From 343c83b185f43ed77976b95a50242786d411a1e8 Mon Sep 17 00:00:00 2001 From: BTMuli Date: Fri, 1 Sep 2023 16:55:43 +0800 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E8=B0=83=E6=95=B4=EF=BC=8C=E6=85=A2=E6=85=A2=E6=94=B9=E5=90=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 14 ++---- src/assets/index.css | 26 +++++++++- src/assets/themes/dark.css | 17 +++++-- src/assets/themes/default.css | 17 +++++-- src/components/{main => app}/t-backTop.vue | 0 src/components/{main => app}/t-sidebar.vue | 8 +--- .../{main => app}/t-switchTheme.vue | 0 src/components/{main => home}/t-calendar.vue | 6 +-- src/components/{main => home}/t-pool.vue | 48 ++++++------------- src/components/{main => home}/t-position.vue | 21 ++------ src/pages/common/Home.vue | 17 +++++-- src/utils/toolFunc.ts | 21 ++++++++ src/views/t-anno-json.vue | 2 +- src/views/t-anno.vue | 2 +- src/views/t-lottery.vue | 2 +- src/views/t-post-json.vue | 2 +- src/views/t-post.vue | 2 +- 17 files changed, 119 insertions(+), 86 deletions(-) rename src/components/{main => app}/t-backTop.vue (100%) rename src/components/{main => app}/t-sidebar.vue (98%) rename src/components/{main => app}/t-switchTheme.vue (100%) rename src/components/{main => home}/t-calendar.vue (97%) rename src/components/{main => home}/t-pool.vue (83%) rename src/components/{main => home}/t-position.vue (86%) create mode 100644 src/utils/toolFunc.ts diff --git a/src/App.vue b/src/App.vue index 31486755..8848cd18 100644 --- a/src/App.vue +++ b/src/App.vue @@ -13,8 +13,8 @@ + diff --git a/src/utils/toolFunc.ts b/src/utils/toolFunc.ts new file mode 100644 index 00000000..0052bea8 --- /dev/null +++ b/src/utils/toolFunc.ts @@ -0,0 +1,21 @@ +/** + * @file utils toolFunc.ts + * @description 一些工具函数 + * @author BTMuli + * @since Beta v0.3.0 + */ + +/** + * @description 时间戳转换为时间字符串 + * @returns {string} 时间字符串 d天 hh:mm:ss + * @param time + */ +export function stamp2LastTime(time: number): string { + const day = Math.floor(time / (24 * 3600 * 1000)); + const hour = Math.floor((time % (24 * 3600 * 1000)) / (3600 * 1000)); + const minute = Math.floor((time % (3600 * 1000)) / (60 * 1000)); + const second = Math.floor((time % (60 * 1000)) / 1000); + return `${day === 0 ? "" : `${day}天`} ${hour.toFixed(0).padStart(2, "0")}:${minute + .toFixed(0) + .padStart(2, "0")}:${second.toFixed(0).padStart(2, "0")}`; +} diff --git a/src/views/t-anno-json.vue b/src/views/t-anno-json.vue index f270587a..f8c05d6d 100644 --- a/src/views/t-anno-json.vue +++ b/src/views/t-anno-json.vue @@ -14,7 +14,7 @@ import { ref, onMounted, reactive } from "vue"; import { useRoute } from "vue-router"; import JsonViewer from "vue-json-viewer"; import ToLoading from "../components/overlay/to-loading.vue"; -import TSwitchTheme from "../components/main/t-switchTheme.vue"; +import TSwitchTheme from "../components/app/t-switchTheme.vue"; // tauri import { appWindow } from "@tauri-apps/api/window"; // utils diff --git a/src/views/t-anno.vue b/src/views/t-anno.vue index edd646a0..6d52f00e 100644 --- a/src/views/t-anno.vue +++ b/src/views/t-anno.vue @@ -24,7 +24,7 @@ import { ref, onMounted, watch } from "vue"; import { useRoute } from "vue-router"; import ToLoading from "../components/overlay/to-loading.vue"; -import TSwitchTheme from "../components/main/t-switchTheme.vue"; +import TSwitchTheme from "../components/app/t-switchTheme.vue"; import TShareBtn from "../components/main/t-shareBtn.vue"; // tauri import { appWindow } from "@tauri-apps/api/window"; diff --git a/src/views/t-lottery.vue b/src/views/t-lottery.vue index d7814947..6792fcea 100644 --- a/src/views/t-lottery.vue +++ b/src/views/t-lottery.vue @@ -57,7 +57,7 @@ import { computed, onMounted, onUpdated, reactive, ref } from "vue"; import { useRoute } from "vue-router"; import JsonViewer from "vue-json-viewer"; import ToLoading from "../components/overlay/to-loading.vue"; -import TSwitchTheme from "../components/main/t-switchTheme.vue"; +import TSwitchTheme from "../components/app/t-switchTheme.vue"; // tauri import { appWindow } from "@tauri-apps/api/window"; // store diff --git a/src/views/t-post-json.vue b/src/views/t-post-json.vue index 04a8a3e2..9dbd954e 100644 --- a/src/views/t-post-json.vue +++ b/src/views/t-post-json.vue @@ -12,7 +12,7 @@ import { ref, onMounted, reactive } from "vue"; import { useRoute } from "vue-router"; import JsonViewer from "vue-json-viewer"; import ToLoading from "../components/overlay/to-loading.vue"; -import TSwitchTheme from "../components/main/t-switchTheme.vue"; +import TSwitchTheme from "../components/app/t-switchTheme.vue"; // tauri import { appWindow } from "@tauri-apps/api/window"; // plugins diff --git a/src/views/t-post.vue b/src/views/t-post.vue index ced2e750..c0732fdb 100644 --- a/src/views/t-post.vue +++ b/src/views/t-post.vue @@ -24,7 +24,7 @@ import { ref, onMounted, watch } from "vue"; import { useRoute } from "vue-router"; import ToLoading from "../components/overlay/to-loading.vue"; -import TSwitchTheme from "../components/main/t-switchTheme.vue"; +import TSwitchTheme from "../components/app/t-switchTheme.vue"; import TShareBtn from "../components/main/t-shareBtn.vue"; // tauri import { appWindow } from "@tauri-apps/api/window";