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 262 sendValue.value = values
263 263 }
264 264 }
265   -
266 265 await sendRpcOneway({
267 266 additionalInfo: {
268 267 cmdType:
... ... @@ -273,7 +272,7 @@ const handleSubmit = async () => {
273 272 persistent: true,
274 273 method: 'methodThingskit',
275 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 276 createMessage.success('命令下发成功')
278 277 visible.value = false
279 278 isInputData.value = false
... ...
... ... @@ -69,7 +69,8 @@ export const getFormSchemas = (event: EventTypeEnum): FormSchema[] => {
69 69 { label: EventActionTypeNameEnum.OPEN_PAGE, value: EventActionTypeEnum.OPEN_PAGE, disbaled: false },
70 70
71 71 ] as any
72   - if (unref(getCellInfo).category === PackageCategoryEnum.CONTROL)
  72 +
  73 + if (unref(getCellInfo).category.toUpperCase() === PackageCategoryEnum.CONTROL)
73 74 options.push({ label: EventActionTypeNameEnum.PARAMS_SETTING, value: EventActionTypeEnum.PARAMS_SETTING, disabled: !deviceProfileId })
74 75
75 76 return {
... ...
... ... @@ -13,6 +13,7 @@ import { useMessage } from '@/hooks/web/useMessage'
13 13 import type { NodeDataActJsonType, NodeDataEventJsonType } from '@/api/node/model'
14 14 import { PackageCategoryEnum } from '@/core/Library/enum'
15 15 import { useContentDataStoreWithOut } from '@/store/modules/contentData'
  16 +import { BasicHelp } from '@/components/Basic'
16 17
17 18 const props = defineProps<ConfigComponentProps>()
18 19
... ... @@ -83,6 +84,11 @@ const validatePassword = () => {
83 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 92 const { savePageContent } = useSavePageContent()
87 93 const handleSave = async () => {
88 94 loading.value = true
... ... @@ -161,8 +167,11 @@ createPublicFormContext(nodeDataActinType)
161 167 </Divider>
162 168 <DataEvents ref="dataEventsElRef" :before-click="handleBeforeOpenEventOrActModal" :form-setting="getFormSetting" />
163 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 175 </Checkbox>
167 176 <Form>
168 177 <FormItem :validate-status="getValidateStatus(operationPassword.value)">
... ...