import{af as U,r as s,d as a,o as u,e as p,f as l,k as n,l as r,g as q,F as j,G as E,n as f,t as G,j as L,ag as V}from"./index-Yv4yXRHK.js";const $={__name:"CodeTypeDialog",props:V({showFileName:Boolean},{modelValue:{},modelModifiers:{}}),emits:V(["confirm"],["update:modelValue"]),setup(m,{emit:b}){const d=U(m,"modelValue"),v=m,N=b,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"),y=a("el-button"),M=a("el-dialog");return u(),p(M,{modelValue:d.value,"onUpdate:modelValue":e[2]||(e[2]=o=>d.value=o),width:"500px",title:"选择生成类型",onOpen:w,onClose:i},{footer:l(()=>[n(y,{onClick:i},{default:l(()=>[...e[3]||(e[3]=[f("取消",-1)])]),_:1}),n(y,{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),q(j,null,E(r(C),(o,O)=>(u(),p(x,{key:O,label:o.value},{default:l(()=>[f(G(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})):L("",!0)]),_:1},8,["model"])]),_:1},8,["modelValue"])}}};export{$ as default};
