Commit 59b28c8c441f228f933e4dc7ad45f3d786d02a8d
1 parent
16a6e0fc
fix: DEFECT-1940 修复模版创建TCP类型产品,无法获取传输协议
Showing
1 changed file
with
4 additions
and
1 deletions
@@ -11,6 +11,7 @@ import { PackageCategoryEnum } from '@/core/Library/enum' | @@ -11,6 +11,7 @@ import { PackageCategoryEnum } from '@/core/Library/enum' | ||
11 | import { validateTCPCustomCommand } from '@/core/Library/components/ThingsModelForm' | 11 | import { validateTCPCustomCommand } from '@/core/Library/components/ThingsModelForm' |
12 | import { JSONEditorValidator } from '@/components/CodeEditor/src/JSONEditor' | 12 | import { JSONEditorValidator } from '@/components/CodeEditor/src/JSONEditor' |
13 | import { DeviceTypeEnum, TCPProtocolTypeEnum, TransportTypeEnum } from '@/enums/deviceEnum' | 13 | import { DeviceTypeEnum, TCPProtocolTypeEnum, TransportTypeEnum } from '@/enums/deviceEnum' |
14 | +import { useProductsStoreWithOut } from '@/store/modules/products' | ||
14 | 15 | ||
15 | export enum FormFieldsEnum { | 16 | export enum FormFieldsEnum { |
16 | ACTION_TYPE = 'actionType', | 17 | ACTION_TYPE = 'actionType', |
@@ -39,7 +40,9 @@ export const getFormSchemas = (event: EventTypeEnum): FormSchema[] => { | @@ -39,7 +40,9 @@ export const getFormSchemas = (event: EventTypeEnum): FormSchema[] => { | ||
39 | const { getNodeData, getCellInfo, getDeviceInfo } = usePublicFormContext() | 40 | const { getNodeData, getCellInfo, getDeviceInfo } = usePublicFormContext() |
40 | const { dataSourceJson } = unref(getNodeData) || {} | 41 | const { dataSourceJson } = unref(getNodeData) || {} |
41 | const { deviceProfileId } = dataSourceJson || {} | 42 | const { deviceProfileId } = dataSourceJson || {} |
42 | - const { transportType } = unref(getDeviceInfo) || {} | 43 | + const productsStore = useProductsStoreWithOut() |
44 | + const detail = productsStore.getProductDetailById(deviceProfileId!) | ||
45 | + const { transportType } = unref(getDeviceInfo) || detail | ||
43 | 46 | ||
44 | return [ | 47 | return [ |
45 | { | 48 | { |