feat: 更新通知中心

This commit is contained in:
wwz 2025-04-12 11:01:17 +08:00
parent ef600c9e3c
commit 1d848b7227
5 changed files with 35 additions and 26 deletions

View File

@ -46,6 +46,13 @@ const Api = {
method: "delete", method: "delete",
}); });
}, },
// 清空已读
syncNoticeclear() {
return request<any>({
url: `${baseURL}/syncNotice/clear`,
method: "delete",
});
},
}; };
export default Api; export default Api;

View File

@ -64,11 +64,11 @@ const contentConfig: IContentConfig = {
name: "damage-out", name: "damage-out",
auth: "", auth: "",
}, },
{ // {
text: "报损", // text: "报损",
name: "reportinglosses", // name: "reportinglosses",
auth: "", // auth: "",
}, // },
], ],
defaultToolbar: ["refresh", "filter", "search"], defaultToolbar: ["refresh", "filter", "search"],
cols: [ cols: [

View File

@ -19,7 +19,6 @@ const modalConfig: IModalConfig = {
console.log("提交之前处理", data); console.log("提交之前处理", data);
}, },
formItems: [ formItems: [
{ {
label: "名称", label: "名称",
prop: "name", prop: "name",
@ -69,7 +68,6 @@ const modalConfig: IModalConfig = {
placeholder: "请输入排序", placeholder: "请输入排序",
}, },
}, },
], ],
}; };

View File

@ -25,21 +25,18 @@ const contentConfig: IContentConfig = {
indexActionData: {}, indexActionData: {},
pk: "id", pk: "id",
toolbar: [ toolbar: [
// { {
// text: "入库记录", text: "全部已读",
// name: "manual-in", name: "mark_all_read",
// auth: "", auth: "",
// }, type: "primary",
// { },
// text: "出库记录", {
// name: "manual-out", text: "清空已读",
// auth: "", name: "Clear_Read",
// }, auth: "",
// { type: "danger",
// text: "报损记录", },
// name: "damage-out",
// auth: "",
// },
], ],
defaultToolbar: ["refresh", "filter", "search"], defaultToolbar: ["refresh", "filter", "search"],
cols: [ cols: [

View File

@ -99,9 +99,15 @@ async function handleEditClick(row: IObject) {
} }
// //
function handleToolbarClick(name: string) { function handleToolbarClick(name: string) {
if (name === "custom1") { if (name === "mark_all_read") {
ElMessage.success("点击了自定义1按钮"); Api.edit({
noticeIdList: [],
});
} }
if (name == "Clear_Read") {
Api.syncNoticeclear();
}
contentRef.value?.fetchPageData();
} }
const matchedProducts = (data: string) => { const matchedProducts = (data: string) => {
@ -126,12 +132,13 @@ async function handleOperatClick(data: IOperatData) {
} }
// Handle content click // Handle content click
function handleContentClick(scope: any, item: any) { function handleContentClick(scope: any, item: any) {
if (scope.type == "1" || scope.type == "0") { if (scope.type == "spec" || scope.type == "product") {
router.push({ router.push({
path: "/product/addgoods", path: "/product/addgoods",
query: { goods_id: item.id }, query: { goods_id: item.id },
}); });
} else { }
if (scope.type == "consInfo" || scope.type == "consGroup") {
router.push({ router.push({
path: "/inventory/consumables", path: "/inventory/consumables",
query: { conName: item.name }, query: { conName: item.name },