dxd 2 vuotta sitten
vanhempi
commit
676c6d95ac

+ 46 - 25
src/views/menu5/cutPage/cutPage.vue

@@ -409,7 +409,6 @@ export default {
     },
     initList() {
       if (this.paperInfo.questions.length > 0) {
-        debugger;
         this.list = this.paperInfo.questions.map((item) => {
           return {
             id: item.id,
@@ -436,6 +435,24 @@ export default {
         });
         this.curBoxIndex == this.paperInfo.questions.length - 1;
       }
+      if (Object.keys(this.paperInfo.ans_points).length > 0) {
+        this.answerList = [
+          {
+            order: 0,
+            name: "answer",
+            ele: [
+              {
+                sqno:0,
+                img: this.getDetailCutImage(this.paperInfo.ans_points),
+                imgCss: this.getDetailCutImageCss(this.paperInfo.ans_points,0),
+                point: this.paperInfo.ans_points,
+                page: 0,
+              }
+              
+            ],
+          },
+        ];
+      }
     },
     formatResData(res) {
       var listArr = [];
@@ -459,31 +476,35 @@ export default {
     },
     getDetailCutImageCss(point, pageIndex) {
       var ratio = 326 / 1040; // 显示宽度/左边切图区域宽度
+      var ratio2 = (point.w * ratio) / 326; // 同比例扩大右边的预览图
       let standardPoint = this.paperInfo.points[this.curLeftIndex][0]; // 标准点
-      debugger;
-      if (point.w * ratio > 340) {
-        return {
-          backgroundImage: `url(${this.leftImgs[pageIndex]})`,
-          width: `${(point.w * ratio) / 1.9}px`,
-          height: `${(point.h * ratio) / 1.9}px`,
-          backgroundSize: `${(this.naturalWidth * ratio) / 1.9}px`,
-          backgroundPositionX: `-${
-            ((point.x + standardPoint.x) * ratio) / 1.9
-          }px`,
-          backgroundPositionY: `-${
-            ((point.y + standardPoint.y) * ratio) / 1.9
-          }px`,
-        };
-      } else {
-        return {
-          backgroundImage: `url(${this.leftImgs[pageIndex]})`,
-          width: `${point.w * ratio}px`,
-          height: `${point.h * ratio}px`,
-          backgroundSize: `${this.naturalWidth * ratio}px`,
-          backgroundPositionX: `-${(point.x + standardPoint.x) * ratio}px`,
-          backgroundPositionY: `-${(point.y + standardPoint.y) * ratio}px`,
-        };
-      }
+      // if (point.w * ratio > 340) {
+      //   return {
+      //     backgroundImage: `url(${this.leftImgs[pageIndex]})`,
+      //     width: `${(point.w * ratio) / 1.9}px`,
+      //     height: `${(point.h * ratio) / 1.9}px`,
+      //     backgroundSize: `${(this.naturalWidth * ratio) / 1.9}px`,
+      //     backgroundPositionX: `-${
+      //       ((point.x + standardPoint.x) * ratio) / 1.9
+      //     }px`,
+      //     backgroundPositionY: `-${
+      //       ((point.y + standardPoint.y) * ratio) / 1.9
+      //     }px`,
+      //   };
+      // } else {
+      return {
+        backgroundImage: `url(${this.leftImgs[pageIndex]})`,
+        width: `${(point.w * ratio) / ratio2}px`,
+        height: `${(point.h * ratio) / ratio2}px`,
+        backgroundSize: `${(this.naturalWidth * ratio) / ratio2}px`,
+        backgroundPositionX: `-${
+          ((point.x + standardPoint.x) * ratio) / ratio2
+        }px`,
+        backgroundPositionY: `-${
+          ((point.y + standardPoint.y) * ratio) / ratio2
+        }px`,
+      };
+      // }
     },
     // 提交保存
     submit() {

+ 1 - 0
src/views/menu5/menu5-2/index.vue

@@ -596,6 +596,7 @@ export default {
     },
     back() {
       this.status = 0;
+      this.getTask()
       clearInterval(this.timer);
     },
     addItems() {

+ 2 - 0
src/views/menu5/menu5-3/index.vue

@@ -665,6 +665,8 @@ export default {
 
     back() {
       this.status = 0;
+      this.getTask()
+       clearInterval(this.timer2);
     },
     addItems() {
       this.status = 1;