|
@@ -50,7 +50,7 @@
|
|
label="小题号"
|
|
label="小题号"
|
|
width="80"
|
|
width="80"
|
|
></el-table-column>
|
|
></el-table-column>
|
|
- <el-table-column prop="totalScore" label="ß" width="85">
|
|
|
|
|
|
+ <el-table-column prop="totalScore" label="小题满分" width="85">
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column label="答案" width="140px" class-name="answer-column">
|
|
<el-table-column label="答案" width="140px" class-name="answer-column">
|
|
<div
|
|
<div
|
|
@@ -78,49 +78,68 @@
|
|
width="270px"
|
|
width="270px"
|
|
class-name="answer-column"
|
|
class-name="answer-column"
|
|
>
|
|
>
|
|
- <template v-if="scope.row.questionType === 2" slot-scope="scope">
|
|
|
|
- <el-select
|
|
|
|
- v-model="scope.row.objectivePolicy"
|
|
|
|
- style="width: 120px"
|
|
|
|
- @change="objectivePolicyChange(scope.row)"
|
|
|
|
- >
|
|
|
|
- <el-option
|
|
|
|
- v-for="(val, key) in QUESTION_SCORE_TYPE"
|
|
|
|
- :key="key"
|
|
|
|
- :value="key"
|
|
|
|
- :label="val"
|
|
|
|
- ></el-option>
|
|
|
|
- </el-select>
|
|
|
|
- <div
|
|
|
|
- v-if="scope.row.objectivePolicy === 'PICK'"
|
|
|
|
- :class="[
|
|
|
|
- 'el-form-item',
|
|
|
|
- { 'is-error': scope.row.objectivePolicyError },
|
|
|
|
- ]"
|
|
|
|
- style="display: inline-block"
|
|
|
|
- >
|
|
|
|
- <div class="el-form-item__content">
|
|
|
|
- <el-input-number
|
|
|
|
- v-model="scope.row.objectivePolicyPickScore"
|
|
|
|
- style="width: 110px; margin-left: 5px"
|
|
|
|
- size="small"
|
|
|
|
- :min="0"
|
|
|
|
- :max="100"
|
|
|
|
- :step="0.5"
|
|
|
|
- step-strictly
|
|
|
|
- :controls="false"
|
|
|
|
- placeholder="每个选项得分"
|
|
|
|
- @change="validateObjectivePolicy(scope.row)"
|
|
|
|
- ></el-input-number>
|
|
|
|
- <div
|
|
|
|
- v-if="scope.row.objectivePolicyError"
|
|
|
|
- class="el-form-item__error"
|
|
|
|
- style="padding-left: 5px"
|
|
|
|
- >
|
|
|
|
- {{ scope.row.objectivePolicyError }}
|
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <template v-if="scope.row.questionType === 2">
|
|
|
|
+ <el-select
|
|
|
|
+ v-model="scope.row.objectivePolicy"
|
|
|
|
+ style="width: 120px"
|
|
|
|
+ @change="objectivePolicyChange(scope.row)"
|
|
|
|
+ >
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="(val, key) in QUESTION_SCORE_TYPE"
|
|
|
|
+ :key="key"
|
|
|
|
+ :value="key"
|
|
|
|
+ :label="val"
|
|
|
|
+ ></el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ <div
|
|
|
|
+ v-if="scope.row.objectivePolicy === 'LEAK'"
|
|
|
|
+ :class="[
|
|
|
|
+ 'el-form-item',
|
|
|
|
+ { 'is-error': scope.row.objectivePolicyError },
|
|
|
|
+ ]"
|
|
|
|
+ style="display: inline-block"
|
|
|
|
+ >
|
|
|
|
+ <div class="el-form-item__content">
|
|
|
|
+ <el-input-number
|
|
|
|
+ v-model="scope.row.objectivePolicyScore"
|
|
|
|
+ style="width: 110px; margin-left: 5px"
|
|
|
|
+ size="small"
|
|
|
|
+ :min="0"
|
|
|
|
+ :max="100"
|
|
|
|
+ :step="0.5"
|
|
|
|
+ step-strictly
|
|
|
|
+ :controls="false"
|
|
|
|
+ placeholder="每个选项得分"
|
|
|
|
+ @change="validateObjectivePolicy(scope.row)"
|
|
|
|
+ ></el-input-number>
|
|
|
|
+ <div
|
|
|
|
+ v-if="scope.row.objectivePolicyError"
|
|
|
|
+ class="el-form-item__error"
|
|
|
|
+ style="padding-left: 5px"
|
|
|
|
+ >
|
|
|
|
+ {{ scope.row.objectivePolicyError }}
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- </div>
|
|
|
|
|
|
+ </template>
|
|
|
|
+ <template
|
|
|
|
+ v-if="
|
|
|
|
+ scope.row.questionType === 1 || scope.row.questionType === 3
|
|
|
|
+ "
|
|
|
|
+ >
|
|
|
|
+ <el-select
|
|
|
|
+ v-model="scope.row.objectivePolicy"
|
|
|
|
+ style="width: 120px"
|
|
|
|
+ >
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="(val, key) in QUESTION_SCORE_TYPE_SIMPLE"
|
|
|
|
+ :key="key"
|
|
|
|
+ :value="key"
|
|
|
|
+ :label="val"
|
|
|
|
+ ></el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </template>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
@@ -152,6 +171,10 @@ export default {
|
|
tableData: [],
|
|
tableData: [],
|
|
QUESTION_SCORE_TYPE,
|
|
QUESTION_SCORE_TYPE,
|
|
abc: "abcdefghijklmnopqrstuvwxyz".toUpperCase(),
|
|
abc: "abcdefghijklmnopqrstuvwxyz".toUpperCase(),
|
|
|
|
+ QUESTION_SCORE_TYPE_SIMPLE: {
|
|
|
|
+ NONE: "全对给分",
|
|
|
|
+ ALL: "任选给半分",
|
|
|
|
+ },
|
|
};
|
|
};
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -173,13 +196,13 @@ export default {
|
|
this.tableData = objectiveStructure.map((item) => {
|
|
this.tableData = objectiveStructure.map((item) => {
|
|
let nitem = {
|
|
let nitem = {
|
|
...item,
|
|
...item,
|
|
- objectivePolicyPickScore: item.objectivePolicyPickScore || undefined,
|
|
|
|
|
|
+ objectivePolicyScore: item.objectivePolicyScore || undefined,
|
|
mainFirstSub: false,
|
|
mainFirstSub: false,
|
|
expandSub: true,
|
|
expandSub: true,
|
|
answerError: "",
|
|
answerError: "",
|
|
objectivePolicyError: "",
|
|
objectivePolicyError: "",
|
|
};
|
|
};
|
|
- if (item.questionType === 2 && !item.objectivePolicy) {
|
|
|
|
|
|
+ if (item.questionType <= 3 && !item.objectivePolicy) {
|
|
nitem.objectivePolicy = "NONE";
|
|
nitem.objectivePolicy = "NONE";
|
|
}
|
|
}
|
|
if (nitem.mainNumber !== curMainNumber) {
|
|
if (nitem.mainNumber !== curMainNumber) {
|
|
@@ -255,18 +278,15 @@ export default {
|
|
row.answerError = "";
|
|
row.answerError = "";
|
|
},
|
|
},
|
|
validateObjectivePolicy(row) {
|
|
validateObjectivePolicy(row) {
|
|
- if (row.questionType === 2 && row.objectivePolicy === "PICK") {
|
|
|
|
- if (
|
|
|
|
- !row.objectivePolicyPickScore &&
|
|
|
|
- row.objectivePolicyPickScore !== 0
|
|
|
|
- ) {
|
|
|
|
|
|
+ if (row.questionType === 2 && row.objectivePolicy === "LEAK") {
|
|
|
|
+ if (!row.objectivePolicyScore && row.objectivePolicyScore !== 0) {
|
|
row.objectivePolicyError = "不能为空";
|
|
row.objectivePolicyError = "不能为空";
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
if (
|
|
if (
|
|
row.answer &&
|
|
row.answer &&
|
|
- row.objectivePolicyPickScore * row.answer.length > row.totalScore
|
|
|
|
|
|
+ row.objectivePolicyScore * row.answer.length > row.totalScore
|
|
) {
|
|
) {
|
|
row.objectivePolicyError = "分值过大";
|
|
row.objectivePolicyError = "分值过大";
|
|
return;
|
|
return;
|
|
@@ -287,17 +307,17 @@ export default {
|
|
},
|
|
},
|
|
objectivePolicyChange(row) {
|
|
objectivePolicyChange(row) {
|
|
const { totalScore, answer, objectivePolicy } = row;
|
|
const { totalScore, answer, objectivePolicy } = row;
|
|
- if (objectivePolicy === "PICK") {
|
|
|
|
|
|
+ if (objectivePolicy === "LEAK") {
|
|
if (answer) {
|
|
if (answer) {
|
|
const answerCount = answer.length;
|
|
const answerCount = answer.length;
|
|
const pickScore = Math.floor((totalScore * 2) / answerCount) / 2;
|
|
const pickScore = Math.floor((totalScore * 2) / answerCount) / 2;
|
|
|
|
|
|
- row.objectivePolicyPickScore = pickScore;
|
|
|
|
|
|
+ row.objectivePolicyScore = pickScore;
|
|
} else {
|
|
} else {
|
|
- row.objectivePolicyPickScore = undefined;
|
|
|
|
|
|
+ row.objectivePolicyScore = undefined;
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
- row.objectivePolicyPickScore = undefined;
|
|
|
|
|
|
+ row.objectivePolicyScore = null;
|
|
}
|
|
}
|
|
this.validateObjectivePolicy(row);
|
|
this.validateObjectivePolicy(row);
|
|
},
|
|
},
|