xiaoming_global 5 anni fa
parent
commit
3e8fcbc61f

+ 2 - 1
src/router/modules/article.js Vedi File

@@ -50,9 +50,10 @@ export default {
50 50
     },
51 51
     {
52 52
       path: '/articles/editArticle/:id',
53
-      component: () => import('@/scrm_pages/article/editArticle'),
53
+      component: () => import('@/scrm_pages/article/edit_article'),
54 54
       name: 'editArticle',
55 55
       hidden:true,
56
+      is_menu: false,
56 57
       meta: { title: 'editArticle', noCache: true }
57 58
     },
58 59
     {

+ 24 - 22
src/scrm_pages/article/articleList.vue Vedi File

@@ -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" @change="selectAllFunc" v-model="selectAll">全选</el-checkbox> 
38
+              <el-checkbox style="width: 30px" @change="selectAllFunc" v-model="selectAll">全选</el-checkbox>
39 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 44
           <div class="checkbox" >
45
-             <el-checkbox v-model='article.checked' @change="selectProduct"></el-checkbox>          
45
+             <el-checkbox v-model='article.checked' @change="selectProduct"></el-checkbox>
46 46
           </div>
47 47
 
48 48
           <div class="activity-image-panel">
@@ -206,7 +206,7 @@
206 206
              this.selectedArticles = val;
207 207
          },
208 208
            deleteArticle(id,index){
209
-             
209
+
210 210
              this.$confirm('确定要删除吗?删除后信息将无法恢复!','删除提示',{
211 211
                dangerouslyUseHTMLString:true,
212 212
                 confirmButtonText: '确定',
@@ -229,53 +229,55 @@
229 229
                console.log("文章id",id);
230 230
                console.log("文章内型",articletype)
231 231
                if(articletype == 1){
232
-                  this.$router.push({path:"/articles/editArticle/"+id});                                  
232
+                  this.$router.push("/articles/editArticle");
233
+                 // this.$router.push({name:'editArticle'})
234
+
233 235
                }
234 236
                if(articletype == 2){
235
-                  //  this.$router.push({path:"/articles/editVido/"+id});   
236
-                   this.$router.push({name:'editVido',params: {id:id}})             
237
+                  //  this.$router.push({path:"/articles/editVido/"+id});
238
+                   this.$router.push({name:'editVido',params: {id:id}})
237 239
                }
238 240
            },
239
-          
241
+
240 242
           selectProduct(val){
241 243
             var ids =[];
242 244
             for(let i=0,len=this.articsData.length;i<len;i++){
243 245
                 if(!this.articsData[i].checked){
244
-                   this.selectAll = false;                                  
246
+                   this.selectAll = false;
245 247
                 }else{
246 248
                   this.selectAll = true;
247 249
                   this.selectReply = val;
248 250
                   ids.push(this.articsData[i].id);
249 251
                   this.selectReply = ids;
250 252
                 }
251
-            }    
252
-            console.log("ids是什么",ids);        
253
+            }
254
+            console.log("ids是什么",ids);
253 255
         },
254 256
         selectAllFunc(val){
255 257
           var ids = [];
256 258
            this.articsData.map((item,i)=>{
257
-             item.checked = val; 
258
-           }) 
259
+             item.checked = val;
260
+           })
259 261
 
260 262
             for(let i=0,len=this.articsData.length;i<len;i++){
261 263
                 if(!this.articsData[i].checked){
262
-                   this.selectAll = false;                                  
264
+                   this.selectAll = false;
263 265
                 }else{
264 266
                   this.selectAll = true;
265 267
                   this.selectReply = val;
266 268
                   ids.push(this.articsData[i].id);
267 269
                   this.selectReply = ids;
268 270
                 }
269
-            }    
270
-            console.log("ids是什么",ids);        
271
+            }
272
+            console.log("ids是什么",ids);
271 273
         },
272 274
 
