useCompany.e9cb4fed.js 636 B

1
  1. import{U as d,R as t,Q as s}from"./index.56449854.js";function U(){const{isSuperUser:p}=d(),{SET_CURRENT_COMPANY:i}=t(),c=s(()=>t().companyList),r=s(()=>t().currentCompany||{}),y=s(()=>t().swithingCompany),a=n=>{t().companyList=n},e=n=>t().swithingCompany=n;function C(n,m){const u=({companyCode:f})=>f===n,o=(m||c.value).find(u);return o&&o.companyCode&&(o.companyNo=o.companyCode),i(p.value?{companyName:(n==null?void 0:n.name)||"\u6240\u6709\u516C\u53F8",companyNo:(n==null?void 0:n.code)||""}:o),o}return{companyList:c,currentCompany:r,setCurrentCompany:C,isSwitchingCompany:y,setSwithingComapny:e,setCompanyList:a}}export{U as u};