diff --git a/src/views/rule-engine/Scene/Save/action/ListItem/CheckItem.vue b/src/views/rule-engine/Scene/Save/action/ListItem/CheckItem.vue index 9f18ab54..47e1c542 100644 --- a/src/views/rule-engine/Scene/Save/action/ListItem/CheckItem.vue +++ b/src/views/rule-engine/Scene/Save/action/ListItem/CheckItem.vue @@ -58,12 +58,14 @@ const checkDeviceDelete = async () => { formTouchOff() return } - const deviceList = item!.selectorValues?.map(item => item.value) || [] - const deviceResp = await deviceQuery({ terms: [{ terms: [{ column: 'id', termType: 'in', value: deviceList.toString() }]}]}) - if (deviceResp.success && (deviceResp.result as any)?.total < (item!.selectorValues?.length || 0)) { // 某一个设备被删除 - _data.value.branches![props.branchesName].then[props.thenName].actions[props.name].device!.selectorValues = undefined - formTouchOff() - return + if (item?.selector === 'fixed') { + const deviceList = item!.selectorValues?.map(item => item.value) || [] + const deviceResp = await deviceQuery({ terms: [{ terms: [{ column: 'id', termType: 'in', value: deviceList.toString() }]}]}) + if (deviceResp.success && (deviceResp.result as any)?.total < (item!.selectorValues?.length || 0)) { // 某一个设备被删除 + _data.value.branches![props.branchesName].then[props.thenName].actions[props.name].device!.selectorValues = undefined + formTouchOff() + return + } } } diff --git a/src/views/rule-engine/Scene/Save/action/ListItem/FilterGroup.vue b/src/views/rule-engine/Scene/Save/action/ListItem/FilterGroup.vue index 48542851..3e7c95c7 100644 --- a/src/views/rule-engine/Scene/Save/action/ListItem/FilterGroup.vue +++ b/src/views/rule-engine/Scene/Save/action/ListItem/FilterGroup.vue @@ -107,9 +107,11 @@ const onKeys: string[] = EventSubscribeKeys({ action: props.actionName }) -EventEmitter.subscribe(onKeys, (d: any) => { +const handleRequest = () => { columnRequest() -}) +} + +EventEmitter.subscribe(onKeys, handleRequest) provide('filter-params', columnOptions) @@ -241,6 +243,10 @@ nextTick(() => { columnRequest() }) +onUnmounted(() => { + EventEmitter.unSubscribe(onKeys, handleRequest) +}) +