import{C as h,D as q,F as w}from"./element-plus.55d71530.js";import{P as j}from"./index.e651cfa0.js";import{r as i,t as f}from"./index.e2bd5212.js";import{d as g,s as b,r as x,b as R,_ as B,o as k,c as M,V as r,M as d,u as l}from"./@vue.96c135a1.js";function J(s){return i.get({url:"/user.user_address/lists",params:s})}function P(s){return i.post({url:"/user.user_address/add",params:s})}function L(s){return i.post({url:"/user.user_address/edit",params:s})}function K(s){return i.post({url:"/user.user_address/delete",params:s})}function N(s){return i.get({url:"/user.user_address/detail",params:s})}const O={class:"edit-popup"},S=g({name:"userAddressEdit"}),Q=g({...S,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(s,{expose:y,emit:V}){const c=V,_=b(),p=b(),m=x("add"),E=R(()=>m.value=="edit"?"\u7F16\u8F91\u7528\u6237\u5730\u5740\u8868":"\u65B0\u589E\u7528\u6237\u5730\u5740\u8868"),u=B({id:"",user_id:"",province_id:"",city_id:"",city_json:"",address:"",house_number:"",contact_number:"",contact_people:""}),D=B({user_id:[{required:!0,message:"\u8BF7\u8F93\u5165\u7528\u6237ID",trigger:["blur"]}],province_id:[{required:!0,message:"\u8BF7\u8F93\u5165\u7701\u4EFDID",trigger:["blur"]}],city_id:[{required:!0,message:"\u8BF7\u8F93\u5165\u57CE\u5E02ID",trigger:["blur"]}],city_json:[{required:!0,message:"\u8BF7\u8F93\u5165\u7701\u5E02\u540D\u79F0",trigger:["blur"]}],address:[{required:!0,message:"\u8BF7\u8F93\u5165\u5177\u4F53\u5730\u5740",trigger:["blur"]}],house_number:[{required:!0,message:"\u8BF7\u8F93\u5165\u95E8\u724C\u53F7",trigger:["blur"]}],contact_number:[{required:!0,message:"\u8BF7\u8F93\u5165\u8054\u7CFB\u53F7\u7801",trigger:["blur"]}],contact_people:[{required:!0,message:"\u8BF7\u8F93\u5165\u8054\u7CFB\u4EBA",trigger:["blur"]}]}),F=async o=>{for(const e in u)o[e]!=null&&o[e]!=null&&(u[e]=o[e]);u.create_time=f(u.create_time,"yyyy-mm-dd hh:MM:ss"),u.update_time=f(u.update_time,"yyyy-mm-dd hh:MM:ss")},C=async o=>{const e=await N({id:o.id});F(e)},v=async()=>{var e,a;await((e=_.value)==null?void 0:e.validate());const o={...u};m.value=="edit"?await L(o):await P(o),(a=p.value)==null||a.close(),c("success")},U=(o="add")=>{var e;m.value=o,(e=p.value)==null||e.open()},I=()=>{c("close")};return y({open:U,setFormData:F,getDetail:C}),(o,e)=>{const a=h,n=q,A=w;return k(),M("div",O,[r(j,{ref_key:"popupRef",ref:p,title:l(E),async:!0,width:"550px",onConfirm:v,onClose:I},{default:d(()=>[r(A,{ref_key:"formRef",ref:_,model:l(u),"label-width":"90px",rules:l(D)},{default:d(()=>[r(n,{label:"\u7528\u6237ID",prop:"user_id"},{default:d(()=>[r(a,{modelValue:l(u).user_id,"onUpdate:modelValue":e[0]||(e[0]=t=>l(u).user_id=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u7528\u6237ID"},null,8,["modelValue"])]),_:1}),r(n,{label:"\u7701\u4EFDID",prop:"province_id"},{default:d(()=>[r(a,{modelValue:l(u).province_id,"onUpdate:modelValue":e[1]||(e[1]=t=>l(u).province_id=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u7701\u4EFDID"},null,8,["modelValue"])]),_:1}),r(n,{label:"\u57CE\u5E02ID",prop:"city_id"},{default:d(()=>[r(a,{modelValue:l(u).city_id,"onUpdate:modelValue":e[2]||(e[2]=t=>l(u).city_id=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u57CE\u5E02ID"},null,8,["modelValue"])]),_:1}),r(n,{label:"\u7701\u5E02\u540D\u79F0",prop:"city_json"},{default:d(()=>[r(a,{modelValue:l(u).city_json,"onUpdate:modelValue":e[3]||(e[3]=t=>l(u).city_json=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u7701\u5E02\u540D\u79F0"},null,8,["modelValue"])]),_:1}),r(n,{label:"\u5177\u4F53\u5730\u5740",prop:"address"},{default:d(()=>[r(a,{modelValue:l(u).address,"onUpdate:modelValue":e[4]||(e[4]=t=>l(u).address=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5177\u4F53\u5730\u5740"},null,8,["modelValue"])]),_:1}),r(n,{label:"\u95E8\u724C\u53F7",prop:"house_number"},{default:d(()=>[r(a,{modelValue:l(u).house_number,"onUpdate:modelValue":e[5]||(e[5]=t=>l(u).house_number=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u95E8\u724C\u53F7"},null,8,["modelValue"])]),_:1}),r(n,{label:"\u8054\u7CFB\u53F7\u7801",prop:"contact_number"},{default:d(()=>[r(a,{modelValue:l(u).contact_number,"onUpdate:modelValue":e[6]||(e[6]=t=>l(u).contact_number=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u8054\u7CFB\u53F7\u7801"},null,8,["modelValue"])]),_:1}),r(n,{label:"\u8054\u7CFB\u4EBA",prop:"contact_people"},{default:d(()=>[r(a,{modelValue:l(u).contact_people,"onUpdate:modelValue":e[7]||(e[7]=t=>l(u).contact_people=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u8054\u7CFB\u4EBA"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["title"])])}}});export{Q as _,K as a,J as b};
