Parcourir la source

Merge branch 'ETA_2.4' of eta_gn_front/eta_front into master

leichen il y a 1 mois
Parent
commit
01e6afff69

+ 38 - 2
src/api/modules/pptApi.js

@@ -316,8 +316,44 @@ export default{
      */
     getAuthPPtList: params => {
         return http.get('pptv2/report/auth_list',params)
-    }
-
+    },
 
+    /**
+     * 获取版本列表
+     * @param {*} params 
+     * PptId
+     * @returns 
+     */
+    getPptHistoryList: params => {
+        return http.get('ppt_history/list',params)
+    },
 
+    /**
+     * 获取版本详情
+     * @param {*} params 
+     * Id
+     * @returns 
+     */
+    getPptHistoryDetail: params => {
+        return http.get('ppt_history/detail',params)
+    },
+    /**
+     * 恢复到版本
+     * @param {*} params 
+     * Id
+     * @returns 
+     */
+    getPptHistoryRevert: params => {
+        return http.post('ppt_history/revert',params)
+    },
+    
+    /**
+     * 删除版本
+     * @param {*} params 
+     * Id
+     * @returns 
+     */
+    getPptHistoryDel: params => {
+        return http.post('ppt_history/del',params)
+    },
 }

+ 38 - 3
src/api/modules/reportV2.js

@@ -124,10 +124,45 @@ export const reportV2Interface = {
 	 */
 	readReportNotice: params => {
 		return http.post('/report/message/read',params)
-	}
-
-
+	},
 
+	/**
+	 * * 获取报告记录列表
+	 * @param {*ReportId} params 
+	 * @param {*ReportChapterId} params 
+	 * @returns 
+	 * */
+	reportHistoryList: params => {
+		return http.get('/report_history/list',params)
+	},
+	/**
+	 * * 获取报告记录详情
+	 * @param {*ReportId} params 
+	 * @param {*id} params 
+	 * @returns 
+	 * */
+	reportHistoryDetail: params => {
+		return http.get('/report_history/detail',params)
+	},
+	
+	/**
+	 * * 删除报告记录
+	 * @param {*ReportId} params 
+	 * @param {*Id} params 
+	 * @returns 
+	 * */
+	reportHistoryDel: params => {
+		return http.post('/report_history/del',params)
+	},
+	/**
+	 * * 恢复报告记录
+	 * @param {*ReportId} params 
+	 * @param {*Id} params 
+	 * @returns
+	 * */
+	reportHistoryRevert: params => {
+		return http.post('/report_history/revert',params)
+	},
 }
 
 

BIN
src/assets/img/version_record.png


+ 2 - 0
src/lang/modules/ReportManagement/ReportList.js

