Commit a8e60d28 authored by 黄奎's avatar 黄奎

页面修改

parent 517731d9
......@@ -5,7 +5,7 @@
<div class="text-h6">题库管理 / 创建题库</div>
</q-card-section>
<q-card-section class="q-pt-none scroll" style="max-height: 70vh">
<q-input clearable standout="bg-primary text-white" v-model="msg.Title" label="请输入题库名称" maxlength="20" />
<q-input clearable standout="bg-primary text-white" v-model="msg.BankName" label="请输入题库名称" maxlength="20" />
</q-card-section>
<q-card-actions align="right" class="bg-white">
<q-btn label="取消" flat color="grey-10" style="font-weight:400 !important" @click="closeQuestionForm" />
......@@ -16,14 +16,24 @@
</template>
<script>
import {
getQuestionBankInfo, //获取题库详情
SetQuestionBank, //保存图库
} from '../../api/question/question'
export default {
props: {
questionBankObj: {
type: Object,
}
},
components: {
},
data() {
return {
msg: {
Title: ''
BankId: 0,
BankName: '', //题库名称
},
persistent: true
}
......@@ -34,9 +44,26 @@
},
methods: {
initQuestionBank() {
if (this.questionBankObj && this.questionBankObj.BankId > 0) {
getQuestionBankInfo({
BankId: this.questionBankObj.BankId
}).then(res => {
if (res.Code == 1) {
this.msg.BankId = res.Data.BankId;
this.msg.BankName = res.Data.BankName;
}
})
} else {
this.msg.BankId = 0;
this.msg.BankName = "";
}
},
//创建
saveQuestion() {
SetQuestionBank(this.msg).then(res => {
});
},
//取消
closeQuestionForm() {
......
......@@ -18,7 +18,7 @@
<div class="page-search row items-center">
<div class="col row wrap q-mr-lg q-col-gutter-md">
<div class="col-3">
<q-input @change="research" clearable standout="bg-primary text-white" v-model="msg.Title" label="关键字"
<q-input @change="research" clearable standout="bg-primary text-white" v-model="msg.BankName" label="关键字"
@clear="research" maxlength="20" />
</div>
</div>
......@@ -30,7 +30,8 @@
<div class="col-2 q-table__title">题库列表</div>
<q-space />
<div class="page-option">
<q-btn color="accent" size="sm" class="q-mr-md" icon="add" @click="isShowQuestionBankForm=true" label="创建新题库"/>
<q-btn color="accent" size="sm" class="q-mr-md" icon="add" @click="isShowQuestionBankForm=true"
label="创建新题库" />
</div>
</template>
<template v-slot:body-cell-Title="props">
......@@ -44,18 +45,23 @@
<template v-slot:body-cell-optioned="props">
<q-td :props="props">
<q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400" label="编辑" />
<q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400" @click="goQuestionList()" label="管理题目" />
<q-btn flat size="xs" icon="edit" color="negative" style="font-weight:400" label="删除" /></q-btn>
<q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400" @click="goQuestionList()"
label="管理题目" />
<q-btn flat size="xs" icon="edit" color="negative" style="font-weight:400" label="删除" />
</q-btn>
</q-td>
</template>
</q-table>
<questionbank-form v-if="isShowQuestionBankForm" @close="closeQuestionBank"
@success="refreshQuestion">
<questionbank-form v-if="isShowQuestionBankForm" @close="closeQuestionBank" @success="refreshQuestion">
</questionbank-form>
</div>
</div>
</template>
<script>
import {
queryQuestionBankPage,
RemoveQuestionBank
} from '../../api/question/question';
import questionbankForm from '../../components/question/questionbank-form';
export default {
meta: {
......@@ -66,41 +72,38 @@
},
data() {
return {
pageCount:0,
msg:{
pageIndex:1,
Title:''
pageCount: 0,
msg: {
pageIndex: 1,
pageSize: 12,
rowsPerPage: 12,
BankName: ''
},
loading: false,
isShowQuestionBankForm:false,
isShowQuestionBankForm: false,
columns: [{
name: 'Number',
name: 'BankId',
label: '序号',
field: 'Number',
field: 'BankId',
align: 'left'
},
{
name: 'CategoryName',
name: 'BankName',
label: '题库名称',
field: 'CategoryName',
align: 'left',
},
{
name: 'classification',
label: '分类',
field: 'classification',
field: 'BankName',
align: 'left',
},
{
name: 'creater',
name: 'CreateByName',
label: '创建人',
field: 'creater',
field: 'CreateByName',
align: 'left'
},
{
name: 'topicNumber',
name: 'QuestionCount',
label: '题量',
field: 'topicNumber',
field: 'QuestionCount',
align: 'left'
},
{
......@@ -109,38 +112,49 @@
field: 'QuestionId'
}
],
data: [{
Number: '1',
CategoryName: '日语2',
classification: '',
creater: '张三丰',
topicNumber: 12,
sodium: 87,
}],
data: [],
}
},
created() {
},
created() {},
mounted() {
this.getQuestionBankPage();
},
methods: {
research(){
research() {
},
changePage(){
changePage() {
},
//关闭弹窗
closeQuestionBank(){
this.isShowQuestionBankForm=false;
closeQuestionBank() {
this.isShowQuestionBankForm = false;
},
//获取题库分页列表
getQuestionBankPage() {
queryQuestionBankPage(this.msg).then(res => {
if (res.Code == 1) {
this.data = res.Data.PageData;
this.pageCount = res.Data.PageCount;
}
})
},
//刷新列表
refreshQuestion(){
refreshQuestion() {
},
//删除问题
deleteQuestionBank(item) {
let delMsg = {
bankId: item.BankId,
status: 1
};
RemoveQuestionBank(delMsg).then(res => {
})
},
//跳转至questionlist
goQuestionList(){
goQuestionList() {
var tempStr = '../course/question';
this.$router.push({
path: tempStr
......
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