xiaoming_global 5 years ago
parent
commit
3e8fcbc61f

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

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