|
@@ -13,7 +13,6 @@
|
|
|
:move="onMove"
|
|
|
:options="{
|
|
|
group: { name: 'itxst' + index, pull: 'clone' },
|
|
|
- sort: true,
|
|
|
}"
|
|
|
>
|
|
|
<transition-group>
|
|
@@ -41,6 +40,9 @@
|
|
|
'px',
|
|
|
}"
|
|
|
>
|
|
|
+ <!--
|
|
|
+ :options="{ group: { name: 'itxst' + index, pull: false } }"
|
|
|
+ -->
|
|
|
<draggable
|
|
|
v-model="SortArr[index]"
|
|
|
:group="'itxst' + index"
|
|
@@ -80,36 +82,39 @@ export default {
|
|
|
drag: false,
|
|
|
SortArr: [],
|
|
|
moveId: null,
|
|
|
+ dragData: null,
|
|
|
};
|
|
|
},
|
|
|
computed: {},
|
|
|
watch: {},
|
|
|
//方法集合
|
|
|
methods: {
|
|
|
- onStart() {
|
|
|
+ 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) {
|
|
|
let _this = this;
|
|
|
_this.drag = false;
|
|
|
let newarr = [
|
|
|
- ...new Set(
|
|
|
- this.curQue.option[index].detail.wordsList.map((item) =>
|
|
|
- JSON.stringify(item)
|
|
|
- )
|
|
|
- ),
|
|
|
+ ...new Set(this.SortArr[index].map((item) => JSON.stringify(item))),
|
|
|
];
|
|
|
let arr = newarr.map((item) => JSON.parse(item));
|
|
|
+ this.curQue.option[index].detail.wordsList = JSON.parse(
|
|
|
+ JSON.stringify(this.dragData)
|
|
|
+ );
|
|
|
//如果左边
|
|
|
- if (arr.length == this.curQue.option[index].detail.wordsList.length) {
|
|
|
+ if (arr.length == this.SortArr[index].length) {
|
|
|
return;
|
|
|
}
|
|
|
- this.curQue.option[index].detail.wordsList.splice(e.newDraggableIndex, 1);
|
|
|
+ this.SortArr[index].splice(e.newDraggableIndex, 1);
|
|
|
},
|
|
|
- onStart2(e) {
|
|
|
+ onStart2(e, index) {
|
|
|
this.drag = true;
|
|
|
- console.log(e);
|
|
|
},
|
|
|
//拖拽结束事件
|
|
|
onEnd2(e, index) {
|
|
@@ -253,22 +258,22 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-.NNPE-Big-Book-preview-green{
|
|
|
- .sentenceSort {
|
|
|
- .item-box{
|
|
|
- b{
|
|
|
- background: #24B99E;
|
|
|
- }
|
|
|
- }
|
|
|
+.NNPE-Big-Book-preview-green {
|
|
|
+ .sentenceSort {
|
|
|
+ .item-box {
|
|
|
+ b {
|
|
|
+ background: #24b99e;
|
|
|
+ }
|
|
|
}
|
|
|
+ }
|
|
|
}
|
|
|
-.NNPE-Big-Book-preview-brown{
|
|
|
- .sentenceSort {
|
|
|
- .item-box{
|
|
|
- b{
|
|
|
- background: #BD8865;
|
|
|
- }
|
|
|
- }
|
|
|
+.NNPE-Big-Book-preview-brown {
|
|
|
+ .sentenceSort {
|
|
|
+ .item-box {
|
|
|
+ b {
|
|
|
+ background: #bd8865;
|
|
|
+ }
|
|
|
}
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|