|
@@ -100,7 +100,7 @@
|
|
|
type="primary"
|
|
|
plain
|
|
|
@click="exportPaperAnswer()"
|
|
|
- ><i class="el-icon-download"></i>导出答案</el-button
|
|
|
+ >导出答案</el-button
|
|
|
>
|
|
|
</el-dropdown-item>
|
|
|
<el-dropdown-item>
|
|
@@ -109,7 +109,7 @@
|
|
|
size="small"
|
|
|
plain
|
|
|
@click="openAnswerDialog"
|
|
|
- ><i class="el-icon-upload2"></i>导入答案
|
|
|
+ >导入答案
|
|
|
</el-button>
|
|
|
</el-dropdown-item>
|
|
|
</el-dropdown-menu>
|
|
@@ -167,6 +167,7 @@
|
|
|
</div>
|
|
|
<div class="edit-cont-action">
|
|
|
<el-button
|
|
|
+ v-show="isShowEditBtn()"
|
|
|
type="primary"
|
|
|
plain
|
|
|
size="small"
|
|
@@ -1019,22 +1020,28 @@
|
|
|
:visible.sync="dialogRadioFile"
|
|
|
:before-close="closeAudioDialog"
|
|
|
:modal="false"
|
|
|
+ width="520px"
|
|
|
append-to-body
|
|
|
custom-class="side-dialog"
|
|
|
>
|
|
|
- <form
|
|
|
- id="radioForm"
|
|
|
- method="post"
|
|
|
- action=""
|
|
|
- enctype="multipart/form-data"
|
|
|
- >
|
|
|
- <input
|
|
|
- id="radioFile"
|
|
|
- name="files"
|
|
|
- type="file"
|
|
|
- value="上传音频文件"
|
|
|
- webkitdirectory
|
|
|
- />
|
|
|
+ <div>
|
|
|
+ <div tabindex="0" class="el-upload el-upload--text">
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ icon="icon icon-search-white"
|
|
|
+ @click="selectAudioFile"
|
|
|
+ >选择文件</el-button
|
|
|
+ >
|
|
|
+ <input
|
|
|
+ id="radioFile"
|
|
|
+ class="el-upload__input"
|
|
|
+ name="files"
|
|
|
+ type="file"
|
|
|
+ value="上传音频文件"
|
|
|
+ webkitdirectory
|
|
|
+ @change="audioFileChange"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
<el-button type="warning" @click="checkFile">检查文件名</el-button>
|
|
|
<el-button
|
|
|
type="info"
|
|
@@ -1045,7 +1052,8 @@
|
|
|
<span v-show="!uploadAudioLoading">开始上传</span>
|
|
|
<span v-show="uploadAudioLoading">正在上传中...</span>
|
|
|
</el-button>
|
|
|
- </form>
|
|
|
+ </div>
|
|
|
+ <p v-if="audioFileName" class="tips-info">文件: {{ audioFileName }}</p>
|
|
|
<div v-if="checkResult" style="margin-top: 20px">
|
|
|
<span>检查结果:</span><br /><br />
|
|
|
<span v-show="message == 'OK!'" style="color: #13ce66">OK!</span>
|
|
@@ -1060,22 +1068,28 @@
|
|
|
:visible.sync="dialogAnswerFile"
|
|
|
:before-close="closeAnswerDialog"
|
|
|
:modal="false"
|
|
|
+ width="520px"
|
|
|
append-to-body
|
|
|
custom-class="side-dialog"
|
|
|
>
|
|
|
- <form
|
|
|
- id="answerForm"
|
|
|
- method="post"
|
|
|
- action=""
|
|
|
- enctype="multipart/form-data"
|
|
|
- >
|
|
|
- <input
|
|
|
- id="answerFile"
|
|
|
- name="answerFiles"
|
|
|
- type="file"
|
|
|
- value="上传答案文件"
|
|
|
- accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
|
- />
|
|
|
+ <div>
|
|
|
+ <div tabindex="0" class="el-upload el-upload--text">
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ icon="icon icon-search-white"
|
|
|
+ @click="selectAnswerFile"
|
|
|
+ >选择文件</el-button
|
|
|
+ >
|
|
|
+ <input
|
|
|
+ id="answerFile"
|
|
|
+ class="el-upload__input"
|
|
|
+ name="answerFiles"
|
|
|
+ type="file"
|
|
|
+ value="上传答案文件"
|
|
|
+ accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
|
+ @change="answerFileChange"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
<el-button type="primary" @click="downAnswerTemplate">
|
|
|
<span>下载模板</span>
|
|
|
</el-button>
|
|
@@ -1088,7 +1102,8 @@
|
|
|
<span v-show="!uploadAnswerLoading">开始上传</span>
|
|
|
<span v-show="uploadAnswerLoading">正在上传中...</span>
|
|
|
</el-button>
|
|
|
- </form>
|
|
|
+ </div>
|
|
|
+ <p v-if="answerFileName" class="tips-info">文件: {{ answerFileName }}</p>
|
|
|
<div style="margin-top: 20px">
|
|
|
<span v-show="answerMessage != ''" style="color: #ff4949">{{
|
|
|
answerMessage
|
|
@@ -1307,6 +1322,8 @@ export default {
|
|
|
showButtons: [],
|
|
|
showSubQuestions: {},
|
|
|
showSubButtons: {},
|
|
|
+ answerFileName: "",
|
|
|
+ audioFileName: "",
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -1669,6 +1686,7 @@ export default {
|
|
|
if (document.getElementById("answerFile")) {
|
|
|
document.getElementById("answerFile").value = "";
|
|
|
}
|
|
|
+ this.answerFileName = "";
|
|
|
this.dialogAnswerFile = true;
|
|
|
this.answerFileList = [];
|
|
|
},
|
|
@@ -1677,6 +1695,17 @@ export default {
|
|
|
this.answerMessage = "";
|
|
|
this.dialogAnswerFile = this.uploadAnswerLoading;
|
|
|
},
|
|
|
+ selectAnswerFile() {
|
|
|
+ document.getElementById("answerFile").click();
|
|
|
+ },
|
|
|
+ answerFileChange() {
|
|
|
+ let fileList = document.getElementById("answerFile").files;
|
|
|
+ if (fileList.length == 0) {
|
|
|
+ this.answerFileName = "";
|
|
|
+ } else {
|
|
|
+ this.answerFileName = fileList[0].name;
|
|
|
+ }
|
|
|
+ },
|
|
|
uploadAnswerFile() {
|
|
|
this.answerMessage = "";
|
|
|
var fileList = document.getElementById("answerFile").files;
|
|
@@ -2511,6 +2540,7 @@ export default {
|
|
|
if (document.getElementById("radioFile")) {
|
|
|
document.getElementById("radioFile").value = "";
|
|
|
}
|
|
|
+ this.audioFileName = "";
|
|
|
this.dialogRadioFile = true;
|
|
|
this.fileList = [];
|
|
|
},
|
|
@@ -2593,7 +2623,23 @@ export default {
|
|
|
console.log(error);
|
|
|
});
|
|
|
},
|
|
|
- //读取文件
|
|
|
+ // 音频文件
|
|
|
+ selectAudioFile() {
|
|
|
+ document.getElementById("radioFile").click();
|
|
|
+ },
|
|
|
+ audioFileChange() {
|
|
|
+ let fileList = document.getElementById("radioFile").files;
|
|
|
+ if (fileList.length == 0) {
|
|
|
+ this.audioFileName = "";
|
|
|
+ } else {
|
|
|
+ let names = [];
|
|
|
+ for (var i = 0; i < fileList.length; i++) {
|
|
|
+ var file = fileList[i];
|
|
|
+ names.push(file.name);
|
|
|
+ }
|
|
|
+ this.audioFileName = names.join();
|
|
|
+ }
|
|
|
+ },
|
|
|
uploadAudioFile() {
|
|
|
let param = new FormData();
|
|
|
var fileList = document.getElementById("radioFile").files;
|