。。。
This commit is contained in:
parent
7f2912d9ad
commit
614f67c85e
|
@ -1,7 +1,5 @@
|
|||
<script setup lang="tsx">
|
||||
import { reactive, onMounted } from "vue";
|
||||
import Draw from "./draw.vue";
|
||||
|
||||
const cdata = reactive({
|
||||
category: [
|
||||
"市区",
|
||||
|
|
|
@ -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%;
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue