import{m as h}from"./message-5a54ef00.js";const F=Vue.defineComponent({__name:"DialogForm",props:{visible:{type:Boolean,default:!1},data:{type:Object,default:()=>({})}},emits:["update:visible"],setup(c,{emit:v}){const r=c,f=[{label:"网关",value:1},{label:"人工智能",value:2},{label:"CVM",value:3},{label:"防火墙",value:4},{label:"未知",value:5}],V=Vue.ref(),a=Vue.ref(!1),o=Vue.ref(r.data),d=Vue.ref(""),_=async l=>{l&&await l.validate(e=>{e&&(h("提交成功",{type:"success"}),a.value=!1,s(l))})},s=l=>{l&&l.resetFields()},p=()=>{a.value=!1,s(V.value)};Vue.watch(()=>a.value,l=>{v("update:visible",l)}),Vue.watch(()=>r.visible,l=>{a.value=l}),Vue.watch(()=>r.data,l=>{o.value=l});const b={name:[{required:!0,message:"请输入产品名称",trigger:"blur"}]};return(l,e)=>{const n=Vue.resolveComponent("el-input"),u=Vue.resolveComponent("el-form-item"),i=Vue.resolveComponent("el-radio"),x=Vue.resolveComponent("el-radio-group"),C=Vue.resolveComponent("el-option"),w=Vue.resolveComponent("el-select"),N=Vue.resolveComponent("el-form"),m=Vue.resolveComponent("el-button"),y=Vue.resolveComponent("el-dialog");return Vue.openBlock(),Vue.createBlock(y,{modelValue:a.value,"onUpdate:modelValue":e[6]||(e[6]=t=>a.value=t),title:"新建产品",width:680,draggable:"","before-close":p},{footer:Vue.withCtx(()=>[Vue.createVNode(m,{onClick:p},{default:Vue.withCtx(()=>[Vue.createTextVNode("取消")]),_:1}),Vue.createVNode(m,{type:"primary",onClick:e[5]||(e[5]=t=>_(V.value))},{default:Vue.withCtx(()=>[Vue.createTextVNode(" 确定 ")]),_:1})]),default:Vue.withCtx(()=>[Vue.createVNode(N,{ref_key:"ruleFormRef",ref:V,model:o.value,rules:b,"label-width":"100px"},{default:Vue.withCtx(()=>[Vue.createVNode(u,{label:"产品名称",prop:"name"},{default:Vue.withCtx(()=>[Vue.createVNode(n,{modelValue:o.value.name,"onUpdate:modelValue":e[0]||(e[0]=t=>o.value.name=t),style:{width:"480px"},placeholder:"请输入产品名称"},null,8,["modelValue"])]),_:1}),Vue.createVNode(u,{label:"产品状态",prop:"status"},{default:Vue.withCtx(()=>[Vue.createVNode(x,{modelValue:o.value.status,"onUpdate:modelValue":e[1]||(e[1]=t=>o.value.status=t)},{default:Vue.withCtx(()=>[Vue.createVNode(i,{label:"0"},{default:Vue.withCtx(()=>[Vue.createTextVNode("已停用")]),_:1}),Vue.createVNode(i,{label:"1"},{default:Vue.withCtx(()=>[Vue.createTextVNode("已启用")]),_:1})]),_:1},8,["modelValue"])]),_:1}),Vue.createVNode(u,{label:"产品描述",prop:"description"},{default:Vue.withCtx(()=>[Vue.createVNode(n,{modelValue:o.value.description,"onUpdate:modelValue":e[2]||(e[2]=t=>o.value.description=t),style:{width:"480px"},placeholder:"请输入产品描述"},null,8,["modelValue"])]),_:1}),Vue.createVNode(u,{label:"产品类型",prop:"type"},{default:Vue.withCtx(()=>[Vue.createVNode(w,{modelValue:o.value.type,"onUpdate:modelValue":e[3]||(e[3]=t=>o.value.type=t),clearable:"",style:{width:"480px"}},{default:Vue.withCtx(()=>[(Vue.openBlock(),Vue.createElementBlock(Vue.Fragment,null,Vue.renderList(f,(t,g)=>Vue.createVNode(C,{key:g,value:t.value,label:t.label},{default:Vue.withCtx(()=>[Vue.createTextVNode(Vue.toDisplayString(t.label),1)]),_:2},1032,["value","label"])),64))]),_:1},8,["modelValue"])]),_:1}),Vue.createVNode(u,{label:"备注",prop:"mark"},{default:Vue.withCtx(()=>[Vue.createVNode(n,{modelValue:d.value,"onUpdate:modelValue":e[4]||(e[4]=t=>d.value=t),type:"textarea",style:{width:"480px"},placeholder:"请输入内容"},null,8,["modelValue"])]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue"])}}});export{F as _};
