zhouwx
2025-06-16 7c8c06b5397d22151b02407b1f4f19d771bb15dd
1
var v=Object.defineProperty;var p=Object.getOwnPropertySymbols;var y=Object.prototype.hasOwnProperty,B=Object.prototype.propertyIsEnumerable;var _=(t,o,e)=>o in t?v(t,o,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[o]=e,c=(t,o)=>{for(var e in o||(o={}))y.call(o,e)&&_(t,e,o[e]);if(p)for(var e of p(o))B.call(o,e)&&_(t,e,o[e]);return t};import{u as f}from"./index.170442172366522.js";import{_ as N,E as r}from"./index.1704421723665.js";import{J as V,a1 as k,a4 as C,a as $,Y as s,R as a,a5 as i,al as z,o as g,b as J,S as A,Q as I,W as D,X as L}from"./vue.1704421723665.js";const O=V({name:"systemAddRole",setup(t,o){const e=k({isShowRoleDialog:!1,title:"",buttonName:"",roleForm:{name:""},menuData:[],menuProps:{children:"children",label:"label"}});return c({onSubmit:async()=>{if(e.title==="\u65B0\u589E\u89D2\u8272"){let l=await f().addRole(e.roleForm);l.data.code===100?(r({type:"success",message:"\u89D2\u8272\u65B0\u589E\u6210\u529F",duration:2e3}),e.isShowRoleDialog=!1,o.emit("refreshRoleList")):r({type:"warning",message:l.data.msg})}else{let l=await f().modRole(e.roleForm);l.data.code===100?(r({type:"success",message:"\u89D2\u8272\u4FEE\u6539\u6210\u529F",duration:2e3}),e.isShowRoleDialog=!1,o.emit("refreshRoleList")):r({type:"warning",message:l.data.msg})}},openDialog:(l,m)=>{if(e.isShowRoleDialog=!0,l==="\u65B0\u589E")e.title="\u65B0\u589E\u89D2\u8272",e.buttonName="\u65B0\u589E",e.roleForm={name:""};else{e.title="\u4FEE\u6539\u89D2\u8272",e.buttonName="\u4FEE\u6539";let u=JSON.parse(JSON.stringify(m));e.roleForm={roleId:u.id,name:u.name}}}},C(e))}}),U={class:"system-add-role-container"},M={class:"dialog-footer"},P=D("\u53D6 \u6D88");function Q(t,o,e,w,b,l){const m=i("el-input"),u=i("el-form-item"),h=i("el-col"),F=i("el-row"),R=i("el-form"),d=i("el-button"),S=i("el-dialog"),E=z("throttle");return g(),$("div",U,[s(S,{title:t.title,modelValue:t.isShowRoleDialog,"onUpdate:modelValue":o[2]||(o[2]=n=>t.isShowRoleDialog=n),width:"600px"},{footer:a(()=>[J("span",M,[s(d,{onClick:o[1]||(o[1]=n=>t.isShowRoleDialog=!t.isShowRoleDialog),size:"default"},{default:a(()=>[P]),_:1}),A((g(),I(d,{type:"primary",onClick:t.onSubmit,size:"default"},{default:a(()=>[D(L(t.buttonName),1)]),_:1},8,["onClick"])),[[E]])])]),default:a(()=>[s(R,{model:t.roleForm,size:"default","label-width":"90px"},{default:a(()=>[s(F,{gutter:35},{default:a(()=>[s(h,{xs:24,sm:12,md:12,lg:24,xl:24,class:"mb20"},{default:a(()=>[s(u,{label:"\u89D2\u8272\u540D\u79F0"},{default:a(()=>[s(m,{modelValue:t.roleForm.name,"onUpdate:modelValue":o[0]||(o[0]=n=>t.roleForm.name=n),placeholder:"\u8BF7\u8F93\u5165\u89D2\u8272\u540D\u79F0",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])]),_:1},8,["title","modelValue"])])}var j=N(O,[["render",Q],["__scopeId","data-v-427e3b1e"]]);export{j as default};