|
@@ -11,6 +11,7 @@ import { genModbusCommand, getDeviceActiveTime, getDeviceInfo, getThingsModelSer |
|
@@ -11,6 +11,7 @@ import { genModbusCommand, getDeviceActiveTime, getDeviceInfo, getThingsModelSer |
|
11
|
import { ThingsModelForm } from '@/core/Library/components/ThingsModelForm'
|
11
|
import { ThingsModelForm } from '@/core/Library/components/ThingsModelForm'
|
|
12
|
import { useMessage } from '@/hooks/web/useMessage'
|
12
|
import { useMessage } from '@/hooks/web/useMessage'
|
|
13
|
import type { StructJSON } from '@/api/device/model'
|
13
|
import type { StructJSON } from '@/api/device/model'
|
|
|
|
14
|
+import { CommandWayEnum } from '@/enums/commandEnum'
|
|
14
|
|
15
|
|
|
15
|
interface ServiceInfo {
|
16
|
interface ServiceInfo {
|
|
16
|
title?: string
|
17
|
title?: string
|
|
@@ -19,6 +20,7 @@ interface ServiceInfo { |
|
@@ -19,6 +20,7 @@ interface ServiceInfo { |
|
19
|
transportType?: string
|
20
|
transportType?: string
|
|
20
|
callType?: string
|
21
|
callType?: string
|
|
21
|
code?: string
|
22
|
code?: string
|
|
|
|
23
|
+ way?: string
|
|
22
|
}
|
24
|
}
|
|
23
|
|
25
|
|
|
24
|
const visible = ref<boolean>(false)
|
26
|
const visible = ref<boolean>(false)
|
|
@@ -49,6 +51,7 @@ const serviceInfo = reactive<ServiceInfo>({ |
|
@@ -49,6 +51,7 @@ const serviceInfo = reactive<ServiceInfo>({ |
|
49
|
transportType: '',
|
51
|
transportType: '',
|
|
50
|
callType: '',
|
52
|
callType: '',
|
|
51
|
code: '',
|
53
|
code: '',
|
|
|
|
54
|
+ way: '', // 单向还是双向
|
|
52
|
})
|
55
|
})
|
|
53
|
|
56
|
|
|
54
|
const [register, { getFieldsValue, validate, setFieldsValue, updateSchema, setProps }] = useForm({ // 自定义下发值
|
57
|
const [register, { getFieldsValue, validate, setFieldsValue, updateSchema, setProps }] = useForm({ // 自定义下发值
|
|
@@ -88,11 +91,12 @@ const getDeviceDetail = async (deviceId: string) => { |
|
@@ -88,11 +91,12 @@ const getDeviceDetail = async (deviceId: string) => { |
|
88
|
}
|
91
|
}
|
|
89
|
|
92
|
|
|
90
|
const open = async (_data: SingleClickEventDataType) => {
|
93
|
const open = async (_data: SingleClickEventDataType) => {
|
|
|
|
94
|
+ console.warn(_data, 'data')
|
|
91
|
const { operationPassword } = _data || {}
|
95
|
const { operationPassword } = _data || {}
|
|
92
|
dataSourceJson.value = _data.deviceInfo
|
96
|
dataSourceJson.value = _data.deviceInfo
|
|
93
|
isPasswordInfo.value = operationPassword || {}
|
97
|
isPasswordInfo.value = operationPassword || {}
|
|
94
|
// commandWay-->命令下发方式
|
98
|
// commandWay-->命令下发方式
|
|
95
|
- const { commandWay, customCommand, serviceCommand, service, callType } = _data || {}
|
99
|
+ const { commandWay, customCommand, serviceCommand, service, callType, way } = _data || {}
|
|
96
|
isCommandWay.value = commandWay
|
100
|
isCommandWay.value = commandWay
|
|
97
|
const { attrInfo, deviceId } = unref(dataSourceJson)
|
101
|
const { attrInfo, deviceId } = unref(dataSourceJson)
|
|
98
|
const { identifier, extensionDesc, detail, name } = attrInfo || {}// 属性信息
|
102
|
const { identifier, extensionDesc, detail, name } = attrInfo || {}// 属性信息
|
|
@@ -110,6 +114,7 @@ const open = async (_data: SingleClickEventDataType) => { |
|
@@ -110,6 +114,7 @@ const open = async (_data: SingleClickEventDataType) => { |
|
110
|
formField.value = identifier
|
114
|
formField.value = identifier
|
|
111
|
isShowActionType.value = !!actionType // 判断modBUS类型时 物模型是否填写扩展描述
|
115
|
isShowActionType.value = !!actionType // 判断modBUS类型时 物模型是否填写扩展描述
|
|
112
|
serviceInfo.callType = callType // 服务命令调用方式 是同步还是异步
|
116
|
serviceInfo.callType = callType // 服务命令调用方式 是同步还是异步
|
|
|
|
117
|
+ serviceInfo.way = way || 'oneway' // 命令下发是双向还是单向
|
|
113
|
|
118
|
|
|
114
|
serviceInfo.transportType = transportType
|
119
|
serviceInfo.transportType = transportType
|
|
115
|
serviceInfo.code = code
|
120
|
serviceInfo.code = code
|
|
@@ -268,7 +273,7 @@ const handleSubmit = async () => { |
|
@@ -268,7 +273,7 @@ const handleSubmit = async () => { |
|
268
|
persistent: true,
|
273
|
persistent: true,
|
|
269
|
method: 'methodThingskit',
|
274
|
method: 'methodThingskit',
|
|
270
|
params: serviceInfo.transportType !== TransportTypeEnum.TCP && unref(isCommandWay) === CommandDeliveryWayEnum.SERVICE ? { service: unref(sendValue) } : unref(sendValue),
|
275
|
params: serviceInfo.transportType !== TransportTypeEnum.TCP && unref(isCommandWay) === CommandDeliveryWayEnum.SERVICE ? { service: unref(sendValue) } : unref(sendValue),
|
|
271
|
- }, dataSourceJson.value.deviceId)
|
276
|
+ }, dataSourceJson.value.deviceId, serviceInfo.way)
|
|
272
|
createMessage.success('命令下发成功')
|
277
|
createMessage.success('命令下发成功')
|
|
273
|
visible.value = false
|
278
|
visible.value = false
|
|
274
|
isInputData.value = false
|
279
|
isInputData.value = false
|