소스 검색

feat: 界面调整

zhangjie 2 달 전
부모
커밋
5ad9aafceb
2개의 변경된 파일28개의 추가작업 그리고 6개의 파일을 삭제
  1. 14 3
      src/modules/mark/components/markDetail/ModalTaskDetail.vue
  2. 14 3
      src/modules/mark/components/markParam/MarkParamGroup.vue

+ 14 - 3
src/modules/mark/components/markDetail/ModalTaskDetail.vue

@@ -150,6 +150,12 @@ export default {
       this.modalVisible = false;
     },
     handleClose() {
+      // 释放所有创建的 URL 对象
+      this.croppedImages.forEach((crop) => {
+        if (crop.src && crop.src.startsWith("blob:")) {
+          URL.revokeObjectURL(crop.src);
+        }
+      });
       // 重置数据
       this.taskDetail = {
         sheetUrls: [],
@@ -245,11 +251,16 @@ export default {
           Math.round(cropParams.h) // 目标 height
         );
 
-        // 获取裁切后的图像 Data URL
-        const croppedSrc = canvas.toDataURL();
+        // 使用 canvas.toBlob() 和 URL.createObjectURL() 生成图片 URL
+        const croppedSrc = await new Promise((resolve) => {
+          canvas.toBlob((blob) => {
+            const url = URL.createObjectURL(blob);
+            resolve(url);
+          }, "image/jpeg");
+        });
 
         crops.push({
-          src: croppedSrc, // 裁切后的图片 Data URL
+          src: croppedSrc, // 裁切后的图片 URL
           originalUrl: originalUrl,
           originalDimensions: originalDim,
           cropParams: cropParams, // 裁切区域在原图的像素坐标和尺寸

+ 14 - 3
src/modules/mark/components/markParam/MarkParamGroup.vue

@@ -68,7 +68,12 @@
             {{ scope.row.doubleRate }}%
           </template>
         </el-table-column>
-        <el-table-column label="AI评卷" width="80" align="center">
+        <el-table-column
+          v-if="enableAIMark"
+          label="AI评卷"
+          width="80"
+          align="center"
+        >
           <template slot-scope="scope">
             <i
               v-if="scope.row.aiQuestionPramSet && scope.row.questionType !== 4"
@@ -84,7 +89,11 @@
             ></i>
           </template>
         </el-table-column>
-        <el-table-column class-name="action-column" label="操作" width="275px">
+        <el-table-column
+          class-name="action-column"
+          label="操作"
+          :width="enableAIMark ? 275 : 180"
+        >
           <template slot-scope="scope">
             <el-button
               class="btn-primary"
@@ -100,6 +109,7 @@
               >评卷区</el-button
             >
             <el-button
+              v-if="enableAIMark"
               :disabled="!checkAiMarkEnabled(scope.row)"
               class="btn-primary"
               type="text"
@@ -281,7 +291,8 @@ export default {
     },
     objectSpanMethod({ rowIndex, columnIndex }) {
       // 第四列为评卷员
-      if (columnIndex === 3 || columnIndex === 9) {
+      const areaSetColumnIndex = this.enableAIMark ? 9 : 8;
+      if (columnIndex === 3 || columnIndex === areaSetColumnIndex) {
         const pos = this.fillQuestionRanges.findIndex((item) =>
           item.includes(rowIndex)
         );