From d508c297fab49293eb7335f4ad1baa972826ccaf Mon Sep 17 00:00:00 2001 From: zhangminghua Date: Thu, 27 Apr 2023 16:55:29 +0800 Subject: [PATCH] =?UTF-8?q?(fixed)10220=20=E6=9C=80=E6=96=B0=E5=85=83?= =?UTF-8?q?=E6=95=B0=E6=8D=AE-=E6=96=87=E4=BB=B6=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E6=97=A0=E6=96=87=E4=BB=B6=E6=8F=8F=E8=BF=B0?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E4=BC=98=E5=8C=96=2010216=20=E6=9C=80?= =?UTF-8?q?=E6=96=B0=E5=85=83=E6=95=B0=E6=8D=AE-=E6=89=93=E6=A0=87?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E9=80=89=E6=8B=A9=E6=A0=87=E7=AD=BE=E4=BC=98?= =?UTF-8?q?=E5=8C=96-=E6=B7=BB=E5=8A=A0/=E5=88=A0=E9=99=A4=E6=96=B0?= =?UTF-8?q?=E6=A0=87=E7=AD=BE=E9=9B=86=E5=90=8E=E5=AF=B9=E5=BA=94=E6=A0=87?= =?UTF-8?q?=E7=AD=BE=E4=BB=8D=E7=84=B6=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../metadataManagement/components/metadataTagModal.js | 11 ++++++++--- .../metadataManagement/containers/filesTable.js | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/web/client/src/sections/metadataManagement/components/metadataTagModal.js b/web/client/src/sections/metadataManagement/components/metadataTagModal.js index 7741862..b32ee92 100644 --- a/web/client/src/sections/metadataManagement/components/metadataTagModal.js +++ b/web/client/src/sections/metadataManagement/components/metadataTagModal.js @@ -15,15 +15,21 @@ const MetadataDatabaseTagModal = (props) => { } const renderTagItems = () => { let tags = []; + const tagIds = form.getFieldValue('tags') || editData.record.tags || []; + let tagsValue = [] if (tagSet.length) { tagList.map(t => { if (tagSet.includes(t.tagSetId)) { t.tags.map(t => { - tags.push({t.name}) + tags.push({t.name}); + if (tagIds.includes(t.id)) { + tagsValue.push(t.id); + } }) } }); } + form.setFieldValue('tags', tagsValue); return tags; } return ( @@ -46,8 +52,7 @@ const MetadataDatabaseTagModal = (props) => { filterOption={(input, option) => option.props.children .toLowerCase().indexOf(input.toLowerCase()) >= 0} onChange={value => { - setTagSet(value) - form.setFieldValue('tags', []); + setTagSet(value); }} mode="multiple" > diff --git a/web/client/src/sections/metadataManagement/containers/filesTable.js b/web/client/src/sections/metadataManagement/containers/filesTable.js index 58c34d8..0f7110c 100644 --- a/web/client/src/sections/metadataManagement/containers/filesTable.js +++ b/web/client/src/sections/metadataManagement/containers/filesTable.js @@ -251,7 +251,7 @@ const FilesTable = (props) => { contentData.map(cd => { tableContent += ``; tableContent += `
${cd.name}
`; - tableContent += `
${cd.description}
`; + tableContent += `
${cd.description || ''}
`; tableContent += `
${cd.fileName ? cd.type : ''}
`; let tagName = cd.tagFiles.map(tagSet => tagSet.tag.name); tableContent += `
${tagName.join(',')}
`;