|
@@ -19,7 +19,7 @@
|
|
|
<div
|
|
|
:class="[
|
|
|
'item',
|
|
|
- JSON.stringify(SortArr[index]).indexOf(itemNode.pinyin) != -1
|
|
|
+ JSON.stringify(SortArr[index]).indexOf(itemNode.index) != -1
|
|
|
? 'select'
|
|
|
: '',
|
|
|
]"
|
|
@@ -36,15 +36,15 @@
|
|
|
</transition-group>
|
|
|
</draggable>
|
|
|
</div>
|
|
|
- <div
|
|
|
- class="item-right_bottom"
|
|
|
- :style="{
|
|
|
+ <div class="item-right_bottom">
|
|
|
+ <!--
|
|
|
+ :style="{
|
|
|
width:
|
|
|
item.detail.wordsList.length * 82 +
|
|
|
item.detail.wordsList.length * 2 +
|
|
|
'px',
|
|
|
}"
|
|
|
- >
|
|
|
+ -->
|
|
|
<!--
|
|
|
:options="{ group: { name: 'itxst' + index, pull: false } }"
|
|
|
-->
|
|
@@ -56,7 +56,11 @@
|
|
|
@end="onEnd2($event, index)"
|
|
|
:move="onMove"
|
|
|
>
|
|
|
- <transition-group>
|
|
|
+ <transition-group
|
|
|
+ :style="{
|
|
|
+ display: SortArr[index].length > 0 ? '-webkit-box' : 'flex',
|
|
|
+ }"
|
|
|
+ >
|
|
|
<div
|
|
|
class="item"
|
|
|
v-for="(itemNode, indexNode) in SortArr[index]"
|
|
@@ -71,6 +75,20 @@
|
|
|
</div>
|
|
|
</transition-group>
|
|
|
</draggable>
|
|
|
+ <div class="fw">
|
|
|
+ <img
|
|
|
+ v-if="SortArr[index].length > 0"
|
|
|
+ src="../../../assets/NPC/fw.png"
|
|
|
+ alt=""
|
|
|
+ @click="removeCurrentSortArr(index)"
|
|
|
+ />
|
|
|
+ <img
|
|
|
+ @click="NOremove"
|
|
|
+ v-else
|
|
|
+ src="../../../assets/NPC/fw-no.png"
|
|
|
+ alt=""
|
|
|
+ />
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -94,12 +112,19 @@ export default {
|
|
|
watch: {},
|
|
|
//方法集合
|
|
|
methods: {
|
|
|
+ // 清空当前选中的文字
|
|
|
+ removeCurrentSortArr(index) {
|
|
|
+ this.$set(this.SortArr, index, []);
|
|
|
+ },
|
|
|
+ NOremove() {
|
|
|
+ this.$message.warning("当前没有可清空的数据");
|
|
|
+ return;
|
|
|
+ },
|
|
|
onStart(e, index) {
|
|
|
this.drag = true;
|
|
|
this.dragData = JSON.parse(
|
|
|
JSON.stringify(this.curQue.option[index].detail.wordsList)
|
|
|
);
|
|
|
- console.log(this.dragData);
|
|
|
},
|
|
|
//拖拽结束事件
|
|
|
onEnd(e, index) {
|
|
@@ -120,10 +145,13 @@ export default {
|
|
|
},
|
|
|
onStart2(e, index) {
|
|
|
this.drag = true;
|
|
|
+ this.dragData = JSON.parse(JSON.stringify(this.SortArr[index]));
|
|
|
},
|
|
|
//拖拽结束事件
|
|
|
onEnd2(e, index) {
|
|
|
this.drag = false;
|
|
|
+ // 不再删除
|
|
|
+ this.SortArr[index] = this.dragData;
|
|
|
let newarr = [
|
|
|
...new Set(
|
|
|
this.curQue.option[index].detail.wordsList.map((item) =>
|
|
@@ -141,12 +169,26 @@ export default {
|
|
|
onMove(e) {
|
|
|
// this.moveId = e.relatedContext.element.id;
|
|
|
},
|
|
|
+ audioPlay(e) {
|
|
|
+ let url = e.target.src;
|
|
|
+ let audio = document.getElementsByTagName("audio");
|
|
|
+ audio.forEach((item) => {
|
|
|
+ if (item.src == url) {
|
|
|
+ item.play();
|
|
|
+ } else {
|
|
|
+ item.pause();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
},
|
|
|
//生命周期 - 创建完成(可以访问当前this实例)
|
|
|
created() {
|
|
|
this.curQue.option.forEach((item) => {
|
|
|
let arr = [];
|
|
|
this.SortArr.push(arr);
|
|
|
+ item.detail.wordsList.forEach((it, i) => {
|
|
|
+ it.index = it.chs + it.pinyin + i;
|
|
|
+ });
|
|
|
});
|
|
|
},
|
|
|
//生命周期 - 挂载完成(可以访问DOM元素)
|
|
@@ -164,9 +206,9 @@ export default {
|
|
|
//@import url(); 引入公共css类
|
|
|
.sentenceSort {
|
|
|
width: 100%;
|
|
|
- background: #f7f7f7;
|
|
|
- padding: 24px;
|
|
|
- border: 1px solid rgba(0, 0, 0, 0.1);
|
|
|
+ // background: #f7f7f7;
|
|
|
+ // background: rgba(0, 0, 0, 0.04);
|
|
|
+ // padding: 24px;
|
|
|
box-sizing: border-box;
|
|
|
border-radius: 8px;
|
|
|
h2 {
|
|
@@ -177,7 +219,7 @@ export default {
|
|
|
font-weight: normal;
|
|
|
}
|
|
|
.item-box {
|
|
|
- margin: 8px 0;
|
|
|
+ margin: 8px 0 24px 0;
|
|
|
b {
|
|
|
background: #de4444;
|
|
|
text-align: center;
|
|
@@ -196,12 +238,14 @@ export default {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
> :nth-child(2) {
|
|
|
+ width: 100%;
|
|
|
> :nth-child(1) {
|
|
|
display: flex;
|
|
|
flex-wrap: wrap;
|
|
|
.item {
|
|
|
- width: 82px;
|
|
|
- height: 70px;
|
|
|
+ // width: 82px;
|
|
|
+ // height: 70px;
|
|
|
+ padding: 8px 16px;
|
|
|
background: #ffffff;
|
|
|
border-radius: 8px;
|
|
|
text-align: center;
|
|
@@ -222,6 +266,9 @@ export default {
|
|
|
font-size: 20px;
|
|
|
}
|
|
|
}
|
|
|
+ .item:hover {
|
|
|
+ border: 1px solid rgba(0, 0, 0, 0.65);
|
|
|
+ }
|
|
|
.select {
|
|
|
background: rgba(0, 0, 0, 0.06);
|
|
|
}
|
|
@@ -229,25 +276,32 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
.item-right_bottom {
|
|
|
- min-width: 200px;
|
|
|
- max-width: 696px;
|
|
|
background: rgba(0, 0, 0, 0.06);
|
|
|
- margin-left: 35px;
|
|
|
margin-top: 10px;
|
|
|
- min-height: 70px;
|
|
|
+ min-height: 74px;
|
|
|
+ // max-height: 103px;
|
|
|
+ border-radius: 8px;
|
|
|
+ position: relative;
|
|
|
+ padding-right: 56px;
|
|
|
> :nth-child(1) {
|
|
|
> :nth-child(1) {
|
|
|
display: flex;
|
|
|
- flex-wrap: wrap;
|
|
|
+ // flex-wrap: wrap;
|
|
|
+ padding-top: 4px;
|
|
|
+ max-height: 103px;
|
|
|
+ min-height: 74px;
|
|
|
+ overflow-x: scroll;
|
|
|
+
|
|
|
.item {
|
|
|
- width: 82px;
|
|
|
- height: 70px;
|
|
|
+ // width: 82px;
|
|
|
+ // height: 70px;
|
|
|
+ padding: 8px 16px;
|
|
|
background: #ffffff;
|
|
|
border-radius: 8px;
|
|
|
text-align: center;
|
|
|
- margin-right: 2px;
|
|
|
+ margin-left: 4px;
|
|
|
color: #000000;
|
|
|
- margin-bottom: 2px;
|
|
|
+ margin-bottom: 4px;
|
|
|
p {
|
|
|
margin: 0;
|
|
|
line-height: 150%;
|
|
@@ -264,6 +318,23 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ .fw {
|
|
|
+ height: 100%;
|
|
|
+ width: 56px;
|
|
|
+ position: absolute;
|
|
|
+ right: 0;
|
|
|
+ top: 0;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ img {
|
|
|
+ width: 16px;
|
|
|
+ height: 16px;
|
|
|
+ top: 29px;
|
|
|
+ right: 24px;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
.NPC-Big-Book-preview-green {
|