Showing
1 changed file
with
14 additions
and
2 deletions
@@ -90,6 +90,8 @@ export const step1Schemas: FormSchema[] = [ | @@ -90,6 +90,8 @@ export const step1Schemas: FormSchema[] = [ | ||
90 | deviceProfileId: id, | 90 | deviceProfileId: id, |
91 | gatewayId: null, | 91 | gatewayId: null, |
92 | codeType: transportType === TransportTypeEnum.TCP ? TaskTypeEnum.MODBUS : null, | 92 | codeType: transportType === TransportTypeEnum.TCP ? TaskTypeEnum.MODBUS : null, |
93 | + code: null, | ||
94 | + addressCode: null, | ||
93 | }); | 95 | }); |
94 | }, | 96 | }, |
95 | showSearch: true, | 97 | showSearch: true, |
@@ -165,7 +167,12 @@ export const step1Schemas: FormSchema[] = [ | @@ -165,7 +167,12 @@ export const step1Schemas: FormSchema[] = [ | ||
165 | minValue: 0, | 167 | minValue: 0, |
166 | }, | 168 | }, |
167 | ifShow: ({ values }) => { | 169 | ifShow: ({ values }) => { |
168 | - return values?.codeType === TaskTypeEnum.MODBUS; | 170 | + return ( |
171 | + values?.transportType === TransportTypeEnum.TCP && | ||
172 | + (values.deviceType === DeviceTypeEnum.SENSOR || | ||
173 | + values.deviceType === DeviceTypeEnum.GATEWAY) && | ||
174 | + values?.codeType === TaskTypeEnum.MODBUS | ||
175 | + ); | ||
169 | }, | 176 | }, |
170 | }, | 177 | }, |
171 | { | 178 | { |
@@ -189,7 +196,12 @@ export const step1Schemas: FormSchema[] = [ | @@ -189,7 +196,12 @@ export const step1Schemas: FormSchema[] = [ | ||
189 | }; | 196 | }; |
190 | }, | 197 | }, |
191 | ifShow: ({ values }) => { | 198 | ifShow: ({ values }) => { |
192 | - return values?.codeType === TaskTypeEnum.CUSTOM; | 199 | + return ( |
200 | + values?.transportType === TransportTypeEnum.TCP && | ||
201 | + (values.deviceType === DeviceTypeEnum.SENSOR || | ||
202 | + values.deviceType === DeviceTypeEnum.GATEWAY) && | ||
203 | + values?.codeType === TaskTypeEnum.CUSTOM | ||
204 | + ); | ||
193 | }, | 205 | }, |
194 | }, | 206 | }, |
195 | 207 |