273 275
         deleteAllArticles(){
274 276
             if (this.selectReply.length==0) {
275 277
             this.$message.error("请选择要删除的信息");
276 278
             return false;
277
-          } 
278
-          
279
+          }
280
+
279 281
           this.$confirm('确认要删除所选的文章吗?','删除提示',{
280 282
              dangerouslyUseHTMLString:true,
281 283
              confirmButtonText: '确定',
@@ -287,7 +289,7 @@
287 289
                    var idMap = {};
288 290
                   for (let index = 0; index < this.selectReply.length; index++) {
289 291
                     ids.push(this.selectReply[index]);
290
-                     idMap[this.selectReply[index]] = this.selectReply[index];                   
292
+                     idMap[this.selectReply[index]] = this.selectReply[index];
291 293
                   }
292 294
                    console.log("第二个ids是什么?",ids);
293 295
                   deleteAllArticles({ids:ids}).then(response=>{
@@ -295,7 +297,7 @@
295 297
                             for (let index = this.articsData.length-1; index >= 0; index--) {
296 298
                               if(this.articsData[index].id in idMap){
297 299
                                    this.articsData.splice(index,1)
298
-                              }                            
300
+                              }
299 301
                             }
300 302
                              this.$message.success("删除评论成功");
301 303
                        }
@@ -318,7 +320,7 @@
318 320
       this.GetAllCategory();
319 321
     },
320 322
 
321
-     
323
+
322 324
   }
323 325
 </script>
324 326
 
@@ -447,5 +449,5 @@
447 449
         left:-10px;
448 450
     }
449 451
 }
450
-    
452
+
451 453
 </style>

src/scrm_pages/article/editArticle.vue → src/scrm_pages/article/edit_article.vue Vedi File

@@ -39,7 +39,7 @@
39 39
                     </el-upload>
40 40
                   </div>
41 41
                 </el-col>
42
-              
42
+
43 43
               <!-- 第二张图片 -->
44 44
                 <el-col :span="3">
45 45
                   <div v-if="picshow">
@@ -119,24 +119,25 @@
119 119
            <el-button @click="gobackList()">返回文章列表</el-button>
120 120
            </span>
121 121
          </el-dialog>
122
-         
122
+
123 123
        <el-dialog
124 124
          title="提示"
125 125
          :visible.sync = "centercancelVisible"
126 126
          width="30%"
127 127
          center>
128
-         <span style="center">是否确定取消编辑此文章/视频</span>
128
+         <span >是否确定取消编辑此文章/视频</span>
129 129
          <span slot="footer" class="dialog-footer">
130 130
          <el-button type="primary" @click="centercancelVisible = false" >确认</el-button>
131
-         <el-button @click="centercancelVisible = false">取消</el-button>   
132
-        </span>   
131
+         <el-button @click="centercancelVisible = false">取消</el-button>
132
+        </span>
133 133
        </el-dialog>
134 134
         </div>
135 135
     </div>
136 136
 </template>
137 137
 
138 138
 <script>
139
-    import BreadCrumb from '../components/bread-crumb'
139
+    // import BreadCrumb from '../components/bread-crumb'
140
+    import BreadCrumb from "@/scrm_pages/components/bread-crumb"
140 141
     import { quillEditor } from 'vue-quill-editor'
141 142
     import 'quill/dist/quill.core.css'
142 143
     import 'quill/dist/quill.snow.css'
@@ -146,7 +147,7 @@
146 147
     import { getFileExtension} from '@/utils/tools'
147 148
     import {getEditArticle,getMenus,UpdataArticleInfo,previewEditArticle,saveArticleDraft} from '@/api/act/submitinfo'
148 149
     export default {
149
-        name: "editArticle",
150
+        name: "EditArticle",
150 151
          components:{
151 152
             BreadCrumb,
152 153
             Neditor,
@@ -203,7 +204,7 @@
203 204
          methods:{
204 205
              //第一个图片
205 206
       handleAvatarSuccess(res, file) {
206
-       this.arctileform.imgs = this.qiniuDomain + res.url;      
207
+       this.arctileform.imgs = this.qiniuDomain + res.url;
207 208
       },
208 209
        handleAvatarError(err, file, fileList) {
209 210
             this.$message.error(err);
@@ -239,14 +240,14 @@
239 240
                     resolve(true)
240 241
                 }).catch(err => {
241 242
                     reject(false)
242
-                    
243
+
243 244
                 })
244 245
             })
