cxmo 1 rok temu
rodzic
commit
541f0e241a
1 zmienionych plików z 14 dodań i 12 usunięć
  1. 14 12
      src/views/ppt_manage/mixins/pptMixins.js

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

@@ -510,18 +510,19 @@ export default {
                     this.$store.commit('SET_CHART_INFO',{chartId:chartElements[i].chartId,chartInfo:temp})
                     this.$store.commit('SET_CHART_INFO',{chartId:chartElements[i].chartId,chartInfo:temp})
                 } */
                 } */
         }
         }
-        await Promise.all(needGetDataArr).then(()=>{
-            console.log('promise all then chart')
-            if(fromType==='present'){
-                for(let i=0;i<chartElements.length;i++) {
-                    let temp = getChartInfo(this.optionMap[chartElements[i].chartId])
-                    this.$store.commit('SET_CHART_INFO',{chartId:chartElements[i].chartId,chartInfo:temp})
+        if(needGetDataArr.length)
+            await Promise.all(needGetDataArr).then(()=>{
+                console.log('promise all then chart')
+                if(fromType==='present'){
+                    for(let i=0;i<chartElements.length;i++) {
+                        let temp = getChartInfo(this.optionMap[chartElements[i].chartId])
+                        this.$store.commit('SET_CHART_INFO',{chartId:chartElements[i].chartId,chartInfo:temp})
+                    }
                 }
                 }
-            }
-        })
+            })
     },
     },
     async sheetListHandle(sheetElements){
     async sheetListHandle(sheetElements){
-        let needGetDataArr = []
+      let needGetDataArr = []
       for(let i=0;i<sheetElements.length;i++){
       for(let i=0;i<sheetElements.length;i++){
         if(!this.sheetDataMap[sheetElements[i].sheetId]){
         if(!this.sheetDataMap[sheetElements[i].sheetId]){
             needGetDataArr.push(new Promise((res,rej)=>{
             needGetDataArr.push(new Promise((res,rej)=>{
@@ -530,9 +531,10 @@ export default {
         }
         }
         /* await this.getsheetData(sheetElements[i].sheetId) */
         /* await this.getsheetData(sheetElements[i].sheetId) */
       }
       }
-      await Promise.all(needGetDataArr).then(()=>{
-        console.log('promise all then sheet')
-    })
+      if(needGetDataArr.length)
+        await Promise.all(needGetDataArr).then(()=>{
+            console.log('promise all then sheet')
+        })
     },
     },
     async getsheetData(id){
     async getsheetData(id){
       const res = await sheetInterface.getSheetData({
       const res = await sheetInterface.getSheetData({