From fe9d443100336810b30d5531c78d8945318bd950 Mon Sep 17 00:00:00 2001 From: GitHub Actions Bot Date: Wed, 25 Sep 2024 19:23:59 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=B1:=20[client]=20sync=20upgrade=20wit?= =?UTF-8?q?h=202=20commits=20[trident-sync]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit perf: 优化示例的自动调整列宽 --- .../src/plugin/fast-crud/index.tsx | 26 ++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/packages/ui/certd-client/src/plugin/fast-crud/index.tsx b/packages/ui/certd-client/src/plugin/fast-crud/index.tsx index 24d05e90..e5817613 100644 --- a/packages/ui/certd-client/src/plugin/fast-crud/index.tsx +++ b/packages/ui/certd-client/src/plugin/fast-crud/index.tsx @@ -45,6 +45,9 @@ function install(app: any, options: any = {}) { }, conditionalRender: { match(scope) { + if (scope.key === "__blank__") { + return false; + } //不能用 !scope.value , 否则switch组件设置为关之后就消失了 const { value, key, props } = scope; return !value && key != "_index" && value != false; @@ -134,6 +137,20 @@ function install(app: any, options: any = {}) { column: { order: 1000 } + }, + //最后一列空白,用于自动伸缩列宽 + __blank__: { + title: "", + type: "text", + form: { + show: false + }, + column: { + order: 99999, + width: -1, + columnSetShow: false, + resizable: false + } } } }; @@ -346,10 +363,13 @@ function install(app: any, options: any = {}) { if (!columnProps.column) { columnProps.column = {}; } - columnProps.column.resizable = true; - if (!columnProps.column.width) { - columnProps.column.width = 100; + if (columnProps.column.resizable == null) { + columnProps.column.resizable = true; + if (!columnProps.column.width) { + columnProps.column.width = 200; + } } + return columnProps; } });