Commit bd006a7f authored by 黄奎's avatar 黄奎

题库下载

parent 27568a76
...@@ -149,11 +149,11 @@ export function queryQuestionCategory() { ...@@ -149,11 +149,11 @@ export function queryQuestionCategory() {
* 获取问题考级程度 * 获取问题考级程度
*/ */
export function queryQuestionLevelType() { export function queryQuestionLevelType() {
return request({ return request({
url: '/Question/GetQuestionLevelType', url: '/Question/GetQuestionLevelType',
method: 'post', method: 'post',
}) })
} }
/** /**
* 题目上移下移 * 题目上移下移
...@@ -246,12 +246,12 @@ export function RemoveQuestionBank(data) { ...@@ -246,12 +246,12 @@ export function RemoveQuestionBank(data) {
* @param {*} data * @param {*} data
*/ */
export function saveBatchQuestionLevel(data) { export function saveBatchQuestionLevel(data) {
return request({ return request({
url: '/Question/SetBatchQuestionLevel', url: '/Question/SetBatchQuestionLevel',
method: 'post', method: 'post',
data data
}) })
} }
/** /**
* 根据题库编号获取题库题型列表(单选题、多选题、等)【试卷组卷使用】 * 根据题库编号获取题库题型列表(单选题、多选题、等)【试卷组卷使用】
...@@ -276,7 +276,7 @@ export function queryQuestionCategoryStaticList(data) { ...@@ -276,7 +276,7 @@ export function queryQuestionCategoryStaticList(data) {
data data
}) })
} }
/** /**
* 获取试卷组卷模板 * 获取试卷组卷模板
...@@ -314,4 +314,14 @@ export function DeletePaperDetails(data) { ...@@ -314,4 +314,14 @@ export function DeletePaperDetails(data) {
data data
}) })
} }
/**
* 题库下载
* @param {*} data
*/
export function DownLoadBank(data) {
return request({
url: '/Question/DownLoadBank',
method: 'post',
data
})
}
<style> <style>
.page-content p { .page-content p {
margin: 0 !important; margin: 0 !important;
} }
.quetion_Title { .quetion_Title {
background: transparent !important; background: transparent !important;
text-overflow: ellipsis; text-overflow: ellipsis;
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
width: 400px; width: 400px;
} }
</style> </style>
<template> <template>
<div class="page-body"> <div class="page-body">
...@@ -34,17 +34,17 @@ ...@@ -34,17 +34,17 @@
</template> </template>
<template v-slot:body-cell-BankId="props"> <template v-slot:body-cell-BankId="props">
<q-td :props="props" style="width:150px;"> <q-td :props="props" style="width:150px;">
{{props.row.BankId}} {{ props.row.BankId }}
</q-td> </q-td>
</template> </template>
<template v-slot:body-cell-BankName="props"> <template v-slot:body-cell-BankName="props">
<q-td :props="props" style="width:400px;"> <q-td :props="props" style="width:400px;">
{{props.row.BankName}} {{ props.row.BankName }}
</q-td> </q-td>
</template> </template>
<template v-slot:body-cell-QuestionCount="props"> <template v-slot:body-cell-QuestionCount="props">
<q-td :props="props" style="width:200px;"> <q-td :props="props" style="width:200px;">
{{props.row.QuestionCount}} {{ props.row.QuestionCount }}
</q-td> </q-td>
</template> </template>
...@@ -54,6 +54,8 @@ ...@@ -54,6 +54,8 @@
</template> </template>
<template v-slot:body-cell-optioned="props"> <template v-slot:body-cell-optioned="props">
<q-td :props="props" style="width:200px;"> <q-td :props="props" style="width:200px;">
<q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400" @click="downloads(props.row)"
label="下载" />
<q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400" @click="EditQuestion(props.row)" <q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400" @click="EditQuestion(props.row)"
label="编辑" /> label="编辑" />
<q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400" @click="goQuestionList(props.row)" <q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400" @click="goQuestionList(props.row)"
...@@ -71,155 +73,166 @@ ...@@ -71,155 +73,166 @@
</div> </div>
</template> </template>
<script> <script>
import { import {
queryQuestionBankPage, queryQuestionBankPage,
RemoveQuestionBank RemoveQuestionBank,
} from '../../api/question/question'; DownLoadBank
import questionbankForm from '../../components/question/questionbank-form'; } from '../../api/question/question';
export default { import questionbankForm from '../../components/question/questionbank-form';
meta: { export default {
title: "题库管理" meta: {
title: "题库管理"
},
components: {
questionbankForm
},
data() {
return {
pageCount: 0,
msg: {
pageIndex: 1,
pageSize: 12,
rowsPerPage: 12,
BankName: ''
},
loading: false,
isShowQuestionBankForm: false,
questionBankObj: null, //传入参数
columns: [{
name: 'RowNum',
label: '编号',
field: 'RowNum',
align: 'left'
},
{
name: 'BankNo',
label: '题库序号',
field: 'BankNo',
align: 'left',
},
{
name: 'BankName',
label: '题库名称',
field: 'BankName',
align: 'left',
},
{
name: 'BankTypeName',
label: '等级',
field: 'BankTypeName',
align: 'left',
},
{
name: 'CreateByName',
label: '创建人',
field: 'CreateByName',
align: 'left'
},
{
name: 'QuestionCount',
label: '题量',
field: 'QuestionCount',
align: 'left'
},
{
name: 'optioned',
label: '操作',
field: 'QuestionId'
}
],
data: [],
}
},
created() { },
mounted() {
this.getQuestionBankPage();
},
methods: {
//下载
downloads(item) {
let msg = {
BankId: item.BankId,
}
DownLoadBank(msg).then(res => {
if (res.Code == 1) {
}
})
}, },
components: { research() {
questionbankForm this.getQuestionBankPage();
}, },
data() { //翻页
return { changePage(val) {
pageCount: 0, this.msg.pageIndex = val;
msg: { this.getQuestionBankPage()
pageIndex: 1,
pageSize: 12,
rowsPerPage: 12,
BankName: ''
},
loading: false,
isShowQuestionBankForm: false,
questionBankObj: null, //传入参数
columns: [{
name: 'RowNum',
label: '编号',
field: 'RowNum',
align: 'left'
},
{
name: 'BankNo',
label: '题库序号',
field: 'BankNo',
align: 'left',
},
{
name: 'BankName',
label: '题库名称',
field: 'BankName',
align: 'left',
},
{
name: 'BankTypeName',
label: '等级',
field: 'BankTypeName',
align: 'left',
},
{
name: 'CreateByName',
label: '创建人',
field: 'CreateByName',
align: 'left'
},
{
name: 'QuestionCount',
label: '题量',
field: 'QuestionCount',
align: 'left'
},
{
name: 'optioned',
label: '操作',
field: 'QuestionId'
}
],
data: [],
}
}, },
created() {}, //关闭弹窗
mounted() { closeQuestionBank() {
this.isShowQuestionBankForm = false;
},
//获取题库分页列表
getQuestionBankPage() {
this.loading = true;
queryQuestionBankPage(this.msg).then(res => {
this.loading = false;
if (res.Code == 1) {
this.data = res.Data.PageData;
this.pageCount = res.Data.PageCount;
}
})
},
//刷新列表
refreshQuestion() {
this.getQuestionBankPage(); this.getQuestionBankPage();
}, },
methods: { //编辑题库
research() { EditQuestion(obj) {
this.getQuestionBankPage(); if (obj) {
}, this.questionBankObj = obj
//翻页 } else {
changePage(val) { this.questionBankObj = null
this.msg.pageIndex = val; }
this.getQuestionBankPage() this.isShowQuestionBankForm = true
}, },
//关闭弹窗 //删除问题
closeQuestionBank() { deleteQuestionBank(item) {
this.isShowQuestionBankForm = false; let delMsg = {
}, bankId: item.BankId,
//获取题库分页列表 status: 1
getQuestionBankPage() { };
this.loading = true; this.$q.dialog({
queryQuestionBankPage(this.msg).then(res => { title: '提示信息',
this.loading = false; message: '是否确定删除该题库?',
cancel: true,
persistent: true,
ok: "确定",
cancel: "取消",
}).onOk(() => {
RemoveQuestionBank(delMsg).then(res => {
if (res.Code == 1) { if (res.Code == 1) {
this.data = res.Data.PageData; this.$q.notify({
this.pageCount = res.Data.PageCount; icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '删除成功!',
position: 'top'
})
this.getQuestionBankPage();
} }
}) })
}, }).onCancel(() => {
//刷新列表
refreshQuestion() {
this.getQuestionBankPage();
},
//编辑题库
EditQuestion(obj) {
if (obj) {
this.questionBankObj = obj
} else {
this.questionBankObj = null
}
this.isShowQuestionBankForm = true
},
//删除问题
deleteQuestionBank(item) {
let delMsg = {
bankId: item.BankId,
status: 1
};
this.$q.dialog({
title: '提示信息',
message: '是否确定删除该题库?',
cancel: true,
persistent: true,
ok: "确定",
cancel: "取消",
}).onOk(() => {
RemoveQuestionBank(delMsg).then(res => {
if (res.Code == 1) {
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '删除成功!',
position: 'top'
})
this.getQuestionBankPage();
}
})
}).onCancel(() => {
}); });
}, },
//跳转至questionlist //跳转至questionlist
goQuestionList(item) { goQuestionList(item) {
var tempStr = '../course/question?BankId=' + item.BankId; var tempStr = '../course/question?BankId=' + item.BankId;
this.$router.push({ this.$router.push({
path: tempStr path: tempStr
}); });
}
} }
} }
}
</script> </script>
<style lang="sass"> <style lang="sass">
@import url('~assets/css/table.sass') @import url('~assets/css/table.sass')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment