|
@@ -31,29 +31,13 @@
|
|
|
</div>
|
|
|
<div class="course-classroom-info" v-if="JSON.stringify(courseInfo) !== '{}'">
|
|
|
<div class="course-classroom-info-header" style="padding-right:50px;">
|
|
|
- <span class="course-classroom-label">{{$t('courseManage.classroom.studentList')}}</span>
|
|
|
- <div v-if="courseInfo.classes" style="float:right;color:white;">
|
|
|
- <Button v-show="updated" type="primary" size="small" style="float:right;margin-left:30px;margin-top:8px;" @click="saveGroup">保存分组</Button>
|
|
|
- <Button size="small" style="float:right;margin-top:8px;" @click="customGroup">{{$t('courseManage.classroom.autoGroupBtn')}}</Button>
|
|
|
- <div style="float:right;margin-right:30px;" v-show="courseInfo.classes[curClassIndex].code == $store.state.userInfo.TEAMModelId">
|
|
|
- <Button type="info" size="small" style="">{{$t('courseManage.classroom.deleteStuBtn')}}</Button>
|
|
|
- </div>
|
|
|
- <div style="float:right;margin-right:30px;" v-show="courseInfo.classes[curClassIndex].code == $store.state.userInfo.TEAMModelId" @click="showStudentList">
|
|
|
- <Button type="info" size="small" style="">{{$t('courseManage.classroom.addStuBtn')}}</Button>
|
|
|
- </div>
|
|
|
- <div style="float:right;margin-right:40px;">
|
|
|
- <span style="margin-right:5px;">{{$t('courseManage.classroom.removeStudent1')}}</span>
|
|
|
- <Select v-model="currentGroup" style="width:80px" size="small">
|
|
|
- <Option v-for="(item,index) in groupList" :value="index" :key="index" @click.native="setGroup">{{ item.groupCode+ '('+item.groupName+')' }}</Option>
|
|
|
- </Select>
|
|
|
- <span style="margin-right:10px;margin-left:5px;">{{$t('courseManage.classroom.removeStudent2')}}</span>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ <span @click="tabName = 'stus'" :class="tabName == 'stus' ? 'course-classroom-label line-bottom line-bottom-active':'course-classroom-label'">{{$t('courseManage.classroom.studentList')}}</span>
|
|
|
+ <span @click="tabName = 'record'" :class="tabName == 'record' ? 'course-classroom-label line-bottom line-bottom-active':'course-classroom-label'">课堂记录</span>
|
|
|
</div>
|
|
|
- <div class="course-classroom-info-content dark-iview-table">
|
|
|
- <!--学生名单-->
|
|
|
+ <!--学生名单-->
|
|
|
+ <div class="course-classroom-info-content dark-iview-table animated fadeIn" v-show="tabName == 'stus'">
|
|
|
<vuescroll style="height:100%;">
|
|
|
- <Table v-if="courseInfo.classes" :columns="studentColumn" :data="courseInfo.classes[curClassIndex].students" max-height="750" class="system-classroom-table" :loading="studentTabelLoading" @on-selection-change="getSelections" no-data-text="暂无学生">
|
|
|
+ <Table v-if="courseInfo.classes" :columns="studentColumn" :data="courseInfo.classes[curClassIndex].students" max-height="800" class="system-classroom-table" :loading="studentTabelLoading" @on-selection-change="getSelections" no-data-text="暂无学生">
|
|
|
<Loading slot="loading" bgColor="rgba(103, 103, 103, 0.27)"></Loading>
|
|
|
<template slot-scope="{ row ,index}" slot="action">
|
|
|
<strong></strong>
|
|
@@ -62,37 +46,12 @@
|
|
|
<EmptyData v-else :top="0" textContent="暂无学生" style="padding-top:100px;"></EmptyData>
|
|
|
</vuescroll>
|
|
|
</div>
|
|
|
+ <!--课堂记录-->
|
|
|
+ <div v-show="tabName == 'record'" class="animated fadeIn">
|
|
|
+ <!--<EmptyData style="margin: auto;margin-top: 200px;"></EmptyData>-->
|
|
|
+ </div>
|
|
|
</div>
|
|
|
-
|
|
|
<EmptyData v-if="JSON.stringify(courseInfo) == '{}'" style="margin: auto;margin-top: 200px;"></EmptyData>
|
|
|
-
|
|
|
- <Modal v-model="customGroupStatus"
|
|
|
- :title="$t('courseManage.classroom.autoGroupBtn')"
|
|
|
- @on-ok="comfirmCustomRules" class="custom-group"
|
|
|
- class-name="dark-iview-modal dark-iview-form"
|
|
|
- v-if="JSON.stringify(courseInfo) !== '{}'">
|
|
|
- <Form :label-width="80" :label-colon="true" style="color:white;" v-if="courseInfo.classes">
|
|
|
- <FormItem :label="$t('courseManage.classroom.studentCountLabel')">
|
|
|
- <span v-if="courseInfo.classes[curClassIndex].students">{{courseInfo.classes[curClassIndex].students.length}}人</span>
|
|
|
- </FormItem>
|
|
|
- <FormItem :label="$t('courseManage.classroom.groupCountLabel')">
|
|
|
- <InputNumber :max="10" :min="1" v-model="groupNum"></InputNumber>
|
|
|
- </FormItem>
|
|
|
- <FormItem :label="$t('courseManage.classroom.groupTypeLabel')">
|
|
|
- <RadioGroup v-model="groupType">
|
|
|
- <Radio label="1">
|
|
|
- <span>{{$t('courseManage.classroom.groupType1')}}</span>
|
|
|
- </Radio>
|
|
|
- <Radio label="2">
|
|
|
- <span>{{$t('courseManage.classroom.groupType2')}}</span>
|
|
|
- </Radio>
|
|
|
- <Radio label="3">
|
|
|
- <span>{{$t('courseManage.classroom.groupType3')}}</span>
|
|
|
- </Radio>
|
|
|
- </RadioGroup>
|
|
|
- </FormItem>
|
|
|
- </Form>
|
|
|
- </Modal>
|
|
|
<Modal v-model="newPersonalStatus"
|
|
|
:title="$t('courseManage.classroom.personalClassroomTitle')"
|
|
|
@on-ok="confirmNewClassroom"
|
|
@@ -142,7 +101,6 @@
|
|
|
import E from 'wangeditor'
|
|
|
import StudentList from '@/components/coursemgmt/StudentList.vue'
|
|
|
import '@/utils/Math.uuid'
|
|
|
- import { setTimeout } from 'core-js'
|
|
|
export default {
|
|
|
components: {
|
|
|
StudentList
|
|
@@ -161,6 +119,7 @@
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ tabName:'stus',
|
|
|
sysClass: {
|
|
|
classroomCode: '',
|
|
|
classroomName:''
|
|
@@ -168,39 +127,12 @@
|
|
|
selectClassStatus: false,
|
|
|
showQrStatus: false,
|
|
|
joinQRcode: undefined,
|
|
|
- updated: false,
|
|
|
- groupNum: 2,
|
|
|
- groupType: '1',
|
|
|
- customGroupStatus: false,
|
|
|
newPersonalStatus: false,
|
|
|
addStudentStatus: false,
|
|
|
- currentGroup: '',
|
|
|
curClassIndex: 0,
|
|
|
studentColumn: [],
|
|
|
studentTabelLoading: false,
|
|
|
selections: [],
|
|
|
- groupList: [
|
|
|
- {
|
|
|
- groupCode: 'A',
|
|
|
- groupName: '组别别名A'
|
|
|
- },
|
|
|
- {
|
|
|
- groupCode: 'B',
|
|
|
- groupName: '组别别名B'
|
|
|
- },
|
|
|
- {
|
|
|
- groupCode: 'C',
|
|
|
- groupName: '组别别名C'
|
|
|
- },
|
|
|
- {
|
|
|
- groupCode: 'D',
|
|
|
- groupName: '组别别名D'
|
|
|
- },
|
|
|
- {
|
|
|
- groupCode: 'E',
|
|
|
- groupName: '组别别名E'
|
|
|
- }
|
|
|
- ],
|
|
|
addStudentStatus: false,
|
|
|
personalClassroom: {
|
|
|
classroomCode: '',
|
|
@@ -244,28 +176,6 @@
|
|
|
this.newPersonalStatus = true
|
|
|
}
|
|
|
},
|
|
|
- //保存分组数据
|
|
|
- saveGroup() {
|
|
|
- this.studentTabelLoading = true
|
|
|
- let groups = this.courseInfo.classes[this.curClassIndex].students.map((item) => {
|
|
|
- return {
|
|
|
- seatNo: item.seatNo,
|
|
|
- groupCode: item.groupCode + '',
|
|
|
- groupName: item.groupName,
|
|
|
- studentId: item.studentId
|
|
|
- }
|
|
|
- })
|
|
|
- this.courseInfo.classes[this.curClassIndex].groups = groups
|
|
|
- this.$api.courseMgmt.upsertPlan(this.courseInfo).then(
|
|
|
- (res) => {
|
|
|
- this.$Message.success('保存成功')
|
|
|
- this.studentTabelLoading = false
|
|
|
- },
|
|
|
- (err) => {
|
|
|
- this.studentTabelLoading = false
|
|
|
- }
|
|
|
- )
|
|
|
- },
|
|
|
//手动设置组别
|
|
|
setGroup() {
|
|
|
if (this.currentGroup == '') {
|
|
@@ -288,103 +198,6 @@
|
|
|
}
|
|
|
this.updated = true
|
|
|
},
|
|
|
- comfirmCustomRules() {
|
|
|
- if (this.groupNum === 0) {
|
|
|
- this.$Message.warning('分组数量不能为0')
|
|
|
- } else if (this.groupType == 0) {
|
|
|
- this.$Message.warning('请设置分组方式')
|
|
|
- } else {
|
|
|
- switch (this.groupType) {
|
|
|
- case '1':
|
|
|
- this.randomGroup()
|
|
|
- break
|
|
|
- case '2':
|
|
|
- this.orderGroup()
|
|
|
- break
|
|
|
- case '3':
|
|
|
- this.orderGroupS()
|
|
|
- break
|
|
|
- default:
|
|
|
- break
|
|
|
- }
|
|
|
- this.updated = true
|
|
|
- }
|
|
|
- },
|
|
|
- orderGroupS() {
|
|
|
- let surplus = this.courseInfo.classes[this.curClassIndex].students.length % this.groupNum// 余数
|
|
|
- let maxCount = surplus == 0 ? this.courseInfo.classes[this.curClassIndex].students.length / this.groupNum : Math.ceil(this.courseInfo.classes[this.curClassIndex].students.length / this.groupNum)// 每组最大人数
|
|
|
- this.courseInfo.classes[this.curClassIndex].students = this.courseInfo.classes[this.curClassIndex].students.sort((a, b) => {
|
|
|
- a.seatNo > b.seatNo
|
|
|
- })
|
|
|
- for (let i = 0; i < maxCount; i++) {
|
|
|
- for (let j = 0; j < this.groupNum; j++) {
|
|
|
- let startIndex = this.groupNum * i
|
|
|
- if (startIndex + j < this.courseInfo.classes[this.curClassIndex].students.length) {
|
|
|
- this.courseInfo.classes[this.curClassIndex].students[startIndex + j].groupCode = j + 1
|
|
|
- this.courseInfo.classes[this.curClassIndex].students[startIndex + j].groupName = '组别别名' + (j + 1)
|
|
|
- } else {
|
|
|
- break
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- orderGroup() {
|
|
|
- let surplus = this.courseInfo.classes[this.curClassIndex].students.length % this.groupNum// 余数
|
|
|
- let maxCount = surplus == 0 ? this.courseInfo.classes[this.curClassIndex].students.length / this.groupNum : Math.ceil(this.courseInfo.classes[this.curClassIndex].students.length / this.groupNum)// 每组最大人数
|
|
|
- this.courseInfo.classes[this.curClassIndex].students = this.courseInfo.classes[this.curClassIndex].students.sort((a, b) => {
|
|
|
- a.seatNo > b.seatNo
|
|
|
- })
|
|
|
- let flag = 0
|
|
|
- let startIndex = 0
|
|
|
- for (let i = 0; i < this.groupNum; i++) {
|
|
|
- for (let j = 0; j < maxCount; j++) {
|
|
|
- if (startIndex + j < this.courseInfo.classes[this.curClassIndex].students.length) {
|
|
|
- this.courseInfo.classes[this.curClassIndex].students[startIndex + j].groupCode = i + 1
|
|
|
- this.courseInfo.classes[this.curClassIndex].students[startIndex + j].groupName = '组别别名' + (i + 1)
|
|
|
- } else {
|
|
|
- break
|
|
|
- }
|
|
|
- }
|
|
|
- startIndex += maxCount
|
|
|
- flag++
|
|
|
- if (flag == surplus) {
|
|
|
- maxCount--
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- randomGroup() {
|
|
|
- let surplus = this.courseInfo.classes[this.curClassIndex].students.length % this.groupNum// 余数
|
|
|
- let surplusCount = surplus// 余数
|
|
|
- let maxCount = surplus == 0 ? this.courseInfo.classes[this.curClassIndex].students.length / this.groupNum : Math.ceil(this.courseInfo.classes[this.curClassIndex].students.length / this.groupNum)// 每组最大人数
|
|
|
- let record = {}// 记录每个组已经分配的人数
|
|
|
- for (let i = 1; i <= this.groupNum; i++) {
|
|
|
- record[i] = 0
|
|
|
- }
|
|
|
- let flag = true
|
|
|
- for (let index in this.courseInfo.classes[this.curClassIndex].students) {
|
|
|
- let groupIndex = this.$jsFn.getBtwRandom(1, this.groupNum)
|
|
|
- if (record[groupIndex] < maxCount) {
|
|
|
- record[groupIndex] = record[groupIndex] + 1
|
|
|
- } else {
|
|
|
- for (let key in record) {
|
|
|
- if (record[key] < maxCount) {
|
|
|
- record[key] = record[key] + 1
|
|
|
- groupIndex = key
|
|
|
- break
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- this.courseInfo.classes[this.curClassIndex].students[index].groupCode = groupIndex
|
|
|
- this.courseInfo.classes[this.curClassIndex].students[index].groupName = '组别别名' + groupIndex
|
|
|
- if (record[groupIndex] == maxCount) {
|
|
|
- surplusCount--
|
|
|
- }
|
|
|
- if (surplusCount <= 0 && surplus > 0 && flag) {
|
|
|
- maxCount--
|
|
|
- flag = false
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
confirmNewClassroom() {
|
|
|
this.personalClassroom['scope'] = 'personal'
|
|
|
this.personalClassroom['code'] = this.$store.state.userInfo.TEAMModelId
|
|
@@ -487,9 +300,6 @@
|
|
|
getSelections(selection) {
|
|
|
this.selections = selection
|
|
|
},
|
|
|
- customGroup() {
|
|
|
- this.customGroupStatus = true
|
|
|
- },
|
|
|
changeClassroom(index) {
|
|
|
this.curClassIndex = index
|
|
|
if (!this.courseInfo.classes[this.curClassIndex].getStatus) {
|
|
@@ -516,19 +326,6 @@
|
|
|
key: 'name',
|
|
|
align: 'left '
|
|
|
},
|
|
|
- //{
|
|
|
- // title: this.$t('courseManage.classroom.studentTableC3'),
|
|
|
- // key: 'periodName',
|
|
|
- // width: 150,
|
|
|
- // align: 'center'
|
|
|
- //},
|
|
|
- //{
|
|
|
- // title: this.$t('courseManage.classroom.studentTableC4'),
|
|
|
- // key: 'gradeName',
|
|
|
- // width: 150,
|
|
|
- // align: 'center',
|
|
|
- // sortable: true
|
|
|
- //},
|
|
|
{
|
|
|
title: this.$t('courseManage.classroom.studentTableC5'),
|
|
|
key: 'groupCode',
|
|
@@ -546,11 +343,6 @@
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
- //setTimeout(() => {
|
|
|
- // if (this.courseInfo.classes.length > 0) {
|
|
|
- // this.getClassroomStudent()
|
|
|
- // }
|
|
|
- //}, 1500)
|
|
|
},
|
|
|
created() {
|
|
|
this.initData()
|