Commit e8c9ebc0 by zhaochengxiang

标签

parent a9868730
...@@ -171,7 +171,7 @@ export function TagCell({ value, readonly = false, onChange, onAdd }) { ...@@ -171,7 +171,7 @@ export function TagCell({ value, readonly = false, onChange, onAdd }) {
}}> }}>
{ {
_value?.map((item, index) => <TagRender _value?.map((item, index) => <TagRender
key={index} key={item.id}
data={item} data={item}
closable={!readonly&&item?.deleteAble} closable={!readonly&&item?.deleteAble}
onClose={(e) => { onClose={(e) => {
...@@ -185,7 +185,7 @@ export function TagCell({ value, readonly = false, onChange, onAdd }) { ...@@ -185,7 +185,7 @@ export function TagCell({ value, readonly = false, onChange, onAdd }) {
<Space wrap={true}> <Space wrap={true}>
{ {
value?.map((item, index) => <TagRender value?.map((item, index) => <TagRender
key={index} key={item.id}
data={item} data={item}
closable={!readonly&&item?.deleteAble} closable={!readonly&&item?.deleteAble}
onClose={(e) => { onClose={(e) => {
...@@ -231,7 +231,7 @@ export function TagSelect({ options, onChange }) { ...@@ -231,7 +231,7 @@ export function TagSelect({ options, onChange }) {
const { value } = props const { value } = props
const index = (options??[]).findIndex(item => item.value === value) const index = (options??[]).findIndex(item => item.value === value)
if (index !== -1) { if (index !== -1) {
return <TagRender data={options[index]} {...props} /> return <TagRender key={value} data={options[index]} {...props} />
} }
return <React.Fragment></React.Fragment> return <React.Fragment></React.Fragment>
...@@ -258,7 +258,6 @@ export function TagSelect({ options, onChange }) { ...@@ -258,7 +258,6 @@ export function TagSelect({ options, onChange }) {
/> />
<TagSelectPopup <TagSelectPopup
tagSearchType='tag-search'
value={options} value={options}
onCancel={(value) => { onCancel={(value) => {
setPopupParams({ setPopupParams({
...@@ -282,7 +281,7 @@ export function TagSelect({ options, onChange }) { ...@@ -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 [waiting, setWaiting] = React.useState(false)
const [selectedRows, setSelectedRows] = React.useState([]) const [selectedRows, setSelectedRows] = React.useState([])
const [showDataQuality, setShowDataQuality] = React.useState(false) const [showDataQuality, setShowDataQuality] = React.useState(false)
...@@ -310,13 +309,6 @@ export function TagSelectPopup({ visible, type, tagSearchType, items, onCancel, ...@@ -310,13 +309,6 @@ export function TagSelectPopup({ visible, type, tagSearchType, items, onCancel,
return return
} }
if (tagSearchType === 'tag-search') {
onChange?.(selectedRows)
close()
return
}
setWaiting(true) setWaiting(true)
dispatch({ dispatch({
type: 'tag.addTags', type: 'tag.addTags',
...@@ -327,6 +319,7 @@ export function TagSelectPopup({ visible, type, tagSearchType, items, onCancel, ...@@ -327,6 +319,7 @@ export function TagSelectPopup({ visible, type, tagSearchType, items, onCancel,
type, type,
catalogId: (items??[]).length>0?items[0].resourceCatalogId:'', catalogId: (items??[]).length>0?items[0].resourceCatalogId:'',
creator: app?.user?.userName, creator: app?.user?.userName,
overrideAll: true,
} }
}, },
callback: () => { callback: () => {
...@@ -367,9 +360,17 @@ export function TagSelectPopup({ visible, type, tagSearchType, items, onCancel, ...@@ -367,9 +360,17 @@ export function TagSelectPopup({ visible, type, tagSearchType, items, onCancel,
> >
<Spin spinning={waiting} > <Spin spinning={waiting} >
{ {
showDataQuality ? <DataQuality type={DataQualityFeighTagSelect} onChange={(val) => { showDataQuality ? <DataQuality
setSelectedRows(val) type={DataQualityFeighTagSelect}
}} /> : null data={{
type,
items,
value,
}}
onChange={(val) => {
setSelectedRows(val)
}}
/> : null
} }
</Spin> </Spin>
</Modal> </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