|
@@ -13,7 +13,12 @@
|
|
|
课程代码:{{ $route.query.courseNo }}
|
|
|
</p>
|
|
|
</div>
|
|
|
- <el-button type="primary" size="small" @click="save">保存</el-button>
|
|
|
+ <div>
|
|
|
+ <el-button type="primary" size="small" @click="save">保存</el-button>
|
|
|
+ <el-button type="primary" size="small" plain @click="back"
|
|
|
+ >返回</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<div class="form">
|
|
|
<el-form
|
|
@@ -121,7 +126,7 @@
|
|
|
<div style="color: #606266; font-size: 14px; line-height: 32px">
|
|
|
<span>选中范围预览:</span>
|
|
|
<span
|
|
|
- v-if="hasError()"
|
|
|
+ v-if="hasError"
|
|
|
class="red"
|
|
|
style="font-size: 12px; font-weight: bold"
|
|
|
>不满足最低要求</span
|
|
@@ -140,20 +145,35 @@
|
|
|
:prop="item.prop"
|
|
|
>
|
|
|
<template slot-scope="scope">
|
|
|
- <span
|
|
|
+ <div
|
|
|
v-if="
|
|
|
- !['hardInfo', 'mediumInfo', 'easyInfo'].includes(
|
|
|
+ ['hardInfo', 'mediumInfo', 'easyInfo'].includes(
|
|
|
item.prop
|
|
|
)
|
|
|
"
|
|
|
- :class="{ red: hasNumError(scope.row, item.prop) }"
|
|
|
- >{{ scope.row[item.prop] }}</span
|
|
|
- >
|
|
|
- <span
|
|
|
- v-else
|
|
|
- :class="{ red: hasNumError(scope.row, item.prop) }"
|
|
|
- >{{ scope.row[item.prop]?.count }}</span
|
|
|
>
|
|
|
+ <el-tooltip
|
|
|
+ v-if="!scope.row[item.prop].valid"
|
|
|
+ effect="dark"
|
|
|
+ :content="scope.row[item.prop].invalidMsg"
|
|
|
+ placement="top"
|
|
|
+ >
|
|
|
+ <span class="red">{{
|
|
|
+ scope.row[item.prop]?.count
|
|
|
+ }}</span>
|
|
|
+ </el-tooltip>
|
|
|
+ <span v-else>{{ scope.row[item.prop]?.count }}</span>
|
|
|
+ </div>
|
|
|
+ <div v-else>
|
|
|
+ <span
|
|
|
+ v-if="
|
|
|
+ item.prop === 'totalCount' && hasNumError(scope.row)
|
|
|
+ "
|
|
|
+ style="color: #f56c6c; font-weight: bold"
|
|
|
+ >{{ scope.row[item.prop] }}</span
|
|
|
+ >
|
|
|
+ <span v-else>{{ scope.row[item.prop] }}</span>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -173,6 +193,7 @@ export default {
|
|
|
components: { LinkTitlesCustom },
|
|
|
data() {
|
|
|
return {
|
|
|
+ hasError: false,
|
|
|
form: {
|
|
|
paperStructType: "BLUEPRINT",
|
|
|
name: "",
|
|
@@ -288,11 +309,18 @@ export default {
|
|
|
return true;
|
|
|
}
|
|
|
},
|
|
|
+ back() {
|
|
|
+ if (this.$route.params?.id) {
|
|
|
+ this.$router.push("/questions/extract_paper_template");
|
|
|
+ } else {
|
|
|
+ this.$router.push("/questions/gen_paper/0");
|
|
|
+ }
|
|
|
+ },
|
|
|
save() {
|
|
|
this.checked = true;
|
|
|
this.$refs.form.validate((valid) => {
|
|
|
if (valid) {
|
|
|
- if (this.multipleSelection.length && !this.hasError()) {
|
|
|
+ if (this.multipleSelection.length && !this.hasError) {
|
|
|
let params = {
|
|
|
courseId: this.$route.query.courseId,
|
|
|
...this.form,
|
|
@@ -318,6 +346,9 @@ export default {
|
|
|
return !!this.form.paperStructId;
|
|
|
},
|
|
|
structChange() {
|
|
|
+ if (!this.form.paperStructId) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
this.tableLoading1 = true;
|
|
|
this.$http
|
|
|
.post("/api/ecs_ques/randompaper/struct/question/info", null, {
|
|
@@ -394,6 +425,7 @@ export default {
|
|
|
if (this.lastRequestKey === str) {
|
|
|
this.tableData3 = res.data.structQuestionInfo || [];
|
|
|
this.tableLoading3 = false;
|
|
|
+ this.hasError = !res.data.valid;
|
|
|
}
|
|
|
});
|
|
|
},
|
|
@@ -401,39 +433,44 @@ export default {
|
|
|
this.multipleSelection = val;
|
|
|
this.getTable3();
|
|
|
},
|
|
|
- hasNumError(row, prop) {
|
|
|
- if (prop === "detailName") {
|
|
|
- return false;
|
|
|
- } else {
|
|
|
- let targetName = row.detailName;
|
|
|
- let find = this.tableData1.find(
|
|
|
- (item) => item.detailName === targetName
|
|
|
- );
|
|
|
- if (!find) {
|
|
|
- return false;
|
|
|
- } else {
|
|
|
- if (prop === "totalCount") {
|
|
|
- return row[prop] < find[prop];
|
|
|
- } else {
|
|
|
- return row[prop].count < find[prop].count;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- hasError() {
|
|
|
+ hasNumError(row) {
|
|
|
return (
|
|
|
- this.tableData1.length &&
|
|
|
- this.tableData3.length &&
|
|
|
- this.tableData3.every((item) => {
|
|
|
- return (
|
|
|
- this.hasNumError(item, "totalCount") ||
|
|
|
- this.hasNumError(item, "hardInfo") ||
|
|
|
- this.hasNumError(item, "mediumInfo") ||
|
|
|
- this.hasNumError(item, "easyInfo")
|
|
|
- );
|
|
|
- })
|
|
|
+ row.easyInfo?.valid == false ||
|
|
|
+ row.hardInfo?.valid == false ||
|
|
|
+ row.mediumInfo?.valid == false
|
|
|
);
|
|
|
+ // if (prop === "detailName") {
|
|
|
+ // return false;
|
|
|
+ // } else {
|
|
|
+ // let targetName = row.detailName;
|
|
|
+ // let find = this.tableData1.find(
|
|
|
+ // (item) => item.detailName === targetName
|
|
|
+ // );
|
|
|
+ // if (!find) {
|
|
|
+ // return false;
|
|
|
+ // } else {
|
|
|
+ // if (prop === "totalCount") {
|
|
|
+ // return row[prop] < find[prop];
|
|
|
+ // } else {
|
|
|
+ // return row[prop].count < find[prop].count;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
},
|
|
|
+ // hasError() {
|
|
|
+ // return (
|
|
|
+ // this.tableData1.length &&
|
|
|
+ // this.tableData3.length &&
|
|
|
+ // this.tableData3.every((item) => {
|
|
|
+ // return (
|
|
|
+ // this.hasNumError(item, "totalCount") ||
|
|
|
+ // this.hasNumError(item, "hardInfo") ||
|
|
|
+ // this.hasNumError(item, "mediumInfo") ||
|
|
|
+ // this.hasNumError(item, "easyInfo")
|
|
|
+ // );
|
|
|
+ // })
|
|
|
+ // );
|
|
|
+ // },
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
@@ -450,6 +487,9 @@ export default {
|
|
|
|
|
|
::v-deep .red {
|
|
|
color: #f56c6c;
|
|
|
+ font-weight: bold;
|
|
|
+ text-decoration: underline;
|
|
|
+ cursor: pointer;
|
|
|
}
|
|
|
|
|
|
p {
|