user1
2024-06-26 bae61829b323cd391e277ad6c054770f4b7a3f8a
src/components/matching/matching.vue
@@ -15,7 +15,7 @@
            :key="index"
            ref="left"
            @mousedown="(e) => touchstart(e, item, index)"
            :style="{ backgroundColor: primaryColor }"
            :style="{ backgroundColor: primaryColor,border:'1px solid' + bordercolor }"
            v-html="item.label.txt"
          ></div>
        </div>
@@ -25,7 +25,7 @@
            v-for="(item, index) in rightArr"
            :key="index"
            ref="right"
            :style="{ backgroundColor: primaryColor }"
            :style="{ backgroundColor: primaryColor,border:'1px solid' + bordercolor }"
            v-html="item.label.txt"
          ></div>
        </div>
@@ -46,11 +46,11 @@
    <!-- 按钮 -->
    <div class="btn-bottom">
      <el-button @click="submitData">提交</el-button>
      <el-button @click="saveData" :style="{ borderColor: primaryColor }"
      <el-button @click="saveData" :style="{ borderColor: bordercolor }"
        >保存</el-button
      >
      <el-button @click="redo">重做</el-button>
      <el-button @click="handleAnswer" :style="{ borderColor: primaryColor }"
      <el-button @click="handleAnswer" :style="{ borderColor: bordercolor }"
        >查看答案</el-button
      >
    </div>
@@ -112,8 +112,12 @@
    },
    primaryColor: {
      type: String,
      default: "#0bab87",
      default: "#fff",
    },
    bordercolor:{
      type:String,
      default:'#f49a4c'
    }
  },
  watch: {
    rawData: {
@@ -341,11 +345,13 @@
        const rightIndex = this.question.options.linkValues.findIndex(
          (citem) => citem.oldId == item.oldId
        );
        answerArr.push({
          left: index,
          right: rightIndex,
        });
      }
      console.log(this.question.userChoise,answerArr);
      this.isRight = this.areArraysEqual(this.question.userChoise, answerArr);
      this.isShowAnswer = true;
    },