|
@@ -1,201 +1,209 @@
|
|
|
<template>
|
|
|
<div class="JoinLine">
|
|
|
- <div :id="'container' + number" class="container">
|
|
|
- <div class="left">
|
|
|
- <ul>
|
|
|
- <div>{{ curQue.conTitle }}</div>
|
|
|
- <li
|
|
|
- :class="'left' + index + number"
|
|
|
- v-for="(item, index) in curQue.con"
|
|
|
- :key="'left' + index"
|
|
|
- >
|
|
|
- <!-- :style="{
|
|
|
+ <div class="main">
|
|
|
+ <div style="text-align: center">{{ curQue.title }}</div>
|
|
|
+ <div :id="'container' + number" class="container">
|
|
|
+ <div class="left">
|
|
|
+ <ul>
|
|
|
+ <div>{{ curQue.conTitle }}</div>
|
|
|
+ <li
|
|
|
+ :class="'left' + index + number"
|
|
|
+ v-for="(item, index) in curQue.con"
|
|
|
+ :key="'left' + index"
|
|
|
+ >
|
|
|
+ <!-- :style="{
|
|
|
background:
|
|
|
JSON.stringify(data).indexOf(item.nodeId) != -1
|
|
|
? '#F0F0F0'
|
|
|
: '',
|
|
|
}" -->
|
|
|
- <div>
|
|
|
+ <div>
|
|
|
+ <img
|
|
|
+ v-if="item.img_list.length > 0"
|
|
|
+ :src="item.img_list[0].id"
|
|
|
+ alt=""
|
|
|
+ @load="conImageload"
|
|
|
+ />
|
|
|
+ <div
|
|
|
+ class="text"
|
|
|
+ :class="'left' + index"
|
|
|
+ v-if="
|
|
|
+ item.detail.wordsList.length > 0 || item.detail.sentence
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <!-- 大于0就说明分词了 -->
|
|
|
+ <template v-if="item.detail.wordsList.length > 0">
|
|
|
+ <div
|
|
|
+ v-for="(it, wordIndex) in item.detail.wordsList"
|
|
|
+ :key="'word' + wordIndex"
|
|
|
+ >
|
|
|
+ <template v-if="item.detail.pyPosition == 'top'">
|
|
|
+ <p
|
|
|
+ style="
|
|
|
+ font-family: 'GB-PINYINOK-B';
|
|
|
+ font-size: 14px;
|
|
|
+ line-height: 20px;
|
|
|
+ "
|
|
|
+ >
|
|
|
+ {{ it.pinyin }}
|
|
|
+ </p>
|
|
|
+ <p
|
|
|
+ style="
|
|
|
+ font-family: 'FZJCGFKTK';
|
|
|
+ font-size: 20px;
|
|
|
+ line-height: 150%;
|
|
|
+ "
|
|
|
+ >
|
|
|
+ {{ it.chs }}
|
|
|
+ </p>
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
+ <p
|
|
|
+ style="
|
|
|
+ font-family: 'FZJCGFKTK';
|
|
|
+ font-size: 20px;
|
|
|
+ line-height: 150%;
|
|
|
+ "
|
|
|
+ >
|
|
|
+ {{ it.chs }}
|
|
|
+ </p>
|
|
|
+ <p
|
|
|
+ style="
|
|
|
+ font-family: 'GB-PINYINOK-B';
|
|
|
+ font-size: 14px;
|
|
|
+ line-height: 20px;
|
|
|
+ "
|
|
|
+ >
|
|
|
+ {{ it.pinyin }}
|
|
|
+ </p>
|
|
|
+ </template>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
+ {{ item.detail.sentence }}
|
|
|
+ </template>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <span>{{ item.Number }}</span>
|
|
|
<img
|
|
|
- v-if="item.img_list.length > 0"
|
|
|
- :src="item.img_list[0].id"
|
|
|
+ v-if="JSON.stringify(data).indexOf(item.nodeId) == -1"
|
|
|
+ name="source"
|
|
|
+ :id="item.nodeId"
|
|
|
+ src="../../../assets/adult/LineImg.png"
|
|
|
alt=""
|
|
|
- @load="conImageload"
|
|
|
/>
|
|
|
- <div
|
|
|
- class="text"
|
|
|
- :class="'left' + index"
|
|
|
- v-if="item.detail.wordsList.length > 0 || item.detail.sentence"
|
|
|
- >
|
|
|
- <!-- 大于0就说明分词了 -->
|
|
|
- <template v-if="item.detail.wordsList.length > 0">
|
|
|
- <div
|
|
|
- v-for="(it, wordIndex) in item.detail.wordsList"
|
|
|
- :key="'word' + wordIndex"
|
|
|
- >
|
|
|
- <template v-if="item.detail.pyPosition == 'top'">
|
|
|
- <p
|
|
|
- style="
|
|
|
- font-family: 'GB-PINYINOK-B';
|
|
|
- font-size: 14px;
|
|
|
- line-height: 20px;
|
|
|
- "
|
|
|
- >
|
|
|
- {{ it.pinyin }}
|
|
|
- </p>
|
|
|
- <p
|
|
|
- style="
|
|
|
- font-family: 'FZJCGFKTK';
|
|
|
- font-size: 20px;
|
|
|
- line-height: 150%;
|
|
|
- "
|
|
|
- >
|
|
|
- {{ it.chs }}
|
|
|
- </p>
|
|
|
- </template>
|
|
|
- <template v-else>
|
|
|
- <p
|
|
|
- style="
|
|
|
- font-family: 'FZJCGFKTK';
|
|
|
- font-size: 20px;
|
|
|
- line-height: 150%;
|
|
|
- "
|
|
|
- >
|
|
|
- {{ it.chs }}
|
|
|
- </p>
|
|
|
- <p
|
|
|
- style="
|
|
|
- font-family: 'GB-PINYINOK-B';
|
|
|
- font-size: 14px;
|
|
|
- line-height: 20px;
|
|
|
- "
|
|
|
- >
|
|
|
- {{ it.pinyin }}
|
|
|
- </p>
|
|
|
- </template>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- <template v-else>
|
|
|
- {{ item.detail.sentence }}
|
|
|
- </template>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <span>{{ item.Number }}</span>
|
|
|
- <img
|
|
|
- v-if="JSON.stringify(data).indexOf(item.nodeId) == -1"
|
|
|
- name="source"
|
|
|
- :id="item.nodeId"
|
|
|
- src="../../../assets/adult/LineImg.png"
|
|
|
- alt=""
|
|
|
- />
|
|
|
- <img
|
|
|
- v-else
|
|
|
- :id="item.nodeId"
|
|
|
- name="target"
|
|
|
- src="../../../assets/adult/LineImg-select.png"
|
|
|
- alt=""
|
|
|
- />
|
|
|
- </li>
|
|
|
- </ul>
|
|
|
- </div>
|
|
|
- <div class="right">
|
|
|
- <ul>
|
|
|
- <div>{{ curQue.optionTitle }}</div>
|
|
|
- <li
|
|
|
- :class="'right' + index + number"
|
|
|
- v-for="(item, index) in curQue.option"
|
|
|
- :key="'right' + index"
|
|
|
- >
|
|
|
- <!-- :style="{
|
|
|
+ <img
|
|
|
+ v-else
|
|
|
+ :id="item.nodeId"
|
|
|
+ name="target"
|
|
|
+ src="../../../assets/adult/LineImg-select.png"
|
|
|
+ alt=""
|
|
|
+ />
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
+ <div class="right">
|
|
|
+ <ul>
|
|
|
+ <div>{{ curQue.optionTitle }}</div>
|
|
|
+ <li
|
|
|
+ :class="'right' + index + number"
|
|
|
+ v-for="(item, index) in curQue.option"
|
|
|
+ :key="'right' + index"
|
|
|
+ >
|
|
|
+ <!-- :style="{
|
|
|
background:
|
|
|
JSON.stringify(data).indexOf(item.nodeId) != -1
|
|
|
? '#F0F0F0'
|
|
|
: '',
|
|
|
}" -->
|
|
|
- <img
|
|
|
- v-if="JSON.stringify(data).indexOf(item.nodeId) == -1"
|
|
|
- name="source"
|
|
|
- :id="item.nodeId"
|
|
|
- src="../../../assets/adult/LineImg.png"
|
|
|
- alt=""
|
|
|
- />
|
|
|
- <img
|
|
|
- v-else
|
|
|
- :id="item.nodeId"
|
|
|
- name="target"
|
|
|
- src="../../../assets/adult/LineImg-select.png"
|
|
|
- alt=""
|
|
|
- />
|
|
|
- <span>{{ item.Number }}</span>
|
|
|
- <div>
|
|
|
<img
|
|
|
- v-if="item.img_list.length > 0"
|
|
|
- :src="item.img_list[0].id"
|
|
|
+ v-if="JSON.stringify(data).indexOf(item.nodeId) == -1"
|
|
|
+ name="source"
|
|
|
+ :id="item.nodeId"
|
|
|
+ src="../../../assets/adult/LineImg.png"
|
|
|
alt=""
|
|
|
- @load="conImageload"
|
|
|
/>
|
|
|
- <div
|
|
|
- class="text"
|
|
|
- :class="'right' + index"
|
|
|
- v-if="item.detail.wordsList.length > 0 || item.detail.sentence"
|
|
|
- >
|
|
|
- <!-- 大于0就说明分词了 -->
|
|
|
- <template v-if="item.detail.wordsList.length > 0">
|
|
|
- <div
|
|
|
- v-for="(it, wordIndex) in item.detail.wordsList"
|
|
|
- :key="'word' + wordIndex"
|
|
|
- >
|
|
|
- <template v-if="item.detail.pyPosition == 'top'">
|
|
|
- <p
|
|
|
- style="
|
|
|
- font-family: 'GB-PINYINOK-B';
|
|
|
- font-size: 14px;
|
|
|
- line-height: 20px;
|
|
|
- "
|
|
|
- >
|
|
|
- {{ it.pinyin }}
|
|
|
- </p>
|
|
|
- <p
|
|
|
- style="
|
|
|
- font-family: 'FZJCGFKTK';
|
|
|
- font-size: 20px;
|
|
|
- line-height: 150%;
|
|
|
- "
|
|
|
- >
|
|
|
- {{ it.chs }}
|
|
|
- </p>
|
|
|
- </template>
|
|
|
- <template v-else>
|
|
|
- <p
|
|
|
- style="
|
|
|
- font-family: 'FZJCGFKTK';
|
|
|
- font-size: 20px;
|
|
|
- line-height: 150%;
|
|
|
- "
|
|
|
- >
|
|
|
- {{ it.chs }}
|
|
|
- </p>
|
|
|
- <p
|
|
|
- style="
|
|
|
- font-family: 'GB-PINYINOK-B';
|
|
|
- font-size: 14px;
|
|
|
- line-height: 20px;
|
|
|
- "
|
|
|
- >
|
|
|
- {{ it.pinyin }}
|
|
|
- </p>
|
|
|
- </template>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- <template v-else>
|
|
|
- {{ item.detail.sentence }}
|
|
|
- </template>
|
|
|
+ <img
|
|
|
+ v-else
|
|
|
+ :id="item.nodeId"
|
|
|
+ name="target"
|
|
|
+ src="../../../assets/adult/LineImg-select.png"
|
|
|
+ alt=""
|
|
|
+ />
|
|
|
+ <span>{{ item.Number }}</span>
|
|
|
+ <div>
|
|
|
+ <img
|
|
|
+ v-if="item.img_list.length > 0"
|
|
|
+ :src="item.img_list[0].id"
|
|
|
+ alt=""
|
|
|
+ @load="conImageload"
|
|
|
+ />
|
|
|
+ <div
|
|
|
+ class="text"
|
|
|
+ :class="'right' + index"
|
|
|
+ v-if="
|
|
|
+ item.detail.wordsList.length > 0 || item.detail.sentence
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <!-- 大于0就说明分词了 -->
|
|
|
+ <template v-if="item.detail.wordsList.length > 0">
|
|
|
+ <div
|
|
|
+ v-for="(it, wordIndex) in item.detail.wordsList"
|
|
|
+ :key="'word' + wordIndex"
|
|
|
+ >
|
|
|
+ <template v-if="item.detail.pyPosition == 'top'">
|
|
|
+ <p
|
|
|
+ style="
|
|
|
+ font-family: 'GB-PINYINOK-B';
|
|
|
+ font-size: 14px;
|
|
|
+ line-height: 20px;
|
|
|
+ "
|
|
|
+ >
|
|
|
+ {{ it.pinyin }}
|
|
|
+ </p>
|
|
|
+ <p
|
|
|
+ style="
|
|
|
+ font-family: 'FZJCGFKTK';
|
|
|
+ font-size: 20px;
|
|
|
+ line-height: 150%;
|
|
|
+ "
|
|
|
+ >
|
|
|
+ {{ it.chs }}
|
|
|
+ </p>
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
+ <p
|
|
|
+ style="
|
|
|
+ font-family: 'FZJCGFKTK';
|
|
|
+ font-size: 20px;
|
|
|
+ line-height: 150%;
|
|
|
+ "
|
|
|
+ >
|
|
|
+ {{ it.chs }}
|
|
|
+ </p>
|
|
|
+ <p
|
|
|
+ style="
|
|
|
+ font-family: 'GB-PINYINOK-B';
|
|
|
+ font-size: 14px;
|
|
|
+ line-height: 20px;
|
|
|
+ "
|
|
|
+ >
|
|
|
+ {{ it.pinyin }}
|
|
|
+ </p>
|
|
|
+ </template>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
+ {{ item.detail.sentence }}
|
|
|
+ </template>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- </li>
|
|
|
- </ul>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+
|
|
|
<!-- 清除所有连线及连线的状态 -->
|
|
|
<div class="fuwei" :class="[TaskModel == 'ANSWER' ? 'notAllow' : '']">
|
|
|
<div @click="clearLine">
|
|
@@ -273,9 +281,24 @@ export default {
|
|
|
// 清除所有连线
|
|
|
clearLine() {
|
|
|
if (!this.TaskModel || this.TaskModel != "ANSWER") {
|
|
|
+ let arr = [];
|
|
|
+ this.data.forEach((item) => {
|
|
|
+ if (item.source.indexOf("Isexample") != -1) {
|
|
|
+ arr.push(item);
|
|
|
+ }
|
|
|
+ });
|
|
|
this.jsPlumb.deleteEveryConnection(); //清除连线方法
|
|
|
this.data = [];
|
|
|
- sessionStorage.removeItem("LineData");
|
|
|
+ this.$set(this.curQue, "Bookanswer", JSON.stringify(this.data));
|
|
|
+ if (arr.length > 0) {
|
|
|
+ this.data = JSON.parse(JSON.stringify(arr));
|
|
|
+ this.data.forEach((item) => {
|
|
|
+ this.jsPlumb.connect({
|
|
|
+ source: item.source,
|
|
|
+ target: item.target,
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
showPlumb() {
|
|
@@ -326,6 +349,10 @@ export default {
|
|
|
this.setjsPlumb(true, true);
|
|
|
//点击连线
|
|
|
this.jsPlumb.bind("click", (conn, originalEvent) => {
|
|
|
+ let index = conn.sourceId.indexOf("Isexample");
|
|
|
+ if (index != -1) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
if (!this.TaskModel || this.TaskModel != "ANSWER") {
|
|
|
// 删除点击的线
|
|
|
this.data.forEach((item, i) => {
|
|
@@ -427,13 +454,27 @@ export default {
|
|
|
this.data = sData;
|
|
|
}
|
|
|
this.curQue.con.forEach((item, i) => {
|
|
|
- item.nodeId = "left_" + i + this.number;
|
|
|
+ let nodeId = item.Isexample
|
|
|
+ ? "left_" + i + this.number + "Isexample"
|
|
|
+ : "left_" + i + this.number;
|
|
|
+ item.nodeId = nodeId;
|
|
|
if (item.img_list.length > 0) {
|
|
|
this.allimgnumber++;
|
|
|
}
|
|
|
+ if (item.Isexample) {
|
|
|
+ this.data.push({
|
|
|
+ source: item.nodeId,
|
|
|
+ target: "right_" + item.AnswerList + this.number,
|
|
|
+ index: i,
|
|
|
+ answer: item.AnswerList,
|
|
|
+ });
|
|
|
+ }
|
|
|
});
|
|
|
this.curQue.option.forEach((item, i) => {
|
|
|
- item.nodeId = "right_" + i + this.number;
|
|
|
+ let nodeId = item.Isexample
|
|
|
+ ? "right_" + i + this.number + "Isexample"
|
|
|
+ : "right_" + i + this.number;
|
|
|
+ item.nodeId = nodeId;
|
|
|
if (item.img_list.length > 0) {
|
|
|
this.allimgnumber++;
|
|
|
}
|
|
@@ -452,8 +493,6 @@ export default {
|
|
|
`right${i + this.number}`
|
|
|
)[0];
|
|
|
if (nodeleft && noderight) {
|
|
|
- console.log(nodeleft);
|
|
|
- console.log(noderight);
|
|
|
if (nodeleft.offsetHeight > noderight.offsetHeight) {
|
|
|
noderight.style.height = nodeleft.offsetHeight + "px";
|
|
|
} else {
|
|
@@ -464,7 +503,6 @@ export default {
|
|
|
}
|
|
|
setTimeout(() => {
|
|
|
if (this.data.length > 0) {
|
|
|
- console.log(this.data);
|
|
|
this.data.forEach((item) => {
|
|
|
this.jsPlumb.connect({
|
|
|
source: item.source,
|
|
@@ -506,15 +544,17 @@ export default {
|
|
|
/* @import url(); 引入css类 */
|
|
|
.JoinLine {
|
|
|
width: 100%;
|
|
|
- .container {
|
|
|
+ .main {
|
|
|
background: #f7f7f7;
|
|
|
border: 1px solid rgba(0, 0, 0, 0.1);
|
|
|
box-sizing: border-box;
|
|
|
border-radius: 8px;
|
|
|
+ padding: 24px 40px;
|
|
|
+ }
|
|
|
+ .container {
|
|
|
position: relative;
|
|
|
display: flex;
|
|
|
justify-content: center;
|
|
|
- padding: 24px 40px;
|
|
|
ul {
|
|
|
list-style: none;
|
|
|
li {
|