import{ad as D,a as d,k as n,b as i,c as V,l as o,m as a,f as u,J as E,F as J,e as L,v as R,d as j,q as g,ae as z}from"./index-B51TLSWN.js";const A={class:"dialog-footer"},H={__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"}]),F=d(100),p=d();function w(){t.value={label:void 0,value:void 0}}function m(){r.value=!1}function B(){p.value.validate(f=>{f&&(s.value==="number"&&(t.value.value=parseFloat(t.value.value)),t.value.id=F.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:w,onClose:m},{footer:a(()=>[j("div",A,[o(b,{type:"primary",onClick:B},{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=>E(s)?s.value=l:null),style:{width:"100px"}},{default:a(()=>[(i(!0),V(J,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{H as default};
