cxmo 7 kuukautta sitten
vanhempi
commit
cf6e3ffdeb

+ 2 - 23
src/views/ppt_manage/mixins/pptMixins.js

@@ -71,9 +71,6 @@ export default {
       //截面散点设置英文props
 			enChartInfo: {},
 			enEdblist:[],
-
-
-        chartSVGDataMap:{}
     }
   },
   methods: {
@@ -595,8 +592,7 @@ export default {
           this.initChart(
 				    `chart_${index}_${item.position}`,
 				    this.optionMap[item.chartId],
-				    page,
-                    item.chartId
+				    page
 			    )
         }else{
           //显示图表已被删除
@@ -608,7 +604,7 @@ export default {
 			
       });
     },
-    initChart(refName, options, page,chartId="") {
+    initChart(refName, options, page) {
       console.log("refName", refName);
       const index = this.pageList.findIndex((i) => i.id === page.id)
       if(index===-1) return
@@ -747,23 +743,6 @@ export default {
           ...secialBarOpt
         });
         
-        
-        if(isPublish&&chartId){
-            const {clientWidth,clientHeight} = $(`#${refName}`)[0]
-            this.chartSVGDataMap[chartId] = chart.getSVG({
-                chart:{
-                    width:clientWidth,
-                    height:clientHeight,
-                    backgroundColor: "rgba(255,255,255,0)",
-                    plotBorderColor:null,
-                    plotBackgroundColor:null,
-                    plotBackgroundImage:null,
-                    plotBorderWidth:null,
-                    plotShadow:false,
-                    animation: false,
-                }
-            })
-        }
       });
     },
     initImages(elements,page){

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

@@ -330,7 +330,7 @@ export default {
                 //将svgDom转为base64 png,返回一个base64字符串
                 //imgData = await this.changeUrl(`chart_${i}_${elements[j].position}`)
                 //imgData = svg2Base64($(`#chart_${i}_${elements[j].position} svg`)[0])//生成的svg背景色是黑色不是透明
-                imgData = this.setCompression2?svgData2Base64(this.chartSVGDataMap[elements[j].chartId]):await this.changeUrl(`chart_${i}_${elements[j].position}`)
+                imgData = this.setCompression2?svgData2Base64($(`#chart_${i}_${elements[j].position} svg`)[0].outerHTML):await this.changeUrl(`chart_${i}_${elements[j].position}`)
               }
             }
           } else if (elements[j].type === 'text'){