2 lines
2.8 KiB
JavaScript
2 lines
2.8 KiB
JavaScript
import{_ as T}from"./index.76a66f15.js";/* empty css */import{a$ as S,C as n,b1 as d,b2 as e,aJ as o,D as l,aG as p,b4 as _,E as m,b3 as h,bW as w,bR as G,cy as I,b_ as O,bZ as P,bs as k,bP as L,bL as N}from"./arco.f3c60d68.js";const z={components:{},data(){return{loading:!1,timeTypes:[{name:"\u4ECA\u65E5",value:0},{name:"\u8FD1\u4E00\u5468",value:1},{name:"\u672C\u6708",value:2},{name:"\u4ECA\u5E74",value:3}],timeType:0,data:{},chartOption:{}}},props:{userId:{type:[Number,String],default:0}},watch:{userId(){this.getData()}},mounted(){this.getData()},methods:{timeChange(a){this.timeType=a,this.getData()},getData(){this.loading=!0,this.$request.post("admin/data/study/getStatistics",{time:this.timeType,user_id:this.userId}).then(a=>{this.loading=!1,this.data=a.data;var i={tooltip:{trigger:"axis"},yAxis:{type:"value"},xAxis:{type:"category",boundaryGap:!1,data:[]},legend:{data:[]},categories:[],series:[]},s={time:{name:"\u5B66\u4E60\u65F6\u957F",type:"line",data:[],smooth:!0},course:{name:"\u5B66\u4E60\u8BFE\u7A0B",type:"line",data:[],smooth:!0},user:{name:"\u5B66\u4E60\u4EBA\u6570",type:"line",data:[],smooth:!0}};for(var r in a.data.log){i.xAxis.data.push(r),i.categories.push(r);for(var t in s)a.data.log[r].hasOwnProperty(t)&&(i.legend.data.push(s[t].name),s[t].data.push(a.data.log[r][t]))}for(var t in s)s[t].data&&i.series.push(s[t]);this.chartOption=i})}}};const V={class:"study-data-item",style:{padding:"20px 0 20px 20px",width:"100%"}},W={style:{color:"rgb(var(--gray-6))"}},q={style:{"margin-left":"6px"}};function J(a,i,s,r,t,y){const f=w,v=G,b=I,x=O,E=P,C=S("Chart"),g=k,B=L,A=N;return n(),d(A,{bordered:!1},{default:e(()=>[o(B,{loading:t.loading,tip:"\u5904\u7406\u4E2D\uFF0C\u8BF7\u7A0D\u540E",style:{width:"100%"}},{default:e(()=>[o(g,{direction:"vertical",fill:"",size:"large"},{default:e(()=>[o(v,{type:"capsule","hide-content":!0,onChange:y.timeChange},{default:e(()=>[(n(!0),l(p,null,_(t.timeTypes,(u,D)=>(n(),d(f,{key:u.value,title:u.name},null,8,["title"]))),128))]),_:1},8,["onChange"]),o(g,{direction:"vertical",fill:""},{default:e(()=>[o(E,{cols:24,"row-gap":1,"col-gap":1},{default:e(()=>[(n(),l(p,null,_(["time_total","total"],(u,D)=>(n(),l(p,null,[(n(!0),l(p,null,_(t.data[u],(F,c)=>(n(),d(x,{class:"panel-col",span:{xs:12,sm:12,md:12,lg:6,xl:4,xxl:4}},{default:e(()=>[m("div",V,[o(b,{value:F,precision:0,"value-from":0,animation:"","value-style":{color:"rgb(var(--gray-9))",fontWeight:700,fontSize:"24px"}},{title:e(()=>[m("div",W,h((u=="total"?"\u603B\u8BA1":t.timeTypes[t.timeType].name)+a.$t("study."+c)),1)]),suffix:e(()=>[m("span",q,h(c=="time"?"\u5C0F\u65F6":c=="user"?"\u4EBA":"\u95E8"),1)]),_:2},1032,["value"])])]),_:2},1024))),256))],64))),64))]),_:1}),o(C,{height:"300px",style:{"margin-top":"0px"},option:t.chartOption},null,8,["option"])]),_:1})]),_:1})]),_:1},8,["loading"])]),_:1})}const H=T(z,[["render",J]]);export{H as s};
|