160 lines
5.4 KiB
Vue
160 lines
5.4 KiB
Vue
<template>
|
|
<div style="width: 100%;height: 100%;">
|
|
<QueryListPage
|
|
ref="classQueryListPage"
|
|
:query-form="classQueryForm"
|
|
:pager-config="pagerConfig"
|
|
:query-list="classQueryList"
|
|
style="width:96%;margin: 0 auto;"
|
|
/>
|
|
<create-class ref="createClass" @refresh="classRefresh" />
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import { getClassListPage, deleteDeptInfo } from '@/api/company';
|
|
import CreateClass from './createClass';
|
|
export default {
|
|
name: 'ClassManage',
|
|
components: {
|
|
CreateClass
|
|
},
|
|
data() {
|
|
return {
|
|
pagerConfig: {
|
|
pageSize: 'pageSize',
|
|
pageIndex: 'pageNum'
|
|
},
|
|
classQueryForm: {
|
|
leftSpan: 14,
|
|
columnNum: 3,
|
|
labelWidth: '90px',
|
|
textAlign: 'right',
|
|
reset: true,
|
|
queryObject: {
|
|
name: {
|
|
type: 'text',
|
|
label: '班级名称:'
|
|
},
|
|
creatorName: {
|
|
type: 'text',
|
|
label: '创建人:'
|
|
}
|
|
}
|
|
},
|
|
classQueryList: {
|
|
query: getClassListPage,
|
|
selectCheckShow: false,
|
|
indexShow: true,
|
|
columns: [
|
|
{
|
|
title: '班级名称:',
|
|
prop: 'name',
|
|
width: '200'
|
|
},
|
|
{
|
|
title: '人数',
|
|
prop: 'numberOfPeople'
|
|
},
|
|
{
|
|
title: '创建日期',
|
|
prop: 'createTime'
|
|
},
|
|
{
|
|
title: '创建人',
|
|
prop: 'creatorName'
|
|
},
|
|
{
|
|
type: 'button',
|
|
title: this.$t('global.operate'),
|
|
width: '450',
|
|
buttons: [
|
|
{
|
|
name: '编辑班级',
|
|
handleClick: this.handleUpdateClass,
|
|
type: 'primary',
|
|
showControl: (row) => {
|
|
return row.creatorId == this.userId;
|
|
}
|
|
},
|
|
{
|
|
name: '学生管理',
|
|
handleClick: this.handleStudentDetail,
|
|
type: 'primary'
|
|
},
|
|
{
|
|
name: '评价查询',
|
|
handleClick: this.handleGradeCheck,
|
|
type: 'primary'
|
|
},
|
|
{
|
|
name: '时长查看',
|
|
handleClick: this.handleDurationView,
|
|
type: 'primary'
|
|
},
|
|
{
|
|
name: '删除',
|
|
handleClick: this.handleDeleteClass,
|
|
type: 'danger',
|
|
showControl: (row) => {
|
|
return row.creatorId == this.userId;
|
|
}
|
|
}
|
|
]
|
|
}
|
|
],
|
|
actions: [
|
|
{ text: '新建班级', handler: this.classCreate }
|
|
]
|
|
}
|
|
};
|
|
},
|
|
computed: {
|
|
userId() {
|
|
return this.$store.state.user.id;
|
|
}
|
|
},
|
|
methods: {
|
|
handleUpdateClass(index, row) {
|
|
this.$refs.createClass.doShow(row);
|
|
},
|
|
handleGradeCheck(index, row) {
|
|
this.$router.push({ path: '/info/totalGrade', query: { orgId: row.id } });
|
|
},
|
|
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(() => { });
|
|
},
|
|
handleStudentDetail( index, row ) {
|
|
this.$router.push({ path: '/info/studentManage', query: { classId: row.id, className: row.name, creatorId: row.creatorId} });
|
|
},
|
|
handleDurationView(index, row) {
|
|
this.$router.push({ path: '/info/durationView', query: { classId: row.id, className: row.name } });
|
|
},
|
|
classCreate() {
|
|
this.$refs.createClass.doShow();
|
|
}
|
|
}
|
|
};
|
|
</script>
|
|
|
|
<style scoped>
|
|
|
|
</style>
|