From 9b3c1c4c7a9ae1d9eb5bd0d5f1f83487b45cb9ae Mon Sep 17 00:00:00 2001 From: siyaqi Date: Sat, 7 Jun 2025 17:11:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=85=A8=E5=B1=80=E6=97=A5?= =?UTF-8?q?=E6=9C=9F=E8=BD=AC=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vue-fastapi-frontend/src/main.js | 4 +- vue-fastapi-frontend/src/utils/index.js | 7 ++ .../views/metadataConfig/bizConfig/index.vue | 74 ++++++++++++++++--- 3 files changed, 72 insertions(+), 13 deletions(-) diff --git a/vue-fastapi-frontend/src/main.js b/vue-fastapi-frontend/src/main.js index cdbe97c..fcb424d 100644 --- a/vue-fastapi-frontend/src/main.js +++ b/vue-fastapi-frontend/src/main.js @@ -18,6 +18,7 @@ import useUserStore from '@/store/modules/user' // 注册指令 import plugins from './plugins' // plugins import { download } from '@/utils/request' +import { formatDateTime } from '@/utils/index' // svg图标 import 'virtual:svg-icons-register' @@ -51,7 +52,8 @@ const app = createApp(App) // 全局方法挂载 app.config.globalProperties.useDict = useDict app.config.globalProperties.download = download -app.config.globalProperties.parseTime = parseTime +app.config.globalProperties.download = download +app.config.globalProperties.formatDateTime = formatDateTime app.config.globalProperties.resetForm = resetForm app.config.globalProperties.handleTree = handleTree app.config.globalProperties.addDateRange = addDateRange diff --git a/vue-fastapi-frontend/src/utils/index.js b/vue-fastapi-frontend/src/utils/index.js index 4e65504..a434020 100644 --- a/vue-fastapi-frontend/src/utils/index.js +++ b/vue-fastapi-frontend/src/utils/index.js @@ -76,6 +76,13 @@ export function getQueryObject(url) { }) return obj } +export function formatDateTime(datetime) { + if (!datetime) return '' + const date = new Date(datetime) + const pad = (n) => String(n).padStart(2, '0') + return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())} ` + + `${pad(date.getHours())}:${pad(date.getMinutes())}:${pad(date.getSeconds())}` +} /** * @param {string} input value diff --git a/vue-fastapi-frontend/src/views/metadataConfig/bizConfig/index.vue b/vue-fastapi-frontend/src/views/metadataConfig/bizConfig/index.vue index ca47fc1..17e86ed 100644 --- a/vue-fastapi-frontend/src/views/metadataConfig/bizConfig/index.vue +++ b/vue-fastapi-frontend/src/views/metadataConfig/bizConfig/index.vue @@ -3,11 +3,19 @@ - + - - + + + + + 搜索 @@ -50,18 +58,31 @@ > - + + + - + + + + - + + + - + + + + - - + + @@ -111,9 +145,11 @@