csx 5 년 전
부모
커밋
405fb2237c
3개의 변경된 파일52개의 추가작업 그리고 48개의 파일을 삭제
  1. 2 1
      src/router/modules/article.js
  2. 24 22
      src/scrm_pages/article/articleList.vue
  3. 26 25
      src/scrm_pages/article/edit_article.vue

+ 2 - 1
src/router/modules/article.js 파일 보기

@@ -50,9 +50,10 @@ export default {
50 50
     },
51 51
     {
52 52
       path: '/articles/editArticle',
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 파일 보기

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

src/scrm_pages/article/editArticle.vue → src/scrm_pages/article/edit_article.vue 파일 보기

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