Commit 5fbd3981 authored by zhengke's avatar zhengke

修改

parent 71ea1b15
......@@ -5,7 +5,8 @@
<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.BankName" label="请输入题库名称" maxlength="20" />
<q-input filled stack-label :dense="false" class="col-6 q-pb-lg" 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" />
......@@ -62,7 +63,10 @@
//创建
saveQuestion() {
SetQuestionBank(this.msg).then(res => {
if (res.Code==1) {
this.$emit('success');
this.closeQuestionForm();
}
});
},
//取消
......
......@@ -18,8 +18,8 @@
<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.BankName" label="关键字"
@clear="research" maxlength="20" />
<q-input @change="research" clearable standout="bg-primary text-white" v-model="msg.BankName"
label="输入题库名称、创建人查找" @clear="research" maxlength="20" />
</div>
</div>
</div>
......@@ -34,20 +34,32 @@
label="创建新题库" />
</div>
</template>
<template v-slot:body-cell-Title="props">
<td style="width:400px;">
</td>
<template v-slot:body-cell-BankId="props">
<q-td :props="props" style="width:150px;">
{{props.row.BankId}}
</q-td>
</template>
<template v-slot:body-cell-BankName="props">
<q-td :props="props" style="width:400px;">
{{props.row.BankName}}
</q-td>
</template>
<template v-slot:body-cell-QuestionCount="props">
<q-td :props="props" style="width:200px;">
{{props.row.QuestionCount}}
</q-td>
</template>
<template v-slot:bottom>
<q-pagination class="full-width justify-end" v-model="msg.pageIndex" color="primary" :max="pageCount"
:input="true" @input="changePage" />
</template>
<template v-slot:body-cell-optioned="props">
<q-td :props="props">
<q-td :props="props" style="width:200px;">
<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(props.rows)"
<q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400" @click="goQuestionList(props.row)"
label="管理题目" />
<q-btn flat size="xs" icon="edit" color="negative" style="font-weight:400" label="删除" />
<q-btn flat size="xs" icon="edit" color="negative" style="font-weight:400" @click="deleteQuestionBank(props.row)" label="删除" />
</q-btn>
</q-td>
</template>
......@@ -121,10 +133,12 @@
},
methods: {
research() {
this.getQuestionBankPage();
},
changePage() {
//翻页
changePage(val) {
this.msg.pageIndex = val;
this.getQuestionBankPage()
},
//关闭弹窗
closeQuestionBank() {
......@@ -141,7 +155,7 @@
},
//刷新列表
refreshQuestion() {
this.getQuestionBankPage();
},
//删除问题
deleteQuestionBank(item) {
......@@ -149,13 +163,34 @@
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
goQuestionList(item) {
var tempStr = '../course/question?bankId='+item.BankId;
var tempStr = '../course/question?bankId=' + item.BankId;
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