From 2993f2202d4acc47d7c65d0e40456c68c95d8cfb Mon Sep 17 00:00:00 2001 From: 田源 <lastanimals@163.com> Date: 星期三, 02 八月 2023 11:30:02 +0800 Subject: [PATCH] 主数据表格错行-表头动态宽度-添加修改默认字段禁用 --- Source/UBCS-WEB/src/components/MasterCrud/VciMasterCrud.vue | 20 ++++++++++++-------- 1 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Source/UBCS-WEB/src/components/MasterCrud/VciMasterCrud.vue b/Source/UBCS-WEB/src/components/MasterCrud/VciMasterCrud.vue index 1bec8e9..21d4327 100644 --- a/Source/UBCS-WEB/src/components/MasterCrud/VciMasterCrud.vue +++ b/Source/UBCS-WEB/src/components/MasterCrud/VciMasterCrud.vue @@ -31,7 +31,7 @@ :label="item.label" :prop="item.prop" :show-overflow-tooltip="true" :sortable="item.sortable" - :width="item.label.length >= 4 ? '150' : item.label.length == 3 ? '120' : '90'" + :width="item.width" align="center"> </el-table-column> </el-table> @@ -241,13 +241,12 @@ created() { }, mounted() { - }, activated() { - // this.doLayout(); - this.$nextTick(() => { - this.$refs.dataTable.doLayout() - }) + this.doLayout() + }, + updated() { + this.doLayout() }, watch: { tableHeadDataFateher: { @@ -266,6 +265,7 @@ handler(newval, oldval) { this.tableData = newval; this.searchResults = newval + this.doLayout() }, }, tableHeadFindData: { @@ -643,10 +643,13 @@ saveRow() { this.editingRow = null; }, + //琛ㄦ牸閿欒闂 doLayout() { this.$nextTick(() => { - this.$refs.crud.doLayout(); - }); + if (this.$refs.dataTable && this.$refs.dataTable.doLayout) { + this.$refs.dataTable.doLayout(); + } + }) }, //琛ㄦ牸澶存覆鏌� CrudHeaderRend() { @@ -717,6 +720,7 @@ limit: this.page.pageSize, }).then((res) => { this.tableData = res.data.data; + this.doLayout() }); }, //澶氶�� -- Gitblit v1.9.3