Commit 8919a212b99e1599883664f4b64487cc156f9cac
1 parent
c2544ad5
feat: device list create new device add code field
Showing
1 changed file
with
20 additions
and
3 deletions
@@ -34,6 +34,12 @@ export const step1Schemas: FormSchema[] = [ | @@ -34,6 +34,12 @@ export const step1Schemas: FormSchema[] = [ | ||
34 | slot: 'snCode', | 34 | slot: 'snCode', |
35 | }, | 35 | }, |
36 | { | 36 | { |
37 | + field: 'transportType', | ||
38 | + label: '类型', | ||
39 | + component: 'Input', | ||
40 | + show: false, | ||
41 | + }, | ||
42 | + { | ||
37 | field: 'profileId', | 43 | field: 'profileId', |
38 | label: '所属产品', | 44 | label: '所属产品', |
39 | required: true, | 45 | required: true, |
@@ -44,9 +50,9 @@ export const step1Schemas: FormSchema[] = [ | @@ -44,9 +50,9 @@ export const step1Schemas: FormSchema[] = [ | ||
44 | api: deviceProfile, | 50 | api: deviceProfile, |
45 | labelField: 'name', | 51 | labelField: 'name', |
46 | valueField: 'tbProfileId', | 52 | valueField: 'tbProfileId', |
47 | - onChange(_value: string, option: { deviceType: string }) { | ||
48 | - const { deviceType } = option; | ||
49 | - setFieldsValue({ deviceType: deviceType }); | 53 | + onChange(_value: string, option: { deviceType: string; transportType: string }) { |
54 | + const { deviceType, transportType } = option; | ||
55 | + setFieldsValue({ deviceType: deviceType, transportType }); | ||
50 | }, | 56 | }, |
51 | }; | 57 | }; |
52 | }, | 58 | }, |
@@ -69,6 +75,17 @@ export const step1Schemas: FormSchema[] = [ | @@ -69,6 +75,17 @@ export const step1Schemas: FormSchema[] = [ | ||
69 | }, | 75 | }, |
70 | }, | 76 | }, |
71 | { | 77 | { |
78 | + field: 'code', | ||
79 | + label: '地址码', | ||
80 | + component: 'Input', | ||
81 | + ifShow: ({ model }) => { | ||
82 | + return model['transportType'] === 'TCP'; | ||
83 | + }, | ||
84 | + dynamicRules: ({ model }) => { | ||
85 | + return [{ required: model['transportType'] === 'TCP', message: '地址码为必填项' }]; | ||
86 | + }, | ||
87 | + }, | ||
88 | + { | ||
72 | field: 'brand', | 89 | field: 'brand', |
73 | component: 'ApiRadioGroup', | 90 | component: 'ApiRadioGroup', |
74 | label: '选择厂家', | 91 | label: '选择厂家', |