zhangjie 1 долоо хоног өмнө
parent
commit
0cb0cd88c2

+ 1 - 0
components.d.ts

@@ -24,6 +24,7 @@ declare module '@vue/runtime-core' {
     ElForm: typeof import('element-plus/es')['ElForm'];
     ElFormItem: typeof import('element-plus/es')['ElFormItem'];
     ElIcon: typeof import('element-plus/es')['ElIcon'];
+    ElImageViewer: typeof import('element-plus/es')['ElImageViewer'];
     ElInput: typeof import('element-plus/es')['ElInput'];
     ElInputNumber: typeof import('element-plus/es')['ElInputNumber'];
     ElMenu: typeof import('element-plus/es')['ElMenu'];

+ 2 - 0
src/api/types/student.ts

@@ -50,6 +50,8 @@ export interface StudentItem {
   subject: string;
   // 试卷类型
   examType: string;
+  // 扫描图
+  sheetUrls: string[];
   // 层次
   level: string;
   // 专业类型

+ 24 - 0
src/views/student/StudentManage.vue

@@ -197,6 +197,14 @@
           <el-tag :type="scope.row.scanRecognition ? 'success' : 'danger'">
             {{ scope.row.scanRecognition ? '是' : '否' }}
           </el-tag>
+          <el-button
+            v-if="scope.row.sheetUrls.length > 0"
+            link
+            style="margin-left: 5px"
+            @click="onPreviewImg(scope.row)"
+          >
+            原图
+          </el-button>
         </template>
       </el-table-column>
       <el-table-column property="scanPages" label="扫描张数" width="80" />
@@ -241,6 +249,14 @@
     :download-handle="downloadTemplate"
     download-filename="学生导入模板.xlsx"
   />
+
+  <!-- 查看图片 -->
+  <el-image-viewer
+    v-if="showPreview"
+    :url-list="curStudentSheetUrls"
+    show-progress
+    @close="showPreview = false"
+  />
 </template>
 
 <script setup lang="ts">
@@ -291,6 +307,14 @@
     modifyStudentRef.value?.open();
   }
 
+  // 查看图片
+  const showPreview = ref(false);
+  const curStudentSheetUrls = ref<string[]>([]);
+  function onPreviewImg(row: StudentItem) {
+    showPreview.value = true;
+    curStudentSheetUrls.value = row.sheetUrls || [];
+  }
+
   // 导入学生
   const importDialogRef = ref();
   function downloadTemplate() {