import{C as U,D as x,F as R}from"./element-plus.bccb9376.js";import{M as g}from"./picker.24e47292.js";import{P}from"./index.8f1b3064.js";import{a as I,b as M,c as h}from"./brand.3d1e7d62.js";import"./lodash.466e9fe4.js";import{d as C,s as F,r as j,b as q,Z as f,o as A,c as L,U as a,L as n,u as l}from"./@vue.18505fe0.js";const N={class:"edit-popup"},O=C({name:"brandEdit"}),K=C({...O,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(S,{expose:_,emit:b}){const m=b,i=F(),s=F(),p=j("add"),V=q(()=>p.value=="edit"?"\u7F16\u8F91\u54C1\u724C\u4FE1\u606F\u8868":"\u65B0\u589E\u54C1\u724C\u4FE1\u606F\u8868"),u=f({id:"",name:"",py:"",number:"",data:"",more:"",pic:"",sort:""}),E=f({name:[{required:!0,message:"\u8BF7\u8F93\u5165\u54C1\u724C\u540D\u79F0",trigger:["blur"]}]}),c=async o=>{for(const e in u)o[e]!=null&&o[e]!=null&&(u[e]=o[e])},B=async o=>{const e=await I({id:o.id});c(e)},v=async()=>{var e,r;await((e=i.value)==null?void 0:e.validate());const o={...u};p.value=="edit"?await M(o):await h(o),(r=s.value)==null||r.close(),m("success")},y=(o="add")=>{var e;p.value=o,(e=s.value)==null||e.open()},D=()=>{m("close")};return _({open:y,setFormData:c,getDetail:B}),(o,e)=>{const r=U,d=x,w=g,k=R;return A(),L("div",N,[a(P,{ref_key:"popupRef",ref:s,title:l(V),async:!0,width:"550px",onConfirm:v,onClose:D},{default:n(()=>[a(k,{ref_key:"formRef",ref:i,model:l(u),"label-width":"90px",rules:l(E)},{default:n(()=>[a(d,{label:"\u54C1\u724C\u540D\u79F0",prop:"name"},{default:n(()=>[a(r,{modelValue:l(u).name,"onUpdate:modelValue":e[0]||(e[0]=t=>l(u).name=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u54C1\u724C\u540D\u79F0"},null,8,["modelValue"])]),_:1}),a(d,{label:"\u54C1\u724C\u7F16\u53F7",prop:"number"},{default:n(()=>[a(r,{modelValue:l(u).number,"onUpdate:modelValue":e[1]||(e[1]=t=>l(u).number=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u54C1\u724C\u7F16\u53F7"},null,8,["modelValue"])]),_:1}),a(d,{label:"\u5907\u6CE8\u4FE1\u606F",prop:"data"},{default:n(()=>[a(r,{modelValue:l(u).data,"onUpdate:modelValue":e[2]||(e[2]=t=>l(u).data=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5907\u6CE8\u4FE1\u606F"},null,8,["modelValue"])]),_:1}),a(d,{label:"\u6269\u5C55\u4FE1\u606F",prop:"more"},{default:n(()=>[a(r,{modelValue:l(u).more,"onUpdate:modelValue":e[3]||(e[3]=t=>l(u).more=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u6269\u5C55\u4FE1\u606F"},null,8,["modelValue"])]),_:1}),a(d,{label:"\u56FE\u7247",prop:"pic"},{default:n(()=>[a(w,{modelValue:l(u).pic,"onUpdate:modelValue":e[4]||(e[4]=t=>l(u).pic=t)},null,8,["modelValue"])]),_:1}),a(d,{label:"\u6392\u5E8F",prop:"sort"},{default:n(()=>[a(r,{modelValue:l(u).sort,"onUpdate:modelValue":e[5]||(e[5]=t=>l(u).sort=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u6392\u5E8F"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["title"])])}}});export{K as _};
