From 1d0dfd5cb34223f476302a38657339f44c790968 Mon Sep 17 00:00:00 2001 From: yaojn Date: Tue, 15 Apr 2025 17:57:22 +0800 Subject: [PATCH] =?UTF-8?q?-=20[=E4=BF=AE=E5=A4=8D]=E8=A1=A8=E5=8D=95?= =?UTF-8?q?=E4=B8=AD=E8=A1=A8=E6=A0=BC=E8=BE=93=E5=85=A5=E9=80=9A=E8=BF=87?= =?UTF-8?q?excel=E5=AF=BC=E5=85=A5=E6=97=B6=E4=B8=8B=E6=8B=89=E6=A1=86?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E7=9A=84=E6=95=B0=E6=8D=AE=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E4=B8=BA=E6=96=87=E6=9C=AC=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=20=20=20-=20[=E5=85=B3=E8=81=94]#[1399952813555712]=E8=A1=A8?= =?UTF-8?q?=E5=8D=95=E4=B8=AD=E8=A1=A8=E6=A0=BC=E8=BE=93=E5=85=A5=E9=80=9A?= =?UTF-8?q?=E8=BF=87excel=E5=AF=BC=E5=85=A5=E6=97=B6=E4=B8=8B=E6=8B=89?= =?UTF-8?q?=E6=A1=86=E7=B1=BB=E5=9E=8B=E7=9A=84=E6=95=B0=E6=8D=AE=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=E6=A0=BC=E5=BC=8F=E4=B8=BA=E6=96=87=E6=9C=AC=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=20http://192.168.0.96:8090/demo/rdm.html#/bug-detail/?= =?UTF-8?q?939050947543040/939050947543057/1399952813555712?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/component/formtableinputer/index.vue | 33 ++++++++++++++++--- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/src/resources/plugins/TsSheet/form/component/formtableinputer/index.vue b/src/resources/plugins/TsSheet/form/component/formtableinputer/index.vue index bbccd3b7..39e5b67b 100644 --- a/src/resources/plugins/TsSheet/form/component/formtableinputer/index.vue +++ b/src/resources/plugins/TsSheet/form/component/formtableinputer/index.vue @@ -714,7 +714,7 @@ export default { let { config = {}, handler = '' } = selectedItem || {}; if (!this.$utils.isEmpty(value)) { let { dataSource = '', isMultiple = false, matrixUuid = '', mapping = {} } = config || {}; - if (dataSource === 'matrix' && (isMultiple || handler == 'formradio' || handler == 'formcheckbox')) { + if (dataSource === 'matrix') { // 矩阵 resultValue = []; if (matrixUuid && !this.$utils.isEmpty(mapping) && mapping.text && mapping.value) { @@ -733,16 +733,39 @@ export default { if (res && res.Status == 'OK') { let tbodyList = (res.Return && res.Return.tbodyList) || []; tbodyList.forEach(item => { - if (item && item.dataList) { - resultValue.push(...item.dataList); + if (item && item.dataList && item.dataList.length > 0) { + if ((isMultiple || handler == 'formcheckbox')) { + resultValue.push(...item.dataList); + } else { + resultValue = item.dataList[0]; + } } }); } }); } - } else if (dataSource == 'static' && (isMultiple || handler == 'formcheckbox')) { + } else if (dataSource == 'static') { resultValue = []; - resultValue = typeof value == 'string' ? value.split(',') : [typeof value == 'number' ? String(value) : value]; + if ((isMultiple || handler == 'formcheckbox')) { + if (typeof value == 'string') { + resultValue = value.split(',').map((v) => ({ + text: v, + value: v + })); + } else if (typeof value == 'number') { + resultValue = [{ text: String(value), value: value }]; + } else { + resultValue = [{ + text: value, + value: value + }]; + } + } else { + resultValue = { + text: value, + value: value + }; + } } else { resultValue = typeof value == 'number' ? String(value) : value; } -- Gitee