Skip to content

Commit

Permalink
refactor: 系统日志默认查询近 7 天日志数据
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles7c committed Apr 22, 2024
1 parent 81194db commit 2ddd900
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/apis/monitor/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export interface LogQuery {
module?: string
ip?: string
createUserString?: string
createTime?: string
createTime: Array<string>
status?: number
sort: Array<string>
}
Expand Down
8 changes: 2 additions & 6 deletions src/components/DateRangePicker/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
import type { ShortcutType } from '@arco-design/web-vue'
import dayjs from 'dayjs'
defineOptions({ name: 'DateRangePicker' })
defineProps({
format: {
type: String,
Expand Down Expand Up @@ -57,10 +59,4 @@ const shortcuts = computed<ShortcutType[]>(() => {
})
</script>

<script lang="ts">
export default {
name: 'DateRangePicker'
}
</script>

<style scoped lang="less"></style>
11 changes: 9 additions & 2 deletions src/views/monitor/log/login/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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' })
Expand Down Expand Up @@ -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']
})
Expand All @@ -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()
}
Expand Down
11 changes: 9 additions & 2 deletions src/views/monitor/log/operation/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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' })
Expand Down Expand Up @@ -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']
})
Expand All @@ -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()
}
Expand Down
2 changes: 1 addition & 1 deletion src/views/tool/generator/GenConfigDrawer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<a-input v-model="form.moduleName" placeholder="项目模块名称,例如:continew-admin-system" />
</a-form-item>
<a-form-item label="模块包名" field="packageName">
<a-input v-model="form.packageName" placeholder="项目模块包名,例如:top.charles7c.continew.admin.system" />
<a-input v-model="form.packageName" placeholder="项目模块包名,例如:top.continew.admin.system" />
</a-form-item>
<a-form-item label="去表前缀" field="tablePrefix">
<a-input v-model="form.tablePrefix" placeholder="数据库表前缀,例如:sys_" />
Expand Down

0 comments on commit 2ddd900

Please sign in to comment.