|
@@ -4,13 +4,14 @@
|
|
:visible.sync="modalIsShow"
|
|
:visible.sync="modalIsShow"
|
|
title="设置试卷蓝图"
|
|
title="设置试卷蓝图"
|
|
top="10px"
|
|
top="10px"
|
|
- width="800px"
|
|
|
|
|
|
+ width="660px"
|
|
:close-on-click-modal="false"
|
|
:close-on-click-modal="false"
|
|
:close-on-press-escape="false"
|
|
:close-on-press-escape="false"
|
|
append-to-body
|
|
append-to-body
|
|
@open="visibleChange"
|
|
@open="visibleChange"
|
|
>
|
|
>
|
|
- <el-table :data="dataList">
|
|
|
|
|
|
+ <p class="mb-2">{{ targetDesc }}</p>
|
|
|
|
+ <el-table :data="dataList" border>
|
|
<el-table-column
|
|
<el-table-column
|
|
prop="mainNumber"
|
|
prop="mainNumber"
|
|
label="大题号"
|
|
label="大题号"
|
|
@@ -21,7 +22,19 @@
|
|
label="小题号"
|
|
label="小题号"
|
|
width="80px"
|
|
width="80px"
|
|
></el-table-column>
|
|
></el-table-column>
|
|
- <el-table-column prop="dimensionList" label="知识点">
|
|
|
|
|
|
+ <el-table-column
|
|
|
|
+ prop="score"
|
|
|
|
+ label="小题满分"
|
|
|
|
+ width="80px"
|
|
|
|
+ ></el-table-column>
|
|
|
|
+ <el-table-column prop="target" label="所属课程目标">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <p v-for="target in scope.row.targetList" :key="target.targetId">
|
|
|
|
+ {{ target.targetName }}
|
|
|
|
+ </p>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <!-- <el-table-column prop="dimensionList" label="知识点">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<template v-for="target in scope.row.targetList">
|
|
<template v-for="target in scope.row.targetList">
|
|
<p
|
|
<p
|
|
@@ -32,7 +45,7 @@
|
|
</p>
|
|
</p>
|
|
</template>
|
|
</template>
|
|
</template>
|
|
</template>
|
|
- </el-table-column>
|
|
|
|
|
|
+ </el-table-column> -->
|
|
<el-table-column class-name="action-column" label="操作" width="110px">
|
|
<el-table-column class-name="action-column" label="操作" width="110px">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<el-button
|
|
<el-button
|
|
@@ -55,7 +68,7 @@
|
|
<!-- 设置知识点 -->
|
|
<!-- 设置知识点 -->
|
|
<select-blue-dimension-dialog
|
|
<select-blue-dimension-dialog
|
|
ref="SelectBlueDimensionDialog"
|
|
ref="SelectBlueDimensionDialog"
|
|
- :course="course"
|
|
|
|
|
|
+ :tree-data="treeData"
|
|
:selected-data="selectedData"
|
|
:selected-data="selectedData"
|
|
@confirm="dimensionSelected"
|
|
@confirm="dimensionSelected"
|
|
></select-blue-dimension-dialog>
|
|
></select-blue-dimension-dialog>
|
|
@@ -63,6 +76,8 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+import { calcSum } from "@/plugins/utils";
|
|
|
|
+import { courseTargetList } from "../../base/api";
|
|
import { endScorePaperPositiveDetail, endScorePaperPositiveSave } from "../api";
|
|
import { endScorePaperPositiveDetail, endScorePaperPositiveSave } from "../api";
|
|
import SelectBlueDimensionDialog from "./SelectBlueDimensionDialog.vue";
|
|
import SelectBlueDimensionDialog from "./SelectBlueDimensionDialog.vue";
|
|
|
|
|
|
@@ -84,9 +99,42 @@ export default {
|
|
dataList: [],
|
|
dataList: [],
|
|
curRow: {},
|
|
curRow: {},
|
|
selectedData: [],
|
|
selectedData: [],
|
|
|
|
+ treeData: [],
|
|
|
|
+ targetDesc: "",
|
|
};
|
|
};
|
|
},
|
|
},
|
|
|
|
+ watch: {
|
|
|
|
+ course: {
|
|
|
|
+ immediate: true,
|
|
|
|
+ handler(val, oldVal) {
|
|
|
|
+ if (!val) return;
|
|
|
|
+ if (val !== oldVal) this.getTree();
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ },
|
|
methods: {
|
|
methods: {
|
|
|
|
+ async getTree() {
|
|
|
|
+ const data = await courseTargetList({
|
|
|
|
+ examId: this.course.examId,
|
|
|
|
+ courseCode: this.course.courseCode,
|
|
|
|
+ });
|
|
|
|
+ this.treeData = (data || []).map((item) => {
|
|
|
|
+ return {
|
|
|
|
+ id: item.id,
|
|
|
|
+ name: item.targetName,
|
|
|
|
+ totalWeight: item.totalWeight,
|
|
|
|
+ disabled: false,
|
|
|
|
+ children: item.dimensionList.map((elem) => {
|
|
|
|
+ return { ...elem, disabled: false };
|
|
|
|
+ }),
|
|
|
|
+ };
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ this.targetDesc = this.treeData
|
|
|
|
+ .map((item) => `${item.name}占比${item.totalWeight}%`)
|
|
|
|
+ .join(",");
|
|
|
|
+ this.targetDesc += "。";
|
|
|
|
+ },
|
|
async getBlueDetail() {
|
|
async getBlueDetail() {
|
|
const res = await endScorePaperPositiveDetail({
|
|
const res = await endScorePaperPositiveDetail({
|
|
examId: this.course.examId,
|
|
examId: this.course.examId,
|
|
@@ -105,9 +153,36 @@ export default {
|
|
this.modalIsShow = true;
|
|
this.modalIsShow = true;
|
|
},
|
|
},
|
|
checkData() {
|
|
checkData() {
|
|
- return !this.dataList.some(
|
|
|
|
|
|
+ const valid = !this.dataList.some(
|
|
(item) => !item.targetList || !item.targetList.length
|
|
(item) => !item.targetList || !item.targetList.length
|
|
);
|
|
);
|
|
|
|
+
|
|
|
|
+ if (!valid) {
|
|
|
|
+ this.$message.error("还有小题未设置知识点,请完成设置!");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ const scoreData = {};
|
|
|
|
+ this.dataList.forEach((item) => {
|
|
|
|
+ if (!item.targetList || !item.targetList.length) return;
|
|
|
|
+ const targetId = item.targetList[0].targetId;
|
|
|
|
+ if (!scoreData[targetId]) scoreData[targetId] = 0;
|
|
|
|
+ scoreData[targetId] += item.score;
|
|
|
|
+ });
|
|
|
|
+ console.log(scoreData);
|
|
|
|
+ const totalScore = calcSum(Object.values(scoreData));
|
|
|
|
+
|
|
|
|
+ const unvalidTargets = [];
|
|
|
|
+ this.treeData.forEach((target) => {
|
|
|
|
+ const rate = (100 * scoreData[target.id]) / totalScore;
|
|
|
|
+ if (rate != target.totalWeight) unvalidTargets.push(target.name);
|
|
|
|
+ });
|
|
|
|
+ if (unvalidTargets.length) {
|
|
|
|
+ this.$message.error(`${unvalidTargets.join("、")}占比不符合要求`);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return true;
|
|
},
|
|
},
|
|
toLink(row) {
|
|
toLink(row) {
|
|
this.curRow = row;
|
|
this.curRow = row;
|
|
@@ -124,9 +199,9 @@ export default {
|
|
},
|
|
},
|
|
async submit() {
|
|
async submit() {
|
|
if (!this.checkData()) {
|
|
if (!this.checkData()) {
|
|
- this.$message.error("还有小题未设置知识点,请完成设置!");
|
|
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
+
|
|
if (this.isSubmit) return;
|
|
if (this.isSubmit) return;
|
|
this.isSubmit = true;
|
|
this.isSubmit = true;
|
|
const datas = {
|
|
const datas = {
|