fix: 场景联动内置参数校验
This commit is contained in:
parent
af5d2e08f6
commit
89458dbf96
|
@ -17,7 +17,7 @@
|
|||
<FunctionItem
|
||||
:builtInList="builtInList"
|
||||
@change="onChange"
|
||||
:source="record.source"
|
||||
v-model:source="record.source"
|
||||
:data="record"
|
||||
v-model:value="record.value"
|
||||
/>
|
||||
|
|
|
@ -152,8 +152,8 @@ const checkDeviceDelete = async () => {
|
|||
|
||||
if (item!.message!.messageType === 'WRITE_PROPERTY') {
|
||||
let hasProperties = false
|
||||
const propertiesKey = Object.keys(item!.message!.properties!)?.[0]
|
||||
if (item!.message!.properties && metadata.properties.length) {
|
||||
const propertiesKey = Object.keys(item!.message!.properties!)?.[0]
|
||||
hasProperties = metadata.properties?.some((item: any) => item.id === propertiesKey)
|
||||
}
|
||||
if (!hasProperties) {
|
||||
|
@ -162,6 +162,22 @@ const checkDeviceDelete = async () => {
|
|||
formTouchOff()
|
||||
return
|
||||
}
|
||||
// 判断值-内置参数
|
||||
const _value = item!.message!.properties?.[propertiesKey]
|
||||
if(_value.source === 'upper') {
|
||||
const _params = {
|
||||
branch: props.thenName,
|
||||
branchGroup: props.branchesName,
|
||||
action: props.name - 1,
|
||||
};
|
||||
const option = (await getBuildInData(_params, _data.value))(_value?.value!, 'id')
|
||||
if(!option) {
|
||||
_data.value.branches![props.branchesName].then[props.thenName].actions[props.name].device!.message!.properties![propertiesKey] = undefined
|
||||
_data.value.branches![props.branchesName].then[props.thenName].actions[props.name].device!.changeData = true
|
||||
formTouchOff()
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (item!.message!.messageType === 'INVOKE_FUNCTION') {
|
||||
|
|
Loading…
Reference in New Issue