index.BLA12pQQ.js 28 KB

1
  1. import{i as R,L as he}from"./echarts.DTyPNLGI.js";import{a as fe,r as D,aC as ee,_ as we,aH as be,q as ye,$ as De,W as Fe,w as te,t as J,f as C,aj as F,c as h,o as v,S as p,K as m,b as e,J as oe,M as E,F as S,R as Q,a9 as U,Q as u,P as f}from"./vue.YrNK8sx4.js";import{r as T,a4 as Se,a5 as Be,b as Ce,u as Ee,L as ae,S as se,D as Te}from"./index.BqrqjjTL.js";import{G as Ae}from"./api.gSJuu3rk.js";import{_ as Me}from"./_plugin-vue_export-helper.DlAUqK2U.js";const A="/api/system/dashboard/";function ze(){return T({url:A+"overview_stats/",method:"get"})}function Re(s){return T({url:A+"device_rankings/",method:"get",params:s})}function Ve(s){return T({url:A+"device_rankings/",method:"get",params:s})}function ke(){return T({url:A+"utilization_trend/",method:"get"})}function Ye(){return T({url:A+"borrow_trends/?period=year",method:"get"})}function We(){return T({url:A+"active_users/",method:"get"})}let d={homeChartOne:null,homeChartTwo:null,homeCharThree:null,dispose:[null,"",void 0]};const Le=fe({name:"home",components:{FullScreen:Be,Aim:Se},setup(){const s=D(0),t=D(!1),q=()=>{const a=document.querySelector(".home-container");a&&(document.fullscreenElement?document.exitFullscreen().then(()=>{t.value=!1}).catch(n=>{console.error(`退出全屏错误: ${n.message}`)}):a.requestFullscreen().then(()=>{t.value=!0}).catch(n=>{console.error(`全屏错误: ${n.message}`)}))},j=D("all"),M=D(null),_=D(""),H=D(""),V=D([]),z=D(),B=D(),k=D(),N=Ce(),I=Ee(),{themeConfig:b}=ee(I),{isTagsViewCurrenFull:K}=ee(N),o=we({devicedata:{total_devices:0,borrowed_devices:0,available_devices:0,today_borrowed:0,today_returned:0,total_borrows:0},panelSettings:{deviceUtilization:!0,deviceRanking:!0,coreMetrics:!0,borrowTrend:!0,deviceBorrowRanking:!0,activeUsers:!0},settingsDialogVisible:!1,homeOne:[],homeThree:[],myCharts:[],charts:{theme:"",bgColor:"",color:"#303133"},apiData:null,heroData:[],userList:[],teamRankings:[]}),Y=be(),W=()=>{o.settingsDialogVisible=!1},L=()=>{var n,l,i,r;d.dispose.some(c=>c===d.homeChartOne)||d.homeChartOne.dispose(),d.homeChartOne=R(z.value,o.charts.theme);const a={backgroundColor:o.charts.bgColor,title:{text:"申请趋势",x:"left",textStyle:{fontSize:"15",color:o.charts.color}},grid:{top:70,right:20,bottom:30,left:30},tooltip:{trigger:"axis"},legend:{data:["申请数量"],right:0},xAxis:{data:((l=(n=o.apiData)==null?void 0:n.application_trend)==null?void 0:l.map(c=>c.date.substring(5)))||["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"]},yAxis:[{type:"value",name:"数量",splitLine:{show:!0,lineStyle:{type:"dashed",color:"#f5f5f5"}}}],series:[{name:"申请数量",type:"line",symbolSize:6,symbol:"circle",smooth:!0,data:((r=(i=o.apiData)==null?void 0:i.application_trend)==null?void 0:r.map(c=>c.count))||[0,41.1,30.4,65.1,53.3,53.3,53.3,41.1,30.4,65.1,53.3,10],lineStyle:{color:"#fe9a8b"},itemStyle:{color:"#fe9a8b",borderColor:"#fe9a8b"},areaStyle:{color:new he(0,0,0,1,[{offset:0,color:"#fe9a8bb3"},{offset:1,color:"#fe9a8b03"}])}}]};d.homeChartOne.setOption(a),o.myCharts.push(d.homeChartOne)},x=()=>{d.dispose.some(w=>w===d.homeChartTwo)||d.homeChartTwo.dispose(),d.homeChartTwo=R(B.value,o.charts.theme);var a=["申请总数","职位总数","问题总数","报告总数"],n=[];o.apiData?n=[o.apiData.total_applications,o.apiData.total_positions,o.apiData.total_questions,o.apiData.total_reports]:n=[34.2,38.87,17.88,9.05];for(var l=[],i=0;i<a.length;i++)l.push({name:a[i],value:n[i]});const r=["#51A3FC","#36C78B","#FEC279","#968AF5","#E790E8"],c={backgroundColor:o.charts.bgColor,title:{text:"数据统计",x:"left",textStyle:{fontSize:"15",color:o.charts.color}},tooltip:{trigger:"item",formatter:"{b} <br/> {c}%"},graphic:{elements:[{type:"image",z:-1,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CbzFQZhQzZr1yGbM2Jsb2Nti3pMZc0C0GzN2IcKUGJPxwVgComcY/Azp9/+NxuJ6PXi004M0YuSWylDZnbaDYdGFo2u12g5K5WbUWW1nWTTFYgwo6OqIVgEKNpPKE6MGywqJEQJcY4ZPZK1pEK9GXa1Qylk+NEQdlwvtgHpfdPn/ixNifr4QLGYAAAAASUVORK5CYII=",width:230,height:230},left:"16.5%",top:"center"}]},legend:{type:"scroll",orient:"vertical",right:"0%",left:"65%",top:"center",itemWidth:14,itemHeight:14,data:a,textStyle:{rich:{name:{fontSize:14,fontWeight:400,width:200,height:35,padding:[0,0,0,60],color:o.charts.color},rate:{fontSize:15,fontWeight:500,height:35,width:40,padding:[0,0,0,30],color:o.charts.color}}}},series:[{type:"pie",radius:["82",b.value.isIsDark?"50":"102"],center:["32%","50%"],itemStyle:{color:function(w){return r[w.dataIndex]}},label:{show:!1},labelLine:{show:!1},data:l}]};d.homeChartTwo.setOption(c),o.myCharts.push(d.homeChartTwo)},P=()=>{d.dispose.some(n=>n===d.homeCharThree)||d.homeCharThree.dispose(),d.homeCharThree=R(k.value,o.charts.theme);const a={backgroundColor:o.charts.bgColor,title:{text:"设备使用趋势",x:"left",textStyle:{fontSize:"15",color:o.charts.color}},tooltip:{trigger:"axis"},legend:{data:["使用率"],right:0},grid:{top:70,right:80,bottom:30,left:80},xAxis:[{type:"category",data:[],boundaryGap:!0,axisTick:{show:!1}}],yAxis:[{name:"使用率(%)",nameLocation:"middle",nameTextStyle:{padding:[3,4,50,6]},splitLine:{show:!0,lineStyle:{type:"dashed",color:"#f5f5f5"}},axisLine:{show:!1},axisTick:{show:!1},axisLabel:{color:o.charts.color,formatter:"{value}"}}],series:[{name:"使用率",type:"line",smooth:!0,showSymbol:!0,data:[],itemStyle:{color:"#91cc75"}}]};d.homeCharThree.setOption(a),o.myCharts.push(d.homeCharThree)},g=()=>{J(()=>{for(let a=0;a<o.myCharts.length;a++)setTimeout(()=>{o.myCharts[a].resize()},a*1e3)})},y=()=>{window.addEventListener("resize",g)},ne=async()=>{const a=await Ae({page:1,page_size:20});a.code===2e3&&(V.value=a.data)};ye(()=>{le(),y(),me(),ne();const a=localStorage.getItem("dashboardPanelSettings");a&&(o.panelSettings=JSON.parse(a))}),De(()=>{g()}),Fe(()=>{}),te(()=>K.value,()=>{g()}),te(()=>b.value.isIsDark,a=>{J(()=>{o.charts.theme=a?"dark":"",o.charts.bgColor=a?"transparent":"",o.charts.color=a?"#dadada":"#303133",setTimeout(()=>{L()},500),setTimeout(()=>{x()},700),setTimeout(()=>{P()},1e3)})},{deep:!0,immediate:!0});const le=async()=>{var a,n;try{const l=await ze();l.code===2e3&&(o.devicedata=l.data,ce(l.data));const i=ae.get(`borrow_ranking_filters_${se.get("userInfo").username}`),r={type:i.borrowType,start_date:(a=i.dateRange)==null?void 0:a[0],end_date:(n=i.dateRange)==null?void 0:n[1],tag_id:i.deviceTagIds};console.log(i);const c=await Re(r);l.code===2e3&&(o.teamRankings=[...c.data.borrow_count_ranking].sort((X,Z)=>Z.borrow_count-X.borrow_count),o.heroData=[...c.data.borrow_duration_ranking].sort((X,Z)=>Number(Z.total_duration)-Number(X.total_duration)),console.log("state.heroData:::",o.heroData));const w=await ke();w.code===2e3&&(console.log("ulres:::",w),de(w.data.trends));const O=await Ye();O.code===2e3&&re(O.data.trends);const G=await We();G.code===2e3&&(o.userList=G.data.active_users)}catch(l){console.error("获取统计数据失败:",l)}},ie=a=>{const n=Te();a==="day"?M.value=[n.format("YYYY-MM-DD"),n.format("YYYY-MM-DD")]:a==="month"?M.value=[n.startOf("month").format("YYYY-MM-DD"),n.endOf("month").format("YYYY-MM-DD")]:a==="year"&&(M.value=[n.startOf("year").format("YYYY-MM-DD"),n.endOf("year").format("YYYY-MM-DD")]),$()},$=async()=>{var n,l;const a=ae.get(`borrow_ranking_filters_${se.get("userInfo").username}`);try{const i={type:a.borrowType,start_date:(n=a.dateRange.value)==null?void 0:n[0],end_date:(l=a.dateRange.value)==null?void 0:l[1],tag_id:a.deviceTagIds},r=await Ve(i);r.code===2e3&&(o.teamRankings=[...r.data.borrow_count_ranking].sort((c,w)=>w.borrow_count-c.borrow_count))}catch(i){console.error("获取设备排名失败:",i)}},re=a=>{const n=a;console.log("monthlyData:::",n);const l=R(document.getElementById("echart3"));if(!l)return;const i={tooltip:{trigger:"axis",axisPointer:{type:"shadow",shadowStyle:{color:"rgba(0,0,0,0.1)"}}},legend:{data:["借用次数","借用时长"],top:"0",textStyle:{color:"#fff"},itemGap:20},grid:{left:"40",right:"40",top:"20",bottom:"40",containLabel:!0},xAxis:[{type:"category",boundaryGap:!0,axisLabel:{show:!0,textStyle:{color:"rgba(255,255,255,1)",fontSize:11}},axisLine:{lineStyle:{color:"rgba(255,255,255,.1)"}},axisTick:{alignWithLabel:!0},data:n.map(r=>r.date)}],yAxis:[{axisLabel:{show:!0,textStyle:{color:"rgba(255,255,255,.6)"}},axisLine:{lineStyle:{color:"rgba(255,255,255,.1)"}},splitLine:{lineStyle:{color:"rgba(255,255,255,.1)"}}}],series:[{name:"借用次数",type:"bar",barWidth:12,itemStyle:{color:"#409EFF"},barCategoryGap:"30%",data:n.map(r=>r.borrow_count)},{name:"借用时长",type:"bar",barWidth:12,itemStyle:{color:"#67C23A"},barCategoryGap:"30%",data:n.map(r=>r.total_duration)}]};l.setOption(i)},ue=a=>{const n=String(a).match(/^(\d{1,2})-(\d{1,2})至(\d{1,2})-(\d{1,2})$/);if(!n)return a;const[,l,i,r,c]=n;return l===r?`${l}-${i}至${c}`:`${l}-${i}至${r}-${c}`},de=a=>{const n=R(document.getElementById("echart5"));if(!n)return;console.log(a);const l={xAxis:{type:"category",data:a.map(i=>ue(i.date)),axisLabel:{color:"#fff",rotate:20,interval:0,fontSize:12,margin:15},axisTick:{alignWithLabel:!0}},yAxis:{type:"value",axisLabel:{color:"#fff"}},series:[{name:"利用率",type:"line",data:a.map(i=>i.utilization_rate),smooth:!0,itemStyle:{color:"#91cc75"}}],tooltip:{trigger:"axis",axisPointer:{type:"line"}},legend:{data:["月度利用率"],textStyle:{color:"#fff"}},grid:{left:"3%",right:"4%",bottom:"15%",top:"10%",containLabel:!0}};n.setOption(l)},ce=a=>{},pe=a=>{const n=["/JobApplication/list/index","/position/list","/questionBank/list","/JobApplication/list/index"];a>=0&&a<n.length&&Y.push(n[a])},me=()=>{const a=()=>{const n=document.getElementById("showTime");if(!n){console.warn("时间显示元素未找到");return}const l=new Date,i=l.getFullYear(),r=l.getMonth()+1,c=l.getDate(),w=l.getHours(),O=l.getMinutes(),G=l.getSeconds();n.innerHTML=i+"年"+r+"月"+c+"日"+w+"时"+O+"分"+G+"秒"};J(()=>{a(),setInterval(a,1e3)})},ge=C(()=>o.settingsDialogVisible),ve=C(()=>o.panelSettings);return{homeLineRef:z,homePieRef:B,homeBarRef:k,selectedType:j,dateRange:M,labelType:V,deviceTagId:_,quickRange:H,handleCardClick:pe,handleQuickRange:ie,fetchRankings:$,scrollOffset:s,devicedata:C(()=>o.devicedata),heroData:C(()=>o.heroData),userList:C(()=>o.userList),teamRankings:C(()=>o.teamRankings),settingsDialogVisible:ge,panelSettings:ve,isFullscreen:t,toggleFullScreen:q,handleClose:W,openSettings:()=>{o.settingsDialogVisible=!0},saveSettings:()=>{o.settingsDialogVisible=!1,localStorage.setItem("dashboardPanelSettings",JSON.stringify(o.panelSettings))}}}}),xe={class:"home-container"},Pe={class:"lol-container"},Oe={class:"head"},Ge={class:"weather"},He={class:"mainbox"},Ne={class:"clearfix"},Ie={class:"navboxall"},Ke={style:{display:"flex","justify-content":"space-between",width:"100%"}},Xe={class:"clearfix navboxall",style:{height:"100%"}},Ze={class:"data-overview"},Je={class:"data-card total-devices"},Qe={class:"card-content"},Ue={class:"card-value"},qe={class:"data-card borrowed"},je={class:"card-content"},_e={class:"card-value"},$e={class:"data-card available"},et={class:"card-content"},tt={class:"card-value"},ot={class:"data-card today-borrowed"},at={class:"card-content"},st={class:"card-value"},nt={class:"data-card today-returned"},lt={class:"card-content"},it={class:"card-value"},rt={class:"data-card total-borrows"},ut={class:"card-content"},dt={class:"card-value"},ct={class:"navboxall"},pt={style:{display:"flex","justify-content":"space-between",width:"100%"}},mt={class:"navboxall"},gt={style:{display:"flex","justify-content":"space-between",width:"100%"}},vt={class:"panel-settings"},ht={class:"dialog-footer"};function ft(s,t,q,j,M,_){const H=F("FullScreen"),V=F("Aim"),z=F("el-icon"),B=F("el-button"),k=F("Setting"),N=F("el-col"),I=F("el-row"),b=F("el-checkbox"),K=F("el-dialog");return v(),h("div",xe,[p(I,{gutter:15,class:"lol-data-section"},{default:m(()=>[p(N,{span:24},{default:m(()=>{var o,Y,W,L,x,P;return[e("div",Pe,[e("div",Oe,[e("div",Ge,[t[7]||(t[7]=e("span",{id:"showTime",style:{"font-size":"20px"}},null,-1)),p(B,{class:"fullscreen-btn",type:"text",onClick:s.toggleFullScreen},{default:m(()=>[p(z,null,{default:m(()=>[s.isFullscreen?(v(),oe(V,{key:1})):(v(),oe(H,{key:0}))]),_:1})]),_:1},8,["onClick"]),p(B,{class:"fullscreen-btn",type:"text",onClick:s.openSettings},{default:m(()=>[p(z,{size:40},{default:m(()=>[p(k)]),_:1})]),_:1},8,["onClick"])]),t[8]||(t[8]=e("h1",null,"设备运维数据中心",-1))]),e("div",He,[e("ul",Ne,[e("li",null,[s.panelSettings.deviceUtilization?(v(),h("div",{key:0,class:"boxall",style:S({flex:s.panelSettings.deviceRanking?2:3.5})},t[9]||(t[9]=[e("div",{class:"alltitle"},"设备利用率趋势",-1),e("div",{class:"navboxall",id:"echart5",style:{height:"95%"}},null,-1)]),4)):E("",!0),s.panelSettings.deviceRanking?(v(),h("div",{key:1,class:"boxall",style:S({flex:s.panelSettings.deviceUtilization?1.5:3.5,overflow:"hidden"})},[t[11]||(t[11]=e("div",{class:"alltitle"},"单台设备累计借用时长排名",-1)),e("div",Ie,[t[10]||(t[10]=e("div",{class:"wraptit"},[e("span",null,"排名"),e("span",null,"设备名称"),e("span",null,"设备编号"),e("span",null,"借用时长")],-1)),e("div",{class:"wrap",style:S(s.isFullscreen?"height: 85%":"height: 70%")},[e("ul",null,[(v(!0),h(Q,null,U(s.heroData,(g,y)=>(v(),h("li",{key:y,style:{width:"100%",padding:"5px 0","border-bottom":"1px solid #232e63"}},[e("div",Ke,[e("span",null,u(y+1),1),e("span",null,u(g.device_name),1),e("span",null,u(g.device_code),1),e("span",null,u(g.total_duration),1)])]))),128))])],4)])],4)):E("",!0)]),e("li",null,[s.panelSettings.coreMetrics?(v(),h("div",{key:0,class:"boxall",style:S({height:s.panelSettings.borrowTrend?"360px":"700px"})},[t[23]||(t[23]=e("div",{class:"alltitle"},"核心概览指标",-1)),e("div",Xe,[e("div",Ze,[e("div",Je,[e("div",Qe,[t[13]||(t[13]=e("div",{class:"card-title"},"设备总库存数",-1)),e("div",Ue,[f(u(((o=s.devicedata)==null?void 0:o.total_devices)??0),1),t[12]||(t[12]=e("span",{class:"card-unit"},null,-1))])])]),e("div",qe,[e("div",je,[t[15]||(t[15]=e("div",{class:"card-title"},"在借数",-1)),e("div",_e,[f(u(((Y=s.devicedata)==null?void 0:Y.borrowed_devices)??0),1),t[14]||(t[14]=e("span",{class:"card-unit"},null,-1))])])]),e("div",$e,[e("div",et,[t[17]||(t[17]=e("div",{class:"card-title"},"在库数",-1)),e("div",tt,[f(u(((W=s.devicedata)==null?void 0:W.available_devices)??0),1),t[16]||(t[16]=e("span",{class:"card-unit"},null,-1))])])]),e("div",ot,[e("div",at,[t[19]||(t[19]=e("div",{class:"card-title"},"今日归还",-1)),e("div",st,[f(u(((L=s.devicedata)==null?void 0:L.today_returned)??0),1),t[18]||(t[18]=e("span",{class:"card-unit"},null,-1))])])]),e("div",nt,[e("div",lt,[t[20]||(t[20]=e("div",{class:"card-title"},"今日借出",-1)),e("div",it,u(((x=s.devicedata)==null?void 0:x.today_borrowed)??0),1)])]),e("div",rt,[e("div",ut,[t[22]||(t[22]=e("div",{class:"card-title"},"累计借用次数",-1)),e("div",dt,[f(u(((P=s.devicedata)==null?void 0:P.total_borrows)??0),1),t[21]||(t[21]=e("span",{class:"card-unit"},null,-1))])])])])])],4)):E("",!0),s.panelSettings.borrowTrend?(v(),h("div",{key:1,class:"boxall",style:S({height:s.panelSettings.coreMetrics?"340px":"700px"})},t[24]||(t[24]=[e("div",{class:"alltitle"},"整体设备借用次数趋势",-1),e("div",{class:"navboxall",id:"echart3",style:{height:"95%"}},null,-1)]),4)):E("",!0)]),e("li",null,[s.panelSettings.deviceBorrowRanking?(v(),h("div",{key:0,class:"boxall",style:S({height:s.panelSettings.activeUsers?"400px":"670px",overflow:"hidden"})},[t[26]||(t[26]=e("div",{class:"alltitle"},"单台设备累计借用次数排名",-1)),e("div",ct,[t[25]||(t[25]=e("div",{class:"wraptit"},[e("span",null,"排名"),e("span",null,"设备名称"),e("span",null,"设备编号"),e("span",null,"借用次数")],-1)),e("div",{class:"wrap",style:S(s.isFullscreen?"height: 85%":"height: 60%")},[e("ul",null,[(v(!0),h(Q,null,U(s.teamRankings,(g,y)=>(v(),h("li",{key:y,style:{width:"100%",padding:"5px 0","border-bottom":"1px solid #232e63"}},[e("div",pt,[e("span",null,u(y+1),1),e("span",null,u(g.device_name),1),e("span",null,u(g.device_code),1),e("span",null,u(g.borrow_count),1)])]))),128))])],4)])],4)):E("",!0),s.panelSettings.activeUsers?(v(),h("div",{key:1,class:"boxall",style:S({height:s.panelSettings.deviceBorrowRanking?"310px":"670px",overflow:"hidden"})},[t[28]||(t[28]=e("div",{class:"alltitle"},"活跃用户排名",-1)),e("div",mt,[t[27]||(t[27]=e("div",{class:"wraptit"},[e("span",null,"排名"),e("span",null,"用户名"),e("span",null,"学号/工号"),e("span",null,"总借用次数")],-1)),e("div",{class:"wrap",style:S(s.isFullscreen?"height: 85%":"height: 60%")},[e("ul",null,[(v(!0),h(Q,null,U(s.userList,(g,y)=>(v(),h("li",{key:y,style:{width:"100%",padding:"5px 0","border-bottom":"1px solid #232e63"}},[e("div",gt,[e("span",null,u(y+1),1),e("span",null,u(g.user_name),1),e("span",null,u(g.user_code),1),e("span",null,u(g.borrow_count),1)])]))),128))])],4)])],4)):E("",!0)])])])])]}),_:1})]),_:1}),p(K,{modelValue:s.settingsDialogVisible,"onUpdate:modelValue":t[6]||(t[6]=o=>s.settingsDialogVisible=o),title:"面板设置",width:"500px","close-on-click-modal":!1,"destroy-on-close":"","before-close":s.handleClose},{footer:m(()=>[e("span",ht,[p(B,{onClick:s.handleClose},{default:m(()=>t[35]||(t[35]=[f("取消")])),_:1},8,["onClick"]),p(B,{type:"primary",onClick:s.saveSettings},{default:m(()=>t[36]||(t[36]=[f("确定")])),_:1},8,["onClick"])])]),default:m(()=>[e("div",vt,[p(b,{modelValue:s.panelSettings.deviceUtilization,"onUpdate:modelValue":t[0]||(t[0]=o=>s.panelSettings.deviceUtilization=o)},{default:m(()=>t[29]||(t[29]=[f("设备利用率趋势")])),_:1},8,["modelValue"]),p(b,{modelValue:s.panelSettings.deviceRanking,"onUpdate:modelValue":t[1]||(t[1]=o=>s.panelSettings.deviceRanking=o)},{default:m(()=>t[30]||(t[30]=[f("单台设备累计借用时长排名")])),_:1},8,["modelValue"]),p(b,{modelValue:s.panelSettings.coreMetrics,"onUpdate:modelValue":t[2]||(t[2]=o=>s.panelSettings.coreMetrics=o)},{default:m(()=>t[31]||(t[31]=[f("核心概览指标")])),_:1},8,["modelValue"]),p(b,{modelValue:s.panelSettings.borrowTrend,"onUpdate:modelValue":t[3]||(t[3]=o=>s.panelSettings.borrowTrend=o)},{default:m(()=>t[32]||(t[32]=[f("整体设备借用次数趋势")])),_:1},8,["modelValue"]),p(b,{modelValue:s.panelSettings.deviceBorrowRanking,"onUpdate:modelValue":t[4]||(t[4]=o=>s.panelSettings.deviceBorrowRanking=o)},{default:m(()=>t[33]||(t[33]=[f("单台设备累计借用次数排名")])),_:1},8,["modelValue"]),p(b,{modelValue:s.panelSettings.activeUsers,"onUpdate:modelValue":t[5]||(t[5]=o=>s.panelSettings.activeUsers=o)},{default:m(()=>t[34]||(t[34]=[f("活跃用户")])),_:1},8,["modelValue"])])]),_:1},8,["modelValue","before-close"])])}const St=Me(Le,[["render",ft],["__scopeId","data-v-7cebc501"]]);export{St as default};