Commit ed121a97 authored by 黄奎's avatar 黄奎

页面修改

parent 31e8dd5f
......@@ -439,4 +439,16 @@ export function delLessonComment(data) {
method: 'post',
data
})
}
/**
* 获取班级学员树形列表
* @param {JSON参数} data
*/
export function queryClassStudentTree(data) {
return request({
url: '/Class/GetClassStudentTree',
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">
<el-tree :data="dataList" show-checkbox node-key="GuestId" ref="classStuTree" highlight-current
:props="defaultProps">
</el-tree>
</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 {
queryClassStudentTree,
} from '../../api/course/class';
export default {
data() {
return {
persistent: true,
defaultProps: {
children: 'SubList',
label: 'Name'
},
msg: {}, //查询参数
loading: false, //表格加载进度条
dataList: [], //数据列表
}
},
mounted() {
this.getClassStudentTree();
},
methods: {
//获取题库分页列表
getClassStudentTree() {
queryClassStudentTree(this.msg).then(res => {
if (res.Code == 1) {
this.dataList = res.Data;
}
})
},
//关闭弹窗
closeSaveForm() {
this.$emit('close')
this.persistent = false
},
//确认选择
sureQuestionBank() {
this.persistent = false;
var tempArray = [];
var checkArray = this.$refs.classStuTree.getCheckedNodes();
if (checkArray && checkArray.length > 0) {
checkArray.forEach(item => {
if (item.SubList && item.SubList.length > 0) {
} else {
tempArray.push(item);
}
})
}
this.$emit('success', tempArray);
},
},
}
</script>
<style lang="sass">
@import url('~assets/css/table.sass')
</style>
......@@ -38,6 +38,7 @@
}
</style>
<!--试卷库管理-->
<template>
<div class="page-body">
<div class="page-search row items-center">
......@@ -189,7 +190,7 @@
},
//创建试卷
CreatePaper() {
this.OpenNewUrl('/exam/examCreate', {})
this.OpenNewUrl('/exam/paperCreate', {})
},
//翻页
changePage(val) {
......@@ -218,7 +219,7 @@
if (item) {
PaperId = item.PaperId
}
this.OpenNewUrl('/exam/examEdit', {
this.OpenNewUrl('/exam/paperEdit', {
Id: PaperId
})
},
......@@ -237,7 +238,7 @@
if (item) {
PaperId = item.PaperId
}
this.OpenNewUrl('/exam/examPublish', {
this.OpenNewUrl('/exam/paperPublish', {
PaperId: PaperId
})
}
......
......@@ -23,14 +23,18 @@
<template>
<div class="page-body">
发布考试
<div class="row">
<q-btn color="accent" size="sm" @click="showClassStu" class="q-mr-md" label="选择学员"  /><br />
<template v-if="postMsg.StudentList&&postMsg.StudentList.length>0">
<span v-for="(item,index) in postMsg.StudentList" :key="index" style="padding-left:5px;">{{item.GuestName}}</span>
</template>
</div>
<div class="row">
<q-input filled stack-label maxlength="30" :dense="false" v-model="postMsg.ExamStartTime"
class="col-6 q-pb-lg q-pr-lg" label="开始时间" />
<q-input filled stack-label maxlength="30" :dense="false" v-model="postMsg.ExamEndTime" class="col-6 q-pb-lg"
label="结束时间" />
</div>
<div class="row">
<q-input filled bottom-slots maxlength="10" v-model="postMsg.ExamTimes" label="考试限时" class="col-6 q-pb-lg q-pr-lg"
:dense="false">
......@@ -115,17 +119,19 @@
<div class="row">
<q-btn color="accent" size="sm" @click="setPublishExam" class="q-mr-md" label="发布考试"  />
</div>
<classstutreeForm v-if="isShowClassStu"  @close="closeClassStuForm"  @success="getClassStuList">
</classstutreeForm>
</div>
</template>
<script>
'../../api/question/question'
import classstutreeForm from '../../components/exam/classstutree-form'
import {
savePublishExam,
} from '../../api/teacher/index';
export default {
components: {
classstutreeForm
},
meta: {
title: "发布考试"
......@@ -154,7 +160,9 @@
FillInIsSubject: 0, //填空类型的题目设为主观题(1-是)
FillInIsIgnore: 0, //填空题答案不区分大小写(1-是)
IsHalfScore: 1, //多选题未选全给一半分(1-是)
StudentList: [],
},
isShowClassStu: false, //是否显示学员弹窗
}
},
created() {
......@@ -166,7 +174,28 @@
},
methods: {
//显示班级学员弹窗
showClassStu() {
this.isShowClassStu = true;
},
//关闭班级学员弹窗
closeClassStuForm() {
this.isShowClassStu = false;
},
//获取选中的需要列表
getClassStuList(array) {
if (array && array.length > 0) {
array.forEach(item => {
this.postMsg.StudentList.push({
GuestId: item.GuestId,
ClassId: item.ClassId,
OrderId: item.OrderId,
CourseId: item.CourseId,
GuestName: item.Name,
});
})
}
},
//发布考试
setPublishExam() {
savePublishExam(this.postMsg).then(res => {
......@@ -179,7 +208,7 @@
position: 'top'
})
this.$router.push({
path: '/exam/examManagement',
path: '/exam/examPaper',
query: {}
});
} else {
......
......@@ -1039,24 +1039,24 @@ const routes = [{
import("pages/teacher/myClass")
},
{
path: "/exam/examManagement", //试卷管理
path: "/exam/examPaper", //试卷管理
component: () =>
import("pages/exam/examManagement")
import("pages/exam/examPaper")
},
{
path: "/exam/examEdit", //考试编辑
path: "/exam/paperEdit", //考试编辑
component: () =>
import("pages/exam/examEdit")
import("pages/exam/paperEdit")
},
{
path: "/exam/examCreate", //考试组卷
path: "/exam/paperCreate", //考试组卷
component: () =>
import("pages/exam/examCreate")
import("pages/exam/paperCreate")
},
{
path: "/exam/examPublish", //发布考试
path: "/exam/paperPublish", //发布考试
component: () =>
import("pages/exam/examPublish")
import("pages/exam/paperPublish")
},
{
path: "/teacher/testdatabase", //题库查询
......
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