config.data.ts
1.83 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 type { BasicColumn } from '/@/components/Table';
import type { FormSchema } from '/@/components/Table';
import { getOrganizationList } from '/@/api/system/system';
import { copyTransFun } from '/@/utils/fnUtils';
import { getDeviceProfile } from '/@/api/alarm/position';
export const formSchema: FormSchema[] = [
{
field: 'organizationId',
label: '',
component: 'ApiTreeSelect',
componentProps: {
api: async () => {
const data = await getOrganizationList();
copyTransFun(data as any as any[]);
return data;
},
},
},
{
field: 'profileId',
label: '',
component: 'ApiSelect',
componentProps: {
api: getDeviceProfile,
placeholder: '请选择设备配置',
labelField: 'name',
valueField: 'id',
},
},
{
field: 'name',
label: '',
component: 'Input',
componentProps: {
placeholder: '请输入设备名称',
},
},
{
field: 'deviceState',
label: '',
component: 'RadioGroup',
componentProps: {
size: 'small',
options: [
{ label: '全部', value: '' },
{ label: '待激活', value: 'INACTIVE' },
{ label: '在线', value: 'ONLINE' },
{ label: '离线', value: 'OFFLINE' },
],
},
},
{
field: 'alarmStatus',
label: '是否告警',
component: 'RadioGroup',
labelWidth: '85px',
componentProps: {
size: 'small',
options: [
{ label: '是', value: '1' },
{ label: '否', value: '0' },
],
},
},
];
export const columns: BasicColumn[] = [
{
title: '名称',
dataIndex: 'name',
width: 100,
},
{
title: '位置',
dataIndex: 'deviceInfo.address',
width: 100,
},
{
title: '状态',
dataIndex: 'deviceState',
width: 100,
slots: { customRender: 'deviceState' },
},
];