useCompany.f3b703c8.js 636 B

1
  1. import{$ as d,X as t,W as s}from"./index.1d5f2f42.js";function g(){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{g as u};