|
@@ -5,10 +5,11 @@ import {getGradeSelect} from "@/api/grade";
|
|
|
import {getAreaSchool} from "@/api/areaboard";
|
|
|
import {SchoolList} from "@/api/school/types";
|
|
|
import ComboCharts from "@/views/admin/components/ComboCharts.vue";
|
|
|
-import {getUrlParam, trimInput} from "@/utils";
|
|
|
+import {trimInput} from "@/utils";
|
|
|
import {StudentItem, StudentParams} from "@/api/student/types";
|
|
|
import {getStudentLists} from "@/api/student";
|
|
|
import {useRouter} from "vue-router";
|
|
|
+
|
|
|
const router = useRouter();
|
|
|
|
|
|
defineOptions({
|
|
@@ -107,7 +108,6 @@ async function getStudentData() {
|
|
|
dataMessage.value = "暂时还没有任何学生绑定学校!";
|
|
|
}
|
|
|
}
|
|
|
- //window.scroll({top: 2000, left: 0, behavior: "smooth"});
|
|
|
})
|
|
|
.catch((error) => {
|
|
|
dataMessage.value = error.message;
|
|
@@ -121,39 +121,52 @@ function alertEvaluationError() {
|
|
|
ElMessage.error("该学生还未进行过测评,暂无测评数据。");
|
|
|
}
|
|
|
function getSchoolSearch() {
|
|
|
- const current = router.currentRoute.value.path;
|
|
|
- router.push(
|
|
|
- current +
|
|
|
- "?school=" +
|
|
|
- dataParams.school_id +
|
|
|
- "&grade=" +
|
|
|
- dataParams.grade_id +
|
|
|
- "&start=" +
|
|
|
- dataParams.start_time +
|
|
|
- "&end=" +
|
|
|
- dataParams.end_time
|
|
|
- );
|
|
|
+ getStudentData();
|
|
|
+}
|
|
|
+
|
|
|
+function pathTo(url: String) {
|
|
|
+ // 记录搜索条件
|
|
|
+ sessionStorage.setItem("schoolChartParams", JSON.stringify(dataParams));
|
|
|
+ sessionStorage.setItem("schoolStudentParams", JSON.stringify(studentParams));
|
|
|
+ // 路由跳转
|
|
|
+ router.push(url);
|
|
|
}
|
|
|
onMounted(() => {
|
|
|
// 获取学校
|
|
|
getSchoolData();
|
|
|
gradeData.value = [{id: 0, name: "全部班级"}];
|
|
|
- let school = getUrlParam("school");
|
|
|
- if (school && Number(school) > 0) {
|
|
|
- dataParams.school_id = Number(school);
|
|
|
- }
|
|
|
- let grade = getUrlParam("grade");
|
|
|
- if (grade && Number(grade) > 0) {
|
|
|
- dataParams.grade_id = Number(grade);
|
|
|
- }
|
|
|
- let start = getUrlParam("start");
|
|
|
- if (start && Number(start) > 0) {
|
|
|
- dataParams.start_time = Number(start);
|
|
|
+ // 获取记录的搜索条件
|
|
|
+ let params1 = sessionStorage.getItem("schoolChartParams");
|
|
|
+ if (params1 && params1 != "null") {
|
|
|
+ const parse1: SchoolParams = JSON.parse(params1);
|
|
|
+ if (parse1.school_id && parse1.school_id > 0) {
|
|
|
+ dataParams.school_id = parse1.school_id;
|
|
|
+ }
|
|
|
+ if (parse1.grade_id && parse1.grade_id > 0) {
|
|
|
+ dataParams.grade_id = parse1.grade_id;
|
|
|
+ }
|
|
|
+ if (parse1.start_time && parse1.start_time > 0) {
|
|
|
+ dataParams.start_time = parse1.start_time;
|
|
|
+ }
|
|
|
+ if (parse1.end_time && parse1.end_time > 0) {
|
|
|
+ dataParams.end_time = parse1.end_time;
|
|
|
+ }
|
|
|
}
|
|
|
- let end = getUrlParam("end");
|
|
|
- if (end && Number(end) > 0) {
|
|
|
- dataParams.end_time = Number(end);
|
|
|
+ let params2 = sessionStorage.getItem("schoolStudentParams");
|
|
|
+ if (params2 && params2 != "null") {
|
|
|
+ const parse2: StudentParams = JSON.parse(params2);
|
|
|
+ if (parse2.page && parse2.page > 0) {
|
|
|
+ studentParams.page = parse2.page;
|
|
|
+ }
|
|
|
+ if (parse2.page_size && parse2.page_size > 0) {
|
|
|
+ studentParams.page_size = parse2.page_size;
|
|
|
+ }
|
|
|
+ if (parse2.search) {
|
|
|
+ studentParams.search = parse2.search;
|
|
|
+ }
|
|
|
}
|
|
|
+ sessionStorage.removeItem("schoolChartParams");
|
|
|
+ sessionStorage.removeItem("schoolStudentParams");
|
|
|
// 获取页面数据
|
|
|
getSchoolPageData();
|
|
|
});
|
|
@@ -184,7 +197,7 @@ onMounted(() => {
|
|
|
value-format="x"
|
|
|
@change="changeDate()" />
|
|
|
</div>
|
|
|
- <el-button color="#4284f2" size="large" @click="getSchoolSearch()">查找</el-button>
|
|
|
+ <el-button color="#4284f2" size="large" @click="getSchoolPageData()">查找</el-button>
|
|
|
</div>
|
|
|
<!-- Echarts 图表 -->
|
|
|
<ComboCharts
|
|
@@ -203,7 +216,7 @@ onMounted(() => {
|
|
|
placeholder="请输入学生名称或手机号码"
|
|
|
size="large"
|
|
|
@input="(value:string) => (studentParams.search = trimInput(value))" />
|
|
|
- <el-button size="large" type="primary" @click="getStudentData()">查找</el-button>
|
|
|
+ <el-button size="large" type="primary" @click="getSchoolSearch()">查找</el-button>
|
|
|
</div>
|
|
|
<!-- 学生数据 -->
|
|
|
<div class="list-table">
|
|
@@ -216,17 +229,30 @@ onMounted(() => {
|
|
|
<el-table-column prop="count" label="训练次数" align="center" />
|
|
|
<el-table-column label="操作" align="center" min-width="160">
|
|
|
<template #default="scope">
|
|
|
- <router-link :to="'/schoolBoard/training?id=' + scope.row.id" class="table-btn">训练报告</router-link>
|
|
|
- <router-link v-if="scope.row.count > 16" :to="'/schoolBoard/result?id=' + scope.row.id" class="table-btn"
|
|
|
+ <!-- <router-link :to="'/schoolBoard/training?id=' + scope.row.id" class="table-btn">训练报告</router-link>-->
|
|
|
+ <button class="table-btn" @click="pathTo('/schoolBoard/training?id=' + scope.row.id)">训练报告</button>
|
|
|
+ <!-- <router-link v-if="scope.row.count > 16" :to="'/schoolBoard/result?id=' + scope.row.id" class="table-btn"
|
|
|
>训练效果分析</router-link
|
|
|
- >
|
|
|
+ >-->
|
|
|
+ <button
|
|
|
+ v-if="scope.row.count > 16"
|
|
|
+ class="table-btn"
|
|
|
+ @click="pathTo('/schoolBoard/result?id=' + scope.row.id)">
|
|
|
+ 训练效果分析
|
|
|
+ </button>
|
|
|
<button v-else class="table-btn disabled" @click="alertTrainingError()">训练效果分析</button>
|
|
|
- <router-link
|
|
|
- v-if="scope.row.count > 0"
|
|
|
+ <!-- <router-link
|
|
|
+ v-if="scope.row.count_report > 0"
|
|
|
:to="'/schoolBoard/evaluation?id=' + scope.row.id"
|
|
|
class="table-btn"
|
|
|
>测评数据对比</router-link
|
|
|
- >
|
|
|
+ >-->
|
|
|
+ <button
|
|
|
+ v-if="scope.row.count_report > 0"
|
|
|
+ class="table-btn"
|
|
|
+ @click="pathTo('/schoolBoard/evaluation?id=' + scope.row.id)">
|
|
|
+ 训练效果分析
|
|
|
+ </button>
|
|
|
<button v-else class="table-btn disabled" @click="alertEvaluationError()">测评数据对比</button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -243,7 +269,7 @@ onMounted(() => {
|
|
|
v-model:total="studentCount"
|
|
|
v-model:page="studentParams.page"
|
|
|
v-model:limit="studentParams.page_size"
|
|
|
- @pagination="getStudentData()" />
|
|
|
+ @pagination="getSchoolSearch()" />
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|