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 @@