|
@@ -4,199 +4,225 @@
|
|
|
<div class="page_filter">
|
|
<div class="page_filter">
|
|
|
<FiltersItem :data="filtersData" @select="handleSelectChange" />
|
|
<FiltersItem :data="filtersData" @select="handleSelectChange" />
|
|
|
</div>
|
|
</div>
|
|
|
- <router-view />
|
|
|
|
|
- <div class="report_bottom">
|
|
|
|
|
- <div class="bottom_no_more">
|
|
|
|
|
- 没有更多了,<span @click="goToPageTop">回到顶部</span>
|
|
|
|
|
|
|
+ <div class="report_content" ref="reportContentRef">
|
|
|
|
|
+ <router-view />
|
|
|
|
|
+ <div
|
|
|
|
|
+ class="report_bottom"
|
|
|
|
|
+ v-if="route.name != 'score' && route.name != 'optionDetail'"
|
|
|
|
|
+ >
|
|
|
|
|
+ <div class="bottom_no_more">
|
|
|
|
|
+ 没有更多了,<span @click="goToPageTop">回到顶部</span>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
|
-import FiltersItem from '@/components/FiltersItem.vue'
|
|
|
|
|
-import { findCommonSelectList } from '@/api/analysis'
|
|
|
|
|
-import { onMounted, ref } from 'vue'
|
|
|
|
|
-import { useAnalysisStore } from '@/store/analysis'
|
|
|
|
|
-
|
|
|
|
|
-const analysisStore = useAnalysisStore()
|
|
|
|
|
-const mainContent = ref<HTMLElement | null>(null)
|
|
|
|
|
-
|
|
|
|
|
-// 子组件实例类型定义
|
|
|
|
|
-interface ChildComponent {
|
|
|
|
|
- PageInit: () => void
|
|
|
|
|
-}
|
|
|
|
|
-const childView = ref<ChildComponent | null>(null)
|
|
|
|
|
-
|
|
|
|
|
-// 强类型定义
|
|
|
|
|
|
|
+import FiltersItem from "@/components/FiltersItem.vue";
|
|
|
|
|
+// 重命名导入的 API 函数以避免冲突
|
|
|
|
|
+import { findCommonSelectList, getAnalysisExamInfo as fetchAnalysisExamInfo } from "@/api/analysis";
|
|
|
|
|
+import { onMounted, ref, computed } from "vue";
|
|
|
|
|
+import { useRoute } from "vue-router";
|
|
|
|
|
+import { useAnalysisStore } from "@/store/analysis";
|
|
|
|
|
+import { useExamStore } from "@/store/exam";
|
|
|
|
|
+
|
|
|
|
|
+const examStore = useExamStore();
|
|
|
|
|
+const analysisStore = useAnalysisStore();
|
|
|
|
|
+const route = useRoute();
|
|
|
|
|
+const reportContentRef = ref<HTMLElement | null>(null);
|
|
|
|
|
+
|
|
|
|
|
+// 考试科目 code
|
|
|
|
|
+const subjectCode = computed(() => {
|
|
|
|
|
+ return examStore.currentExam?.examSubjectCode;
|
|
|
|
|
+});
|
|
|
|
|
+
|
|
|
|
|
+// --- 类型定义 ---
|
|
|
interface FilterOption {
|
|
interface FilterOption {
|
|
|
- label: string
|
|
|
|
|
- value: string
|
|
|
|
|
- [key: string]: any
|
|
|
|
|
|
|
+ label: string;
|
|
|
|
|
+ value: string;
|
|
|
|
|
+ [key: string]: any; // 保留用于动态属性,如 selectSchoolVoList 等
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
interface FilterItem {
|
|
interface FilterItem {
|
|
|
- label: string
|
|
|
|
|
- type: 'subjectName' | 'schoolName' | 'registrationType' | 'scoreType' | 'classType' | 'className'
|
|
|
|
|
- list: FilterOption[]
|
|
|
|
|
- value: string
|
|
|
|
|
|
|
+ label: string;
|
|
|
|
|
+ type: "subjectName" | "schoolName" | "registrationType" | "scoreType" | "classType" | "className";
|
|
|
|
|
+ list: FilterOption[];
|
|
|
|
|
+ value: string;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// 简化接口定义,利用 TS 推断或保持必要结构
|
|
|
interface SubjectItem {
|
|
interface SubjectItem {
|
|
|
- subjectName: string
|
|
|
|
|
- subjectCode: string
|
|
|
|
|
- subjectId: string
|
|
|
|
|
- isTotal: boolean
|
|
|
|
|
- subjectGroupType: number
|
|
|
|
|
- selectSchoolVoList: SchoolItem[]
|
|
|
|
|
- subjectGroupCodes: string
|
|
|
|
|
|
|
+ subjectName: string;
|
|
|
|
|
+ subjectCode: string;
|
|
|
|
|
+ subjectId: string;
|
|
|
|
|
+ isTotal: number | string;
|
|
|
|
|
+ subjectGroupType: number;
|
|
|
|
|
+ selectSchoolVoList: SchoolItem[];
|
|
|
|
|
+ subjectGroupCodes: string;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
interface SchoolItem {
|
|
interface SchoolItem {
|
|
|
- schoolId: string
|
|
|
|
|
- schoolName: string
|
|
|
|
|
- schoolLevel: string
|
|
|
|
|
- schoolGroupId: string
|
|
|
|
|
- selectStatusVoList: StatusItem[]
|
|
|
|
|
- schoolGroupNames: string
|
|
|
|
|
|
|
+ schoolId: string;
|
|
|
|
|
+ schoolName: string;
|
|
|
|
|
+ schoolLevel: string | number; // 兼容可能的数字类型
|
|
|
|
|
+ schoolGroupId: string;
|
|
|
|
|
+ selectStatusVoList: StatusItem[];
|
|
|
|
|
+ schoolGroupNames: string;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
interface StatusItem {
|
|
interface StatusItem {
|
|
|
- statusName: string
|
|
|
|
|
- statusGroupType: string
|
|
|
|
|
- statusGroupId: string
|
|
|
|
|
- examCommonSelectScoreList: ScoreTypeItem[]
|
|
|
|
|
- statusGroupNames: string
|
|
|
|
|
|
|
+ statusName: string;
|
|
|
|
|
+ statusGroupType: string;
|
|
|
|
|
+ statusGroupId: string;
|
|
|
|
|
+ examCommonSelectScoreList: ScoreTypeItem[];
|
|
|
|
|
+ statusGroupNames: string;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
interface ScoreTypeItem {
|
|
interface ScoreTypeItem {
|
|
|
- scoreType: string
|
|
|
|
|
- typeName: string
|
|
|
|
|
- selectClassVoList: ClassTypeItem[]
|
|
|
|
|
|
|
+ scoreType: string;
|
|
|
|
|
+ typeName: string;
|
|
|
|
|
+ selectClassVoList: ClassTypeItem[];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
interface ClassTypeItem {
|
|
interface ClassTypeItem {
|
|
|
- typeName: string
|
|
|
|
|
- classType: string
|
|
|
|
|
- selectInfoVoList: ClassItem[]
|
|
|
|
|
|
|
+ typeName: string;
|
|
|
|
|
+ classType: string;
|
|
|
|
|
+ selectInfoVoList: ClassItem[];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
interface ClassItem {
|
|
interface ClassItem {
|
|
|
- className: string
|
|
|
|
|
- classLevel: string
|
|
|
|
|
- classGroupId: string
|
|
|
|
|
- classIdCode: string
|
|
|
|
|
- classCode: string
|
|
|
|
|
- classGroupNames: string
|
|
|
|
|
|
|
+ className: string;
|
|
|
|
|
+ classLevel: string | number;
|
|
|
|
|
+ classGroupId: string;
|
|
|
|
|
+ classIdCode: string;
|
|
|
|
|
+ classCode: string;
|
|
|
|
|
+ classGroupNames: string;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
interface FilterParams {
|
|
interface FilterParams {
|
|
|
- examId: string
|
|
|
|
|
- examLevel:Number
|
|
|
|
|
- subjectCode: string
|
|
|
|
|
- subjectName: string
|
|
|
|
|
- subjectId: string
|
|
|
|
|
- subjectGroupType: number
|
|
|
|
|
- isTotal: boolean
|
|
|
|
|
- subjectGroupCodes: string
|
|
|
|
|
- schoolId: string
|
|
|
|
|
- schoolLevel: string
|
|
|
|
|
- schoolGroupId: string
|
|
|
|
|
- schoolGroupName: string | null
|
|
|
|
|
- schoolName: string | null
|
|
|
|
|
- schoolGroupNames: string
|
|
|
|
|
- registrationType: string
|
|
|
|
|
- registrationName: string | null
|
|
|
|
|
- registrationGroupId: string
|
|
|
|
|
- statusGroupNames: string
|
|
|
|
|
- scoreType: string
|
|
|
|
|
- classType: string
|
|
|
|
|
- classIdCode: string
|
|
|
|
|
- classLevel: string | number
|
|
|
|
|
- classGroupId: string
|
|
|
|
|
- classGroupName: string
|
|
|
|
|
- classGroupNames: string[]
|
|
|
|
|
|
|
+ examId: string;
|
|
|
|
|
+ examLevel: number; // 修正为 number
|
|
|
|
|
+ subjectCode: string;
|
|
|
|
|
+ subjectName: string;
|
|
|
|
|
+ subjectId: string;
|
|
|
|
|
+ subjectGroupType: number;
|
|
|
|
|
+ isTotal: number | string;
|
|
|
|
|
+ subjectGroupCodes: string;
|
|
|
|
|
+ schoolId: string;
|
|
|
|
|
+ schoolLevel: string | number;
|
|
|
|
|
+ schoolGroupId: string;
|
|
|
|
|
+ schoolGroupName: string | null;
|
|
|
|
|
+ schoolName: string | null;
|
|
|
|
|
+ schoolGroupNames: string;
|
|
|
|
|
+ registrationType: string;
|
|
|
|
|
+ registrationName: string | null;
|
|
|
|
|
+ registrationGroupId: string;
|
|
|
|
|
+ statusGroupNames: string;
|
|
|
|
|
+ scoreType: string;
|
|
|
|
|
+ classType: string;
|
|
|
|
|
+ classIdCode: string;
|
|
|
|
|
+ classLevel: string | number;
|
|
|
|
|
+ classGroupId: string;
|
|
|
|
|
+ classGroupName: string;
|
|
|
|
|
+ classGroupNames: string[];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// 筛选数据
|
|
|
|
|
|
|
+// --- 状态数据 ---
|
|
|
const filtersData = ref<FilterItem[]>([
|
|
const filtersData = ref<FilterItem[]>([
|
|
|
- { label: '科目名称', type: 'subjectName', list: [], value: '' },
|
|
|
|
|
- { label: '学校名称', type: 'schoolName', list: [], value: '' },
|
|
|
|
|
- { label: '学生类型', type: 'registrationType', list: [], value: '' },
|
|
|
|
|
- { label: '分数类型', type: 'scoreType', list: [], value: '' },
|
|
|
|
|
- { label: '班级类型', type: 'classType', list: [], value: '' },
|
|
|
|
|
- { label: '班级名称', type: 'className', list: [], value: '' },
|
|
|
|
|
-])
|
|
|
|
|
-
|
|
|
|
|
-// 筛选联动工具函数
|
|
|
|
|
|
|
+ { label: "科目名称", type: "subjectName", list: [], value: "" },
|
|
|
|
|
+ { label: "学校名称", type: "schoolName", list: [], value: "" },
|
|
|
|
|
+ { label: "学生类型", type: "registrationType", list: [], value: "" },
|
|
|
|
|
+ { label: "分数类型", type: "scoreType", list: [], value: "" },
|
|
|
|
|
+ { label: "班级类型", type: "classType", list: [], value: "" },
|
|
|
|
|
+ { label: "班级名称", type: "className", list: [], value: "" },
|
|
|
|
|
+]);
|
|
|
|
|
+
|
|
|
|
|
+// --- 工具函数 ---
|
|
|
const updateBySchool = (school: FilterOption) => {
|
|
const updateBySchool = (school: FilterOption) => {
|
|
|
- if (!school) return
|
|
|
|
|
- const registrationTypeList = school.selectStatusVoList.map((item: any) => ({
|
|
|
|
|
|
|
+ if (!school || !school.selectStatusVoList) return;
|
|
|
|
|
+
|
|
|
|
|
+ const registrationTypeList: FilterOption[] = school.selectStatusVoList.map((item: StatusItem) => ({
|
|
|
label: item.statusName,
|
|
label: item.statusName,
|
|
|
- value: `${item.statusGroupType || ''}${item.statusGroupId || ''}${item.statusName || ''}`,
|
|
|
|
|
|
|
+ value: `${item.statusGroupType || ""}${item.statusGroupId || ""}${item.statusName || ""}`,
|
|
|
statusGroupType: item.statusGroupType,
|
|
statusGroupType: item.statusGroupType,
|
|
|
statusName: item.statusName,
|
|
statusName: item.statusName,
|
|
|
statusGroupId: item.statusGroupId,
|
|
statusGroupId: item.statusGroupId,
|
|
|
examCommonSelectScoreList: item.examCommonSelectScoreList,
|
|
examCommonSelectScoreList: item.examCommonSelectScoreList,
|
|
|
statusGroupNames: item.statusGroupNames,
|
|
statusGroupNames: item.statusGroupNames,
|
|
|
- }))
|
|
|
|
|
- filtersData.value[2].list = registrationTypeList
|
|
|
|
|
- filtersData.value[2].value = registrationTypeList[0]?.value || ''
|
|
|
|
|
- updateByStatus(registrationTypeList[0])
|
|
|
|
|
-}
|
|
|
|
|
|
|
+ }));
|
|
|
|
|
+
|
|
|
|
|
+ filtersData.value[2].list = registrationTypeList;
|
|
|
|
|
+ filtersData.value[2].value = registrationTypeList[0]?.value || "";
|
|
|
|
|
+ updateByStatus(registrationTypeList[0]);
|
|
|
|
|
+};
|
|
|
|
|
|
|
|
const updateByStatus = (status: FilterOption) => {
|
|
const updateByStatus = (status: FilterOption) => {
|
|
|
- if (!status) return
|
|
|
|
|
- const scoreTypeList = status.examCommonSelectScoreList.map((item: any) => ({
|
|
|
|
|
|
|
+ if (!status || !status.examCommonSelectScoreList) return;
|
|
|
|
|
+
|
|
|
|
|
+ const scoreTypeList: FilterOption[] = status.examCommonSelectScoreList.map((item: ScoreTypeItem) => ({
|
|
|
label: item.typeName,
|
|
label: item.typeName,
|
|
|
value: item.scoreType,
|
|
value: item.scoreType,
|
|
|
selectClassVoList: item.selectClassVoList,
|
|
selectClassVoList: item.selectClassVoList,
|
|
|
- }))
|
|
|
|
|
- filtersData.value[3].list = scoreTypeList
|
|
|
|
|
- filtersData.value[3].value = scoreTypeList[0]?.value || ''
|
|
|
|
|
- updateByScoreType(scoreTypeList[0])
|
|
|
|
|
-}
|
|
|
|
|
|
|
+ }));
|
|
|
|
|
+
|
|
|
|
|
+ filtersData.value[3].list = scoreTypeList;
|
|
|
|
|
+ filtersData.value[3].value = scoreTypeList[0]?.value || "";
|
|
|
|
|
+ updateByScoreType(scoreTypeList[0]);
|
|
|
|
|
+};
|
|
|
|
|
|
|
|
const updateByScoreType = (type: FilterOption) => {
|
|
const updateByScoreType = (type: FilterOption) => {
|
|
|
- if (!type) return
|
|
|
|
|
- const classTypeList = type.selectClassVoList.map((item: any) => ({
|
|
|
|
|
|
|
+ if (!type || !type.selectClassVoList) return;
|
|
|
|
|
+
|
|
|
|
|
+ const classTypeList: FilterOption[] = type.selectClassVoList.map((item: ClassTypeItem) => ({
|
|
|
label: item.typeName,
|
|
label: item.typeName,
|
|
|
value: item.classType,
|
|
value: item.classType,
|
|
|
selectInfoVoList: item.selectInfoVoList,
|
|
selectInfoVoList: item.selectInfoVoList,
|
|
|
- }))
|
|
|
|
|
- filtersData.value[4].list = classTypeList
|
|
|
|
|
- filtersData.value[4].value = classTypeList[0]?.value || ''
|
|
|
|
|
- updateByClassType(classTypeList[0])
|
|
|
|
|
-}
|
|
|
|
|
|
|
+ }));
|
|
|
|
|
+
|
|
|
|
|
+ filtersData.value[4].list = classTypeList;
|
|
|
|
|
+ filtersData.value[4].value = classTypeList[0]?.value || "";
|
|
|
|
|
+ updateByClassType(classTypeList[0]);
|
|
|
|
|
+};
|
|
|
|
|
|
|
|
const updateByClassType = (classType: FilterOption) => {
|
|
const updateByClassType = (classType: FilterOption) => {
|
|
|
- if (!classType) return
|
|
|
|
|
- const classList = (classType.selectInfoVoList || []).map((item: any) => ({
|
|
|
|
|
|
|
+ if (!classType || !classType.selectInfoVoList) return;
|
|
|
|
|
+
|
|
|
|
|
+ const classList: FilterOption[] = (classType.selectInfoVoList || []).map((item: ClassItem) => ({
|
|
|
label: item.className,
|
|
label: item.className,
|
|
|
- value: `${item.classLevel || ''}${item.classGroupId || ''}${item.classIdCode || ''}`,
|
|
|
|
|
|
|
+ value: `${item.classLevel || ""}${item.classGroupId || ""}${item.classIdCode || ""}`,
|
|
|
classLevel: item.classLevel,
|
|
classLevel: item.classLevel,
|
|
|
className: item.className,
|
|
className: item.className,
|
|
|
classCode: item.classCode,
|
|
classCode: item.classCode,
|
|
|
classIdCode: item.classIdCode,
|
|
classIdCode: item.classIdCode,
|
|
|
classGroupId: item.classGroupId,
|
|
classGroupId: item.classGroupId,
|
|
|
classGroupNames: item.classGroupNames,
|
|
classGroupNames: item.classGroupNames,
|
|
|
- }))
|
|
|
|
|
- filtersData.value[5].list = classList
|
|
|
|
|
- filtersData.value[5].value = classList[0]?.value || ''
|
|
|
|
|
-}
|
|
|
|
|
|
|
+ }));
|
|
|
|
|
|
|
|
-// 构建筛选参数并刷新子页面
|
|
|
|
|
-const buildAndSaveFilterParams = () => {
|
|
|
|
|
- const courseObj = filtersData.value[0].list.find(item => item.value === filtersData.value[0].value)
|
|
|
|
|
- const schoolObj = filtersData.value[1].list.find(item => item.value === filtersData.value[1].value)
|
|
|
|
|
- const statusObj = filtersData.value[2].list.find(item => item.value === filtersData.value[2].value)
|
|
|
|
|
- const classObj = filtersData.value[5].list.find(item => item.value === filtersData.value[5].value)
|
|
|
|
|
|
|
+ filtersData.value[5].list = classList;
|
|
|
|
|
+ filtersData.value[5].value = classList[0]?.value || "";
|
|
|
|
|
+};
|
|
|
|
|
|
|
|
- if (!courseObj || !schoolObj || !statusObj) return
|
|
|
|
|
|
|
+// 构建筛选参数并保存
|
|
|
|
|
+const buildAndSaveFilterParams = () => {
|
|
|
|
|
+ const courseObj = filtersData.value[0].list.find(
|
|
|
|
|
+ (item) => item.value === filtersData.value[0].value,
|
|
|
|
|
+ );
|
|
|
|
|
+ const schoolObj = filtersData.value[1].list.find(
|
|
|
|
|
+ (item) => item.value === filtersData.value[1].value,
|
|
|
|
|
+ );
|
|
|
|
|
+ const statusObj = filtersData.value[2].list.find(
|
|
|
|
|
+ (item) => item.value === filtersData.value[2].value,
|
|
|
|
|
+ );
|
|
|
|
|
+ const classObj = filtersData.value[5].list.find(
|
|
|
|
|
+ (item) => item.value === filtersData.value[5].value,
|
|
|
|
|
+ );
|
|
|
|
|
+
|
|
|
|
|
+ if (!courseObj || !schoolObj || !statusObj) return;
|
|
|
|
|
|
|
|
const filterObject: FilterParams = {
|
|
const filterObject: FilterParams = {
|
|
|
- examId:'2036963589738971137',
|
|
|
|
|
- examLevel:2,//单校
|
|
|
|
|
|
|
+ examId: "2036963589738971137",
|
|
|
|
|
+ examLevel: 2, // 单校
|
|
|
subjectCode: courseObj.subjectCode,
|
|
subjectCode: courseObj.subjectCode,
|
|
|
subjectName: courseObj.subjectName,
|
|
subjectName: courseObj.subjectName,
|
|
|
subjectId: courseObj.subjectId,
|
|
subjectId: courseObj.subjectId,
|
|
@@ -207,118 +233,163 @@ const buildAndSaveFilterParams = () => {
|
|
|
schoolId: schoolObj.schoolId,
|
|
schoolId: schoolObj.schoolId,
|
|
|
schoolLevel: schoolObj.schoolLevel,
|
|
schoolLevel: schoolObj.schoolLevel,
|
|
|
schoolGroupId: schoolObj.schoolGroupId,
|
|
schoolGroupId: schoolObj.schoolGroupId,
|
|
|
- schoolGroupName: (schoolObj.schoolLevel === 0 || schoolObj.schoolLevel === 2) ? null : schoolObj.schoolName,
|
|
|
|
|
|
|
+ schoolGroupName:
|
|
|
|
|
+ schoolObj.schoolLevel === 0 || schoolObj.schoolLevel === 2
|
|
|
|
|
+ ? null
|
|
|
|
|
+ : schoolObj.schoolName,
|
|
|
schoolName: schoolObj.schoolLevel === 2 ? schoolObj.schoolName : null,
|
|
schoolName: schoolObj.schoolLevel === 2 ? schoolObj.schoolName : null,
|
|
|
schoolGroupNames: schoolObj.schoolGroupNames,
|
|
schoolGroupNames: schoolObj.schoolGroupNames,
|
|
|
|
|
|
|
|
registrationType: statusObj.statusGroupType,
|
|
registrationType: statusObj.statusGroupType,
|
|
|
- registrationName: statusObj.statusName === '全部' ? null : statusObj.statusName,
|
|
|
|
|
|
|
+ registrationName:
|
|
|
|
|
+ statusObj.statusName === "全部" ? null : statusObj.statusName,
|
|
|
registrationGroupId: statusObj.statusGroupId,
|
|
registrationGroupId: statusObj.statusGroupId,
|
|
|
statusGroupNames: statusObj.statusGroupNames,
|
|
statusGroupNames: statusObj.statusGroupNames,
|
|
|
|
|
|
|
|
scoreType: filtersData.value[3].value,
|
|
scoreType: filtersData.value[3].value,
|
|
|
classType: filtersData.value[4].value,
|
|
classType: filtersData.value[4].value,
|
|
|
|
|
|
|
|
- classIdCode: classObj?.classIdCode || '',
|
|
|
|
|
|
|
+ classIdCode: classObj?.classIdCode || "",
|
|
|
classLevel: classObj?.classLevel || 0,
|
|
classLevel: classObj?.classLevel || 0,
|
|
|
- classGroupId: classObj?.classGroupId || '',
|
|
|
|
|
- classGroupName: classObj?.className || '',
|
|
|
|
|
|
|
+ classGroupId: classObj?.classGroupId || "",
|
|
|
|
|
+ classGroupName: classObj?.className || "",
|
|
|
classGroupNames: classObj?.classGroupNames || [],
|
|
classGroupNames: classObj?.classGroupNames || [],
|
|
|
- }
|
|
|
|
|
|
|
+ };
|
|
|
|
|
|
|
|
- analysisStore.setFilterObject(filterObject)
|
|
|
|
|
-}
|
|
|
|
|
|
|
+ analysisStore.setFilterObject(filterObject);
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+// --- 业务逻辑 ---
|
|
|
|
|
|
|
|
-// 初始化加载
|
|
|
|
|
|
|
+// 初始化加载公共筛选列表
|
|
|
const getCommonSelectList = async () => {
|
|
const getCommonSelectList = async () => {
|
|
|
try {
|
|
try {
|
|
|
- const res = await findCommonSelectList({ aiExamId: '2036963589738971137' })
|
|
|
|
|
- if (res.code !== 200 || !res.data?.length) return
|
|
|
|
|
-
|
|
|
|
|
- const subjectList: FilterOption[] = (res.data as SubjectItem[]).map(item => ({
|
|
|
|
|
- label: item.subjectName,
|
|
|
|
|
- value: item.subjectCode,
|
|
|
|
|
- subjectName: item.subjectName,
|
|
|
|
|
- subjectId: item.subjectId,
|
|
|
|
|
- subjectCode: item.subjectCode,
|
|
|
|
|
- isTotal: item.isTotal,
|
|
|
|
|
- subjectGroupType: item.subjectGroupType,
|
|
|
|
|
- isTotalScore: item.subjectGroupType === 1,
|
|
|
|
|
- isMulCourse: item.subjectGroupType === 1,
|
|
|
|
|
- selectSchoolVoList: item.selectSchoolVoList,
|
|
|
|
|
- subjectGroupCodes: item.subjectGroupCodes,
|
|
|
|
|
- }))
|
|
|
|
|
-
|
|
|
|
|
- if (!subjectList.length) return
|
|
|
|
|
- filtersData.value[0].list = subjectList
|
|
|
|
|
- filtersData.value[0].value = subjectList[0].value
|
|
|
|
|
-
|
|
|
|
|
- const schoolList = subjectList[0].selectSchoolVoList.map((item: any) => ({
|
|
|
|
|
|
|
+ const res = await findCommonSelectList({ aiExamId: "2036963589738971137" });
|
|
|
|
|
+ if (res.code !== 200 || !res.data?.length) return;
|
|
|
|
|
+
|
|
|
|
|
+ const subjectList: FilterOption[] = (res.data as SubjectItem[])
|
|
|
|
|
+ .filter((item) => item.isTotal === 0)
|
|
|
|
|
+ .map((item) => ({
|
|
|
|
|
+ label: item.subjectName,
|
|
|
|
|
+ value: item.subjectCode,
|
|
|
|
|
+ subjectName: item.subjectName,
|
|
|
|
|
+ subjectId: item.subjectId,
|
|
|
|
|
+ subjectCode: item.subjectCode,
|
|
|
|
|
+ isTotal: item.isTotal,
|
|
|
|
|
+ subjectGroupType: item.subjectGroupType,
|
|
|
|
|
+ isTotalScore: item.subjectGroupType === 1,
|
|
|
|
|
+ isMulCourse: item.subjectGroupType === 1,
|
|
|
|
|
+ selectSchoolVoList: item.selectSchoolVoList,
|
|
|
|
|
+ subjectGroupCodes: item.subjectGroupCodes,
|
|
|
|
|
+ }));
|
|
|
|
|
+
|
|
|
|
|
+ if (!subjectList.length) return;
|
|
|
|
|
+
|
|
|
|
|
+ filtersData.value[0].list = subjectList;
|
|
|
|
|
+ filtersData.value[0].value = subjectList[0].value;
|
|
|
|
|
+
|
|
|
|
|
+ const firstSubject = subjectList[0];
|
|
|
|
|
+ if (!firstSubject.selectSchoolVoList) return;
|
|
|
|
|
+
|
|
|
|
|
+ const schoolList: FilterOption[] = firstSubject.selectSchoolVoList.map((item: SchoolItem) => ({
|
|
|
label: item.schoolName,
|
|
label: item.schoolName,
|
|
|
- value: `${item.schoolLevel || ''}${item.schoolGroupId || ''}${item.schoolId || ''}`,
|
|
|
|
|
|
|
+ value: `${item.schoolLevel || ""}${item.schoolGroupId || ""}${item.schoolId || ""}`,
|
|
|
schoolId: item.schoolId,
|
|
schoolId: item.schoolId,
|
|
|
schoolName: item.schoolName,
|
|
schoolName: item.schoolName,
|
|
|
schoolLevel: item.schoolLevel,
|
|
schoolLevel: item.schoolLevel,
|
|
|
schoolGroupId: item.schoolGroupId,
|
|
schoolGroupId: item.schoolGroupId,
|
|
|
selectStatusVoList: item.selectStatusVoList,
|
|
selectStatusVoList: item.selectStatusVoList,
|
|
|
schoolGroupNames: item.schoolGroupNames,
|
|
schoolGroupNames: item.schoolGroupNames,
|
|
|
- }))
|
|
|
|
|
-
|
|
|
|
|
- filtersData.value[1].list = schoolList
|
|
|
|
|
- filtersData.value[1].value = schoolList[0]?.value || ''
|
|
|
|
|
- updateBySchool(schoolList[0])
|
|
|
|
|
- buildAndSaveFilterParams()
|
|
|
|
|
|
|
+ }));
|
|
|
|
|
+
|
|
|
|
|
+ filtersData.value[1].list = schoolList;
|
|
|
|
|
+ filtersData.value[1].value = schoolList[0]?.value || "";
|
|
|
|
|
+
|
|
|
|
|
+ if (schoolList[0]) {
|
|
|
|
|
+ updateBySchool(schoolList[0]);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ buildAndSaveFilterParams();
|
|
|
} catch (err) {
|
|
} catch (err) {
|
|
|
- console.error('获取筛选数据失败:', err)
|
|
|
|
|
|
|
+ console.error("获取筛选数据失败:", err);
|
|
|
}
|
|
}
|
|
|
-}
|
|
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+// 获取任务的相关配置和信息
|
|
|
|
|
+const loadAnalysisExamInfo = async () => {
|
|
|
|
|
+ try {
|
|
|
|
|
+ // 如果 subjectCode 可能为空,可能需要处理
|
|
|
|
|
+ const currentSubjectCode = subjectCode.value;
|
|
|
|
|
+ if (!currentSubjectCode) {
|
|
|
|
|
+ console.warn("Subject code is not available");
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ const res = await fetchAnalysisExamInfo({
|
|
|
|
|
+ examId: "2036963589738971137",
|
|
|
|
|
+ subjectCode: currentSubjectCode,
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ if (res.code === 200 && res.data) {
|
|
|
|
|
+ analysisStore.setAnalysisExamInfo(res.data);
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ console.error("获取分析考试信息失败:", error);
|
|
|
|
|
+ }
|
|
|
|
|
+};
|
|
|
|
|
|
|
|
-// 筛选切换
|
|
|
|
|
|
|
+// 筛选切换处理
|
|
|
const handleSelectChange = (index: number, value: string) => {
|
|
const handleSelectChange = (index: number, value: string) => {
|
|
|
- filtersData.value[index].value = value
|
|
|
|
|
- const selectedItem = filtersData.value[index].list.find(item => item.value === value)
|
|
|
|
|
- if (!selectedItem) return
|
|
|
|
|
|
|
+ filtersData.value[index].value = value;
|
|
|
|
|
+ const selectedItem = filtersData.value[index].list.find(
|
|
|
|
|
+ (item) => item.value === value,
|
|
|
|
|
+ );
|
|
|
|
|
+ if (!selectedItem) return;
|
|
|
|
|
|
|
|
- const { type } = filtersData.value[index]
|
|
|
|
|
|
|
+ const { type } = filtersData.value[index];
|
|
|
|
|
|
|
|
- if (type === 'subjectName') {
|
|
|
|
|
- const schoolList = selectedItem.selectSchoolVoList.map((item: any) => ({
|
|
|
|
|
|
|
+ if (type === "subjectName") {
|
|
|
|
|
+ if (!selectedItem.selectSchoolVoList) return;
|
|
|
|
|
+ const schoolList: FilterOption[] = selectedItem.selectSchoolVoList.map((item: SchoolItem) => ({
|
|
|
label: item.schoolName,
|
|
label: item.schoolName,
|
|
|
- value: `${item.schoolLevel || ''}${item.schoolGroupId || ''}${item.schoolId || ''}`,
|
|
|
|
|
|
|
+ value: `${item.schoolLevel || ""}${item.schoolGroupId || ""}${item.schoolId || ""}`,
|
|
|
schoolId: item.schoolId,
|
|
schoolId: item.schoolId,
|
|
|
schoolName: item.schoolName,
|
|
schoolName: item.schoolName,
|
|
|
schoolLevel: item.schoolLevel,
|
|
schoolLevel: item.schoolLevel,
|
|
|
schoolGroupId: item.schoolGroupId,
|
|
schoolGroupId: item.schoolGroupId,
|
|
|
selectStatusVoList: item.selectStatusVoList,
|
|
selectStatusVoList: item.selectStatusVoList,
|
|
|
schoolGroupNames: item.schoolGroupNames,
|
|
schoolGroupNames: item.schoolGroupNames,
|
|
|
- }))
|
|
|
|
|
- filtersData.value[1].list = schoolList
|
|
|
|
|
- filtersData.value[1].value = schoolList[0]?.value || ''
|
|
|
|
|
- updateBySchool(schoolList[0])
|
|
|
|
|
|
|
+ }));
|
|
|
|
|
+ filtersData.value[1].list = schoolList;
|
|
|
|
|
+ filtersData.value[1].value = schoolList[0]?.value || "";
|
|
|
|
|
+ if (schoolList[0]) {
|
|
|
|
|
+ updateBySchool(schoolList[0]);
|
|
|
|
|
+ }
|
|
|
|
|
+ } else if (type === "schoolName") {
|
|
|
|
|
+ updateBySchool(selectedItem);
|
|
|
|
|
+ } else if (type === "registrationType") {
|
|
|
|
|
+ updateByStatus(selectedItem);
|
|
|
|
|
+ } else if (type === "scoreType") {
|
|
|
|
|
+ updateByScoreType(selectedItem);
|
|
|
|
|
+ } else if (type === "classType") {
|
|
|
|
|
+ updateByClassType(selectedItem);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (type === 'schoolName') updateBySchool(selectedItem)
|
|
|
|
|
- if (type === 'registrationType') updateByStatus(selectedItem)
|
|
|
|
|
- if (type === 'scoreType') updateByScoreType(selectedItem)
|
|
|
|
|
- if (type === 'classType') updateByClassType(selectedItem)
|
|
|
|
|
|
|
+ buildAndSaveFilterParams();
|
|
|
|
|
+};
|
|
|
|
|
|
|
|
- buildAndSaveFilterParams()
|
|
|
|
|
-}
|
|
|
|
|
// 回到顶部
|
|
// 回到顶部
|
|
|
const goToPageTop = () => {
|
|
const goToPageTop = () => {
|
|
|
- window.scrollTo({ top: 0, behavior: 'smooth' })
|
|
|
|
|
-}
|
|
|
|
|
|
|
+ reportContentRef.value?.scrollTo({ top: 0, behavior: "smooth" });
|
|
|
|
|
+};
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
- getCommonSelectList()
|
|
|
|
|
-})
|
|
|
|
|
|
|
+ getCommonSelectList();
|
|
|
|
|
+ loadAnalysisExamInfo();
|
|
|
|
|
+});
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
|
-.page_report_main {
|
|
|
|
|
- width: 100%;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
.report_bottom {
|
|
.report_bottom {
|
|
|
width: 100%;
|
|
width: 100%;
|
|
|
padding: 20px 0;
|
|
padding: 20px 0;
|