mynews.data.ts
1.7 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
import { BasicColumn, FormSchema } from '/@/components/Table';
import { render } from '/@/utils/common/renderUtils';
export const columns: BasicColumn[] = [
{
title: '标题',
dataIndex: 'titile',
width: 100,
align: 'left',
},
{
title: '消息类型',
dataIndex: 'msgCategory',
width: 80,
customRender: ({ text }) => {
return render.renderDictNative(
text,
[
{ label: '通知公告', value: '1', color: 'blue' },
{ label: '系统消息', value: '2' },
],
true
);
},
},
{
title: '发布人',
dataIndex: 'sender',
width: 80,
},
{
title: '发布时间',
dataIndex: 'sendTime',
width: 80,
},
{
title: '优先级',
dataIndex: 'priority',
width: 80,
customRender: ({ text }) => {
const color = text == 'L' ? 'blue' : text == 'M' ? 'yellow' : 'red';
return render.renderTag(render.renderDict(text, 'priority'), color);
},
},
{
title: '阅读状态',
dataIndex: 'readFlag',
width: 80,
customRender: ({ text }) => {
return render.renderDictNative(
text,
[
{ label: '未读', value: '0', color: 'red' },
{ label: '已读', value: '1' },
],
true
);
},
},
];
export const searchFormSchema: FormSchema[] = [
{
field: 'titile',
label: '标题',
component: 'Input',
colProps: { span: 6 },
},
{
field: 'sender',
label: '发布人',
component: 'Input',
colProps: { span: 6 },
},
{
field: 'sendTime',
label: '发布时间',
component: 'RangeDate',
componentProps: {
valueType: 'Date',
},
colProps: { span: 6 },
},
];