Commit eb9de802 authored by 黄奎's avatar 黄奎

页面修改

parent bd006a7f
<style> <style>
.page-content p { .page-content p {
margin: 0 !important; margin: 0 !important;
} }
.quetion_Title {
background: transparent !important;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
width: 400px;
.quetion_Title { }
background: transparent !important;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
width: 400px;
}
</style> </style>
<template> <template>
<div class="page-body"> <div class="page-body">
...@@ -61,7 +62,7 @@ ...@@ -61,7 +62,7 @@
<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)"
label="管理题目" /> label="管理题目" />
<q-btn flat size="xs" icon="edit" color="negative" style="font-weight:400" <q-btn flat size="xs" icon="edit" color="negative" style="font-weight:400"
@click="deleteQuestionBank(props.row)" label="删除" /> @click="deleteQuestionBank(props.row)" label="删除">
</q-btn> </q-btn>
</q-td> </q-td>
</template> </template>
...@@ -73,167 +74,177 @@ ...@@ -73,167 +74,177 @@
</div> </div>
</template> </template>
<script> <script>
import { import {
queryQuestionBankPage, queryQuestionBankPage,
RemoveQuestionBank, RemoveQuestionBank,
DownLoadBank DownLoadBank
} from '../../api/question/question'; } from '../../api/question/question';
import questionbankForm from '../../components/question/questionbank-form'; import {
export default { EduDownLoad
meta: { } from "../../api/common/common";
title: "题库管理" import questionbankForm from '../../components/question/questionbank-form';
}, export default {
components: { meta: {
questionbankForm title: "题库管理"
},
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) {
}
})
}, },
research() { components: {
this.getQuestionBankPage(); questionbankForm
}, },
//翻页 data() {
changePage(val) { return {
this.msg.pageIndex = val; pageCount: 0,
this.getQuestionBankPage() msg: {
}, pageIndex: 1,
//关闭弹窗 pageSize: 12,
closeQuestionBank() { rowsPerPage: 12,
this.isShowQuestionBankForm = false; BankName: ''
}, },
//获取题库分页列表 loading: false,
getQuestionBankPage() { isShowQuestionBankForm: false,
this.loading = true; questionBankObj: null, //传入参数
queryQuestionBankPage(this.msg).then(res => { columns: [{
this.loading = false; name: 'RowNum',
if (res.Code == 1) { label: '编号',
this.data = res.Data.PageData; field: 'RowNum',
this.pageCount = res.Data.PageCount; 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() {},
refreshQuestion() { mounted() {
this.getQuestionBankPage(); this.getQuestionBankPage();
}, },
//编辑题库 methods: {
EditQuestion(obj) { //下载
if (obj) { downloads(item) {
this.questionBankObj = obj let msg = {
} else { BankId: item.BankId,
this.questionBankObj = null }
} var fileName = item.BankName + ".doc";
this.isShowQuestionBankForm = true this.loading=true;
}, EduDownLoad(
//删除问题 "/Question/DownLoadBank",
deleteQuestionBank(item) { msg,
let delMsg = { fileName, res => {
bankId: item.BankId, this.loading=false;
status: 1 }
}; );
this.$q.dialog({ },
title: '提示信息', research() {
message: '是否确定删除该题库?', this.getQuestionBankPage();
cancel: true, },
persistent: true, //翻页
ok: "确定", changePage(val) {
cancel: "取消", this.msg.pageIndex = val;
}).onOk(() => { this.getQuestionBankPage()
RemoveQuestionBank(delMsg).then(res => { },
//关闭弹窗
closeQuestionBank() {
this.isShowQuestionBankForm = false;
},
//获取题库分页列表
getQuestionBankPage() {
this.loading = true;
queryQuestionBankPage(this.msg).then(res => {
this.loading = false;
if (res.Code == 1) { if (res.Code == 1) {
this.$q.notify({ this.data = res.Data.PageData;
icon: 'iconfont icon-chenggong', this.pageCount = res.Data.PageCount;
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')
</style>
\ No newline at end of file </style>
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