From 512d5d7e79e0a64b36e24cbe5d7c5f8d0adc0b94 Mon Sep 17 00:00:00 2001 From: riku <risaku@163.com> Date: 星期四, 26 九月 2024 17:46:48 +0800 Subject: [PATCH] 1.升级了element-plus版本 2.对外支持模块新设备匹配工地功能完成 3.新增设备匹配模块单挑匹配记录编辑功能(未完成) --- src/components/table/FYTable.vue | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 53 insertions(+), 5 deletions(-) diff --git a/src/components/table/FYTable.vue b/src/components/table/FYTable.vue index e00929f..bec9d06 100644 --- a/src/components/table/FYTable.vue +++ b/src/components/table/FYTable.vue @@ -9,18 +9,34 @@ </template> </FYSearchBar> </el-row> - <el-row ref="expandRef"> - <slot name="options-expand"></slot> + <el-row ref="expandRef" justify="space-between"> + <el-col span="22"> + <slot name="options-expand"></slot> + </el-col> + <el-col span="2"> + <el-space :wrap="false"> + <el-text size="small">瀛椾綋</el-text> + <el-radio-group v-model="fontSize" size="small"> + <el-radio-button value="small">灏�</el-radio-button> + <el-radio-button value="default">涓�</el-radio-button> + <el-radio-button value="large">澶�</el-radio-button> + </el-radio-group> + </el-space> + </el-col> </el-row> + <div ref="expand2Ref"> + <slot name="options-expand2"></slot> + </div> <el-table :data="tableData" v-loading="loading" table-layout="fixed" :row-class-name="tableRowClassName" :height="tableHeight" + :size="fontSize" border > - <slot name="table-column"></slot> + <slot name="table-column" :size="fontSize"></slot> </el-table> <el-pagination @@ -51,6 +67,11 @@ pagination: { type: Boolean, default: true + }, + // '' | 'small' | 'default' | 'large' + size: { + type: String, + default: 'default' } }, data() { @@ -60,7 +81,8 @@ total: 0, currentPage: 1, pageSize: 20, - loading: false + loading: false, + fontSize: 'default' }; }, emits: ['search'], @@ -73,6 +95,30 @@ pageSize(nValue, oValue) { if (nValue != oValue) { this.onSearch(); + } + }, + size: { + handler(nValue, oValue) { + if (nValue != oValue) { + this.fontSize = nValue; + } + }, + immediate: true + } + }, + 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 h3 = this.$refs.expandRef.$el.offsetHeight; + const h4 = this.$refs.expand2Ref.offsetHeight; + + const h = h1 + h2 + h3 + h4; + // return `calc(100vh - ${h1}px - ${h2}px - var(--el-main-padding) * 2 - var(--el-header-height))`; + return `calc(100vh - ${h}px - 60px - var(--el-main-padding) * 2)`; + } else { + return '500'; } } }, @@ -101,7 +147,9 @@ 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 h = h1 + h2 + h3; + const h4 = this.$refs.expand2Ref.offsetHeight; + + const h = h1 + h2 + h3 + h4; // return `calc(100vh - ${h1}px - ${h2}px - var(--el-main-padding) * 2 - var(--el-header-height))`; return `calc(100vh - ${h}px - 60px - var(--el-main-padding) * 2)`; }, -- Gitblit v1.9.3