import{C as S,D as I,Q as q,R as L,F as O}from"./element-plus.9cae3cb1.js";import{P}from"./index.b375235f.js";import{a as j,b as A,c as M}from"./shop_express.6b7a1fea.js";import"./lodash.fc1b942f.js";import"./dayjs.37feae28.js";import{d as E,s as _,r as N,b as Q,_ as F,o as m,c as b,V as o,M as s,u as l,U as T,aa as z,L as G}from"./@vue.96c135a1.js";const H={class:"edit-popup"},J=E({name:"shopExpressEdit"}),ee=E({...J,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(B,{expose:V,emit:D}){const c=D,i=_(),r=_(),p=N("add"),v=Q(()=>p.value=="edit"?"\u7F16\u8F91\u5546\u57CE\u5FEB\u9012\u8868":"\u65B0\u589E\u5546\u57CE\u5FEB\u9012\u8868"),u=F({id:"",code:"",kdn_code:"",name:"",weight:"",status:""}),w=F({name:[{required:!0,message:"\u8BF7\u8F93\u5165\u7269\u6D41\u540D\u79F0",trigger:["blur"]}],status:[{required:!0,message:"\u8BF7\u9009\u62E9\u72B6\u6001",trigger:["blur"]}]}),f=async t=>{for(const e in u)t[e]!=null&&t[e]!=null&&(u[e]=t[e])},g=async t=>{const e=await j({id:t.id});f(e)},h=async()=>{var e,n;await((e=i.value)==null?void 0:e.validate());const t={...u};p.value=="edit"?await A(t):await M(t),(n=r.value)==null||n.close(),c("success")},k=(t="add")=>{var e;p.value=t,(e=r.value)==null||e.open()},x=()=>{c("close")};return V({open:k,setFormData:f,getDetail:g}),(t,e)=>{const n=S,d=I,C=q,y=L,R=O;return m(),b("div",H,[o(P,{ref_key:"popupRef",ref:r,title:l(v),async:!0,width:"550px",onConfirm:h,onClose:x},{default:s(()=>[o(R,{ref_key:"formRef",ref:i,model:l(u),"label-width":"90px",rules:l(w)},{default:s(()=>[o(d,{label:"\u7F16\u7801",prop:"code"},{default:s(()=>[o(n,{modelValue:l(u).code,"onUpdate:modelValue":e[0]||(e[0]=a=>l(u).code=a),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u7F16\u7801"},null,8,["modelValue"])]),_:1}),o(d,{label:"\u7B80\u7801",prop:"kdn_code"},{default:s(()=>[o(n,{modelValue:l(u).kdn_code,"onUpdate:modelValue":e[1]||(e[1]=a=>l(u).kdn_code=a),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u7B80\u7801"},null,8,["modelValue"])]),_:1}),o(d,{label:"\u7269\u6D41\u540D\u79F0",prop:"name"},{default:s(()=>[o(n,{modelValue:l(u).name,"onUpdate:modelValue":e[2]||(e[2]=a=>l(u).name=a),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u7269\u6D41\u540D\u79F0"},null,8,["modelValue"])]),_:1}),o(d,{label:"\u6743\u91CD",prop:"weight"},{default:s(()=>[o(n,{modelValue:l(u).weight,"onUpdate:modelValue":e[3]||(e[3]=a=>l(u).weight=a),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u6743\u91CD"},null,8,["modelValue"])]),_:1}),o(d,{label:"\u72B6\u6001",prop:"status"},{default:s(()=>[o(y,{class:"flex-1",modelValue:l(u).status,"onUpdate:modelValue":e[4]||(e[4]=a=>l(u).status=a),clearable:"",placeholder:"\u8BF7\u9009\u62E9\u72B6\u6001"},{default:s(()=>[(m(!0),b(T,null,z(B.dictData.show_status,(a,U)=>(m(),G(C,{key:U,label:a.name,value:parseInt(a.value)},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["title"])])}}});export{ee as _};
