首页概览数据

This commit is contained in:
禺狨
2023-03-23 10:49:47 +08:00
parent 20e64cd56c
commit e7be30c700
4 changed files with 147 additions and 94 deletions

View File

@@ -18,6 +18,24 @@ export function dateFormat(dateStr: string) {
return moment(dateStr).format("YYYY-MM-DD HH:mm");
}
export function timeFormat(dateStr: number) {
var d = moment.duration(dateStr, "seconds");
let value =
Math.floor(d.asDays()) +
"天" +
d.hours() +
"时" +
d.minutes() +
"分" +
d.seconds() +
"秒";
if (Math.floor(d.asDays()) === 0) {
value = d.hours() + "时" + d.minutes() + "分" + d.seconds() + "秒";
}
return value;
}
export function generateUUID(): string {
let guid = "";
for (let i = 1; i <= 32; i++) {