| 1 |
- import{ar as e,d as a,aY as l,a7 as t,y as s,a2 as o,b2 as c,b3 as i,c as r,b4 as n,an as p,s as u,Z as d,_,D as k,x as m,b5 as w,g as v,aK as h,a as f,i as g,a1 as y,O as b,k as j,m as x,aH as z,aI as C,q,P as S}from"./element-plus.DUy1TWHM.js";import{M as L,aU as T,aD as I,aI as P,aL as $,u as H,v as U,I as D,bJ as B,s as A,bk as K,bb as N,H as R,F as E,aX as F,bM as M,bO as J,au as O,a$ as Q,aw as W,t as G,bL as Y,q as V}from"./@vue.DbmRtknU.js";import{t as X,ag as Z,al as ee,U as ae,am as le,a9 as te,ai as se,n as oe,B as ce,an as ie,Y as re,ae as ne,_ as pe}from"./index.B1CvNv-2.js";import{u as ue}from"./vue-i18n.DXLOBfKS.js";import{a as de}from"./vue-router.yxIMtaxH.js";import"./lodash-es.DaM9m3L-.js";import"./async-validator.j0i5Y79Y.js";import"./@popperjs.DxtSUbXb.js";import"./@ctrl.BEgk5vdO.js";import"./dayjs.DCWbrgJ0.js";import"./memoize-one.BAtLgO95.js";import"./normalize-wheel-es.TzhA1irr.js";import"./@floating-ui.8vigAAFV.js";import"./pinia.BlfmsheH.js";import"./@vueuse.Dnsd2JKX.js";import"./nprogress.BTjJXJ-u.js";import"./codemirror.CYSLATvI.js";import"./diff-match-patch.DkK4wJpa.js";import"./vue-web-terminal.D-rog7dz.js";import"./vue.MGxsMDTR.js";/* empty css */import"./axios.Da-QW0H8.js";import"./qs.BQjOrGHM.js";import"./side-channel.4q28KFJj.js";import"./es-errors.DTEWvbA_.js";import"./object-inspect.DvQZIv3_.js";import"./side-channel-list.Do0-XmF5.js";import"./side-channel-map.DNHQ53lO.js";import"./get-intrinsic.Bbe5x-9b.js";import"./es-object-atoms.CyiuHMUS.js";import"./math-intrinsics.pM-JTNwN.js";import"./gopd.BudZp56J.js";import"./es-define-property.F0aoeP8o.js";import"./has-symbols.BcO-SUVM.js";import"./get-proto.Cb_fpw-j.js";import"./dunder-proto.WEH3rgQR.js";import"./call-bind-apply-helpers.DJjIjCF_.js";import"./function-bind.DrnB-baK.js";import"./hasown.BXcyoiLU.js";import"./call-bound.22gFUC2Q.js";import"./side-channel-weakmap.DpSeWE6i.js";import"./pinia-plugin-persistedstate.COWkwNh5.js";import"./@intlify.DPMNdUn_.js";const _e=[{key:"system",title:"系统管理",subtitle:"用户、角色、菜单、部门、字典、岗位、参数、公告、日志等",matchHints:["module_system/"]},{key:"monitor",title:"监控运维",subtitle:"服务监控、缓存、在线用户、资源占用等",matchHints:["module_monitor/"]},{key:"task",title:"任务与流程",subtitle:"定时任务、执行节点、工作流等",matchHints:["module_task/"]},{key:"ai",title:"AI 助手",subtitle:"对话、记忆管理等",matchHints:["module_ai/"]},{key:"app",title:"应用与生成",subtitle:"应用管理、代码生成、示例演示等",matchHints:["module_application/","module_generator/","module_example/"]},{key:"docs",title:"文档中心",subtitle:"Swagger / Redoc / 本地文档等",matchHints:["module_common/"]}];function ke(e){return e.replace(/\\/g,"/")}function me(e,a){for(const l of a){const a=e.find(e=>e.component_path&&ke(e.component_path).includes(l));if(a)return a.path}}function we(e,a){for(const l of a){const a=e.find(e=>e.component_path&&ke(e.component_path).includes(l));if(a)return a.title}}const ve={class:"app-container workplace-page"},he={class:"workplace-hero"},fe={class:"flex flex-wrap items-center gap-4 min-w-0 flex-1"},ge={class:"flex items-center md:mb-0"},ye={class:"workplace-hero__avatar-wrap"},be={class:"workplace-hero__greeting"},je={class:"workplace-hero__actions"},xe={class:"workplace-hero__login"},ze={class:"workplace-hero__login-time"},Ce={class:"workplace-module-grid"},qe=["tabindex","onClick","onKeydown"],Se={class:"workplace-module-card__icon"},Le={class:"workplace-module-card__body"},Te={class:"workplace-module-card__name"},Ie={class:"workplace-module-card__desc"},Pe={key:0,class:"workplace-module-card__hint"},$e={key:1,class:"workplace-module-card__hint workplace-module-card__hint--muted"},He={class:"workplace-bookmarks-card__header"},Ue={class:"workplace-panel-title workplace-bookmarks-card__title-line"},De={class:"workplace-section-sub workplace-section-sub--inline"},Be={class:"workplace-bookmarks-card__header-actions"},Ae={class:"workplace-module-bookmarks"},Ke={key:0,class:"workplace-quick-list workplace-quick-list--hub"},Ne=["onClick","onKeydown"],Re={key:2,class:"i-svg:menu"},Ee={class:"workplace-quick-row__text"},Fe={class:"workplace-quick-row__title"},Me={class:"workplace-quick-row__actions"},Je=["disabled","title","aria-label","onClick"],Oe={class:"mt-4 workplace-ops-stack"},Qe={class:"workplace-snapshot-grid"},We={class:"workplace-stat-tile"},Ge={class:"workplace-stat-tile__value"},Ye={class:"workplace-stat-tile"},Ve={class:"workplace-stat-tile__value"},Xe={class:"workplace-stat-tile"},Ze={class:"workplace-stat-tile__value workplace-stat-tile__value--sm"},ea={class:"workplace-stat-tile"},aa={class:"workplace-stat-tile__value"},la={class:"workplace-stat-tile__hint"},ta={class:"workplace-stat-tile"},sa={class:"workplace-stat-tile__value workplace-stat-tile__value--sm"},oa={key:0,class:"workplace-snapshot-card__foot"},ca={class:"workplace-section-card__head"},ia={class:"workplace-ops-card__body"},ra={key:1,class:"workplace-running-list workplace-running-list--in-grid"},na={class:"workplace-running-list__main"},pa={class:"workplace-running-list__name"},ua={class:"workplace-running-list__meta"},da={key:0},_a={key:1,class:"workplace-running-list__trigger"},ka={class:"workplace-section-card__head"},ma={class:"workplace-section-sub workplace-section-sub--inline"},wa={class:"workplace-section-card__actions"},va={class:"workplace-ops-card__body workplace-ops-card__body--logs"},ha={key:1,class:"workplace-logs-scroll"},fa={class:"workplace-section-card__head"},ga={class:"workplace-ops-card__body workplace-ops-card__body--notices"},ya={class:"workplace-notice-card"},ba={class:"workplace-notice-card__head"},ja={class:"workplace-notice-card__titles"},xa={class:"workplace-notice-card__title"},za={class:"workplace-notice-card__time"},Ca={class:"workplace-notice-card__content"},qa={class:"workplace-notice-card__foot"},Sa={class:"workplace-notice-card__author"},La=pe(L({name:"Workplace",inheritAttrs:!1,__name:"workplace",setup(L){const pe=X(),ke=Z(),{t:La}=ue(),Ta=de(),Ia=T([]),Pa=T([]),$a=T(!1),Ha=T(!1),Ua=T([]),Da=T(!1),Ba=V(()=>Ha.value||Pa.value.length<=10?Pa.value:Pa.value.slice(0,10)),Aa=T({userTotal:null,onlineTotal:null,cpuUsed:null,memUsage:null,jobCount:null,schedulerStatus:"",schedulerRunning:!1,chatSessions:null,appCount:null});function Ka(e){return null!=e&&Number.isFinite(e)?String(e):"—"}function Na(e){return null!=e&&Number.isFinite(e)?`${Number(e).toFixed(1)}%`:"—"}const Ra={system:u,monitor:p,task:n,ai:r,app:i,docs:c},Ea=V(()=>function(e){const a=new Set,l=[],t=e=>{var s;for(const o of e)if(!o.hidden)if(null==(s=o.children)?void 0:s.length)t(o.children);else if(o.title&&o.route_path){const e=o.route_path.trim(),t=e.startsWith("/")?e:`/${e}`;if(a.has(t))continue;a.add(t),l.push({title:o.title,path:t,icon:o.icon,component_path:o.component_path,order:o.order})}};return t(e),l.sort((e,a)=>(e.order??0)-(a.order??0)),l}(pe.routeList)),Fa=V(()=>{const e=Ea.value;return _e.map(a=>({...a,entryPath:me(e,a.matchHints),entryLabel:we(e,a.matchHints)}))});function Ma(e){e?function(e){if(!e)return;Ta.push(e).catch(()=>{q.warning("无法打开该页面,请检查路由配置")})}(e):q.info("当前账号在该模块暂无可用入口,请联系管理员分配权限")}const Ja=V(()=>Ia.value.slice(0,5));const Oa=T(ee.getQuickLinks()),Qa=e=>{if(!e)return"";const a=new Date(e),l=(new Date).getTime()-a.getTime(),t=Math.floor(l/6e4),s=Math.floor(l/36e5),o=Math.floor(l/864e5);return t<1?"刚刚":t<60?`${t}分钟前`:s<24?`${s}小时前`:o<7?`${o}天前`:a.toLocaleDateString()},Wa=()=>{Ta.push({name:"Notice"}).catch(()=>{q.warning("公告通知跳转失败,请检查路由配置")})};const Ga=e=>{switch(e){case"1":default:return"通知";case"2":return"公告"}},Ya=e=>{switch(e){case"1":default:return"primary";case"2":return"success"}},Va=e=>{e.href?Ta.push(e.href).catch(()=>{q.warning(`路由 ${e.href} 不存在,请检查配置`)}):q.info(`${e.title} 功能待开发`)},Xa=["#4080ff","#23c343","#ff9a2e","#f76560","#a9aeb8","#00b42a"];function Za(e){return Xa[e%Xa.length]}function el(e){const a=Oa.value.findIndex(a=>null!=a.id&&""!==a.id?a.id===e.id:a.href===e.href);return a>=0?a:0}const al=e=>{Oa.value=e};I(()=>{(async()=>{try{const e=await ne.listNotice({page_no:1,page_size:5,status:"0"});0===e.data.code&&(Ia.value=e.data.data.items)}catch(e){}})(),async function(){var e,a,l,t,s,o;tl.value=!0;try{const[c,i,r,n,p,u]=await Promise.allSettled([ae.listUser({page_no:1,page_size:1}),le.listOnline({page_no:1,page_size:1}),te.getServer(),se.getSchedulerStatus(),oe.getSessionList({page_no:1,page_size:1}),ce.listApp({page_no:1,page_size:1})]),d=Aa.value;if(d.userTotal="fulfilled"===c.status&&0===c.value.data.code?(null==(e=c.value.data.data)?void 0:e.total)??null:null,d.onlineTotal="fulfilled"===i.status&&0===i.value.data.code?(null==(a=i.value.data.data)?void 0:a.total)??null:null,"fulfilled"===r.status&&0===r.value.data.code){const e=r.value.data.data;d.cpuUsed=(null==(l=e.cpu)?void 0:l.used)??null,d.memUsage=(null==(t=e.mem)?void 0:t.usage)??null}else d.cpuUsed=null,d.memUsage=null;if("fulfilled"===n.status&&0===n.value.data.code){const e=n.value.data.data;d.jobCount=(null==e?void 0:e.job_count)??null,d.schedulerStatus=(null==e?void 0:e.status)??"",d.schedulerRunning=!!(null==e?void 0:e.is_running)}else d.jobCount=null,d.schedulerStatus="",d.schedulerRunning=!1;d.chatSessions="fulfilled"===p.status&&0===p.value.data.code?(null==(s=p.value.data.data)?void 0:s.total)??null:null,d.appCount="fulfilled"===u.status&&0===u.value.data.code?(null==(o=u.value.data.data)?void 0:o.total)??null:null,sl.value=Date.now()}catch(c){}finally{tl.value=!1}}(),async function(){var e;$a.value=!0;try{const a=await re.listLog({page_no:1,page_size:50});0===a.data.code&&(Pa.value=(null==(e=a.data.data)?void 0:e.items)??[])}catch(a){}finally{$a.value=!1}}(),async function(){Da.value=!0;try{const e=await se.getSchedulerJobs();if(0===e.data.code){const a=e.data.data??[];Ua.value=a.filter(e=>"运行中"===e.status).slice(0,10)}}catch(e){}finally{Da.value=!1}}(),ee.addListener(al)}),P(()=>{ee.removeListener(al)});const ll={avatar:pe.basicInfo.avatar||"https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png",name:pe.basicInfo.name||"吴彦祖",username:pe.basicInfo.username||"账号信息",description:pe.basicInfo.description||"用户说明",dept_name:pe.basicInfo.dept_name||"软件专业部",last_login:pe.basicInfo.last_login||"2023-01-01 00:00:00"},tl=T(!1),sl=T(null);return(c,i)=>{const r=e,n=a,p=t,u=s,L=o,T=v,I=_,P=f,V=m,X=y,Z=x,ae=j,le=C,te=z,se=b;return $(),H("div",ve,[U("div",null,[D(u,{shadow:"hover",class:"workplace-hero-card workplace-surface"},{default:B(()=>[U("div",he,[U("div",fe,[U("div",ge,[U("div",ye,[ll.avatar?($(),A(r,{key:0,size:"large",src:ll.avatar,class:"workplace-hero__avatar"},null,8,["src"])):($(),A(n,{key:1,size:40,class:"text-secondary workplace-hero__avatar-fallback"},{default:B(()=>[D(K(l))]),_:1}))]),U("div",null,[U("div",be,N(K(ke))+N(ll.name)+","+N("祝你开心每一天!"),1),D(p,{class:"workplace-hero__meta"},{default:B(()=>[R(N(ll.username)+" · "+N(ll.dept_name)+" · "+N(ll.description),1)]),_:1})])])]),U("div",je,[U("div",xe,[i[6]||(i[6]=U("div",{class:"workplace-hero__login-label"},"最近登录",-1)),U("div",ze,N(ll.last_login),1)])])])]),_:1}),D(X,{gutter:16,class:"mt-4 workplace-module-row"},{default:B(()=>[D(L,{xs:24,lg:16},{default:B(()=>[D(u,{class:"workplace-modules-card workplace-surface",shadow:"hover"},{header:B(()=>[...i[7]||(i[7]=[U("div",null,[U("span",{class:"workplace-panel-title"},"模块入口"),U("p",{class:"workplace-section-sub workplace-section-sub--inline"}," 按业务域进入;灰色表示暂无该域权限(完整列表见左侧导航) ")],-1)])]),default:B(()=>[U("div",Ce,[($(!0),H(E,null,F(Fa.value,e=>($(),H("div",{key:e.key,class:O(["workplace-module-card",{"is-disabled":!e.entryPath}]),role:"button",tabindex:e.entryPath?0:-1,onClick:a=>Ma(e.entryPath),onKeydown:[M(J(a=>Ma(e.entryPath),["prevent"]),["enter"]),M(J(a=>Ma(e.entryPath),["prevent"]),["space"])]},[U("div",Se,[D(n,{size:26},{default:B(()=>[($(),A(Q(Ra[e.key])))]),_:2},1024)]),U("div",Le,[U("span",Te,N(e.title),1),U("span",Ie,N(e.subtitle),1),e.entryPath?($(),H("span",Pe," 将进入:"+N(e.entryLabel||"—"),1)):($(),H("span",$e," 暂无该域权限 "))]),D(n,{class:"workplace-module-card__arrow",size:16},{default:B(()=>[D(K(d))]),_:1})],42,qe))),128))])]),_:1})]),_:1}),D(L,{xs:24,lg:8,class:"workplace-bookmarks-col"},{default:B(()=>[D(u,{class:"workplace-bookmarks-card workplace-surface",shadow:"hover"},{header:B(()=>[U("div",He,[U("div",null,[U("span",Ue,[D(n,{class:"workplace-bookmarks-card__star",size:18},{default:B(()=>[D(K(w))]),_:1}),i[8]||(i[8]=R(" 我的收藏 ",-1)),Oa.value.length>0?($(),A(T,{key:0,type:"info",size:"small",effect:"plain",round:"",class:"workplace-bookmarks-card__count"},{default:B(()=>[R(N(Oa.value.length)+"/"+N(K(ie)),1)]),_:1})):G("",!0)]),U("p",De," 最多 "+N(K(ie))+" 个 · 标签栏星标添加 · 仅本机 ",1)]),U("div",Be,[D(I,{content:"在顶部标签栏左侧星标上点击,可加入或取消收藏",placement:"top"},{default:B(()=>[D(n,{class:"workplace-module-bookmarks__help",size:15},{default:B(()=>[D(K(h))]),_:1})]),_:1}),D(P,{size:"small",type:"danger",plain:"",onClick:i[0]||(i[0]=e=>{S.confirm("确定要清空收藏吗?","清空收藏确认",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{ee.clearQuickLinks(),q.success("已清空收藏")}).catch(()=>{})})},{default:B(()=>[D(n,null,{default:B(()=>[D(K(g))]),_:1}),R(" "+N(K(La)("common.clear")),1)]),_:1})])])]),default:B(()=>[U("div",Ae,[Oa.value.length>0?($(),H("div",Ke,[($(!0),H(E,null,F(Oa.value,(e,a)=>($(),A(I,{key:e.id||`${e.href}-${a}`,placement:"top","show-after":400,content:e.title},{default:B(()=>[U("div",{class:"workplace-quick-row workplace-quick-row--compact workplace-quick-row--chip",role:"button",tabindex:"0",onClick:a=>Va(e),onKeydown:[M(J(a=>Va(e),["prevent"]),["enter"]),M(J(a=>Va(e),["prevent"]),["space"])]},[U("span",{class:"workplace-quick-row__accent",style:W({backgroundColor:Za(el(e))})},null,4),U("div",{class:"workplace-quick-row__icon",style:W({color:Za(el(e))})},[e.icon&&e.icon.startsWith("el-icon")?($(),A(n,{key:0},{default:B(()=>[($(),A(Q(e.icon.replace("el-icon-",""))))]),_:2},1024)):e.icon?($(),H("div",{key:1,class:O(`i-svg:${e.icon}`)},null,2)):($(),H("div",Re))],4),U("div",Ee,[U("span",Fe,N(e.title),1)]),U("div",Me,[U("button",{type:"button",class:"workplace-quick-row__remove",disabled:!e.id&&!e.href,title:e.id||e.href?"移除收藏":"无法移除(缺少路径)","aria-label":`移除收藏 ${e.title}`,onClick:J(a=>(e=>{S.confirm(`确定要取消收藏"${e.title}"吗?`,"取消收藏确认",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{if(e.id)ee.removeQuickLink(e.id);else{if(!e.href)return void q.warning("无法移除:缺少标识");ee.removeQuickLinkByHref(e.href)}q.success(`已取消收藏:${e.title}`)}).catch(()=>{})})(e),["stop"])},[D(n,null,{default:B(()=>[D(K(k))]),_:1})],8,Je)])],40,Ne)]),_:2},1032,["content"]))),128))])):($(),A(V,{key:1,"image-size":48,class:"workplace-module-bookmarks__empty"},{description:B(()=>[...i[9]||(i[9]=[U("p",{class:"workplace-quick-empty__title"},"暂无收藏",-1),U("p",{class:"workplace-quick-empty__hint"},[R(" 在顶部 "),U("strong",null,"标签栏"),R(" 左侧星标点击添加 ")],-1)])]),_:1}))])]),_:1})]),_:1})]),_:1})]),U("div",Oe,[D(X,{gutter:16,class:"workplace-ops-row workplace-ops-row--pair"},{default:B(()=>[D(L,{xs:24,md:12,class:"workplace-ops-col"},{default:B(()=>[Y(($(),A(u,{shadow:"hover",class:"workplace-snapshot-card workplace-surface workplace-ops-card"},{header:B(()=>[...i[10]||(i[10]=[U("div",{class:"workplace-snapshot-card__head"},[U("div",null,[U("span",{class:"workplace-panel-title"},"运行快照"),U("p",{class:"workplace-section-sub workplace-section-sub--inline"}," 关键指标一览;可进菜单看全量 ")])],-1)])]),default:B(()=>{return[U("div",Qe,[U("div",We,[i[11]||(i[11]=U("div",{class:"workplace-stat-tile__label"},"系统用户",-1)),U("div",Ge,N(Ka(Aa.value.userTotal)),1),i[12]||(i[12]=U("div",{class:"workplace-stat-tile__hint"},"账号总数",-1))]),U("div",Ye,[i[13]||(i[13]=U("div",{class:"workplace-stat-tile__label"},"当前在线",-1)),U("div",Ve,N(Ka(Aa.value.onlineTotal)),1),i[14]||(i[14]=U("div",{class:"workplace-stat-tile__hint"},"会话在线",-1))]),U("div",Xe,[i[15]||(i[15]=U("div",{class:"workplace-stat-tile__label"},"本机负载",-1)),U("div",Ze," CPU "+N(Na(Aa.value.cpuUsed))+" · 内存 "+N(Na(Aa.value.memUsage)),1),i[16]||(i[16]=U("div",{class:"workplace-stat-tile__hint"},"监控服务所在机器",-1))]),U("div",ea,[i[17]||(i[17]=U("div",{class:"workplace-stat-tile__label"},"调度任务",-1)),U("div",aa,N(Ka(Aa.value.jobCount)),1),U("div",la,[R(N(Aa.value.schedulerStatus||"—")+" ",1),Aa.value.schedulerRunning?($(),H(E,{key:0},[R("· 引擎运行中")],64)):G("",!0)])]),U("div",ta,[i[18]||(i[18]=U("div",{class:"workplace-stat-tile__label"},"AI 与应用",-1)),U("div",sa," 会话 "+N(Ka(Aa.value.chatSessions))+" · 应用 "+N(Ka(Aa.value.appCount)),1),i[19]||(i[19]=U("div",{class:"workplace-stat-tile__hint"},"对话列表与应用数量",-1))])]),sl.value?($(),H("div",oa,[i[20]||(i[20]=U("span",{class:"workplace-snapshot-card__foot-dot","aria-hidden":"true"},null,-1)),R(" 更新于 "+N((e=sl.value,new Date(e).toLocaleString())),1)])):G("",!0)];var e}),_:1})),[[se,tl.value]])]),_:1}),D(L,{xs:24,md:12,class:"workplace-ops-col"},{default:B(()=>[D(u,{shadow:"hover",class:"workplace-section-card workplace-surface workplace-ops-card"},{header:B(()=>[U("div",ca,[i[22]||(i[22]=U("div",null,[U("span",{class:"workplace-panel-title"},"运行中的任务"),U("p",{class:"workplace-section-sub workplace-section-sub--inline"}," 调度器 · 最多 10 条 ")],-1)),D(P,{type:"primary",link:"",onClick:i[1]||(i[1]=e=>{Ta.push({name:"Job"}).catch(()=>{q.warning("任务管理页跳转失败,请检查路由配置")})})},{default:B(()=>[...i[21]||(i[21]=[R("任务管理",-1)])]),_:1})])]),default:B(()=>[Y(($(),H("div",ia,[Da.value||0!==Ua.value.length?($(),H("ul",ra,[($(!0),H(E,null,F(Ua.value,e=>($(),H("li",{key:e.id,class:"workplace-running-list__item"},[U("div",na,[U("span",pa,N(e.name),1),D(T,{type:"success",size:"small"},{default:B(()=>[...i[23]||(i[23]=[R("运行中",-1)])]),_:1})]),U("div",ua,[e.next_run_time?($(),H("span",da,"下次:"+N(e.next_run_time),1)):G("",!0),e.trigger?($(),H("span",_a,N(e.trigger),1)):G("",!0)])]))),128))])):($(),A(V,{key:0,"image-size":64,description:"暂无运行中的任务"}))])),[[se,Da.value]])]),_:1})]),_:1})]),_:1}),D(X,{gutter:16,class:"workplace-ops-row workplace-ops-row--pair"},{default:B(()=>[D(L,{xs:24,md:12,class:"workplace-ops-col"},{default:B(()=>[D(u,{shadow:"hover",class:"workplace-section-card workplace-surface workplace-ops-card"},{header:B(()=>[U("div",ka,[U("div",null,[i[24]||(i[24]=U("span",{class:"workplace-panel-title"},"系统日志",-1)),U("p",ma," 已加载 "+N(Pa.value.length)+" 条 · 默认 10 条 ",1)]),U("div",wa,[Pa.value.length>10?($(),A(P,{key:0,type:"primary",link:"",onClick:i[2]||(i[2]=e=>Ha.value=!Ha.value)},{default:B(()=>[R(N(Ha.value?"收起":"展开全部"),1)]),_:1})):G("",!0),D(P,{type:"primary",link:"",onClick:i[3]||(i[3]=e=>{Ta.push({name:"Log"}).catch(()=>{q.warning("日志管理页跳转失败,请检查路由配置")})})},{default:B(()=>[...i[25]||(i[25]=[R("日志管理",-1)])]),_:1})])])]),default:B(()=>[Y(($(),H("div",va,[$a.value||0!==Pa.value.length?($(),H("div",ha,[D(ae,{data:Ba.value,class:"workplace-logs-table",size:"small",stripe:"","max-height":Ha.value?360:220},{default:B(()=>[D(Z,{label:"类型",width:"72",align:"center"},{default:B(({row:e})=>[D(T,{type:1===e.type?"success":"primary",size:"small"},{default:B(()=>[R(N(1===e.type?"登录":"操作"),1)]),_:2},1032,["type"])]),_:1}),D(Z,{label:"路径",prop:"request_path","min-width":"120","show-overflow-tooltip":""}),D(Z,{label:"方法",width:"72",align:"center"},{default:B(({row:e})=>{return[D(T,{type:(a=e.request_method,void 0===a||"GET"===a?"info":"POST"===a?"success":"PUT"===a||"PATCH"===a?"warning":"DELETE"===a?"danger":"info"),size:"small"},{default:B(()=>[R(N(e.request_method||"—"),1)]),_:2},1032,["type"])];var a}),_:1}),D(Z,{label:"状态",width:"64",align:"center"},{default:B(({row:e})=>{return[D(T,{type:(a=e.response_code,void 0===a?"info":a>=200&&a<300?"success":a>=300&&a<400?"warning":"danger"),size:"small"},{default:B(()=>[R(N(e.response_code??"—"),1)]),_:2},1032,["type"])];var a}),_:1}),D(Z,{label:"IP",prop:"request_ip","min-width":"100","show-overflow-tooltip":""}),D(Z,{label:"时间",prop:"created_time","min-width":"136","show-overflow-tooltip":""})]),_:1},8,["data","max-height"])])):($(),A(V,{key:0,"image-size":72,description:"暂无日志"}))])),[[se,$a.value]])]),_:1})]),_:1}),D(L,{xs:24,md:12,class:"workplace-ops-col"},{default:B(()=>[D(u,{shadow:"hover",class:"workplace-section-card workplace-surface workplace-ops-card"},{header:B(()=>[U("div",fa,[i[27]||(i[27]=U("div",null,[U("span",{class:"workplace-panel-title"},"最新消息"),U("p",{class:"workplace-section-sub workplace-section-sub--inline"}," 公告与通知 · 最近 5 条 ")],-1)),D(P,{type:"primary",link:"",onClick:i[4]||(i[4]=e=>Wa())},{default:B(()=>[...i[26]||(i[26]=[R("公告管理",-1)])]),_:1})])]),default:B(()=>[U("div",ga,[0===Ia.value.length?($(),A(V,{key:0,"image-size":80,description:"暂无数据"})):($(),A(te,{key:1,class:"workplace-notice-timeline"},{default:B(()=>[($(!0),H(E,null,F(Ja.value,(e,a)=>($(),A(le,{key:e.id,type:0===a?"primary":"info"},{default:B(()=>{var a;return[U("div",ya,[U("div",ba,[U("div",ja,[U("span",xa,N(e.notice_title),1),D(T,{size:"small",type:Ya(e.notice_type)},{default:B(()=>[R(N(Ga(e.notice_type)),1)]),_:2},1032,["type"])]),U("span",za,N(Qa(e.created_time)),1)]),U("div",Ca,N(e.notice_content),1),U("div",qa,[U("span",Sa,N(null==(a=e.created_by)?void 0:a.name)+" 发布 ",1),D(I,{placement:"top",content:e.description||e.notice_content},{default:B(()=>[D(P,{target:"_blank",type:"primary",link:"",onClick:i[5]||(i[5]=e=>Wa())},{default:B(()=>[...i[28]||(i[28]=[R(" 详情↗ ",-1)])]),_:1})]),_:1},8,["content"])])])]}),_:2},1032,["type"]))),128))]),_:1}))])]),_:1})]),_:1})]),_:1})])])}}}),[["__scopeId","data-v-009557f0"]]);export{La as default};
|