diff --git a/src/components/Layout/components/Notice.vue b/src/components/Layout/components/Notice.vue index 25570448..b6485554 100644 --- a/src/components/Layout/components/Notice.vue +++ b/src/components/Layout/components/Notice.vue @@ -45,47 +45,43 @@ const subscribeNotice = () => { total.value += 1; notification.open({ message: resp?.payload?.topicName, - description: () => ( -
{ - { - /* changeStatus_api('_read', [resp.id]); */ - } - read('', resp); - }} - > - {resp?.payload?.message} -
- ), + description: () => + h( + 'div', + { + class: "ellipsis", + style: { + cursor: 'pointer' + }, + onClick: () => { + read('', resp); + } + }, + { + default: () => resp?.payload?.message + } + ) + , onClick: () => { // changeStatus_api('_read', [resp.id]) read('', resp); }, key: resp.payload.id, - btn: ( - - ), + btn: () => + h( + Button, + { + type: "primary", + size: "small", + onClick: (e: Event) => { + e.stopPropagation(); + read('_read', resp); + } + }, + { + default: () => "标记已读" + } + ), }); }); }; diff --git a/src/views/DataCollect/Collector/Point/index.vue b/src/views/DataCollect/Collector/Point/index.vue index c2fee56d..fea336b3 100644 --- a/src/views/DataCollect/Collector/Point/index.vue +++ b/src/views/DataCollect/Collector/Point/index.vue @@ -468,7 +468,7 @@ const columns = [ const subRef = ref(); const propertyValue = ref(new Map()); - +const cacheIds = ref() const showBatch = ref(false); const clickBatch = () => { @@ -657,15 +657,18 @@ const onCheckAllChange = (e: any) => { watch( () => tableRef?.value?._dataSource, (value) => { + subRef.value?.unsubscribe(); if (value.length !== 0) { - subscribeProperty(value); - value.forEach((item: any) => { - item?.accessModes?.forEach((i: any) => { - if (i?.value === 'read') { - ReadIdMap.set(item.id, item); - } - }); - }); + setTimeout(() => { + subscribeProperty(value); + value.forEach((item: any) => { + item?.accessModes?.forEach((i: any) => { + if (i?.value === 'read') { + ReadIdMap.set(item.id, item); + } + }); + }); + }, 100) } cancelSelect(); checkAll.value = false; @@ -701,9 +704,7 @@ watch( ); onUnmounted(() => { - if (subRef.value) { - subRef.value?.unsubscribe(); - } + subRef.value?.unsubscribe(); }); /**