Showing
1 changed file
with
8 additions
and
2 deletions
... | ... | @@ -41,7 +41,7 @@ export const getFormSchemas = (event: EventTypeEnum): FormSchema[] => { |
41 | 41 | // transportType:判断是什么类型的设备 code:设备地址码 deviceType:设备类型 |
42 | 42 | let codeType: string | null = '' |
43 | 43 | const { transportType, deviceType, codeType: deviceCodeType } = deviceInfo || {} |
44 | - codeType = deviceCodeType || (deviceId ? contentDataStore.diveceDetailMap?.[deviceId].codeType : null) | |
44 | + codeType = deviceCodeType || (deviceId ? contentDataStore.diveceDetailMap?.[deviceId]?.codeType : null) | |
45 | 45 | const isTemplate = contentDataStore.isTemplate // 判断是否是模板 |
46 | 46 | return [ |
47 | 47 | { |
... | ... | @@ -124,8 +124,14 @@ export const getFormSchemas = (event: EventTypeEnum): FormSchema[] => { |
124 | 124 | |
125 | 125 | function setOptions() { |
126 | 126 | // 是模板的话选择不到设备标识符类型所以就判断为放开自定义命令 |
127 | - if (isTemplate) | |
127 | + if (isTemplate) { | |
128 | + if (transportType !== TransportTypeEnum.TCP) | |
129 | + options.push(serviceOption) | |
128 | 130 | return |
131 | + } | |
132 | + | |
133 | + if (transportType !== TransportTypeEnum.TCP && deviceType === DeviceTypeEnum.SENSOR) | |
134 | + options.push(serviceOption) | |
129 | 135 | |
130 | 136 | if (deviceType !== DeviceTypeEnum.SENSOR) |
131 | 137 | options.push(serviceOption) | ... | ... |