|
@@ -10592,7 +10592,7 @@ export default {
|
|
|
let count2 = await this.getWorksCount(3, i, j, tooli);
|
|
let count2 = await this.getWorksCount(3, i, j, tooli);
|
|
|
if (count1 > 0 || count2 > 0) {
|
|
if (count1 > 0 || count2 > 0) {
|
|
|
this.$confirm(
|
|
this.$confirm(
|
|
|
- "切换工具顺序将删除此工具的提交成果,是否继续此操作?",
|
|
|
|
|
|
|
+ "切换工具顺序将一起移动此工具的提交成果,是否继续此操作?",
|
|
|
"提示",
|
|
"提示",
|
|
|
{
|
|
{
|
|
|
confirmButtonText: "确定",
|
|
confirmButtonText: "确定",
|
|
@@ -10617,6 +10617,8 @@ export default {
|
|
|
);
|
|
);
|
|
|
this.unitJson[i].chapterInfo[0].taskJson[j].toolChoose[tooli] = a;
|
|
this.unitJson[i].chapterInfo[0].taskJson[j].toolChoose[tooli] = a;
|
|
|
this.$forceUpdate();
|
|
this.$forceUpdate();
|
|
|
|
|
+ this.moveWork(3, i, j, tooli - 1, i, j, tooli);
|
|
|
|
|
+ this.updateWork(2);
|
|
|
})
|
|
})
|
|
|
.catch(() => {
|
|
.catch(() => {
|
|
|
return;
|
|
return;
|
|
@@ -10636,6 +10638,7 @@ export default {
|
|
|
);
|
|
);
|
|
|
this.unitJson[i].chapterInfo[0].taskJson[j].toolChoose[tooli] = a;
|
|
this.unitJson[i].chapterInfo[0].taskJson[j].toolChoose[tooli] = a;
|
|
|
this.$forceUpdate();
|
|
this.$forceUpdate();
|
|
|
|
|
+ this.updateWork();
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
async downTool(e, i, j, tooli) {
|
|
async downTool(e, i, j, tooli) {
|
|
@@ -10650,7 +10653,7 @@ export default {
|
|
|
let count2 = await this.getWorksCount(3, i, j, tooli);
|
|
let count2 = await this.getWorksCount(3, i, j, tooli);
|
|
|
if (count1 > 0 || count2 > 0) {
|
|
if (count1 > 0 || count2 > 0) {
|
|
|
this.$confirm(
|
|
this.$confirm(
|
|
|
- "切换工具顺序将删除此工具的提交成果,是否继续此操作?",
|
|
|
|
|
|
|
+ "切换工具顺序将一起移动此工具的提交成果,是否继续此操作?",
|
|
|
"提示",
|
|
"提示",
|
|
|
{
|
|
{
|
|
|
confirmButtonText: "确定",
|
|
confirmButtonText: "确定",
|
|
@@ -10675,6 +10678,8 @@ export default {
|
|
|
);
|
|
);
|
|
|
this.unitJson[i].chapterInfo[0].taskJson[j].toolChoose[tooli] = a;
|
|
this.unitJson[i].chapterInfo[0].taskJson[j].toolChoose[tooli] = a;
|
|
|
this.$forceUpdate();
|
|
this.$forceUpdate();
|
|
|
|
|
+ this.moveWork(3, i, j, tooli + 1, i, j, tooli);
|
|
|
|
|
+ this.updateWork(2);
|
|
|
})
|
|
})
|
|
|
.catch(() => {
|
|
.catch(() => {
|
|
|
return;
|
|
return;
|
|
@@ -10694,6 +10699,7 @@ export default {
|
|
|
);
|
|
);
|
|
|
this.unitJson[i].chapterInfo[0].taskJson[j].toolChoose[tooli] = a;
|
|
this.unitJson[i].chapterInfo[0].taskJson[j].toolChoose[tooli] = a;
|
|
|
this.$forceUpdate();
|
|
this.$forceUpdate();
|
|
|
|
|
+ this.updateWork();
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
addWork(gotype) {
|
|
addWork(gotype) {
|
|
@@ -14114,7 +14120,7 @@ export default {
|
|
|
let count2 = await this.getWorksCount(2, 0, this.oldIndex, 0);
|
|
let count2 = await this.getWorksCount(2, 0, this.oldIndex, 0);
|
|
|
if (count1 > 0 || count2 > 0) {
|
|
if (count1 > 0 || count2 > 0) {
|
|
|
this.$confirm(
|
|
this.$confirm(
|
|
|
- "切换任务顺序将删除所有工具的提交成果,是否继续此操作?",
|
|
|
|
|
|
|
+ "切换任务顺序将一起移动所有工具的提交成果,是否继续此操作?",
|
|
|
"提示",
|
|
"提示",
|
|
|
{
|
|
{
|
|
|
confirmButtonText: "确定",
|
|
confirmButtonText: "确定",
|
|
@@ -14144,10 +14150,12 @@ export default {
|
|
|
this.unitJson[this.unitIndex].chapterInfo[0].taskJson = [
|
|
this.unitJson[this.unitIndex].chapterInfo[0].taskJson = [
|
|
|
...newItems
|
|
...newItems
|
|
|
];
|
|
];
|
|
|
|
|
+ this.moveWork(2, 0, this.newIndex, 0, 0, this.oldIndex, 0);
|
|
|
this.typeIndex = "";
|
|
this.typeIndex = "";
|
|
|
this.newIndex = "";
|
|
this.newIndex = "";
|
|
|
this.isdrag = "";
|
|
this.isdrag = "";
|
|
|
this.$forceUpdate();
|
|
this.$forceUpdate();
|
|
|
|
|
+ this.updateWork(2);
|
|
|
})
|
|
})
|
|
|
.catch(() => {
|
|
.catch(() => {
|
|
|
this.typeIndex = "";
|
|
this.typeIndex = "";
|
|
@@ -14178,6 +14186,7 @@ export default {
|
|
|
this.typeIndex = "";
|
|
this.typeIndex = "";
|
|
|
this.newIndex = "";
|
|
this.newIndex = "";
|
|
|
this.$forceUpdate();
|
|
this.$forceUpdate();
|
|
|
|
|
+ this.updateWork();
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
getWorksCount(type, stage, task, tool) {
|
|
getWorksCount(type, stage, task, tool) {
|
|
@@ -14204,6 +14213,34 @@ export default {
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
|
|
+ moveWork(type, nstage, ntask, ntool, ostage, otask, otool) {
|
|
|
|
|
+ // type: int 类型
|
|
|
|
|
+ // nstage, ntask, ntool: 新目标位置(目标单元/任务/工具)
|
|
|
|
|
+ // ostage, otask, otool: 原始位置
|
|
|
|
|
+ // this.cid 课程id
|
|
|
|
|
+ let params = [
|
|
|
|
|
+ {
|
|
|
|
|
+ cid: this.cid,
|
|
|
|
|
+ nstage: nstage,
|
|
|
|
|
+ ntask: ntask,
|
|
|
|
|
+ ntool: ntool,
|
|
|
|
|
+ type: type,
|
|
|
|
|
+ ostage: ostage,
|
|
|
|
|
+ otask: otask,
|
|
|
|
|
+ otool: otool
|
|
|
|
|
+ }
|
|
|
|
|
+ ];
|
|
|
|
|
+ return this.ajax
|
|
|
|
|
+ .post(this.$store.state.api + "moveCourseWork", params)
|
|
|
|
|
+ .then(res => {
|
|
|
|
|
+ console.log(res);
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(err => {
|
|
|
|
|
+ console.error("移动作品失败,网络异常");
|
|
|
|
|
+ console.error(err);
|
|
|
|
|
+ throw err;
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
openCodeEditor(type,val, unitIndex,itemTaskIndex = 0,index1){
|
|
openCodeEditor(type,val, unitIndex,itemTaskIndex = 0,index1){
|
|
|
console.log('openCodeEditor',type,val,unitIndex,itemTaskIndex,index1);
|
|
console.log('openCodeEditor',type,val,unitIndex,itemTaskIndex,index1);
|
|
|
|
|
|