config.data.ts
2.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
import { BasicColumn, FormSchema } from '/@/components/Table';
import moment from 'moment';
import { format } from '../util';
import { h } from 'vue';
import { Tag } from 'ant-design-vue';
import { useI18n } from '/@/hooks/web/useI18n';
const { t } = useI18n();
// 表格数据
export const columns: BasicColumn[] = [
{
title: t('log.exception.table.tenantName'),
dataIndex: 'tenantName',
width: 120,
},
{
title: t('log.operate.table.entityName'),
dataIndex: 'entityName',
width: 180,
},
{
title: t('log.operate.table.operators'),
dataIndex: 'userName',
width: 180,
},
{
title: t('log.operate.table.operationStatus'),
dataIndex: 'actionStatus',
width: 180,
customRender: ({ record }) => {
const status = record.actionStatus;
const enable = status === 'SUCCESS' ? '成功' : '失败';
const color = enable === '成功' ? 'green' : 'red';
const text = enable === '成功' ? '成功' : '失败';
return h(Tag, { color }, () => text);
},
},
{
title: t('log.operate.table.operationTime'),
dataIndex: 'createdTime',
width: 180,
format: (_, record) => {
return format(record.createdTime, 'yyyy-MM-dd HH:mm:ss');
},
},
];
// 分页查询
export const searchFormSchema: FormSchema[] = [
{
field: 'queryTime',
label: t('log.operate.search.time'),
component: 'RangePicker',
componentProps: {
showTime: {
defaultValue: [moment('00:00:00', 'HH:mm:ss'), moment('23:59:59', 'HH:mm:ss')],
},
},
colProps: { span: 6 },
},
];
// 详情配置
export const formSchema: FormSchema[] = [
{
field: 'createdTime',
label: t('log.operate.search.time'),
component: 'Input',
componentProps: {
disabled: true,
},
},
{
field: 'tenantName',
label: t('log.operate.table.tenantName'),
component: 'Input',
componentProps: {
disabled: true,
},
},
{
field: 'entityName',
label: t('log.operate.table.entityName'),
component: 'Input',
componentProps: {
disabled: true,
},
},
{
field: 'userName',
label: t('log.operate.table.operators'),
colProps: { span: 24 },
component: 'Input',
componentProps: {
disabled: true,
},
},
{
field: 'actionStatus',
label: t('log.operate.table.operationStatus'),
component: 'Input',
componentProps: {
disabled: true,
},
},
{
field: 'actionData',
label: t('log.operate.operationalData'),
component: 'InputTextArea',
componentProps: {
disabled: true,
autosize: true,
allowClear: false,
},
},
{
field: 'actionFailureDetails',
label: t('log.operate.failureInformation'),
component: 'InputTextArea',
componentProps: {
disabled: true,
autosize: true,
allowClear: false,
},
},
];