import{E as e,e as s,a9 as n,h as a,w as o,z as r,o as t,i,a as l,k as f,l as u,F as d,aU as c,j as _,t as p,a7 as g,s as v,aC as h,H as C,O as m,y as I,ak as y,aS as j,al as x}from"./index-DXvjTqMr.js";import{d as k}from"./index.D3kEQn5y.js";import{_ as b}from"./_plugin-vue_export-helper.BCo6x5W8.js";import"./uni-nav-bar.BZJJc0Hh.js";import"./uni-icons.Dxt3pfrw.js";/* empty css                                                                  *//* empty css                                                                    *//* empty css                                                              */const D=b({__name:"enterprise",setup(b){const D=e("serverConfigInfo")||[],E=e("chooseEnterprise")||[],H=s([{type:1,icon:"icon-danchuang-tianjiahetong"}]),N=s({serverConfigInfo:D,type:0});n((e=>{N.type=e.type||0,E&&N.serverConfigInfo.forEach((e=>{e.isDefault=e.address===E.address}))}));const S=e=>{1===e.type&&c({url:"/pages/users/login/config"})};return(e,s)=>{const n=m,b=I,D=r,E=y,U=j,w=x;return t(),a(D,{class:"content"},{default:o((()=>[i(k,{"is-jump-bar":!1,"jump-url":"/pages/users/login/index","is-right":!0,"right-data":l(H),onHandleNarItem:S},null,8,["right-data"]),(t(!0),f(d,null,u(l(N).serverConfigInfo,((e,s)=>(t(),a(D,{class:"card",key:s},{default:o((()=>[i(D,{class:"header"},{default:o((()=>[i(n,{src:e.logo},null,8,["src"]),i(b,null,{default:o((()=>[_(p(e.enterprise_name),1)])),_:2},1024)])),_:2},1024),i(D,{class:"line"}),i(D,{class:"btn"},{default:o((()=>[i(D,{class:"agree-content"},{default:o((()=>[i(w,{onChange:s=>(e=>{C("chooseApiUrl",e.address),N.serverConfigInfo.forEach((e=>{e.isDefault=!1}));const s=N.serverConfigInfo.findIndex((s=>s===e));-1!==s&&(N.serverConfigInfo[s].isDefault=!0,C("chooseEnterprise",N.serverConfigInfo[s])),C("serverConfigInfo",N.serverConfigInfo),c({url:"/pages/users/login/index"})})(e)},{default:o((()=>[i(U,null,{default:o((()=>[i(E,{style:{transform:"scale(0.7)"},value:s.toString(),checked:e.isDefault},null,8,["value","checked"]),_(" 选中企业 ")])),_:2},1024)])),_:2},1032,["onChange"])])),_:2},1024),i(D,{class:"del",onClick:g((n=>((e,s)=>{let n=!1;v("确定要删除该企业吗").then((()=>{e.isDefault?h({title:"无法删除选中企业",icon:"none",duration:2e3}):N.serverConfigInfo&&(n=N.serverConfigInfo.some((s=>s.address===e.address)),n&&(N.serverConfigInfo.splice(s,1),C("serverConfigInfo",N.serverConfigInfo)))})).catch((()=>{}))})(e,s)),["stop"])},{default:o((()=>[i(D,{class:"iconfont icon-shanchu1"}),i(b,null,{default:o((()=>[_("删除")])),_:1})])),_:2},1032,["onClick"])])),_:2},1024)])),_:2},1024)))),128))])),_:1})}}},[["__scopeId","data-v-f1a3a183"]]);export{D as default};
