Procházet zdrojové kódy

文章列表,文章评论bug修改

xiaoming_global před 5 roky
rodič
revize
fef633a0cd

+ 1 - 0
build/utils.js Zobrazit soubor

@@ -47,6 +47,7 @@ exports.cssLoaders = function (options) {
47 47
     if (options.extract) {
48 48
       return ExtractTextPlugin.extract({
49 49
         use: loaders,
50
+        publicPath:'../../',
50 51
         fallback: 'vue-style-loader'
51 52
       })
52 53
     } else {

+ 8 - 0
src/api/act/submitinfo.js Zobrazit soubor

@@ -333,3 +333,11 @@ export function deleteComments(id,data){
333 333
    })
334 334
 }
335 335
 
336
+export function deleteAllArticles(data){
337
+    return request({
338
+        url:"/api/article/deleteAllArticles",
339
+        method:"delete",
340
+        data:data,
341
+    })
342
+}
343
+

+ 1 - 0
src/lang/zh.js Zobrazit soubor

@@ -174,6 +174,7 @@ export default {
174 174
     activitySignupList: "报名列表",
175 175
     SMSManage: "短信管理",
176 176
     SMSSend: "群发短信",
177
+    site:"微网站",
177 178
   },
178 179
   navbar: {
179 180
     logOut: '退出登录',

+ 2 - 2
src/router/modules/site.js Zobrazit soubor

@@ -14,12 +14,12 @@ export default {
14 14
       path: '/site',
15 15
       component: () => import('@/scrm_pages/site/index'),
16 16
       name: 'site',
17
-      unfinished: true,
17
+      // unfinished: true,
18 18
       meta: {
19 19
         title: '微网站',
20 20
         noCache: true,
21 21
       }
22
-    },
22
+    }, 
23 23
     {
24 24
       path: '/site/preview',
25 25
       component: () => import('@/scrm_pages/site/preview'),

+ 1 - 0
src/scrm_pages/article/acticleCategory.vue Zobrazit soubor

@@ -211,6 +211,7 @@
211 211
                 idMap[this.selectedMembers[index].id] = this.selectedMembers[index].id;
212 212
             }
213 213
             DeleteCategorys({ids:ids}).then(response=>{
214
+              console.log("IDS是什么?",ids)
214 215
                var res = response.data;
215 216
                if(res.state ===1){
216 217
                  var articsDatalength = this.articsData.length;

+ 76 - 6
src/scrm_pages/article/articleList.vue Zobrazit soubor

@@ -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();

+ 35 - 18
src/scrm_pages/article/commentList.vue Zobrazit soubor

@@ -6,12 +6,12 @@
6 6
         <div class="app-container">
7 7
             <div class="pl">
8 8
                <el-checkbox  @change="selectAllFunc" v-model="selectAll"><span class="comment" >全部评论</span></el-checkbox>  
9
-              <el-button size="small" icon="el-icon-delete" @click="openDeleteReply">批量删除</el-button>     
9
+              <el-button size="small" icon="el-icon-delete" @click="openDeleteReply()">批量删除</el-button>     
10 10
             </div> 
11 11
             <div class="border2"></div>
12 12
 
13 13
             <div v-for="(item,index) in comments" :key="item.id">
14
-              <div class="check"><el-checkbox v-model='item.checked' @change="selectProduct"></el-checkbox></div>
14
+              <div class="check"><el-checkbox v-model='item.checked' @change="selectProduct()"></el-checkbox></div>
15 15
               <div class="img">
16 16
                  <img :src="item.comment_user_avater" style="width:50px;height:50px">
17 17
               </div>
@@ -176,20 +176,37 @@ import { copyFile } from 'fs';
176 176
                return false
177 177
             });            
178 178
         },
179
-        selectProduct(val){
179
+        selectProduct(val){ 
180
+            var ids = [];             
180 181
             for(let i=0,len=this.comments.length;i<len;i++){
181 182
                 if(!this.comments[i].checked){
182
-                   this.selectAll = false;
183
+                   this.selectAll = false;   
184
+                             
183 185
                 }else{
184 186
                   this.selectAll = true;
187
+                  this.selectReply = val;
188
+                  ids.push(this.comments[i].id);               
189
+                  this.selectReply = ids;
185 190
                 }
186
-            } 
187
-            this.selectReply = val; 
191
+            }     
192
+            console.log("hhah",ids);
188 193
         },
189 194
         selectAllFunc(val){
190 195
            this.comments.map((item,i)=>{
191 196
              item.checked = val;
192 197
            }) 
198
+            var ids = [];             
199
+            for(let i=0,len=this.comments.length;i<len;i++){
200
+                if(!this.comments[i].checked){
201
+                   this.selectAll = false;   
202
+                             
203
+                }else{
204
+                  this.selectAll = true;
205
+                  this.selectReply = val;
206
+                  ids.push(this.comments[i].id);               
207
+                  this.selectReply = ids;
208
+                }
209
+            }     
193 210
         },
194 211
         deleteReply(id,index){
195 212
           this.$confirm("确定删除此评论?",'删除提示',{
@@ -223,23 +240,23 @@ import { copyFile } from 'fs';
223 240
           }).then(()=>{
224 241
               var ids = [];
225 242
               var idMap = {};
226
-              for (const index in this.selectReply) {
227
-                ids.push(this.selectReply[index].id);
228
-                idMap[this.selectReply[index].id] = this.selectReply[index].id;
229
-              }
243
+              for (let i=0,len=this.selectReply.length;i<len;i++) {
244
+                ids.push(this.selectReply[i]);
245
+                idMap[this.selectReply[i]] = this.selectReply[i];
246
+              }          
247
+              console.log("第二个ids是什么?",ids)           
230 248
               openDeleteReply({ids:ids}).then(response=>{
231 249
                   if(response.data.state==1){
232
-                    // var commentslength = this.comments.length;
233
-                    // for (let index = commentslength-1; index>=0; index--) {
234
-                    //    if(this.comments[index].id in idMap){
235
-                    //       this.comments.splice(index,1);
236
-                    //    }
237
-                    // }
238
-                    // this.$message.success("删除会员成功");
250
+                    for (let index = this.comments.length-1; index >= 0; index--) {
251
+                      if(this.comments[index].id in idMap){
252
+                         this.comments.splice(index,1)
253
+                      }                     
254
+                    }                 
255
+                    this.$message.success("删除评论成功");
239 256
                   }
240 257
               })
241 258
           })
242
-        }
259
+        },
243 260
     },
244 261
     created(){
245 262
       this.getReplyAllComents();

+ 1 - 1
src/scrm_pages/site/index.vue Zobrazit soubor

@@ -16,7 +16,7 @@
16 16
               </div>
17 17
             </el-col>
18 18
             <el-col :span="12">
19
-
19
+                 
20 20
             </el-col>
21 21
           </el-row>
22 22
       </div>