Commit 3d8385fb authored by shuiluo's avatar shuiluo

feat: 登录日志完成

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