소스 검색

个人画像隐藏功能优化

吴朋磊 2 달 전
부모
커밋
8bf05a7148
1개의 변경된 파일14개의 추가작업 그리고 49개의 파일을 삭제
  1. 14 49
      src/views/analysisReport/studentPage/mainPage.vue

+ 14 - 49
src/views/analysisReport/studentPage/mainPage.vue

@@ -36,7 +36,7 @@
 
                                 <button v-if="isShowKnowledgeButtons" class="mm_btn mb_10" :class="{ active: activeBtn === pathTwo }"
                                     @click="toPage(pathTwo)">个性化错题</button>
-                                <button v-if="isTotalScore" class="mm_btn mb_10" :class="{ active: activeBtn === pathThree }"
+                                <button v-if="!isTotalScore" class="mm_btn mb_10" :class="{ active: activeBtn === pathThree }"
                                     @click="toPage(pathThree)">个人画像</button>
                             </div>
 
@@ -84,28 +84,10 @@ export default {
         isTotalScore() {
             return this.$store.state.report.isTotalScore;
         },
-        // 动态过滤筛选数据,在个人画像页面隐藏总分选项
+        // 筛选数据,不再在个人画像页面隐藏总分选项
         filteredFilterData() {
-            // 检查当前是否在个人画像页面
-            const isPersonalProfilePage = this.$route.path === '/studentAnalysisReport/reportDetails/personalProfile';
-            
-            if (!isPersonalProfilePage) {
-                // 非个人画像页面,返回原始数据
-                return this.filterData;
-            }
-            
-            // 深拷贝原始数据,避免直接修改
-            const updatedFilterData = JSON.parse(JSON.stringify(this.filterData));
-            
-            // 遍历筛选数据,找到科目名称筛选项
-            updatedFilterData.forEach(filterItem => {
-                if (filterItem.type === 'subjectName') {
-                    // 过滤掉总分选项(isTotal为1或subjectGroupType为1的选项)
-                    filterItem.list = filterItem.list.filter(item => item.isTotal !== 1 && item.subjectGroupType !== 1);
-                }
-            });
-            
-            return updatedFilterData;
+            // 返回原始数据,不在个人画像页面隐藏总分选项
+            return this.filterData;
         }
     },
     data() {
@@ -192,14 +174,20 @@ export default {
                 isTotal: courseObj.isTotal //是否为总分科目 1为总分 0为非总分
             };
             //设置是否是总分
+            const isTotal = courseObj.isTotal == 1 || courseObj.subjectGroupType == 1;//1为总分 0为非总分  1为组合科目 0为非组合科目
             this.$store.commit("report/set_state", {
                 key: "isTotalScore",
-                value: courseObj.isTotal == 1 || courseObj.subjectGroupType == 1,//1为总分 0为非总分  1为组合科目 0为非组合科目
+                value: isTotal,
             });
 
             localStorage.setItem('reportExamCourseId', courseObj.subjectId);//单科的考试科目id
-            localStorage.setItem('reportIsTotalScore', courseObj.isTotal == 1 || courseObj.subjectGroupType == 1)
+            localStorage.setItem('reportIsTotalScore', isTotal)
             this.$store.dispatch("report/UpdateFilterObject", filterObject);
+            
+            // 如果选择了总分且当前在个人画像页面,跳转到成绩分析页面
+            if (isTotal && this.$route.path === '/studentAnalysisReport/reportDetails/personalProfile') {
+                this.toPage(this.pathOne);
+            }
         },
 
         // 滚动条事件
@@ -267,32 +255,9 @@ export default {
             this.stuPdfLoading = false;
         },
         
-        // 处理筛选数据更新,在个人画像页面隐藏总分选项
+        // 处理筛选数据更新
         handleFilterDataUpdate() {
-            // 检查当前是否在个人画像页面
-            const isPersonalProfilePage = this.$route.path === '/studentAnalysisReport/reportDetails/personalProfile';
-            
-            if (isPersonalProfilePage) {
-                // 深拷贝原始数据,避免直接修改props
-                const updatedFilterData = JSON.parse(JSON.stringify(this.filterData));
-                
-                // 遍历筛选数据,找到科目名称筛选项
-                updatedFilterData.forEach((filterItem, index) => {
-                    if (filterItem.type === 'subjectName') {
-                        // 过滤掉总分选项(isTotal为1的选项)
-                        const nonTotalItems = filterItem.list.filter(item => item.isTotal !== 1 && item.subjectGroupType !== 1);
-                        
-                        // 检查当前选中的是否是总分选项
-                        const currentSelected = filterItem.list.find(item => item.value === filterItem.value);
-                        const isCurrentTotal = currentSelected && (currentSelected.isTotal === 1 || currentSelected.subjectGroupType === 1);
-                        
-                        // 如果当前选中的是总分选项且有其他选项,切换到第一个非总分选项
-                        if (isCurrentTotal && nonTotalItems.length > 0) {
-                            this.ChangeFilters({ index, value: nonTotalItems[0].value });
-                        }
-                    }
-                });
-            }
+            // 不再在个人画像页面隐藏总分选项
         },
     },
     watch: {