Commit fbbd8867d603e40c2ccd6a24cbcecc9fe3cc3896

Authored by loveumiko
1 parent ed5d14f1

fix: 修复设备选择是网关子时命令下发方式没有服务调用

... ... @@ -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)
... ...