浏览代码

Merge branch 'master' of http://120.26.64.82:10880/BFFE/CA3.0

zhongxiaoyu 1 年之前
父节点
当前提交
1fc09dc392
共有 1 个文件被更改,包括 6 次插入4 次删除
  1. 6 4
      src/views/newQuery/components/table.vue

+ 6 - 4
src/views/newQuery/components/table.vue

@@ -58,7 +58,7 @@
 import pf from '@/layout/mixin/publicFunc'
 import { getToken } from '@/utils/auth'
 import { getAuthData, formatOrder } from '@/utils/validate'
-import { exportToExcel } from '@/utils/table'
+import { throttledExportToExcel } from '@/utils/table'
 import tableColsMixin from '../mix/tableCols'
 import Dialog from '@/layout/components/Dialog/index.vue'
 import TableHeaderCell from '@/components/TableHeaderCell/index.vue'
@@ -133,6 +133,7 @@ export default {
       tableOptions: {}, // 弹框-下来数据缓存
       showSummary: false, // 是否显示统计
       tableDataSortRules: {},
+      tableCath: []
     }
   },
   computed: {
@@ -222,6 +223,7 @@ export default {
               this.showSummary = true
             }
             const msgDatasShows = formatOrder(msgDatas)
+            this.tableCath = msgDatasShows
             if (this.istableChild) {
               const datas = _.cloneDeep(msgDatasShows)
               const cache = {}
@@ -268,7 +270,7 @@ export default {
       }
     },
     setTableCols () {
-      this.tableCols.forEach(({ columnName, needFilters, needSort }) => {
+      this.tableCath.forEach(({ columnName, needFilters, needSort }) => {
         if (needFilters) {
           this.$set(this.tableDataFilters, columnName, [])
           this.$set(this.filterValues, columnName, [])
@@ -488,7 +490,7 @@ export default {
         if (index === 0) {
           sums[index] = '合计:' + this.tableData.length
         }
-        this.tableColsCopy.forEach(p => {
+        this.tableCath.forEach(p => {
           if (column.property == p.columnName && p.needCount) {
             const values = data.map(item => Number(item[column.property]))
             if (!values.every(value => isNaN(value))) {
@@ -562,7 +564,7 @@ export default {
     exportHandler () {
       const table = this.$refs['table'].$el.cloneNode(true)
       const fileName = `${this.downName || this.AqueryParams.auth_name}.xlsx`
-      exportToExcel(table, `${this.downName || this.AqueryParams.auth_name}`, fileName)
+      throttledExportToExcel(table, `${this.downName || this.AqueryParams.auth_name}`, fileName)
     },
     formatter (row, column, cellValue, index) {
       const sameColumn = this.tableCols.find(