Commit c301691d authored by zhengke's avatar zhengke

修改

parent 5fbd3981
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
props: { props: {
questionBankObj: { questionBankObj: {
type: Object, type: Object,
default:null
} }
}, },
components: { components: {
...@@ -42,7 +43,6 @@ ...@@ -42,7 +43,6 @@
computed: {}, computed: {},
created() {}, created() {},
mounted() { mounted() {
}, },
methods: { methods: {
initQuestionBank() { initQuestionBank() {
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +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="isShowQuestionBankForm=true" <q-btn color="accent" size="sm" class="q-mr-md" icon="add" @click="EditQuestion(null)"
label="创建新题库" /> label="创建新题库" />
</div> </div>
</template> </template>
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
</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" 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="删除" />
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
</q-td> </q-td>
</template> </template>
</q-table> </q-table>
<questionbank-form v-if="isShowQuestionBankForm" @close="closeQuestionBank" @success="refreshQuestion"> <questionbank-form v-if="isShowQuestionBankForm" :questionBankObj="questionBankObj" @close="closeQuestionBank" @success="refreshQuestion">
</questionbank-form> </questionbank-form>
</div> </div>
</div> </div>
...@@ -93,6 +93,7 @@ ...@@ -93,6 +93,7 @@
}, },
loading: false, loading: false,
isShowQuestionBankForm: false, isShowQuestionBankForm: false,
questionBankObj:null, //传入参数
columns: [{ columns: [{
name: 'BankId', name: 'BankId',
label: '序号', label: '序号',
...@@ -157,6 +158,15 @@ ...@@ -157,6 +158,15 @@
refreshQuestion() { refreshQuestion() {
this.getQuestionBankPage(); this.getQuestionBankPage();
}, },
//编辑题库
EditQuestion(obj){
if(obj){
this.questionBankObj = obj
}else{
this.questionBankObj = null
}
this.isShowQuestionBankForm=true
},
//删除问题 //删除问题
deleteQuestionBank(item) { deleteQuestionBank(item) {
let delMsg = { let delMsg = {
...@@ -186,7 +196,6 @@ ...@@ -186,7 +196,6 @@
}).onCancel(() => { }).onCancel(() => {
}); });
}, },
//跳转至questionlist //跳转至questionlist
goQuestionList(item) { goQuestionList(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