Commit e8c9ebc0 by zhaochengxiang

标签

parent a9868730
......@@ -171,7 +171,7 @@ export function TagCell({ value, readonly = false, onChange, onAdd }) {
}}>
{
_value?.map((item, index) => <TagRender
key={index}
key={item.id}
data={item}
closable={!readonly&&item?.deleteAble}
onClose={(e) => {
......@@ -185,7 +185,7 @@ export function TagCell({ value, readonly = false, onChange, onAdd }) {
<Space wrap={true}>
{
value?.map((item, index) => <TagRender
key={index}
key={item.id}
data={item}
closable={!readonly&&item?.deleteAble}
onClose={(e) => {
......@@ -231,7 +231,7 @@ export function TagSelect({ options, onChange }) {
const { value } = props
const index = (options??[]).findIndex(item => item.value === value)
if (index !== -1) {
return <TagRender data={options[index]} {...props} />
return <TagRender key={value} data={options[index]} {...props} />
}
return <React.Fragment></React.Fragment>
......@@ -258,7 +258,6 @@ export function TagSelect({ options, onChange }) {
/>
<TagSelectPopup
tagSearchType='tag-search'
value={options}
onCancel={(value) => {
setPopupParams({
......@@ -282,7 +281,7 @@ export function TagSelect({ options, onChange }) {
)
}
export function TagSelectPopup({ visible, type, tagSearchType, items, onCancel, onChange }) {
export function TagSelectPopup({ visible, type, value, items, onCancel, onChange }) {
const [waiting, setWaiting] = React.useState(false)
const [selectedRows, setSelectedRows] = React.useState([])
const [showDataQuality, setShowDataQuality] = React.useState(false)
......@@ -310,13 +309,6 @@ export function TagSelectPopup({ visible, type, tagSearchType, items, onCancel,
return
}
if (tagSearchType === 'tag-search') {
onChange?.(selectedRows)
close()
return
}
setWaiting(true)
dispatch({
type: 'tag.addTags',
......@@ -327,6 +319,7 @@ export function TagSelectPopup({ visible, type, tagSearchType, items, onCancel,
type,
catalogId: (items??[]).length>0?items[0].resourceCatalogId:'',
creator: app?.user?.userName,
overrideAll: true,
}
},
callback: () => {
......@@ -367,9 +360,17 @@ export function TagSelectPopup({ visible, type, tagSearchType, items, onCancel,
>
<Spin spinning={waiting} >
{
showDataQuality ? <DataQuality type={DataQualityFeighTagSelect} onChange={(val) => {
showDataQuality ? <DataQuality
type={DataQualityFeighTagSelect}
data={{
type,
items,
value,
}}
onChange={(val) => {
setSelectedRows(val)
}} /> : null
}}
/> : null
}
</Spin>
</Modal>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment