import{az as c,d as q,r as f,s as w,p as z,c as m,e as E,k as A,i as o,h as l,u as r,f as S,j as T,F as N,a2 as O,q as P,g as s,m as C,E as R}from"./index.0308b213.js";const L=n=>c.request({url:"adminapi/setting.defaultAddress/editSave",method:"POST",data:n}),le=n=>c.request({url:"adminapi/setting.defaultAddress/list",method:"POST",data:n}),j=n=>c.request({url:"adminapi/setting.defaultAddress/detail",params:{id:n}}),I=()=>c.request({url:"adminapi/setting.defaultAddress/dict",method:"POST"}),M=s("div",{class:"tn-form-item__tips"},"\u586B\u5199\u540D\u79F0/\u6536\u4EF6\u4EBA",-1),G=s("div",{class:"tn-form-item__tips"},"\u586B\u5199\u8BE5\u5730\u5740\u7684\u7528\u9014",-1),H=s("div",{class:"tn-form-item__tips"},"\u552F\u4E00\u6807\u8BC6\u7801\uFF08\u548C\u5F00\u53D1\u786E\u8BA4\uFF0C\u7528\u5927\u5199\u82F1\u6587\u548C\u4E0B\u5212\u7EBF\uFF09",-1),J=s("div",{class:"tn-form-item__tips"},"\u586B\u5199\u5730\u5740",-1),K=s("div",{class:"tn-form-item__tips"},"\u586B\u5199\u95E8\u724C\u53F7",-1),Q=s("div",{class:"tn-form-item__tips"},"\u586B\u5199\u7ECF\u5EA6",-1),W=s("div",{class:"tn-form-item__tips"},"\u586B\u5199\u7EAC\u5EA6",-1),X=s("div",{class:"tn-form-item__tips"},"\u586B\u5199\u90AE\u7F16",-1),Y=s("div",{class:"tn-form-item__tips"},"\u586B\u5199\u624B\u673A\u53F7\uFF08\u5305\u542B\u533A\u53F7\uFF09",-1),Z=C("\u63D0\u4EA4"),$=C("\u53D6\u6D88"),te=q({props:{modelValue:{type:Boolean,default:!1},id:{default:0}},emits:["update:modelValue","onClose"],setup(n,{emit:B}){const p=n;let _=f(!1),F=w(()=>Number(p.id)>0);f([]);let V=f([]);const y=f(),u=f({id:0,address:"",number:"",location_x:"",location_y:"",name:"",address_code:"",address_type:null,zip_code:"",phone:"",remark:""});z(()=>p.modelValue,i=>{_.value=i,g(),i&&p.id&&(u.id=p.id,D())});const g=()=>{I().then(i=>{V.value=i.address_type_list,console.log(V.value)})},D=()=>{j(p.id).then(i=>{u.value=i})},k=()=>{L(u.value).then(()=>{R.success("\u4FDD\u5B58\u6210\u529F"),v()})},v=()=>{B("update:modelValue",!1),B("onClose")};return(i,t)=>{const d=m("el-input"),a=m("el-form-item"),U=m("el-option"),x=m("el-select"),b=m("el-button"),h=m("el-dialog");return E(),A(h,{modelValue:r(_),"onUpdate:modelValue":t[10]||(t[10]=e=>P(_)?_.value=e:_=e),title:r(F)?"\u7F16\u8F91":"\u65B0\u589E",width:"80%","destroy-on-close":"",onClose:v},{footer:o(()=>[l(b,{type:"primary",onClick:k},{default:o(()=>[Z]),_:1}),l(b,{type:"danger",onClick:v},{default:o(()=>[$]),_:1})]),default:o(()=>[l(r(O),{ref_key:"formRef",ref:y,model:u.value,"label-width":"150px"},{default:o(()=>[l(a,{label:"\u540D\u79F0/\u6536\u4EF6\u4EBA",prop:"name"},{default:o(()=>[l(d,{modelValue:u.value.name,"onUpdate:modelValue":t[0]||(t[0]=e=>u.value.name=e),disabled:r(F)},null,8,["modelValue","disabled"]),M]),_:1}),l(a,{label:"\u5907\u6CE8\u8BF4\u660E",prop:"remark"},{default:o(()=>[l(d,{modelValue:u.value.remark,"onUpdate:modelValue":t[1]||(t[1]=e=>u.value.remark=e)},null,8,["modelValue"]),G]),_:1}),l(a,{label:"\u552F\u4E00\u6807\u8BC6\u7801\uFF08\u548C\u5F00\u53D1\u786E\u8BA4\uFF0C\u7528\u5927\u5199\u82F1\u6587\u548C\u4E0B\u5212\u7EBF\uFF09",prop:"address_code"},{default:o(()=>[l(d,{modelValue:u.value.address_code,"onUpdate:modelValue":t[2]||(t[2]=e=>u.value.address_code=e),disabled:r(F)},null,8,["modelValue","disabled"]),H]),_:1}),l(a,{label:"\u5730\u5740",prop:"address"},{default:o(()=>[l(d,{modelValue:u.value.address,"onUpdate:modelValue":t[3]||(t[3]=e=>u.value.address=e)},null,8,["modelValue"]),J]),_:1}),l(a,{label:"\u95E8\u724C\u53F7",prop:"number"},{default:o(()=>[l(d,{modelValue:u.value.number,"onUpdate:modelValue":t[4]||(t[4]=e=>u.value.number=e)},null,8,["modelValue"]),K]),_:1}),l(a,{label:"\u7ECF\u5EA6",prop:"location_x"},{default:o(()=>[l(d,{modelValue:u.value.location_x,"onUpdate:modelValue":t[5]||(t[5]=e=>u.value.location_x=e)},null,8,["modelValue"]),Q]),_:1}),l(a,{label:"\u7EAC\u5EA6",prop:"location_y"},{default:o(()=>[l(d,{modelValue:u.value.location_y,"onUpdate:modelValue":t[6]||(t[6]=e=>u.value.location_y=e)},null,8,["modelValue"]),W]),_:1}),l(a,{label:"\u7C7B\u578B",prop:"name"},{default:o(()=>[l(x,{modelValue:u.value.address_type,"onUpdate:modelValue":t[7]||(t[7]=e=>u.value.address_type=e),placeholder:"\u8BF7\u9009\u62E9",style:{width:"240px"},disabled:r(F)},{default:o(()=>[(E(!0),S(N,null,T(r(V),(e,ee)=>(E(),A(U,{label:e.name,value:e.id,key:e.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue","disabled"])]),_:1}),l(a,{label:"\u90AE\u7F16",prop:"zip_code"},{default:o(()=>[l(d,{modelValue:u.value.zip_code,"onUpdate:modelValue":t[8]||(t[8]=e=>u.value.zip_code=e)},null,8,["modelValue"]),X]),_:1}),l(a,{label:"\u624B\u673A\u53F7\uFF08\u5305\u542B\u533A\u53F7\uFF09",prop:"phone"},{default:o(()=>[l(d,{modelValue:u.value.phone,"onUpdate:modelValue":t[9]||(t[9]=e=>u.value.phone=e)},null,8,["modelValue"]),Y]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue","title"])}}});export{te as _,le as l};
