Commit 0fe9c8cd authored by 黄奎's avatar 黄奎

页面修改

parent 1e48591f
...@@ -5,8 +5,11 @@ ...@@ -5,8 +5,11 @@
<div class="text-h6">{{(questionBankObj&&questionBankObj.BankId>0)?"修改题库":"创建题库"}}</div> <div class="text-h6">{{(questionBankObj&&questionBankObj.BankId>0)?"修改题库":"创建题库"}}</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 filled stack-label :dense="false" class="col-6 q-pb-lg" ref="BankName" v-model="msg.BankName" label="请输入题库名称" <q-input filled stack-label :dense="false" class="col-6 q-pb-lg" ref="BankNo" v-model="msg.BankNo"
maxlength="20" :rules="[val => !!val || '请输入题库名称']" /> label="请输入题库序号" maxlength="20" :rules="[val => !!val || '请输入题库序号']" />
<q-input filled stack-label :dense="false" class="col-6 q-pb-lg" ref="BankName" v-model="msg.BankName"
label="请输入题库名称" maxlength="20" :rules="[val => !!val || '请输入题库名称']" />
</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" />
...@@ -25,7 +28,7 @@ ...@@ -25,7 +28,7 @@
props: { props: {
questionBankObj: { questionBankObj: {
type: Object, type: Object,
default:null default: null
} }
}, },
components: { components: {
...@@ -35,6 +38,7 @@ ...@@ -35,6 +38,7 @@
return { return {
msg: { msg: {
BankId: 0, BankId: 0,
BankNo: "", //题库序号
BankName: '', //题库名称 BankName: '', //题库名称
}, },
persistent: true persistent: true
...@@ -53,20 +57,22 @@ ...@@ -53,20 +57,22 @@
}).then(res => { }).then(res => {
if (res.Code == 1) { if (res.Code == 1) {
this.msg.BankId = res.Data.BankId; this.msg.BankId = res.Data.BankId;
this.msg.BankNo = res.Data.BankNo;
this.msg.BankName = res.Data.BankName; this.msg.BankName = res.Data.BankName;
} }
}) })
} else { } else {
this.msg.BankId = 0; this.msg.BankId = 0;
this.msg.BankNo = "";
this.msg.BankName = ""; this.msg.BankName = "";
} }
}, },
//创建 //创建
saveQuestion() { saveQuestion() {
this.$refs.BankName.validate() this.$refs.BankName.validate()
if(!this.$refs.BankName.hasError){ if (!this.$refs.BankName.hasError) {
SetQuestionBank(this.msg).then(res => { SetQuestionBank(this.msg).then(res => {
if (res.Code==1) { if (res.Code == 1) {
this.$emit('success'); this.$emit('success');
this.closeQuestionForm(); this.closeQuestionForm();
} }
......
...@@ -18,8 +18,8 @@ ...@@ -18,8 +18,8 @@
<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.BankName" <q-input @change="research" clearable standout="bg-primary text-white" v-model="msg.BankName" label="输入关键字查找"
label="输入关键字查找" @clear="research" maxlength="20" /> @clear="research" maxlength="20" />
</div> </div>
</div> </div>
</div> </div>
...@@ -30,8 +30,7 @@ ...@@ -30,8 +30,7 @@
<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="EditQuestion(null)" <q-btn color="accent" size="sm" class="q-mr-md" icon="add" @click="EditQuestion(null)" label="创建新题库" />
label="创建新题库" />
</div> </div>
</template> </template>
<template v-slot:body-cell-BankId="props"> <template v-slot:body-cell-BankId="props">
...@@ -56,15 +55,18 @@ ...@@ -56,15 +55,18 @@
</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="EditQuestion(props.row)" label="编辑" /> <q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400" @click="EditQuestion(props.row)"
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)"
label="管理题目" /> label="管理题目" />
<q-btn flat size="xs" icon="edit" color="negative" style="font-weight:400" @click="deleteQuestionBank(props.row)" label="删除" /> <q-btn flat size="xs" icon="edit" color="negative" style="font-weight:400"
@click="deleteQuestionBank(props.row)" label="删除" />
</q-btn> </q-btn>
</q-td> </q-td>
</template> </template>
</q-table> </q-table>
<questionbank-form v-if="isShowQuestionBankForm" :questionBankObj="questionBankObj" @close="closeQuestionBank" @success="refreshQuestion"> <questionbank-form v-if="isShowQuestionBankForm" :questionBankObj="questionBankObj" @close="closeQuestionBank"
@success="refreshQuestion">
</questionbank-form> </questionbank-form>
</div> </div>
</div> </div>
...@@ -93,20 +95,25 @@ ...@@ -93,20 +95,25 @@
}, },
loading: false, loading: false,
isShowQuestionBankForm: false, isShowQuestionBankForm: false,
questionBankObj:null, //传入参数 questionBankObj: null, //传入参数
columns: [{ columns: [{
name: 'BankId', name: 'RowNum',
label: '号', label: '号',
field: 'BankId', field: 'RowNum',
align: 'left' align: 'left'
}, },
{
name: 'BankNo',
label: '题库序号',
field: 'BankNo',
align: 'left',
},
{ {
name: 'BankName', name: 'BankName',
label: '题库名称', label: '题库名称',
field: 'BankName', field: 'BankName',
align: 'left', align: 'left',
}, },
{ {
name: 'CreateByName', name: 'CreateByName',
label: '创建人', label: '创建人',
...@@ -159,13 +166,13 @@ ...@@ -159,13 +166,13 @@
this.getQuestionBankPage(); this.getQuestionBankPage();
}, },
//编辑题库 //编辑题库
EditQuestion(obj){ EditQuestion(obj) {
if(obj){ if (obj) {
this.questionBankObj = obj this.questionBankObj = obj
}else{ } else {
this.questionBankObj = null this.questionBankObj = null
} }
this.isShowQuestionBankForm=true this.isShowQuestionBankForm = true
}, },
//删除问题 //删除问题
deleteQuestionBank(item) { deleteQuestionBank(item) {
......
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