import{d as I,n as S,o as d,c as y,a as i,b as e,w as a,k as c,E as U,r as s,g as E,I as L,j as _,D as N,q as w,x as m,F as j,s as F,G as M,_ as T}from"./index-DIl-pxgT.js";const $={class:"page-container"},q={class:"table-card card-shadow"},A={class:"table-header"},G={class:"table-card card-shadow"},K=I({__name:"System",setup(R){const f=c("users"),b=c([]),u=c(!1),p=c("");async function v(){u.value=!0;try{const t=await(await fetch(`/api/v1/users?keyword=${encodeURIComponent(p.value)}`,{headers:{Authorization:`Bearer ${localStorage.getItem("pdg_token")||""}`}})).json();b.value=t.data||[]}catch(n){U.error((n==null?void 0:n.message)||"加载失败")}finally{u.value=!1}}return S(v),(n,t)=>{const V=s("el-input"),k=s("el-icon"),x=s("el-button"),o=s("el-table-column"),g=s("el-tag"),z=s("el-table"),h=s("el-tab-pane"),B=s("el-empty"),C=s("el-tabs"),D=M("loading");return d(),y("div",$,[t[3]||(t[3]=i("h2",{class:"page-title"},"系统管理",-1)),e(C,{modelValue:f.value,"onUpdate:modelValue":t[1]||(t[1]=l=>f.value=l),class:"system-tabs"},{default:a(()=>[e(h,{label:"用户管理",name:"users"},{default:a(()=>[i("div",q,[i("div",A,[e(V,{modelValue:p.value,"onUpdate:modelValue":t[0]||(t[0]=l=>p.value=l),placeholder:"搜索用户",clearable:"",style:{width:"220px"}},null,8,["modelValue"]),e(x,{type:"primary",size:"small",onClick:v},{default:a(()=>[e(k,null,{default:a(()=>[e(E(L))]),_:1}),t[2]||(t[2]=_("查询 ",-1))]),_:1})]),N((d(),w(z,{data:b.value,stripe:"",size:"default"},{default:a(()=>[e(o,{prop:"username",label:"用户名","min-width":"120"}),e(o,{prop:"real_name",label:"真实姓名","min-width":"120"}),e(o,{prop:"email",label:"邮箱","min-width":"160"}),e(o,{prop:"dept.name",label:"部门","min-width":"120"},{default:a(({row:l})=>{var r;return[_(m(((r=l.dept)==null?void 0:r.name)||"--"),1)]}),_:1}),e(o,{prop:"roles",label:"角色","min-width":"180"},{default:a(({row:l})=>[(d(!0),y(j,null,F(l.roles,r=>(d(),w(g,{key:r.id,size:"small",style:{"margin-right":"4px"}},{default:a(()=>[_(m(r.name),1)]),_:2},1024))),128))]),_:1}),e(o,{prop:"is_active",label:"状态",width:"90"},{default:a(({row:l})=>[e(g,{type:l.is_active?"success":"danger",size:"small"},{default:a(()=>[_(m(l.is_active?"正常":"禁用"),1)]),_:2},1032,["type"])]),_:1})]),_:1},8,["data"])),[[D,u.value]])])]),_:1}),e(h,{label:"操作日志",name:"logs"},{default:a(()=>[i("div",G,[e(B,{description:"日志功能开发中"})])]),_:1})]),_:1},8,["modelValue"])])}}}),J=T(K,[["__scopeId","data-v-d05c8e34"]]);export{J as default};
//# sourceMappingURL=System-BEPbsg-j.js.map
