import{ad as D,a as d,j as n,b as i,c as V,l as o,w as a,f as u,B as j,F as E,e as L,q as R,d as z,m as g,ae as A}from"./index-D0Tcm3GV.js";const G={class:"dialog-footer"},I={__name:"TreeNodeDialog",props:{modelValue:{},modelModifiers:{}},emits:A(["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"}]),w=d(100),p=d();function B(){t.value={label:void 0,value:void 0}}function m(){r.value=!1}function F(){p.value.validate(f=>{f&&(s.value==="number"&&(t.value.value=parseFloat(t.value.value)),t.value.id=w.value++,x("commit",t.value),m())})}return(f,e)=>{const c=n("el-input"),_=n("el-form-item"),v=n("el-col"),T=n("el-option"),U=n("el-select"),q=n("el-form"),b=n("el-button"),M=n("el-dialog");return i(),V("div",null,[o(M,{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:B,onClose:m},{footer:a(()=>[z("div",G,[o(b,{type:"primary",onClick:F},{default:a(()=>[...e[4]||(e[4]=[g("确 定",-1)])]),_:1}),o(b,{onClick:m},{default:a(()=>[...e[5]||(e[5]=[g("取 消",-1)])]),_:1})])]),default:a(()=>[o(q,{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=>j(s)?s.value=l:null),style:{width:"100px"}},{default:a(()=>[(i(!0),V(E,null,L(u(N),(l,O)=>(i(),R(T,{key:O,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};
