import{C,D as R,F as h}from"./element-plus.73c9e9a6.js";import{M as P}from"./picker.903854da.js";import{P as U}from"./index.fa58e261.js";import{r as s}from"./index.bd5cd373.js";import"./lodash.403d4198.js";import{d as E,s as b,r as I,b as M,Z as g,o as j,c as q,U as n,L as r,u as a}from"./@vue.663bc523.js";function Q(o){return s.get({url:"/setting/label/lists",params:o})}function A(o){return s.post({url:"/setting/label/add",params:o})}function N(o){return s.post({url:"/setting/label/edit",params:o})}function W(o){return s.post({url:"/setting/label/delete",params:o})}function O(o){return s.get({url:"/setting/label/detail",params:o})}const S={class:"edit-popup"},T=E({name:"labelEdit"}),X=E({...T,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(o,{expose:v,emit:B}){const d=B,m=b(),i=b(),p=I("add"),D=M(()=>p.value=="edit"?"\u7F16\u8F91\u6807\u7B7E":"\u65B0\u589E\u6807\u7B7E"),l=g({id:"",label_name:"",logo:""}),F=g({}),f=async t=>{for(const e in l)t[e]!=null&&t[e]!=null&&(l[e]=t[e])},w=async t=>{const e=await O({id:t.id});f(e)},y=async()=>{var e,u;await((e=m.value)==null?void 0:e.validate());const t={...l};p.value=="edit"?await N(t):await A(t),(u=i.value)==null||u.close(),d("success")},k=(t="add")=>{var e;p.value=t,(e=i.value)==null||e.open()},L=()=>{d("close")};return v({open:k,setFormData:f,getDetail:w}),(t,e)=>{const u=C,_=R,V=P,x=h;return j(),q("div",S,[n(U,{ref_key:"popupRef",ref:i,title:a(D),async:!0,width:"550px",onConfirm:y,onClose:L},{default:r(()=>[n(x,{ref_key:"formRef",ref:m,model:a(l),"label-width":"90px",rules:a(F)},{default:r(()=>[n(_,{label:"\u6807\u7B7E\u540D\u5B57",prop:"label_name"},{default:r(()=>[n(u,{modelValue:a(l).label_name,"onUpdate:modelValue":e[0]||(e[0]=c=>a(l).label_name=c),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u6807\u7B7E\u540D\u5B57"},null,8,["modelValue"])]),_:1}),n(_,{label:"logo(\u56FE\u7247)",prop:"logo"},{default:r(()=>[n(V,{modelValue:a(l).logo,"onUpdate:modelValue":e[1]||(e[1]=c=>a(l).logo=c)},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["title"])])}}});export{X as _,W as a,Q as b};
