import{C,D as R,F as k}from"./element-plus.a63a26dd.js";import{P as L}from"./index.da3823b2.js";import{b as U,c as g,d as V}from"./user_label.09e6de1a.js";import"./lodash.2473fc51.js";import{d as _,s as m,r as I,b as P,Z as d,o as j,c as q,U as s,L as r,u as o}from"./@vue.18505fe0.js";const A={class:"edit-popup"},N=_({name:"userLabelEdit"}),H=_({...N,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(O,{expose:f,emit:b}){const c=b,i=m(),u=m(),n=I("add"),F=P(()=>n.value=="edit"?"\u7F16\u8F91\u7528\u6237\u6807\u7B7E\u8868":"\u65B0\u589E\u7528\u6237\u6807\u7B7E\u8868"),t=d({label_id:"",label_name:""}),E=d({label_name:[{required:!0,message:"\u8BF7\u8F93\u5165\u6807\u7B7E\u540D\u79F0",trigger:["blur"]}]}),p=async a=>{for(const e in t)a[e]!=null&&a[e]!=null&&(t[e]=a[e])},v=async a=>{const e=await U({label_id:a.label_id});p(e)},B=async()=>{var e,l;await((e=i.value)==null?void 0:e.validate());const a={...t};n.value=="edit"?await g(a):await V(a),(l=u.value)==null||l.close(),c("success")},y=(a="add")=>{var e;n.value=a,(e=u.value)==null||e.open()},D=()=>{c("close")};return f({open:y,setFormData:p,getDetail:v}),(a,e)=>{const l=C,w=R,h=k;return j(),q("div",A,[s(L,{ref_key:"popupRef",ref:u,title:o(F),async:!0,width:"550px",onConfirm:B,onClose:D},{default:r(()=>[s(h,{ref_key:"formRef",ref:i,model:o(t),"label-width":"90px",rules:o(E)},{default:r(()=>[s(w,{label:"\u6807\u7B7E\u540D\u79F0",prop:"label_name"},{default:r(()=>[s(l,{modelValue:o(t).label_name,"onUpdate:modelValue":e[0]||(e[0]=x=>o(t).label_name=x),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u6807\u7B7E\u540D\u79F0",readonly:!1},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["title"])])}}});export{H as _};
