Commit 4ae77c099960c0ad17b2413835ba5e7e92e69b66

Authored by xp.Huang
2 parents 445cfec6 59b28c8c

Merge branch 'fix/DEFECT-1940' into 'main_dev'

fix: 修复模版创建TCP类型产品,无法获取传输协议

See merge request yunteng/thingskit-scada!221
... ... @@ -11,6 +11,7 @@ import { PackageCategoryEnum } from '@/core/Library/enum'
11 11 import { validateTCPCustomCommand } from '@/core/Library/components/ThingsModelForm'
12 12 import { JSONEditorValidator } from '@/components/CodeEditor/src/JSONEditor'
13 13 import { DeviceTypeEnum, TCPProtocolTypeEnum, TransportTypeEnum } from '@/enums/deviceEnum'
  14 +import { useProductsStoreWithOut } from '@/store/modules/products'
14 15
15 16 export enum FormFieldsEnum {
16 17 ACTION_TYPE = 'actionType',
... ... @@ -39,7 +40,9 @@ export const getFormSchemas = (event: EventTypeEnum): FormSchema[] => {
39 40 const { getNodeData, getCellInfo, getDeviceInfo } = usePublicFormContext()
40 41 const { dataSourceJson } = unref(getNodeData) || {}
41 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 47 return [
45 48 {
... ...