|
@@ -16,6 +16,16 @@
|
|
|
</p>
|
|
|
|
|
|
<div>
|
|
|
+ <el-select
|
|
|
+ v-model="curPaperType"
|
|
|
+ placeholder="选择卷型"
|
|
|
+ :clearable="false"
|
|
|
+ style="width: 100px; margin-right: 10px"
|
|
|
+ @change="paperTypeChange"
|
|
|
+ >
|
|
|
+ <el-option value="A" label="A卷"></el-option>
|
|
|
+ <el-option value="B" label="B卷"></el-option>
|
|
|
+ </el-select>
|
|
|
<el-button type="primary" @click="toImport">导入标答</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -179,10 +189,7 @@
|
|
|
title="导入客观题标答"
|
|
|
:upload-url="uploadUrl"
|
|
|
:format="['xls', 'xlsx']"
|
|
|
- :upload-data="{
|
|
|
- examId: basicInfo.examId,
|
|
|
- paperNumber: basicInfo.paperNumber,
|
|
|
- }"
|
|
|
+ :upload-data="uploadData"
|
|
|
:download-handle="downloadHandle"
|
|
|
:download-filename="dfilename"
|
|
|
:auto-upload="false"
|
|
@@ -217,6 +224,8 @@ export default {
|
|
|
NONE: "全对给分",
|
|
|
ALL: "任选给分",
|
|
|
},
|
|
|
+ curPaperType: "A",
|
|
|
+ prevPaperType: "A",
|
|
|
// import
|
|
|
uploadUrl: "/api/admin/mark/question/objective/import",
|
|
|
dfilename: "客观题标答导入模板.xlsx",
|
|
@@ -225,6 +234,13 @@ export default {
|
|
|
},
|
|
|
computed: {
|
|
|
...mapState("markParam", ["basicInfo"]),
|
|
|
+ uploadData() {
|
|
|
+ return {
|
|
|
+ examId: this.basicInfo.examId,
|
|
|
+ paperNumber: this.basicInfo.paperNumber,
|
|
|
+ paperType: this.curPaperType,
|
|
|
+ };
|
|
|
+ },
|
|
|
},
|
|
|
mounted() {
|
|
|
this.initData();
|
|
@@ -260,6 +276,13 @@ export default {
|
|
|
return nitem;
|
|
|
});
|
|
|
},
|
|
|
+ paperTypeChange() {
|
|
|
+ if (!this.checkData()) {
|
|
|
+ this.curPaperType = this.prevPaperType;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.prevPaperType = this.curPaperType;
|
|
|
+ },
|
|
|
getRowClassName({ row }) {
|
|
|
let classNames = [];
|
|
|
if (row.mainFirstSub) {
|
|
@@ -373,6 +396,7 @@ export default {
|
|
|
const datas = {
|
|
|
examId: this.basicInfo.examId,
|
|
|
paperNumber: this.basicInfo.paperNumber,
|
|
|
+ paperType: this.curPaperType,
|
|
|
objectiveInfo: this.tableData.map((item) =>
|
|
|
omit(item, ["mainFirstSub", "expandSub", "error", "errMsg", "mainId"])
|
|
|
),
|
|
@@ -384,6 +408,8 @@ export default {
|
|
|
this.$message.success(
|
|
|
"保存成功,请到成绩检查菜单点击客观题统分按钮进行统分!"
|
|
|
);
|
|
|
+
|
|
|
+ // TODO:检查其他卷是否已提交
|
|
|
// this.$emit("confirm");
|
|
|
},
|
|
|
cancel() {
|
|
@@ -395,10 +421,7 @@ export default {
|
|
|
this.downloading = true;
|
|
|
|
|
|
const res = await downloadByApi(() => {
|
|
|
- return markObjectiveQuestionExport({
|
|
|
- examId: this.basicInfo.examId,
|
|
|
- paperNumber: this.basicInfo.paperNumber,
|
|
|
- });
|
|
|
+ return markObjectiveQuestionExport(this.uploadData);
|
|
|
}).catch((e) => {
|
|
|
this.$message.error(e || "下载失败,请重新尝试!");
|
|
|
});
|