From 6584cbef8a5829950c20b507e17445b97650e73f Mon Sep 17 00:00:00 2001 From: hcong <1050828145@qq.com> Date: 星期三, 27 十一月 2024 12:15:04 +0800 Subject: [PATCH] 1. 新增消息管理类 2. socket消息类型js改为枚举类 3. 重连函数在使用时以参数传递进来 --- src/components/table/FYTable.vue | 24 +++++++++++++++++++++++- 1 files changed, 23 insertions(+), 1 deletions(-) diff --git a/src/components/table/FYTable.vue b/src/components/table/FYTable.vue index bec9d06..3e5da08 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', 'sortChange'], 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,21 @@ } 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 }) { + this.$emit('sortChange', { column, prop, order }); + }, + clearSort(){ + this.$refs.tableRef.clearSort(); } }, mounted() { -- Gitblit v1.9.3