import{C as U,D as w,F as P}from"./element-plus.55d71530.js";import{P as x}from"./index.8e3b20a1.js";import{r as p}from"./index.75e08341.js";import"./lodash.d6737109.js";import"./dayjs.37feae28.js";import{d as b,s as g,r as k,b as I,_ as V,o as h,c as j,V as u,M as n,u as o}from"./@vue.96c135a1.js";function K(d){return p.get({url:"/setting.postage_region/lists",params:d})}function q(d){return p.post({url:"/setting.postage_region/add",params:d})}function L(d){return p.post({url:"/setting.postage_region/edit",params:d})}function Q(d){return p.post({url:"/setting.postage_region/delete",params:d})}function M(d){return p.get({url:"/setting.postage_region/detail",params:d})}const N={class:"edit-popup"},O=b({name:"postageRegionEdit"}),W=b({...O,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(d,{expose:_,emit:E}){const f=E,F=g(),i=g(),m=k("add"),B=I(()=>m.value=="edit"?"\u7F16\u8F91\u7701\u5E02\u533A\u8868":"\u65B0\u589E\u7701\u5E02\u533A\u8868"),l=V({id:"",pid:"",short:"",name:"",level:"",pinyin:"",code:"",status:"",lng:"",lat:"",sorts:""}),v=V({}),c=async s=>{for(const e in l)s[e]!=null&&s[e]!=null&&(l[e]=s[e])},y=async s=>{const e=await M({id:s.id});c(e)},C=async()=>{var e,a;await((e=F.value)==null?void 0:e.validate());const s={...l};m.value=="edit"?await L(s):await q(s),(a=i.value)==null||a.close(),f("success")},R=(s="add")=>{var e;m.value=s,(e=i.value)==null||e.open()},A=()=>{f("close")};return _({open:R,setFormData:c,getDetail:y}),(s,e)=>{const a=U,r=w,D=P;return h(),j("div",N,[u(x,{ref_key:"popupRef",ref:i,title:o(B),async:!0,width:"550px",onConfirm:C,onClose:A},{default:n(()=>[u(D,{ref_key:"formRef",ref:F,model:o(l),"label-width":"90px",rules:o(v)},{default:n(()=>[u(r,{label:"\u7236\u7EA7ID",prop:"pid"},{default:n(()=>[u(a,{modelValue:o(l).pid,"onUpdate:modelValue":e[0]||(e[0]=t=>o(l).pid=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u7236\u7EA7ID"},null,8,["modelValue"])]),_:1}),u(r,{label:"\u7B80\u79F0",prop:"short"},{default:n(()=>[u(a,{modelValue:o(l).short,"onUpdate:modelValue":e[1]||(e[1]=t=>o(l).short=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u7B80\u79F0"},null,8,["modelValue"])]),_:1}),u(r,{label:"\u540D\u79F0",prop:"name"},{default:n(()=>[u(a,{modelValue:o(l).name,"onUpdate:modelValue":e[2]||(e[2]=t=>o(l).name=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u540D\u79F0"},null,8,["modelValue"])]),_:1}),u(r,{label:"\u5C42\u7EA7",prop:"level"},{default:n(()=>[u(a,{modelValue:o(l).level,"onUpdate:modelValue":e[3]||(e[3]=t=>o(l).level=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5C42\u7EA7"},null,8,["modelValue"])]),_:1}),u(r,{label:"\u62FC\u97F3",prop:"pinyin"},{default:n(()=>[u(a,{modelValue:o(l).pinyin,"onUpdate:modelValue":e[4]||(e[4]=t=>o(l).pinyin=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u62FC\u97F3"},null,8,["modelValue"])]),_:1}),u(r,{label:"\u7F16\u53F7",prop:"code"},{default:n(()=>[u(a,{modelValue:o(l).code,"onUpdate:modelValue":e[5]||(e[5]=t=>o(l).code=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u7F16\u53F7"},null,8,["modelValue"])]),_:1}),u(r,{label:"\u72B6\u6001",prop:"status"},{default:n(()=>[u(a,{modelValue:o(l).status,"onUpdate:modelValue":e[6]||(e[6]=t=>o(l).status=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u72B6\u6001"},null,8,["modelValue"])]),_:1}),u(r,{label:"\u7ECF\u5EA6",prop:"lng"},{default:n(()=>[u(a,{modelValue:o(l).lng,"onUpdate:modelValue":e[7]||(e[7]=t=>o(l).lng=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u7ECF\u5EA6"},null,8,["modelValue"])]),_:1}),u(r,{label:"\u7EF4\u5EA6",prop:"lat"},{default:n(()=>[u(a,{modelValue:o(l).lat,"onUpdate:modelValue":e[8]||(e[8]=t=>o(l).lat=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u7EF4\u5EA6"},null,8,["modelValue"])]),_:1}),u(r,{label:"",prop:"sorts"},{default:n(()=>[u(a,{modelValue:o(l).sorts,"onUpdate:modelValue":e[9]||(e[9]=t=>o(l).sorts=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["title"])])}}});export{W as _,Q as a,K as b};
