rt-sim-training-client/src/views/organization/classManage/index.vue

148 lines
4.8 KiB
Vue
Raw Normal View History

2021-03-18 09:03:15 +08:00
<template>
<div style="width: 100%;height: 100%;">
<QueryListPage
ref="classQueryListPage"
:query-form="classQueryForm"
:pager-config="pagerConfig"
:query-list="classQueryList"
style="width:90%;margin: 0 auto;"
/>
<create-class ref="createClass" @refresh="classRefresh" />
<bind-lessons ref="bindLessons" />
</div>
</template>
<script>
import { getClassListPageSelf, deleteDeptInfo } from '@/api/company';
import CreateClass from './createClass';
import BindLessons from './bindLessons';
export default {
name: 'ClassManage',
components: {
CreateClass,
BindLessons
},
data() {
return {
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
classQueryForm: {
leftSpan: 14,
columnNum: 3,
labelWidth: '90px',
textAlign: 'right',
reset: true,
queryObject: {
name: {
type: 'text',
label: '班级名称:'
}
}
},
classQueryList: {
query: getClassListPageSelf,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: '班级名称:',
prop: 'name',
width: '200'
},
{
title: '人数',
prop: 'numberOfPeople'
},
{
title: '创建日期',
prop: 'createTime'
},
{
type: 'button',
title: this.$t('global.operate'),
width: '450',
buttons: [
{
name: '编辑班级',
handleClick: this.handleUpdateClass,
type: 'primary'
},
{
name: '学生管理',
handleClick: this.handleStudentDetail,
type: 'primary'
},
{
name: '评价查询',
handleClick: this.handleGradeCheck,
type: 'primary'
},
{
name: '排课',
handleClick: this.handleBindLesson,
type: 'primary'
},
{
name: '删除',
handleClick: this.handleDeleteClass,
type: 'danger'
}
]
}
],
actions: [
{ text: '新建班级', handler: this.classCreate },
{ text: '返回', handler: this.goBack }
]
}
};
},
methods: {
handleUpdateClass(index, row) {
this.$refs.createClass.doShow(row);
},
2021-03-19 15:49:05 +08:00
handleGradeCheck(index, row) {
this.$router.push({ path: '/info/totalGrade', query: { orgId: row.id } });
2021-03-18 09:03:15 +08:00
},
classRefresh() {
this.$nextTick(() => {
this.$refs.classQueryListPage.refresh(true);
});
},
handleDeleteClass(index, row) {
this.$confirm('此操作将班级,且无法恢复,是否继续?', this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
deleteDeptInfo(row.id).then(response => {
this.$message.success('删除班级成功!');
this.classRefresh();
}).catch(() => {
this.$messageBox('删除班级失败!');
this.classRefresh();
});
}).catch(() => { });
},
goBack() {
this.$router.go(-1);
},
handleStudentDetail( index, row ) {
this.$router.push({ path: '/info/studentManage', query: { classId: row.id, className: row.name} });
},
handleBindLesson(index, row) {
this.$refs.bindLessons.doShow(row);
},
classCreate() {
this.$refs.createClass.doShow();
}
}
};
</script>
<style scoped>
</style>