Commit 5f4edd54 authored by 黄奎's avatar 黄奎

新增页面

parent 9e41c0c5
import request from '../../utils/request'
/**
* 获取课程分页列表
* @param {JSON参数} data
*/
export function queryClassPage(data) {
return request({
url: '/Class/GetClassPageList',
method: 'post',
data
})
}
/**
* 获取课程状态列表
* @param {JSON参数} data
*/
export function queryClassStatusList() {
return request({
url: '/Class/GetClassStatusList',
method: 'post',
data:""
})
}
\ No newline at end of file
......@@ -3,26 +3,22 @@
<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="getList" clearable standout="bg-primary text-white" v-model="msg.className"
label="班级名称" />
<q-input @change="getList" clearable standout="bg-primary text-white" v-model="msg.ClassName" label="班级名称" />
</div>
<div class="col-3">
<q-select @input="getList" standout="bg-primary text-white" option-value="Id"
option-label="Name" v-model="msg.classStatus" :options="classStatusList"
emit-value map-options label="课程状态" />
<q-select @input="getList" standout="bg-primary text-white" option-value="Id" option-label="Name"
v-model="msg.classStatus" :options="classStatusList" emit-value map-options label="课程状态" />
</div>
<div class="col-3">
<q-input @change="getList" clearable standout="bg-primary text-white" v-model="msg.teacher"
<q-input @change="getList" clearable standout="bg-primary text-white" v-model="msg.TeacherName"
label="带班老师" />
</div>
<div class="col-3">
<q-input @change="getList" clearable standout="bg-primary text-white" v-model="msg.LearningCourses"
label="学习课程" />
<q-input @change="getList" clearable standout="bg-primary text-white" v-model="msg.CourseName" label="学习课程" />
</div>
<div class="col-3">
<q-select @input="getList" standout="bg-primary text-white" option-value="Id"
option-label="Name" v-model="msg.guanlianxiaoqu" :options="schoolList"
emit-value map-options label="关联校区" />
<q-select @input="getList" standout="bg-primary text-white" option-value="Id" option-label="Name"
v-model="msg.guanlianxiaoqu" :options="schoolList" emit-value map-options label="关联校区" />
</div>
</div>
<div class="page-option">
......@@ -32,47 +28,29 @@
<div class="page-content">
<q-table :pagination="msg" :loading="loading" no-data-label="暂无相关数据" flat class="sticky-tow-column-table"
separator="none" title="班级信息" :data="data" :columns="columns" row-key="name">
<!-- <template v-slot:body-cell-CoverImg="props">
<q-td :props="props">
<q-avatar square size="100px">
<img :src="props.value" />
</q-avatar>
</q-td>
</template>
<template v-slot:body-cell-CourseIntro="props">
<q-td :props="props">
<span v-html="props.value"></span>
</q-td>
</template>
<template v-slot:body-cell-Status="props">
<q-td :props="props">
<q-badge :color="props.value==1?'negative':'primary'" :label="props.value==0?'正常':'禁用'" />
<template v-slot:body-cell-ClassPersion="props">
<q-td auto-width :props="props">
预招 {{props.row.ClassPersion}} 当前 {{props.row.OrderStudentCount}}
</q-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> -->
<template v-slot:body-cell-optioned="props">
<q-td :props="props">
<q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400" label="订单中心"></q-btn>
<q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400" label="收支明细"></q-btn>
<q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400" label="编辑"
@click="EditCourse()" />
<q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400" label="编辑" @click="EditCourse()" />
</q-td>
</template>
</q-table>
<class-form v-if="isShowClassForm" :save-obj="classObjOption" @close="closeClassSaveForm"
@success="refreshPage">
<class-form v-if="isShowClassForm" :save-obj="classObjOption" @close="closeClassSaveForm" @success="refreshPage">
</class-form>
</div>
</div>
</template>
<script>
// import {
// queryCoursePage,
// queryCourseCategoryTree,
// } from '../../api/course/index'
import {
queryClassPage,
queryClassStatusList,
} from '../../api/course/class'
import classForm from '../../components/course/class-form'
export default {
meta: {
......@@ -84,52 +62,52 @@
data() {
return {
columns: [{
name: 'CourseId',
name: 'ClassName',
label: '班级名称',
field: 'CourseId',
field: 'ClassName',
align: 'left'
},
{
name: 'CourseName',
required: true,
name: 'SchoolName',
label: '校区',
field: 'SchoolName',
align: 'left',
},
{
name: 'CateName',
name: 'CourseName',
label: '课程',
field: 'CateName',
field: 'CourseName',
align: 'left'
},
{
name: 'CoverImg',
name: 'TeacherName',
label: '带班老师',
field: 'CoverImg',
field: 'TeacherName',
align: 'left'
},
{
name: 'CourseIntro',
name: 'ClassPersion',
label: '招生/报名',
field: 'CourseIntro',
field: 'ClassPersion',
align: 'left'
},
{
name: 'CreateByName',
name: 'OpenTime',
label: '开班时间',
field: 'CreateByName',
field: 'OpenTime',
align: 'left'
},
{
name: 'CreateTimeStr',
name: 'CompleteProgress',
label: '课程进度',
field: 'CreateTimeStr',
field: 'CompleteProgress',
align: 'left'
},
{
name: 'Status',
name: 'ClassStatusStr',
label: '状态',
align: 'left',
field: 'Status'
field: 'ClassStatusStr'
},
{
name: 'optioned',
......@@ -139,34 +117,44 @@
],
data: [],
loading: false,
isShowClassForm:false,
isShowClassForm: false,
msg: {
pageIndex: 1,
pageSize: 12,
className:'', //班级名称
classStatus:'', //班级状态
teacher:'', //带班老师
LearningCourses:'', //学习课程
guanlianxiaoqu:0, //关联校区
ClassName: '', //班级名称
classStatus: '', //班级状态
TeacherName: '', //带班老师
CourseName: '', //学习课程
guanlianxiaoqu: 0, //关联校区
},
//班级状态
classStatusList:[{
Id:1,
Name:'状态1'
classStatusList: [{
Id: 1,
Name: '状态1'
}],
//关联校区
schoolList:[{
Id:1,
Name:'清华大学'
schoolList: [{
Id: 1,
Name: '清华大学'
}],
pageCount: 0,
classObjOption:null,
classObjOption: null,
}
},
created() {
this.getClassStatus();
},
mounted() {
this.getList();
},
methods: {
getClassStatus() {
queryClassStatusList({}).then(res => {
this.classStatusList = res.Data;
}).catch(() => {
})
},
//翻页
changePage(val) {
this.msg.pageIndex = val;
......@@ -174,14 +162,14 @@
},
//获取菜单分页列表
getList() {
// this.loading = true;
// queryCoursePage(this.msg).then(res => {
// this.loading = false
// this.data = res.Data.PageData
// this.pageCount = res.Data.PageCount
// }).catch(() => {
// this.loading = false
// })
this.loading = true;
queryClassPage(this.msg).then(res => {
this.loading = false
this.data = res.Data.PageData
this.pageCount = res.Data.PageCount
}).catch(() => {
this.loading = false
})
},
//刷新页面
refreshPage() {
......@@ -195,7 +183,7 @@
// } else {
// this.classObjOption = null
// }
this.isShowClassForm = true
this.isShowClassForm = true
},
//关闭弹窗
closeClassSaveForm() {
......
......@@ -20,12 +20,12 @@
</div>
</div>
<div class="page-option">
<q-btn color="accent" class="q-mr-md" icon="add" label="新增班级" @click="EditClass(null)" />
<q-btn color="accent" class="q-mr-md" icon="add" label="新增教室" @click="EditClass(null)" />
</div>
</div>
<div class="page-content">
<q-table :pagination="msg" :loading="loading" no-data-label="暂无相关数据" flat
class="sticky-right-column-table sticky-tow-column-table" separator="none" title="班级信息" :data="data"
class="sticky-right-column-table sticky-tow-column-table" separator="none" title="教室信息" :data="data"
:columns="columns" row-key="name">
<template v-slot:body-cell-TeacherHead="props">
<q-td auto-width :props="props">
......@@ -83,7 +83,7 @@
import classForm from '../../components/school/classmanage/class-form'
export default {
meta: {
title: "班级管理"
title: "教室管理"
},
components: {
classForm
......
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