refactor: 系统日志默认查询近 7 天日志数据

This commit is contained in:
2024-04-22 20:57:26 +08:00
parent 81194dbb52
commit 2ddd900121
5 changed files with 22 additions and 12 deletions

View File

@@ -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()
}