import{ad as O,a as s,j as a,b as u,q as p,w as l,l as n,f as r,c as U,F as j,e as E,m as f,t as L,g as S,ae as y}from"./index-D0Tcm3GV.js";const h={__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(),C={fileName:[{required:!0,message:"请输入文件名",trigger:"blur"}],type:[{required:!0,message:"生成类型不能为空",trigger:"change"}]},k=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:C,"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(j,null,E(r(k),(o,M)=>(u(),p(x,{key:M,label:o.value},{default:l(()=>[f(L(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})):S("",!0)]),_:1},8,["model"])]),_:1},8,["modelValue"])}}};export{h as default};
