Commit a8e60d28 authored by 黄奎's avatar 黄奎

页面修改

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