Browse Source

Merge branch 'custom' of http://8.136.199.33:3000/eta_front/eta_front into custom

ldong 2 months ago
parent
commit
96f73f428a

+ 3 - 3
src/views/dataEntry_manage/databaseComponents/batchComputedSave.vue

@@ -26,9 +26,9 @@
 					>
 						<el-option
 							v-for="item in frequencyArr"
-							:key="item"
-							:label="item"
-							:value="item"
+							:key="item.value"
+							:label="item.label"
+							:value="item.value"
 						>
 						</el-option>
 					</el-select>

+ 2 - 0
src/views/report_manage/reportV2/components/chapterEditWrapper.vue

@@ -485,6 +485,8 @@ export default {
 
     //选择章节 预览
     async chooseChapter(item) {
+      this.$emit('change',{ selectChapterId: 0,editChapterId:0 })
+      
       this.editChapterId && this.handleMarkOver(this.editChapterId);
 
       if(item.IsAuth) {

+ 16 - 8
src/views/report_manage/reportV2/normalReport/editReport.vue

@@ -255,15 +255,20 @@ export default {
 
 			//如果富文本中有未上传完成的图片,去除这个dom
 			$('.fr-element').find('img.fr-uploading').length&&$('.fr-element').find('img.fr-uploading').remove()
-			const res = await saveChapterReport({
-				ReportChapterId: this.reportInfo.ReportChapterId,
-				// Title: this.reportInfo.Title,
-				Content: $('.fr-element').html()
-			})
-			if(res.Ret !== 200) return 
 
-			this.lastsavetime = http.dateFormatter(new Date(), true);
-			type==='save' && this.$message.success(res.Msg);
+			return new Promise(async(resolve,reject) => {
+				const res = await saveChapterReport({
+					ReportChapterId: this.reportInfo.ReportChapterId,
+					// Title: this.reportInfo.Title,
+					Content: $('.fr-element').html()
+				})
+				if(res.Ret !== 200) return
+				resolve(true)
+	
+				this.lastsavetime = http.dateFormatter(new Date(), true);
+				type==='save' && this.$message.success(res.Msg);
+
+			})
 		},
 
 		/* 章节预览 */
@@ -284,6 +289,9 @@ export default {
 			//如果富文本中有未上传完成的图片,去除这个dom
 			$('.fr-element').find('img.fr-uploading').length&&$('.fr-element').find('img.fr-uploading').remove()
 
+			const saveRes = await this.handleAutoSaveChapter('auto');
+			if(!saveRes) return
+
 			const res = await publishChapterReport({
         ReportChapterId: this.reportInfo.ReportChapterId
       });

+ 13 - 14
src/views/report_manage/reportV2/smartReport/editReport.vue

@@ -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);
             }
 		},