import{request as e}from"@cqsjjb/jjb-common-lib/http.js";import{useState as t,useEffect as r}from"react";import{executeWithCache as n}from"../../../../utils/index.js";import i from"../../Basic/index.js";import{jsx as a}from"react/jsx-runtime";function p(p){const{params:s={},searchType:o="current",...l}=p,[d,m]=t([]);return r(()=>{(async()=>{let t="";const r={...s,time:(new Date).getTime()};"current"===o&&(t="/basicInfo/department/listTree",delete r.inType,delete r.enterpriseType),"all"===o&&(t="/basicInfo/department/listAllTree",delete r.inType,delete r.enterpriseType,delete r.eqCorpinfoId,delete r.eqParentId),"inType"===o&&(t="/basicInfo/department/listAllTreeByCorpType",delete r.eqCorpinfoId,delete r.eqParentId,r.enterpriseType&&!Array.isArray(r.enterpriseType)&&(r.enterpriseType=[r.enterpriseType]));const i={searchType:o,params:s};await n(i,async()=>{const{data:n}=await e(t,"post",r);return n},m)})()},[]),a(i,{treeData:d,childrenKey:"childrenList",...l})}p.displayName="DepartmentLeftTree";export{p as default};
