import{d as x,e as N}from"./list.5526c7ef.js";import{P as B}from"./index.b06ad809.js";import{d as F,r as y,b as S,p as E,c as i,e as c,k as v,i as o,h as p,g as _,f as I,j as M,t as T,u as s,F as U,m as C,E as P,_ as $}from"./index.0308b213.js";import"./loading.c9286a4b.js";import"./setting.644fa418.js";const j={style:{width:"100%",height:"600px",overflow:"auto"}},L={style:{display:"flex","justify-content":"space-between","align-items":"center"}},R=C("\u5220\u9664"),q=C("\u63D0\u4EA4"),z=F({props:{modelValue:{type:Boolean,default:!1},id:{default:0}},emits:["update:modelValue","onClose"],setup(h,{emit:f}){const l=h,r=y(!1);let m=y([120.337886,22.963266]);const a=S({id2:0,data:[]}),A=()=>{x(l.id).then(t=>{m.value=[Number(t.item.location_y),Number(t.item.location_x)],a.data=t.item.delivery_areas})},V=t=>{a.data=t};E(()=>l.modelValue,t=>{r.value=t,t&&l.id&&(a.id2=l.id,A())});const b=()=>{let t=new Date().getTime();a.data=a.data.map((e,d)=>(t++,{colorType:(e==null?void 0:e.colorType)||1,delivery_free_price:Number(e.delivery_free_price)||0,delivery_price:Number(e.delivery_price)||0,fillColor:(e==null?void 0:e.fillColor)||"#71a3ef",path:e.path||[],send_price:Number(e.send_price)||0,strokeColor:(e==null?void 0:e.strokeColor)||"#4589ef",time:`M${t}`})),N(a).then(e=>{P.success(e.msg),g()})},k=t=>{a.data.splice(t,1)},g=()=>{f("update:modelValue",!1),f("onClose")};return(t,e)=>{const d=i("el-button"),D=i("el-card"),w=i("el-dialog");return c(),v(w,{modelValue:r.value,"onUpdate:modelValue":e[1]||(e[1]=n=>r.value=n),title:"\u670D\u52A1\u533A\u57DF",width:"50%",onClose:g},{footer:o(()=>[p(d,{type:"primary",onClick:b},{default:o(()=>[q]),_:1})]),default:o(()=>[p(B,{onUpdate:V,modelValue:s(a).data,"onUpdate:modelValue":e[0]||(e[0]=n=>s(a).data=n),center:s(m),style:{width:"100%"}},{default:o(()=>[_("div",j,[(c(!0),I(U,null,M(s(a).data,(n,u)=>(c(),v(D,{key:`area-data-${u}`},{default:o(()=>[_("div",L,[_("label",null,"\u533A\u57DF\u8303\u56F4"+T(u+1),1),p(d,{type:"danger",onClick:G=>k(u)},{default:o(()=>[R]),_:2},1032,["onClick"])])]),_:2},1024))),128))])]),_:1},8,["modelValue","center"])]),_:1},8,["modelValue"])}}});const W=$(z,[["__scopeId","data-v-7826d388"]]);export{W as default};
