Commit db94d5f6d93663e44da9d9a5967746948267caef

Authored by ww
1 parent 606e5aa5

fix: 修复设备创建地址码只存在于设备为网关子设备并且传输协议为TCP协议

... ... @@ -4,6 +4,7 @@ import { deviceProfile, getGatewayDevice } from '/@/api/device/deviceManager';
4 4 import { TransportTypeEnum } from '../../profiles/components/TransportDescript/const';
5 5 import { JSONEditorValidator } from '/@/components/CodeEditor/src/JSONEditor';
6 6 import { JSONEditor } from '/@/components/CodeEditor';
  7 +import { DeviceTypeEnum } from '/@/api/device/model/deviceModel';
7 8 useComponentRegister('JSONEditor', JSONEditor);
8 9
9 10 export enum TypeEnum {
... ... @@ -113,7 +114,9 @@ export const step1Schemas: FormSchema[] = [
113 114 maxLength: 255,
114 115 placeholder: '请输入设备标识',
115 116 },
116   - ifShow: ({ values }) => values?.transportType === TransportTypeEnum.TCP,
  117 + ifShow: ({ values }) =>
  118 + values?.transportType === TransportTypeEnum.TCP &&
  119 + values.deviceType === DeviceTypeEnum.SENSOR,
117 120 },
118 121 {
119 122 field: 'brand',
... ...
... ... @@ -258,6 +258,7 @@ export const step2Schemas: FormSchema[] = [
258 258 { label: 'LWM2M', value: 'LWM2M' },
259 259 { label: 'SNMP', value: 'SNMP' },
260 260 ],
  261 + getPopupContainer: () => document.body,
261 262 };
262 263 },
263 264 colProps: { span: 10 },
... ...