import{request as e}from"@cqsjjb/jjb-common-lib/http.js";import{useState as t,useEffect as r}from"react";import{executeWithCache as o}from"../../../../utils/index.js";import n from"../../Basic/index.js";import{jsx as i}from"react/jsx-runtime";function a(a){const{params:s={},placeholder:m="人员",isNeedCorpInfoId:p=!1,isNeedDepartmentId:d=!0,isNeedPostId:f=!1,extraParams:c={},...l}=a,u={noMain:"",eqEmploymentFlag:1},[I,y]=t([]);return r(()=>{(async()=>{if(!p&&!d&&!f)return void console.error("【PersonnelSelect】 请至少传入一个参数");if(p&&(!s.corpinfoId||"string"!=typeof s.corpinfoId))return;if(d&&(!s.departmentId||"string"!=typeof s.departmentId))return;if(f&&(!s.postId||"string"!=typeof s.postId))return;const t={...u,...c},r={params:s,extraParams:t};await o(r,async()=>{const{data:r}=await e("/basicInfo/user/listAll","get",{...s,...t,time:(new Date).getTime()});return r},y)})()},[JSON.stringify(s),p,d,f,JSON.stringify(c)]),i(n,{data:I,placeholder:m,...l})}a.displayName="PersonnelSelect";export{a as default};
