|
@@ -465,15 +465,17 @@ export default {
|
|
|
}
|
|
|
|
|
|
const htmlStr=document.getElementById('report-html-content').outerHTML.replace(/contenteditable="true"/g,'contenteditable="false"');
|
|
|
- const res = await saveChapterReport({
|
|
|
- ReportChapterId: this.reportInfo.ReportChapterId,
|
|
|
- // Title: this.reportInfo.Title,
|
|
|
- Content: htmlStr,
|
|
|
- ContentStruct:this.formatContentListElData(),
|
|
|
- })
|
|
|
- if(res.Ret !== 200) return
|
|
|
+ return new Promise(async(resolve,reject) => {
|
|
|
+ const res = await saveChapterReport({
|
|
|
+ ReportChapterId: this.reportInfo.ReportChapterId,
|
|
|
+ Content: htmlStr,
|
|
|
+ ContentStruct:this.formatContentListElData(),
|
|
|
+ })
|
|
|
+ if(res.Ret !== 200) return
|
|
|
+ resolve(true)
|
|
|
|
|
|
- type==='save' && this.$message.success(res.Msg);
|
|
|
+ type==='save' && this.$message.success(res.Msg);
|
|
|
+ })
|
|
|
},
|
|
|
|
|
|
/* 章节预览 */
|
|
@@ -495,6 +497,9 @@ export default {
|
|
|
|
|
|
/* 单章节发布 */
|
|
|
async handlePublishChapter() {
|
|
|
+
|
|
|
+ const saveRes = await this.handleAutoSaveChapter('auto');
|
|
|
+ if(!saveRes) return
|
|
|
|
|
|
const res = await publishChapterReport({
|
|
|
ReportChapterId: this.reportInfo.ReportChapterId
|
|
@@ -503,12 +508,6 @@ export default {
|
|
|
this.$message.success(this.$t('MsgPrompt.submit_msg'))
|
|
|
|
|
|
this.$refs.chapterContRef&&this.$refs.chapterContRef.getChapterList()
|
|
|
-
|
|
|
- // this.$refs.chapterContRef.handleMarkOver(this.reportInfo.ReportChapterId)
|
|
|
- // setTimeout(() => {
|
|
|
- // this.timer && clearInterval(this.timer);
|
|
|
- // this.$router.replace({ path: '/reportNew' });
|
|
|
- // }, 1000);
|
|
|
}
|
|
|
},
|
|
|
|