Эх сурвалжийг харах

个人画像-添加考试筛选

吴朋磊 2 сар өмнө
parent
commit
62e40ad64f

+ 55 - 9
src/views/analysisReport/personalProfile/MyGradeHistory.vue

@@ -9,9 +9,14 @@
     </div>
 
     <div class="content" v-if="gradeHistoryData.length > 0">
-      <el-table :data="tableData" style="width: 100%" border :header-cell-style="headerCellStyle"
-        :cell-style="cellStyle" stripe>
-        <el-table-column type="index" label="序号" width="70" align="center"></el-table-column>
+      <el-table ref="gradeTable" :data="tableData" style="width: 100%" border :header-cell-style="headerCellStyle"
+        :cell-style="cellStyle" stripe @selection-change="handleSelectionChange" width="55" align="center">
+        <el-table-column type="selection" width="55" align="center"></el-table-column>
+        <el-table-column type="index" label="序号" width="70" align="center">
+          <template slot-scope="scope">
+            {{scope.$index <10 ? '0' + (scope.$index + 1) : scope.$index + 1 }}
+          </template>
+        </el-table-column>
         <el-table-column prop="examName" label="考试名称" align="center"></el-table-column>
         <el-table-column prop="fullScore" label="满分" width="90" align="center"></el-table-column>
         <el-table-column prop="rawScore" label="原始分" width="90" align="center"></el-table-column>
@@ -43,9 +48,9 @@
     <StudentPaper v-model="showStudentPaperDialog" :paperInfo="paperInfo" :currentPageIndex="currentPageIndex"
       :pageTitle="paperTitle"></StudentPaper>
 
-        <!-- 历次考试对比弹窗 - 使用公共组件 -->
-    <BenchTaskSelect v-if="showBenchTaskSelect" :showDialog.sync="showBenchTaskSelect" :isMultiple="isMultiple"
-      :title="benchTaskTitle" :before="1" @GetSelectId="GetSelectId"></BenchTaskSelect>
+    <!-- 历次考试对比弹窗 - 使用公共组件 -->
+    <!-- <BenchTaskSelect v-if="showBenchTaskSelect" :showDialog.sync="showBenchTaskSelect" :isMultiple="isMultiple"
+      :title="benchTaskTitle" :before="1" @GetSelectId="GetSelectId"></BenchTaskSelect> -->
   </div>
 </template>
 
@@ -53,12 +58,12 @@
 import StudentPaper from '@/components/StudentPaper.vue' //学生答题卡预览组件
 import { mapGetters } from 'vuex'
 // 导入公共组件
-import BenchTaskSelect from '@/views/analysisReport/components/benchTaskSelectSchool';
+//import BenchTaskSelect from '@/views/analysisReport/components/benchTaskSelectSchool';
 
 export default {
   components: {
     StudentPaper,
-    BenchTaskSelect
+    // BenchTaskSelect
   },
   name: "MyGradeHistory",
   props: {
@@ -70,6 +75,11 @@ export default {
     gradeHistoryData: {
       type: Array,
       default: () => []
+    },
+    // 接收个人画像数据
+    portraitData: {
+      type: Object,
+      default: () => {}
     }
   },
   data() {
@@ -84,8 +94,34 @@ export default {
       isMultiple: true,
       // 弹窗标题
       benchTaskTitle: '历次考试对比',
+      // 是否正在初始化全选
+      isInitializing: false,
     };
   },
+  watch: {
+    // 监听gradeHistoryData变化,数据加载完成后默认全选
+    gradeHistoryData: {
+      handler(newVal) {
+        if (newVal && newVal.length > 0) {
+          this.$nextTick(() => {
+            if (this.$refs.gradeTable) {
+              // 设置初始化标志,避免触发selection-change事件
+              this.isInitializing = true;
+              // 先清空所有选择,再重新全选
+              this.$refs.gradeTable.clearSelection();
+              // 遍历表格数据,手动选中每一行
+              this.tableData.forEach(row => {
+                this.$refs.gradeTable.toggleRowSelection(row, true);
+              });
+              // 完成后重置标志
+              this.isInitializing = false;
+            }
+          });
+        }
+      },
+      immediate: true
+    }
+  },
   computed: {
     ...mapGetters(['userInfo']),
     pageName() {
@@ -136,9 +172,19 @@ export default {
         margin: '0',
         lineHeight: '50px'
       };
-    }
+    },
   },
   methods: {
+    // 处理选择变化
+    handleSelectionChange(selection) {
+      // 初始化过程中不触发事件,避免重复调用接口
+      if (this.isInitializing) {
+        return;
+      }
+      let selectedExamIds = selection.map(item => item.examId);
+      // 传递选中的考试ID给父组件
+      this.$emit('selection-change', selectedExamIds);
+    },
     // 历史考试对比弹窗
     showExamCompareDialog() {
       this.showBenchTaskSelect = true;

+ 10 - 2
src/views/analysisReport/personalProfile/index.vue

@@ -1,7 +1,7 @@
 <template>
     <div class="personalProfile">
         <!-- 我的历次成绩子组件 -->
-        <MyGradeHistory :grade-history-data="gradeHistoryData" v-loading="historyloading" />
+        <MyGradeHistory :grade-history-data="gradeHistoryData" v-loading="historyloading" @selection-change="handleSelectionChange" />
 
         <!-- 历次考试知识点追踪 -->
         <KnowledgeTrack 
@@ -249,7 +249,15 @@ export default {
                 }
             })
         },
-
+        // 处理选择变化
+        handleSelectionChange(selectedExamIds) {
+            console.log('选中的考试ID:', selectedExamIds);
+            this.portraitData.examIds = selectedExamIds;
+            // 历次考试知识点追踪
+            this.previousExamsData();
+            // 零分知识点、高频错题知识点(会自动调用 KnowledgeTrackData 和 pushQuestionData)
+            this.vulerabData();
+        },
         //历次考试知识点追踪
         previousExamsData() {
             // 加载状态-清空数据

+ 1 - 1
version.json

@@ -1,5 +1,5 @@
 {
-  "version": "0.1.3_2026_3_30_0",
+  "version": "0.1.3_2026_4_2_0",
   "content": [
     {
       "time": "2024-11-1",