|
@@ -496,10 +496,10 @@
|
|
|
</div> -->
|
|
|
<div v-for="(t, tIndex) in unitJson[unitIndex].chapterInfo[0]
|
|
|
.taskJson" :key="tIndex" :class="{
|
|
|
- dragOverTop: newIndex === tIndex && typeIndex == 'task-'+tIndex && oldIndex > tIndex,
|
|
|
- dragOverBottom: newIndex === tIndex && typeIndex == 'task-'+tIndex && oldIndex < tIndex,
|
|
|
+ dragOverTop: newIndex === tIndex && typeIndex == 'task-'+tIndex && oldIndex > tIndex && dragType == 'task',
|
|
|
+ dragOverBottom: newIndex === tIndex && typeIndex == 'task-'+tIndex && oldIndex < tIndex && dragType == 'task',
|
|
|
}">
|
|
|
- <div @dragstart="dragTaskStart(t, tIndex)" @dragover.prevent="dragTaskOver(tIndex)"
|
|
|
+ <div @dragstart="dragTaskStart(t, tIndex, 0)" @dragover.prevent="dragTaskOver(tIndex, 0)"
|
|
|
@dragend="dragTaskEnd()" draggable @click="goToTask(tIndex)" class="navTask" :class="{
|
|
|
isNavTask:
|
|
|
isClickColor > 0 && isClickColor == tIndex + 1,
|
|
@@ -538,11 +538,19 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="navBottom" v-if="courseState == 1">
|
|
|
- <div v-for="(stage, stageIndex) in unitJson" :key="stageIndex" class="stageBox" >
|
|
|
- <div @click="unitSet2(stageIndex)" class="navStage" :class="{
|
|
|
+ <div v-for="(stage, stageIndex) in unitJson" :key="stageIndex" class="stageBox" :class="{
|
|
|
+ dragOverTop: newIndex === stageIndex && typeIndex == 'Unit-'+stageIndex && oldIndex > stageIndex && dragType == 'Unit',
|
|
|
+ dragOverBottom: newIndex === stageIndex && typeIndex == 'Unit-'+stageIndex && oldIndex < stageIndex && dragType == 'Unit',
|
|
|
+ }">
|
|
|
+ <div @dragstart="dragUnitStart(stage, stageIndex)" @dragover.prevent="dragUnitOver(stageIndex)"
|
|
|
+ @dragend="dragUnitEnd()" draggable @click="unitSet2(stageIndex)" class="navStage" :class="{
|
|
|
isNavStage: stageIndex == unitIndex,
|
|
|
isNavStageOpen: stage.toolOpen
|
|
|
}">
|
|
|
+ <div
|
|
|
+ style="left: 8px;"
|
|
|
+ class="chapter_upload_drag"
|
|
|
+ ></div>
|
|
|
<div class="nt_taskBox">
|
|
|
<div class="nt_taskTitle">第{{ stageIndex + 1 }}阶段:</div>
|
|
|
<div class="nt_taskName">
|
|
@@ -554,17 +562,17 @@
|
|
|
</div>
|
|
|
<div v-for="(t, tIndex) in unitJson[stageIndex].chapterInfo[0]
|
|
|
.taskJson" :key="`${stageIndex}-${tIndex}`" :class="{
|
|
|
- dragOverTop: newIndex === tIndex && typeIndex == 'task-'+tIndex && oldIndex > tIndex && stageIndex == unitIndex,
|
|
|
- dragOverBottom: newIndex === tIndex && typeIndex == 'task-'+tIndex && oldIndex < tIndex && stageIndex == unitIndex,
|
|
|
+ dragOverTop: newIndex === tIndex && typeIndex == 'task-'+tIndex && ((oldIndex > tIndex && stageIndex == checkUnitIndex) || (oldIndex == tIndex && stageIndex == checkUnitIndex && checkUnitIndex != oldUnitIndex)) && dragType == 'task',
|
|
|
+ dragOverBottom: newIndex === tIndex && typeIndex == 'task-'+tIndex && oldIndex < tIndex && stageIndex == checkUnitIndex && dragType == 'task',
|
|
|
}" :style="{display:stage.toolOpen ? 'block' : 'none'}">
|
|
|
- <div @dragstart="dragTaskStart(t, tIndex)" @dragover.prevent="dragTaskOver(tIndex)"
|
|
|
+ <div @dragstart="dragTaskStart(t, tIndex, stageIndex)" @dragover.prevent="dragTaskOver(tIndex, stageIndex)"
|
|
|
@dragend="dragTaskEnd()" draggable @click="goToTask2(tIndex, stageIndex)" class="navTask" :class="{
|
|
|
isNavTask:
|
|
|
isClickColor > 0 && isClickColor == tIndex + 1 && stageIndex == unitIndex,
|
|
|
isNavOpen: t.toolOpen
|
|
|
}">
|
|
|
<div
|
|
|
- style="left: 8px;"
|
|
|
+ style="left: 12px;"
|
|
|
class="chapter_upload_drag"
|
|
|
></div>
|
|
|
<div class="nt_taskBox">
|
|
@@ -777,8 +785,8 @@
|
|
|
item1.type
|
|
|
)
|
|
|
" :class="{
|
|
|
- dragOverTop2: newIndex === index1 && typeIndex == 'chapter-'+itemTaskIndex+'-'+index1 && oldIndex > index1,
|
|
|
- dragOverBottom2: newIndex === index1 && typeIndex == 'chapter-'+itemTaskIndex+'-'+index1 && oldIndex < index1,
|
|
|
+ dragOverTop2: newIndex === index1 && typeIndex == 'chapter-'+itemTaskIndex+'-'+index1 && oldIndex > index1 && dragType == 'drag',
|
|
|
+ dragOverBottom2: newIndex === index1 && typeIndex == 'chapter-'+itemTaskIndex+'-'+index1 && oldIndex < index1 && dragType == 'drag',
|
|
|
}">
|
|
|
<div class="chapter_upload_drag"></div>
|
|
|
<div class="chapter_upload_o" style="
|
|
@@ -4126,6 +4134,8 @@ export default {
|
|
|
ppage: 1,
|
|
|
toolsData: toolsData,
|
|
|
oldIndex: 0,
|
|
|
+ dragType:'',
|
|
|
+ oldUnitIndex: 0,
|
|
|
oldData: null,
|
|
|
newIndex: "",
|
|
|
englishList:{},
|
|
@@ -4158,6 +4168,7 @@ export default {
|
|
|
homeworkList: [],
|
|
|
},
|
|
|
],
|
|
|
+ checkUnitIndex: 0,
|
|
|
|
|
|
};
|
|
|
},
|
|
@@ -9797,7 +9808,7 @@ export default {
|
|
|
},
|
|
|
dragStart(val, i, j) {
|
|
|
console.log(this.taskCount);
|
|
|
-
|
|
|
+ this.dragType = 'drag'
|
|
|
this.taskCount = j
|
|
|
this.oldIndex = i;
|
|
|
this.oldData = val;
|
|
@@ -9807,6 +9818,12 @@ export default {
|
|
|
this.newIndex = i;
|
|
|
},
|
|
|
dragEnd() {
|
|
|
+ if(this.dragType != 'drag'){
|
|
|
+ this.typeIndex = "";
|
|
|
+ this.newIndex = "";
|
|
|
+ this.dragType = "";
|
|
|
+ return;
|
|
|
+ }
|
|
|
console.log(this.taskCount);
|
|
|
|
|
|
let newItems = [...this.unitJson[this.unitIndex].chapterInfo[0].taskJson[this.taskCount].chapterData];
|
|
@@ -9817,20 +9834,33 @@ export default {
|
|
|
this.unitJson[this.unitIndex].chapterInfo[0].taskJson[this.taskCount].chapterData = [...newItems];
|
|
|
this.typeIndex = "";
|
|
|
this.newIndex = "";
|
|
|
+ this.dragType = "";
|
|
|
this.$forceUpdate()
|
|
|
},
|
|
|
- dragTaskStart(val, i) {
|
|
|
+ dragTaskStart(val, i, j) {
|
|
|
+ this.dragType = 'task'
|
|
|
this.oldIndex = i;
|
|
|
this.oldData = val;
|
|
|
+ this.oldUnitIndex = j;
|
|
|
},
|
|
|
- dragTaskOver(i) {
|
|
|
+ dragTaskOver(i, j) {
|
|
|
this.typeIndex = "task-" + i
|
|
|
this.newIndex = i;
|
|
|
+ this.checkUnitIndex = j;
|
|
|
},
|
|
|
dragTaskEnd() {
|
|
|
- if(this.newIndex == this.oldIndex){
|
|
|
+ if(this.dragType != 'task'){
|
|
|
+ this.newIndex = "";
|
|
|
+ this.dragType = "";
|
|
|
+ this.typeIndex = "";
|
|
|
+ this.checkUnitIndex = "";
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if((this.newIndex == this.oldIndex && this.oldUnitIndex == this.checkUnitIndex)){
|
|
|
this.newIndex = "";
|
|
|
+ this.dragType = "";
|
|
|
this.typeIndex = "";
|
|
|
+ this.checkUnitIndex = "";
|
|
|
return;
|
|
|
}
|
|
|
this.$confirm(
|
|
@@ -9843,18 +9873,85 @@ export default {
|
|
|
}
|
|
|
)
|
|
|
.then(() => {
|
|
|
- let newItems = [...this.unitJson[this.unitIndex].chapterInfo[0].taskJson];
|
|
|
- // 删除老的节点
|
|
|
+ if(this.oldUnitIndex != this.checkUnitIndex){
|
|
|
+ let newItems = [...this.unitJson[this.oldUnitIndex].chapterInfo[0].taskJson];
|
|
|
+ // 删除老的节点
|
|
|
+ newItems.splice(this.oldIndex, 1);
|
|
|
+ // 在列表中目标位置增加新的节点
|
|
|
+ let newItems2 = [...this.unitJson[this.checkUnitIndex].chapterInfo[0].taskJson];
|
|
|
+ newItems2.splice(this.newIndex, 0, this.oldData);
|
|
|
+ this.unitJson[this.oldUnitIndex].chapterInfo[0].taskJson = [...newItems];
|
|
|
+ this.unitJson[this.checkUnitIndex].chapterInfo[0].taskJson = [...newItems2];
|
|
|
+ }else{
|
|
|
+ let newItems = [...this.unitJson[this.oldUnitIndex].chapterInfo[0].taskJson];
|
|
|
+ // 删除老的节点
|
|
|
+ newItems.splice(this.oldIndex, 1);
|
|
|
+ // 在列表中目标位置增加新的节点
|
|
|
+ newItems.splice(this.newIndex, 0, this.oldData);
|
|
|
+ this.unitJson[this.oldUnitIndex].chapterInfo[0].taskJson = [...newItems];
|
|
|
+ }
|
|
|
+ this.typeIndex = "";
|
|
|
+ this.newIndex = "";
|
|
|
+ this.dragType = "";
|
|
|
+ this.checkUnitIndex = "";
|
|
|
+ this.updateWork();
|
|
|
+ this.$forceUpdate()
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.newIndex = "";
|
|
|
+ this.dragType = "";
|
|
|
+ this.typeIndex = "";
|
|
|
+ this.checkUnitIndex = "";
|
|
|
+ return;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ dragUnitStart(val, i) {
|
|
|
+ this.dragType = 'Unit'
|
|
|
+ this.oldIndex = i;
|
|
|
+ this.oldData = val;
|
|
|
+ },
|
|
|
+ dragUnitOver(i, j) {
|
|
|
+ this.typeIndex = "Unit-" + i
|
|
|
+ this.newIndex = i;
|
|
|
+ },
|
|
|
+ dragUnitEnd() {
|
|
|
+ if(this.dragType != 'task'){
|
|
|
+ this.newIndex = "";
|
|
|
+ this.dragType = "";
|
|
|
+ this.typeIndex = "";
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(this.newIndex == this.oldIndex){
|
|
|
+ this.newIndex = "";
|
|
|
+ this.dragType = "";
|
|
|
+ this.typeIndex = "";
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.$confirm(
|
|
|
+ "切换阶段顺序将删除所有工具的提交成果,是否继续此操作?",
|
|
|
+ "提示",
|
|
|
+ {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ }
|
|
|
+ )
|
|
|
+ .then(() => {
|
|
|
+ let newItems = [...this.unitJson];
|
|
|
+ // 删除老的节点
|
|
|
newItems.splice(this.oldIndex, 1);
|
|
|
// 在列表中目标位置增加新的节点
|
|
|
newItems.splice(this.newIndex, 0, this.oldData);
|
|
|
- this.unitJson[this.unitIndex].chapterInfo[0].taskJson = [...newItems];
|
|
|
+ this.unitJson = [...newItems];
|
|
|
this.typeIndex = "";
|
|
|
this.newIndex = "";
|
|
|
+ this.dragType = "";
|
|
|
+ this.updateWork();
|
|
|
this.$forceUpdate()
|
|
|
})
|
|
|
.catch(() => {
|
|
|
this.newIndex = "";
|
|
|
+ this.dragType = "";
|
|
|
this.typeIndex = "";
|
|
|
return;
|
|
|
});
|
|
@@ -10987,6 +11084,10 @@ export default {
|
|
|
z-index: 10;
|
|
|
}
|
|
|
|
|
|
+.isNavStage > .chapter_upload_drag{
|
|
|
+ background-image: url("../../assets/icon/new/icon_course_drag_active2.png");
|
|
|
+}
|
|
|
+
|
|
|
.chapter_upload_t {
|
|
|
background-color: #fff;
|
|
|
position: absolute;
|
|
@@ -13179,6 +13280,7 @@ ol {
|
|
|
/* background: #6b91b7; */
|
|
|
height: 100%;
|
|
|
overflow: auto;
|
|
|
+ padding: 10px 0;
|
|
|
}
|
|
|
|
|
|
.navStage {
|
|
@@ -13190,7 +13292,7 @@ ol {
|
|
|
cursor: pointer;
|
|
|
background: #ffffff;
|
|
|
width: 95%;
|
|
|
- margin: 10px auto 0;
|
|
|
+ margin: 5px auto 5px;
|
|
|
box-sizing: border-box;
|
|
|
border-radius: 5px;
|
|
|
flex-wrap: wrap;
|
|
@@ -13204,7 +13306,7 @@ ol {
|
|
|
height: 16px;
|
|
|
background-image: url(../../assets/icon/new/icon_stage.png);
|
|
|
background-size: 100%;
|
|
|
- margin-left: 10px;
|
|
|
+ margin-left: 25px;
|
|
|
}
|
|
|
|
|
|
.navStage::after {
|
|
@@ -13247,7 +13349,7 @@ ol {
|
|
|
|
|
|
|
|
|
.navStage .nt_taskBox {
|
|
|
- width: calc(100% - 53px);
|
|
|
+ width: calc(100% - 68px);
|
|
|
padding: 0 0 0 5px;
|
|
|
box-sizing: border-box;
|
|
|
box-sizing: border-box;
|
|
@@ -13282,7 +13384,7 @@ ol {
|
|
|
cursor: pointer;
|
|
|
background: #ffffff;
|
|
|
width: 95%;
|
|
|
- margin: 10px auto 0;
|
|
|
+ margin: 5px auto 5px;
|
|
|
box-sizing: border-box;
|
|
|
border-radius: 5px;
|
|
|
flex-wrap: wrap;
|
|
@@ -13305,7 +13407,17 @@ ol {
|
|
|
}
|
|
|
|
|
|
.isNavOpen::before {
|
|
|
+ /* background-image: url(../../assets/icon/new/icon_arrow_a.png) !important; */
|
|
|
+ transform: rotate(90deg);
|
|
|
+}
|
|
|
+
|
|
|
+.isNavTask::before {
|
|
|
background-image: url(../../assets/icon/new/icon_arrow_a.png) !important;
|
|
|
+ transform: rotate(-90deg);
|
|
|
+}
|
|
|
+
|
|
|
+.isNavTask.isNavOpen::before{
|
|
|
+ transform: rotate(0deg);
|
|
|
}
|
|
|
|
|
|
.dragOverTop {
|