data.ts
1.95 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
import { FormSchema } from '/@/components/Form';
import { deviceConfigGetRuleChain } from '/@/api/device/deviceConfigApi';
import { findDictItemByCode } from '/@/api/system/dict';
export const step1Schemas: FormSchema[] = [
{
field: 'name',
label: '上传图片',
component: 'Input',
slot: 'imageSelect',
},
{
field: 'name',
label: '配置名称',
required: true,
component: 'Input',
componentProps: {
maxLength: 255,
placeholder: '请输入配置名称',
},
},
{
field: 'defaultRuleChainId',
label: '规则链',
component: 'ApiSelect',
componentProps: {
api: async () => {
const data = await deviceConfigGetRuleChain();
const returnData = data.map((m) => {
return {
getValueField: m.name,
getKeyField: m.id.id,
};
});
return returnData;
},
labelField: 'getValueField',
valueField: 'getKeyField',
immediate: true,
},
},
{
field: 'defaultQueueName',
label: '处理队列',
component: 'ApiSelect',
componentProps: {
api: findDictItemByCode,
params: {
dictCode: 'queen_execute_sequence',
},
labelField: 'itemText',
valueField: 'itemValue',
resultField: 'items',
},
},
{
label: '描述',
field: 'description',
component: 'InputTextArea',
componentProps: {
maxLength: 255,
placeholder: '请输入描述',
},
},
];
export const step2Schemas: FormSchema[] = [
{
field: 'transportType',
component: 'Select',
label: '传输方式',
defaultValue: 'DEFAULT',
componentProps() {
return {
options: [
{ label: '默认', value: 'DEFAULT' },
{ label: 'MQTT', value: 'MQTT' },
{ label: 'CoAP', value: 'COAP' },
// { label: 'LWM2M', value: 'LWM2M' },
],
onChange(e) {},
};
},
colProps: { span: 11 },
},
];