Quellcode durchsuchen

修改自动报表数据回显

FinalYu vor 1 Jahr
Ursprung
Commit
c01c657267

+ 10 - 8
chuanyi_client2/src/views/my_report/index.vue

@@ -1334,17 +1334,19 @@ export default {
       }
       // 其余报表信息
       tableItemList.forEach((tableItem, i) => {
-        let standby = tableItem.standby ? JSON.parse(tableItem.standby) : {}
-        let dataIndex = standby.index != null ? standby.index : -1
+        // let standby = tableItem.standby ? JSON.parse(tableItem.standby) : {}
+        // let dataIndex = standby.index != null ? standby.index : -1
         let valueList = tableItem.valueList ? tableItem.valueList.split(',') : []
-        let val = (dataIndex == -1 || (dataIndex + 1) > valueList.length)
-            ? cqcyCode['invalidData'] : valueList[dataIndex]
+        // let val = (dataIndex == -1 || (dataIndex + 1) > valueList.length)
+        //     ? cqcyCode['invalidData'] : valueList[dataIndex]
         let xAxis = tableItem.xaxis
         let yAxis = tableItem.yaxis
-        try {
-          luckysheet.setCellValue(xAxis, yAxis, val)
-        } catch (e) {
-          console.warn(e)
+        if (valueList.length == 0) {
+          luckysheet.setCellValue(xAxis, yAxis, '')
+        } else {
+          valueList.forEach((v, j) => {
+            luckysheet.setCellValue(xAxis + j, yAxis, v)
+          })
         }
       })
       this.updateLocalExcelContent()

+ 1 - 1
chuanyi_client2/src/views/report_template/index.vue

@@ -2132,7 +2132,7 @@ export default {
             luckysheet.setCellValue((p_r > 1 ? (p_r - 1) : 0), p_c, describe ? describe : name)
           }
           luckysheet.setCellValue(p_r, p_c, v)
-          this.pushToItemTable(item)
+          if (n == 0) this.pushToItemTable(item)
         })
       }
       if (flag == 1) {

+ 10 - 8
chuanyi_client2/src/views/run_config/index.vue

@@ -1468,17 +1468,19 @@ export default {
       }
       // 其余报表信息
       tableItemList.forEach((tableItem, i) => {
-        let standby = tableItem.standby ? JSON.parse(tableItem.standby) : {}
-        let dataIndex = standby.index != null ? standby.index : -1
+        // let standby = tableItem.standby ? JSON.parse(tableItem.standby) : {}
+        // let dataIndex = standby.index != null ? standby.index : -1
         let valueList = tableItem.valueList ? tableItem.valueList.split(',') : []
-        let val = (dataIndex == -1 || (dataIndex + 1) > valueList.length)
-            ? cqcyCode['invalidData'] : valueList[dataIndex]
+        // let val = (dataIndex == -1 || (dataIndex + 1) > valueList.length)
+        //     ? cqcyCode['invalidData'] : valueList[dataIndex]
         let xAxis = tableItem.xaxis
         let yAxis = tableItem.yaxis
-        try {
-          luckysheet.setCellValue(xAxis, yAxis, val)
-        } catch (e) {
-          console.warn(e)
+        if (valueList.length == 0) {
+          luckysheet.setCellValue(xAxis, yAxis, '')
+        } else {
+          valueList.forEach((v, j) => {
+            luckysheet.setCellValue(xAxis + j, yAxis, v)
+          })
         }
       })
       this.updateLocalExcelContent()