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 6a42968..8b18d62 100644 --- a/src/views/inventory/consumables/config/content.ts +++ b/src/views/inventory/consumables/config/content.ts @@ -77,11 +77,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 },