|
@@ -505,7 +505,7 @@
|
|
|
isClickColor > 0 && isClickColor == tIndex + 1,
|
|
|
isNavOpen: t.toolOpen
|
|
|
}">
|
|
|
- <div @click.stop="taskOpen(tIndex)" class="chapter_upload_open"></div>
|
|
|
+ <div @click.stop="taskOpen(tIndex, 0)" class="chapter_upload_open"></div>
|
|
|
<div
|
|
|
@mousedown="isdrag = 'task-'+tIndex" @mouseup="isdrag = ''"
|
|
|
@touchstart="isdrag = 'task-'+tIndex" @touchend="isdrag = ''"
|
|
@@ -577,7 +577,7 @@
|
|
|
isClickColor > 0 && isClickColor == tIndex + 1 && stageIndex == unitIndex,
|
|
|
isNavOpen: t.toolOpen
|
|
|
}">
|
|
|
- <div @click.stop="taskOpen(tIndex)" class="chapter_upload_open"></div>
|
|
|
+ <div @click.stop="taskOpen(tIndex, stageIndex)" class="chapter_upload_open"></div>
|
|
|
<div
|
|
|
@mousedown="isdrag = 'task-'+stageIndex+'-'+tIndex" @mouseup="isdrag = ''"
|
|
|
@touchstart="isdrag = 'task-'+stageIndex+'-'+tIndex" @touchend="isdrag = ''"
|
|
@@ -6648,6 +6648,76 @@ export default {
|
|
|
console.error(err);
|
|
|
});
|
|
|
},
|
|
|
+ updateWork3(unitIndex) {
|
|
|
+ let _unitIndex = unitIndex;
|
|
|
+ let cPan = 1;
|
|
|
+ for (
|
|
|
+ var j = 0;
|
|
|
+ j < this.unitJson[_unitIndex].chapterInfo[0].taskJson.length;
|
|
|
+ j++
|
|
|
+ ) {
|
|
|
+ this.unitJson[_unitIndex].chapterInfo[0].taskJson[j].proVisible = false;
|
|
|
+ this.unitJson[_unitIndex].chapterInfo[0].taskJson[
|
|
|
+ j
|
|
|
+ ].proVisible2 = false;
|
|
|
+ if (
|
|
|
+ this.unitJson[_unitIndex].chapterInfo[0].taskJson[j].toolChoose
|
|
|
+ .length > 1
|
|
|
+ ) {
|
|
|
+ for (
|
|
|
+ var z = 0;
|
|
|
+ z <
|
|
|
+ this.unitJson[_unitIndex].chapterInfo[0].taskJson[j].toolChoose
|
|
|
+ .length;
|
|
|
+ z++
|
|
|
+ ) {
|
|
|
+ if (
|
|
|
+ !this.unitJson[_unitIndex].chapterInfo[0].taskJson[j].toolChoose[
|
|
|
+ z
|
|
|
+ ].tool.length
|
|
|
+ ) {
|
|
|
+ this.$message.error("请把工具添加完整");
|
|
|
+ cPan = 2;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (this.unitJson[_unitIndex].chapterInfo[0].taskJson[j].eList) {
|
|
|
+ this.unitJson[_unitIndex].chapterInfo[0].taskJson[j].eList =
|
|
|
+ this.unitJson[_unitIndex].chapterInfo[0].taskJson[j].eList.filter(
|
|
|
+ (ele) => {
|
|
|
+ return ele.value != "";
|
|
|
+ }
|
|
|
+ );
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.inputShow = true;
|
|
|
+ if (cPan == 2) {
|
|
|
+ this.steps--;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ let params = [
|
|
|
+ {
|
|
|
+ cid: this.cid,
|
|
|
+ chapters: JSON.stringify(this.unitJson),
|
|
|
+ uid: this.userid,
|
|
|
+ unitIndex: _unitIndex,
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ this.ajax
|
|
|
+ .post(this.$store.state.api + "updateWorkNew4", params)
|
|
|
+ .then((res) => {
|
|
|
+ // this.$message({
|
|
|
+ // message: "修改成功",
|
|
|
+ // type: "success",
|
|
|
+ // });
|
|
|
+ this.courseId = this.cid;
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ this.$message.error("网络不佳");
|
|
|
+ console.error(err);
|
|
|
+ });
|
|
|
+ },
|
|
|
updateWork() {
|
|
|
let cPan = 1;
|
|
|
for (var i = 0; i < this.unitJson.length; i++) {
|
|
@@ -9426,12 +9496,13 @@ export default {
|
|
|
// }
|
|
|
this.$forceUpdate();
|
|
|
},
|
|
|
- taskOpen(i){
|
|
|
- if (this.unitJson[this.unitIndex].chapterInfo[0].taskJson[i].toolOpen) {
|
|
|
- this.unitJson[this.unitIndex].chapterInfo[0].taskJson[i].toolOpen = false
|
|
|
+ taskOpen(i, stageIndex){
|
|
|
+ if (this.unitJson[stageIndex].chapterInfo[0].taskJson[i].toolOpen) {
|
|
|
+ this.unitJson[stageIndex].chapterInfo[0].taskJson[i].toolOpen = false
|
|
|
} else {
|
|
|
- this.unitJson[this.unitIndex].chapterInfo[0].taskJson[i].toolOpen = true
|
|
|
+ this.unitJson[stageIndex].chapterInfo[0].taskJson[i].toolOpen = true
|
|
|
}
|
|
|
+ this.updateWork3(stageIndex)
|
|
|
this.$forceUpdate();
|
|
|
},
|
|
|
goToTask2(i, stage) {
|