|
|
@@ -2,6 +2,16 @@
|
|
|
<div class="ele-body">
|
|
|
<el-card shadow="never">
|
|
|
<search ref="search" @search="search"></search>
|
|
|
+ <el-popconfirm
|
|
|
+ class="ele-action"
|
|
|
+ v-if="canDeleteSelection"
|
|
|
+ title="确定要彻底删除选中的回收站记录吗?删除后不可恢复!"
|
|
|
+ @confirm="removeBatch"
|
|
|
+ >
|
|
|
+ <template v-slot:reference>
|
|
|
+ <el-button type="danger">批量删除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-popconfirm>
|
|
|
<ele-pro-table
|
|
|
ref="table"
|
|
|
:columns="columns"
|
|
|
@@ -70,7 +80,8 @@
|
|
|
recycleBinPage,
|
|
|
getDocTreeListAPI,
|
|
|
revoke,
|
|
|
- recycleDeleteAPI
|
|
|
+ recycleDeleteAPI,
|
|
|
+ recycleDeleteBatchAPI
|
|
|
} from '@/api/doc-manage';
|
|
|
export default {
|
|
|
mixins: [dictMixins, tableColumnsMixin],
|
|
|
@@ -86,7 +97,15 @@
|
|
|
tabMixinsInit: false,
|
|
|
cacheKeyUrl: 'fm-2611241029-doc-recycleBin',
|
|
|
folderList: [],
|
|
|
+ selection: [],
|
|
|
columns: [
|
|
|
+ {
|
|
|
+ width: 45,
|
|
|
+ type: 'selection',
|
|
|
+ columnKey: 'selection',
|
|
|
+ align: 'center',
|
|
|
+ fixed: 'left'
|
|
|
+ },
|
|
|
{
|
|
|
width: 45,
|
|
|
type: 'index',
|
|
|
@@ -170,7 +189,15 @@
|
|
|
});
|
|
|
},
|
|
|
computed: {
|
|
|
- ...mapGetters(['user'])
|
|
|
+ ...mapGetters(['user']),
|
|
|
+ // 仅当勾选记录全部为当前用户所删(delUserId 为空视为历史数据放行)时显示批量删除
|
|
|
+ canDeleteSelection() {
|
|
|
+ if (!this.selection || !this.selection.length) return false;
|
|
|
+ const uid = this.user?.info?.userId;
|
|
|
+ return this.selection.every(
|
|
|
+ (row) => !row.delUserId || String(row.delUserId) === String(uid)
|
|
|
+ );
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
// ele-pro-table 列变化 → 转换为 slim 格式后同步到后端
|
|
|
@@ -284,6 +311,15 @@
|
|
|
})
|
|
|
.catch((e) => {});
|
|
|
},
|
|
|
+ removeBatch() {
|
|
|
+ const ids = this.selection.map((row) => row.id);
|
|
|
+ recycleDeleteBatchAPI(ids)
|
|
|
+ .then(() => {
|
|
|
+ this.$message.success('删除成功');
|
|
|
+ this.done();
|
|
|
+ })
|
|
|
+ .catch((e) => {});
|
|
|
+ },
|
|
|
revoke(row) {
|
|
|
revoke({
|
|
|
fileId: row.fileId,
|