From bb6ca60d634fa9b844583feb4a37bb7f984ab132 Mon Sep 17 00:00:00 2001
From: zzq <a13193816592@163.com>
Date: 星期四, 28 九月 2023 15:18:51 +0800
Subject: [PATCH] "报表路由跳转,api调用"

---
 src/components/makepager/TableCommonView.vue |   84 ++++++++++++++++++++++--------------------
 1 files changed, 44 insertions(+), 40 deletions(-)

diff --git a/src/components/makepager/TableCommonView.vue b/src/components/makepager/TableCommonView.vue
index 2c9631a..31e9b0c 100644
--- a/src/components/makepager/TableCommonView.vue
+++ b/src/components/makepager/TableCommonView.vue
@@ -1,6 +1,9 @@
 <!-- eslint-disable vue/no-use-v-if-with-v-for -->
 <template>
-  <div :class="{'table-view':true,'table_height':!showSummary}" v-loading="loading">
+  <div
+    :class="{ 'table-view': true, table_height: !showSummary }"
+    v-loading="loading"
+  >
     <el-table
       ref="table"
       border
@@ -51,9 +54,9 @@
             <span
               class="Badge"
               :class="{
-                greenSlot: scope.row.status == '4',
+                greenSlot: scope.row.status == '4'||scope.row.status ==  '瀹屾垚',
                 redSlot: scope.row.status == '5',
-                blueSlot: scope.row.status == '3',
+                blueSlot: scope.row.status == '3'||scope.row.status ==  '灏辩华',
                 graySlot: scope.row.status == '1',
               }"
               >{{
@@ -178,10 +181,10 @@
       type: Boolean,
       default: true,
     },
-    showSummary:{
-      type:Boolean,
-      default:false
-    }
+    showSummary: {
+      type: Boolean,
+      default: false,
+    },
   },
   data() {
     return {
@@ -252,52 +255,54 @@
     },
     //姹傚拰
     getSummaries(param) {
-      if(this.tableList.countcol&&this.tableList.countcol.length>0){
-      const { columns, data } = param;
-      const sums = [];
-      columns.forEach((column, index) => {
-        if (index === 0) {
-          sums[index] = " ";
-          return;
-        }
-        this.tableList.countcol.forEach((countcols,idx) => {
-          if (column.label === countcols) {
-            const values = data.map((item) => Number(item[column.property]));
-            if (!values.every((value) => isNaN(value))) {
-              sums[index] = values.reduce((prev, curr) => {
-                const value = Number(curr);
-                if (!isNaN(value)) {
-                  return prev + curr;
-                } else {
-                  return prev;
-                }
-              }, 0);
-              sums[index] = sums[index].toLocaleString();
-              // console.log(sums,"sums")
-            } else {
-              sums[index] = "";
-            }
-          } else {
+      if (this.tableList.countcol && this.tableList.countcol.length > 0) {
+        const { columns, data } = param;
+        const sums = [];
+        columns.forEach((column, index) => {
+          if (index === 0) {
+            sums[index] = " ";
             return;
           }
+          this.tableList.countcol.forEach((countcols) => {
+            if (column.label === countcols) {
+              const values = data.map((item) => Number(item[column.property]));
+              if (!values.every((value) => isNaN(value))) {
+                sums[index] = values.reduce((prev, curr) => {
+                  const value = Number(curr);
+                  if (!isNaN(value)) {
+                    return prev + curr;
+                  } else {
+                    return prev;
+                  }
+                }, 0);
+                sums[index] =
+                  this.tableList.tableColumn[index - 1].unit + "" + sums[index];
+              } else {
+                sums[index] = "";
+              }
+            } else {
+              return;
+            }
+          });
         });
-      });
-      return sums;
-      }else{
+        return sums;
       }
     },
-    
   },
 };
 </script>
 
 <!-- Add "scoped" attribute to limit CSS to this component only -->
 <style lang="scss" scoped>
-.table_height{
+.table_height {
+  height: 100%;
+}
+.el-table__body-wrapper{
   height: 100%;
 }
 .table-view {
   position: relative;
+  height: 100%;
   .blue {
     width: 70px;
     text-align: center;
@@ -375,9 +380,8 @@
     border-top-right-radius: 12px;
     overflow: auto;
   }
-  .el-table__body-wrapper{
+  .el-table__body-wrapper {
     // height: ;
   }
 }
-
 </style>

--
Gitblit v1.8.0