|
@@ -29,7 +29,6 @@
|
|
<tableNoData :text="$t('Common.no_cont_msg')"/>
|
|
<tableNoData :text="$t('Common.no_cont_msg')"/>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
-
|
|
|
|
<!-- 章节报告预览 -->
|
|
<!-- 章节报告预览 -->
|
|
<template v-else-if="reportCoopType===2&&selectChapterId&&!editChapterId">
|
|
<template v-else-if="reportCoopType===2&&selectChapterId&&!editChapterId">
|
|
<div style="max-height:100vh;overflow-y:auto;">
|
|
<div style="max-height:100vh;overflow-y:auto;">
|
|
@@ -49,11 +48,12 @@
|
|
@openBaseInfo="showReportBaseInfo=true"
|
|
@openBaseInfo="showReportBaseInfo=true"
|
|
@handleRefreshAllChart="handleRefreshAllChart"
|
|
@handleRefreshAllChart="handleRefreshAllChart"
|
|
@handlePreviewReport="reportInfo.ReportChapterId?handlePreviewChapter():handlePreviewReport()"
|
|
@handlePreviewReport="reportInfo.ReportChapterId?handlePreviewChapter():handlePreviewReport()"
|
|
- @handleSaveContent="reportInfo.ReportChapterId?handleAutoSaveChapter('save'):handleSaveContent({isAutoSave:false})"
|
|
|
|
|
|
+ @handleSaveContent="reportInfo.ReportChapterId?handleAutoSaveChapter('save'):handleSaveContent({isAutoSave:false,IsManualSave:true})"
|
|
@handlePublishOpt="(type) =>{reportInfo.ReportChapterId?handlePublishChapter():handlePublishOpt(type)}"
|
|
@handlePublishOpt="(type) =>{reportInfo.ReportChapterId?handlePublishChapter():handlePublishOpt(type)}"
|
|
@update="()=>{$refs.chapterContRef&&$refs.chapterContRef.getChapterList()}"
|
|
@update="()=>{$refs.chapterContRef&&$refs.chapterContRef.getChapterList()}"
|
|
|
|
+ @handleVersionRecord="handleVersionRecord()"
|
|
/>
|
|
/>
|
|
-
|
|
|
|
|
|
+
|
|
<div class="main-wrap">
|
|
<div class="main-wrap">
|
|
<div class="report-action-wrap">
|
|
<div class="report-action-wrap">
|
|
<ul class="top-type-list">
|
|
<ul class="top-type-list">
|
|
@@ -186,8 +186,8 @@
|
|
<div class="close-icon" @click="handleCloseRight">
|
|
<div class="close-icon" @click="handleCloseRight">
|
|
<img src="~@/assets/img/smartReport/icon14.png" alt="">
|
|
<img src="~@/assets/img/smartReport/icon14.png" alt="">
|
|
</div>
|
|
</div>
|
|
- <div style="overflow-x:auto;height:calc(100% + 12px);">
|
|
|
|
- <div style="min-width:800px;height: 100%;">
|
|
|
|
|
|
+ <div :style="rightType !=='versionRecord' ? 'overflow-x:auto;height:calc(100% + 12px);' : 'overflow-x:auto;'">
|
|
|
|
+ <div :style="rightType !=='versionRecord' ? 'min-width: 800px; height: 100%;' : 'height: 100%;'">
|
|
<TextEdit
|
|
<TextEdit
|
|
v-if="rightType==='text'"
|
|
v-if="rightType==='text'"
|
|
:key="activeId"
|
|
:key="activeId"
|
|
@@ -215,6 +215,8 @@
|
|
<ETASandBox v-if="rightType==='etaSandBox'"/>
|
|
<ETASandBox v-if="rightType==='etaSandBox'"/>
|
|
<!-- 语义分析 -->
|
|
<!-- 语义分析 -->
|
|
<SemanticAnalysis v-if="rightType==='semanticAnalysis'"/>
|
|
<SemanticAnalysis v-if="rightType==='semanticAnalysis'"/>
|
|
|
|
+ <!-- 版本记录 -->
|
|
|
|
+ <VersionRecord v-if="rightType==='versionRecord'" :selectChapterId="selectChapterId" @handleRestore="handleRestore"/>
|
|
<!-- 版图资源库 -->
|
|
<!-- 版图资源库 -->
|
|
<ImgSource v-if="rightType==='imgSource'" @change="handleInsertImgSource" @close="handleCloseRight"/>
|
|
<ImgSource v-if="rightType==='imgSource'" @change="handleInsertImgSource" @close="handleCloseRight"/>
|
|
</div>
|
|
</div>
|
|
@@ -293,6 +295,7 @@ import reportBaseInfo from '../components/reportBaseInfoDia.vue'
|
|
import StatisticAnalysis from './components/StatisticAnalysis.vue'
|
|
import StatisticAnalysis from './components/StatisticAnalysis.vue'
|
|
import ETAPriceChart from './components/ETAPriceChart.vue'
|
|
import ETAPriceChart from './components/ETAPriceChart.vue'
|
|
import ETASandBox from './components/ETASandBox.vue'
|
|
import ETASandBox from './components/ETASandBox.vue'
|
|
|
|
+import VersionRecord from './components/VersionRecord.vue'
|
|
import SemanticAnalysis from './components/SemanticAnalysis.vue'
|
|
import SemanticAnalysis from './components/SemanticAnalysis.vue'
|
|
import { getUrlParams } from '@/utils/common'
|
|
import { getUrlParams } from '@/utils/common'
|
|
import reportApproveConfig from "@/mixins/reportApproveConfig.js"
|
|
import reportApproveConfig from "@/mixins/reportApproveConfig.js"
|
|
@@ -301,6 +304,7 @@ import editHeader from '../components/reportEditHeader.vue';
|
|
import chapterWrapper from '../components/chapterEditWrapper.vue';
|
|
import chapterWrapper from '../components/chapterEditWrapper.vue';
|
|
import smartReportDetail from './reportDetail.vue'
|
|
import smartReportDetail from './reportDetail.vue'
|
|
import { GetQueryString } from '@/utils/common'
|
|
import { GetQueryString } from '@/utils/common'
|
|
|
|
+import { reportV2Interface } from '@/api/modules/reportV2';
|
|
export default {
|
|
export default {
|
|
mixins:[reportApproveConfig],
|
|
mixins:[reportApproveConfig],
|
|
name:"smartReportEditV2",
|
|
name:"smartReportEditV2",
|
|
@@ -318,6 +322,7 @@ export default {
|
|
StatisticAnalysis,
|
|
StatisticAnalysis,
|
|
ETAPriceChart,
|
|
ETAPriceChart,
|
|
ETASandBox,
|
|
ETASandBox,
|
|
|
|
+ VersionRecord,
|
|
SemanticAnalysis,
|
|
SemanticAnalysis,
|
|
ImgSource,
|
|
ImgSource,
|
|
editHeader,
|
|
editHeader,
|
|
@@ -422,6 +427,38 @@ export default {
|
|
this.getChapterDetail()
|
|
this.getChapterDetail()
|
|
},
|
|
},
|
|
|
|
|
|
|
|
+ /* 版本记录 */
|
|
|
|
+ async handleVersionRecord() {
|
|
|
|
+ this.showRight=true
|
|
|
|
+ this.rightType = 'versionRecord';
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ /* 恢复版本 */
|
|
|
|
+ handleRestore(Id) {
|
|
|
|
+ this.$confirm('确认将报告恢复到该版本吗?', '提示', {
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
+ type: 'warning'
|
|
|
|
+ }).then(() => {
|
|
|
|
+ this.reportHistoryRevert(Id)
|
|
|
|
+ }).catch(() => {
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ /* 恢复版本报告请求 */
|
|
|
|
+ async reportHistoryRevert(Id) {
|
|
|
|
+ reportV2Interface.reportHistoryRevert({
|
|
|
|
+ Id
|
|
|
|
+ }).then((res) => {
|
|
|
|
+ if(res.Ret !== 200) return
|
|
|
|
+ this.$message.success('恢复成功!');
|
|
|
|
+ if (this.$route.query.coopType === '1') {
|
|
|
|
+ this.getReportDetail()
|
|
|
|
+ } else {
|
|
|
|
+ this.getChapterDetail()
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+
|
|
/* 获取章节报告详情 */
|
|
/* 获取章节报告详情 */
|
|
async getChapterDetail() {
|
|
async getChapterDetail() {
|
|
if(!this.selectChapterId) return
|
|
if(!this.selectChapterId) return
|
|
@@ -438,14 +475,13 @@ export default {
|
|
$('.edit-smart-report-page')[0].scrollTop = 0;
|
|
$('.edit-smart-report-page')[0].scrollTop = 0;
|
|
if(this.editChapterId) {
|
|
if(this.editChapterId) {
|
|
this.timer = setInterval(() => {
|
|
this.timer = setInterval(() => {
|
|
- this.handleAutoSaveChapter();
|
|
|
|
|
|
+ this.handleAutoSaveChapter('');
|
|
}, 6000);
|
|
}, 6000);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
/* 章节自动保存 存草稿*/
|
|
/* 章节自动保存 存草稿*/
|
|
- async handleAutoSaveChapter(type='auto') {
|
|
|
|
-
|
|
|
|
|
|
+ async handleAutoSaveChapter(type) {
|
|
if(!this.reportInfo.ReportChapterId||!this.editChapterId) return
|
|
if(!this.reportInfo.ReportChapterId||!this.editChapterId) return
|
|
if(!document.getElementById('report-html-content')){
|
|
if(!document.getElementById('report-html-content')){
|
|
this.timer && clearInterval(this.timer);
|
|
this.timer && clearInterval(this.timer);
|
|
@@ -458,6 +494,7 @@ export default {
|
|
ReportChapterId: this.reportInfo.ReportChapterId,
|
|
ReportChapterId: this.reportInfo.ReportChapterId,
|
|
Content: htmlStr,
|
|
Content: htmlStr,
|
|
ContentStruct:this.formatContentListElData(),
|
|
ContentStruct:this.formatContentListElData(),
|
|
|
|
+ IsManualSave: type === '' ? false : true //是否手动保存
|
|
})
|
|
})
|
|
if(res.Ret !== 200) return
|
|
if(res.Ret !== 200) return
|
|
resolve(true)
|
|
resolve(true)
|
|
@@ -673,7 +710,8 @@ export default {
|
|
path: '/smartReportDetail',
|
|
path: '/smartReportDetail',
|
|
query:{
|
|
query:{
|
|
id:this.$route.query.id,
|
|
id:this.$route.query.id,
|
|
- type:'preview'
|
|
|
|
|
|
+ type:'preview',
|
|
|
|
+ isVersionRecord:'false'
|
|
}
|
|
}
|
|
});
|
|
});
|
|
window.open(href, '_blank');
|
|
window.open(href, '_blank');
|
|
@@ -1125,7 +1163,7 @@ export default {
|
|
},1000),
|
|
},1000),
|
|
|
|
|
|
// 自动/存草稿保存内容
|
|
// 自动/存草稿保存内容
|
|
- handleSaveContent({isAutoSave}){
|
|
|
|
|
|
+ handleSaveContent({isAutoSave, IsManualSave}){
|
|
const html=document.getElementById('report-html-content').outerHTML.replace(/contenteditable="true"/g,'contenteditable="false"');
|
|
const html=document.getElementById('report-html-content').outerHTML.replace(/contenteditable="true"/g,'contenteditable="false"');
|
|
return new Promise((resolve,reject)=>{
|
|
return new Promise((resolve,reject)=>{
|
|
const id=this.$route.query.id||0
|
|
const id=this.$route.query.id||0
|
|
@@ -1144,6 +1182,7 @@ export default {
|
|
Content:html,
|
|
Content:html,
|
|
ContentStruct:this.formatContentListElData(),
|
|
ContentStruct:this.formatContentListElData(),
|
|
NoChange:this.contentChange?2:1,
|
|
NoChange:this.contentChange?2:1,
|
|
|
|
+ IsManualSave,
|
|
...imgParams
|
|
...imgParams
|
|
}).then(res=>{
|
|
}).then(res=>{
|
|
if(res.Ret===200){
|
|
if(res.Ret===200){
|
|
@@ -1160,7 +1199,7 @@ export default {
|
|
async handlePublishOpt(type){
|
|
async handlePublishOpt(type){
|
|
if(document.getElementById('report-html-content')) {
|
|
if(document.getElementById('report-html-content')) {
|
|
// 存一次草稿
|
|
// 存一次草稿
|
|
- const saveRes=await this.handleSaveContent({isAutoSave:true})
|
|
|
|
|
|
+ const saveRes=await this.handleSaveContent({isAutoSave:true,IsManualSave:true})
|
|
if(!saveRes) return
|
|
if(!saveRes) return
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1382,7 +1421,7 @@ export default {
|
|
window.addEventListener('message',this.setSheetIframeStyle)
|
|
window.addEventListener('message',this.setSheetIframeStyle)
|
|
if(this.reportCoopType===1) {
|
|
if(this.reportCoopType===1) {
|
|
this.timer = setInterval(() => {
|
|
this.timer = setInterval(() => {
|
|
- this.handleSaveContent({isAutoSave:true});
|
|
|
|
|
|
+ this.handleSaveContent({isAutoSave:true,IsManualSave:false});
|
|
}, 6000);
|
|
}, 6000);
|
|
}
|
|
}
|
|
},
|
|
},
|