优化DepartmentLeftTree和DepartmentSelectTree
parent
10083fa9f8
commit
e8b72d77e5
|
|
@ -19,20 +19,20 @@ function DepartmentLeftTree(props) {
|
||||||
const actualParams = { ...params, time: new Date().getTime() };
|
const actualParams = { ...params, time: new Date().getTime() };
|
||||||
if (searchType === "current") {
|
if (searchType === "current") {
|
||||||
requestUrl = "/basicInfo/department/listTree";
|
requestUrl = "/basicInfo/department/listTree";
|
||||||
actualParams.inType = undefined;
|
delete actualParams.inType;
|
||||||
actualParams.enterpriseType = undefined;
|
delete actualParams.enterpriseType;
|
||||||
}
|
}
|
||||||
if (searchType === "all") {
|
if (searchType === "all") {
|
||||||
requestUrl = "/basicInfo/department/listAllTree";
|
requestUrl = "/basicInfo/department/listAllTree";
|
||||||
actualParams.inType = undefined;
|
delete actualParams.inType;
|
||||||
actualParams.enterpriseType = undefined;
|
delete actualParams.enterpriseType;
|
||||||
actualParams.eqCorpinfoId = undefined;
|
delete actualParams.eqCorpinfoId;
|
||||||
actualParams.eqParentId = undefined;
|
delete actualParams.eqParentId;
|
||||||
}
|
}
|
||||||
if (searchType === "inType") {
|
if (searchType === "inType") {
|
||||||
requestUrl = "/basicInfo/department/listAllTreeByCorpType";
|
requestUrl = "/basicInfo/department/listAllTreeByCorpType";
|
||||||
actualParams.eqCorpinfoId = undefined;
|
delete actualParams.eqCorpinfoId;
|
||||||
actualParams.eqParentId = undefined;
|
delete actualParams.eqParentId;
|
||||||
if (actualParams.enterpriseType && !Array.isArray(actualParams.enterpriseType)) {
|
if (actualParams.enterpriseType && !Array.isArray(actualParams.enterpriseType)) {
|
||||||
actualParams.enterpriseType = [actualParams.enterpriseType];
|
actualParams.enterpriseType = [actualParams.enterpriseType];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ function DepartmentSelectTree(props) {
|
||||||
|
|
||||||
const getData = async () => {
|
const getData = async () => {
|
||||||
setTreeData([]);
|
setTreeData([]);
|
||||||
|
|
||||||
// 生成缓存键
|
// 生成缓存键
|
||||||
const paramsStr = JSON.stringify(params);
|
const paramsStr = JSON.stringify(params);
|
||||||
const cacheKey = `${searchType}_${paramsStr}`;
|
const cacheKey = `${searchType}_${paramsStr}`;
|
||||||
|
|
@ -44,20 +44,20 @@ function DepartmentSelectTree(props) {
|
||||||
const actualParams = { ...params, time: new Date().getTime() };
|
const actualParams = { ...params, time: new Date().getTime() };
|
||||||
if (searchType === "current") {
|
if (searchType === "current") {
|
||||||
requestUrl = "/basicInfo/department/listTree";
|
requestUrl = "/basicInfo/department/listTree";
|
||||||
actualParams.inType = undefined;
|
delete actualParams.inType;
|
||||||
actualParams.enterpriseType = undefined;
|
delete actualParams.enterpriseType;
|
||||||
}
|
}
|
||||||
if (searchType === "all") {
|
if (searchType === "all") {
|
||||||
requestUrl = "/basicInfo/department/listAllTree";
|
requestUrl = "/basicInfo/department/listAllTree";
|
||||||
actualParams.inType = undefined;
|
delete actualParams.inType;
|
||||||
actualParams.enterpriseType = undefined;
|
delete actualParams.enterpriseType;
|
||||||
actualParams.eqCorpinfoId = undefined;
|
delete actualParams.eqCorpinfoId;
|
||||||
actualParams.eqParentId = undefined;
|
delete actualParams.eqParentId;
|
||||||
}
|
}
|
||||||
if (searchType === "inType") {
|
if (searchType === "inType") {
|
||||||
requestUrl = "/basicInfo/department/listAllTreeByCorpType";
|
requestUrl = "/basicInfo/department/listAllTreeByCorpType";
|
||||||
actualParams.eqCorpinfoId = undefined;
|
delete actualParams.eqCorpinfoId;
|
||||||
actualParams.eqParentId = undefined;
|
delete actualParams.eqParentId;
|
||||||
if (actualParams.enterpriseType && !Array.isArray(actualParams.enterpriseType)) {
|
if (actualParams.enterpriseType && !Array.isArray(actualParams.enterpriseType)) {
|
||||||
actualParams.enterpriseType = [actualParams.enterpriseType];
|
actualParams.enterpriseType = [actualParams.enterpriseType];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue