From d2e7a410b7ccf0bb988cd47c1d5a619ed2806f61 Mon Sep 17 00:00:00 2001 From: easy <1358086367@qq.com> Date: Thu, 9 Mar 2023 19:52:00 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=B8=AA=E4=BA=BA=E4=B8=AD=E5=BF=83?= =?UTF-8?q?=E8=87=AA=E6=B5=8B=E3=80=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/account/notificationRecord.ts | 2 +- src/components/Layout/components/Notice.vue | 16 ++++++++-- .../account/NotificationRecord/index.vue | 20 ++++++------ .../NotificationSubscription/index.vue | 32 +++++++++---------- .../components/ComprehensiveHome/index.vue | 21 +++++++++--- .../home/components/DeviceHome/index.vue | 8 ++--- 6 files changed, 59 insertions(+), 40 deletions(-) diff --git a/src/api/account/notificationRecord.ts b/src/api/account/notificationRecord.ts index 18217d85..58cb612f 100644 --- a/src/api/account/notificationRecord.ts +++ b/src/api/account/notificationRecord.ts @@ -1,7 +1,7 @@ import server from '@/utils/request' // 获取记录列表 -export const getList_api = (data:object): any =>server.get(`/notifications/_query`,encodeParams(data)) +export const getList_api = (data:object): any =>server.post(`/notifications/_query`,data) // 修改记录状态 export const changeStatus_api = (type:'_read'|'_unread',data:string[]): any =>server.post(`/notifications/${type}`,data) diff --git a/src/components/Layout/components/Notice.vue b/src/components/Layout/components/Notice.vue index 07423bc1..58bba839 100644 --- a/src/components/Layout/components/Notice.vue +++ b/src/components/Layout/components/Notice.vue @@ -26,7 +26,7 @@ import { notification } from 'ant-design-vue'; import { changeStatus_api } from '@/api/account/notificationRecord'; import { useUserInfo } from '@/store/userInfo'; -const updateCount = computed(()=>useUserInfo().$state.alarmUpdateCount); +const updateCount = computed(() => useUserInfo().$state.alarmUpdateCount); const total = ref(0); const list = ref([]); @@ -50,10 +50,20 @@ const subscribeNotice = () => { const getList = () => { loading.value = true; const params = { - 'terms[0].column': 'state', - 'terms[0].value': 'unread', 'sorts[0].name': 'notifyTime', 'sorts[0].order': 'desc', + terms: [ + { + terms: [ + { + type: 'or', + value: 'unread', + termType: 'eq', + column: 'state', + }, + ], + }, + ], }; getList_api(params) .then((resp: any) => { diff --git a/src/views/account/NotificationRecord/index.vue b/src/views/account/NotificationRecord/index.vue index 84790dbc..a6d380d3 100644 --- a/src/views/account/NotificationRecord/index.vue +++ b/src/views/account/NotificationRecord/index.vue @@ -1,14 +1,17 @@