From e1e5dad3197982a09c86121db61bfa14164bb831 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BD=97=E9=AA=8F=E8=BE=89?= <2807466517@qq.com> Date: Wed, 16 Jul 2025 15:58:39 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=BE=97=E5=AE=9E=E7=89=B9=E6=AE=8A?= =?UTF-8?q?=E5=A4=84=E7=90=86=E7=94=A8=E6=88=B7=E5=9E=8B=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/executor/open/form/index.tsx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/executor/open/form/index.tsx b/src/executor/open/form/index.tsx index 91e034d55..588b42fa9 100644 --- a/src/executor/open/form/index.tsx +++ b/src/executor/open/form/index.tsx @@ -607,13 +607,22 @@ const FormView: React.FC = ({ form, finished }) => { console.log(row); const formattedRow: FormattedRow = {}; for (const item of selectedFields) { + const targetfield = form.fields.find((part) => part.propId == item); if (item === 'belongId') { const result = await kernel.queryEntityById({ id: row[item], }); formattedRow[item] = result.data.name; - } else if (item == 'id') { - formattedRow[item] = row[item]; + } else if (targetfield && targetfield.valueType == '用户型') { + const query = await kernel.queryEntityById({ + id: row[item], + }); + console.log(query) + if (query.data?.name) { + formattedRow[item] = query.data.name; + } else { + formattedRow[item] = row[item]; + } } else { formattedRow[item] = row[item]; } -- Gitee From 75be76fedd4998e97103cf2c1d0daabe0e3b7f93 Mon Sep 17 00:00:00 2001 From: luojunhui <2807466517@qq.com> Date: Fri, 18 Jul 2025 17:59:24 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=8F=AF=E6=B7=BB=E5=8A=A0=E5=94=AF?= =?UTF-8?q?=E4=B8=80=E6=A0=87=E8=AF=86=E5=88=B0=E6=A0=87=E7=AD=BE=E6=89=93?= =?UTF-8?q?=E5=8D=B0=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WorkForm/Design/config/print.tsx | 28 +++++++++++++++---- src/executor/open/form/detail/print.tsx | 25 +++++++++++++++++ 2 files changed, 47 insertions(+), 6 deletions(-) diff --git a/src/components/DataStandard/WorkForm/Design/config/print.tsx b/src/components/DataStandard/WorkForm/Design/config/print.tsx index 3ba30beed..590fd12a2 100644 --- a/src/components/DataStandard/WorkForm/Design/config/print.tsx +++ b/src/components/DataStandard/WorkForm/Design/config/print.tsx @@ -41,12 +41,28 @@ const PrintConfig: React.FC = ({ current }) => { ); const values = deepClone(current?.attributes); values.unshift({ - id: 'id', + id: 'id', name: '唯一标识', + primaryId: 'id', code: 'id', - valueType: '描述型', + rule: '', remark: '唯一标识', - } as any); + authId: '', + propId: 'id', + formId: current.metadata.id, + queryRule: '', + belongId: '', + property: undefined, + options: undefined, + status: 0, + createUser: '', + updateUser: '', + version: '', + createTime: '', + updateTime: '', + shareId: '', + }); + const unitVerticalList = [ { id: 1, name: '与二维码对齐', value: 1 }, { id: 2, name: '与属性对齐', value: 2 }, @@ -79,7 +95,7 @@ const PrintConfig: React.FC = ({ current }) => { }); const findItem = (title: string) => { - const attribute = current.attributes.find((i) => i.name === title); + const attribute = values.find((i) => i.name === title); if (attribute) return attribute; return ''; }; @@ -332,11 +348,11 @@ const PrintConfig: React.FC = ({ current }) => { searchMode="contains" searchExpr={'name'} value={item.value} - dataSource={current.attributes} + dataSource={values} displayExpr={'name'} valueExpr={'propId'} onValueChanged={(value) => { - var attr = current.attributes.find((a) => + var attr = values.find((a) => [a.propId, a.id, a.primaryId].includes(value.value), ); setCount((prev) => { diff --git a/src/executor/open/form/detail/print.tsx b/src/executor/open/form/detail/print.tsx index 830950abf..a62312b38 100644 --- a/src/executor/open/form/detail/print.tsx +++ b/src/executor/open/form/detail/print.tsx @@ -46,6 +46,28 @@ const ThingPrint: React.FC = ({ const box = document.createElement('div'); let printStr = ''; let card = []; + attributes.push({ + id: 'id', + name: '唯一标识', + primaryId: 'id', + code: 'id', + rule: '', + remark: '唯一标识', + authId: '', + propId: 'id', + formId: '', + queryRule: '', + belongId: '', + property: undefined, + options: undefined, + status: 0, + createUser: '', + updateUser: '', + version: '', + createTime: '', + updateTime: '', + shareId: '', + }) card = things.map((thing) => { return qrcodeConfig.map((i) => { let data = ''; @@ -53,6 +75,9 @@ const ThingPrint: React.FC = ({ var attr = attributes.find((a) => [a.propId, a.id, a.primaryId].includes(i.value), ); + if (i.value == 'id') { + i.type = '描述型' + } if (attr) { value = thing[attr!.id] ?? -- Gitee