Commit 07a9bd39a16cd04609cfc665e7771dc9d817b2ee

Authored by ww
1 parent 7d81e7a1

fix: 修复模版组态无法显示设备名称

... ... @@ -30,7 +30,7 @@ export const formSchemas = (componentKey?: string): FormSchema[] => {
30 30 placeholder: '请选择产品',
31 31 onSelect(value: string, option: any) {
32 32 formModel[ContentDataFieldsEnum.DEVICE_PROFILE_ID] = value
33   - formModel[ContentDataFieldsEnum.DEVICE_INFO] = value && option ? { transportType: option.transportType, deviceType: option.deviceType, codeType: option?.codeType } : null
  33 + formModel[ContentDataFieldsEnum.DEVICE_INFO] = value && option ? { transportType: option.transportType, deviceType: option.deviceType, codeType: option?.codeType, deviceName: null } : null
34 34 },
35 35 getPopupContainer: () => document.body,
36 36 }
... ... @@ -56,7 +56,7 @@ export const formSchemas = (componentKey?: string): FormSchema[] => {
56 56 fieldNames: { label: 'name', value: 'tbDeviceId' },
57 57 onSelect(value: string, option: DeviceItemType) {
58 58 formModel[ContentDataFieldsEnum.DEVICE_PROFILE_ID] = value ? option.deviceProfileId : null
59   - formModel[ContentDataFieldsEnum.DEVICE_INFO] = value && option ? { code: option.code, transportType: option.transportType, deviceType: option.deviceType, deviceProfileId: option.deviceProfileId, deviceName: option.alias || option.name, codeType: option?.codeType } : null
  59 + formModel[ContentDataFieldsEnum.DEVICE_INFO] = value && option ? { code: option.code, transportType: option.transportType, deviceType: option.deviceType, deviceProfileId: option.deviceProfileId, deviceName: option.alias || option.name || null, codeType: option?.codeType } : null
60 60 formModel[ContentDataFieldsEnum.ATTR] = null
61 61 },
62 62 filterOption: (inputValue: string, option: DeviceItemType) => {
... ...