优化DepartmentSelectTree

master
LiuJiaNan 2026-01-16 10:16:27 +08:00
parent cd87ae835f
commit b491aed263
1 changed files with 14 additions and 4 deletions

View File

@ -29,14 +29,24 @@ function DepartmentSelectTree(props) {
} }
let requestUrl = ""; let requestUrl = "";
if (searchType === "current") let actualParams = params;
if (searchType === "current") {
requestUrl = "/basicInfo/department/listTree"; requestUrl = "/basicInfo/department/listTree";
if (searchType === "all") actualParams.inType = undefined;
actualParams.enterpriseType = undefined;
}
if (searchType === "all") {
requestUrl = "/basicInfo/department/listAllTree"; requestUrl = "/basicInfo/department/listAllTree";
if (searchType === "inType") actualParams.inType = undefined;
actualParams.enterpriseType = undefined;
}
if (searchType === "inType") {
requestUrl = "/basicInfo/department/listAllTreeByCorpType"; requestUrl = "/basicInfo/department/listAllTreeByCorpType";
actualParams.eqCorpinfoId = undefined;
actualParams.eqParentId = undefined;
}
const { data } = await request(requestUrl, "post", params); const { data } = await request(requestUrl, "post", actualParams);
setTreeData(data); setTreeData(data);
}; };