From 2ddd9001219ed6e8dec7e87c15207e5ca5f2aec9 Mon Sep 17 00:00:00 2001 From: Charles7c Date: Mon, 22 Apr 2024 20:57:26 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E7=B3=BB=E7=BB=9F=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E9=BB=98=E8=AE=A4=E6=9F=A5=E8=AF=A2=E8=BF=91=207=20?= =?UTF-8?q?=E5=A4=A9=E6=97=A5=E5=BF=97=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/monitor/type.ts | 2 +- src/components/DateRangePicker/index.vue | 8 ++------ src/views/monitor/log/login/index.vue | 11 +++++++++-- src/views/monitor/log/operation/index.vue | 11 +++++++++-- src/views/tool/generator/GenConfigDrawer.vue | 2 +- 5 files changed, 22 insertions(+), 12 deletions(-) diff --git a/src/apis/monitor/type.ts b/src/apis/monitor/type.ts index a4194a5..9f4d9c8 100644 --- a/src/apis/monitor/type.ts +++ b/src/apis/monitor/type.ts @@ -48,7 +48,7 @@ export interface LogQuery { module?: string ip?: string createUserString?: string - createTime?: string + createTime: Array status?: number sort: Array } diff --git a/src/components/DateRangePicker/index.vue b/src/components/DateRangePicker/index.vue index e37d35f..330cc08 100644 --- a/src/components/DateRangePicker/index.vue +++ b/src/components/DateRangePicker/index.vue @@ -13,6 +13,8 @@ import type { ShortcutType } from '@arco-design/web-vue' import dayjs from 'dayjs' +defineOptions({ name: 'DateRangePicker' }) + defineProps({ format: { type: String, @@ -57,10 +59,4 @@ const shortcuts = computed(() => { }) - - diff --git a/src/views/monitor/log/login/index.vue b/src/views/monitor/log/login/index.vue index 018e8f3..84c0be1 100644 --- a/src/views/monitor/log/login/index.vue +++ b/src/views/monitor/log/login/index.vue @@ -49,6 +49,7 @@ import { exportLoginLog, listLog } from '@/apis' import type { TableInstanceColumns } from '@/components/GiTable/type' import DateRangePicker from '@/components/DateRangePicker/index.vue' import { useTable, useDownload } from '@/hooks' +import dayjs from 'dayjs' defineOptions({ name: 'LoginLog' }) @@ -93,7 +94,10 @@ const queryForm = reactive({ module: '登录', ip: undefined, createUserString: undefined, - createTime: undefined, + createTime: [ + dayjs().subtract(6, 'day').startOf('day').format('YYYY-MM-DD HH:mm:ss'), + dayjs().endOf('day').format('YYYY-MM-DD HH:mm:ss') + ], status: undefined, sort: ['createTime,desc'] }) @@ -109,7 +113,10 @@ const { const reset = () => { queryForm.ip = undefined queryForm.createUserString = undefined - queryForm.createTime = undefined + queryForm.createTime = [ + dayjs().subtract(6, 'day').startOf('day').format('YYYY-MM-DD HH:mm:ss'), + dayjs().endOf('day').format('YYYY-MM-DD HH:mm:ss') + ] queryForm.status = undefined search() } diff --git a/src/views/monitor/log/operation/index.vue b/src/views/monitor/log/operation/index.vue index 6302251..dec5c75 100644 --- a/src/views/monitor/log/operation/index.vue +++ b/src/views/monitor/log/operation/index.vue @@ -61,6 +61,7 @@ import type { TableInstanceColumns } from '@/components/GiTable/type' import DateRangePicker from '@/components/DateRangePicker/index.vue' import OperationLogDetailDrawer from './OperationLogDetailDrawer.vue' import { useTable, useDownload } from '@/hooks' +import dayjs from 'dayjs' defineOptions({ name: 'OperationLog' }) @@ -105,7 +106,10 @@ const queryForm = reactive({ description: undefined, ip: undefined, createUserString: undefined, - createTime: undefined, + createTime: [ + dayjs().subtract(6, 'day').startOf('day').format('YYYY-MM-DD HH:mm:ss'), + dayjs().endOf('day').format('YYYY-MM-DD HH:mm:ss') + ], status: undefined, sort: ['createTime,desc'] }) @@ -122,7 +126,10 @@ const reset = () => { queryForm.description = undefined queryForm.ip = undefined queryForm.createUserString = undefined - queryForm.createTime = undefined + queryForm.createTime = [ + dayjs().subtract(6, 'day').startOf('day').format('YYYY-MM-DD HH:mm:ss'), + dayjs().endOf('day').format('YYYY-MM-DD HH:mm:ss') + ] queryForm.status = undefined search() } diff --git a/src/views/tool/generator/GenConfigDrawer.vue b/src/views/tool/generator/GenConfigDrawer.vue index a8edbd5..9f3032b 100644 --- a/src/views/tool/generator/GenConfigDrawer.vue +++ b/src/views/tool/generator/GenConfigDrawer.vue @@ -21,7 +21,7 @@ - +