|
@@ -39,7 +39,7 @@
|
|
|
<i class="el-icon-delete"></i> 删除
|
|
|
</el-button>
|
|
|
<el-dropdown class="button_left">
|
|
|
- <el-button type="primary" size="mini" plain>
|
|
|
+ <el-button type="primary" size="small">
|
|
|
更多 <i class="el-icon-arrow-down el-icon--right"></i>
|
|
|
</el-button>
|
|
|
<el-dropdown-menu slot="dropdown">
|
|
@@ -63,10 +63,9 @@
|
|
|
</el-dropdown-item>
|
|
|
<el-dropdown-item>
|
|
|
<el-button
|
|
|
- size="mini"
|
|
|
+ size="small"
|
|
|
type="primary"
|
|
|
@click="exportPaperAnswer()"
|
|
|
- plain
|
|
|
><i class="el-icon-download"></i>导出答案</el-button
|
|
|
>
|
|
|
</el-dropdown-item>
|
|
@@ -74,7 +73,7 @@
|
|
|
<el-button
|
|
|
v-show="parentView == 'import_paper'"
|
|
|
type="primary"
|
|
|
- @click="openDialog"
|
|
|
+ @click="openAnswerDialog"
|
|
|
size="small"
|
|
|
><i class="el-icon-upload2"></i> 导入答案
|
|
|
</el-button>
|
|
@@ -756,6 +755,41 @@
|
|
|
}}</span>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
+ <el-dialog
|
|
|
+ title="上传答案文件"
|
|
|
+ :visible.sync="dialogAnswerFile"
|
|
|
+ :before-close="closeAnswerDialog"
|
|
|
+ >
|
|
|
+ <form
|
|
|
+ id="answerForm"
|
|
|
+ method="post"
|
|
|
+ action=""
|
|
|
+ enctype="multipart/form-data"
|
|
|
+ >
|
|
|
+ <input
|
|
|
+ id="answerFile"
|
|
|
+ name="answerFiles"
|
|
|
+ type="file"
|
|
|
+ value="上传答案文件"
|
|
|
+ accept="application/xlsx"
|
|
|
+ webkitdirectory
|
|
|
+ />
|
|
|
+ <el-button
|
|
|
+ @click="uploadAnswerFile"
|
|
|
+ type="info"
|
|
|
+ :loading="uploadAnswerLoading"
|
|
|
+ :disabled="isUploadAnswer || uploadAnswerLoading"
|
|
|
+ >
|
|
|
+ <span v-show="!uploadAnswerLoading">开始上传</span>
|
|
|
+ <span v-show="uploadAnswerLoading">正在上传中...</span>
|
|
|
+ </el-button>
|
|
|
+ </form>
|
|
|
+ <div style="margin-top: 20px;" v-if="checkResultAnswer">
|
|
|
+ <span style="color: #ff4949;" v-show="answerMessage != ''">{{
|
|
|
+ answerMessage
|
|
|
+ }}</span>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -781,6 +815,7 @@ export default {
|
|
|
display: "block",
|
|
|
uploadAction: "",
|
|
|
fileList: [],
|
|
|
+ answerFileList: [],
|
|
|
paperId: "",
|
|
|
paperDetailId: "",
|
|
|
editPaperDetailUnit: "",
|
|
@@ -799,6 +834,7 @@ export default {
|
|
|
dialogLoading: false,
|
|
|
detailLoading: false,
|
|
|
uploadAudioLoading: false,
|
|
|
+ uploadAnswerLoading: false,
|
|
|
questionTypes: QUESTION_TYPES,
|
|
|
questionType: "",
|
|
|
quesModel: { quesProperties: [] },
|
|
@@ -811,9 +847,13 @@ export default {
|
|
|
options: ["正确", "错误"],
|
|
|
duplicateLoading: false,
|
|
|
dialogRadioFile: false,
|
|
|
+ dialogAnswerFile: false,
|
|
|
isUpload: true,
|
|
|
+ isUploadAnswer: true,
|
|
|
message: "",
|
|
|
+ answerMessage:"",
|
|
|
checkResult: false,
|
|
|
+ checkResultAnswer: false,
|
|
|
fileNameList: [],
|
|
|
defaultColor: [
|
|
|
"Red",
|
|
@@ -869,6 +909,50 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
+ openAnswerDialog() {
|
|
|
+ this.checkResultAnswer = false;
|
|
|
+ this.isUploadAnswer = true;
|
|
|
+ if (document.getElementById("answerFile")) {
|
|
|
+ document.getElementById("answerFile").value = "";
|
|
|
+ }
|
|
|
+ this.dialogAnswerFile = true;
|
|
|
+ this.answerFileList = [];
|
|
|
+ },
|
|
|
+
|
|
|
+ closeAnswerDialog() {
|
|
|
+ this.dialogAnswerFile = this.uploadAnswerLoading;
|
|
|
+ },
|
|
|
+ uploadAnswerFile() {
|
|
|
+ var fileList = document.getElementById("radioFile").files;
|
|
|
+ if (fileList.length == 0) {
|
|
|
+ this.answerMessage = "请选择文件!";
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ let param = new FormData();
|
|
|
+ //循环添加到formData中
|
|
|
+ for (var i = 0; i < fileList.length; i++) {
|
|
|
+ var file = fileList[i];
|
|
|
+ param.append("files", file, file.name);
|
|
|
+ }
|
|
|
+ let config = {
|
|
|
+ headers: { "Content-Type": "multipart/form-data" },
|
|
|
+ };
|
|
|
+ this.$http
|
|
|
+ .post(QUESTION_API + "/paper/answer/import/" + this.paperId, param, config)
|
|
|
+ .then(() => {
|
|
|
+ this.dialogAnswerFile = false;
|
|
|
+ this.uploadAnswerLoading = false;
|
|
|
+ this.checkResultAnswer = false;
|
|
|
+ this.isUploadAnswer = true;
|
|
|
+ document.getElementById("answerFile").value = "";
|
|
|
+ this.initPaper();
|
|
|
+ })
|
|
|
+ .catch((error) => {
|
|
|
+ this.answerMessage = error.response.data.desc;
|
|
|
+ this.uploadAnswerLoading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ },
|
|
|
//隐藏大题下的所有小题
|
|
|
hideContent(index) {
|
|
|
console.log("up");
|