学员页面重复请求api和分类默认展开

This commit is contained in:
禺狨
2023-04-11 16:28:49 +08:00
parent dfc33aa754
commit d90afcc08b
5 changed files with 28 additions and 18 deletions

View File

@@ -89,13 +89,16 @@ export const TreeCategory = (props: PropInterface) => {
<span>{props.text}</span>
</div>
</div>
<Tree
onSelect={onSelect}
selectedKeys={selectKey}
onExpand={onExpand}
treeData={treeData}
switcherIcon={<i className="iconfont icon-icon-fold c-gray" />}
/>
{treeData.length > 0 && (
<Tree
onSelect={onSelect}
selectedKeys={selectKey}
onExpand={onExpand}
treeData={treeData}
defaultExpandAll={true}
switcherIcon={<i className="iconfont icon-icon-fold c-gray" />}
/>
)}
</div>
);
};

View File

@@ -71,8 +71,10 @@ export const UploadImageButton = (props: PropsInterface) => {
// 加载图片列表
useEffect(() => {
getImageList();
}, [category_ids, refresh, page, size]);
if (showModal) {
getImageList();
}
}, [category_ids, refresh, page, size, showModal]);
return (
<>