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