import * as echarts from "echarts"; import { useSelector } from "react-redux"; import StudyProgress from "../StudyProgress"; import ScoreRingChart from "../ScoreRingChart"; import AttendanceRingChart from "../AttendanceRingChart"; import { getDashboardStatistics } from "@/services"; import "./index.css"; import { useEffect } from "react"; const ringData = [ { value: 80, name: "我的", title: { offsetCenter: ["-30%", "-90%"], }, itemStyle: { color: new echarts.graphic.LinearGradient(0, 0, 1, 1, [ { offset: 0, color: "#2C7AFF" }, { offset: 1, color: "#00AEFF" }, ]), }, }, // 外环 { value: 60, name: "班级", title: { offsetCenter: ["-60%", "-90%"], }, itemStyle: { color: new echarts.graphic.LinearGradient(0, 0, 1, 1, [ { offset: 0, color: "#4564FF" }, { offset: 1, color: "#AB2CFF" }, ]), }, }, // 中环 ]; const attendanceData = [ { name: "出勤率", value: 22, itemStyle: { color: new echarts.graphic.LinearGradient(0, 0, 1, 1, [ { offset: 0, color: "#2C7AFF" }, { offset: 1, color: "#00D5FF" }, ]), }, }, { name: "缺勤率", value: 8, itemStyle: { color: "#FF9D2C" } }, // 可添加更多状态(如迟到、早退、缺勤等) ]; const StudyStudes = () => { const studentInfo = useSelector((state) => state.student.studentInfo); // 获取仪表盘数据 const queryDashboardStatistics = async () => { const res = await getDashboardStatistics(); console.log(res); }; useEffect(() => { queryDashboardStatistics(); }, []); return (
学习情况
个人学习时长(h)
145
班级平均学习时长(h)
145
整体课程完成进度
班级平均进度
60%我的进度
60%班级平均进度
60%我的进度
60%出勤率
60%缺勤率
60%