From 3c9000a858a9e3634317038ecba4a0d914b41efe Mon Sep 17 00:00:00 2001 From: herenshan112 Date: Wed, 11 Feb 2026 16:02:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=A4=A7=E5=AE=BD=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DesignForm/public/form/childTable.vue | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/src/components/DesignForm/public/form/childTable.vue b/src/components/DesignForm/public/form/childTable.vue index 91dd84a..7d25218 100644 --- a/src/components/DesignForm/public/form/childTable.vue +++ b/src/components/DesignForm/public/form/childTable.vue @@ -103,7 +103,7 @@ onMounted(()=>{ setTimeout(()=>{ if(preFillFlag.value==1){ let i = 0; - props.data.control.preFill.ids.forEach((element:any) => { + props.data.control.preFill?.ids.forEach((element:any) => { addColumn() //console.log(element) @@ -340,6 +340,25 @@ function optionsValue3Get1(data: any, fieldName: string) { console.log(props.data.name) */ emits("optionsValue3GetTable", data, fieldName); } +/** +@ 作者: 秦东 +@ 时间: 2026-02-11 15:52:08 +@ 功能: 计算宽度 +*/ +const jisuanTableWidth = (data: any) => { + let width = 0; + console.log("jisuanTableWidth--->计算宽度",data.item.label.length,"---------->",data) + // data.item.label.forEach((item: any) => { + // // width += item.item.span?item.item.span:120; + // }); + if (data.item.label && data.item.label.length > 0) { + width = data.item.label.length * 30+90; + } + if (width < 100) { + width = 120; + } + return width; +} @@ -354,9 +373,10 @@ function optionsValue3Get1(data: any, fieldName: string) { :key="index" :prop="item.name" :label="item.item.label" - :width="item.item.span" + :width="jisuanTableWidth(item)" >