import{r as c,e as l,E as k,o as p,c as z,f as e,h as s,G as u,J as _,m as y,i as t,K as E,H as T,B as J,v as L}from"./index-C1_1_QXk.js";import{l as O,c as V}from"./role-gbXRIS2k.js";const j={class:"app-container"},q=J({name:"Role"}),I=Object.assign(q,{setup(A){const{proxy:m}=L(),w=c([]),f=c(!1),g=c(!0),h=c(0),i=c({pageNum:1,pageSize:10});function d(){f.value=!0,O(i.value).then(o=>{w.value=o.data.list,h.value=o.data.total,f.value=!1})}function S(o){m.$modal.confirm('是否确认删除角色"'+o.name+'"的数据项?').then(function(){return V({id:o.id})}).then(a=>{d(),m.$modal.msgSuccess(a.code)}).catch(()=>{})}function C(){m.$router.push("/system/role/createRole")}function N(o){m.$router.push(`/system/role/editRole?row=${JSON.stringify(o)}`)}return d(),(o,a)=>{const v=l("el-button"),$=l("el-col"),P=l("right-toolbar"),x=l("el-row"),r=l("el-table-column"),D=l("el-table"),R=l("pagination"),b=k("hasPermi"),B=k("loading");return p(),z("div",j,[e(x,{gutter:10,class:"mb8"},{default:s(()=>[e($,{span:1.5},{default:s(()=>[u((p(),_(v,{type:"primary",plain:"",icon:"Plus",onClick:C},{default:s(()=>[y("创建角色")]),_:1})),[[b,["system:role:add"]]])]),_:1}),e(P,{showSearch:t(g),"onUpdate:showSearch":a[0]||(a[0]=n=>E(g)?g.value=n:null),onQueryTable:d},null,8,["showSearch"])]),_:1}),u((p(),_(D,{data:t(w)},{default:s(()=>[e(r,{label:"名称",prop:"name"}),e(r,{label:"标签",prop:"tag"}),e(r,{label:"创建时间",prop:"createTime"}),e(r,{label:"操作员",prop:"userName"}),e(r,{label:"操作",align:"center"},{default:s(n=>[u((p(),_(v,{link:"",type:"primary",icon:"EditPen",onClick:U=>N(n.row)},{default:s(()=>[y("编辑")]),_:2},1032,["onClick"])),[[b,["system:role:edit"]]]),u((p(),_(v,{link:"",type:"primary",icon:"Delete",onClick:U=>S(n.row)},{default:s(()=>[y("删除")]),_:2},1032,["onClick"])),[[b,["system:role:del"]]])]),_:1})]),_:1},8,["data"])),[[B,t(f)]]),u(e(R,{total:t(h),page:t(i).pageNum,"onUpdate:page":a[1]||(a[1]=n=>t(i).pageNum=n),limit:t(i).pageSize,"onUpdate:limit":a[2]||(a[2]=n=>t(i).pageSize=n),onPagination:d},null,8,["total","page","limit"]),[[T,t(h)>0]])])}}});export{I as default};
