Files
tongjiweb/server/public/assets/RdStats-B2gVWfHm.js
T
2026-06-04 11:01:29 +08:00

2 lines
2.2 KiB
JavaScript

import{r as f}from"./index-8cA9XdMr.js";import{i as b,L as h}from"./index-Bn9PLWWT.js";import{q as y,c as w,a,e as d,t as c,b as e,w as g,s as x,h as p,r as u,o as k}from"./index-Au1XOH8d.js";const S={class:"stat-cards"},C={class:"stat-card purple"},L={class:"value"},A={class:"stat-card green"},B={class:"value"},N={class:"content-card"},R={class:"content-card"},D={__name:"RdStats",setup(V){const s=p({}),r=p(null);let n=null;async function v(){const l=await f.getStats();s.value=l.data,await x(),m()}function m(){if(!r.value)return;n||(n=b(r.value,"dark"));const l=[...s.value.monthly||[]].reverse();n.setOption({backgroundColor:"transparent",tooltip:{trigger:"axis"},xAxis:{type:"category",data:l.map(t=>t.month),axisLabel:{color:"#94a3b8"}},yAxis:{type:"value",name:"工时(h)",axisLabel:{color:"#94a3b8"}},series:[{type:"line",data:l.map(t=>t.total_hours),smooth:!0,lineStyle:{width:3,color:"#6366f1"},areaStyle:{color:new h(0,0,0,1,[{offset:0,color:"rgba(99, 102, 241, 0.4)"},{offset:1,color:"rgba(99, 102, 241, 0.05)"}])},itemStyle:{color:"#6366f1"}}]})}return y(v),(l,t)=>{var i;const o=u("el-table-column"),_=u("el-table");return k(),w("div",null,[t[6]||(t[6]=a("div",{class:"page-header"},[a("h1",null,"个人统计"),a("p",null,"查看您的工时分布与月度趋势")],-1)),a("div",S,[a("div",C,[t[1]||(t[1]=a("div",{class:"label"},"参与项目数",-1)),a("div",L,[d(c(((i=s.value.projects)==null?void 0:i.length)||0),1),t[0]||(t[0]=a("span",{class:"unit"},"个",-1))])]),a("div",A,[t[3]||(t[3]=a("div",{class:"label"},"累计总工时",-1)),a("div",B,[d(c(s.value.total_hours||0),1),t[2]||(t[2]=a("span",{class:"unit"},"小时",-1))])])]),a("div",N,[t[4]||(t[4]=a("div",{class:"card-title"},"各项目工时明细",-1)),e(_,{data:s.value.projects||[],stripe:""},{default:g(()=>[e(o,{prop:"client_name",label:"客户/项目","min-width":"180"}),e(o,{prop:"total_hours",label:"总工时(h)",width:"120"}),e(o,{prop:"work_days",label:"工作天数",width:"110"}),e(o,{prop:"first_date",label:"首次填报",width:"130"}),e(o,{prop:"last_date",label:"最近填报",width:"130"})]),_:1},8,["data"])]),a("div",R,[t[5]||(t[5]=a("div",{class:"card-title"},"月度工时趋势",-1)),a("div",{ref_key:"chartRef",ref:r,class:"chart-container"},null,512)])])}}};export{D as default};