Pārlūkot izejas kodu

成绩单添加答题卡

liurongli 13 stundas atpakaļ
vecāks
revīzija
fa7cec5dca
1 mainītis faili ar 65 papildinājumiem un 2 dzēšanām
  1. 65 2
      src/views/analysis/score.vue

+ 65 - 2
src/views/analysis/score.vue

@@ -75,7 +75,24 @@
           :label="item.label"
           min-width="80"
           fixed="left"
-        />
+        >
+          <template #default="scope">
+            <span
+              v-if="
+                scope.row.score != '缺考' &&
+                scope.row.score != '违纪' &&
+                item.prop === 'studentUserName'
+              "
+              @click="OpenStudentPaper(scope.row)"
+              style="cursor: pointer; color: #2e64fa"
+            >
+              {{ scope.row[item.prop] }}
+            </span>
+            <template v-else>
+              {{ scope.row?.[item.prop] || "-" }}
+            </template>
+          </template>
+        </el-table-column>
         <template v-if="state.checkList.includes('group')">
           <el-table-column
             v-for="(item, index) in state.groupDataTitleData"
@@ -115,10 +132,17 @@
       </el-table>
     </template>
   </ReportModule>
+  <StudentPaper
+    :modelValue="state.showStudentPaperDialog"
+    :paperInfo="state.paperInfo"
+    :pageTitle="state.paperTitle"
+    @updateModelValue="UpdateModelValue"
+  ></StudentPaper>
 </template>
 
 <script lang="ts" setup>
 import ReportModule from "@/components/ReportModule.vue";
+import StudentPaper from "@/components/StudentPaper.vue"; //学生答题卡组件
 import {
   studentTranscriptTitle,
   queryJointStudentStatistics,
@@ -128,7 +152,15 @@ import {
 import { useAnalysisStore } from "@/store/analysis";
 import { downloadExcel } from "@/utils/exportExcel";
 import { Search } from "@element-plus/icons-vue";
-import { nextTick, ref, onMounted, onUnmounted, reactive, watch } from "vue";
+import {
+  nextTick,
+  ref,
+  onMounted,
+  onUnmounted,
+  reactive,
+  computed,
+  watch,
+} from "vue";
 import { throttle } from "lodash";
 
 interface TableColumn {
@@ -162,9 +194,19 @@ interface State {
   pageInfo: PageInfo;
   tableLoading: Boolean;
   loadingText: String;
+  paperInfo: {
+    examPaperId: string; //考试科目id
+    platformNumber: string; //学籍号平台号
+    questionId: string; //题目id
+  };
+  paperTitle: String; //学生试卷标题
+  showStudentPaperDialog: Boolean; //是否显示学生答题卡弹窗
 }
 
 const analysisStore = useAnalysisStore();
+const getExamName = computed(() => {
+  return analysisStore.analysisExamInfo.examName || "";
+});
 
 const state = reactive<State>({
   keyWord: "",
@@ -186,6 +228,13 @@ const state = reactive<State>({
   },
   tableLoading: true,
   loadingText: "加载中……",
+  paperInfo: {
+    examPaperId: "", //考试科目id
+    platformNumber: "", //学籍号平台号
+    questionId: "", //题目id
+  }, //学生试卷信息
+  paperTitle: "", //学生试卷标题
+  showStudentPaperDialog: false, //是否显示学生答题卡弹窗
 });
 const tableRef = ref<any>(null);
 const reportModuleRef = ref<any>(null);
@@ -301,6 +350,20 @@ const ExportExcel = () => {
     reportModuleRef.value?.SetExportLoading?.(false);
   });
 };
+//打开答题卡弹窗
+const OpenStudentPaper = (row, prop) => {
+  state.paperInfo = {
+    examPaperId: analysisStore.filterObject.subjectId, //考试科目id
+    platformNumber: row.studentRegistrationCode, //学籍号平台号
+    questionId: "", //题目id
+  };
+  state.paperTitle = `${getExamName.value}-${analysisStore.filterObject.subjectName}-${row.className}-${row.studentUserName}`; //学生姓名
+  state.showStudentPaperDialog = true;
+};
+//更新弹窗状态
+const UpdateModelValue = (val: boolean) => {
+  state.showStudentPaperDialog = val;
+};
 // 搜索事件
 const HandleSearch = () => {
   state.pageInfo.pageNum = 1;