You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
2.6KB

  1. import z from"./roleDrawer-ea62456e.js";import{a as u,r as p,o as F,b as o,c as L,d as R,f as e,h as t,i as _,e as m,F as j,k as M,ar as U,as as E,s as G}from"./index-dd5fae99.js";import"./menuManage-d68f1902.js";const I={class:"flex justify-between items-center"},S=["onClick"],W=["onClick"],q=M({name:"roleManage"}),Q=Object.assign(q,{setup(A){const{proxy:f}=G(),r=u({name:void 0}),i=p(),b=p(0),k=u([{label:"序号",type:"index",width:"80"},{label:"角色名称",key:"name",prop:"name",width:"250"},{label:"角色描述",key:"describe",prop:"describe",minWidth:"180",showOverflowTooltip:!0},{label:"创建时间",key:"createOn",prop:"createOn",width:"180"},{label:"操作",slot:"action",width:"120",fixed:"right"}]),v=p([]),s=async(l=i.value.pageParams)=>{const a=await U({...l,...r});v.value=a.data.records,b.value=a.data.total},x=()=>{s()},C=()=>{r.name=void 0,i.value.pageParams.pageNumber=1,i.value.pageParams.pageSize=10,s()},n=u({visible:!1,rowData:void 0}),h=()=>{n.visible=!0,n.rowData=void 0},D=l=>{n.visible=!0,n.rowData=l},V=l=>{f.$messageBox.confirm("是否删除该角色?","提示!",{type:"warning"}).then(async()=>{await E([l.id]),f.$message.success("删除成功!"),s()})},B=l=>{n.visible=!1,l&&s()};return F(()=>{s()}),(l,a)=>{const N=o("el-input"),w=o("el-form-item"),g=o("el-col"),c=o("el-button"),O=o("el-row"),P=o("el-form"),y=o("el-card"),T=o("table-list");return L(),R(j,null,[e(y,{shadow:"never",class:"search mb-16"},{default:t(()=>[e(P,{"label-suffix":":",model:r,size:"small"},{default:t(()=>[e(O,{gutter:16},{default:t(()=>[e(g,{span:8},{default:t(()=>[e(w,{label:"角色名称"},{default:t(()=>[e(N,{modelValue:r.name,"onUpdate:modelValue":a[0]||(a[0]=d=>r.name=d),placeholder:"请输入"},null,8,["modelValue"])]),_:1})]),_:1}),e(g,{span:16},{default:t(()=>[e(w,{class:"btn"},{default:t(()=>[e(c,{type:"primary",onClick:x},{default:t(()=>a[1]||(a[1]=[_("查询")])),_:1}),e(c,{onClick:C},{default:t(()=>a[2]||(a[2]=[_("重置")])),_:1})]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),e(y,{shadow:"never"},{header:t(()=>[m("div",I,[a[4]||(a[4]=m("span",null,"角色列表",-1)),e(c,{type:"primary",icon:"Plus",size:"small",onClick:h},{default:t(()=>a[3]||(a[3]=[_(" 新增角色 ")])),_:1})])]),default:t(()=>[e(T,{ref_key:"tableListRef",ref:i,column:k,data:v.value,total:b.value,onGetTableData:s},{action:t(({scope:d})=>[m("a",{class:"text-primary",onClick:$=>D(d.row)},"编辑",8,S),m("a",{class:"text-danger",onClick:$=>V(d.row)},"删除",8,W)]),_:1},8,["column","data","total"])]),_:1}),e(z,{visible:n.visible,data:n.rowData,onClose:B},null,8,["visible","data"])],64)}}});export{Q as default};