From 2bee4ac5b53d0d35afa7e74e39b801de199ff17a Mon Sep 17 00:00:00 2001 From: v_xugzhou <941071842@qq.com> Date: Fri, 8 Nov 2024 14:41:45 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=B7=B2=E5=AD=98=E5=9C=A8=E7=9A=84?= =?UTF-8?q?=E5=86=B3=E7=AD=96=E8=A1=A8=E5=AF=BC=E5=87=BA=E5=90=8E=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E5=AF=BC=E5=85=A5=E6=94=B6=E9=97=AE=E9=A2=98=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=20#59=20#=20Reviewed,=20transaction=20id:=2023272?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DecisionTable/ImportExport/ExportBtn.vue | 23 ++++- .../DecisionTable/ImportExport/ImportBtn.vue | 12 +-- .../ImportExport/dataTransfer.js | 99 ++++++++++++------- .../components/FieldSlider/index.vue | 19 ++++ frontend/src/config/i18n/cn.js | 1 + frontend/src/config/i18n/en.js | 1 + 6 files changed, 105 insertions(+), 50 deletions(-) diff --git a/frontend/src/components/DecisionTable/ImportExport/ExportBtn.vue b/frontend/src/components/DecisionTable/ImportExport/ExportBtn.vue index 2aeedae..1c60092 100644 --- a/frontend/src/components/DecisionTable/ImportExport/ExportBtn.vue +++ b/frontend/src/components/DecisionTable/ImportExport/ExportBtn.vue @@ -69,11 +69,25 @@ // 暂时过滤【条件组合】类型!!! if (cur.inputs.type !== 'common') return acc; const arr = []; - cur.inputs.conditions.forEach((item) => { - arr.push({ v: getCellText(item), t: 's', s: cellStyles }); + cur.inputs.conditions.forEach((item, index) => { + const inputInfo = inputs[index]; + const v = getCellText(item); + if (inputInfo.type === 'select') { + // 下拉框类型导出为text + const option = inputInfo.options.items.find(o => o.id === v); + arr.push({ v: option.name, t: 's', s: cellStyles }); + } else { + arr.push({ v, t: 's', s: cellStyles }); + } }); outputs.forEach((item) => { - arr.push({ v: cur.outputs[item.id], t: 's', s: cellStyles }); + if (item.type === 'select') { + // 下拉框类型导出为text + const option = item.options.items.find(o => o.id === cur.outputs[item.id]); + arr.push({ v: option.name, t: 's', s: cellStyles }); + } else { + arr.push({ v: cur.outputs[item.id], t: 's', s: cellStyles }); + } }); acc.push(arr); return acc; @@ -112,8 +126,9 @@ fill: { fgColor: { rgb: '9FE3FF' } }, }, }); + const c = headerIndex === 0 ? childIndex : (headers[headerIndex - 1].children.length + childIndex); comments.push({ - cell: XLSX.utils.encode_cell({ c: headerIndex * header.children.length + childIndex, r: 1 }), + cell: XLSX.utils.encode_cell({ c, r: 1 }), comment: child.description, }); }); diff --git a/frontend/src/components/DecisionTable/ImportExport/ImportBtn.vue b/frontend/src/components/DecisionTable/ImportExport/ImportBtn.vue index e7b8ebd..c0a60d2 100644 --- a/frontend/src/components/DecisionTable/ImportExport/ImportBtn.vue +++ b/frontend/src/components/DecisionTable/ImportExport/ImportBtn.vue @@ -17,7 +17,7 @@