Browse Source

Merge branch 'ppt-demand-055'

cxmo 9 months ago
parent
commit
317d1326cc

+ 12 - 7
src/views/ppt_manage/mixins/pptMixins.js

@@ -12,7 +12,7 @@ import futuresInterface from '@/api/modules/futuresBaseApi';
 import { fittingEquationInterface,statisticFeatureInterface,crossVarietyInterface } from '@/api/modules/chartRelevanceApi';
 import chartRelevanceApi from '@/api/modules/chartRelevanceApi.js';
 import { defaultOpts } from '@/utils/defaultOptions';
-import {formatPPTDate,checkPPTpageElemant,getStrSize,isShowPPTTitle,toTextProps,toJson,rgbaToHex} from '../newVersion/utils/untils.js';
+import {formatPPTDate,checkPPTpageElemant,getStrSize,isShowPPTTitle,toTextProps,toJson,rgbaToHex,getChartInfo} from '../newVersion/utils/untils.js';
 import FormatOne from '../newVersion/components/formatPage/FormatOne.vue';
 import FormatTwo from '../newVersion/components/formatPage/FormatTwo.vue';
 import FormatThree from '../newVersion/components/formatPage/FormatThree.vue';
@@ -470,12 +470,17 @@ export default {
       await this.listHandle(chartElements);
       this.initCharts(chartElements, page);
     },
-    async listHandle(chartElements) {
-			for(let i=0;i<chartElements.length;i++) {
-        if(!this.optionMap[chartElements[i].chartId])
-				await this.getchartData(chartElements[i].chartId);
-			}
-		},
+    async listHandle(chartElements,fromType='') {
+        for(let i=0;i<chartElements.length;i++) {
+            if(!this.optionMap[chartElements[i].chartId])
+                await this.getchartData(chartElements[i].chartId);
+                //由于演示页的图表没有await加载,在这里更新每一张图表的信息
+                if(fromType==='present'){
+                    let temp = getChartInfo(this.optionMap[chartElements[i].chartId])
+                    this.$store.commit('SET_CHART_INFO',{chartId:chartElements[i].chartId,chartInfo:temp})
+                }
+            }
+        },
     async sheetListHandle(sheetElements){
       for(let i=0;i<sheetElements.length;i++){
         if(!this.sheetDataMap[sheetElements[i].sheetId])

+ 1 - 1
src/views/ppt_manage/newVersion/pptEnPresent.vue

@@ -301,7 +301,7 @@ export default {
         const sheetElements = this.pageList[i].elements.filter((item)=>{
           return item.type === 'sheet'
         })
-        this.listHandle(chartElements);
+        this.listHandle(chartElements,'present');
         this.sheetListHandle(sheetElements);
       }
       this.currentKey = 1

+ 1 - 1
src/views/ppt_manage/newVersion/pptPresent.vue

@@ -299,7 +299,7 @@ export default {
         const sheetElements = this.pageList[i].elements.filter((item)=>{
           return item.type === 'sheet'
         })
-        this.listHandle(chartElements);
+        this.listHandle(chartElements,'present');
         this.sheetListHandle(sheetElements);
       }
       this.currentKey = 1

+ 3 - 0
src/vuex/modules/ppt.js

@@ -20,6 +20,9 @@ const ppt = {
     //设置图表信息
     SET_CHART_INFO_MAP(state,chartInfoMap){
       state.chartInfoMap = chartInfoMap
+    },
+    SET_CHART_INFO(state,{chartId,chartInfo}){
+        state.chartInfoMap[chartId] = chartInfo
     }
   },
   actions:{},