Commit 4b216178 authored by shuiluo's avatar shuiluo

feat: 操作日志完成

parent 3d8385fb
...@@ -41,5 +41,8 @@ export default { ...@@ -41,5 +41,8 @@ export default {
fail: ['失败', 'Fail'], fail: ['失败', 'Fail'],
success: ['成功', 'success'], success: ['成功', 'success'],
'log.userId': ['用户Id', 'UserId'], 'log.userId': ['用户Id', 'UserId'],
'log.loginTime': ['登录时间', 'LoginTime'] 'log.loginTime': ['登录时间', 'LoginTime'],
'log.businessModule': ['业务模块', 'Business Module'],
'log.operationService': ['操作服务', 'Operation Service'],
'log.operateTime': ['操作时间', 'Operate Time'],
}; };
<template> <template>
<pre>{{ data.operateContent }}</pre> <Wraper :hidden="hidden" noFooter>
<pre>{{ row ? row.operateContent : '' }}</pre>
</Wraper>
</template> </template>
<script> <script>
import { WraperMixins } from '@/components/table';
export default { export default {
props: ['data'], mixins: [WraperMixins],
}; };
</script> </script>
<template> <template>
<my-table url="/api/v1/logger/operation" rowKey="logId" ref="table"> <Table url="/api/v1/logger/operation" rowKey="logId" :buttons="buttons" ref="table">
<template #drawer> <template #drawer="drawer">
<Form :data="currentClickRow" /> <Form v-bind="drawer" />
</template> </template>
<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="操作用户Id"> <MoreItem :label="$t('log.userId')">
<a-input v-model="query.operatorId" /> <a-input v-model="query.operatorId" :placeholder="$t('input.placeholder')" />
</my-form-item> </MoreItem>
<my-form-item label="业务模块"> <MoreItem :label="$t('log.businessModule')">
<a-select v-model="query.loginType" allowClear> <a-select v-model="query.loginType" allowClear :placeholder="$t('select.placeholder')">
<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="操作服务"> </template>
<a-select v-model="query.isSuccess" allowClear> <template #moreSearch="{ query }">
<MoreItem :label="$t('log.operationService')">
<a-select v-model="query.isSuccess" allowClear :placeholder="$t('select.placeholder')">
<a-select-option value="0">失败</a-select-option> <a-select-option value="0">失败</a-select-option>
<a-select-option value="1">成功</a-select-option> <a-select-option value="1">成功</a-select-option>
</a-select> </a-select>
</my-form-item> </MoreItem>
</template>
<a-table-column title="用户Id" data-index="operatorId" />
<a-table-column title="用户名称" data-index="operatorName" />
<a-table-column title="业务模块" data-index="moduleCode" />
<a-table-column title="操作服务" data-index="serviceCode" />
<a-table-column title="操作时间" data-index="operateTime" />
<a-table-column title="操作">
<template #default="row">
<a @click="() => view(row)">详情</a>
</template> </template>
</a-table-column> <a-table-column :title="$t('log.userId')" data-index="operatorId" />
</my-table> <a-table-column :title="$t('user.name')" data-index="operatorName" />
<a-table-column :title="$t('log.businessModule')" data-index="moduleCode" />
<a-table-column :title="$t('log.operationService')" data-index="serviceCode" />
<a-table-column :title="$t('log.operateTime')" data-index="operateTime" />
</Table>
</template> </template>
<script> <script>
import Form from './form.vue'; import Form from './form.vue';
import { Table, MoreItem } from '@/components/table';
export default { export default {
components: { Form }, components: { Form, Table, MoreItem },
data() { data() {
return { return {
currentClickRow: {}, buttons: [
{
label: this.$t('table.view'),
click: this.view,
},
],
}; };
}, },
methods: { methods: {
showDrawer(type, noFooter) {
this.$refs['table'].show({ type, noFooter });
},
view(row) { view(row) {
this.currentClickRow = row; this.$refs['table'].show({ row, title: this.$t('table.view') });
this.showDrawer(2, true);
}, },
}, },
}; };
......
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