From ee38779810cfbe512788f71679aaaaa7fedb1775 Mon Sep 17 00:00:00 2001
From: lxp <1928192722@qq.com>
Date: 星期二, 18 三月 2025 11:19:00 +0800
Subject: [PATCH] 表格合并以及权限添加

---
 src/views/business/unPass/index.vue |   38 +++++++++++++++++++++++++++++++++-----
 1 files changed, 33 insertions(+), 5 deletions(-)

diff --git a/src/views/business/unPass/index.vue b/src/views/business/unPass/index.vue
index 18a6423..88ee522 100644
--- a/src/views/business/unPass/index.vue
+++ b/src/views/business/unPass/index.vue
@@ -33,7 +33,7 @@
 }
 </style>
 <template>
-  <div class="below-standard-main">
+  <div class="below-standard-main bg-1">
     <div style="width: 100%; height: 100%">
       <div>
         <el-row class="title">
@@ -79,7 +79,8 @@
           :tableData="tableData"
           :column="column"
           :tableLoading="tableLoading"
-          :height="'calc(100vh - 270px)'"
+          :parentSpanMethod="spanMethod"
+          :height="tableHeight+''"
           :page="page"
           @pagination="pagination"
         ></lims-table>
@@ -157,12 +158,39 @@
     this.entityCopy = this.HaveJson(this.entity);
     this.refreshTable();
   },
+  created() {
+    this.getTableHeight();
+  },
   methods: {
+    // 琛ㄦ牸鍚堝苟
+    spanMethod({row,column,rowIndex,columnIndex}) {
+      // 闇�瑕佸悎骞剁殑鍒�
+      const needSpan = [1]
+      if(needSpan.includes(columnIndex)) {
+        // 濡傛灉鏄涓�琛� 鎴栬�� 褰撳墠琛岀殑鍊煎拰涓婁竴琛岀殑鍊间笉涓�鏍� 灏辫寮�濮嬭繘琛岃绠楀悎骞�
+        if(rowIndex == 0 || row.entrustCode != this.tableData[rowIndex -1 ].entrustCode) {
+          // 鍚戜笅鎵惧埌鍜屽綋鍓嶈涓嶄竴鏍风殑琛屾暟
+          let rowSpan = 1;
+          while(rowIndex + rowSpan < this.tableData.length && row.entrustCode == this.tableData[rowIndex + rowSpan].entrustCode) {
+            rowSpan++
+          }
+          return [rowSpan,1]
+        }else {
+          // 濡傛灉鍜屼笂涓�琛岀殑鍊间竴鏍� 灏遍殣钘�
+          return [0,0]
+        }
+      }else{
+        return [1,1]
+      }
+    },
+    getTableHeight() {
+      this.tableHeight = window.innerHeight - 50 - 46 - 60 - 80 - 30 - 30 - 32;
+    },
     getData() {
       this.tableLoading = true;
       pageInsUnPass({
         current: this.page.current,
-        limit: this.page.size,
+        size: this.page.size,
         model: this.entity.model,
         sample: this.entity.sample,
       }).then((res) => {
@@ -171,8 +199,8 @@
         this.page.total = res.data.total;
       });
     },
-    pagination({current,limit}) {
-      this.page.current = current;
+    pagination({page,limit}) {
+      this.page.current = page;
       this.page.size = limit;
       this.getData();
     },

--
Gitblit v1.9.3