|
@@ -91,15 +91,15 @@
|
|
<div class="course-classroom-info-header" style="padding-right:50px;">
|
|
<div class="course-classroom-info-header" style="padding-right:50px;">
|
|
<span @click="tabName = 'record'" :class="tabName == 'record' ? 'course-classroom-label line-bottom line-bottom-active':'course-classroom-label line-bottom'">课堂记录</span>
|
|
<span @click="tabName = 'record'" :class="tabName == 'record' ? 'course-classroom-label line-bottom line-bottom-active':'course-classroom-label line-bottom'">课堂记录</span>
|
|
<span @click="tabName = 'stus'" :class="tabName == 'stus' ? 'course-classroom-label line-bottom line-bottom-active':'course-classroom-label line-bottom'">{{$t('courseManage.classroom.studentList')}}</span>
|
|
<span @click="tabName = 'stus'" :class="tabName == 'stus' ? 'course-classroom-label line-bottom line-bottom-active':'course-classroom-label line-bottom'">{{$t('courseManage.classroom.studentList')}}</span>
|
|
- <div style="float:right;" v-if="listType == 'private' && tabName == 'stus'">
|
|
|
|
- <span class="disable-text-icon action-btn-wrap">
|
|
|
|
- <Icon type="md-add" size="16" />
|
|
|
|
- 添加学生
|
|
|
|
- </span>
|
|
|
|
- <span class="disable-text-icon action-btn-wrap">
|
|
|
|
|
|
+ <div style="float:right;color:white;" v-if="listType == 'private' && tabName == 'stus'">
|
|
|
|
+ <span class="action-btn-wrap" @click="delStudents">
|
|
<Icon type="md-trash" size="16" />
|
|
<Icon type="md-trash" size="16" />
|
|
删除学生
|
|
删除学生
|
|
</span>
|
|
</span>
|
|
|
|
+ <span class="action-btn-wrap" @click="addStuStatus = true">
|
|
|
|
+ <Icon type="md-add" size="16" />
|
|
|
|
+ 添加学生
|
|
|
|
+ </span>
|
|
<!--<span class="disable-text-icon action-btn-wrap">
|
|
<!--<span class="disable-text-icon action-btn-wrap">
|
|
<Icon type="md-shuffle" size="16" />
|
|
<Icon type="md-shuffle" size="16" />
|
|
自动分组
|
|
自动分组
|
|
@@ -112,7 +112,7 @@
|
|
</div>
|
|
</div>
|
|
<div class="course-classroom-info-content dark-iview-table animated fadeIn" v-show="tabName == 'stus'">
|
|
<div class="course-classroom-info-content dark-iview-table animated fadeIn" v-show="tabName == 'stus'">
|
|
<vuescroll style="height:100%;">
|
|
<vuescroll style="height:100%;">
|
|
- <Table :columns="studentColumn" :data="students"
|
|
|
|
|
|
+ <Table :columns="studentColumn" :data="students" @on-selection-change="(selections)=>{delSelection = selections}"
|
|
:height="tableHeight" class="system-classroom-table" :loading="stuLoading" no-data-text="暂无学生">
|
|
:height="tableHeight" class="system-classroom-table" :loading="stuLoading" no-data-text="暂无学生">
|
|
<Loading slot="loading" bgColor="rgba(103, 103, 103, 0.27)"></Loading>
|
|
<Loading slot="loading" bgColor="rgba(103, 103, 103, 0.27)"></Loading>
|
|
<template slot-scope="{ row ,index}" slot="action">
|
|
<template slot-scope="{ row ,index}" slot="action">
|
|
@@ -160,7 +160,7 @@
|
|
</div>
|
|
</div>
|
|
<Drawer title="课程信息" class-name="dark-iview-drawer" width="450" :closable="false" v-model="showCusInfo" @on-close="baseEditStatus = true">
|
|
<Drawer title="课程信息" class-name="dark-iview-drawer" width="450" :closable="false" v-model="showCusInfo" @on-close="baseEditStatus = true">
|
|
<!--基础信息-->
|
|
<!--基础信息-->
|
|
- <div class="course-base-info-content dark-iview-form disabled-iview-select dark-wang-editor" >
|
|
|
|
|
|
+ <div class="course-base-info-content dark-iview-form disabled-iview-select dark-wang-editor">
|
|
<Form ref="courseBaseInfo" label-position="top">
|
|
<Form ref="courseBaseInfo" label-position="top">
|
|
<FormItem label="课程名称" prop="name" class="disabled-iview-select">
|
|
<FormItem label="课程名称" prop="name" class="disabled-iview-select">
|
|
<Input v-if="listType == 'school' && courseListS[curCusIndex]" v-model="courseListS[curCusIndex][0].courseName" :disabled="true" style="width:100%" placeholder="课程名称" :clearable="true"></Input>
|
|
<Input v-if="listType == 'school' && courseListS[curCusIndex]" v-model="courseListS[curCusIndex][0].courseName" :disabled="true" style="width:100%" placeholder="课程名称" :clearable="true"></Input>
|
|
@@ -174,7 +174,7 @@
|
|
<div ref="courseNotice" v-show="!baseEditStatus"></div>
|
|
<div ref="courseNotice" v-show="!baseEditStatus"></div>
|
|
<div v-show="baseEditStatus" style="height:fit-content;color:white;font-size:16px;padding-left:10px;width:100%;">
|
|
<div v-show="baseEditStatus" style="height:fit-content;color:white;font-size:16px;padding-left:10px;width:100%;">
|
|
<vuescroll>
|
|
<vuescroll>
|
|
- <div v-if="listType == 'school' && courseListS[curCusIndex] && checkNotice(courseListS[curCusIndex][0].notice)"
|
|
|
|
|
|
+ <div v-if="listType == 'school' && courseListS[curCusIndex] && checkNotice(courseListS[curCusIndex][0].notice)"
|
|
v-html="courseListS[curCusIndex][0].notice" style=""></div>
|
|
v-html="courseListS[curCusIndex][0].notice" style=""></div>
|
|
<div v-else-if="listType == 'private' && courseListP[curCusIndex] && checkNotice(courseListP[curCusIndex].notice)" v-html="courseListP[curCusIndex].notice" style=""></div>
|
|
<div v-else-if="listType == 'private' && courseListP[curCusIndex] && checkNotice(courseListP[curCusIndex].notice)" v-html="courseListP[curCusIndex].notice" style=""></div>
|
|
<div v-else style="">暂无公告!</div>
|
|
<div v-else style="">暂无公告!</div>
|
|
@@ -245,6 +245,13 @@
|
|
</FormItem>
|
|
</FormItem>
|
|
</Form>
|
|
</Form>
|
|
</Modal>
|
|
</Modal>
|
|
|
|
+ <Modal v-model="addStuStatus"
|
|
|
|
+ title="添加学生"
|
|
|
|
+ width="1200"
|
|
|
|
+ @on-ok="confirmAddStu"
|
|
|
|
+ class-name="dark-iview-modal">
|
|
|
|
+ <StudentList @getSelectInfo="(selction)=>{selections = selction}"></StudentList>
|
|
|
|
+ </Modal>
|
|
<div class="qr-code-wrap" v-show="showQrStatus" @click="showQrStatus = false">
|
|
<div class="qr-code-wrap" v-show="showQrStatus" @click="showQrStatus = false">
|
|
<div id="qrcode" :class="showQrStatus ? 'animated fadeIn':'animated fadeOut'" ref="qrcode" style="padding:20px;background-color:white;width:320px;margin:auto;"></div>
|
|
<div id="qrcode" :class="showQrStatus ? 'animated fadeIn':'animated fadeOut'" ref="qrcode" style="padding:20px;background-color:white;width:320px;margin:auto;"></div>
|
|
</div>
|
|
</div>
|
|
@@ -253,8 +260,10 @@
|
|
<script>
|
|
<script>
|
|
import QRCode from 'qrcodejs2'
|
|
import QRCode from 'qrcodejs2'
|
|
import E from '@/utils/wangEditor.js'
|
|
import E from '@/utils/wangEditor.js'
|
|
|
|
+ import StudentList from '@/components/coursemgt/StudentList.vue'
|
|
export default {
|
|
export default {
|
|
components: {
|
|
components: {
|
|
|
|
+ StudentList
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
// 验证只能是字母和数字
|
|
// 验证只能是字母和数字
|
|
@@ -270,6 +279,8 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return {
|
|
return {
|
|
|
|
+ delSelection:[],
|
|
|
|
+ selections:[],
|
|
schoolClassList:[],
|
|
schoolClassList:[],
|
|
tableHeight:100,
|
|
tableHeight:100,
|
|
studentColumn: [
|
|
studentColumn: [
|
|
@@ -284,24 +295,27 @@
|
|
key: 'name',
|
|
key: 'name',
|
|
align: 'left '
|
|
align: 'left '
|
|
},
|
|
},
|
|
|
|
+ {
|
|
|
|
+ title: '账号',
|
|
|
|
+ key: 'id',
|
|
|
|
+ align: 'center',
|
|
|
|
+ sortable: true
|
|
|
|
+ },
|
|
{
|
|
{
|
|
title: this.$t('courseManage.classroom.studentTableC1'),
|
|
title: this.$t('courseManage.classroom.studentTableC1'),
|
|
key: 'no',
|
|
key: 'no',
|
|
- //width: 140,
|
|
|
|
align: 'center',
|
|
align: 'center',
|
|
sortable: true
|
|
sortable: true
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: this.$t('courseManage.classroom.studentTableC5'),
|
|
title: this.$t('courseManage.classroom.studentTableC5'),
|
|
slot: 'groupId',
|
|
slot: 'groupId',
|
|
- //width: 150,
|
|
|
|
align: 'center',
|
|
align: 'center',
|
|
sortable: true
|
|
sortable: true
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: this.$t('courseManage.classroom.studentTableC6'),
|
|
title: this.$t('courseManage.classroom.studentTableC6'),
|
|
slot: 'groupName',
|
|
slot: 'groupName',
|
|
- //width: 150,
|
|
|
|
align: 'center'
|
|
align: 'center'
|
|
}
|
|
}
|
|
],
|
|
],
|
|
@@ -317,7 +331,7 @@
|
|
listType: 'school',
|
|
listType: 'school',
|
|
tabName: 'record',
|
|
tabName: 'record',
|
|
addCusStatus: false,
|
|
addCusStatus: false,
|
|
- delCusStatus: false,
|
|
|
|
|
|
+ addStuStatus: false,
|
|
joinQRcode: undefined,
|
|
joinQRcode: undefined,
|
|
curCusIndex: 0,
|
|
curCusIndex: 0,
|
|
curClassIndex: 0,
|
|
curClassIndex: 0,
|
|
@@ -347,19 +361,125 @@
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ //删除学生
|
|
|
|
+ delStudents() {
|
|
|
|
+ if (this.delSelection.length > 0) {
|
|
|
|
+ let names = this.delSelection.map(item => {
|
|
|
|
+ return item.name
|
|
|
|
+ })
|
|
|
|
+ this.$Modal.confirm({
|
|
|
|
+ title: '删除学生',
|
|
|
|
+ content: `确认删除${names.join(', ')}共${names.length}名学生吗?`,
|
|
|
|
+ onOk: () => {
|
|
|
|
+ this.listLoading = true
|
|
|
|
+ this.delSelection.forEach(item => {
|
|
|
|
+ let index = this.courseListP[this.curCusIndex].classes[this.curClassIndex].students.findIndex(stu => {
|
|
|
|
+ return stu.id == item.id
|
|
|
|
+ })
|
|
|
|
+ this.courseListP[this.curCusIndex].classes[this.curClassIndex].students.splice(index,1)
|
|
|
|
+ })
|
|
|
|
+ this.$api.courseMgmt.upsertPrivateCus({
|
|
|
|
+ course: this.courseListP[this.curCusIndex],
|
|
|
|
+ option: 'update'
|
|
|
|
+ }).then(
|
|
|
|
+ (res) => {
|
|
|
|
+ if (!res.error) {
|
|
|
|
+ this.selections.length = 0
|
|
|
|
+ this.$Message.success('删除成功!')
|
|
|
|
+ } else {
|
|
|
|
+ this.$Message.error('删除失败!')
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ (err) => {
|
|
|
|
+ this.$Message.error('删除失败!')
|
|
|
|
+ }
|
|
|
|
+ ).finally(() => {
|
|
|
|
+ this.listLoading = false
|
|
|
|
+ this.baseEditStatus = !this.baseEditStatus
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ this.$Message.warning('请先选择需要删除的学生!')
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ //确认添加学生
|
|
|
|
+ confirmAddStu() {
|
|
|
|
+ if (this.selections.length > 0) {
|
|
|
|
+ if (!this.courseListP[this.curCusIndex].classes[this.curClassIndex].students) {
|
|
|
|
+ this.$set(this.courseListP[this.curCusIndex].classes[this.curClassIndex], 'students', [])
|
|
|
|
+ }
|
|
|
|
+ let stuIds = this.courseListP[this.curCusIndex].classes[this.curClassIndex].students.map(item => {
|
|
|
|
+ return item.id
|
|
|
|
+ })
|
|
|
|
+ if (stuIds.length > 0) {
|
|
|
|
+ //如果已经有学生,根据账号去重
|
|
|
|
+ let hasRepeat = false
|
|
|
|
+ this.selections.forEach(item => {
|
|
|
|
+ if (stuIds.indexOf(item.id) == -1) {
|
|
|
|
+ this.courseListP[this.curCusIndex].classes[this.curClassIndex].students.push({
|
|
|
|
+ id: item.id,
|
|
|
|
+ name: item.name,
|
|
|
|
+ no: item.no
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ hasRepeat = true
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ if (hasRepeat) {
|
|
|
|
+ //this.$Message.warning('已经自动帮您去掉账号重复的学生!')
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ let stus = this.selections.map(item => {
|
|
|
|
+ return {
|
|
|
|
+ id: item.id,
|
|
|
|
+ name: item.name,
|
|
|
|
+ no: item.no
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ this.courseListP[this.curCusIndex].classes[this.curClassIndex].students.push(...stus)
|
|
|
|
+ }
|
|
|
|
+ //保存操作
|
|
|
|
+ this.listLoading = true
|
|
|
|
+ this.$api.courseMgmt.upsertPrivateCus({
|
|
|
|
+ course: this.courseListP[this.curCusIndex],
|
|
|
|
+ option: 'update'
|
|
|
|
+ }).then(
|
|
|
|
+ (res) => {
|
|
|
|
+ if (!res.error) {
|
|
|
|
+ this.selections.length = 0
|
|
|
|
+ this.$Message.success('添加成功!')
|
|
|
|
+ } else {
|
|
|
|
+ this.$Message.error('添加失败!')
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ (err) => {
|
|
|
|
+ this.$Message.error('添加失败!')
|
|
|
|
+ }
|
|
|
|
+ ).finally(() => {
|
|
|
|
+ this.listLoading = false
|
|
|
|
+ this.baseEditStatus = !this.baseEditStatus
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ },
|
|
//查询班级学生名单
|
|
//查询班级学生名单
|
|
findClassStu() {
|
|
findClassStu() {
|
|
this.stuLoading = true
|
|
this.stuLoading = true
|
|
let params = {
|
|
let params = {
|
|
'school_code': this.$store.state.userInfo.schoolCode,
|
|
'school_code': this.$store.state.userInfo.schoolCode,
|
|
- //'teacher.id': this.$store.state.userInfo.TEAMModelId,
|
|
|
|
- 'id': this.courseListS[this.curCusIndex][this.curClassIndex].id
|
|
|
|
|
|
+ 'id': this.classList[this.curClassIndex].id
|
|
}
|
|
}
|
|
this.$api.schoolSetting.getClassroomStudent(params).then(
|
|
this.$api.schoolSetting.getClassroomStudent(params).then(
|
|
(res) => {
|
|
(res) => {
|
|
if (!res.error) {
|
|
if (!res.error) {
|
|
if (res.classrooms.length > 0) {
|
|
if (res.classrooms.length > 0) {
|
|
- this.$set(this.courseListS[this.curCusIndex][this.curClassIndex], 'students', res.classrooms[0].students)
|
|
|
|
|
|
+ if (this.listType == 'school') {
|
|
|
|
+ this.$set(this.courseListS[this.curCusIndex][this.curClassIndex], 'students', res.classrooms[0].students)
|
|
|
|
+ }
|
|
|
|
+ //else {
|
|
|
|
+ // this.$set(this.courseListP[this.curCusIndex].classes[this.curClassIndex], 'students', res.classrooms[0].students)
|
|
|
|
+ //}
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
this.$Message.error('API error!')
|
|
this.$Message.error('API error!')
|
|
@@ -439,7 +559,7 @@
|
|
this.toggleCusInfo()
|
|
this.toggleCusInfo()
|
|
this.edNotice()
|
|
this.edNotice()
|
|
},
|
|
},
|
|
- //保存个人课程公告
|
|
|
|
|
|
+ //保存个人课程
|
|
saveNotice() {
|
|
saveNotice() {
|
|
this.listLoading = true
|
|
this.listLoading = true
|
|
this.$api.courseMgmt.upsertPrivateCus({
|
|
this.$api.courseMgmt.upsertPrivateCus({
|
|
@@ -548,8 +668,9 @@
|
|
addClassroom(value) {
|
|
addClassroom(value) {
|
|
if (value == 0) {
|
|
if (value == 0) {
|
|
//直接读取登录成功拿到得学校基础信息
|
|
//直接读取登录成功拿到得学校基础信息
|
|
- this.schoolClassList = JSON.parse(JSON.stringify(this.$store.state.user.schoolProfile.school_classes))
|
|
|
|
- //this.$store.dispatch('schoolBaseInfo/getClassroom')
|
|
|
|
|
|
+ this.$store.dispatch('user/getSchoolProfile').then(res => {
|
|
|
|
+ this.schoolClassList = res.school_classes
|
|
|
|
+ })
|
|
this.selectClassStatus = true
|
|
this.selectClassStatus = true
|
|
} else if (value == 1) {
|
|
} else if (value == 1) {
|
|
let randomCode = 'P'
|
|
let randomCode = 'P'
|
|
@@ -591,20 +712,38 @@
|
|
return item.id == this.sysClass.id
|
|
return item.id == this.sysClass.id
|
|
})
|
|
})
|
|
if (curClass.length > 0) {
|
|
if (curClass.length > 0) {
|
|
- this.courseListP[this.curCusIndex].classes.push(curClass[0])
|
|
|
|
- this.$api.courseMgmt.upsertPrivateCus({
|
|
|
|
- course: this.courseListP[this.curCusIndex],
|
|
|
|
- option: 'update'
|
|
|
|
- }).then(
|
|
|
|
|
|
+ let params = {
|
|
|
|
+ 'school_code': this.$store.state.userInfo.schoolCode,
|
|
|
|
+ 'id': this.sysClass.id
|
|
|
|
+ }
|
|
|
|
+ this.$api.schoolSetting.getClassroomStudent(params).then(
|
|
(res) => {
|
|
(res) => {
|
|
if (!res.error) {
|
|
if (!res.error) {
|
|
- this.$Message.success('上课班级添加成功!')
|
|
|
|
|
|
+ if (res.classrooms.length > 0) {
|
|
|
|
+ curClass[0].students = res.classrooms[0].students
|
|
|
|
+ this.courseListP[this.curCusIndex].classes.push(curClass[0])
|
|
|
|
+ this.$api.courseMgmt.upsertPrivateCus({
|
|
|
|
+ course: this.courseListP[this.curCusIndex],
|
|
|
|
+ option: 'update'
|
|
|
|
+ }).then(
|
|
|
|
+ (res) => {
|
|
|
|
+ if (!res.error) {
|
|
|
|
+ this.$Message.success('上课班级添加成功!')
|
|
|
|
+ } else {
|
|
|
|
+ this.$Message.error('上课班级添加失败!')
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ (err) => {
|
|
|
|
+ this.$Message.error('上课班级添加失败!')
|
|
|
|
+ }
|
|
|
|
+ )
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
- this.$Message.error('上课班级添加失败!')
|
|
|
|
|
|
+ this.$Message.error('API error!')
|
|
}
|
|
}
|
|
},
|
|
},
|
|
(err) => {
|
|
(err) => {
|
|
- this.$Message.error('上课班级添加失败!')
|
|
|
|
|
|
+ this.$Message.error('API error!')
|
|
}
|
|
}
|
|
)
|
|
)
|
|
}
|
|
}
|
|
@@ -622,7 +761,7 @@
|
|
},
|
|
},
|
|
changeClassroom(index) {
|
|
changeClassroom(index) {
|
|
this.curClassIndex = index
|
|
this.curClassIndex = index
|
|
- if (this.classList[index].scope == 'school' && !this.courseListS[this.curCusIndex][this.curClassIndex].students) {
|
|
|
|
|
|
+ if (this.listType == 'school' && !this.courseListS[this.curCusIndex][this.curClassIndex].students) {
|
|
this.findClassStu()
|
|
this.findClassStu()
|
|
}
|
|
}
|
|
},
|
|
},
|