import{d as w,O as x,k as r,o as j,c as y,a as s,b as t,u as a}from"./vue.1703796278973.js";import{M as k,I as R,r as h,aG as M,F as B,W as C}from"./index.17037962789732.js";import"./index.170379627897337.js";import"./index.170379627897315.js";import"./index.170379627897318.js";import"./index.170379627897319.js";import"./index.170379627897314.js";import{s as S}from"./role.1703796278973.js";import{h as q}from"./system.1703796278973.js";const L=w({__name:"AddDialog",props:{visible:{type:Boolean}},emits:["update:visible"],setup(D,{emit:m}){const c=x(),{jumpPage:d}=q(),l=r(!1),o=r({}),u=r(),_=()=>{var i;l.value=!0,(i=u.value)==null||i.validate().then(()=>S(o.value)).then(e=>{e.status===200&&(k.success("操作成功"),m("update:visible",!1),c.query.save?(window==null||window.onTabSaveSuccess(e.result.id),setTimeout(()=>window.close(),300)):d("system/Role/Detail",{id:e.result.id}))}).finally(()=>l.value=!1)};return(i,e)=>{const f=R,p=h,v=M,g=B,b=C;return j(),y(b,{visible:"",title:"新增",width:"670px",onCancel:e[2]||(e[2]=n=>m("update:visible",!1)),onOk:_,"confirm-loading":a(l)},{default:s(()=>[t(g,{ref_key:"formRef",ref:u,model:a(o),layout:"vertical"},{default:s(()=>[t(p,{name:"name",label:"名称",rules:[{required:!0,message:"请输入名称"},{max:64,message:"最多可输入64个字符"}]},{default:s(()=>[t(f,{value:a(o).name,"onUpdate:value":e[0]||(e[0]=n=>a(o).name=n),placeholder:"请输入角色名称","allow-clear":""},null,8,["value"])]),_:1}),t(p,{name:"name",label:"说明"},{default:s(()=>[t(v,{value:a(o).description,"onUpdate:value":e[1]||(e[1]=n=>a(o).description=n),placeholder:"请输入说明","allow-clear":"",maxlength:200,"show-count":""},null,8,["value"])]),_:1})]),_:1},8,["model"])]),_:1},8,["confirm-loading"])}}});export{L as _};
