Commit 1798e060 by zhaochengxiang

bug fix

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