From 8a3046817d6bf207f38accd0cd6b65d770db3bea Mon Sep 17 00:00:00 2001 From: riku <risaku@163.com> Date: 星期五, 12 九月 2025 17:20:08 +0800 Subject: [PATCH] 1. 修改静安第三方接口url地址 2. 修改静安新增设备匹配功能中,上传的经纬度信息为我方的信息 --- src/components/table/FYTable.vue | 51 ++++++++++++++++++++++++++++++++++++++++++--------- 1 files changed, 42 insertions(+), 9 deletions(-) diff --git a/src/components/table/FYTable.vue b/src/components/table/FYTable.vue index 42c7a99..b759ee0 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 + v-bind="$attrs" ref="tableRef" :data="tableData" v-loading="loading" @@ -39,6 +40,7 @@ :cell-class-name="cellClassName" @paste="handlePaste" @sort-change="handleSortChange" + :show-overflow-tooltip="true" border > <slot name="table-column" :size="fontSize"></slot> @@ -78,6 +80,14 @@ size: { type: String, default: 'default' + }, + data: { + type: Array, + default: () => [] + }, + totalCount: { + type: Number, + default: 0 } }, data() { @@ -91,7 +101,7 @@ fontSize: 'default' }; }, - emits: ['search', 'cellClick', 'tablePaste'], + emits: ['search', 'cellClick', 'tablePaste', 'sortChange'], watch: { currentPage(nValue, oValue) { if (nValue != oValue) { @@ -110,13 +120,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 +165,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 +180,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; @@ -177,17 +207,20 @@ handlePaste(event) { this.$emit('tablePaste', event); }, - doLayout(){ + doLayout() { this.$refs.tableRef.doLayout(); }, - handleSortChange({column, prop, order }){ - + handleSortChange({ column, prop, order }) { + this.$emit('sortChange', { column, prop, order }); + }, + clearSort() { + this.$refs.tableRef.clearSort(); } }, mounted() { this.tableHeight = this.calcTableHeight(); this.onSearch(); - } + }, }; </script> -- Gitblit v1.9.3