|
@@ -43,7 +43,9 @@ export default defineComponent({
|
|
const { musicGroupId } = toRefs(props);
|
|
const { musicGroupId } = toRefs(props);
|
|
/** 统计 */
|
|
/** 统计 */
|
|
const getSchool = async () => {
|
|
const getSchool = async () => {
|
|
- const res = await api_schoolIndexStat({musicGroupId: musicGroupId.value});
|
|
|
|
|
|
+ const res = await api_schoolIndexStat({
|
|
|
|
+ musicGroupId: musicGroupId.value
|
|
|
|
+ });
|
|
if (res.data) {
|
|
if (res.data) {
|
|
const {
|
|
const {
|
|
gradeDistributions,
|
|
gradeDistributions,
|
|
@@ -67,16 +69,20 @@ export default defineComponent({
|
|
};
|
|
};
|
|
|
|
|
|
/** 出勤统计 */
|
|
/** 出勤统计 */
|
|
- const getAttendanceStat = async () => {
|
|
|
|
- const res = await api_schoolIndexAttendanceStat({});
|
|
|
|
|
|
+ const getAttendanceStat = async (period: string) => {
|
|
|
|
+ const res = await api_schoolIndexAttendanceStat({
|
|
|
|
+ period
|
|
|
|
+ });
|
|
if (res.data) {
|
|
if (res.data) {
|
|
data.studentAttendance = res.data;
|
|
data.studentAttendance = res.data;
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
|
|
/** 练习统计 */
|
|
/** 练习统计 */
|
|
- const getLessonStat = async () => {
|
|
|
|
- const res = await api_schoolIndexLessonStat({});
|
|
|
|
|
|
+ const getLessonStat = async (period: string) => {
|
|
|
|
+ const res = await api_schoolIndexLessonStat({
|
|
|
|
+ period
|
|
|
|
+ });
|
|
if (res.data) {
|
|
if (res.data) {
|
|
data.studentLessons = res.data;
|
|
data.studentLessons = res.data;
|
|
}
|
|
}
|
|
@@ -84,8 +90,8 @@ export default defineComponent({
|
|
|
|
|
|
const init = () => {
|
|
const init = () => {
|
|
getSchool();
|
|
getSchool();
|
|
- getAttendanceStat();
|
|
|
|
- getLessonStat();
|
|
|
|
|
|
+ getAttendanceStat('week');
|
|
|
|
+ getLessonStat('week');
|
|
};
|
|
};
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
init();
|
|
init();
|
|
@@ -98,14 +104,14 @@ export default defineComponent({
|
|
<DetailData data={data.subjectGradeDistributions} />
|
|
<DetailData data={data.subjectGradeDistributions} />
|
|
<Attendance
|
|
<Attendance
|
|
data={data.studentAttendance}
|
|
data={data.studentAttendance}
|
|
- onChange={() => {
|
|
|
|
- getAttendanceStat();
|
|
|
|
|
|
+ onChange={(value) => {
|
|
|
|
+ getAttendanceStat(value);
|
|
}}
|
|
}}
|
|
/>
|
|
/>
|
|
<Practice
|
|
<Practice
|
|
data={data.studentLessons}
|
|
data={data.studentLessons}
|
|
- onChange={() => {
|
|
|
|
- getLessonStat();
|
|
|
|
|
|
+ onChange={(value) => {
|
|
|
|
+ getLessonStat(value);
|
|
}}
|
|
}}
|
|
/>
|
|
/>
|
|
</div>
|
|
</div>
|