|
|
@@ -307,13 +307,31 @@
|
|
|
<el-dialog title="导入结果" :close-on-press-escape="false" :close-on-click-modal="false" :visible.sync="importMsgOpen" width="500px" append-to-body>
|
|
|
<div class="import-msg" v-html="importMsg">
|
|
|
</div>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="importMsgOpen = false">关 闭</el-button>
|
|
|
+ <el-button
|
|
|
+ v-if="failList && failList.length > 0"
|
|
|
+ type="primary"
|
|
|
+ @click="handleExportFailList(failList)"
|
|
|
+ :loading="exportFailLoading"
|
|
|
+ >导出失败信息</el-button>
|
|
|
+ </div>
|
|
|
</el-dialog>
|
|
|
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { listCourseQuestionBank, getCourseQuestionBank, delCourseQuestionBank, addCourseQuestionBank, updateCourseQuestionBank, exportCourseQuestionBank, importTemplate } from "@/api/course/courseQuestionBank";
|
|
|
+import {
|
|
|
+ listCourseQuestionBank,
|
|
|
+ getCourseQuestionBank,
|
|
|
+ delCourseQuestionBank,
|
|
|
+ addCourseQuestionBank,
|
|
|
+ updateCourseQuestionBank,
|
|
|
+ exportCourseQuestionBank,
|
|
|
+ importTemplate,
|
|
|
+ exportFail
|
|
|
+} from "@/api/course/courseQuestionBank";
|
|
|
import { getToken } from "@/utils/auth";
|
|
|
import {
|
|
|
listUserCourseCategory,
|
|
|
@@ -334,7 +352,7 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
-
|
|
|
+ exportFailLoading: false,
|
|
|
//单选
|
|
|
selectedAnswer:null,
|
|
|
//多选
|
|
|
@@ -397,6 +415,7 @@ export default {
|
|
|
},
|
|
|
// 导入
|
|
|
importMsgOpen:false,
|
|
|
+ failList:[],
|
|
|
importMsg: '',
|
|
|
upload: {
|
|
|
// 是否显示弹出层(文件导入)
|
|
|
@@ -426,6 +445,33 @@ export default {
|
|
|
getOptionLabel(index) {
|
|
|
return this.alphabet[index];
|
|
|
},
|
|
|
+// 导出失败信息
|
|
|
+ handleExportFailList(failList) {
|
|
|
+ if (!failList || failList.length === 0) {
|
|
|
+ this.msgWarning("没有失败信息可导出");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ this.exportFailLoading = true;
|
|
|
+ this.$confirm('是否确认导出失败信息?', "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "info"
|
|
|
+ }).then(() => {
|
|
|
+ // 调用导出失败信息的API
|
|
|
+ exportFail(failList).then(response => {
|
|
|
+ this.download(response.msg);
|
|
|
+ this.msgSuccess("失败信息导出成功");
|
|
|
+ this.exportFailLoading = false;
|
|
|
+ }).catch(() => {
|
|
|
+ this.msgError("失败信息导出失败");
|
|
|
+ this.exportFailLoading = false;
|
|
|
+ });
|
|
|
+ }).catch(() => {
|
|
|
+ this.exportFailLoading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
|
|
|
// 分类树
|
|
|
getCategoryTree() {
|
|
|
@@ -661,7 +707,8 @@ export default {
|
|
|
this.upload.isUploading = false;
|
|
|
this.$refs.upload.clearFiles();
|
|
|
this.importMsgOpen=true;
|
|
|
- this.importMsg = response.msg
|
|
|
+ this.importMsg = response.data.message
|
|
|
+ this.failList = response.data.failList
|
|
|
this.getList();
|
|
|
},
|
|
|
}
|