Commit b183f1f3 authored by 黄奎's avatar 黄奎

页面修改

parent 01db8f6f
...@@ -253,4 +253,17 @@ export function queryQuestionCategoryList(data) { ...@@ -253,4 +253,17 @@ export function queryQuestionCategoryList(data) {
data data
}) })
} }
/**
* 获取试卷组卷模板
* @param {*} data
*/
export function queryExaminationTemplatePage(data) {
return request({
url: '/Exam/GetExaminationTemplatePage',
method: 'post',
data
})
}
\ No newline at end of file
<template>
<q-dialog v-model="persistent" content-class="bg-grey-1" persistent transition-show="scale" transition-hide="scale">
<q-card style="width: 850px;max-width:900px;">
<q-card-section>
<div class="text-h6">模板信息</div>
</q-card-section>
<q-card-section class="q-pt-none scroll" style="max-height: 70vh">
<div class="page-search row items-center">
<div class="col row wrap q-mr-lg q-col-gutter-md">
<div class="col-12">
<q-input @input="research" clearable standout="bg-primary text-white" v-model="msg.TemplateName" label="关键字"
@clear="research" maxlength="20" />
</div>
</div>
</div>
<div class="page-content">
<q-table :pagination="msg" :loading="loading" no-data-label="暂无相关数据" flat
class="sticky-column-table sticky-header-column-table" style="max-height: 550px" separator="none" :data="dataList" :columns="columns"
row-key="TemplateId" selection="single" :selected.sync="selectedQuestionBank">
<template v-slot:top="props">
<div class="col-2 q-table__title">模板列表</div>
<q-space />
</template>
<template v-slot:body-cell-Title="props">
<td style="width:400px;">
<div @click="goDetail(props.row)" v-html="props.row.Title" class="quetion_Title">
</div>
</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>
</q-table>
</div>
</q-card-section>
<q-separator />
<q-card-actions align="right" class="bg-white">
<q-btn label="取消" flat color="grey-10" style="font-weight:400 !important" @click="closeSaveForm" />
<q-btn label="确认选择" color="accent q-px-md" style="font-weight:400 !important" @click="sureQuestionBank" />
</q-card-actions>
</q-card>
</q-dialog>
</template>
<script>
import {
queryExaminationTemplatePage,
} from '../../api/question/question';
export default {
data() {
return {
persistent: true,
msg: {
pageIndex: 1,
pageSize: 12,
rowsPerPage: 12,
TemplateName: ''
},
pageCount: 0, //总页数
loading: false, //表格加载进度条
columns: [{
name: 'TemplateId',
label: '编号',
field: 'TemplateId',
align: 'left'
},
{
name: 'TemplateName',
label: '模板名称',
field: 'TemplateName',
align: 'left',
},
{
name: 'TemplateScore',
label: '总分',
field: 'TemplateScore',
align: 'left',
},
{
name: 'TemplateDifficultyTypeName',
label: '难度',
field: 'TemplateDifficultyTypeName',
align: 'left'
},
{
name: 'QuestionStructure',
label: '题型结构',
field: 'QuestionStructure',
align: 'left'
},
],
dataList: [], //数据列表
selectedQuestionBank: [], //选择的题库
}
},
mounted() {
this.getExaminationTemplatePage();
},
methods: {
//获取题库分页列表
getExaminationTemplatePage() {
queryExaminationTemplatePage(this.msg).then(res => {
if (res.Code == 1) {
this.dataList = res.Data.PageData;
this.pageCount = res.Data.PageCount;
}
})
},
//翻页
changePage(val) {
this.msg.pageIndex = val;
this.getExaminationTemplatePage()
},
research() {
this.msg.pageIndex = 1;
this.getExaminationTemplatePage();
},
//关闭弹窗
closeSaveForm() {
this.$emit('close')
this.persistent = false
},
//确认选择
sureQuestionBank() {
this.persistent = false;
var tempArray = [];
if (this.selectedQuestionBank && this.selectedQuestionBank.length > 0) {
this.selectedQuestionBank.forEach(item => {
tempArray.push(item)
})
}
this.$emit('success', tempArray);
},
},
}
</script>
<style lang="sass">
@import url('~assets/css/table.sass')
</style>
This diff is collapsed.
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