。。。

This commit is contained in:
TimSpan 2025-05-13 16:40:35 +08:00
parent 7f2912d9ad
commit 614f67c85e
3 changed files with 16 additions and 22 deletions

View File

@ -1,7 +1,5 @@
<script setup lang="tsx">
import { reactive, onMounted } from "vue";
import Draw from "./draw.vue";
const cdata = reactive({
category: [
"市区",

View File

@ -109,7 +109,6 @@
import { WEEK } from "./constant/index";
import useDraw from "./utils/useDraw.ts";
import { title, subtitle, moduleInfo } from "./constant/index";
//
import BottomLeft from "./components/bottomLeft/index.vue";
import CenterRight2 from "./components/centerRight2/index.vue";
@ -174,7 +173,6 @@
box-sizing: border-box;
}
.app {
box-sizing: border-box;
width: 100vw;
height: 100vh;
background-color: #020308;
@ -183,13 +181,11 @@
color: #d3d6dd;
width: 1920px;
height: 1080px;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
transform-origin: left top;
/* transform-origin: center center; */
.bg {
width: 100%;
height: 100%;

View File

@ -7,30 +7,30 @@ export const formatTime = (
time: string | number | Date,
fmt: string
): string => {
if (!time) return ''
const date = new Date(time)
if (!time) return "";
const date = new Date(time);
const o = {
'M+': date.getMonth() + 1,
'd+': date.getDate(),
'H+': date.getHours(),
'm+': date.getMinutes(),
's+': date.getSeconds(),
'q+': Math.floor((date.getMonth() + 3) / 3),
"M+": date.getMonth() + 1,
"d+": date.getDate(),
"H+": date.getHours(),
"m+": date.getMinutes(),
"s+": date.getSeconds(),
"q+": Math.floor((date.getMonth() + 3) / 3),
S: date.getMilliseconds(),
}
};
if (/(y+)/.test(fmt))
fmt = fmt.replace(
RegExp.$1,
(date.getFullYear() + '').substr(4 - RegExp.$1.length)
)
(date.getFullYear() + "").substr(4 - RegExp.$1.length)
);
for (const k in o) {
if (new RegExp('(' + k + ')').test(fmt)) {
if (new RegExp("(" + k + ")").test(fmt)) {
fmt = fmt.replace(
RegExp.$1,
// @ts-ignore: Unreachable code error
RegExp.$1.length === 1 ? o[k] : ('00' + o[k]).substr(('' + o[k]).length)
)
RegExp.$1.length === 1 ? o[k] : ("00" + o[k]).substr(("" + o[k]).length)
);
}
}
return fmt
}
return fmt;
};