role-list.bbaa44e8.js 916 B

1
  1. import{h as d}from"./index.ad3ce109.js";import{u as p}from"./use-response-handle.e77e146e.js";import{q as f,B as m,C as _,r as h,o as s,K as C,H as b,n as l,J as g,I as v,v as R,G as k,O as x}from"./index.f0f7bda7.js";const y=["onClick"],L=f({__name:"role-list",props:{currentRole:null},emits:["changeCurrentRole"],setup(c,{emit:n}){const i=p(),o=m([]);async function u(){const{code:t,data:a,message:r}=await d({size:100});i({code:t,message:r,handler:()=>{o.value=a.list,n("changeCurrentRole",R(o)[0])}})}return _(()=>u()),(t,a)=>{const r=h("ElScrollbar");return s(),C(r,{class:"border-r border-#dcdfe6"},{default:b(()=>[(s(!0),l(v,null,g(o.value,e=>(s(),l("div",{class:k(["px-1 py-0.5 m-1.5 hover:color-blue hover:bg-#f7f7f7 cursor-pointer duration-200",c.currentRole.id===e.id&&"color-blue bg-#f7f7f7"]),key:e.id,onClick:()=>n("changeCurrentRole",e)},x(e.role_name),11,y))),128))]),_:1})}}});export{L as default};