Commit 8aa0a73b38707287fef3f0eb399a7acb41ebeb39

Authored by ww
1 parent 302db6c7

fix: DEFECT-1046 create device fill in code field need deivceType is SENSOR && transportType is TCP

1 1 import { FormSchema } from '/@/components/Form';
2 2 import { findDictItemByCode } from '/@/api/system/dict';
3 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 7 export enum TypeEnum {
6 8 IS_GATEWAY = 'GATEWAY',
... ... @@ -116,7 +118,10 @@ export const step1Schemas: FormSchema[] = [
116 118 label: '地址码',
117 119 component: 'Input',
118 120 ifShow: ({ model }) => {
119   - return model['transportType'] === 'TCP';
  121 + return (
  122 + model['transportType'] === TransportTypeEnum.TCP &&
  123 + model['deviceType'] === DeviceTypeEnum.SENSOR
  124 + );
120 125 },
121 126 dynamicRules: ({ model }) => {
122 127 return [{ required: model['transportType'] === 'TCP', message: '地址码为必填项' }];
... ...
... ... @@ -362,7 +362,6 @@
362 362
363 363 const generateSN = async () => {
364 364 const data = await generateSNCode();
365   - console.log(data);
366 365 setFieldsValue({
367 366 sn: data,
368 367 });
... ...