Jelajahi Sumber

节点扫描导出bug修复

zhongxiaoyu 2 tahun lalu
induk
melakukan
cf298319af

+ 2 - 3
src/views/statisticsCharts/views/nodeStatisticsCharts.vue

@@ -568,7 +568,7 @@ export default {
               Object.entries(record).filter(([key, value]) => key === 'a4' || this.checkList.includes(key))
             )
             xlsxDatas[0].push(...listArray[0].map(([key, value]) => key))
-            xlsxDatas.push(...listArray.map(record => record.map(([key, value]) => value)))
+            xlsxDatas.push(...listArray.map(record => record.map(([key, value]) => value || 0)))
             xlsxDatas[0][0] = '日期'
             // 添加合计行
             if (xlsxDatas.length > 2) {
@@ -599,8 +599,7 @@ export default {
               // 计算每一列宽度,考虑换行
               row.forEach((cell, columnIndex) => {
                 const cellWidth = Math.max(
-                  ...cell
-                    .toString()
+                  ...String(cell)
                     .split('\n')
                     .map(cellRow =>
                       cellRow.split('').reduce((pre, curr) => {