闫增涛
2024-06-25 a4ca94a580c518285395ce8da62d0165ab0de3a1
拖拽题优化
3个文件已修改
11 ■■■■■ 已修改文件
src/App.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/books/mathBook/view/components/chapter001.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/dragQuestion/index.vue 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/App.vue
@@ -65,7 +65,7 @@
        process.env.VUE_APP_RESOURCE_CTX +
          (process.env.VUE_APP_ENV == "product"
            ? process.env.VUE_APP_BOOK_ID
            : "sportsAndHealth")
            : "mathBook")
      );
      // 测试试读30页
      // this.activeBook.tryPageCount = 10;
src/books/mathBook/view/components/chapter001.vue
@@ -576,8 +576,8 @@
      </div>
    </div>
    <div class="page-box padding-116" page="10">
      <!-- <drag :question="dragQuestion" :page="10"/> -->
       <graffiti style="width:100%" />
      <drag :question="dragQuestion" :page="10"/>
       <!-- <graffiti style="width:100%" /> -->
    </div>
    <!-- 函数控件弹窗 -->
    <el-dialog
src/components/dragQuestion/index.vue
@@ -193,6 +193,7 @@
      maxX: null,
      maxY: null,
      spaceList: [],
      submitState:false,
    };
  },
  mounted() {
@@ -204,6 +205,7 @@
    // 3.限制鼠标松开要在空格的范围内
    mousedown(e) {
      e.preventDefault();
      if(this.submitState) return false
      console.log("鼠标按下", e);
      this.moveDom = e.toElement;
      this.parentDom = this.getParentWithClass(e.toElement, "question-box");
@@ -298,6 +300,7 @@
    },
    // 提交
    submitData() {
      this.submitState = true
      let arr = [];
      const data = this.drageQuestion;
      for (let index = 0; index < data.length; index++) {
@@ -309,10 +312,10 @@
        item.isRight = arr == item.answer
        item.isComplete = true
      }
      console.log(arr,this.drageQuestion[0]);
    },
    redio() {
      this.submitState = false
      localStorage.removeItem(
        this.config.activeBook.name + "-drag-" + this.page
      );