Commit 1798e060 by zhaochengxiang

bug fix

parent 86348f8d
......@@ -97,7 +97,7 @@ const ModelTree = (props) => {
useEffect(() => {
if (viewSelectedKey !== 'branch') {
if (keyword!=='') {
if (keyword!=='' || (searchProperties??[]).length > 0) {
if (item && !prevItem) {
setPrevItem(item);
}
......@@ -113,24 +113,7 @@ const ModelTree = (props) => {
}
//eslint-disable-next-line react-hooks/exhaustive-deps
}, [ keyword, viewSelectedKey])
useEffect(() => {
if ((searchProperties??[]).length > 0) {
if (item && !prevItem) {
setPrevItem(item);
}
setItem(null);
} else {
if (prevItem && !item) {
setItem(prevItem);
onSelect && onSelect(prevItem?.key||'');
setPrevItem(null);
}
}
//eslint-disable-next-line react-hooks/exhaustive-deps
}, [searchProperties])
}, [ keyword, searchProperties, viewSelectedKey])
const haveStockImportPermission = useMemo(() => {
return (item?.optionList||[]).findIndex(option => option.name==='存量模型导入'&&option.enabled) !== -1
......
......@@ -355,8 +355,9 @@ class Model extends React.Component {
onSearchPropertiesCancel = (searchProperties) => {
this.setState({ selectSearchPropertiesVisible: false })
if (searchProperties) {
this.setState({ keyword: '', catalogId: '', searchProperties }, () => {
this.setState({ keyword: '', catalogId: '', searchProperties: [...searchProperties] }, () => {
if (searchProperties.length !== 0) {
this.onTableChange()
}
......
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