理论题目添加清空操作
This commit is contained in:
parent
2754e14bff
commit
b06248a366
@ -83,3 +83,11 @@ export function testAnswer(questionId, data) {
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
// 清空题库
|
||||
export function clearBank() {
|
||||
return request({
|
||||
url: `/api/question/org/clear`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<script>
|
||||
// import { UrlConfig } from '@/scripts/ConstDic';
|
||||
import { listQuestionPage, deleteQuestion, getLabelList, listQuestionAll } from '@/api/questionBank.js';
|
||||
import { listQuestionPage, deleteQuestion, getLabelList, listQuestionAll, clearBank } from '@/api/questionBank.js';
|
||||
import DialogDetail from './dialog-detail';
|
||||
import PreviewAnswer from './previewAnswer';
|
||||
import { convertSheetToList } from '@/jmapNew/theme/parser/util.js';
|
||||
@ -33,7 +33,7 @@ export default {
|
||||
queryForm: {
|
||||
reset: true,
|
||||
labelWidth: '80px',
|
||||
leftSpan: 17,
|
||||
leftSpan: 16,
|
||||
beforeQuery: this.beforeQuery,
|
||||
queryObject: {
|
||||
type: {
|
||||
@ -136,7 +136,8 @@ export default {
|
||||
{ text: '导 入', fileType: 'file', handler: this.importQuestionBank },
|
||||
// { text: '试卷规则管理', handler: this.questionsRuleManage},
|
||||
// { text: '导出', handler: this.exportTemplate},
|
||||
{ text: '导出模板', handler: this.downloadTemplate}
|
||||
{ text: '导出模板', handler: this.downloadTemplate},
|
||||
{ text: '清空题库', type:'danger', handler: this.clearBank}
|
||||
]
|
||||
}
|
||||
};
|
||||
@ -418,6 +419,19 @@ export default {
|
||||
// this.$router.push({ path: `/system/questionsRuleManage`});
|
||||
this.$router.push({ path: `/teaching/questionsRuleManage`});
|
||||
},
|
||||
clearBank() {
|
||||
this.$confirm('慎重!本操作可清空所有题库数据,是否继续?', '提 示', {
|
||||
confirmButtonText: '确 定',
|
||||
cancelButtonText: '取 消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
clearBank().then(resp => {
|
||||
this.reloadTable();
|
||||
}).catch(error => {
|
||||
this.$message.error(`清空题库数据失败: ${error.message}`);
|
||||
});
|
||||
}).catch( () => { });
|
||||
},
|
||||
downloadTemplate() {
|
||||
// 创建隐藏的可下载链接
|
||||
var eleLink = document.createElement('a');
|
||||
|
Loading…
Reference in New Issue
Block a user