提交 4798e1f9 作者: 翁进城

修正修改目录的接口

上级 c73bea90
...@@ -50,7 +50,6 @@ const DirectoryManage: FC = (props: any) => { ...@@ -50,7 +50,6 @@ const DirectoryManage: FC = (props: any) => {
}); });
//目录modal //目录modal
const [isAddOrEditDecModal, setIsAddOrEditDecModal] = useState<boolean>(false); const [isAddOrEditDecModal, setIsAddOrEditDecModal] = useState<boolean>(false);
const [reload, setReload] = useState(false);
const [editData, setEditData] = useState<categoryDec | null>(null); const [editData, setEditData] = useState<categoryDec | null>(null);
const columns: ColumnsType<DataType> = [ const columns: ColumnsType<DataType> = [
...@@ -109,6 +108,10 @@ const DirectoryManage: FC = (props: any) => { ...@@ -109,6 +108,10 @@ const DirectoryManage: FC = (props: any) => {
}, },
]; ];
useEffect(() => {
getDirectoryList();
}, [pagination.current]);
// 目录弹窗 // 目录弹窗
const showDecModal = () => { const showDecModal = () => {
setEditData(null); setEditData(null);
...@@ -163,7 +166,7 @@ const DirectoryManage: FC = (props: any) => { ...@@ -163,7 +166,7 @@ const DirectoryManage: FC = (props: any) => {
CategoryManageAPI.removeDirectory(id).then((res) => { CategoryManageAPI.removeDirectory(id).then((res) => {
if (res.code == 200) { if (res.code == 200) {
message.success('删除成功'); message.success('删除成功');
setReload(!reload); getDirectoryList();
} else { } else {
message.error(res.message); message.error(res.message);
} }
...@@ -172,10 +175,6 @@ const DirectoryManage: FC = (props: any) => { ...@@ -172,10 +175,6 @@ const DirectoryManage: FC = (props: any) => {
}); });
}; };
useEffect(() => {
getDirectoryList();
}, [JSON.stringify(pagination), reload]);
const handleTableChange = ( const handleTableChange = (
pagination: TablePaginationConfig, pagination: TablePaginationConfig,
filters: Record<string, FilterValue>, filters: Record<string, FilterValue>,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论