import{ad as O,a as s,k as a,b as u,v as p,m as l,l as n,f as r,c as U,F as E,e as L,q as f,t as S,g as $,ae as y}from"./index-B51TLSWN.js";const j={__name:"CodeTypeDialog",props:y({showFileName:Boolean},{modelValue:{},modelModifiers:{}}),emits:y(["confirm"],["update:modelValue"]),setup(m,{emit:V}){const d=O(m,"modelValue"),v=m,N=V,t=s({fileName:void 0,type:"file"}),c=s(),k={fileName:[{required:!0,message:"请输入文件名",trigger:"blur"}],type:[{required:!0,message:"生成类型不能为空",trigger:"change"}]},C=s([{label:"页面",value:"file"},{label:"弹窗",value:"dialog"}]);function w(){v.showFileName&&(t.value.fileName=`${+new Date}.vue`)}function i(){d.value=!1}function F(){c.value.validate(_=>{_&&(N("confirm",{...t.value}),i())})}return(_,e)=>{const x=a("el-radio-button"),B=a("el-radio-group"),g=a("el-form-item"),D=a("el-input"),T=a("el-form"),b=a("el-button"),q=a("el-dialog");return u(),p(q,{modelValue:d.value,"onUpdate:modelValue":e[2]||(e[2]=o=>d.value=o),width:"500px",title:"选择生成类型",onOpen:w,onClose:i},{footer:l(()=>[n(b,{onClick:i},{default:l(()=>[...e[3]||(e[3]=[f("取消",-1)])]),_:1}),n(b,{type:"primary",onClick:F},{default:l(()=>[...e[4]||(e[4]=[f("确定",-1)])]),_:1})]),default:l(()=>[n(T,{ref_key:"codeTypeForm",ref:c,model:r(t),rules:k,"label-width":"100px"},{default:l(()=>[n(g,{label:"生成类型",prop:"type"},{default:l(()=>[n(B,{modelValue:r(t).type,"onUpdate:modelValue":e[0]||(e[0]=o=>r(t).type=o)},{default:l(()=>[(u(!0),U(E,null,L(r(C),(o,M)=>(u(),p(x,{key:M,label:o.value},{default:l(()=>[f(S(o.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1}),m.showFileName?(u(),p(g,{key:0,label:"文件名",prop:"fileName"},{default:l(()=>[n(D,{modelValue:r(t).fileName,"onUpdate:modelValue":e[1]||(e[1]=o=>r(t).fileName=o),placeholder:"请输入文件名",clearable:""},null,8,["modelValue"])]),_:1})):$("",!0)]),_:1},8,["model"])]),_:1},8,["modelValue"])}}};export{j as default};
