import{af as D,r as d,d as n,o as m,g as V,k as o,f as a,l as u,B as E,F as G,G as L,e as R,i as j,n as g,ag as z}from"./index-Bg_jr9nS.js";const A={class:"dialog-footer"},I={__name:"TreeNodeDialog",props:{modelValue:{},modelModifiers:{}},emits:z(["confirm"],["update:modelValue"]),setup(k,{emit:y}){const r=D(k,"modelValue"),x=y,t=d({label:void 0,value:void 0}),C={label:[{required:!0,message:"请输入选项名",trigger:"blur"}],value:[{required:!0,message:"请输入选项值",trigger:"blur"}]},s=d("string"),N=d([{label:"字符串",value:"string"},{label:"数字",value:"number"}]),B=d(100),p=d();function F(){t.value={label:void 0,value:void 0}}function i(){r.value=!1}function w(){p.value.validate(f=>{f&&(s.value==="number"&&(t.value.value=parseFloat(t.value.value)),t.value.id=B.value++,x("commit",t.value),i())})}return(f,e)=>{const c=n("el-input"),_=n("el-form-item"),v=n("el-col"),T=n("el-option"),U=n("el-select"),M=n("el-form"),b=n("el-button"),O=n("el-dialog");return m(),V("div",null,[o(O,{title:"添加选项",modelValue:r.value,"onUpdate:modelValue":e[3]||(e[3]=l=>r.value=l),width:"800px","close-on-click-modal":!1,"modal-append-to-body":!1,onOpen:F,onClose:i},{footer:a(()=>[j("div",A,[o(b,{type:"primary",onClick:w},{default:a(()=>[...e[4]||(e[4]=[g("确 定",-1)])]),_:1}),o(b,{onClick:i},{default:a(()=>[...e[5]||(e[5]=[g("取 消",-1)])]),_:1})])]),default:a(()=>[o(M,{ref_key:"treeNodeForm",ref:p,model:u(t),rules:C,"label-width":"100px"},{default:a(()=>[o(v,{span:24},{default:a(()=>[o(_,{label:"选项名",prop:"label"},{default:a(()=>[o(c,{modelValue:u(t).label,"onUpdate:modelValue":e[0]||(e[0]=l=>u(t).label=l),placeholder:"请输入选项名",clearable:""},null,8,["modelValue"])]),_:1})]),_:1}),o(v,{span:24},{default:a(()=>[o(_,{label:"选项值",prop:"value"},{default:a(()=>[o(c,{modelValue:u(t).value,"onUpdate:modelValue":e[2]||(e[2]=l=>u(t).value=l),placeholder:"请输入选项值",clearable:""},{append:a(()=>[o(U,{modelValue:u(s),"onUpdate:modelValue":e[1]||(e[1]=l=>E(s)?s.value=l:null),style:{width:"100px"}},{default:a(()=>[(m(!0),V(G,null,L(u(N),(l,q)=>(m(),R(T,{key:q,label:l.label,value:l.value,disabled:l.disabled},null,8,["label","value","disabled"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["modelValue"])]),_:1})]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue"])])}}};export{I as default};
