|
|
|
@ -22,7 +22,8 @@
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="班级:">
|
|
|
|
<el-form-item label="班级:">
|
|
|
|
<el-select placeholder="全部" v-model="classParams.classId" style="width: 185.6px">
|
|
|
|
<el-select placeholder="全部" v-model="classParams.classId" style="width: 185.6px">
|
|
|
|
<el-option v-for="item in userStore.classList" :key="item" :label="item.class_name" :value="item.class_id" />
|
|
|
|
<el-option label="全部" value="" />
|
|
|
|
|
|
|
|
<el-option v-for="item in userStore.classList" :key="item.class_id" :label="item.class_name" :value="item.class_id" />
|
|
|
|
</el-select>
|
|
|
|
</el-select>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item>
|
|
|
|
<el-form-item>
|
|
|
|
@ -48,8 +49,6 @@
|
|
|
|
<script setup>
|
|
|
|
<script setup>
|
|
|
|
import * as echarts from "echarts";
|
|
|
|
import * as echarts from "echarts";
|
|
|
|
import * as teacherApi from "@/api/teacher.js";
|
|
|
|
import * as teacherApi from "@/api/teacher.js";
|
|
|
|
const { proxy } = getCurrentInstance();
|
|
|
|
|
|
|
|
import { getAssetsFile } from "@/utils/index.js";
|
|
|
|
|
|
|
|
import useUserStore from "@/store/modules/user";
|
|
|
|
import useUserStore from "@/store/modules/user";
|
|
|
|
const userStore = useUserStore();
|
|
|
|
const userStore = useUserStore();
|
|
|
|
const classTime = ref([]);
|
|
|
|
const classTime = ref([]);
|
|
|
|
@ -59,7 +58,6 @@ const classParams = ref({
|
|
|
|
classId: "",
|
|
|
|
classId: "",
|
|
|
|
time: "",
|
|
|
|
time: "",
|
|
|
|
});
|
|
|
|
});
|
|
|
|
const initstatus = ref(false);
|
|
|
|
|
|
|
|
const circularData = ref([
|
|
|
|
const circularData = ref([
|
|
|
|
{ value: 0, name: "一般", key: "generalCount" },
|
|
|
|
{ value: 0, name: "一般", key: "generalCount" },
|
|
|
|
{ value: 0, name: "优秀", key: "excellentCount" },
|
|
|
|
{ value: 0, name: "优秀", key: "excellentCount" },
|
|
|
|
@ -145,14 +143,15 @@ const getStatisticsData = async () => {
|
|
|
|
const getClassGradeTrend = () => {
|
|
|
|
const getClassGradeTrend = () => {
|
|
|
|
teacherApi.getAverageScoreTrend().then((res) => {
|
|
|
|
teacherApi.getAverageScoreTrend().then((res) => {
|
|
|
|
const trends = Array.isArray(res) ? res : [];
|
|
|
|
const trends = Array.isArray(res) ? res : [];
|
|
|
|
classTime.value = trends[0]?.startTime || [];
|
|
|
|
classTime.value = [...new Set(trends.flatMap((item) => item.startTime || []))].sort();
|
|
|
|
className.value = trends.map((item) => item.className);
|
|
|
|
className.value = trends.map((item) => item.className);
|
|
|
|
classList.value = trends.map((item) => {
|
|
|
|
classList.value = trends.map((item) => {
|
|
|
|
|
|
|
|
const scoresByDate = new Map((item.startTime || []).map((date, index) => [date, item.classAverageScore?.[index] ?? null]));
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
name: item.className,
|
|
|
|
name: item.className,
|
|
|
|
type: "line",
|
|
|
|
type: "line",
|
|
|
|
stack: "Total",
|
|
|
|
connectNulls: false,
|
|
|
|
data: item.classAverageScore,
|
|
|
|
data: classTime.value.map((date) => scoresByDate.get(date) ?? null),
|
|
|
|
};
|
|
|
|
};
|
|
|
|
});
|
|
|
|
});
|
|
|
|
getTrendData();
|
|
|
|
getTrendData();
|
|
|
|
@ -165,9 +164,6 @@ const getClassGradeStatistics = () => {
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
classParams.value.time = classParams.value.time.toString();
|
|
|
|
classParams.value.time = classParams.value.time.toString();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (initstatus.value && !classParams.value.classId) {
|
|
|
|
|
|
|
|
proxy.$modal.msgWarning("请选择班级");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
teacherApi.getScoreStatisticsTrend(classParams.value).then((res) => {
|
|
|
|
teacherApi.getScoreStatisticsTrend(classParams.value).then((res) => {
|
|
|
|
circularData.value.forEach((item, index) => {
|
|
|
|
circularData.value.forEach((item, index) => {
|
|
|
|
item.value = res[item.key];
|
|
|
|
item.value = res[item.key];
|
|
|
|
@ -186,7 +182,7 @@ const getClassGradeStatistics = () => {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
// 获取班级
|
|
|
|
// 获取班级
|
|
|
|
const getClassList = () => {
|
|
|
|
const getClassList = () => {
|
|
|
|
teacherApi.getOwnedTeachingClasses().then((res) => {
|
|
|
|
teacherApi.getTeacherHomeClasses().then((res) => {
|
|
|
|
userStore.classList = (res.data || []).map((item) => ({
|
|
|
|
userStore.classList = (res.data || []).map((item) => ({
|
|
|
|
class_name: item.className,
|
|
|
|
class_name: item.className,
|
|
|
|
class_id: item.schoolClassId,
|
|
|
|
class_id: item.schoolClassId,
|
|
|
|
@ -197,7 +193,6 @@ onMounted(() => {
|
|
|
|
getClassGradeTrend();
|
|
|
|
getClassGradeTrend();
|
|
|
|
getClassGradeStatistics()
|
|
|
|
getClassGradeStatistics()
|
|
|
|
getClassList()
|
|
|
|
getClassList()
|
|
|
|
initstatus.value = true;
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
<style lang='scss' scoped>
|
|
|
|
<style lang='scss' scoped>
|
|
|
|
|