From 8b9330a58d6dbaeec10172d31c99791d3566e61a Mon Sep 17 00:00:00 2001 From: xieyonghong <18010623010@163.com> Date: Mon, 27 Mar 2023 13:39:46 +0800 Subject: [PATCH] =?UTF-8?q?style:=20=E4=BC=98=E5=8C=96=E5=9C=BA=E6=99=AF?= =?UTF-8?q?=E8=81=94=E5=8A=A8=E5=9B=9E=E6=98=BE=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Scene/Save/action/ListItem/CheckItem.vue | 14 ++++++++------ .../Scene/Save/action/ListItem/FilterGroup.vue | 10 ++++++++-- .../Scene/Save/components/Terms/ParamsItem.vue | 2 +- .../Scene/Save/components/Terms/util.ts | 4 +++- yarn.lock | 4 ++-- 5 files changed, 22 insertions(+), 12 deletions(-) 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) +}) +