diff --git a/index.html b/index.html index 7cda843043b95f1c5c8a02e8991bbe47afe12f88..ac7dfd5432c6952bb59d31ba7075750ffb954cbd 100644 --- a/index.html +++ b/index.html @@ -32,7 +32,7 @@ }
diff --git a/src/components/Common/FlowDesign/Config/Components/PrintNode/printTemplate/Template1.tsx b/src/components/Common/FlowDesign/Config/Components/PrintNode/printTemplate/Template1.tsx index 09a77f8c0073cf08351c6c045aaac66a5f44e3ec..f81829555ee073b8c4f63e7f764f05bfa21ae313 100644 --- a/src/components/Common/FlowDesign/Config/Components/PrintNode/printTemplate/Template1.tsx +++ b/src/components/Common/FlowDesign/Config/Components/PrintNode/printTemplate/Template1.tsx @@ -300,9 +300,15 @@ const Template1: FC = ({ printData, current, loading, styleTemplate, pri const parentNodeText = newParentObj.join('、'); return {parentNodeText}; } else if (type === '选择型') { + const lookups = + attrsObj.lookups != undefined && attrsObj.lookups.length > 0 + ? attrsObj.lookups + : current.instanceData!.fields[attrsObj.xfield.formId].filter( + (obj) => obj.id == attrsObj.id, + )[0].lookups; return (
- {attrsObj.lookups + {lookups .filter((item: any) => !item.hide) .map((lookup: any) => (
); } else if (type === '分类型') { + const lookups = + attrsObj.lookups != undefined && attrsObj.lookups.length > 0 + ? attrsObj.lookups + : current.instanceData!.fields[attrsObj.xfield.formId].filter( + (obj) => obj.id == attrsObj.id, + )[0].lookups; let flText = ''; - attrsObj.lookups.forEach((item: any) => { + lookups.forEach((item: any) => { if ( item.value == current.instanceData!.data[attrsObj.xfield.name.split('-')[0]][0].after?.[0]?.[ @@ -419,13 +431,19 @@ const Template1: FC = ({ printData, current, loading, styleTemplate, pri const parentNodeText = newParentObj.join('、'); return {parentNodeText}; } else if (valueType == '选择型') { + const isLookups = + attrsObj.lookups != undefined && attrsObj.lookups.length > 0 + ? attrsObj.lookups + : current.instanceData!.fields[attrsObj.formId].filter( + (obj) => obj.id == attrsObj.id, + )[0].lookups; const lookups = attrsObj.checkTrue - ? attrsObj.lookups.filter((item: any) => + ? isLookups.filter((item: any) => attrsObj.widget == '多选框' ? value.includes(item.value) : value === item.value, ) - : attrsObj.lookups; + : isLookups; return (
{lookups @@ -452,9 +470,15 @@ const Template1: FC = ({ printData, current, loading, styleTemplate, pri
); } else if (valueType == '分类型') { + const lookups = + attrsObj.lookups != undefined && attrsObj.lookups.length > 0 + ? attrsObj.lookups + : current.instanceData!.fields[attrsObj.formId].filter( + (obj) => obj.id == attrsObj.id, + )[0].lookups; + if (!attrsObj.parentCheck) { let flText = ''; - const lookups = attrsObj.lookups; lookups.forEach((item: any) => { if (item.value == value) { flText = item.text; @@ -462,7 +486,7 @@ const Template1: FC = ({ printData, current, loading, styleTemplate, pri }); return {flText}; } else { - const treeData = buildTree(attrsObj.lookups, undefined, 1); + const treeData = buildTree(lookups, undefined, 1); const parentNode = findParentNodeByIdAndLevel( treeData, value, diff --git a/src/executor/tools/generate/thingTable.tsx b/src/executor/tools/generate/thingTable.tsx index 6405c2f5ae013c8bae0d45e4ed0501db32ec4671..d800cea83ac463d02d580c0b91f4f4eeb2250373 100644 --- a/src/executor/tools/generate/thingTable.tsx +++ b/src/executor/tools/generate/thingTable.tsx @@ -193,7 +193,12 @@ const GenerateThingTable = (props: IProps) => { ) { item[type.code] = findTextWithParent(item[type.code], type.lookups); } - if (user && column.dataField && !regex.test(item[user.code])) { + if ( + user && + column.dataField && + !regex.test(item[user.code]) && + item[user.code] + ) { if (entity == undefined) { if (user.lookups && user.lookups.length > 0) { item[user.code] = diff --git a/src/executor/tools/task/print/index.tsx b/src/executor/tools/task/print/index.tsx index 8371c003289e3b2f1e0ea61c99426f3ca7ee8ff5..0cfce99711d889bcd50511c1edc386c7fc000e0e 100644 --- a/src/executor/tools/task/print/index.tsx +++ b/src/executor/tools/task/print/index.tsx @@ -154,6 +154,11 @@ const Print = ({ current, service }: IPrint) => { {((printLoaded && resource.print?.length > 0) || resource.print?.length == 0) && (