|
@@ -438,20 +438,16 @@ export default {
|
|
});
|
|
});
|
|
},
|
|
},
|
|
async toDeleteSub(row) {
|
|
async toDeleteSub(row) {
|
|
- if (row.objective) {
|
|
|
|
- const confirm = await this.$confirm(`确定要删除小题吗?`, "提示", {
|
|
|
|
- type: "warning",
|
|
|
|
- }).catch(() => {});
|
|
|
|
- if (confirm !== "confirm") return;
|
|
|
|
- } else {
|
|
|
|
- if (
|
|
|
|
- this.groupQuestions.includes(`${row.mainNumber}-${row.subNumber}`)
|
|
|
|
- ) {
|
|
|
|
- this.$message.error("当前小题已有分组,不可删除!");
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
|
|
+ if (!row.objective && this.checkSubQuestionHasGroup(row)) {
|
|
|
|
+ this.$message.error("当前小题已有分组,不可删除!");
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ const confirm = await this.$confirm(`确定要删除小题吗?`, "提示", {
|
|
|
|
+ type: "warning",
|
|
|
|
+ }).catch(() => {});
|
|
|
|
+ if (confirm !== "confirm") return;
|
|
|
|
+
|
|
const subPos = this.tableData.findIndex((item) => item.key === row.key);
|
|
const subPos = this.tableData.findIndex((item) => item.key === row.key);
|
|
this.tableData.splice(subPos, 1);
|
|
this.tableData.splice(subPos, 1);
|
|
|
|
|