import{d as D,ap as N,r as v,aq as P,a as I,b as R,e as i,o as f,c as L,g as n,W as j,h as e,H as q,F as z,_ as G,a0 as H,ar as W,as as $,w as u,N as h,O as A,at as J,L as U,M as S,f as O}from"./index-17740f03-1778929502341v=1.0.0.js";const K={class:"city-box"},Q=D({__name:"Cascader",props:{multiple:{type:Boolean,default:!0},checkStrictly:{type:Boolean,default:!1},placeholder:{type:String,required:!0},value:{type:Array,default:()=>[]},props:{type:Object,default:()=>({})},showAllLevels:{type:Boolean,default:!0}},emits:["update:value","change"],setup(g,{emit:V}){const b=N(),s=g,_=V,c=v({multiple:s.multiple,checkStrictly:s.checkStrictly,label:"name",value:"code",children:"children",...s.props}),t=v(P),p=I({get(){return s.value},set(r){_("update:value",r)}}),B=r=>{_("change",r)},k=async()=>{const{data:r}=await z({});t.value=r,c.value.label="name",c.value.value="company_area_id",c.value.children="next"};return R(()=>{k()}),(r,F)=>{const C=i("el-cascader");return f(),L("div",K,[n(C,j(e(b),{placeholder:g.placeholder,options:e(t),props:e(c),"show-all-levels":g.showAllLevels,clearable:!0,filterable:"",onChange:B,modelValue:e(p),"onUpdate:modelValue":F[0]||(F[0]=w=>q(p)?p.value=w:null)}),null,16,["placeholder","options","props","show-all-levels","modelValue"])])}}});const T=G(Q,[["__scopeId","data-v-2822ac91"]]),Y=D({__name:"LocationInfo",props:{info:{type:Object,default:()=>{}}},emits:["update:info","setName"],setup(g,{emit:V}){const b=v({xs:24,sm:24,md:12,lg:12,xl:12}),s=v({xs:16,sm:12,md:12,lg:12,xl:10}),_=g,c=V,t=I({get:()=>_.info,set:l=>{c("update:info",l)}}),p=v([]),B=v([]);H(()=>[_.info.county,_.info.street],(l,a)=>{l&&(l[0]&&C(l[0]),l[1]&&w(l[1]))},{deep:!0});const k=async l=>{const a=l?l[2]:"";if(!a)return[];await C(a),p.value=[],t.value.street="",t.value.company_area_community_id=""},r=l=>{const{province:a,city:m,county:d,street:y,company_area_community_id:x,county_name:E}=l;t.value.area_ids=[a,m,d],t.value.street=y,t.value.company_area_community_id=x,c("setName",E),F(y),C(d)},F=async l=>{await w(l),t.value.company_area_community_id=""},C=async l=>{if(!l)return;const{data:a}=await W({company_area_id:l,level:4});B.value=a[0].next},w=async l=>{if(!l)return;const{data:a}=await $({street_company_area_id:l});p.value=a};return(l,a)=>{const m=i("el-form-item"),d=i("FormCol"),y=i("FormRow"),x=i("el-option"),E=i("el-select"),M=i("el-input");return f(),L("div",null,[n(y,null,{default:u(()=>[n(d,h(A(e(b))),{default:u(()=>[n(m,{label:"\u8BE6\u7EC6\u5730\u5740\uFF1A",prop:"address"},{default:u(()=>[n(J,{address:e(t).address,"onUpdate:address":a[0]||(a[0]=o=>e(t).address=o),latitude:e(t).lat,"onUpdate:latitude":a[1]||(a[1]=o=>e(t).lat=o),longitude:e(t).lng,"onUpdate:longitude":a[2]||(a[2]=o=>e(t).lng=o),onGetAreaInfo:r},null,8,["address","latitude","longitude"])]),_:1})]),_:1},16)]),_:1}),n(y,null,{default:u(()=>[n(d,h(A(e(b))),{default:u(()=>[n(m,{label:"\u7701\u5E02\u533A\u53BF\uFF1A",prop:"area_ids"},{default:u(()=>[n(T,{value:e(t).area_ids,"onUpdate:value":a[3]||(a[3]=o=>e(t).area_ids=o),checkStrictly:!1,multiple:!1,placeholder:"\u8BF7\u9009\u62E9\u7701\u5E02\u533A",onChange:k},null,8,["value"])]),_:1})]),_:1},16)]),_:1}),n(y,null,{default:u(()=>[n(d,h(A(e(s))),{default:u(()=>[n(m,{label:"\u8857\u9053/\u4E61\u9547\uFF1A",prop:"street"},{default:u(()=>[n(E,{modelValue:e(t).street,"onUpdate:modelValue":a[4]||(a[4]=o=>e(t).street=o),class:"m-2",placeholder:"\u8BF7\u9009\u62E9\u8857\u9053",style:{width:"100%"},onChange:F},{default:u(()=>[(f(!0),L(U,null,S(e(B),o=>(f(),O(x,{key:o.company_area_id,label:o.name,value:o.company_area_id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1},16),n(d,h(A(e(s))),{default:u(()=>[n(m,{label:"\u793E\u533A/\u6751\uFF1A",prop:"company_area_community_id"},{default:u(()=>[n(E,{modelValue:e(t).company_area_community_id,"onUpdate:modelValue":a[5]||(a[5]=o=>e(t).company_area_community_id=o),class:"m-2",placeholder:"\u8BF7\u9009\u62E9\u793E\u533A",style:{width:"100%"}},{default:u(()=>[(f(!0),L(U,null,S(e(p),o=>(f(),O(x,{key:o.company_area_community_id,label:o.name,value:o.company_area_community_id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1},16),n(d,h(A(e(s))),{default:u(()=>[n(m,{label:"\u70B9\u4F4D\u540D\u79F0\uFF1A",prop:"name"},{default:u(()=>[n(M,{modelValue:e(t).name,"onUpdate:modelValue":a[6]||(a[6]=o=>e(t).name=o),placeholder:"\u8BF7\u8F93\u5165\u70B9\u4F4D\u540D\u79F0"},null,8,["modelValue"])]),_:1})]),_:1},16)]),_:1})])}}});export{Y as _};
