zhangjie 2 lat temu
rodzic
commit
5f0bd18622

+ 1 - 22
src/components/vEditor/VEditor.vue

@@ -90,7 +90,6 @@ export default {
   mounted() {
     this.initData();
     this.$refs.editor.addEventListener("paste", pasteHandle.bind(this));
-    this.$refs.editor.addEventListener("wheel", this.wheelEventHandle);
     this.$refs.editor.addEventListener("click", this.clickEventHandle);
   },
   beforeDestroy() {
@@ -143,27 +142,7 @@ export default {
       this.$emit("input", json);
       this.$emit("change", json);
     },
-    wheelEventHandle(e) {
-      // console.log(e);
-      // console.dir(e.target);
-      const el = e.target;
-      if (el.tagName && el.tagName === "IMG") {
-        e.preventDefault();
-        e.stopPropagation();
-        const shift = e.deltaY > 0;
-        const newWidth =
-          +getComputedStyle(el).width.replace("px", "") + (shift ? 1 : -1);
-        // console.log(newWidth, el.naturalWidth);
-        if (newWidth >= 16 && newWidth <= el.naturalWidth) {
-          el.style.width = newWidth + "px";
-          el.style.height =
-            (newWidth / el.naturalWidth) * el.naturalHeight + "px";
-          // el.setAttribute("width", newWidth);
-
-          this.emitJSON();
-        }
-      }
-    },
+    // image resize
     clickEventHandle(e) {
       const el = e.target;
       if (el.tagName && el.tagName === "IMG") {

+ 2 - 23
src/modules/question/components/QuestionAnswer.vue

@@ -18,7 +18,7 @@
 </template>
 
 <script>
-import { deepCopy } from "@/plugins/utils";
+// import { deepCopy } from "@/plugins/utils";
 
 export default {
   name: "QuestionAnswer",
@@ -89,28 +89,7 @@ export default {
           .map((item) => this.optionNames[item - 1])
           .join("");
       } else if (this.IS_FILL_QUESTION) {
-        this.quesAnswer = quesAnswer.map((item) => {
-          let nitem = deepCopy(item);
-          if (!nitem.sections || !nitem.sections.length) {
-            nitem.sections = [
-              {
-                blocks: [
-                  {
-                    type: "text",
-                    value: `(${item.index + 1})`,
-                  },
-                ],
-              },
-            ];
-          } else {
-            nitem.sections[0].blocks.unshift({
-              type: "text",
-              value: `(${item.index + 1})`,
-            });
-          }
-
-          return nitem;
-        });
+        this.quesAnswer = quesAnswer;
       } else if (this.IS_TEXT_QUESTION) {
         this.quesAnswer = quesAnswer[0];
       }