mirror of
https://github.com/continew-org/continew-admin-ui.git
synced 2025-11-14 03:01:37 +08:00
refactor: 调整 eslint.config.js,优化代码格式
This commit is contained in:
@@ -24,7 +24,7 @@ const router = useRouter()
|
||||
|
||||
const PaneMap: Record<string, Component> = {
|
||||
1: LoginLog,
|
||||
2: OperationLog
|
||||
2: OperationLog,
|
||||
}
|
||||
|
||||
const activeKey = ref('1')
|
||||
@@ -35,7 +35,7 @@ watch(
|
||||
activeKey.value = String(route.query.tabKey)
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
{ immediate: true },
|
||||
)
|
||||
|
||||
const change = (key: string | number) => {
|
||||
|
||||
@@ -57,16 +57,16 @@ const queryForm = reactive<LogQuery>({
|
||||
module: '登录',
|
||||
createTime: [
|
||||
dayjs().subtract(6, 'day').startOf('day').format('YYYY-MM-DD HH:mm:ss'),
|
||||
dayjs().endOf('day').format('YYYY-MM-DD HH:mm:ss')
|
||||
dayjs().endOf('day').format('YYYY-MM-DD HH:mm:ss'),
|
||||
],
|
||||
sort: ['createTime,desc']
|
||||
sort: ['createTime,desc'],
|
||||
})
|
||||
|
||||
const {
|
||||
tableData: dataList,
|
||||
loading,
|
||||
pagination,
|
||||
search
|
||||
search,
|
||||
} = useTable((page) => listLog({ ...queryForm, ...page }), { immediate: true })
|
||||
|
||||
const columns: TableInstanceColumns[] = [
|
||||
@@ -74,7 +74,7 @@ const columns: TableInstanceColumns[] = [
|
||||
title: '序号',
|
||||
width: 66,
|
||||
align: 'center',
|
||||
render: ({ rowIndex }) => h('span', {}, rowIndex + 1 + (pagination.current - 1) * pagination.pageSize)
|
||||
render: ({ rowIndex }) => h('span', {}, rowIndex + 1 + (pagination.current - 1) * pagination.pageSize),
|
||||
},
|
||||
{ title: '登录时间', dataIndex: 'createTime', width: 180 },
|
||||
{ title: '用户昵称', dataIndex: 'createUserString', ellipsis: true, tooltip: true },
|
||||
@@ -87,23 +87,23 @@ const columns: TableInstanceColumns[] = [
|
||||
filters: [
|
||||
{
|
||||
text: '成功',
|
||||
value: '1'
|
||||
value: '1',
|
||||
},
|
||||
{
|
||||
text: '失败',
|
||||
value: '2'
|
||||
}
|
||||
value: '2',
|
||||
},
|
||||
],
|
||||
filter: () => {
|
||||
return true
|
||||
},
|
||||
alignLeft: true
|
||||
}
|
||||
alignLeft: true,
|
||||
},
|
||||
},
|
||||
{ title: '登录 IP', dataIndex: 'ip', ellipsis: true, tooltip: true },
|
||||
{ title: '登录地点', dataIndex: 'address', ellipsis: true, tooltip: true },
|
||||
{ title: '浏览器', dataIndex: 'browser', ellipsis: true, tooltip: true },
|
||||
{ title: '终端系统', dataIndex: 'os', ellipsis: true, tooltip: true }
|
||||
{ title: '终端系统', dataIndex: 'os', ellipsis: true, tooltip: true },
|
||||
]
|
||||
|
||||
// 重置
|
||||
@@ -112,7 +112,7 @@ const reset = () => {
|
||||
queryForm.createUserString = 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')
|
||||
dayjs().endOf('day').format('YYYY-MM-DD HH:mm:ss'),
|
||||
]
|
||||
queryForm.status = undefined
|
||||
search()
|
||||
|
||||
@@ -68,16 +68,16 @@ defineOptions({ name: 'OperationLog' })
|
||||
const queryForm = reactive<LogQuery>({
|
||||
createTime: [
|
||||
dayjs().subtract(6, 'day').startOf('day').format('YYYY-MM-DD HH:mm:ss'),
|
||||
dayjs().endOf('day').format('YYYY-MM-DD HH:mm:ss')
|
||||
dayjs().endOf('day').format('YYYY-MM-DD HH:mm:ss'),
|
||||
],
|
||||
sort: ['createTime,desc']
|
||||
sort: ['createTime,desc'],
|
||||
})
|
||||
|
||||
const {
|
||||
loading,
|
||||
tableData: dataList,
|
||||
pagination,
|
||||
search
|
||||
search,
|
||||
} = useTable((page) => listLog({ ...queryForm, ...page }), { immediate: true })
|
||||
|
||||
const columns: TableInstanceColumns[] = [
|
||||
@@ -85,7 +85,7 @@ const columns: TableInstanceColumns[] = [
|
||||
title: '序号',
|
||||
width: 66,
|
||||
align: 'center',
|
||||
render: ({ rowIndex }) => h('span', {}, rowIndex + 1 + (pagination.current - 1) * pagination.pageSize)
|
||||
render: ({ rowIndex }) => h('span', {}, rowIndex + 1 + (pagination.current - 1) * pagination.pageSize),
|
||||
},
|
||||
{ title: '操作时间', slotName: 'createTime', width: 180 },
|
||||
{ title: '操作人', dataIndex: 'createUserString', ellipsis: true, tooltip: true },
|
||||
@@ -99,22 +99,22 @@ const columns: TableInstanceColumns[] = [
|
||||
filters: [
|
||||
{
|
||||
text: '成功',
|
||||
value: '1'
|
||||
value: '1',
|
||||
},
|
||||
{
|
||||
text: '失败',
|
||||
value: '2'
|
||||
}
|
||||
value: '2',
|
||||
},
|
||||
],
|
||||
filter: () => true,
|
||||
alignLeft: true
|
||||
}
|
||||
alignLeft: true,
|
||||
},
|
||||
},
|
||||
{ title: '操作 IP', dataIndex: 'ip', ellipsis: true, tooltip: true },
|
||||
{ title: '操作地点', dataIndex: 'address', ellipsis: true, tooltip: true },
|
||||
{ title: '耗时', slotName: 'timeTaken', align: 'center' },
|
||||
{ title: '浏览器', dataIndex: 'browser', ellipsis: true, tooltip: true },
|
||||
{ title: '终端系统', dataIndex: 'os', ellipsis: true, tooltip: true }
|
||||
{ title: '终端系统', dataIndex: 'os', ellipsis: true, tooltip: true },
|
||||
]
|
||||
|
||||
// 重置
|
||||
@@ -124,7 +124,7 @@ const reset = () => {
|
||||
queryForm.createUserString = 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')
|
||||
dayjs().endOf('day').format('YYYY-MM-DD HH:mm:ss'),
|
||||
]
|
||||
queryForm.status = undefined
|
||||
search()
|
||||
|
||||
@@ -61,14 +61,14 @@ const userStore = useUserStore()
|
||||
const currentToken = userStore.token
|
||||
|
||||
const queryForm = reactive<OnlineUserQuery>({
|
||||
sort: ['createTime,desc']
|
||||
sort: ['createTime,desc'],
|
||||
})
|
||||
|
||||
const {
|
||||
tableData: dataList,
|
||||
loading,
|
||||
pagination,
|
||||
search
|
||||
search,
|
||||
} = useTable((page) => listOnlineUser({ ...queryForm, ...page }), { immediate: true })
|
||||
|
||||
const columns: TableInstanceColumns[] = [
|
||||
@@ -76,7 +76,7 @@ const columns: TableInstanceColumns[] = [
|
||||
title: '序号',
|
||||
width: 66,
|
||||
align: 'center',
|
||||
render: ({ rowIndex }) => h('span', {}, rowIndex + 1 + (pagination.current - 1) * pagination.pageSize)
|
||||
render: ({ rowIndex }) => h('span', {}, rowIndex + 1 + (pagination.current - 1) * pagination.pageSize),
|
||||
},
|
||||
{ title: '用户昵称', slotName: 'nickname', ellipsis: true, tooltip: true },
|
||||
{ title: '登录 IP', dataIndex: 'ip', ellipsis: true, tooltip: true },
|
||||
@@ -90,8 +90,8 @@ const columns: TableInstanceColumns[] = [
|
||||
slotName: 'action',
|
||||
align: 'center',
|
||||
fixed: !isMobile() ? 'right' : undefined,
|
||||
show: has.hasPermOr(['monitor:online:kickout'])
|
||||
}
|
||||
show: has.hasPermOr(['monitor:online:kickout']),
|
||||
},
|
||||
]
|
||||
|
||||
// 重置
|
||||
|
||||
Reference in New Issue
Block a user