import{ad as O,k as s,r as a,o as u,p,w as l,d as n,f as r,a as U,F as h,h as E,e as f,t as L,q as S,ae as V}from"./index-CAjTdQe7.js";const j={__name:"CodeTypeDialog",props:V({showFileName:Boolean},{modelValue:{},modelModifiers:{}}),emits:V(["confirm"],["update:modelValue"]),setup(m,{emit:b}){const d=O(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"),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(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),U(h,null,E(r(C),(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{j as default};
