|
@@ -8,12 +8,12 @@ defineOptions({
|
|
|
name: "DashboardIndex",
|
|
|
inheritAttrs: false,
|
|
|
});
|
|
|
-// import { getClassList, getSchoolList } from "@/api/school";
|
|
|
-import { ClassList, SchoolList } from "@/api/school/types";
|
|
|
+// import { getGradeList, getSchoolList } from "@/api/school";
|
|
|
+import { GradeList, SchoolList } from "@/api/school/types";
|
|
|
import { watch } from "vue";
|
|
|
import { useUserStore } from "@/store/modules/user";
|
|
|
import { CaretBottom } from "@element-plus/icons-vue";
|
|
|
-import { getClassList } from "@/api/school";
|
|
|
+import { getGradeList } from "@/api/school";
|
|
|
import { getDashboardData, getDashboardTop } from "@/api/dashboard";
|
|
|
import { DashboardCard, DashboardData } from "@/api/dashboard/types";
|
|
|
const userStore = useUserStore();
|
|
@@ -49,15 +49,15 @@ async function getDataCard(schoolId) {
|
|
|
/**
|
|
|
* 班级数据
|
|
|
*/
|
|
|
-const classData = ref<ClassList[]>();
|
|
|
+const gradeData = ref<GradeList[]>();
|
|
|
// 班级编号
|
|
|
-let classId = ref(0);
|
|
|
-async function getClassData(schoolId) {
|
|
|
- getClassList(schoolId)
|
|
|
+let gradeId = ref(0);
|
|
|
+async function getGradeData(schoolId) {
|
|
|
+ getGradeList(schoolId)
|
|
|
.then(({ data }) => {
|
|
|
data.unshift({ id: 0, name: "全部班级" });
|
|
|
- classData.value = data;
|
|
|
- //console.log(classData.value)
|
|
|
+ gradeData.value = data;
|
|
|
+ //console.log(gradeData.value)
|
|
|
})
|
|
|
.catch((error) => {
|
|
|
console.log(error);
|
|
@@ -81,8 +81,8 @@ const chartData: DashboardData = reactive({
|
|
|
// // 近期分期占比分析
|
|
|
// afterProportion: Proportion;
|
|
|
});
|
|
|
-async function getChartData(classId) {
|
|
|
- getDashboardData(classId)
|
|
|
+async function getChartData(gradeId) {
|
|
|
+ getDashboardData(gradeId)
|
|
|
.then(({ data }) => {
|
|
|
// 初期专注力估值
|
|
|
chartData.frontAverage = data.frontAverage;
|
|
@@ -106,11 +106,11 @@ async function getChartData(classId) {
|
|
|
|
|
|
onMounted(() => {
|
|
|
// 获取班级
|
|
|
- getClassData(userStore.schoolId);
|
|
|
+ getGradeData(userStore.schoolId);
|
|
|
// 数据卡片
|
|
|
getDataCard(userStore.schoolId);
|
|
|
// 图表数据
|
|
|
- getChartData(classId.value);
|
|
|
+ getChartData(gradeId.value);
|
|
|
});
|
|
|
|
|
|
// 数据状态:1正常,2训练次数小于3,3过期,4缺省
|
|
@@ -135,13 +135,13 @@ const percentNumber = [1, 2, 13, 2, 2];
|
|
|
<!-- 班级选择 及 案例展示 -->
|
|
|
<div class="class-select clear">
|
|
|
<el-select
|
|
|
- v-model="classId"
|
|
|
+ v-model="gradeId"
|
|
|
placeholder="全部班级"
|
|
|
size="large"
|
|
|
:suffix-icon="CaretBottom"
|
|
|
>
|
|
|
<el-option
|
|
|
- v-for="item in classData"
|
|
|
+ v-for="item in gradeData"
|
|
|
:key="item.id"
|
|
|
:label="item.name"
|
|
|
:value="item.id"
|