diff --git a/src/components/DataStandard/WorkForm/Design/config/print.tsx b/src/components/DataStandard/WorkForm/Design/config/print.tsx index 3ba30beede32d3164b0ee8338893f5c2c949972a..590fd12a2db62059ad691ec68473c5d3c1683771 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 830950abf567ad3a744b9df5be829fc6df85266c..a62312b38feff35cf340b540f885ce3921a49b63 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] ?? diff --git a/src/executor/open/form/index.tsx b/src/executor/open/form/index.tsx index 91e034d55f1d2b8db96e6bc489ae04213bc7fc80..588b42fa9c6a265cd6eb26f28fa4bc3bef88ea75 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]; }