import{d as A,a as E,H as b,o as u,c as _,q as s,m as n,N as w,z as c,e as d,I as S,J as N,K as B,p as m,L as V,M as L,O as U,r as h,E as z,G as P}from"./index-XuO881sr.js";import{E as $}from"./el-image-DL2LnvRC.js";import{g as q,d as D,s as M}from"./index-B_ImzkRi.js";const R={class:"box"},j={class:"header"},F={class:"container"},G={class:"community_nav_box"},H={class:"currentbox"},J={class:"communityBody"},K={class:"image-viewer-slot image-slot"},O={class:"coummunityaction_box"},Q={class:"coummunityname"},T={class:"counmmunityaddress"},W={class:"actions flex"},X=["onClick"],Y=["onClick"],Z=["onClick"],ss={class:"addCoummunity"},es=A({__name:"index",setup(os){const a=E(),i=h([]),r=h();function g(){q().then(o=>{i.value=o.rows,r.value=o.rows.find(e=>e.choiceStatus===0),o.rows.forEach(e=>{e.villageImageUrl&&console.log(e.villageImageUrl.split(","))})})}g();function f(){a.push({path:"/community/AddCommunity"})}function p(o){D(o.villageId).then(()=>{const e=i.value.filter(l=>l.villageId!==o.villageId);i.value=e})}function y(o){a.push({path:"/community/AddCommunity",query:{id:o.villageId}})}function I(o){o.choiceStatus===0?a.push({path:"/index"}):M(o.villageId).then(e=>{console.log("切换成小区---------------------"),z.success("切换小区成功"),a.push({path:"/index"})})}return(o,e)=>{const l=V,x=$,C=b("AddLocation");return u(),_("div",R,[s("div",j,[e[0]||(e[0]=s("span",{class:""},"智慧物业后台管理系统",-1)),n(w,{ref:"navbarRef"},null,512)]),s("div",F,[s("div",G,[s("div",H,"当前小区:"+c(d(r)&&d(r).villageName),1),e[1]||(e[1]=s("div",{class:"subtitle flex align-center"},[s("div",{class:"line"}),s("div",{class:"changecommunity"},"切换小区")],-1))]),s("div",J,[(u(!0),_(S,null,N(d(i),(t,k)=>(u(),_("div",{class:B(["coummunity_card",{activeCommunity:t.choiceStatus===0}]),key:k},[n(x,{src:t.villageImageUrl?t.villageImageUrl.split(",")[0]:""},{error:m(()=>[s("div",K,[n(l,null,{default:m(()=>[n(d(L))]),_:1})])]),_:1},8,["src"]),s("div",O,[s("div",Q,c(t.villageName),1),s("div",T,c(t.address),1)]),s("div",W,[s("div",{onClick:v=>I(t),style:U({color:t.choiceStatus===0?"green":""})},c(t.choiceStatus===0?"进入":"管理"),13,X),s("div",{onClick:v=>y(t)},"编辑",8,Y),s("div",{onClick:v=>p(t)},"删除",8,Z)])],2))),128)),s("div",{onClick:f,class:"coummunity_card addActions flex flex-items-center justify-center"},[s("div",ss,[n(l,null,{default:m(()=>[n(C)]),_:1}),e[2]||(e[2]=s("div",null,"添加小区",-1))])])])])])}}}),is=P(es,[["__scopeId","data-v-a8925981"]]);export{is as default};
