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",
});
},
// 清空已读
syncNoticeclear() {
return request<any>({
url: `${baseURL}/syncNotice/clear`,
method: "delete",
});
},
};
export default Api;

View File

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

View File

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

View File

@ -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: [

View File

@ -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 },