@@ -38,6 +38,7 @@ export const ReportListEn = {
   last_save_time: "Last save time",
   click_clear_btn: "Clear Content",
   click_refresh_btn: "Rfrsh",
+  version_record: "Version record",
   preview_btn: "Preview",
   save_draft_btn: "Draft",
   scheduled_publish_btn: "Schedule",
@@ -210,6 +211,7 @@ export const ReportListZh = {
   last_save_time: "最近保存时间",
   click_clear_btn: "一键清空内容",
   click_refresh_btn: "一键刷新",
+  version_record: "版本记录",
   preview_btn: "预览",
   save_draft_btn: "存草稿",
   scheduled_publish_btn: "定时发布",

+ 2 - 0
src/lang/modules/Slides/pptPresent.js

@@ -20,6 +20,7 @@ export const presentEn = {
   update_chart_btn: "Update chart",
   paste_element_btn: "Paste element",
   layer_editing: "Layer editing",
+  version_history: "Version history",
   keyword_search: "Keyword search",
   eta_chart_gallery: "Chart Gallery",
   commodity_price_curve: "Commodity Price Curve",
@@ -129,6 +130,7 @@ export const presentZh = {
   update_chart_btn: "更新图表",
   paste_element_btn: "粘贴元素",
   layer_editing: "图层编辑",
+  version_history: "版本记录",
   keyword_search: "关键字查找",
   eta_chart_gallery: "图库",
   commodity_price_curve: "商品价格曲线",

+ 2 - 0
src/utils/buttonConfig.js

@@ -42,6 +42,7 @@ export const reportManageBtn={
     reportMange_chapter_sort: 'reportMange:chapter:sort',//章节排序
     reportMange_chapter_share: 'reportMange:chapter:share',//章节分享
     reportMange_chapter_editTag: 'reportMange:chapter:editTag',//章节添加标签
+    reportMange_history: 'reportManage:history',//历史记录
 }
 /*
  *--------智能研报列表----------- 
@@ -195,6 +196,7 @@ export const pptPermission ={
     ppt_addCatalog:'ppt:addCatalog',//添加我的目录
     ppt_setShare:'ppt:setShare',//设置共享
     ppt_visible:'ppt:visible',//可见权限
+    ppt_history:'ppt:history',//添加我的目录
 }
 /*
 *--------英文PPT---------- 

+ 1 - 1
src/views/ppt_manage/mixins/layerMixins.js

@@ -21,6 +21,7 @@ export default {
   methods:{
     //改变编辑模式
     handleChangeEditModal(){
+      this.isVersionHistory = false
       //判断当前ppt是否添加了页面
       if(this.pageList.length===0){
         this.$message.warning(this.$t('Slides.msg_page_at_least_one'))
@@ -33,7 +34,6 @@ export default {
       if(this.isEditLayer){
         //进入图层编辑模式,需要退出其他模式
         this.isEditTitle = false
-        
         //如果当前活跃图层没有layers,加上
         if(!this.currentItem.layers){
           this.refleshLayerEl([])

+ 4 - 0
src/views/ppt_manage/mixins/pptEditorMixins.js

@@ -112,6 +112,7 @@ export default{
     },
     exitEditTitle(e){
         this.isEditTitle = false
+        this.isVersionHistory = false
     },
     //切换标题编辑模式
     handleEditTitle(item){
@@ -126,6 +127,7 @@ export default{
             this.isEditLayer = false
             this.activeLayerEl = {}
             this.isEditTitle = false
+            this.isVersionHistory = false
             
             this.pageList.map((item,index)=>{
                 if(item.id===id){
@@ -143,10 +145,12 @@ export default{
             })
         }
         this.isEditTitle = true
+        this.isVersionHistory = false
         if(this.isEditTitle){
             //进入标题编辑模式,需要退出其他模式
             this.isEditLayer = false
             this.activeLayerEl = {}
+            this.isVersionHistory = false
             
             //初始化该页标题的数据
             if(!this.currentItem.titleDetail){

+ 10 - 3
src/views/ppt_manage/mixins/pptMixins.js

@@ -201,9 +201,16 @@ export default {
     },
     //获取ppt详情
     async getpptDataById(id){
-      const res = this.currentLang!=='en'?await pptInterface.getpptDetail({
-        PptId:id
-      }):await pptEnInterface.getpptDetail({PptId:id})
+      let res = null
+      if (this.$route.query.isVersionRecord === 'true') {
+        res = await pptInterface.getPptHistoryDetail({
+          Id:id
+        })
+      } else {
+        res = this.currentLang!=='en'?await pptInterface.getpptDetail({
+          PptId:id
+        }):await pptEnInterface.getpptDetail({PptId:id})
+      }
       if(res.Ret===200){
         const {
             Content,

+ 227 - 0
src/views/ppt_manage/newVersion/components/layer/VersionRecord.vue

@@ -0,0 +1,227 @@
+<template>
+  <div class="statistic-analysis-wrap">
+      <div class="top-box">
+          <div class="right">
+            版本记录
+          </div>
+          <div class="left">
+              <div class="search-box">
+                  <el-switch
+                    v-model="OnlyMine"
+                    @change="handleChangeIsOnlyMine"
+                    active-text="仅显示我保存的版本">
+                  </el-switch>
+              </div>
+          </div>
+      </div>
+      <div class="main-box">
+          <div class="list-wrap" v-infinite-scroll="handleLoadMore" :infinite-scroll-immediate="true">
+              <div class="chart-item" v-for="item in list" :key="item.Id"  @mouseenter="showOperation(item.Id)"
+              @mouseleave="hideOperation">
+              <div class="item-img">
+                <img src="~@/assets/img/version_record.png"/>
+              </div>
+                  <div class="top">
+                    <el-tooltip class="item" effect="light" :content="item.Title" placement="top">
+                      <div class="title">{{ item.Title }}</div>
+                    </el-tooltip>
+                    <div class="time">{{ item.CreateTime }}</div>
+                  </div>
+                  <div class="bottom">
+                    <div class="name">{{item.AdminRealName}}</div>
+                    <div class="operation" v-show="item.showOperations">
+                      <span @click="preview(item.Id)">预览</span>
+                      <span @click="$emit('handleRestore', item.Id)">恢复</span>
+                      <span class="delete" @click="deleteVersionRecord(item.Id)">删除</span>
+                    </div>
+                  </div>
+              </div>
+              <tableNoData :text="$t('Table.prompt_slogan')" style="width: 100%;" size="mini" v-if="list.length===0&&finished"/>
+          </div>
+      </div>
+  </div>
+</template>
+
+<script>
+import {pptInterface} from '@/api/api.js';
+export default {
+  data() {
+      return {
+          list:[],
+          page:1,
+          pageSize:10,
+          finished:false,
+          loading:false,
+          OnlyMine:false,      
+      }
+  },
+  created(){
+      this.getSandBoxList()
+  },
+  methods: {
+      /* 搜索版本记录分页 */
+      async getSandBoxList() {
+        const {id} = this.$route.query
+          let params = {
+              CurrentIndex: this.page,
+              PageSize: this.pageSize,
+              PptId:id,
+              IsShowMe: this.OnlyMine,
+          };
+          this.loading=true
+          let res = await pptInterface.getPptHistoryList(params);
+          this.loading=false
+          if (res.Ret !== 200) return;
+          const arr = (res.Data.List || []).map(item => ({
+            ...item,
+            showOperations: false, // 初始时隐藏操作栏
+          }));
+          this.list =
+              this.page === 1
+              ? arr
+              : [...this.list, ...arr];
+          this.finished =  res.Data.Paging.IsEnd;
+      },
+      // 是否仅显示我保存的版本
+      handleChangeIsOnlyMine(val) {
+          this.page = 1;
+          this.list = [];
+          this.getSandBoxList();
+      },
+      handleLoadMore(){
+          if(this.finished||this.loading) return
+          this.page++
+          this.getSandBoxList()
+      },
+      // 预览
+      preview(id){
+        // this.$router.push({path:'/pptpublish', query:{id, isVersionRecord:'true'}})
+        let { href } = this.$router.resolve({ 
+          path: '/pptpublish',
+          query:{
+            id,
+            isVersionRecord:'true'
+          }
+        });
+        window.open(href, '_blank');
+      },
+      // 删除弹窗
+      deleteVersionRecord(Id){
+          this.$confirm('删除后不可恢复,是否确认删除该版本?', '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          }).then(() => {
+              this.deleteItem(Id)
+          }).catch(() => {
+          });
+      },
+      deleteItem(Id) {
+          pptInterface.getPptHistoryDel({
+              Id
+          }).then((res) => {
+              if(res.Ret !== 200) return
+              this.$message.success('删除成功!');
+              this.handleChangeIsOnlyMine()
+          });
+      },
+      showOperation(itemId) {
+        const item = this.list.find(i => i.Id === itemId);
+        if (item) {
+          this.$set(item, 'showOperations', true); // 使用 $set 以确保响应性
+        }
+      },
+      hideOperation() {
+        this.list.forEach(item => {
+          this.$set(item, 'showOperations', false); // 隐藏所有操作栏
+        });
+      },
+  },
+}
+</script>
+
+<style lang="scss" scoped>
+div{
+  box-sizing: border-box;
+}
+.statistic-analysis-wrap{
+  margin-top: 10px;
+  border: 1px solid var(--gary-gy-5-line, #C8CDD9);
+  background: #FFF;
+  .top-box{
+      padding: 20px 20px 0 20px;
+      display: flex;
+      justify-content: space-between;
+      align-items: center;
+  }
+  .main-box{
+      padding: 20px;
+      height: calc(100vh - 340px);
+      border-radius: 4px;
+      display: flex;
+      flex-direction: column;
+      .list-wrap{
+          flex: 1;
+          overflow-y: auto;
+          // display: flex;
+          // flex-wrap: wrap;
+          gap: 0 20px;
+
+      }
+  }
+}
+.chart-item {
+  position: relative;
+  width: 100%;
+  max-height: 100px;
+  margin: 10px 0;
+  padding: 10px;
+  border-radius: 10px;
+  font-size: 14px;
+  text-align: center;
+  padding-left: 20px;
+  .item-img {
+    position: absolute;
+    top: 10px;
+    left: 0;
+    width: 8px;
+    height: 54px;
+    img {
+      width: 8px;
+      height: 54px;
+    }
+  }
+  .top {
+    display: flex;
+    justify-content: space-between;
+    .title {
+      max-width: 100px;
+      overflow: hidden;
+      text-overflow: ellipsis;
+      white-space: nowrap;
+      line-height: 20px;
+      font-size: 16px;
+      color: #333333;
+    }
+    .time {
+      line-height: 20px;
+      color: #666666;
+    }
+  }
+  .bottom {
+    margin-top: 10px;
+    display: flex;
+    justify-content: space-between;
+    .name {
+      color: #333333;
+    }
+    .operation {
+      cursor: pointer;
+      color: #0052D9;
+      .delete {
+        color: #D54941;
+      }
+    }
+  }
+}
+</style>

+ 39 - 5
src/views/ppt_manage/newVersion/pptEditor.vue

@@ -164,10 +164,11 @@
                  type="primary" @click="handlePublish">{{ result.ReportSource===1?'去发布':'去提交' }}</el-button>
                 <el-button @click="handleSave('save')">{{$t('Slides.operations_save')}}</el-button>
                 <el-button type="text" @click="handleChangeEditModal"><i class="el-icon-sort" style="transform: rotate(90deg);margin-right:5px;"></i>{{isEditLayer? $t('Slides.ppt_edit_btn'):$t('Slides.layer_editing')}}</el-button>
+                <el-button type="text" v-permission="permissionBtn.pptPermission.ppt_history" @click="handleVersionHistory"><i class="el-icon-time" style="margin-right:5px;"></i>{{$t('Slides.version_history')}}</el-button>
             </div>
-            <div class="richtext-tool"></div>
+            <div class="richtext-tool" v-if="!isVersionHistory"></div>
             <!-- 防止el-tabs未渲染时触发scrollToActiveTab 报错,v-if改为v-show-->
-            <div class="addppt-right-box" v-show="!isEditLayer&&!isEditTitle">
+            <div class="addppt-right-box" v-show="!isEditLayer&&!isEditTitle && !isVersionHistory">
               <el-tabs v-model="tabsactive">
                 <el-tab-pane :label="tab.label" :name="tab.val" v-for="tab in panelTabs" :key="tab.val"></el-tab-pane>
               </el-tabs>
@@ -233,7 +234,7 @@
               </div>
             </div>
             <!-- 图层编辑 -->
-            <div class="layer-edit-box" v-if="isEditLayer">
+            <div class="layer-edit-box" v-if="isEditLayer && !isVersionHistory">
               	<el-collapse v-model="activeNames" class="tool-list">
                   <el-collapse-item :title="$t('Slides.layer_element')" name="el">
                     <div class="el-wrap">
@@ -282,6 +283,10 @@
                     @textChange="handleTextChange"
                     @applyToAll="changeSettingAll"/>
             </div>
+            <!-- 历史记录编辑 -->
+             <div class="history-edit-box" v-if="isVersionHistory">
+                <VersionRecord ref="version" :PptId="PptId" @handleRestore="handleRestore"/>
+             </div>
           </div>
     </div>
 
@@ -355,6 +360,7 @@ import {pptInterface} from '@/api/api.js';
 import * as sheetInterface from '@/api/modules/sheetApi.js';
 import ShapePreview from './components/layer/shapePreview.vue';
 import LayerEditTool from './components/layer/layerEditTool.vue';
+import VersionRecord from './components/layer/VersionRecord.vue';
 import DeletePageDialog from './components/editor/DeletePageDialog.vue';
 import ChangeFormatDialog from './components/editor/ChangeFormatDialog.vue';
 import InsertPageDialog from './components/editor/InsertPageDialog.vue';
@@ -375,7 +381,7 @@ export default {
   components: {
     IndexItem, ChooseCover, AddFormat, ShapePreview,
     LayerEditTool, DeletePageDialog, ChangeFormatDialog, InsertPageDialog, addMyClassifyDia, InsertCharts, ContextMenu, InsertSemantics,
-    ChooseCoverNew,TitleEditorTool,selectImage
+    ChooseCoverNew, TitleEditorTool,selectImage, VersionRecord
 },
   data() {
     return {
@@ -433,7 +439,8 @@ export default {
         search_have_more: true,
 
         chart_source: 1,//图表来源 1 eta 2 商品价格
-        isShowMe: false
+        isShowMe: false,
+        isVersionHistory: false,//是否显示版本历史
     };
   },
   computed:{
@@ -840,10 +847,12 @@ export default {
           this.activeLayerEl = {}
           
           this.isEditTitle = false
+          this.isVersionHistory = false
         }
         //点击当前页时,退出标题编辑模式
         if(this.currentItem&&this.currentItem.id===id){
             this.isEditTitle = false
+            this.isVersionHistory = false
             return 
         }
         this.pageList.map((item,index)=>{
@@ -1094,6 +1103,28 @@ export default {
       el.push(temp);
       return el;
     },
+    // 版本记录列表
+    handleVersionHistory(item) {
+      this.isEditLayer = false
+      this.isVersionHistory = true;
+    },
+    // 
+    handleRestore(Id) {
+      this.$confirm('确认将报告恢复到该版本吗?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+      }).then(() => {
+        this.reportHistoryRevert(Id)
+      }).catch(() => {
+      });
+    },
+    async reportHistoryRevert(Id) {
+      let res = await pptInterface.getPptHistoryRevert({Id});
+      if (res.Ret !== 200) return;
+      this.$message.success('恢复成功!');
+      this.init()
+    },
     //更新ppt页元素(数据)
     refleshElements(els){
         this.currentItem.elements = els;
@@ -1123,6 +1154,9 @@ export default {
       this.isSaved = true
       if(this.$route.query.id||this.pptId){
         await this.editPPT(FirstPage,Content,type)
+        if (this.isVersionHistory) {
+          this.$refs.version.handleChangeIsOnlyMine() // 刷新版本列表
+        }
       }else{
         // await this.addPPT(FirstPage,Content)
       }

+ 2 - 2
src/views/ppt_manage/newVersion/pptPublish.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="publish-page-wrap page-wrap">
-      <div class="pub-btn-list">
+      <div class="pub-btn-list" v-if="this.$route.query.isVersionRecord !== 'true'">
         <el-button  type="primary" plain style="width:182px;height:40px;" @click="$router.push({path:'/pptlist'})">{{$t('Slides.return_to_list')}}</el-button>
 
         <!-- 下载配置 -->
@@ -32,7 +32,7 @@
           <!-- 内容 -->
           <div class="ppt-item" v-for="(item,index) in pageList" :key="item.id">
             <!-- 自定义标题 -->
-            <div class="custom-title-wrap content" 
+            <div class="custom-title-wrap content"
                 :style="item.titleDetail?{
                     left:(item.titleDetail.baseLeft||90)*contentScale+'px',
                     top:(item.titleDetail.baseTop||40.9)*contentScale+'px',

+ 8 - 0
src/views/report_manage/reportV2/components/reportEditHeader.vue

@@ -12,6 +12,14 @@
               <img src="~@/assets/img/smartReport/back.png" alt="">
               <span>返回列表</span>
           </li>
+          <li 
+            class="action-item" 
+            @click="$emit('handleVersionRecord')"
+            v-permission="permissionBtn.reportManageBtn.reportMange_history"
+            >
+              <img src="~@/assets/img/smartReport/icon01.png" alt="">
+              <span>{{$t('ReportManage.ReportList.version_record')}}</span>
+          </li>
           <li v-if="!reportInfo.ReportChapterId" class="action-item" @click="$emit('openBaseInfo')">
               <img src="~@/assets/img/smartReport/icon01.png" alt="">
               <span>{{$t('ReportManage.ReportList.information_title')}}</span>

+ 233 - 0
src/views/report_manage/reportV2/normalReport/components/VersionRecord.vue

@@ -0,0 +1,233 @@
+<template>
+  <div class="statistic-analysis-wrap">
+      <div class="top-box">
+          <div class="right">
+            版本记录
+          </div>
+          <div class="left">
+              <div class="search-box">
+                  <el-switch
+                    v-model="OnlyMine"
+                    @change="handleChangeIsOnlyMine"
+                    active-text="仅显示我保存的版本">
+                  </el-switch>
+              </div>
+          </div>
+      </div>
+      <div class="main-box">
+          <div class="list-wrap" v-infinite-scroll="handleLoadMore" :infinite-scroll-immediate="true">
+              <div class="chart-item" v-for="item in list" :key="item.SandboxId" @mouseenter="showOperation(item.Id)" @mouseleave="hideOperation">
+                <div class="item-img">
+                  <img src="~@/assets/img/version_record.png"/>
+                </div>
+                <div class="top">
+                  <el-tooltip class="item" effect="light" :content="item.Title" placement="top">
+                    <div class="title">{{ item.Title }}</div>
+                  </el-tooltip>
+                  <div class="time">{{ item.CreateTime }}</div>
+                </div>
+                <div class="bottom">
+                  <div class="name">{{item.AdminName}}</div>
+                  <div class="operation" v-show="item.showOperations">
+                    <span @click="preview(item.Id)">预览</span>
+                    <span @click="$emit('handleRestore', item.Id)">恢复</span>
+                    <span class="delete" @click="deleteVersionRecord(item.Id)">删除</span>
+                  </div>
+                </div>
+              </div>
+              <tableNoData :text="$t('Table.prompt_slogan')" style="width: 100%;" size="mini" v-if="list.length===0&&finished"/>
+          </div>
+      </div>
+  </div>
+</template>
+
+<script>
+import { reportV2Interface } from '@/api/modules/reportV2';
+export default {
+  props:{
+    selectChapterId:{
+        type:Number,
+        default:0
+    }
+  },
+  data() {
+      return {
+          list:[],
+          page:1,
+          pageSize:10,
+          finished:false,
+          loading:false,
+          OnlyMine:false,      
+      }
+  },
+  created(){
+      this.getSandBoxList()
+  },
+  methods: {
+      /* 搜索版本记录分页 */
+      async getSandBoxList(word) {
+           this.$route.query.coopType
+          let params = {
+              CurrentIndex: this.page,
+              PageSize: this.pageSize,
+              IsShowMe: this.OnlyMine,
+          };
+          if (this.$route.query.coopType == '1') {
+              params.ReportId = this.$route.query.id;
+          } else {
+              params.ReportChapterId = this.selectChapterId + '';
+          }
+          this.loading=true
+          let res = await reportV2Interface.reportHistoryList(params);
+          this.loading=false
+          if (res.Ret !== 200) return;
+          const arr = res.Data.List || [];
+          this.list =
+              this.page === 1
+              ? arr
+              : [...this.list, ...arr];
+          this.finished =  res.Data.Paging.IsEnd;
+      },
+      // 是否仅显示我保存的版本
+      handleChangeIsOnlyMine(val) {
+          this.page = 1;
+          this.list = [];
+          this.getSandBoxList();
+      },
+      handleLoadMore(){
+          if(this.finished||this.loading) return
+          this.page++
+          this.getSandBoxList()
+      },
+      // 预览
+      preview(id){
+        let { href } = this.$router.resolve({ 
+            path: '/reportdtlV2',
+            query:{
+                id,
+                isVersionRecord:'true'
+            }
+            
+        });
+        window.open(href, '_blank');
+      },
+      // 删除弹窗
+      deleteVersionRecord(Id){
+          this.$confirm('删除后不可恢复,是否确认删除该版本?', '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          }).then(() => {
+              this.deleteItem(Id)
+          }).catch(() => {
+          });
+      },
+      deleteItem(Id) {
+          reportV2Interface.reportHistoryDel({
+              Id
+          }).then((res) => {
+              if(res.Ret !== 200) return
+              this.$message.success('删除成功!');
+              this.handleChangeIsOnlyMine()
+          });
+      },
+      showOperation(itemId) {
+        const item = this.list.find(i => i.Id === itemId);
+        if (item) {
+          this.$set(item, 'showOperations', true); // 使用 $set 以确保响应性
+        }
+      },
+      hideOperation() {
+        this.list.forEach(item => {
+          this.$set(item, 'showOperations', false); // 隐藏所有操作栏
+        });
+      },
+  },
+}
+</script>
+
+<style lang="scss" scoped>
+div{
+  box-sizing: border-box;
+}
+.statistic-analysis-wrap{
+  margin-top: 10px;
+  border: 1px solid var(--gary-gy-5-line, #C8CDD9);
+  background: #FFF;
+  .top-box{
+      padding: 20px 20px 0 20px;
+      display: flex;
+      justify-content: space-between;
+      align-items: center;
+  }
+  .main-box{
+      padding: 20px;
+      height: calc(100vh - 180px);
+      border-radius: 4px;
+      display: flex;
+      flex-direction: column;
+      .list-wrap{
+          flex: 1;
+          overflow-y: auto;
+          // display: flex;
+          // flex-wrap: wrap;
+          gap: 0 20px;
+
+      }
+  }
+}
+.chart-item {
+  position: relative;
+  width: 100%;
+  max-height: 100px;
+  margin: 10px 0;
+  padding: 10px;
+  border-radius: 10px;
+  font-size: 14px;
+  text-align: center;
+  padding-left: 20px;
+  .item-img {
+    position: absolute;
+    top: 10px;
+    left: 0;
+    width: 8px;
+    height: 54px;
+    img {
+      width: 8px;
+      height: 54px;
+    }
+  }
+  .top {
+    display: flex;
+    justify-content: space-between;
+    .title {
+      max-width: 250px;
+      overflow: hidden;
+      text-overflow: ellipsis;
+      white-space: nowrap;
+      line-height: 20px;
+      font-size: 16px;
+      color: #333333;
+    }
+    .time {
+      line-height: 20px;
+      color: #666666;
+    }
+  }
+  .bottom {
+    margin-top: 10px;
+    display: flex;
+    justify-content: space-between;
+    .name {
+      color: #333333;
+    }
+    .operation {
+      cursor: pointer;
+      color: #0052D9;
+      .delete {
+        color: #D54941;
+      }
+    }
+  }
+}
+</style>

+ 15 - 2
src/views/report_manage/reportV2/normalReport/components/insertContent.vue

@@ -19,7 +19,8 @@
     <ETASandBox v-if="actTab==='etaSandBox'" @insertHtml="item=>{$emit('insertHtml',{item,type:'image'})}"/>
     <!-- 语义分析 -->
     <SemanticAnalysis v-if="actTab==='semanticAnalysis'" @insertHtml="item => {$emit('insertHtml',{item,type:'image'})}"/>
-
+    <!-- 版本记录 -->
+    <VersionRecord v-if="actTab==='versionRecord'" ref="version" :selectChapterId="selectChapterId" @handleRestore="handleRestore"/>
   </div>
 </template>
 <script>
@@ -29,13 +30,17 @@ import StatisticAnalysis from './StatisticAnalysis.vue'
 import ETAPriceChart from './ETAPriceChart.vue'
 import ETASandBox from './ETASandBox.vue'
 import SemanticAnalysis from './SemanticAnalysis.vue'
+import VersionRecord from './VersionRecord.vue'
 export default {
   props: {
     actTab: {
       type: String
+    },
+    selectChapterId: {
+      type: Number
     }
   },
-  components: {ETAChart,ETASheet,StatisticAnalysis,ETAPriceChart,ETASandBox,SemanticAnalysis  },
+  components: {ETAChart,ETASheet,StatisticAnalysis,ETAPriceChart,ETASandBox,SemanticAnalysis,VersionRecord},
   data() {
     return {
     }
@@ -43,6 +48,14 @@ export default {
   methods: {
       handleImportMyChart(list){
           this.$emit('handleImportMyChart',list)
+      },
+      handleRestore(data){
+          this.$emit('handleRestore',data)
+      },
+      getSandBoxList(){
+        if (this.$refs.version) {
+          this.$refs.version.handleChangeIsOnlyMine() // 刷新版本列表
+        }
       }
   }
 }

+ 49 - 12
src/views/report_manage/reportV2/normalReport/editReport.vue

@@ -50,7 +50,8 @@
 						@openBaseInfo="showReportBaseInfo=true"
 						@handleRefreshAllChart="refreshReport"
 						@handlePreviewReport="reportInfo.ReportChapterId?handlePreviewChapter():handlePreviewReport()"
-						@handleSaveContent="reportInfo.ReportChapterId?handleAutoSaveChapter('save'):handleAutoSave('save')"
+						@handleVersionRecord="handleVersionRecord()"
+						@handleSaveContent="reportInfo.ReportChapterId?handleAutoSaveChapter('save'):handleAutoSave('save',true)"
 						@handlePublishOpt="(type) =>{reportInfo.ReportChapterId?handlePublishChapter():handlePublishReport(type)}"
 						@update="()=>{$refs.chapterContRef&&$refs.chapterContRef.getChapterList()}"
 					/>
@@ -73,11 +74,14 @@
 
 						<!-- 可插入内容 -->
 						<insertContent
+							ref="insertContRef"
 							v-show="activeTab"
 							:actTab="activeTab"
+							:selectChapterId="selectChapterId"
 							@slide="activeTab=''"
 							@insertHtml="insertHtml"
 							@handleImportMyChart="handleImportMyChart"
+							@handleRestore="handleRestore"
 						/>
 						
 					</div>
@@ -192,7 +196,7 @@ export default {
 		if(this.reportCoopType===1) {	
 			this.getreportdetail();
 			this.timer = setInterval(() => {
-				this.handleAutoSave();
+				this.handleAutoSave('', false);
 			}, 6000);
 		}
 
@@ -234,13 +238,13 @@ export default {
 			$('.editor-wrapper')[0].scrollTop = 0;
 			if(this.editChapterId) {
 				this.timer = setInterval(() => {
-					this.handleAutoSaveChapter();
+					this.handleAutoSaveChapter('');
 				}, 6000);
 			}
 		},
 
 		/* 章节自动保存 存草稿*/
-		async handleAutoSaveChapter(type='auto') {
+		async handleAutoSaveChapter(type) {
 			
 			if(!this.reportInfo.ReportChapterId||!this.editChapterId) return
 
@@ -256,14 +260,16 @@ export default {
 				const res = await saveChapterReport({
 					ReportChapterId: this.reportInfo.ReportChapterId,
 					// Title: this.reportInfo.Title,
-					Content: $('.fr-element').html()
+					Content: $('.fr-element').html(),
+					IsManualSave: type === '' ? false : true    //是否手动保存
 				})
 				if(res.Ret !== 200) return
 				resolve(true)
-	
 				this.lastsavetime = http.dateFormatter(new Date(), true);
 				type==='save' && this.$message.success(res.Msg);
-
+				if(type !== '')  {
+					this.$refs.insertContRef.getSandBoxList() // 刷新版本列表
+				}
 			})
 		},
 
@@ -365,7 +371,7 @@ export default {
 		},
 
 		// 每十秒自动保存 存草稿
-		handleAutoSave(type='auto') {
+		handleAutoSave(type='auto', IsManualSave) {
 
 			if(!this.autoSaveFlag) return
 			//如果富文本中有未上传完成的图片,去除这个dom
@@ -374,13 +380,16 @@ export default {
 				autosave({
 					ReportId: Number(this.$route.query.id),
 					Content: $('.fr-element').html(),
-					NoChange:this.ischange?0:1
+					NoChange:this.ischange?0:1,
+					IsManualSave
 				}).then((res) => {
 					if (res.Ret === 200) {
 						resolve(true)
-
 						this.lastsavetime = http.dateFormatter(new Date(), true);
 						type==='save' && this.$message.success(res.Msg);
+						if(IsManualSave)  {
+                            this.$refs.insertContRef.getSandBoxList() // 刷新版本列表
+                        }
 					}
 				});
 				this.ischange = false;
@@ -389,7 +398,7 @@ export default {
 
 		/* 报告详情 */
 		async getreportdetail() {
-			
+
 			const res = await reportdetail({ ReportId: parseInt(this.report_id) })
 
 			if (res.Ret !== 200) return
@@ -409,7 +418,7 @@ export default {
 		/* 发布报告 */
 		async handlePublishReport(tp) {
 
-			const saveRes = await this.handleAutoSave('auto');
+			const saveRes = await this.handleAutoSave('auto', true);
 			if(!saveRes) return
 
 			if(tp==='dsfb'){
@@ -567,6 +576,34 @@ export default {
 				
 				this.$store.commit('SET_DYNAMIC_LINK',res.Data)
 		},
+		async handleVersionRecord() {
+			this.showRight=true 
+            this.activeTab = 'versionRecord';
+		},
+		/* 恢复版本 */
+		handleRestore(Id) {
+            this.$confirm('确认将报告恢复到该版本吗?', '提示', {
+                confirmButtonText: '确定',
+                cancelButtonText: '取消',
+                type: 'warning'
+            }).then(() => {
+                this.reportHistoryRevert(Id)
+            }).catch(() => {
+            });
+        },
+        /* 恢复版本报告请求 */
+        async reportHistoryRevert(Id) {
+            const res = await reportV2Interface.reportHistoryRevert({Id})
+			if(res.Ret !== 200) return
+			this.$message.success('恢复成功!');
+			if (this.$route.query.coopType == '1') {
+				this.getreportdetail()
+				console.log(44555);
+			} else {
+				this.getChapterDetail()
+			}
+        },
+
 	},
 };
 </script>

+ 24 - 11
src/views/report_manage/reportV2/normalReport/reportdtl.vue

@@ -35,7 +35,7 @@
 			<div v-html="configInfo.Disclaimer"></div>
 		</div>
 
-		<div v-if="linkUrl" style="width:100px;height30px;position:absolute;right:-100px;top:100px;cursor:pointer;">
+		<div v-if="linkUrl" style="width:100px;height:30px;position:absolute;right:-100px;top:100px;cursor:pointer;">
 			<div v-permission="$route.query.fromPage==='en'
                 ?permissionBtn.enReportManageBtn.enReport_reportView_copyWechat
                 :permissionBtn.reportManageBtn.reportManage_reportView_copyWechat"
@@ -58,6 +58,7 @@
 	import {etaBaseConfigInterence} from '@/api/modules/etaBaseConfigApi.js';
 	import * as reportEnInterface from '@/api/modules/reportEnApi';
 	import {strategyReportInterence} from '@/api/api.js'
+	import { reportV2Interface } from '@/api/modules/reportV2';
 	import vueQr from 'vue-qr'
 	export default {
 		computed: {
@@ -117,17 +118,19 @@
 				this.isshow=true;
 				return 
 			}
-
-			if(this.$route.query.id||this.reportId) {
-				this.getreportdetail();
-			}else {
-				let reportdtl=sessionStorage.getItem('reportdtl') || false;
-				this.reportInfo=JSON.parse(reportdtl);
-				console.info("reportInfo");
-				console.log(this.reportInfo);
-				this.isshow=true;
+			if(this.$route.query.isVersionRecord === 'true') {
+				this.getReportHistoryDetail()
+			} else {
+				if(this.$route.query.id||this.reportId) {
+					this.getreportdetail();
+				}else {
+					let reportdtl=sessionStorage.getItem('reportdtl') || false;
+					this.reportInfo=JSON.parse(reportdtl);
+					console.info("reportInfo");
+					console.log(this.reportInfo);
+					this.isshow=true;
+				}
 			}
-			
 			this.getConfigSet()
 		},
 		updated(){
@@ -166,6 +169,16 @@
 				this.reportInfo=res.Data;
 				this.isshow=true;
 			},
+
+			// 获取报告详情
+			async getReportHistoryDetail(){
+				const id=this.$route.query.id||this.reportId||0
+				if(!id) return
+				this.$emit("reportStartLoading")
+				const res = await reportV2Interface.reportHistoryDetail({Id:id})
+				this.reportInfo=res.Data;
+				this.isshow=true;
+			},
 			/* 复制链接 */
 			copyHandle() {
 				var clipboard = new this.Clipboard('.copy')

+ 233 - 0
src/views/report_manage/reportV2/smartReport/components/VersionRecord.vue

@@ -0,0 +1,233 @@
+<template>
+  <div class="statistic-analysis-wrap">
+      <div class="top-box">
+          <div class="right">
+            版本记录
+          </div>
+          <div class="left">
+              <div class="search-box">
+                  <el-switch
+                    v-model="OnlyMine"
+                    @change="handleChangeIsOnlyMine"
+                    active-text="仅显示我保存的版本">
+                  </el-switch>
+              </div>
+          </div>
+      </div>
+      <div class="main-box">
+          <div class="list-wrap" v-infinite-scroll="handleLoadMore" :infinite-scroll-immediate="true">
+              <div class="chart-item" v-for="item in list" :key="item.SandboxId" @mouseenter="showOperation(item.Id)" @mouseleave="hideOperation">
+                  <div class="item-img">
+                    <img src="~@/assets/img/version_record.png"/>
+                  </div>
+                  <div class="top">
+                    <el-tooltip class="item" effect="light" :content="item.Title" placement="top">
+                      <div class="title">{{ item.Title }}</div>
+                    </el-tooltip>
+                    <!-- <div class="title">{{ item.Title }}</div> -->
+                    <div class="time">{{ item.CreateTime }}</div>
+                  </div>
+                  <div class="bottom">
+                    <div class="name">{{item.AdminName}}</div>
+                    <div class="operation" v-show="item.showOperations">
+                      <span @click="preview(item.Id)">预览</span>
+                      <span @click="$emit('handleRestore', item.Id)">恢复</span>
+                      <span class="delete" @click="deleteVersionRecord(item.Id)">删除</span>
+                    </div>
+                  </div>
+              </div>
+              <tableNoData :text="$t('Table.prompt_slogan')" style="width: 100%;" size="mini" v-if="list.length===0&&finished"/>
+          </div>
+      </div>
+  </div>
+</template>
+
+<script>
+import { reportV2Interface } from '@/api/modules/reportV2';
+export default {
+  props:{
+    selectChapterId:{
+        type:Number,
+        default:0
+    }
+  },
+  data() {
+      return {
+          list:[],
+          page:1,
+          pageSize:10,
+          finished:false,
+          loading:false,
+          OnlyMine:false,      
+      }
+  },
+  created(){
+      this.getSandBoxList()
+  },
+  methods: {
+      /* 搜索版本记录分页 */
+      async getSandBoxList(word) {
+           this.$route.query.coopType
+          let params = {
+              CurrentIndex: this.page,
+              PageSize: this.pageSize,
+              IsShowMe: this.OnlyMine,
+          };
+          if (this.$route.query.coopType == '1') {
+              params.ReportId = this.$route.query.id;
+          } else {
+              params.ReportChapterId = this.selectChapterId + '';
+          }
+          this.loading=true
+          let res = await reportV2Interface.reportHistoryList(params);
+          this.loading=false
+          if (res.Ret !== 200) return;
+          const arr = res.Data.List || [];
+          this.list =
+              this.page === 1
+              ? arr
+              : [...this.list, ...arr];
+          this.finished =  res.Data.Paging.IsEnd;
+      },
+      // 是否仅显示我保存的版本
+      handleChangeIsOnlyMine(val) {
+          this.page = 1;
+          this.list = [];
+          this.getSandBoxList();
+      },
+      handleLoadMore(){
+          if(this.finished||this.loading) return
+          this.page++
+          this.getSandBoxList()
+      },
+      // 预览
+      preview(id){
+        let { href } = this.$router.resolve({ 
+            path: '/smartReportDetail',
+            query:{
+                id,
+                isVersionRecord:'true'
+            }
+        });
+        window.open(href, '_blank');
+      },
+      // 删除弹窗
+      deleteVersionRecord(Id){
+          this.$confirm('删除后不可恢复,是否确认删除该版本?', '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          }).then(() => {
+              this.deleteItem(Id)
+          }).catch(() => {
+          });
+      },
+      deleteItem(Id) {
+          reportV2Interface.reportHistoryDel({
+              Id
+          }).then((res) => {
+              if(res.Ret !== 200) return
+              this.$message.success('删除成功!');
+              this.handleChangeIsOnlyMine()
+          });
+      },
+      showOperation(itemId) {
+        const item = this.list.find(i => i.Id === itemId);
+        if (item) {
+          this.$set(item, 'showOperations', true); // 使用 $set 以确保响应性
+        }
+      },
+      hideOperation() {
+        this.list.forEach(item => {
+          this.$set(item, 'showOperations', false); // 隐藏所有操作栏
+        });
+      },
+  },
+}
+</script>
+
+<style lang="scss" scoped>
+div{
+  box-sizing: border-box;
+}
+.statistic-analysis-wrap{
+  margin-top: 10px;
+  border: 1px solid var(--gary-gy-5-line, #C8CDD9);
+  background: #FFF;
+  .top-box{
+      padding: 20px 20px 0 20px;
+      display: flex;
+      justify-content: space-between;
+      align-items: center;
+  }
+  .main-box{
+      padding: 20px;
+      height: calc(100vh - 170px);
+      border-radius: 4px;
+      display: flex;
+      flex-direction: column;
+      .list-wrap{
+          flex: 1;
+          overflow-y: auto;
+          // display: flex;
+          // flex-wrap: wrap;
+          gap: 0 20px;
+
+      }
+  }
+}
+.chart-item {
+  position: relative;
+  width: 100%;
+  max-height: 100px;
+  margin: 10px 0;
+  padding: 10px;
+  border-radius: 10px;
+  font-size: 14px;
+  text-align: center;
+  padding-left: 20px;
+  .item-img {
+    position: absolute;
+    top: 10px;
+    left: 0;
+    width: 8px;
+    height: 54px;
+    img {
+      width: 8px;
+      height: 54px;
+    }
+  }
+  .top {
+    display: flex;
+    justify-content: space-between;
+    .title {
+      max-width: 250px;
+      overflow: hidden;
+      text-overflow: ellipsis;
+      white-space: nowrap;
+      line-height: 20px;
+      font-size: 16px;
+      color: #333333;
+    }
+    .time {
+      line-height: 20px;
+      color: #666666;
+    }
+  }
+  .bottom {
+    margin-top: 10px;
+    display: flex;
+    justify-content: space-between;
+    .name {
+      color: #333333;
+    }
+    .operation {
+      cursor: pointer;
+      color: #0052D9;
+      .delete {
+        color: #D54941;
+      }
+    }
+  }
+}
+</style>

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

@@ -29,7 +29,6 @@
                     <tableNoData :text="$t('Common.no_cont_msg')"/>
                 </div>
 			</template>
-
 			<!-- 章节报告预览 -->
 			<template v-else-if="reportCoopType===2&&selectChapterId&&!editChapterId">
 				<div style="max-height:100vh;overflow-y:auto;">
@@ -49,11 +48,11 @@
                     @openBaseInfo="showReportBaseInfo=true"
                     @handleRefreshAllChart="handleRefreshAllChart"
                     @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)}"
                     @update="()=>{$refs.chapterContRef&&$refs.chapterContRef.getChapterList()}"
+                    @handleVersionRecord="handleVersionRecord()"
                 />
-                
                 <div class="main-wrap">
                     <div class="report-action-wrap">
                         <ul class="top-type-list">
@@ -176,7 +175,7 @@
                                 :style="{fontFamily:item.family,fontSize:(item.size*2)+'px',fontWeight:item.weight,textAlign:item.align,color:item.color,
                                     width:item.width,height:item.height,left:item.left,top:item.top
                                 }">
-                                    {{ layoutBaseInfo[item.value] }}
+                                    {{ layoutBaseInfo[item.value] }}111
                                 </div>
                             </div>
                         </div>
@@ -186,8 +185,8 @@
                         <div class="close-icon" @click="handleCloseRight">
                             <img src="~@/assets/img/smartReport/icon14.png" alt="">
                         </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 
                             v-if="rightType==='text'"
                             :key="activeId"
@@ -215,6 +214,8 @@
                         <ETASandBox v-if="rightType==='etaSandBox'"/>
                         <!-- 语义分析 -->
                         <SemanticAnalysis v-if="rightType==='semanticAnalysis'"/>
+                        <!-- 版本记录 -->
+                        <VersionRecord v-if="rightType==='versionRecord'" ref="version" :selectChapterId="selectChapterId" @handleRestore="handleRestore"/>
                         <!-- 版图资源库 -->
                         <ImgSource v-if="rightType==='imgSource'" @change="handleInsertImgSource" @close="handleCloseRight"/>
                         </div>
@@ -293,6 +294,7 @@ import reportBaseInfo from '../components/reportBaseInfoDia.vue'
 import StatisticAnalysis from './components/StatisticAnalysis.vue'
 import ETAPriceChart from './components/ETAPriceChart.vue'
 import ETASandBox from './components/ETASandBox.vue'
+import VersionRecord from './components/VersionRecord.vue'
 import SemanticAnalysis from './components/SemanticAnalysis.vue'
 import { getUrlParams } from '@/utils/common'
 import reportApproveConfig from "@/mixins/reportApproveConfig.js"
@@ -301,6 +303,7 @@ import editHeader from '../components/reportEditHeader.vue';
 import chapterWrapper from '../components/chapterEditWrapper.vue';
 import smartReportDetail from './reportDetail.vue'
 import { GetQueryString } from '@/utils/common'
+import { reportV2Interface } from '@/api/modules/reportV2';
 export default {
     mixins:[reportApproveConfig],
     name:"smartReportEditV2",
@@ -318,6 +321,7 @@ export default {
         StatisticAnalysis,
         ETAPriceChart,
         ETASandBox,
+        VersionRecord,
         SemanticAnalysis,
         ImgSource,
         editHeader,
@@ -422,6 +426,38 @@ export default {
 			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() {
             if(!this.selectChapterId) return
@@ -438,14 +474,13 @@ export default {
 			$('.edit-smart-report-page')[0].scrollTop = 0;
 			if(this.editChapterId) {
 				this.timer = setInterval(() => {
-					this.handleAutoSaveChapter();
+					this.handleAutoSaveChapter('');
 				}, 6000);
 			}
 		},
 
 		/* 章节自动保存 存草稿*/
-		async handleAutoSaveChapter(type='auto') {
-			
+		async handleAutoSaveChapter(type) {
 			if(!this.reportInfo.ReportChapterId||!this.editChapterId) return
             if(!document.getElementById('report-html-content')){
                 this.timer && clearInterval(this.timer);
@@ -458,11 +493,14 @@ export default {
                     ReportChapterId: this.reportInfo.ReportChapterId,
                     Content: htmlStr,
                     ContentStruct:this.formatContentListElData(),
+                    IsManualSave: type === '' ? false : true    //是否手动保存
                 })
                 if(res.Ret !== 200) return 
                 resolve(true)
-
                 type==='save' && this.$message.success(res.Msg);
+                if(type !== '' && this.$refs.version)  {
+					this.$refs.version.handleChangeIsOnlyMine() // 刷新版本列表
+				}
             })
 		},
 
@@ -673,7 +711,8 @@ export default {
                 path: '/smartReportDetail',
                 query:{
                     id:this.$route.query.id,
-                    type:'preview'
+                    type:'preview',
+                    isVersionRecord:'false'
                 }
             });
 			window.open(href, '_blank');
@@ -1011,6 +1050,8 @@ export default {
 
         // 获取报告详情
         getReportDetail(){
+            console.log('获取报告详情------------------->');
+            
             const id=this.$route.query.id||0
             if(!id) return
 
@@ -1125,7 +1166,7 @@ export default {
         },1000),
         
         // 自动/存草稿保存内容
-        handleSaveContent({isAutoSave}){
+        handleSaveContent({isAutoSave, IsManualSave}){
             const html=document.getElementById('report-html-content').outerHTML.replace(/contenteditable="true"/g,'contenteditable="false"');
             return new Promise((resolve,reject)=>{
                 const id=this.$route.query.id||0
@@ -1144,6 +1185,7 @@ export default {
                     Content:html,
                     ContentStruct:this.formatContentListElData(),
                     NoChange:this.contentChange?2:1,
+                    IsManualSave,
                     ...imgParams
                 }).then(res=>{
                     if(res.Ret===200){
@@ -1151,6 +1193,9 @@ export default {
                         if(!isAutoSave){
                             this.$message.success(this.$t('MsgPrompt.saved_msg'))
                         }
+                        if(IsManualSave && this.$refs.version)  {
+                            this.$refs.version.handleChangeIsOnlyMine() // 刷新版本列表
+                        }
                     }
                 })
             })
@@ -1160,7 +1205,7 @@ export default {
         async handlePublishOpt(type){
             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
             }
 
@@ -1382,7 +1427,7 @@ export default {
         window.addEventListener('message',this.setSheetIframeStyle)
         if(this.reportCoopType===1) {
             this.timer = setInterval(() => {
-                this.handleSaveContent({isAutoSave:true});
+                this.handleSaveContent({isAutoSave:true,IsManualSave:false});
             }, 6000);
         }
     },

+ 41 - 1
src/views/report_manage/reportV2/smartReport/reportDetail.vue

@@ -104,6 +104,7 @@
 <script>
 import {apiSmartReport}  from '@/api/modules/smartReport'
 import {etaBaseConfigInterence} from '@/api/modules/etaBaseConfigApi.js';
+import { reportV2Interface } from '@/api/modules/reportV2';
 import {
 	reportdetail,
 } from '@/api/modules/reportV2';
@@ -166,7 +167,11 @@ export default {
             this.content=this.reportInfo.Content
             return 
         }
-        this.getReportDetail()
+        if(this.$route.query.isVersionRecord === 'true') {
+            this.getReportHistoryDetail()
+        } else {
+            this.getReportDetail()
+        }
         this.getConfigSet()
     },
     methods: {
@@ -215,6 +220,41 @@ export default {
                 }
             })
         },
+        // 获取报告详情
+        async getReportHistoryDetail(){
+            const id=this.$route.query.id||this.reportId||0
+            if(!id) return
+            this.$emit("reportStartLoading")
+            await reportV2Interface.reportHistoryDetail({
+                Id:id
+            }).then(res=>{
+                this.$emit("reportEndLoading")
+                if(res.Ret===200){
+                    this.reportInfo=res.Data || {}
+                    this.headImgStyle=this.reportInfo.HeadStyle?JSON.parse(this.reportInfo.HeadStyle):[]
+                    this.headImgStyle.map(st =>{
+                        st.value=st.value || st.label
+                    })
+                    this.endImgStyle=this.reportInfo.EndStyle?JSON.parse(this.reportInfo.EndStyle):[]
+                    this.endImgStyle.map(st =>{
+                        st.value=st.value || st.label
+                    })
+                    this.layoutBaseInfo['研报标题']=this.reportInfo.Title
+                    this.layoutBaseInfo['研报作者']=this.reportInfo.Author
+                    this.layoutBaseInfo['创建时间']=[2,6].includes(this.reportInfo.State)?this.reportInfo.PublishTime:''
+                    if(['preview','previewChapter'].includes(this.$route.query.type)){
+                       this.content=sessionStorage.getItem('smartReportContent')||res.Data.Content;
+                       this.reportInfo.Abstract = this.$route.query.type==='preview'?this.reportInfo.Abstract : ''; 
+                       this.bgColor=this.$route.query.type==='preview'?(sessionStorage.getItem('smartReportContentBg')||res.Data.CanvasColor):''
+                    }else{
+                        this.content=res.Data.Content
+                        this.bgColor=res.Data.CanvasColor
+                    }
+                }else{
+                    this.$emit("reportError")
+                }
+            })
+        },
 
         /* 复制链接 */
 		copyHandle() {