Commit 3d8385fb authored by shuiluo's avatar shuiluo

feat: 登录日志完成

parent d7d2f4bf
...@@ -32,4 +32,14 @@ export default { ...@@ -32,4 +32,14 @@ export default {
'task.invalidTip': ['确认是否失效', 'Confirm Whether To Disable It'], 'task.invalidTip': ['确认是否失效', 'Confirm Whether To Disable It'],
'task.taskNameError': ['请输入 @:system.jobName', 'Please Input @:system.jobName'], 'task.taskNameError': ['请输入 @:system.jobName', 'Please Input @:system.jobName'],
'task.taskRuleError': ['请输入 @:task.schedulingRules', 'Please Input @:task.schedulingRules'], 'task.taskRuleError': ['请输入 @:task.schedulingRules', 'Please Input @:task.schedulingRules'],
'log.loginIp': ['登录IP', 'LoginIp'],
'log.loginUser': ['登录用户', 'LoginUser'],
'log.eventType': ['事件类型', 'EventType'],
'log.login': ['登录系统', 'Login'],
'log.logout': ['退出系统', 'Logout'],
'log.eventStatus': ['事件状态', 'EventStatus'],
fail: ['失败', 'Fail'],
success: ['成功', 'success'],
'log.userId': ['用户Id', 'UserId'],
'log.loginTime': ['登录时间', 'LoginTime']
}; };
<template> <template>
<my-table url="/api/v1/logger/login" rowKey="logId" ref="table"> <Table url="/api/v1/logger/login" rowKey="logId">
<template #search="{query}"> <template #search="{ query }">
<my-form-item label="开始时间"> <MoreItem :label="$t('select.startTime')">
<a-date-picker <a-date-picker
class="tw-w-full" class="tw-w-full"
show-time show-time
v-model="query.startTime" v-model="query.startTime"
valueFormat="YYYY-MM-DD HH:mm:ss" valueFormat="YYYY-MM-DD HH:mm:ss"
/> />
</my-form-item> </MoreItem>
<my-form-item label="结束时间"> <MoreItem :label="$t('select.endTime')">
<a-date-picker <a-date-picker
class="tw-w-full" class="tw-w-full"
show-time show-time
v-model="query.endTime" v-model="query.endTime"
valueFormat="YYYY-MM-DD HH:mm:ss" valueFormat="YYYY-MM-DD HH:mm:ss"
/> />
</my-form-item> </MoreItem>
<my-form-item label="登录用户"> <MoreItem :label="$t('log.loginUser')">
<a-input v-model="query.userId" /> <a-input v-model="query.userId" />
</my-form-item> </MoreItem>
<my-form-item label="登录IP"> <MoreItem :label="$t('log.loginIp')">
<a-input v-model="query.loginIp" /> <a-input v-model="query.loginIp" />
</my-form-item> </MoreItem>
<my-form-item label="事件类型"> </template>
<template #moreSearch="{ query }">
<MoreItem :label="$t('log.eventType')">
<a-select v-model="query.loginType" allowClear> <a-select v-model="query.loginType" allowClear>
<a-select-option value="LOGIN">登录系统</a-select-option> <a-select-option value="LOGIN">{{ $t('log.login') }}</a-select-option>
<a-select-option value="LOGOUT">退出系统</a-select-option> <a-select-option value="LOGOUT">{{ $t('log.logout') }}</a-select-option>
</a-select> </a-select>
</my-form-item> </MoreItem>
<my-form-item label="事件状态"> <MoreItem :label="$t('log.eventStatus')">
<a-select v-model="query.isSuccess" allowClear> <a-select v-model="query.isSuccess" allowClear>
<a-select-option value="0">失败</a-select-option> <a-select-option value="0">{{ $t('fail') }}</a-select-option>
<a-select-option value="1">成功</a-select-option> <a-select-option value="1">{{ $t('success') }}</a-select-option>
</a-select> </a-select>
</my-form-item> </MoreItem>
</template> </template>
<a-table-column title="用户Id" data-index="userId" />
<a-table-column title="登录用户" data-index="userName" /> <a-table-column :title="$t('log.userId')" data-index="userId" />
<a-table-column title="登录IP" data-index="loginIp" /> <a-table-column :title="$t('log.loginUser')" data-index="userName" />
<a-table-column title="事件类型" data-index="loginTypeName" /> <a-table-column :title="$t('log.loginIp')" data-index="loginIp" />
<a-table-column title="事件状态" data-index="isSuccessName" /> <a-table-column :title="$t('log.eventType')" data-index="loginTypeName" />
<a-table-column title="登录时间" data-index="loginTime" /> <a-table-column :title="$t('log.eventStatus')" data-index="isSuccessName" />
<a-table-column title="说明" data-index="logResultContent" /> <a-table-column :title="$t('log.loginTime')" data-index="loginTime" />
</my-table> <a-table-column :title="$t('table.remark')" data-index="logResultContent" />
</Table>
</template> </template>
<script> <script>
import { Table, MoreItem } from '@/components/table';
export default { export default {
data() { components: { Table, MoreItem },
return {};
},
methods: {
refreshTable() {
this.$refs.table.getData();
},
showDrawer(type, noFooter) {
this.$refs['table'].show({ type, noFooter });
},
},
}; };
</script> </script>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment