Browse Source

修改图表导出

FinalYu 1 year ago
parent
commit
920c9a51dc

+ 6 - 5
chuanyi_client2/src/components/CustomDialog/DataSourceItem.vue

@@ -556,6 +556,7 @@ export default {
       }
       if (chooseChannelNameList.length == 0) {
         showAlertMsgWin(this, null, '请选择子数据项!')
+        return
       }
       // 去重
       let arr = JSON.parse(JSON.stringify(this.chooseItemDataListByTree))
@@ -576,14 +577,14 @@ export default {
           }
         }
       }
-      this.chooseItemDataListByTree = arr
-      this.isSelectAllItem = false
-      this.leavesChooseList = []
-      setTimeout(() => {
+      this.$nextTick(() => {
+        this.chooseItemDataListByTree = arr
+        this.leavesChooseList = []
+        this.isSelectAllItem = false
         this.isSelectAllItemData = false
         this.$refs.itemTree.setCheckedKeys([])
         this.$refs.chooseItemTree.setCheckedNodes([])
-      }, 100)
+      })
     },
     /** 移除数据项 */
     removeCheckNodesBtnEvent() {

+ 7 - 5
chuanyi_client2/src/components/HeaderMain/index.vue

@@ -1737,6 +1737,7 @@ export default {
       }
       if (chooseChannelNameList.length == 0) {
         showAlertMsgWin(this, null, '请选择子数据项!')
+        return
       }
       // 去重
       let arr = JSON.parse(JSON.stringify(this.chooseItemDataListByTree))
@@ -1757,13 +1758,14 @@ export default {
           }
         }
       }
-      this.chooseItemDataListByTree = arr
-      this.isSelectAllItem = false
-      this.leavesChooseList = []
-      setTimeout(() => {
+      this.$nextTick(() => {
+        this.chooseItemDataListByTree = arr
+        this.isSelectAllItem = false
+        this.isSelectAllItemData = false
+        this.leavesChooseList = []
         this.$refs.itemTree.setCheckedKeys([])
         this.$refs.chooseItemTree.setCheckedNodes([])
-      }, 100)
+      })
     },
     /** 移除全部数据项 */
     removeAllCheckNodesBtnEvent() {

+ 7 - 4
chuanyi_client2/src/utils/export.js

@@ -189,10 +189,12 @@ var setImages = function (table, worksheet, workbook) {
         } else {
             col_st = getImagePosition(item.default.left, visibledatacolumn);
             row_st = getImagePosition(item.default.top, visibledatarow);
-            imgWidth = item.default.width;
-            imgHeight = item.default.height;
-            let w_ed = item.default.left + item.default.width;
-            let h_ed = item.default.top + item.default.height;
+            imgWidth = item.originWidth;
+            imgHeight = item.originHeight;
+            // imgWidth = item.default.width;
+            // imgHeight = item.default.height;
+            let w_ed = item.default.left + imgWidth;
+            let h_ed = item.default.top + imgHeight;
             let col_ed = getImagePosition(w_ed, visibledatacolumn);
             let row_ed = getImagePosition(h_ed, visibledatarow);
             cellConfig = {
@@ -437,6 +439,7 @@ export var exportExcel = function (luckysheet, value) {
 
     // 4.写入 buffer
     const buffer = workbook.xlsx.writeBuffer().then(data => {
+        console.log(data)
         const blob = new Blob([data], {
             type: 'application/vnd.ms-excel;charset=utf-8'
         })

+ 1 - 0
chuanyi_client2/src/utils/luckysheettool.js

@@ -71,6 +71,7 @@ export function insertLuckysheetEChart({
     n(l + " #luckysheet-cell-main").append(x);
     n('.'+u).mousedown(function(){return false});
     let S = r.init(document.getElementsByClassName(u)[0]);
+    f.animation = false;
     S.setOption(f);
     let k = S.getConnectedDataURL({
         type: "png",