From 1d848b7227c4a478fc0b263058d778a69f313027 Mon Sep 17 00:00:00 2001 From: wwz <1144797966@qq.com> Date: Sat, 12 Apr 2025 11:01:17 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E4=B8=AD=E5=BF=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/notifications/index.ts | 7 +++++ .../inventory/consumables/config/content.ts | 10 +++---- src/views/notifications/config/add.ts | 2 -- src/views/notifications/config/content.ts | 27 +++++++++---------- src/views/notifications/index.vue | 15 ++++++++--- 5 files changed, 35 insertions(+), 26 deletions(-) diff --git a/src/api/notifications/index.ts b/src/api/notifications/index.ts index 21e0a13..05fb18a 100644 --- a/src/api/notifications/index.ts +++ b/src/api/notifications/index.ts @@ -46,6 +46,13 @@ const Api = { method: "delete", }); }, + // 清空已读 + syncNoticeclear() { + return request({ + url: `${baseURL}/syncNotice/clear`, + method: "delete", + }); + }, }; export default Api; diff --git a/src/views/inventory/consumables/config/content.ts b/src/views/inventory/consumables/config/content.ts index 0dc52a2..3ffef60 100644 --- a/src/views/inventory/consumables/config/content.ts +++ b/src/views/inventory/consumables/config/content.ts @@ -64,11 +64,11 @@ const contentConfig: IContentConfig = { name: "damage-out", auth: "", }, - { - text: "报损", - name: "reportinglosses", - auth: "", - }, + // { + // text: "报损", + // name: "reportinglosses", + // auth: "", + // }, ], defaultToolbar: ["refresh", "filter", "search"], cols: [ diff --git a/src/views/notifications/config/add.ts b/src/views/notifications/config/add.ts index 0f42129..9cd5a79 100644 --- a/src/views/notifications/config/add.ts +++ b/src/views/notifications/config/add.ts @@ -19,7 +19,6 @@ const modalConfig: IModalConfig = { console.log("提交之前处理", data); }, formItems: [ - { label: "名称", prop: "name", @@ -69,7 +68,6 @@ const modalConfig: IModalConfig = { placeholder: "请输入排序", }, }, - ], }; diff --git a/src/views/notifications/config/content.ts b/src/views/notifications/config/content.ts index e9417de..521681c 100644 --- a/src/views/notifications/config/content.ts +++ b/src/views/notifications/config/content.ts @@ -25,21 +25,18 @@ const contentConfig: IContentConfig = { indexActionData: {}, pk: "id", toolbar: [ - // { - // text: "入库记录", - // name: "manual-in", - // auth: "", - // }, - // { - // text: "出库记录", - // name: "manual-out", - // auth: "", - // }, - // { - // text: "报损记录", - // name: "damage-out", - // auth: "", - // }, + { + text: "全部已读", + name: "mark_all_read", + auth: "", + type: "primary", + }, + { + text: "清空已读", + name: "Clear_Read", + auth: "", + type: "danger", + }, ], defaultToolbar: ["refresh", "filter", "search"], cols: [ diff --git a/src/views/notifications/index.vue b/src/views/notifications/index.vue index 645854c..96fb805 100644 --- a/src/views/notifications/index.vue +++ b/src/views/notifications/index.vue @@ -99,9 +99,15 @@ async function handleEditClick(row: IObject) { } // 其他工具栏 function handleToolbarClick(name: string) { - if (name === "custom1") { - ElMessage.success("点击了自定义1按钮"); + if (name === "mark_all_read") { + Api.edit({ + noticeIdList: [], + }); } + if (name == "Clear_Read") { + Api.syncNoticeclear(); + } + contentRef.value?.fetchPageData(); } const matchedProducts = (data: string) => { @@ -126,12 +132,13 @@ async function handleOperatClick(data: IOperatData) { } // Handle content click function handleContentClick(scope: any, item: any) { - if (scope.type == "1" || scope.type == "0") { + if (scope.type == "spec" || scope.type == "product") { router.push({ path: "/product/addgoods", query: { goods_id: item.id }, }); - } else { + } + if (scope.type == "consInfo" || scope.type == "consGroup") { router.push({ path: "/inventory/consumables", query: { conName: item.name },