import{a as g,r as s,q as u,aC as l,$ as b,w as m,t as p,aj as _,c as k,o as x,S as t,K as a}from"./vue.D1BjjNmv.js";import{S as f,b as R,u as S}from"./index.Df8UJ10K.js";import{d as B,e as z}from"./api.JeMNPeN4.js";import D from"./StatusCards.uL9fU-Qz.js";import E from"./InfoCards.TufYwFir.js";import I from"./BorrowTrendsChart.CLBj6A0r.js";import L from"./BorrowRankingList.DXCZANtg.js";import{_ as V}from"./_plugin-vue_export-helper.DlAUqK2U.js";import"./index.D6H9PPaW.js";import"./echarts.Bm4fHez2.js";import"./api.Bh9dYQll.js";const A={class:"home-container"},F=g({name:"screenconsole"}),j=g({...F,setup(q){const o=s({pending_approval:0,pending_return:0,pending_overdue:0,pending_maintenance:0,pending_restock:0,pending_warehousing:0,pending_inventory_check:0}),c=s({total_devices:0,borrowed_devices:0,available_devices:0,today_borrowed:0,today_returned:0,total_borrows:0,total_borrowers:0});u(async()=>{try{if(console.log(f.get("userInfo")),f.get("userInfo").username=="平台管理员")return;const e=await B();e.code===2e3&&(o.value.pending_approval=e.data.pending_approval,o.value.pending_return=e.data.borrowed,o.value.pending_maintenance=e.data.pending_repair,o.value.pending_overdue=e.data.overdue);const i=await z();i.code===2e3&&(c.value=i.data)}catch(e){console.error("获取数据失败:",e)}}),s(),s(),s();const h=R(),v=S(),{themeConfig:w}=l(v),{isTagsViewCurrenFull:C}=l(h),n=()=>{p(()=>{for(let e=0;e<state.myCharts.length;e++)setTimeout(()=>{state.myCharts[e].resize()},e*1e3)})},T=()=>{window.addEventListener("resize",n)};u(()=>{y(),T()}),b(()=>{n()}),m(()=>C.value,()=>{n()}),m(()=>w.value.isIsDark,e=>{p(()=>{state.charts.theme=e?"dark":"",state.charts.bgColor=e?"transparent":"",state.charts.color=e?"#dadada":"#303133",setTimeout(()=>{initLineChart()},500),setTimeout(()=>{initPieChart()},700),setTimeout(()=>{initBarChart()},1e3)})},{deep:!0,immediate:!0});const y=async()=>{};return(e,i)=>{const r=_("el-col"),d=_("el-row");return x(),k("div",A,[t(d,{gutter:15,class:"home-row"},{default:a(()=>[t(r,{span:6},{default:a(()=>[t(D,{statusData:o.value},null,8,["statusData"])]),_:1}),t(r,{span:18},{default:a(()=>[t(E,{summaryData:c.value},null,8,["summaryData"])]),_:1})]),_:1}),t(d,{gutter:15,class:"home-row"},{default:a(()=>[t(r,{span:12},{default:a(()=>[t(L)]),_:1}),t(r,{span:12},{default:a(()=>[t(I)]),_:1})]),_:1})])}}}),W=V(j,[["__scopeId","data-v-c5914131"]]);export{W as default};
