|
@@ -35,14 +35,14 @@
|
35
|
35
|
</div>
|
36
|
36
|
|
37
|
37
|
<div class="filter-container" style="margin-top: 10px;margin-left: 5px">
|
38
|
|
- <el-checkbox style="width: 30px">全选</el-checkbox>
|
39
|
|
- <el-button size="small" icon="el-icon-delete">批量删除</el-button>
|
|
38
|
+ <el-checkbox style="width: 30px" @change="selectAllFunc" v-model="selectAll">全选</el-checkbox>
|
|
39
|
+ <el-button size="small" icon="el-icon-delete" @click="deleteAllArticles()">批量删除</el-button>
|
40
|
40
|
</div>
|
41
|
41
|
|
42
|
42
|
<div class="clearfix">
|
43
|
43
|
<div class="published-cell" v-for="(article,index) in articsData" :key="article.id">
|
44
|
|
- <div class="checkbox">
|
45
|
|
- <el-checkbox></el-checkbox>
|
|
44
|
+ <div class="checkbox" >
|
|
45
|
+ <el-checkbox v-model='article.checked' @change="selectProduct"></el-checkbox>
|
46
|
46
|
</div>
|
47
|
47
|
|
48
|
48
|
<div class="activity-image-panel">
|
|
@@ -99,7 +99,7 @@
|
99
|
99
|
|
100
|
100
|
<script>
|
101
|
101
|
import BreadCrumb from '../components/bread-crumb'
|
102
|
|
- import { GetAllArticles,deleteArticle} from '@/api/act/submitinfo'
|
|
102
|
+ import { GetAllArticles,deleteArticle,deleteAllArticles} from '@/api/act/submitinfo'
|
103
|
103
|
import PublishedCell from "@/scrm_pages/article/components/published_cell"
|
104
|
104
|
export default {
|
105
|
105
|
name: 'commentList',
|
|
@@ -132,6 +132,9 @@
|
132
|
132
|
selecting_status:'',
|
133
|
133
|
orgName:'',
|
134
|
134
|
statustext:'',
|
|
135
|
+ checked: false,
|
|
136
|
+ selectAll:false,
|
|
137
|
+ selectReply:[],
|
135
|
138
|
}
|
136
|
139
|
},
|
137
|
140
|
methods:{
|
|
@@ -230,7 +233,74 @@
|
230
|
233
|
if(articletype ==2){
|
231
|
234
|
this.$router.push({path:'/articles/editVido/'+articleid});
|
232
|
235
|
}
|
233
|
|
- }
|
|
236
|
+ },
|
|
237
|
+
|
|
238
|
+ selectProduct(val){
|
|
239
|
+ var ids =[];
|
|
240
|
+ for(let i=0,len=this.articsData.length;i<len;i++){
|
|
241
|
+ if(!this.articsData[i].checked){
|
|
242
|
+ this.selectAll = false;
|
|
243
|
+ }else{
|
|
244
|
+ this.selectAll = true;
|
|
245
|
+ this.selectReply = val;
|
|
246
|
+ ids.push(this.articsData[i].id);
|
|
247
|
+ this.selectReply = ids;
|
|
248
|
+ }
|
|
249
|
+ }
|
|
250
|
+ console.log("ids是什么",ids);
|
|
251
|
+ },
|
|
252
|
+ selectAllFunc(val){
|
|
253
|
+ var ids = [];
|
|
254
|
+ this.articsData.map((item,i)=>{
|
|
255
|
+ item.checked = val;
|
|
256
|
+ })
|
|
257
|
+
|
|
258
|
+ for(let i=0,len=this.articsData.length;i<len;i++){
|
|
259
|
+ if(!this.articsData[i].checked){
|
|
260
|
+ this.selectAll = false;
|
|
261
|
+ }else{
|
|
262
|
+ this.selectAll = true;
|
|
263
|
+ this.selectReply = val;
|
|
264
|
+ ids.push(this.articsData[i].id);
|
|
265
|
+ this.selectReply = ids;
|
|
266
|
+ }
|
|
267
|
+ }
|
|
268
|
+ console.log("ids是什么",ids);
|
|
269
|
+ },
|
|
270
|
+
|
|
271
|
+ deleteAllArticles(){
|
|
272
|
+ if (this.selectReply.length==0) {
|
|
273
|
+ this.$message.error("请选择要删除的信息");
|
|
274
|
+ return false;
|
|
275
|
+ }
|
|
276
|
+
|
|
277
|
+ this.$confirm('确认要删除所选的文章吗?','删除提示',{
|
|
278
|
+ dangerouslyUseHTMLString:true,
|
|
279
|
+ confirmButtonText: '确定',
|
|
280
|
+ cancelButtonText: '取消',
|
|
281
|
+ type: 'warning'
|
|
282
|
+ }).then(()=>{
|
|
283
|
+ deleteAllArticles().then(response=>{
|
|
284
|
+ var ids = [];
|
|
285
|
+ var idMap = {};
|
|
286
|
+ for (let index = 0; index < this.selectReply.length; index++) {
|
|
287
|
+ ids.push(this.selectReply[index]);
|
|
288
|
+ idMap[this.selectReply[index]] = this.selectReply[index];
|
|
289
|
+ }
|
|
290
|
+ console.log("第二个ids是什么?",ids);
|
|
291
|
+ deleteAllArticles({ids:ids}).then(response=>{
|
|
292
|
+ if(response.data.state ==1){
|
|
293
|
+ for (let index = this.articsData.length-1; index >= 0; index--) {
|
|
294
|
+ if(this.articsData[index].id in idMap){
|
|
295
|
+ this.articsData.splice(index,1)
|
|
296
|
+ }
|
|
297
|
+ }
|
|
298
|
+ this.$message.success("删除评论成功");
|
|
299
|
+ }
|
|
300
|
+ })
|
|
301
|
+ });
|
|
302
|
+ })
|
|
303
|
+ }
|
234
|
304
|
},
|
235
|
305
|
created(){
|
236
|
306
|
this.GetAllArticles();
|