|
|
@@ -12,112 +12,157 @@
|
|
|
:cache-key="cacheKeyUrl"
|
|
|
:page-size="this.$store.state.tablePageSize"
|
|
|
>
|
|
|
-
|
|
|
<template v-slot:type="{ row }">
|
|
|
- {{types[row.type]}}
|
|
|
+ {{ types[row.type] }}
|
|
|
</template>
|
|
|
|
|
|
<template v-slot:tableHeaderTitle="{ column }">
|
|
|
- <span style="display: inline-block;text-align: center; width: 100%;">{{column.label}}</span>
|
|
|
+ <span
|
|
|
+ style="display: inline-block; text-align: center; width: 100%"
|
|
|
+ >{{ column.label }}</span
|
|
|
+ >
|
|
|
</template>
|
|
|
</ele-pro-table>
|
|
|
</el-card>
|
|
|
-
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import tabMixins from '@/mixins/tableColumnsMixin';
|
|
|
-import search from "./components/search.vue";
|
|
|
+ import tabMixins from '@/mixins/tableColumnsMixin';
|
|
|
+ import search from './components/search.vue';
|
|
|
|
|
|
-import {deepClone} from "@/utils";
|
|
|
-import {operateLogPageAPI} from "@/api/system/operationLog/api";
|
|
|
+ import { deepClone } from '@/utils';
|
|
|
+ import { operateLogPageAPI } from '@/api/system/operationLog/api';
|
|
|
|
|
|
-export default {
|
|
|
- name: 'index',
|
|
|
- mixins: [tabMixins],
|
|
|
-components:{search},
|
|
|
- data() {
|
|
|
- return {
|
|
|
- // 表格列配置
|
|
|
- columns: [
|
|
|
- {
|
|
|
- columnKey: 'index',
|
|
|
- label: '序号',
|
|
|
- type: 'index',
|
|
|
- width: 55,
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- fixed: 'left'
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'userName',
|
|
|
- label: '用户名称',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- width: 120
|
|
|
- },
|
|
|
- {
|
|
|
- prop: ' type',
|
|
|
- label: '日志类型',
|
|
|
- align: 'center',
|
|
|
- slot: 'type',
|
|
|
- showOverflowTooltip: true,
|
|
|
- width: 120
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'dateTime',
|
|
|
- label: '操作时间',
|
|
|
- minWidth: 100,
|
|
|
- slot: 'dateTime',
|
|
|
- align: 'center',
|
|
|
- headerSlot: 'tableHeaderTitle',
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'ip',
|
|
|
- label: 'IP地址',
|
|
|
- minWidth: 100,
|
|
|
- align: 'center',
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'tag',
|
|
|
- label: '操作菜单',
|
|
|
- minWidth: 100,
|
|
|
- align: 'center',
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'description',
|
|
|
- label: '操作描述',
|
|
|
- minWidth: 100,
|
|
|
- align: 'center',
|
|
|
+ export default {
|
|
|
+ name: 'index',
|
|
|
+ mixins: [tabMixins],
|
|
|
+ components: { search },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ // 表格列配置
|
|
|
+ columns: [
|
|
|
+ {
|
|
|
+ columnKey: 'index',
|
|
|
+ label: '序号',
|
|
|
+ type: 'index',
|
|
|
+ width: 55,
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ fixed: 'left'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'userName',
|
|
|
+ label: '用户名称',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ width: 100
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: ' type',
|
|
|
+ label: '日志类型',
|
|
|
+ align: 'center',
|
|
|
+ slot: 'type',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ width: 150
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ {
|
|
|
+ prop: 'ip',
|
|
|
+ label: 'IP地址',
|
|
|
+ width: 100,
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'tag',
|
|
|
+ label: '操作菜单',
|
|
|
+ width: 100,
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'operationType',
|
|
|
+ label: '操作类型',
|
|
|
+ width: 100,
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'description',
|
|
|
+ label: '操作描述',
|
|
|
+ minWidth: 100,
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'changeDetail',
|
|
|
+ label: '变更内容',
|
|
|
+ minWidth: 100,
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ formatter(row) {
|
|
|
+ if (row.changeDetail) {
|
|
|
+ let data = JSON.parse(row.changeDetail);
|
|
|
+ return JSON.stringify(data.changeColumns)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'method',
|
|
|
+ label: '访问接口',
|
|
|
+ minWidth: 100,
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'request',
|
|
|
+ label: '请求参数',
|
|
|
+ minWidth: 100,
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'response',
|
|
|
+ label: '返回参数',
|
|
|
+ minWidth: 100,
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'operationTime',
|
|
|
+ label: '接口响应时长(ms)',
|
|
|
+ width: 150,
|
|
|
+ align: 'center',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'createTime',
|
|
|
+ label: '操作时间',
|
|
|
+ width: 180,
|
|
|
+ slot: 'createTime',
|
|
|
+ align: 'center',
|
|
|
+ headerSlot: 'tableHeaderTitle'
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ types: {
|
|
|
+ 0: '常规日志',
|
|
|
+ 1: '系统管理操作日志',
|
|
|
+ 2: '系统安全操作日志',
|
|
|
+ 3: '系统审计操作日志'
|
|
|
},
|
|
|
- {
|
|
|
- prop: 'api',
|
|
|
- label: '访问接口',
|
|
|
- minWidth: 100,
|
|
|
- align: 'center',
|
|
|
- }
|
|
|
- ],
|
|
|
- types:{
|
|
|
- 0:'常规日志',
|
|
|
- 1:'系统管理操作日志',
|
|
|
- 2:'系统安全操作日志',
|
|
|
- 3:'系统审计操作日志',
|
|
|
- },
|
|
|
- cacheKeyUrl: '19f94758-operationLog',
|
|
|
- };
|
|
|
- },
|
|
|
- created() {
|
|
|
- },
|
|
|
- methods: {
|
|
|
- /* 表格数据源 */
|
|
|
- datasource({page, limit, where, order}) {
|
|
|
- return operateLogPageAPI({pageNum: page, size: limit, ...where});
|
|
|
- },
|
|
|
- /* 刷新表格 */
|
|
|
- reload(where) {
|
|
|
- this.$refs.table.reload({page: 1, where});
|
|
|
+ cacheKeyUrl: '19f94758-operationLog'
|
|
|
+ };
|
|
|
},
|
|
|
- }
|
|
|
-};
|
|
|
+ created() {},
|
|
|
+ methods: {
|
|
|
+ /* 表格数据源 */
|
|
|
+ datasource({ page, limit, where, order }) {
|
|
|
+ return operateLogPageAPI({ pageNum: page, size: limit, ...where });
|
|
|
+ },
|
|
|
+ /* 刷新表格 */
|
|
|
+ reload(where) {
|
|
|
+ this.$refs.table.reload({ page: 1, where });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
</script>
|