编辑端添加引用批量删除

This commit is contained in:
@fawn-nine
2023-07-19 17:37:16 +08:00
parent 52fde4a961
commit 9010b83ae7
3 changed files with 77 additions and 8 deletions

View File

@@ -98,8 +98,9 @@
</ul>
</div>
<div class="refenceCentent mt20">
<el-table :data="tableData" ref="multipleTable"
empty-text="New messages (0)" :show-header="false" :stripe="false" :highlight-current-row="false">
<el-table :data="tableData" ref="multipleTable" @selection-change="RefenceSelectionChange"
empty-text="New messages (0)" :show-header="false" :stripe="false" :highlight-current-row="false">
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column type="index" label="No." width="55" align="center"></el-table-column>
<el-table-column label="state" width="55" align="center">
<template slot-scope="scope">

View File

@@ -959,5 +959,5 @@ import VueUeditorWrap from 'vue-ueditor-wrap'; // ES6 Module
}
.istitle{margin: 20px 0;}
.Ptitle{background: rgb(23, 138, 184); padding: 4px; margin: 15px 0;}
.Ptitle p{margin-bottom: 0 !important; font-weight: bold; color: #fff !important;}
.Ptitle p{margin-bottom: 0 !important; font-weight: bold; color: #fff !important; font-style: italic;}
</style>

View File

@@ -66,8 +66,15 @@
<br clear="both">
</div>
<!-- 新的 -->
<el-table v-if="showB_step ==2" :data="chanFerForm" ref="multipleTable"
empty-text="New messages (0)" :show-header="false" :stripe="false" :highlight-current-row="false" >
<div v-if="showB_step ==2" >
<div class="topBtnBox btns" v-if="chanFerForm.length > 0">
<el-button type="primary" plain @click="selectAllRef">Select all</el-button>
<el-button type="success" plain @click="toggleSelection">Select none</el-button>
<el-button type="danger" plain @click="deleteSomeRefs" :disabled="multipleSelection.length > 0 ? false : true">Delete</el-button>
</div>
<el-table :data="chanFerForm" class="refTable" ref="multipleTable" @selection-change="RefenceSelectionChange"
empty-text="New messages (0)" :show-header="false" :stripe="false" :highlight-current-row="false" align="center">
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column type="index" label="No." width="55" align="center">
<template slot-scope="scope">
<i v-if="scope.row.is_change == 1" class="itemChanged"></i>
@@ -84,7 +91,7 @@
</span>
</template>
</el-table-column>
<el-table-column label="Title" align="left">
<el-table-column label="Title" align="center">
<template slot-scope="scope">
<!-- journal 形式 -->
<div style="text-align: left;" v-if="scope.row.refer_type == 'journal'">
@@ -114,6 +121,12 @@
</div>
</el-table-column>
</el-table>
<div class="bottomBtnBox btns" v-if="chanFerForm.length > 0">
<el-button type="primary" plain @click="selectAllRef">Select all</el-button>
<el-button type="success" plain @click="toggleSelection">Select none</el-button>
<el-button type="danger" plain @click="deleteSomeRefs" :disabled="multipleSelection.length > 0 ? false : true">Delete</el-button>
</div>
</div>
<!-- end -->
</div>
<br clear="both">
@@ -227,7 +240,7 @@
</span>
</el-dialog>
<!-- 复制word添加引用 -->
<el-dialog title= "Add References'" :visible.sync="showEditor" width="800px" z-index="1000" @close="showEditor= false">
<el-dialog title= "Add References'" :visible.sync="showEditor" width="800px" class="wordDia" z-index="1000" @close="showEditor= false">
<div>
<div class="logtips">
<p >Paste the contents of the wold file here, delete the carriage return at the end and click "Submit".</p>
@@ -324,7 +337,8 @@ export default {
],
},
addLoading:false,
editboxVisible:false,
editboxVisible:false,
multipleSelection:[] // 多选
}
},
@@ -414,6 +428,56 @@ export default {
this.showB_step = e
}
},
RefenceSelectionChange(val){
// console.log(val,666666)
this.multipleSelection = val
// console.log(this.multipleSelection,'this.multipleSelection')
},
// 取消选择
toggleSelection(){
this.multipleSelection = []
this.$refs.multipleTable.clearSelection();
},
// 选中所有
selectAllRef(){
this.$refs.multipleTable.toggleAllSelection()
},
// 删除部分引用
deleteSomeRefs(){
var ids = []
ids = this.multipleSelection.map(item=>{
return item.p_refer_id
})
this.$confirm('Are you sure you want to remove the selected references?', 'Tips', {
confirmButtonText: 'Sure',
cancelButtonText: 'Cancel',
type: 'warning'
}).then(() => {
const loading = this.$loading({
lock: true,
text: 'please wait',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
this.$api
.post('api/Preaccept/delRefers', {
'ids': ids
})
.then(res => {
loading.close();
if (res.code == 0) {
console.log(res)
this.changeRefer()
} else {
this.$message.error(res.msg);
}
})
.catch(err => {
loading.close();
console.log(err);
});
}).catch(() => {});
},
// 清空引用数据
clearRefences(){
@@ -920,6 +984,7 @@ export default {
/* 编辑器高度 */
/* /deep/ #edui1_iframeholder{ height: 260px;} */
.wordDia{max-height: 800px; overflow-y:scroll ;}
.logtips{margin-bottom: 15px; color: #666;}
/* .itemIndex{position: relative;} */
.itemChanged{position: absolute; display: inline-block; background: #006699; color: #fff; padding: 7px; border-radius: 0 0 7px 7px; left: 0; top: 0;}
@@ -1505,4 +1570,7 @@ export default {
margin: 0 auto;
font-size: 13px;
}
.refTable th{background: red !important; color: #666;}
.topBtnBox.btns{margin-bottom: 20px;}
.bottomBtnBox.btns{margin-top: 20px;}
</style>