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

页面修改

parent 1e48591f
......@@ -5,8 +5,11 @@
<div class="text-h6">{{(questionBankObj&&questionBankObj.BankId>0)?"修改题库":"创建题库"}}</div>
</q-card-section>
<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="请输入题库名称"
maxlength="20" :rules="[val => !!val || '请输入题库名称']" />
<q-input filled stack-label :dense="false" class="col-6 q-pb-lg" ref="BankNo" v-model="msg.BankNo"
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-actions align="right" class="bg-white">
<q-btn label="取消" flat color="grey-10" style="font-weight:400 !important" @click="closeQuestionForm" />
......@@ -25,7 +28,7 @@
props: {
questionBankObj: {
type: Object,
default:null
default: null
}
},
components: {
......@@ -35,6 +38,7 @@
return {
msg: {
BankId: 0,
BankNo: "", //题库序号
BankName: '', //题库名称
},
persistent: true
......@@ -43,7 +47,7 @@
computed: {},
created() {},
mounted() {
this.initQuestionBank();
this.initQuestionBank();
},
methods: {
initQuestionBank() {
......@@ -53,20 +57,22 @@
}).then(res => {
if (res.Code == 1) {
this.msg.BankId = res.Data.BankId;
this.msg.BankNo = res.Data.BankNo;
this.msg.BankName = res.Data.BankName;
}
})
} else {
this.msg.BankId = 0;
this.msg.BankNo = "";
this.msg.BankName = "";
}
},
//创建
saveQuestion() {
this.$refs.BankName.validate()
if(!this.$refs.BankName.hasError){
if (!this.$refs.BankName.hasError) {
SetQuestionBank(this.msg).then(res => {
if (res.Code==1) {
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>
......@@ -30,8 +30,7 @@
<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="EditQuestion(null)"
label="创建新题库" />
<q-btn color="accent" size="sm" class="q-mr-md" icon="add" @click="EditQuestion(null)" label="创建新题库" />
</div>
</template>
<template v-slot:body-cell-BankId="props">
......@@ -56,15 +55,18 @@
</template>
<template v-slot:body-cell-optioned="props">
<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)"
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-td>
</template>
</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>
</div>
</div>
......@@ -93,20 +95,25 @@
},
loading: false,
isShowQuestionBankForm: false,
questionBankObj:null, //传入参数
questionBankObj: null, //传入参数
columns: [{
name: 'BankId',
label: '号',
field: 'BankId',
name: 'RowNum',
label: '号',
field: 'RowNum',
align: 'left'
},
{
name: 'BankNo',
label: '题库序号',
field: 'BankNo',
align: 'left',
},
{
name: 'BankName',
label: '题库名称',
field: 'BankName',
align: 'left',
},
{
name: 'CreateByName',
label: '创建人',
......@@ -159,13 +166,13 @@
this.getQuestionBankPage();
},
//编辑题库
EditQuestion(obj){
if(obj){
EditQuestion(obj) {
if (obj) {
this.questionBankObj = obj
}else{
} else {
this.questionBankObj = null
}
this.isShowQuestionBankForm=true
this.isShowQuestionBankForm = true
},
//删除问题
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