feat: 数据更改
This commit is contained in:
@@ -48,6 +48,8 @@ const contentConfig: IContentConfig = {
|
||||
label: "通知类型",
|
||||
align: "center",
|
||||
prop: "type",
|
||||
slotName: "type",
|
||||
templet: "custom",
|
||||
},
|
||||
{
|
||||
label: "是否已读",
|
||||
@@ -63,23 +65,27 @@ const contentConfig: IContentConfig = {
|
||||
slotName: "content",
|
||||
templet: "list",
|
||||
},
|
||||
{
|
||||
label: "商品/耗材",
|
||||
align: "center",
|
||||
prop: "extraJson",
|
||||
},
|
||||
{
|
||||
label: "创建时间",
|
||||
align: "center",
|
||||
prop: "createTime",
|
||||
},
|
||||
{
|
||||
label: "操作",
|
||||
align: "center",
|
||||
fixed: "right",
|
||||
width: 280,
|
||||
templet: "custom",
|
||||
slotName: "operate",
|
||||
operat: ["delete"],
|
||||
},
|
||||
// {
|
||||
// label: "操作",
|
||||
// align: "center",
|
||||
// fixed: "right",
|
||||
// width: 280,
|
||||
// templet: "tool",
|
||||
// operat: ["edit", "delete"],
|
||||
// width: 150,
|
||||
// templet: "custom",
|
||||
// slotName: "operate",
|
||||
// },
|
||||
],
|
||||
};
|
||||
|
||||
@@ -1,44 +1,42 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 搜索 -->
|
||||
<page-search
|
||||
ref="searchRef"
|
||||
:search-config="searchConfig"
|
||||
@query-click="handleQueryClick"
|
||||
@reset-click="handleResetClick"
|
||||
/>
|
||||
<page-search ref="searchRef" :search-config="searchConfig" @query-click="handleQueryClick"
|
||||
@reset-click="handleResetClick" />
|
||||
<!-- 列表 -->
|
||||
<page-content
|
||||
ref="contentRef"
|
||||
:content-config="contentConfig"
|
||||
@add-click="handleAddClick"
|
||||
@edit-click="handleEditClick"
|
||||
@export-click="handleExportClick"
|
||||
@search-click="handleSearchClick"
|
||||
@toolbar-click="handleToolbarClick"
|
||||
@operat-click="handleOperatClick"
|
||||
@filter-change="handleFilterChange"
|
||||
>
|
||||
<page-content ref="contentRef" :content-config="contentConfig" @add-click="handleAddClick"
|
||||
@edit-click="handleEditClick" @export-click="handleExportClick" @search-click="handleSearchClick"
|
||||
@toolbar-click="handleToolbarClick" @operat-click="handleOperatClick" @filter-change="handleFilterChange">
|
||||
<template #type="scope">
|
||||
{{ scope.row.type == 1 ? "耗材变动" : "商品变动 " }}
|
||||
</template>
|
||||
<template #isRead="scope">
|
||||
<el-tag :type="scope.row.isRead == 1 ? 'success' : 'info'">
|
||||
{{ scope.row.isRead == 1 ? "已读" : "未读" }}
|
||||
</el-tag>
|
||||
</template>
|
||||
<template #operate="scope">
|
||||
<div style="
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
">
|
||||
<el-button link type="primary" @click="refAddHaocaiTakinShow(scope.row, '')">
|
||||
设为已读
|
||||
</el-button>
|
||||
<el-button link type="primary" @click="refAddHaocaiTakinShow(scope.row, 'delete')">
|
||||
删除
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</page-content>
|
||||
|
||||
<!-- 新增 -->
|
||||
<page-modal
|
||||
ref="addModalRef"
|
||||
:modal-config="addModalConfig"
|
||||
@submit-click="handleSubmitClick"
|
||||
/>
|
||||
<page-modal ref="addModalRef" :modal-config="addModalConfig" @submit-click="handleSubmitClick" />
|
||||
|
||||
<!-- 编辑 -->
|
||||
<page-modal
|
||||
ref="editModalRef"
|
||||
:modal-config="editModalConfig"
|
||||
@submit-click="handleSubmitClick"
|
||||
/>
|
||||
<page-modal ref="editModalRef" :modal-config="editModalConfig" @submit-click="handleSubmitClick" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -50,6 +48,7 @@ import addModalConfig from "./config/add";
|
||||
import contentConfig from "./config/content";
|
||||
import editModalConfig from "./config/edit";
|
||||
import searchConfig from "./config/search";
|
||||
import Api from "@/api/notifications";
|
||||
|
||||
const {
|
||||
searchRef,
|
||||
@@ -87,6 +86,17 @@ function handleToolbarClick(name: string) {
|
||||
ElMessage.success("点击了自定义1按钮");
|
||||
}
|
||||
}
|
||||
|
||||
//删除
|
||||
function refAddHaocaiTakinShow(item: any, type: string) {
|
||||
console.log(item);
|
||||
if (type === "delete") {
|
||||
Api.delete(item.id);
|
||||
} else {
|
||||
Api.edit(item.id);
|
||||
}
|
||||
}
|
||||
|
||||
// 其他操作列
|
||||
async function handleOperatClick(data: IOperatData) {
|
||||
console.log(data);
|
||||
|
||||
Reference in New Issue
Block a user