|
@@ -26,7 +26,17 @@
|
|
|
</data-search>
|
|
|
</el-col>
|
|
|
<el-col :span="24">
|
|
|
- <data-table ref="dataTable" :fields="fields" :opera="opera" :data="list" :total="total" @query="search" @view="toView" @see="toSee"></data-table>
|
|
|
+ <data-table
|
|
|
+ ref="dataTable"
|
|
|
+ :fields="fields"
|
|
|
+ :opera="opera"
|
|
|
+ :data="list"
|
|
|
+ :total="total"
|
|
|
+ @query="search"
|
|
|
+ @view="toView"
|
|
|
+ @see="toSee"
|
|
|
+ @del="toDelete"
|
|
|
+ ></data-table>
|
|
|
</el-col>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -92,6 +102,7 @@ export default {
|
|
|
opera: [
|
|
|
{ label: '查看', method: 'view' },
|
|
|
{ label: '已读', method: 'see', confirm: true, type: 'warning', display: (i) => i.status == '0' },
|
|
|
+ { label: '删除', method: 'del', confirm: true, type: 'danger' },
|
|
|
],
|
|
|
btnList: [{ label: '添加', method: 'add' }],
|
|
|
searchFields: [
|
|
@@ -150,6 +161,13 @@ export default {
|
|
|
let res = await this.update(info);
|
|
|
if (this.$checkRes(res, '已读', `${res.errmsg}`)) this.search();
|
|
|
},
|
|
|
+ async toDelete({ data }) {
|
|
|
+ let res = await this.delete(data._id);
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ this.$message({ type: `success`, message: `刪除信息成功` });
|
|
|
+ this.search();
|
|
|
+ }
|
|
|
+ },
|
|
|
// 查询其他信息
|
|
|
async searchOthers() {
|
|
|
// 来源
|