From c40f4c1267dae4fcf27dbbd75ea83014fba87783 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期二, 15 七月 2025 15:28:21 +0800
Subject: [PATCH] 新增联合执法清单

---
 src/components/table/FYTable.vue |   39 ++++++++++++++++++++++++++++++++++-----
 1 files changed, 34 insertions(+), 5 deletions(-)

diff --git a/src/components/table/FYTable.vue b/src/components/table/FYTable.vue
index 3e5da08..478a48d 100644
--- a/src/components/table/FYTable.vue
+++ b/src/components/table/FYTable.vue
@@ -28,6 +28,7 @@
     <slot name="options-expand2"></slot>
   </div>
   <el-table
+    id="fyTable"
     ref="tableRef"
     :data="tableData"
     v-loading="loading"
@@ -78,6 +79,14 @@
     size: {
       type: String,
       default: 'default'
+    },
+    data: {
+      type: Array,
+      default: () => []
+    },
+    totalCount: {
+      type: Number,
+      default: 0
     }
   },
   data() {
@@ -110,13 +119,25 @@
         }
       },
       immediate: true
+    },
+    data(nValue, oValue) {
+      if (nValue != oValue) {
+        this.tableData = nValue;
+      }
+    },
+    totalCount(nValue, oValue) {
+      if (nValue != oValue) {
+        this.total = nValue;
+      }
     }
   },
   computed: {
     cTableHeight() {
       if (this.$refs.searchRef) {
         const h1 = this.$refs.searchRef.$el.offsetHeight;
-        const h2 = this.$refs.paginationRef ? this.$refs.paginationRef.$el.offsetHeight : 0;
+        const h2 = this.$refs.paginationRef
+          ? this.$refs.paginationRef.$el.offsetHeight
+          : 0;
         const h3 = this.$refs.expandRef.$el.offsetHeight;
         const h4 = this.$refs.expand2Ref.offsetHeight;
 
@@ -143,8 +164,14 @@
           pageSize: this.pageSize
         },
         (res) => {
-          this.tableData = res.data;
-          this.total = res.total ? res.total : 0;
+          if (res) {
+            if (res.data) {
+              this.tableData = res.data;
+            }
+            if (res.total) {
+              this.total = res.total;
+            }
+          }
           this.loading = false;
           this.doLayout();
         }
@@ -152,7 +179,9 @@
     },
     calcTableHeight() {
       const h1 = this.$refs.searchRef.$el.offsetHeight;
-      const h2 = this.$refs.paginationRef ? this.$refs.paginationRef.$el.offsetHeight : 0;
+      const h2 = this.$refs.paginationRef
+        ? this.$refs.paginationRef.$el.offsetHeight
+        : 0;
       const h3 = this.$refs.expandRef.$el.offsetHeight;
       const h4 = this.$refs.expand2Ref.offsetHeight;
 
@@ -183,7 +212,7 @@
     handleSortChange({ column, prop, order }) {
       this.$emit('sortChange', { column, prop, order });
     },
-    clearSort(){
+    clearSort() {
       this.$refs.tableRef.clearSort();
     }
   },

--
Gitblit v1.9.3