From 1abb6a9ca01cc76f271542a063d1b19839448019 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期五, 27 九月 2024 17:42:05 +0800
Subject: [PATCH] 1.新增评估结果批量导入功能(未完成)

---
 src/components/table/FYTable.vue |   21 ++++++++++++++++++++-
 1 files changed, 20 insertions(+), 1 deletions(-)

diff --git a/src/components/table/FYTable.vue b/src/components/table/FYTable.vue
index bec9d06..42c7a99 100644
--- a/src/components/table/FYTable.vue
+++ b/src/components/table/FYTable.vue
@@ -28,12 +28,17 @@
     <slot name="options-expand2"></slot>
   </div>
   <el-table
+    ref="tableRef"
     :data="tableData"
     v-loading="loading"
     table-layout="fixed"
     :row-class-name="tableRowClassName"
     :height="tableHeight"
     :size="fontSize"
+    @cell-click="cellClick"
+    :cell-class-name="cellClassName"
+    @paste="handlePaste"
+    @sort-change="handleSortChange"
     border
   >
     <slot name="table-column" :size="fontSize"></slot>
@@ -64,6 +69,7 @@
 export default {
   props: {
     rowClassName: undefined,
+    cellClassName: Function || String,
     pagination: {
       type: Boolean,
       default: true
@@ -85,7 +91,7 @@
       fontSize: 'default'
     };
   },
-  emits: ['search'],
+  emits: ['search', 'cellClick', 'tablePaste'],
   watch: {
     currentPage(nValue, oValue) {
       if (nValue != oValue) {
@@ -140,6 +146,7 @@
           this.tableData = res.data;
           this.total = res.total ? res.total : 0;
           this.loading = false;
+          this.doLayout();
         }
       );
     },
@@ -163,6 +170,18 @@
       } else {
         return row.extension1 != '0' ? 'online-row' : 'offline-row';
       }
+    },
+    cellClick(row, column, cell, event) {
+      this.$emit('cellClick', row, column, cell, event);
+    },
+    handlePaste(event) {
+      this.$emit('tablePaste', event);
+    },
+    doLayout(){
+      this.$refs.tableRef.doLayout();
+    },
+    handleSortChange({column, prop, order }){
+
     }
   },
   mounted() {

--
Gitblit v1.9.3