|
|
@@ -13224,7 +13224,7 @@ ${_this.unitJson[0].chapterInfo[0].taskJson[index].taskDetail3.replaceAll('#',''
|
|
|
let count2 = await this.getWorksCount(3, i, j, tooli);
|
|
|
if (count1 > 0 || count2 > 0) {
|
|
|
this.$confirm(
|
|
|
- "切换工具顺序将删除此工具的提交成果,是否继续此操作?",
|
|
|
+ "切换工具顺序将一起移动此工具的提交成果,是否继续此操作?",
|
|
|
"提示",
|
|
|
{
|
|
|
confirmButtonText: "确定",
|
|
|
@@ -13248,6 +13248,8 @@ ${_this.unitJson[0].chapterInfo[0].taskJson[index].taskDetail3.replaceAll('#',''
|
|
|
);
|
|
|
this.unitJson[i].chapterInfo[0].taskJson[j].toolChoose[tooli] = a;
|
|
|
this.$forceUpdate();
|
|
|
+ this.moveWork(3, i, j, tooli - 1, i, j, tooli);
|
|
|
+ this.updateWork();
|
|
|
})
|
|
|
.catch(() => {
|
|
|
return;
|
|
|
@@ -13280,7 +13282,7 @@ ${_this.unitJson[0].chapterInfo[0].taskJson[index].taskDetail3.replaceAll('#',''
|
|
|
let count2 = await this.getWorksCount(3, i, j, tooli);
|
|
|
if (count1 > 0 || count2 > 0) {
|
|
|
this.$confirm(
|
|
|
- "切换工具顺序将删除此工具的提交成果,是否继续此操作?",
|
|
|
+ "切换工具顺序将一起移动此工具的提交成果,是否继续此操作?",
|
|
|
"提示",
|
|
|
{
|
|
|
confirmButtonText: "确定",
|
|
|
@@ -13304,6 +13306,8 @@ ${_this.unitJson[0].chapterInfo[0].taskJson[index].taskDetail3.replaceAll('#',''
|
|
|
);
|
|
|
this.unitJson[i].chapterInfo[0].taskJson[j].toolChoose[tooli] = a;
|
|
|
this.$forceUpdate();
|
|
|
+ this.moveWork(3, i, j, tooli + 1, i, j, tooli);
|
|
|
+ this.updateWork();
|
|
|
})
|
|
|
.catch(() => {
|
|
|
return;
|
|
|
@@ -17844,7 +17848,7 @@ ${_this.unitJson[0].chapterInfo[0].taskJson[index].taskDetail3.replaceAll('#',''
|
|
|
);
|
|
|
if (count1 > 0 || count2 > 0) {
|
|
|
this.$confirm(
|
|
|
- "切换任务顺序将删除所有工具的提交成果,是否继续此操作?",
|
|
|
+ "切换任务顺序将一起移动所有工具的提交成果,是否继续此操作?",
|
|
|
"提示",
|
|
|
{
|
|
|
confirmButtonText: "确定",
|
|
|
@@ -17893,6 +17897,7 @@ ${_this.unitJson[0].chapterInfo[0].taskJson[index].taskDetail3.replaceAll('#',''
|
|
|
...newItems,
|
|
|
];
|
|
|
}
|
|
|
+ this.moveWork(2, this.checkUnitIndex, this.newIndex, 0, this.oldUnitIndex, this.oldIndex, 0);
|
|
|
this.typeIndex = "";
|
|
|
this.newIndex = "";
|
|
|
this.dragType = "";
|
|
|
@@ -17994,7 +17999,7 @@ ${_this.unitJson[0].chapterInfo[0].taskJson[index].taskDetail3.replaceAll('#',''
|
|
|
console.log(count1, count2);
|
|
|
if (count1 > 0 || count2 > 0) {
|
|
|
this.$confirm(
|
|
|
- "切换阶段顺序将删除所有工具的提交成果,是否继续此操作?",
|
|
|
+ "切换阶段顺序将一起移动所有任务的提交成果,是否继续此操作?",
|
|
|
"提示",
|
|
|
{
|
|
|
confirmButtonText: "确定",
|
|
|
@@ -18009,6 +18014,7 @@ ${_this.unitJson[0].chapterInfo[0].taskJson[index].taskDetail3.replaceAll('#',''
|
|
|
// 在列表中目标位置增加新的节点
|
|
|
newItems.splice(this.newIndex, 0, this.oldData);
|
|
|
this.unitJson = [...newItems];
|
|
|
+ this.moveWork(1, this.newIndex, 0, 0, this.oldIndex, 0, 0);
|
|
|
this.typeIndex = "";
|
|
|
this.newIndex = "";
|
|
|
this.dragType = "";
|
|
|
@@ -18062,6 +18068,34 @@ ${_this.unitJson[0].chapterInfo[0].taskJson[index].taskDetail3.replaceAll('#',''
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
+ 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;
|
|
|
+ });
|
|
|
+ },
|
|
|
getTwoType(id) {
|
|
|
this.twoJson = [];
|
|
|
var array = this.CourseTypeJson1[
|