Просмотр исходного кода

导航添加联校分析报告

liurongli 5 месяцев назад
Родитель
Сommit
35c489738c

+ 4 - 4
src/App.vue

@@ -1,6 +1,6 @@
 <template>
     <div id="app" ref="app">
-        <router-view></router-view>
+        <router-view :key="$route.fullPath"></router-view>
     </div>
 </template>
 
@@ -13,13 +13,13 @@ export default {
     mounted() {
         // INFO: 本地调试,自动登录
         if (process.env.NODE_ENV === 'development') {
-            // this.SubmitLogin();
+            this.SubmitLogin();
         }
     },
     methods: {
         SubmitLogin() {
-            const username = '50002100001';
-            const password = '50002100001';
+            const username = '99689820198805';
+            const password = '123456';
             const type = '2';
             sessionStorage.setItem('schoolType', type);
             user.loginEmailPass({

+ 2 - 2
src/components/StudentPaper.vue

@@ -61,7 +61,7 @@
 <script>
 
 import PaperImage from '@/components/PaperImage.vue';//学生试卷组件
-
+import {getApiName} from '@/utils/common';
 export default {
     name: 'StudentPaper',//学生试卷组件
     components:
@@ -192,7 +192,7 @@ export default {
         if(this.paperInfo.examId!='' && this.paperInfo.subjectCode!=null)
         {
           this.isLoading=true;
-          this.$api.reportStudent.findStudentCard(this.paperInfo).then(res=>{
+          this.$api.reportStudent[getApiName()].findStudentCard(this.paperInfo).then(res=>{
             console.log("打印学生试卷详情信息",res);
             
             

+ 4 - 3
src/http/api/reportStudent.js

@@ -160,6 +160,7 @@ const schoolReport = {
         );
     },
 };
-const schoolType = sessionStorage.getItem('schoolType') ?? '1';//1:单校  2:联校
-const report = schoolType=='1'?schoolReport:jointSchoolReport;
-export default { ...report };
+// const schoolType = sessionStorage.getItem('schoolType') ?? '1';//1:单校  2:联校
+// const report = schoolType=='1'?schoolReport:jointSchoolReport;
+// export default { ...report };
+export default { schoolReport,jointSchoolReport };

+ 8 - 1
src/router/index.js

@@ -49,12 +49,19 @@ let studentAnalysisReport = {
     component: () => import("@/views/analysisReport/index"),
     children: [
         {
-            path: "/studentAnalysisReport/list", // 报告列表
+            path: "/jointStudentAnalysisReport/list", // 报告列表
             meta: {
                 title: "分析报告",
             },
             component: () => import("@/views/analysisReport/studentPage/list/mainPage"),
         },
+        {
+            path: "/studentAnalysisReport/list", // 报告列表
+            meta: {
+                title: "校考分析报告",
+            },
+            component: () => import("@/views/analysisReport/studentPage/list/mainPage"),
+        },
         {
             name: "reportDetails",
             path: "/studentAnalysisReport/reportDetails",

+ 5 - 0
src/utils/common.js

@@ -260,4 +260,9 @@ export function mmToPx(num) {
     const result=examTypesColor[type].background;
     
     return result;
+  }
+  //获取当前接口地址名称
+  export function getApiName(){
+    const schoolType = sessionStorage.getItem('schoolType') ?? '1';//1:单校  2:联校
+    return schoolType=='1'?'schoolReport':'jointSchoolReport'
   }

+ 2 - 4
src/views/analysisReport/studentPage/list/mainPage.vue

@@ -63,7 +63,7 @@
 </template>
 <script>
 import FiltersItem from "@/components/FiltersItem_ruoyan.vue";
-
+import {getApiName} from '@/utils/common';
 export default {
   components: { FiltersItem },
   data() {
@@ -283,9 +283,7 @@ export default {
         examTypeCode: this.params.examType, // 考试类型
       };
       // 获取考试分析列表数据
-      this.$api.reportStudent
-        .queryStudentExamDataList(param)
-        .then((res) => {
+      this.$api.reportStudent[getApiName()].queryStudentExamDataList(param).then((res) => {
           if (res.code === 200) {
             this.listData = res?.data?.examData || [];
             this.pageInfo.total = this.listData.length;

+ 9 - 18
src/views/analysisReport/studentPage/scrolReport/transcript_single.vue

@@ -342,6 +342,7 @@ import ExpandableText from '@/views/analysisReport/components/ExpandableText' //
 import LineChart from '@/views/analysisReport/components/dCharts/lineChart' //折线图
 import GaugeChart from '@/views/analysisReport/components/dCharts/GaugeChart'
 import GotoTop from '@/views/analysisReport/components/GotoTop' //分析报告页面底部回到顶部组件
+import {getApiName} from '@/utils/common';
 import { mapGetters } from 'vuex'
 export default {
   name: 'subjectQuality',
@@ -539,9 +540,7 @@ export default {
     //学生端查询单科-我的成绩
     QueryOneSubjectData() {
       this.subjectLoading = true
-      this.$api.reportStudent
-        .queryOneSubjectData(this.reportParam)
-        .then(res => {
+      this.$api.reportStudent[getApiName()].queryOneSubjectData(this.reportParam).then(res => {
           if (res.code == 200 && res.data) {
             this.subjectData.data = res.data
             const academicLevelData = res.data.academicLevelData;
@@ -577,12 +576,10 @@ export default {
     //查询学生答题卡带批阅痕迹的
     FindStudentCard() {
       this.answerCard.loading = true
-      this.$api.reportStudent
-        .findStudentCard({
+      this.$api.reportStudent[getApiName()].findStudentCard({
           examId: this.reportParam.examId, //考试ID
           subjectCode: this.reportParam.subjectCode //科目code
-        })
-        .then(res => {
+        }).then(res => {
           if (res.code == 200 && res.data) {
             this.answerCard.paperImageList = res?.data?.pageVOS || [];
             this.answerCard.studentCode = res?.data?.studentCode ?? ''
@@ -622,9 +619,7 @@ export default {
     //学生端查询单科-小题分析(表格-图表)
     QueryOneSubjectSmallQuestionData() {
       this.groupData.smallQuestionData.loading = true
-      this.$api.reportStudent
-        .queryOneSubjectSmallQuestionData(this.reportParam)
-        .then(res => {
+      this.$api.reportStudent[getApiName()].queryOneSubjectSmallQuestionData(this.reportParam).then(res => {
           if (res.code == 200 && res.data) {
             const tableData = res.data.tableData || []
             const titleData = res.data.titleData || []
@@ -704,9 +699,7 @@ export default {
       this.groupData.bigQuestionData.loading = true
       this.groupData.knowledgePointQuestionData.loading = true
       this.groupData.abilityQuestionData.loading = true
-      this.$api.reportStudent
-        .queryOneSubjectGroupQuestionData(this.reportParam)
-        .then(res => {
+      this.$api.reportStudent[getApiName()].queryOneSubjectGroupQuestionData(this.reportParam).then(res => {
           if (res.code == 200 && res.data) {
             const { bigQuestion, knowledgePointQuestion, abilityQuestion } = res.data
             if (bigQuestion && bigQuestion?.tableData?.length > 0) {
@@ -769,7 +762,7 @@ export default {
     },
     //学生端查询单科-自定义分组
     QueryOneSubjectCustomGroupQuestion() {
-      this.$api.reportStudent.queryOneSubjectCustomGroupQuestion(this.reportParam).then(res => {
+      this.$api.reportStudent[getApiName()].queryOneSubjectCustomGroupQuestion(this.reportParam).then(res => {
         if (res.code == 200 && res.data) {
           const customQuestionData = res?.data?.customQuestionData ?? []
           if (customQuestionData && customQuestionData.length > 0) {
@@ -803,9 +796,7 @@ export default {
     //学生端查询单科-历次查询
     QueryOneSubjectHistoryExamData() {
       this.historyExamLoading = true
-      this.$api.reportStudent
-        .queryOneSubjectHistoryExamData(this.reportParam)
-        .then(res => {
+      this.$api.reportStudent[getApiName()].queryOneSubjectHistoryExamData(this.reportParam).then(res => {
           if (res.code == 200 && res.data) {
             const detailData = (res.data?.detailData || []).reverse()
             this.historyExamData.chartData = detailData
@@ -853,7 +844,7 @@ export default {
     },
     //学生端查询单科-总结建议
     QueryOneSubjectSuggestionData() {
-      this.$api.reportStudent.queryOneSubjectSuggestionData(this.reportParam).then(res => {
+      this.$api.reportStudent[getApiName()].queryOneSubjectSuggestionData(this.reportParam).then(res => {
         if (res.code == 200 && res.data) {
           const data = res.data
           //* 1-得分显示分数,小题分显示分数,2-得分显示分数,小题分显示对错

+ 4 - 7
src/views/analysisReport/studentPage/scrolReport/transcript_total.vue

@@ -188,6 +188,7 @@ import ExpandableText from '@/views/analysisReport/components/ExpandableText' //
 import LineChart from '@/views/analysisReport/components/dCharts/lineChart' //折线图
 import GotoTop from '@/views/analysisReport/components/GotoTop' //分析报告页面底部回到顶部组件
 import StudentPaper from '@/components/StudentPaper.vue' //学生答题卡预览组件
+import {getApiName} from '@/utils/common';
 import { mapGetters } from 'vuex'
 export default {
   name: 'subjectQuality',
@@ -285,9 +286,7 @@ export default {
     QueryMultiSubjectData() {
       //  获取表格数据
       this.subjectLoading = true
-      this.$api.reportStudent
-        .queryMultiSubjectData(this.reportParam)
-        .then(res => {
+      this.$api.reportStudent[getApiName()].queryMultiSubjectData(this.reportParam).then(res => {
           if (res.code == 200 && res.data) {
             this.subjectData.tableData = res.data.tableData || []
             this.subjectData.studentOpenness = res.data.studentOpenness ?? ''
@@ -363,9 +362,7 @@ export default {
         //学生端查询总分,多科历次信息,组合科目时,一定要传组合科目的名称,组合科目的历次是按照组合科目名称来查询
         param.subjectName = this.getSubjectName
       }
-      this.$api.reportStudent
-        .queryHistoryExamData({ ...param })
-        .then(res => {
+      this.$api.reportStudent[getApiName()].queryHistoryExamData({ ...param }).then(res => {
           if (res.code == 200 && res.data) {
             const detailData = (res.data?.detailData || []).reverse()
             this.historyExamData.chartData = detailData
@@ -413,7 +410,7 @@ export default {
     },
     //学生端查询总分,多科总结建议信息
     QuerySuggestionData() {
-      this.$api.reportStudent.querySuggestionData(this.reportParam).then(res => {
+      this.$api.reportStudent[getApiName()].querySuggestionData(this.reportParam).then(res => {
         if (res.code == 200 && res.data) {
           const data = res.data
           this.suggestionData = data

+ 1 - 1
src/views/layout/components/AppMain.vue

@@ -1,6 +1,6 @@
 <template>
   <el-main class="appMain">
-    <router-view></router-view>
+    <router-view :key="$route.fullPath"></router-view>
   </el-main>
 </template>
 <script>

+ 15 - 3
src/views/layout/components/Header.vue

@@ -202,6 +202,10 @@ export default {
      
       {
         menuName: "分析报告",
+        externalLink: "/jointStudentAnalysisReport/list",
+      },
+      {
+        menuName: "校考分析报告",
         externalLink: "/studentAnalysisReport/list",
       },
       {
@@ -254,15 +258,23 @@ export default {
     },
     activeMenu() {
       const path = this.$route.path;
-
       // 按优先级匹配
-      if (path === '/studentAnalysisReport' || path.startsWith('/studentAnalysisReport/')) {
+      if (path === '/studentAnalysisReport/list') {
+        sessionStorage.setItem('schoolType', 1);//单校
         this.activeMenuName = '/studentAnalysisReport/list';
+      } else if(path == '/jointStudentAnalysisReport/list'){
+        sessionStorage.setItem('schoolType', 2);//联校
+        this.activeMenuName = '/jointStudentAnalysisReport/list';
       } else if (path === '/userInfo' || path.startsWith('/userInfo/')) {
         this.activeMenuName = '/userInfo';
       } else {
         // 默认选中分析报告
-        this.activeMenuName = '/studentAnalysisReport/list';
+        const schoolType = sessionStorage.getItem('schoolType');
+        if(schoolType == 1){//单校
+          this.activeMenuName = '/studentAnalysisReport/list';
+        }else if(schoolType == 2){
+          this.activeMenuName = '/jointStudentAnalysisReport/list';
+        }
       }
     },
     menuSelect(key, keyPath) {

+ 1 - 1
src/views/login/login.vue

@@ -72,7 +72,7 @@ export default {
           console.log('打印用户信息', userInfo)
           this.$store.dispatch('user/CLEAR_LOCAL_STORAGE') //清空本地存储
           setToken(userInfo.tokenValue)
-          sessionStorage.setItem('schoolType', 2) //1:单校 2:联校// 暂时写死单校   线上还是单校的
+          sessionStorage.setItem('schoolType', 1) //1:单校 2:联校// 暂时写死单校   线上还是单校的
           this.$store.dispatch('user/SET_TOKEN', userInfo.tokenValue)
           this.$store.dispatch('user/SET_SCHOOL_LOGO', userInfo.schoolLogoUrl) //设置学校logo
           this.$store.dispatch('user/SET_SCHOOL_WEB_SITE_ID', userInfo.cloudMonitorSiteId || '') //设置学校网站id