Commit 8aa0a73b38707287fef3f0eb399a7acb41ebeb39
1 parent
302db6c7
fix: DEFECT-1046 create device fill in code field need deivceType is SENSOR && transportType is TCP
Showing
2 changed files
with
6 additions
and
2 deletions
| 1 | import { FormSchema } from '/@/components/Form'; | 1 | import { FormSchema } from '/@/components/Form'; |
| 2 | import { findDictItemByCode } from '/@/api/system/dict'; | 2 | import { findDictItemByCode } from '/@/api/system/dict'; |
| 3 | import { deviceProfile, getGatewayDevice } from '/@/api/device/deviceManager'; | 3 | import { deviceProfile, getGatewayDevice } from '/@/api/device/deviceManager'; |
| 4 | +import { DeviceTypeEnum } from '/@/api/device/model/deviceModel'; | ||
| 5 | +import { TransportTypeEnum } from '../../profiles/components/TransportDescript/const'; | ||
| 4 | 6 | ||
| 5 | export enum TypeEnum { | 7 | export enum TypeEnum { |
| 6 | IS_GATEWAY = 'GATEWAY', | 8 | IS_GATEWAY = 'GATEWAY', |
| @@ -116,7 +118,10 @@ export const step1Schemas: FormSchema[] = [ | @@ -116,7 +118,10 @@ export const step1Schemas: FormSchema[] = [ | ||
| 116 | label: '地址码', | 118 | label: '地址码', |
| 117 | component: 'Input', | 119 | component: 'Input', |
| 118 | ifShow: ({ model }) => { | 120 | ifShow: ({ model }) => { |
| 119 | - return model['transportType'] === 'TCP'; | 121 | + return ( |
| 122 | + model['transportType'] === TransportTypeEnum.TCP && | ||
| 123 | + model['deviceType'] === DeviceTypeEnum.SENSOR | ||
| 124 | + ); | ||
| 120 | }, | 125 | }, |
| 121 | dynamicRules: ({ model }) => { | 126 | dynamicRules: ({ model }) => { |
| 122 | return [{ required: model['transportType'] === 'TCP', message: '地址码为必填项' }]; | 127 | return [{ required: model['transportType'] === 'TCP', message: '地址码为必填项' }]; |
| @@ -362,7 +362,6 @@ | @@ -362,7 +362,6 @@ | ||
| 362 | 362 | ||
| 363 | const generateSN = async () => { | 363 | const generateSN = async () => { |
| 364 | const data = await generateSNCode(); | 364 | const data = await generateSNCode(); |
| 365 | - console.log(data); | ||
| 366 | setFieldsValue({ | 365 | setFieldsValue({ |
| 367 | sn: data, | 366 | sn: data, |
| 368 | }); | 367 | }); |