csx 5 years ago
parent
commit
405fb2237c

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

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

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

35
           </div>
35
           </div>
36
 
36
 
37
             <div class="filter-container" style="margin-top: 10px;margin-left: 5px">
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
               <el-button size="small" icon="el-icon-delete" @click="deleteAllArticles()">批量删除</el-button>
39
               <el-button size="small" icon="el-icon-delete" @click="deleteAllArticles()">批量删除</el-button>
40
             </div>
40
             </div>
41
-         
41
+
42
       <div class="clearfix">
42
       <div class="clearfix">
43
         <div class="published-cell" v-for="(article,index) in articsData" :key="article.id">
43
         <div class="published-cell" v-for="(article,index) in articsData" :key="article.id">
44
           <div class="checkbox" >
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
           </div>
46
           </div>
47
 
47
 
48
           <div class="activity-image-panel">
48
           <div class="activity-image-panel">
207
              this.selectedArticles = val;
207
              this.selectedArticles = val;
208
          },
208
          },
209
            deleteArticle(id,index){
209
            deleteArticle(id,index){
210
-             
210
+
211
              this.$confirm('确定要删除吗?删除后信息将无法恢复!','删除提示',{
211
              this.$confirm('确定要删除吗?删除后信息将无法恢复!','删除提示',{
212
                dangerouslyUseHTMLString:true,
212
                dangerouslyUseHTMLString:true,
213
                 confirmButtonText: '确定',
213
                 confirmButtonText: '确定',
230
                console.log("文章id",id);
230
                console.log("文章id",id);
231
                console.log("文章内型",articletype)
231
                console.log("文章内型",articletype)
232
                if(articletype == 1){
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
                if(articletype == 2){
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
           selectProduct(val){
243
           selectProduct(val){
242
             var ids =[];
244
             var ids =[];
243
             for(let i=0,len=this.articsData.length;i<len;i++){
245
             for(let i=0,len=this.articsData.length;i<len;i++){
244
                 if(!this.articsData[i].checked){
246
                 if(!this.articsData[i].checked){
245
-                   this.selectAll = false;                                  
247
+                   this.selectAll = false;
246
                 }else{
248
                 }else{
247
                   this.selectAll = true;
249
                   this.selectAll = true;
248
                   this.selectReply = val;
250
                   this.selectReply = val;
249
                   ids.push(this.articsData[i].id);
251
                   ids.push(this.articsData[i].id);
250
                   this.selectReply = ids;
252
                   this.selectReply = ids;
251
                 }
253
                 }
252
-            }    
253
-            console.log("ids是什么",ids);        
254
+            }
255
+            console.log("ids是什么",ids);
254
         },
256
         },
255
         selectAllFunc(val){
257
         selectAllFunc(val){
256
           var ids = [];
258
           var ids = [];
257
            this.articsData.map((item,i)=>{
259
            this.articsData.map((item,i)=>{
258
-             item.checked = val; 
259
-           }) 
260
+             item.checked = val;
261
+           })
260
 
262
 
261
             for(let i=0,len=this.articsData.length;i<len;i++){
263
             for(let i=0,len=this.articsData.length;i<len;i++){
262
                 if(!this.articsData[i].checked){
264
                 if(!this.articsData[i].checked){
263
-                   this.selectAll = false;                                  
265
+                   this.selectAll = false;
264
                 }else{
266
                 }else{
265
                   this.selectAll = true;
267
                   this.selectAll = true;
266
                   this.selectReply = val;
268
                   this.selectReply = val;
267
                   ids.push(this.articsData[i].id);
269
                   ids.push(this.articsData[i].id);
268
                   this.selectReply = ids;
270
                   this.selectReply = ids;
269
                 }
271
                 }
270
-            }    
271
-            console.log("ids是什么",ids);        
272
+            }
273
+            console.log("ids是什么",ids);
272
         },
274
         },
273
 
275
 
274
         deleteAllArticles(){
276
         deleteAllArticles(){
275
             if (this.selectReply.length==0) {
277
             if (this.selectReply.length==0) {
276
             this.$message.error("请选择要删除的信息");
278
             this.$message.error("请选择要删除的信息");
277
             return false;
279
             return false;
278
-          } 
279
-          
280
+          }
281
+
280
           this.$confirm('确认要删除所选的文章吗?','删除提示',{
282
           this.$confirm('确认要删除所选的文章吗?','删除提示',{
281
              dangerouslyUseHTMLString:true,
283
              dangerouslyUseHTMLString:true,
282
              confirmButtonText: '确定',
284
              confirmButtonText: '确定',
288
                    var idMap = {};
290
                    var idMap = {};
289
                   for (let index = 0; index < this.selectReply.length; index++) {
291
                   for (let index = 0; index < this.selectReply.length; index++) {
290
                     ids.push(this.selectReply[index]);
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
                    console.log("第二个ids是什么?",ids);
295
                    console.log("第二个ids是什么?",ids);
294
                   deleteAllArticles({ids:ids}).then(response=>{
296
                   deleteAllArticles({ids:ids}).then(response=>{
296
                             for (let index = this.articsData.length-1; index >= 0; index--) {
298
                             for (let index = this.articsData.length-1; index >= 0; index--) {
297
                               if(this.articsData[index].id in idMap){
299
                               if(this.articsData[index].id in idMap){
298
                                    this.articsData.splice(index,1)
300
                                    this.articsData.splice(index,1)
299
-                              }                            
301
+                              }
300
                             }
302
                             }
301
                              this.$message.success("删除评论成功");
303
                              this.$message.success("删除评论成功");
302
                        }
304
                        }
319
       this.GetAllCategory();
321
       this.GetAllCategory();
320
     },
322
     },
321
 
323
 
322
-     
324
+
323
   }
325
   }
324
 </script>
326
 </script>
325
 
327
 
448
         left:-10px;
450
         left:-10px;
449
     }
451
     }
450
 }
452
 }
451
-    
453
+
452
 </style>
454
 </style>

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

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