Commit 562c338268b3024e856db4ab7203d0b92c3ec485

Authored by xp.Huang
2 parents 6b0ad371 c295fc3e

Merge branch 'fix/device-send-command' into 'main_dev'

fix: 修复服务未区分单双向

See merge request yunteng/thingskit-scada!171
@@ -262,7 +262,6 @@ const handleSubmit = async () => { @@ -262,7 +262,6 @@ const handleSubmit = async () => {
262 sendValue.value = values 262 sendValue.value = values
263 } 263 }
264 } 264 }
265 -  
266 await sendRpcOneway({ 265 await sendRpcOneway({
267 additionalInfo: { 266 additionalInfo: {
268 cmdType: 267 cmdType:
@@ -273,7 +272,7 @@ const handleSubmit = async () => { @@ -273,7 +272,7 @@ const handleSubmit = async () => {
273 persistent: true, 272 persistent: true,
274 method: 'methodThingskit', 273 method: 'methodThingskit',
275 params: serviceInfo.transportType !== TransportTypeEnum.TCP && unref(isCommandWay) === CommandDeliveryWayEnum.SERVICE ? { service: unref(sendValue) } : unref(sendValue), 274 params: serviceInfo.transportType !== TransportTypeEnum.TCP && unref(isCommandWay) === CommandDeliveryWayEnum.SERVICE ? { service: unref(sendValue) } : unref(sendValue),
276 - }, dataSourceJson.value.deviceId, serviceInfo.way) 275 + }, dataSourceJson.value.deviceId, serviceInfo.callType ? serviceInfo.callType === 'SYNC' ? 'twoway' : 'oneway' : serviceInfo.way)
277 createMessage.success('命令下发成功') 276 createMessage.success('命令下发成功')
278 visible.value = false 277 visible.value = false
279 isInputData.value = false 278 isInputData.value = false
@@ -69,7 +69,8 @@ export const getFormSchemas = (event: EventTypeEnum): FormSchema[] => { @@ -69,7 +69,8 @@ export const getFormSchemas = (event: EventTypeEnum): FormSchema[] => {
69 { label: EventActionTypeNameEnum.OPEN_PAGE, value: EventActionTypeEnum.OPEN_PAGE, disbaled: false }, 69 { label: EventActionTypeNameEnum.OPEN_PAGE, value: EventActionTypeEnum.OPEN_PAGE, disbaled: false },
70 70
71 ] as any 71 ] as any
72 - if (unref(getCellInfo).category === PackageCategoryEnum.CONTROL) 72 +
  73 + if (unref(getCellInfo).category.toUpperCase() === PackageCategoryEnum.CONTROL)
73 options.push({ label: EventActionTypeNameEnum.PARAMS_SETTING, value: EventActionTypeEnum.PARAMS_SETTING, disabled: !deviceProfileId }) 74 options.push({ label: EventActionTypeNameEnum.PARAMS_SETTING, value: EventActionTypeEnum.PARAMS_SETTING, disabled: !deviceProfileId })
74 75
75 return { 76 return {
@@ -13,6 +13,7 @@ import { useMessage } from '@/hooks/web/useMessage' @@ -13,6 +13,7 @@ import { useMessage } from '@/hooks/web/useMessage'
13 import type { NodeDataActJsonType, NodeDataEventJsonType } from '@/api/node/model' 13 import type { NodeDataActJsonType, NodeDataEventJsonType } from '@/api/node/model'
14 import { PackageCategoryEnum } from '@/core/Library/enum' 14 import { PackageCategoryEnum } from '@/core/Library/enum'
15 import { useContentDataStoreWithOut } from '@/store/modules/contentData' 15 import { useContentDataStoreWithOut } from '@/store/modules/contentData'
  16 +import { BasicHelp } from '@/components/Basic'
16 17
17 const props = defineProps<ConfigComponentProps>() 18 const props = defineProps<ConfigComponentProps>()
18 19
@@ -83,6 +84,11 @@ const validatePassword = () => { @@ -83,6 +84,11 @@ const validatePassword = () => {
83 return operationPassword.value ? Promise.resolve(operationPassword) : Promise.reject(new Error('请输入操作密码')) 84 return operationPassword.value ? Promise.resolve(operationPassword) : Promise.reject(new Error('请输入操作密码'))
84 } 85 }
85 86
  87 +const getSetPasswordStatus = computed(() => {
  88 + const data = unref(getNodeData)?.eventJson?.SINGLE
  89 + return !data
  90 +})
  91 +
86 const { savePageContent } = useSavePageContent() 92 const { savePageContent } = useSavePageContent()
87 const handleSave = async () => { 93 const handleSave = async () => {
88 loading.value = true 94 loading.value = true
@@ -161,8 +167,11 @@ createPublicFormContext(nodeDataActinType) @@ -161,8 +167,11 @@ createPublicFormContext(nodeDataActinType)
161 </Divider> 167 </Divider>
162 <DataEvents ref="dataEventsElRef" :before-click="handleBeforeOpenEventOrActModal" :form-setting="getFormSetting" /> 168 <DataEvents ref="dataEventsElRef" :before-click="handleBeforeOpenEventOrActModal" :form-setting="getFormSetting" />
163 <div v-if="getCellInfo.category === PackageCategoryEnum.CONTROL" class="flex flex-col justify-center passwordInput" :class="getFormSetting?.actSetting === false && 'mb-4'"> 169 <div v-if="getCellInfo.category === PackageCategoryEnum.CONTROL" class="flex flex-col justify-center passwordInput" :class="getFormSetting?.actSetting === false && 'mb-4'">
164 - <Checkbox v-model:checked="operationPassword.checked">  
165 - {{ operationPassword.label }} 170 + <Checkbox v-model:checked="operationPassword.checked" :disabled="getSetPasswordStatus">
  171 + <div class="flex">
  172 + {{ operationPassword.label }}
  173 + <BasicHelp class="ml-1" text="操作密码: 需完成单击事件交互。" />
  174 + </div>
166 </Checkbox> 175 </Checkbox>
167 <Form> 176 <Form>
168 <FormItem :validate-status="getValidateStatus(operationPassword.value)"> 177 <FormItem :validate-status="getValidateStatus(operationPassword.value)">