From d7c6c6429a00a480a5b163e0afe7aae217d8a1f6 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期二, 10 三月 2026 17:30:36 +0800
Subject: [PATCH] 2026.3.10

---
 src/components/table/FYTable.vue |   94 +++++++++++++++++++++++------------------------
 1 files changed, 46 insertions(+), 48 deletions(-)

diff --git a/src/components/table/FYTable.vue b/src/components/table/FYTable.vue
index 25023f6..fc0c3c9 100644
--- a/src/components/table/FYTable.vue
+++ b/src/components/table/FYTable.vue
@@ -75,30 +75,30 @@
     cellClassName: Function || String,
     pagination: {
       type: Boolean,
-      default: true
+      default: true,
     },
     // '' | 'small' | 'default' | 'large'
     size: {
       type: String,
-      default: 'default'
+      default: 'default',
     },
     data: {
       type: Array,
-      default: () => []
+      default: () => [],
     },
     totalCount: {
       type: Number,
-      default: 0
+      default: 0,
     },
     defaultPageSize: {
       type: Number,
-      default: 20
+      default: 20,
     },
     // 棰濆鐨勯珮搴︼紝鐢ㄤ簬璁$畻琛ㄦ牸楂樺害
     extraHeight: {
       type: Number,
-      default: 0
-    }
+      default: 0,
+    },
   },
   data() {
     return {
@@ -108,46 +108,46 @@
       currentPage: 1,
       pageSize: this.defaultPageSize,
       loading: false,
-      fontSize: 'default'
-    };
+      fontSize: 'default',
+    }
   },
   emits: ['search', 'cellClick', 'tablePaste', 'sortChange'],
   watch: {
     currentPage(nValue, oValue) {
       if (nValue != oValue) {
-        this.onSearch();
+        this.onSearch()
       }
     },
     pageSize(nValue, oValue) {
       if (nValue != oValue) {
-        this.onSearch();
+        this.onSearch()
       }
     },
     size: {
       handler(nValue, oValue) {
         if (nValue != oValue) {
-          this.fontSize = nValue;
+          this.fontSize = nValue
         }
       },
-      immediate: true
+      immediate: true,
     },
     data(nValue, oValue) {
       if (nValue != oValue) {
-        this.tableData = nValue;
+        this.tableData = nValue
       }
     },
     totalCount(nValue, oValue) {
       if (nValue != oValue) {
-        this.total = nValue;
+        this.total = nValue
       }
     },
     extraHeight: {
       handler(nValue, oValue) {
         if (nValue != oValue) {
-          this.tableHeight = this.calcTableHeight();
+          this.tableHeight = this.calcTableHeight()
         }
-      }
-    }
+      },
+    },
   },
   computed: {},
   methods: {
@@ -157,73 +157,71 @@
      * 鍥炶皟鍑芥暟鎺ユ敹涓�涓璞★紝鍖呮嫭琛ㄦ牸鏁版嵁鏁扮粍data鍜屾暟鎹�绘暟total
      */
     onSearch() {
-      this.loading = true;
+      this.loading = true
       this.$emit(
         'search',
         {
           currentPage: this.currentPage,
-          pageSize: this.pageSize
+          pageSize: this.pageSize,
         },
         (res) => {
           if (res) {
             if (res.data) {
-              this.tableData = res.data;
+              this.tableData = res.data
             }
             if (res.total) {
-              this.total = res.total;
+              this.total = res.total
             }
           }
-          this.loading = false;
-          this.doLayout();
-        }
-      );
+          this.loading = false
+          this.doLayout()
+        },
+      )
     },
     calcTableHeight() {
-      const h1 = this.$refs.searchRef.$el.offsetHeight;
-      const h2 = this.$refs.paginationRef
-        ? this.$refs.paginationRef.$el.offsetHeight
-        : 0;
-      const h3 = this.$refs.expandRef.$el.offsetHeight;
-      const h4 = this.$refs.expand2Ref.offsetHeight;
+      const h1 = this.$refs.searchRef.$el.offsetHeight
+      const h2 = this.$refs.paginationRef ? this.$refs.paginationRef.$el.offsetHeight : 0
+      const h3 = this.$refs.expandRef.$el.offsetHeight
+      const h4 = this.$refs.expand2Ref.offsetHeight
 
-      const h = h1 + h2 + h3 + h4 + this.extraHeight;
-      return this.contentMaxHeight.value - h + 'px';
+      const h = h1 + h2 + h3 + h4 + this.extraHeight
+      return this.contentMaxHeight - h + 'px'
       // return `calc(100vh - ${h}px - 60px - var(--el-main-padding) * 2)`;
     },
     tableRowClassName({ row }) {
       if (this.rowClassName) {
         if (typeof this.rowClassName == 'string') {
-          return this.rowClassName;
+          return this.rowClassName
         } else if (typeof this.rowClassName == 'function') {
-          return this.rowClassName({ row });
+          return this.rowClassName({ row })
         }
       } else {
-        return row.extension1 != '0' ? 'online-row' : 'offline-row';
+        return row.extension1 != '0' ? 'online-row' : 'offline-row'
       }
     },
     cellClick(row, column, cell, event) {
-      this.$emit('cellClick', row, column, cell, event);
+      this.$emit('cellClick', row, column, cell, event)
     },
     handlePaste(event) {
-      this.$emit('tablePaste', event);
+      this.$emit('tablePaste', event)
     },
     doLayout() {
-      this.$refs.tableRef.doLayout();
+      this.$refs.tableRef.doLayout()
     },
     handleSortChange({ column, prop, order }) {
-      this.$emit('sortChange', { column, prop, order });
+      this.$emit('sortChange', { column, prop, order })
     },
     clearSort() {
-      this.$refs.tableRef.clearSort();
-    }
+      this.$refs.tableRef.clearSort()
+    },
   },
   mounted() {
     setTimeout(() => {
-      this.tableHeight = this.calcTableHeight();
-    }, 100);
-    this.onSearch();
-  }
-};
+      this.tableHeight = this.calcTableHeight()
+    }, 100)
+    this.onSearch()
+  },
+}
 </script>
 
 <style>

--
Gitblit v1.9.3