From 3054fbea17ba7d09ecc7e80754cbb8ef487a5347 Mon Sep 17 00:00:00 2001 From: liwenxuan <1298531568@qq.com> Date: Tue, 21 Oct 2025 14:08:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=9A=E9=80=89=E6=A1=86=E5=8A=A0=E5=BC=80?= =?UTF-8?q?=E5=85=B3=E6=8E=A7=E5=88=B6=E6=8F=90=E4=BA=A4=E5=90=8E=E4=B9=9F?= =?UTF-8?q?=E8=83=BD=E6=98=BE=E7=A4=BA=E6=89=80=E6=9C=89=E9=80=89=E9=A1=B9?= =?UTF-8?q?-----=E5=AD=90=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DesignForm/public/form/childTable.vue | 72 ++++++++++++++++++- .../DesignForm/public/form/formItem.vue | 2 + 2 files changed, 73 insertions(+), 1 deletion(-) diff --git a/src/components/DesignForm/public/form/childTable.vue b/src/components/DesignForm/public/form/childTable.vue index 8452665..284a865 100644 --- a/src/components/DesignForm/public/form/childTable.vue +++ b/src/components/DesignForm/public/form/childTable.vue @@ -190,8 +190,50 @@ const timeToString = (timeVal: any, types: int) => { }; +// 将字符类数字转为数值类 +const formatNumber = (val: any) => { + // 将字符类数字转为数值类 + if (typeof val === 'string' && /^\d+(\.\d+)?$/.test(val.toString())) { + // 为数字 + return Number(val) + } else { + return val + } +} +const config = computed(() => { + return props.data.config || {}; +}); +const transformOption = (val: string | number, type?: string) => { + switch (config.value.transformData || type) { + case "none": + return val; + case "string": + try { + return val.toString(); + } catch (e) { + return val; + } + } + return formatNumber(val); +}; - +const judgeCheckbox = (val: any, list: any) => { + let valAry = []; + if (Array.isArray(val)) { + if (val.length > 0) { + if (Array.isArray(list)) { + val.forEach((item) => { + list.forEach((ltem) => { + if (item == ltem.value) { + valAry.push(ltem.label); + } + }); + }); + } + } + } + return valAry.join(',');; +}; let associatedFormsIndexTablekey = 0; /* const emits = defineEmits<{ @@ -248,6 +290,34 @@ function optionsValue3Get1(data: any, fieldName: string) { v-else-if="item.type == 'datePicker'" v-html="timeToString(scope.row[item.name], item.control.type)" > + +