245 246
           return isJPG && isLt2M;
246 247
       },
247 248
       //第二个图片
248 249
       handleAvatartwoSuccess(res, file) {
249
-        this.imageUrl = this.qiniuDomain + res.url;    
250
+        this.imageUrl = this.qiniuDomain + res.url;
250 251
       },
251 252
        handleAvatartwoError(err, file, fileList) {
252 253
             this.$message.error(err);
@@ -287,9 +288,9 @@
287 288
       },
288 289
 
289 290
       //第三张图片
290
-      handleAvatarlastSuccess(res, file) {  
291
+      handleAvatarlastSuccess(res, file) {
291 292
         this.imageUrlLast = this.qiniuDomain + res.url;
292
-      
293
+
293 294
       },
294 295
        handleAvatarlastError(err, file, fileList) {
295 296
             this.$message.error(err);
@@ -325,37 +326,37 @@
325 326
                 }).catch(err => {
326 327
                     reject(false)
327 328
                 })
328
-            }) 
329
+            })
329 330
         },
330 331
         getEditArticle(){
331 332
             const id = this.$route.params && this.$route.params.id;
332 333
             console.log("编辑文章id是什么?",id)
333 334
            getEditArticle(id,this.arctileform).then(response=>{
334 335
                  if(response.data.state == 1){
335
-                     var articles = response.data.data.articles;                      
336
-                                     
337
-                     console.log("articles是什么",articles)            
336
+                     var articles = response.data.data.articles;
337
+
338
+                     console.log("articles是什么",articles)
338 339
                      this.arctileform.title = articles.title;
339 340
                      this.arctileform.content = articles.content;
340 341
                      this.arctileform.imgs = articles.imgs;
341 342
                      console.log("ww",this.arctileform.imgs)
342 343
                      this.arctileform.class_id = articles.class_id;
343 344
                      console.log(articles.title)
344
-                    
345
+
345 346
                  }
346 347
            });
347
-        }, 
348
+        },
348 349
         getMenus(){
349 350
             getMenus().then(response =>{
350 351
                 if(response.data.state == 1){
351 352
                    var categorys = response.data.data.categorys;
352 353
                    this.options = categorys;
353 354
                    console.log("分类号",categorys)
354
-                   
355
+
355 356
                 }
356 357
             })
357 358
         },
358
-        
359
+
359 360
         UpdataArticleInfo(forName){
360 361
               this.arctileform.content = this.$refs.neditor.content;
361 362
               const id = this.$route.params && this.$route.params.id;
@@ -367,9 +368,9 @@
367 368
                          if(response.data.state == 1){
368 369
                           var aritcls = response.data.data.articls;
369 370
                           console.log("更新内容是多少",aritcls)
370
-                             this.dialogVisible = true;      
371
+                             this.dialogVisible = true;
371 372
                          }
372
-                    }); 
373
+                    });
373 374
                  }
374 375
              })
375 376
         },
@@ -391,7 +392,7 @@
391 392
         },
392 393
         // preview(forName){
393 394
         //     this.form.act_content = this.$refs.neditor.content;
394
-        //     const id = this.$route.params && this.$route.params.id; 
395
+        //     const id = this.$route.params && this.$route.params.id;
395 396
         //     this.$refs[forName].validate((valid)=>{
396 397
         //       if(valid){
397 398
         //          previewEditArticle(id,this.form).then(response=>{
@@ -415,11 +416,11 @@
415 416
             var patt = /<img[^>]+src=['"]([^'"]+)['"]+/g;
416 417
             while ((temp = patt.exec(content)) != null) {
417 418
             images.push(temp[1]);
418
-            }                 
419
+            }
419 420
             //  console.log("图片数组",images);
420 421
              this.arctileform.imgs = images[0];
421 422
              this.imageUrl = images[1];
422
-             this.imageUrlLast = images [2];           
423
+             this.imageUrlLast = images [2];
423 424
         },
424 425
       },
425 426
       created(){