diff --git a/src/components/LeftTree/Department/Gwj/index.js b/src/components/LeftTree/Department/Gwj/index.js index 0f5423e..71c6c72 100644 --- a/src/components/LeftTree/Department/Gwj/index.js +++ b/src/components/LeftTree/Department/Gwj/index.js @@ -19,20 +19,20 @@ function DepartmentLeftTree(props) { const actualParams = { ...params, time: new Date().getTime() }; if (searchType === "current") { requestUrl = "/basicInfo/department/listTree"; - actualParams.inType = undefined; - actualParams.enterpriseType = undefined; + delete actualParams.inType; + delete actualParams.enterpriseType; } if (searchType === "all") { requestUrl = "/basicInfo/department/listAllTree"; - actualParams.inType = undefined; - actualParams.enterpriseType = undefined; - actualParams.eqCorpinfoId = undefined; - actualParams.eqParentId = undefined; + delete actualParams.inType; + delete actualParams.enterpriseType; + delete actualParams.eqCorpinfoId; + delete actualParams.eqParentId; } if (searchType === "inType") { requestUrl = "/basicInfo/department/listAllTreeByCorpType"; - actualParams.eqCorpinfoId = undefined; - actualParams.eqParentId = undefined; + delete actualParams.eqCorpinfoId; + delete actualParams.eqParentId; if (actualParams.enterpriseType && !Array.isArray(actualParams.enterpriseType)) { actualParams.enterpriseType = [actualParams.enterpriseType]; } diff --git a/src/components/SelectTree/Department/Gwj/index.js b/src/components/SelectTree/Department/Gwj/index.js index 068ac56..ffa9f57 100644 --- a/src/components/SelectTree/Department/Gwj/index.js +++ b/src/components/SelectTree/Department/Gwj/index.js @@ -22,7 +22,7 @@ function DepartmentSelectTree(props) { const getData = async () => { setTreeData([]); - + // 生成缓存键 const paramsStr = JSON.stringify(params); const cacheKey = `${searchType}_${paramsStr}`; @@ -44,20 +44,20 @@ function DepartmentSelectTree(props) { const actualParams = { ...params, time: new Date().getTime() }; if (searchType === "current") { requestUrl = "/basicInfo/department/listTree"; - actualParams.inType = undefined; - actualParams.enterpriseType = undefined; + delete actualParams.inType; + delete actualParams.enterpriseType; } if (searchType === "all") { requestUrl = "/basicInfo/department/listAllTree"; - actualParams.inType = undefined; - actualParams.enterpriseType = undefined; - actualParams.eqCorpinfoId = undefined; - actualParams.eqParentId = undefined; + delete actualParams.inType; + delete actualParams.enterpriseType; + delete actualParams.eqCorpinfoId; + delete actualParams.eqParentId; } if (searchType === "inType") { requestUrl = "/basicInfo/department/listAllTreeByCorpType"; - actualParams.eqCorpinfoId = undefined; - actualParams.eqParentId = undefined; + delete actualParams.eqCorpinfoId; + delete actualParams.eqParentId; if (actualParams.enterpriseType && !Array.isArray(actualParams.enterpriseType)) { actualParams.enterpriseType = [actualParams.enterpriseType]; }