。。。

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"> <script setup lang="tsx">
import { reactive, onMounted } from "vue";
import Draw from "./draw.vue"; import Draw from "./draw.vue";
const cdata = reactive({ const cdata = reactive({
category: [ category: [
"市区", "市区",

View File

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

View File

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