Commit 0c9006bdf94a454865252bbad1bd0070d7cf4df4

Authored by ww
1 parent 48104d8d

perf: 创建tcp网关设备时新增设备标识符

@@ -114,7 +114,16 @@ export const step1Schemas: FormSchema[] = [ @@ -114,7 +114,16 @@ export const step1Schemas: FormSchema[] = [
114 { 114 {
115 field: 'code', 115 field: 'code',
116 label: '设备标识', 116 label: '设备标识',
117 - required: true, 117 + dynamicRules({ values }) {
  118 + return [
  119 + {
  120 + required:
  121 + values?.transportType === TransportTypeEnum.TCP &&
  122 + values.deviceType === DeviceTypeEnum.SENSOR,
  123 + message: '请输入设备标识符',
  124 + },
  125 + ];
  126 + },
118 component: 'Input', 127 component: 'Input',
119 componentProps: { 128 componentProps: {
120 maxLength: 255, 129 maxLength: 255,
@@ -122,7 +131,7 @@ export const step1Schemas: FormSchema[] = [ @@ -122,7 +131,7 @@ export const step1Schemas: FormSchema[] = [
122 }, 131 },
123 ifShow: ({ values }) => 132 ifShow: ({ values }) =>
124 values?.transportType === TransportTypeEnum.TCP && 133 values?.transportType === TransportTypeEnum.TCP &&
125 - values.deviceType === DeviceTypeEnum.SENSOR, 134 + (values.deviceType === DeviceTypeEnum.SENSOR || values.deviceType === DeviceTypeEnum.GATEWAY),
126 }, 135 },
127 { 136 {
128 field: 'brand', 137 field: 'brand',