|
@@ -2935,14 +2935,41 @@ export default {
|
|
|
this.dialogVisible4 = false;
|
|
|
},
|
|
|
addTools(i, itemTaskIndex, toolIndex) {
|
|
|
+ // if (
|
|
|
+ // this.unitJson[this.unitIndex].chapterInfo[0].taskJson[itemTaskIndex]
|
|
|
+ // .toolChoose[toolIndex].tool.length == 0
|
|
|
+ // ) {
|
|
|
+ // this.unitJson[this.unitIndex].chapterInfo[0].taskJson[
|
|
|
+ // itemTaskIndex
|
|
|
+ // ].toolChoose[toolIndex].tool.push(i);
|
|
|
+ // } else {
|
|
|
+ // if (
|
|
|
+ // this.unitJson[this.unitIndex].chapterInfo[0].taskJson[
|
|
|
+ // itemTaskIndex
|
|
|
+ // ].toolChoose[toolIndex].tool.indexOf(i) != -1
|
|
|
+ // ) {
|
|
|
+ // this.unitJson[this.unitIndex].chapterInfo[0].taskJson[
|
|
|
+ // itemTaskIndex
|
|
|
+ // ].toolChoose[toolIndex].tool.splice(
|
|
|
+ // this.unitJson[this.unitIndex].chapterInfo[0].taskJson[
|
|
|
+ // itemTaskIndex
|
|
|
+ // ].toolChoose[toolIndex].tool.indexOf(i),
|
|
|
+ // 1
|
|
|
+ // );
|
|
|
+ // } else {
|
|
|
+ // this.unitJson[this.unitIndex].chapterInfo[0].taskJson[
|
|
|
+ // itemTaskIndex
|
|
|
+ // ].toolChoose[toolIndex].tool.push(i);
|
|
|
+ // }
|
|
|
+ // console.log(
|
|
|
+ // this.unitJson[this.unitIndex].chapterInfo[0].taskJson[itemTaskIndex]
|
|
|
+ // .toolChoose[toolIndex].tool
|
|
|
+ // );
|
|
|
+ // }
|
|
|
if (
|
|
|
this.unitJson[this.unitIndex].chapterInfo[0].taskJson[itemTaskIndex]
|
|
|
- .toolChoose[toolIndex].tool.length == 0
|
|
|
+ .toolChoose[toolIndex].tool.length > 0
|
|
|
) {
|
|
|
- this.unitJson[this.unitIndex].chapterInfo[0].taskJson[
|
|
|
- itemTaskIndex
|
|
|
- ].toolChoose[toolIndex].tool.push(i);
|
|
|
- } else {
|
|
|
if (
|
|
|
this.unitJson[this.unitIndex].chapterInfo[0].taskJson[
|
|
|
itemTaskIndex
|
|
@@ -2957,15 +2984,17 @@ export default {
|
|
|
1
|
|
|
);
|
|
|
} else {
|
|
|
- this.unitJson[this.unitIndex].chapterInfo[0].taskJson[
|
|
|
- itemTaskIndex
|
|
|
- ].toolChoose[toolIndex].tool.push(i);
|
|
|
+ this.$message({
|
|
|
+ message: "每个工具只能添加一个",
|
|
|
+ type: "error",
|
|
|
+ });
|
|
|
}
|
|
|
- console.log(
|
|
|
- this.unitJson[this.unitIndex].chapterInfo[0].taskJson[itemTaskIndex]
|
|
|
- .toolChoose[toolIndex].tool
|
|
|
- );
|
|
|
+ } else {
|
|
|
+ this.unitJson[this.unitIndex].chapterInfo[0].taskJson[
|
|
|
+ itemTaskIndex
|
|
|
+ ].toolChoose[toolIndex].tool.push(i);
|
|
|
}
|
|
|
+
|
|
|
this.$forceUpdate();
|
|
|
},
|
|
|
addAskList() {
|