import{C,D as R,F as h}from"./element-plus.4a7d92a3.js";import{_ as U}from"./picker.125411f2.js";import{P as I}from"./index.a19e7573.js";import{r as s}from"./index.9fc4c153.js";import"./lodash.9dc701ad.js";import{d as E,s as b,r as P,b as j,Z as g,o as q,c as A,U as n,L as r,u as a}from"./@vue.18505fe0.js";function Q(o){return s.get({url:"/setting/label/lists",params:o})}function N(o){return s.post({url:"/setting/label/add",params:o})}function O(o){return s.post({url:"/setting/label/edit",params:o})}function W(o){return s.post({url:"/setting/label/delete",params:o})}function S(o){return s.get({url:"/setting/label/detail",params:o})}const T={class:"edit-popup"},Z=E({name:"labelEdit"}),X=E({...Z,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(o,{expose:v,emit:B}){const m=B,d=b(),i=b(),p=P("add"),D=j(()=>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 S({id:t.id});f(e)},y=async()=>{var e,u;await((e=d.value)==null?void 0:e.validate());const t={...l};p.value=="edit"?await O(t):await N(t),(u=i.value)==null||u.close(),m("success")},L=(t="add")=>{var e;p.value=t,(e=i.value)==null||e.open()},V=()=>{m("close")};return v({open:L,setFormData:f,getDetail:w}),(t,e)=>{const u=C,_=R,k=U,x=h;return q(),A("div",T,[n(I,{ref_key:"popupRef",ref:i,title:a(D),async:!0,width:"550px",onConfirm:y,onClose:V},{default:r(()=>[n(x,{ref_key:"formRef",ref:d,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(k,{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};
