|
@@ -75,24 +75,17 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- 上课名单、上课时段设置 -->
|
|
|
- <div slot="right" class="class-setting" v-show="!isAddStuList && !addTeaStatus">
|
|
|
+ <div slot="right" class="class-setting" v-show="!addListStatus && !addTeaStatus">
|
|
|
<div class="teacher-list-header">
|
|
|
<span class="tab-label" style="padding-left:10px">
|
|
|
{{$t('cusMgt.cusNameList')}}
|
|
|
</span>
|
|
|
- <!-- <span @click="curTab = 0" :class="curTab == 0 ? 'tab-label line-bottom line-bottom-active':'tab-label line-bottom'">
|
|
|
- {{$t('cusMgt.cusNameList')}}
|
|
|
- </span> -->
|
|
|
- <!-- 取消根据老师设置课程时段的功能 -->
|
|
|
- <!-- <span @click="selectTab(1)" :class="curTab == 1 ? 'tab-label line-bottom line-bottom-active':'tab-label line-bottom'">
|
|
|
- {{$t('cusMgt.cusTime')}}
|
|
|
- </span> -->
|
|
|
<div class="action-btn-wrap">
|
|
|
<span class="action-btn" style="margin-right:30px" @click="updCusInfo()" v-if="isUpd">
|
|
|
<Icon type="ios-albums-outline" size="16" />
|
|
|
<span>{{$t('cusMgt.saveLabel')}}</span>
|
|
|
</span>
|
|
|
- <span class="action-btn" v-show="curTab == 0" :style="{marginRight:isUpd ? '20px':'30px'}" @click="setDefaultTea">
|
|
|
+ <span class="action-btn" v-show="curTab == 0" :style="{marginRight:isUpd ? '20px':'30px'}" @click="addNameList">
|
|
|
<Icon type="md-add" size="16" />
|
|
|
<span>{{$t('cusMgt.addStuList')}}</span>
|
|
|
</span>
|
|
@@ -116,23 +109,12 @@
|
|
|
</p>
|
|
|
<p class="class-attr-item">
|
|
|
<span class="attr-label">学生人数:</span>
|
|
|
- <span class="class-name">--人</span>
|
|
|
+ <span class="class-name">{{item.students ? item.students.length : 0}}{{$t('unit.text7')}}</span>
|
|
|
</p>
|
|
|
- <!-- 上课地点 取消设置上课教室-->
|
|
|
- <!-- <p class="class-attr-item">
|
|
|
- <span class="attr-label">{{$t('cusMgt.addrLabel')}} </span>
|
|
|
- <span :class="item.room ? 'class-name':'def-class-name'">{{item.room && item.roomInfo ? item.roomInfo.name : $t('cusMgt.noSet')}}</span>
|
|
|
- </p> -->
|
|
|
</div>
|
|
|
</div>
|
|
|
- <!-- 设置教室名单 -->
|
|
|
+ <!-- 设置班级名单 -->
|
|
|
<div slot="right" class="set-stu-list dark-iview-table dark-el-cascader" v-if="schdList[curClassIndex]">
|
|
|
- <!-- <div class="stu-list-header dark-iview-select">
|
|
|
- <span class="attr-label">{{$t('cusMgt.addrLabel')}}</span>
|
|
|
- <Select v-model="schdList[curClassIndex].room" style="width:200px" size="small" filterable clearable @on-clear="updCusInfo">
|
|
|
- <Option v-for="item in roomList" :value="item.id" :key="item.id" @click.native="setCusRoom(item)">{{ item.name }}</Option>
|
|
|
- </Select>
|
|
|
- </div> -->
|
|
|
<vuescroll>
|
|
|
<Table v-if="schdList[curClassIndex]" :columns="schdList[curClassIndex].stulist ? listColumn : classColumn" :data="students" class="stu-list-table" :loading="stuLoading" :no-data-text="$t('cusMgt.noStu')">
|
|
|
<Loading slot="loading" :top="0" bgColor="rgba(103, 103, 103, 0.27)"></Loading>
|
|
@@ -173,8 +155,8 @@
|
|
|
</vuescroll>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <!-- 添加名单UI 批量添加-->
|
|
|
- <div slot="right" class="class-setting dark-iview-input dark-iview-select dark-iview-table" v-show="isAddStuList">
|
|
|
+ <!-- 添加班级名单UI 批量添加-->
|
|
|
+ <div slot="right" class="class-setting dark-iview-input dark-iview-select dark-iview-table" v-show="addListStatus">
|
|
|
<vuescroll>
|
|
|
<div class="add-tea-header">
|
|
|
<RadioGroup v-model="addType" type="button" button-style="solid" size="small">
|
|
@@ -208,7 +190,7 @@
|
|
|
<div slot="right" class="class-setting dark-iview-input dark-iview-table" v-show="addTeaStatus">
|
|
|
<vuescroll>
|
|
|
<div class="add-tea-header">
|
|
|
- <Input search :placeholder="$t('cusMgt.searchHolder')" style="width:240px;margin-top:4px" size="small" />
|
|
|
+ <!-- <Input search :placeholder="$t('cusMgt.searchHolder')" style="width:240px;margin-top:4px" size="small" /> -->
|
|
|
<div class="action-btn-wrap">
|
|
|
<span class="action-btn" style="margin-right:40px" @click="confirmAddTea">
|
|
|
<Icon type="md-add" size="16" />
|
|
@@ -309,13 +291,11 @@ export default {
|
|
|
setCurClass: '',
|
|
|
addTeaStatus: false,
|
|
|
preDefault: true,
|
|
|
- isAddStuList: false,
|
|
|
+ addListStatus: false,
|
|
|
isSearch: false,
|
|
|
stuLoading: false,
|
|
|
- students: [],
|
|
|
preStus: [],
|
|
|
stuList: [],
|
|
|
- isDefault: true,
|
|
|
teacherList: [],
|
|
|
sltTeachers: [],
|
|
|
sltClass: [],
|
|
@@ -406,17 +386,17 @@ export default {
|
|
|
align: 'center',
|
|
|
sortable: true
|
|
|
},
|
|
|
- {
|
|
|
- title: this.$t('courseManage.classroom.studentTableC5'),
|
|
|
- slot: 'groupId',
|
|
|
- align: 'center',
|
|
|
- sortable: true
|
|
|
- },
|
|
|
- {
|
|
|
- title: this.$t('courseManage.classroom.studentTableC6'),
|
|
|
- slot: 'groupName',
|
|
|
- align: 'center'
|
|
|
- }
|
|
|
+ // {
|
|
|
+ // title: this.$t('courseManage.classroom.studentTableC5'),
|
|
|
+ // slot: 'groupId',
|
|
|
+ // align: 'center',
|
|
|
+ // sortable: true
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // title: this.$t('courseManage.classroom.studentTableC6'),
|
|
|
+ // slot: 'groupName',
|
|
|
+ // align: 'center'
|
|
|
+ // }
|
|
|
],
|
|
|
listColumn: [
|
|
|
{
|
|
@@ -507,20 +487,6 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- //设置上课教室
|
|
|
- setCusRoom(room) {
|
|
|
- console.log(room)
|
|
|
- this.$set(this.schdList[this.curClassIndex], 'roomInfo', {
|
|
|
- id: room.id,
|
|
|
- name: room.name
|
|
|
- })
|
|
|
- // this.schdList[this.curClassIndex].roomInfo = {
|
|
|
- // id:room.id,
|
|
|
- // name:room.name
|
|
|
- // }
|
|
|
- console.log(this.schdList[this.curClassIndex])
|
|
|
- this.updCusInfo()
|
|
|
- },
|
|
|
//根据班级学年计算年级
|
|
|
getGradeByYear(year) {
|
|
|
if (year && this.schoolBase && this.schoolBase.period.length && this.filterPeriod) {
|
|
@@ -642,7 +608,7 @@ export default {
|
|
|
this.addTeaStatus = true
|
|
|
},
|
|
|
initStatus() {
|
|
|
- this.isAddStuList = false
|
|
|
+ this.addListStatus = false
|
|
|
this.addTeaStatus = false
|
|
|
},
|
|
|
confirmAddStuList() {
|
|
@@ -705,23 +671,11 @@ export default {
|
|
|
},
|
|
|
selectTab(index) {
|
|
|
this.curTab = index
|
|
|
- // this.setDefClass()
|
|
|
let teaId = this.teaList[this.curTeaIndex].id
|
|
|
if (index == 1 && teaId && !this.teaSchds[teaId]) {
|
|
|
this.getTeaSchd()
|
|
|
}
|
|
|
},
|
|
|
- //设置默认授课教室
|
|
|
- // setDefClass() {
|
|
|
- // if (this.schdList[this.curClassIndex]) {
|
|
|
- // this.setCurClass = this.schdList[this.curClassIndex].classId || ''
|
|
|
- // if (!this.setCurClass && this.schdRoomList[0]) {
|
|
|
- // this.setCurClass = this.schdRoomList[0].classId
|
|
|
- // }
|
|
|
- // } else {
|
|
|
- // this.setCurClass = ''
|
|
|
- // }
|
|
|
- // },
|
|
|
//设置课程时段
|
|
|
selectCell(data) {
|
|
|
let teacher = this.teaList[this.curTeaIndex] ? this.teaList[this.curTeaIndex].id : ''
|
|
@@ -797,20 +751,16 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- //修改上课名单
|
|
|
- updateStuList(listName) {
|
|
|
- this.isUpd = true
|
|
|
- this.schdList[this.curClassIndex].listName = listName
|
|
|
- },
|
|
|
+
|
|
|
//关闭搜索状态
|
|
|
closeSearch() {
|
|
|
this.isSearch = false
|
|
|
this.keyWord = ''
|
|
|
this.filterByPeriod()
|
|
|
},
|
|
|
- //设置默认授课老师
|
|
|
- setDefaultTea() {
|
|
|
- this.isAddStuList = true
|
|
|
+ //添加课程名单
|
|
|
+ addNameList() {
|
|
|
+ this.addListStatus = true
|
|
|
this.schedule.teacherId = this.teaList[this.curTeaIndex].id
|
|
|
this.schedule.teacherName = this.teaList[this.curTeaIndex].name
|
|
|
},
|
|
@@ -829,18 +779,16 @@ export default {
|
|
|
}
|
|
|
)
|
|
|
},
|
|
|
- //选择教室列表
|
|
|
+ //选择课程名单列表
|
|
|
selectClass(index) {
|
|
|
this.curClassIndex = index
|
|
|
- this.setIsDefault()
|
|
|
+ this.findCurStuList()
|
|
|
this.initStatus()
|
|
|
},
|
|
|
//教师列表选择事件
|
|
|
selectTea(index) {
|
|
|
this.curClassIndex = 0
|
|
|
this.curTeaIndex = index
|
|
|
- this.setIsDefault()
|
|
|
- // this.setDefClass()
|
|
|
this.initStatus()
|
|
|
//获取老师所有授课数据渲染课程表
|
|
|
if (this.teaList.length) {
|
|
@@ -882,63 +830,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- //默认名单切换判断
|
|
|
- handleSwitch() {
|
|
|
- return new Promise((resolve, reject) => {
|
|
|
- if (!this.isDefault) {
|
|
|
- this.$Modal.confirm({
|
|
|
- title: this.$t('cusMgt.defaultTitle'),
|
|
|
- content: this.$t('cusMgt.defaultContent'),
|
|
|
- onOk: () => {
|
|
|
- this.schdList[this.curClassIndex].stulist = ''
|
|
|
- resolve()
|
|
|
- },
|
|
|
- onCancel: () => {
|
|
|
- reject()
|
|
|
- }
|
|
|
- })
|
|
|
- } else {
|
|
|
- resolve()
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- //设置教室名称
|
|
|
- setClassName(data, option) {
|
|
|
- let curClass = this.roomList.find(item => {
|
|
|
- return item.id == data
|
|
|
- })
|
|
|
- if (option == 'insert') { //添加名单的逻辑
|
|
|
- if (curClass) {
|
|
|
- this.schedule.classInfo.name = curClass.name
|
|
|
- this.schedule.classInfo.id = curClass.id
|
|
|
- if (curClass.students) {
|
|
|
- this.preStus = curClass.students
|
|
|
- } else {
|
|
|
- let params = {
|
|
|
- 'school_code': this.$store.state.userInfo.schoolCode,
|
|
|
- 'ids': [curClass.id],
|
|
|
- 'scope': 'school'
|
|
|
- }
|
|
|
- this.$api.schoolSetting.getClassroomStudent(params).then(
|
|
|
- (res) => {
|
|
|
- if (!res.error) {
|
|
|
- this.preStus = res.stus.length ? res.stus[0] : []
|
|
|
- curClass.students = res.stus.length ? res.stus[0] : []
|
|
|
- } else {
|
|
|
- this.$Message.error('API error!')
|
|
|
- }
|
|
|
- },
|
|
|
- (err) => {
|
|
|
- this.$Message.error('API error!')
|
|
|
- }
|
|
|
- )
|
|
|
- }
|
|
|
- }
|
|
|
- } else { //修改教室的逻辑
|
|
|
- this.isUpd = true
|
|
|
- if (curClass) this.schdList[this.curClassIndex].classInfo.name = curClass.name
|
|
|
- }
|
|
|
- },
|
|
|
+
|
|
|
//确认添加名单
|
|
|
confirmAddSchd() {
|
|
|
if (!this.schedule.teacherId) {
|
|
@@ -1003,14 +895,14 @@ export default {
|
|
|
return
|
|
|
}
|
|
|
console.log('课程信息:', this.courseListShow[this.curCusIndex])
|
|
|
- this.isAddStuList = false
|
|
|
+ this.addListStatus = false
|
|
|
this.updCusInfo()
|
|
|
this.initSchedule()
|
|
|
this.clearTable()
|
|
|
},
|
|
|
//取消添加Schd
|
|
|
cancelAddSchd() {
|
|
|
- this.isAddStuList = false
|
|
|
+ this.addListStatus = false
|
|
|
this.initSchedule()
|
|
|
this.clearTable()
|
|
|
},
|
|
@@ -1126,20 +1018,11 @@ export default {
|
|
|
onCancel: () => { }
|
|
|
})
|
|
|
},
|
|
|
- goMgtStuList() {
|
|
|
- //不用跳转页面进行操作
|
|
|
- this.$router.push({
|
|
|
- name: 'MgtStuList'
|
|
|
- })
|
|
|
- // 在当前页面添加stulist
|
|
|
- // this.addStuListStatus = true
|
|
|
- },
|
|
|
// 切换课表模式和课程模式
|
|
|
toggleView() {
|
|
|
this.$router.push({
|
|
|
name: 'CoursePlan'
|
|
|
})
|
|
|
- // this.$Message.warning('课表模式开发中...')
|
|
|
},
|
|
|
dropdownStates(flag) {
|
|
|
if (!flag) this.filterByPeriod()
|
|
@@ -1209,58 +1092,81 @@ export default {
|
|
|
'id': this.courseListShow[this.curCusIndex].id
|
|
|
}
|
|
|
this.$api.courseMgmt.findCusInfo(requestData).then(
|
|
|
- (res) => {
|
|
|
- if (!res.error) {
|
|
|
- if (res.courses && res.courses.length > 0) {
|
|
|
- res.courses[0].schedule = res.courses[0].schedule ? res.courses[0].schedule : []
|
|
|
- res.courses[0].schedule.forEach(item => {
|
|
|
- //补充班级信息
|
|
|
- if (item.classId) {
|
|
|
- let classInfo = this.classList.find(classItem => {
|
|
|
- return classItem.id == item.classId
|
|
|
- })
|
|
|
- if (classInfo) {
|
|
|
- item.classInfo = {
|
|
|
- id: item.classId,
|
|
|
- name: classInfo.name
|
|
|
- }
|
|
|
- } else {
|
|
|
- item.classInfo = {
|
|
|
- id: item.classId,
|
|
|
- name: '--'
|
|
|
- }
|
|
|
+ async (res) => {
|
|
|
+ if (!res.error && res.courses && res.courses.length > 0) {
|
|
|
+ res.courses[0].schedule = res.courses[0].schedule ? res.courses[0].schedule : []
|
|
|
+ //获取班级名单信息(方便列表显示学生人数)
|
|
|
+ let classIds = res.courses[0].schedule.map(item => {
|
|
|
+ return item.classId
|
|
|
+ })
|
|
|
+ for (let i = 0; i < classIds.length; i++) {
|
|
|
+ if (!classIds[i]) {
|
|
|
+ classIds.splice(i, 1)
|
|
|
+ i--
|
|
|
+ }
|
|
|
+ }
|
|
|
+ let classStus = null
|
|
|
+ if (classIds.length) {
|
|
|
+ try {
|
|
|
+ classStus = await this.getStuByClassIds(classIds)
|
|
|
+ } catch (e) {
|
|
|
+ this.$Message.error('API ERROR')
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ res.courses[0].schedule.forEach(item => {
|
|
|
+ //补充班级信息
|
|
|
+ if (item.classId) {
|
|
|
+ let classInfo = this.classList.find(classItem => {
|
|
|
+ return classItem.id == item.classId
|
|
|
+ })
|
|
|
+ if (classInfo) {
|
|
|
+ item.classInfo = {
|
|
|
+ id: item.classId,
|
|
|
+ name: classInfo.name
|
|
|
}
|
|
|
- }
|
|
|
- // 补充动态名单信息
|
|
|
- if (item.stulist) {
|
|
|
- let listInfo = this.stuList.find(listItem => {
|
|
|
- return listItem.id == item.stulist
|
|
|
- })
|
|
|
- if (listInfo) {
|
|
|
- item.listName = listInfo.name
|
|
|
- } else {
|
|
|
- item.listName = '--'
|
|
|
+ } else {
|
|
|
+ item.classInfo = {
|
|
|
+ id: item.classId,
|
|
|
+ name: '--'
|
|
|
}
|
|
|
}
|
|
|
- // 补充教室信息
|
|
|
- if (item.room) {
|
|
|
- let roomInfo = this.roomList.find(roomItem => {
|
|
|
- return roomItem.id == item.room
|
|
|
- })
|
|
|
- if (roomInfo) {
|
|
|
- item.roomInfo = {
|
|
|
- id: item.room,
|
|
|
- name: roomInfo.name
|
|
|
- }
|
|
|
- } else {
|
|
|
- item.roomInfo = {
|
|
|
- id: item.room,
|
|
|
- name: '--'
|
|
|
+ //根据上面查看班级学生的返回结果补充学生名单
|
|
|
+ if (classStus && classStus.stus) {
|
|
|
+ classStus.stus.forEach(stuItem => {
|
|
|
+ if (stuItem.length > 0 && stuItem[0].classId == item.classId) {
|
|
|
+ item.students = stuItem
|
|
|
+ item.fullStu = true
|
|
|
}
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 补充动态名单信息
|
|
|
+ if (item.stulist) {
|
|
|
+ let listInfo = this.stuList.find(listItem => {
|
|
|
+ return listItem.id == item.stulist
|
|
|
+ })
|
|
|
+ item.listName = listInfo ? listInfo.name : '--'
|
|
|
+ item.students = listInfo ? listInfo.students : []
|
|
|
+ }
|
|
|
+ // 补充教室信息
|
|
|
+ if (item.room) {
|
|
|
+ let roomInfo = this.roomList.find(roomItem => {
|
|
|
+ return roomItem.id == item.room
|
|
|
+ })
|
|
|
+ if (roomInfo) {
|
|
|
+ item.roomInfo = {
|
|
|
+ id: item.room,
|
|
|
+ name: roomInfo.name
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ item.roomInfo = {
|
|
|
+ id: item.room,
|
|
|
+ name: '--'
|
|
|
}
|
|
|
}
|
|
|
- })
|
|
|
- }
|
|
|
+ }
|
|
|
+ })
|
|
|
this.$set(this.courseListShow, this.curCusIndex, res.courses[0])
|
|
|
this.selectTea(0)
|
|
|
}
|
|
@@ -1272,6 +1178,16 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
+ //初始化课程课程信息时,根据班级ids查询名单信息
|
|
|
+ getStuByClassIds(classIds) {
|
|
|
+ let params = {
|
|
|
+ 'school_code': this.$store.state.userInfo.schoolCode,
|
|
|
+ 'ids': classIds,
|
|
|
+ //school:校本班级 teacher:私人课程校本名单 private:私人课程动态名单
|
|
|
+ 'scope': 'school'
|
|
|
+ }
|
|
|
+ return this.$api.schoolSetting.getClassroomStudent(params)
|
|
|
+ },
|
|
|
//显示新增/编辑课程对话框
|
|
|
showAddCourse(type) {
|
|
|
this.addCourseStatus = true
|
|
@@ -1413,30 +1329,17 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- setIsDefault() {
|
|
|
- if (this.schdList.length) {
|
|
|
- this.isDefault = !this.schdList[this.curClassIndex].stulist
|
|
|
- this.findCurStuList()
|
|
|
- }
|
|
|
- },
|
|
|
- //获取当前学生名单
|
|
|
+ //获取当前动态学生名单
|
|
|
findCurStuList() {
|
|
|
- if (this.isAddStuList) {
|
|
|
- this.students = []
|
|
|
- return
|
|
|
- }
|
|
|
- if (!this.schdList || !this.schdList[this.curClassIndex]) {
|
|
|
- this.students = []
|
|
|
- return
|
|
|
- }
|
|
|
- if (this.schdList[this.curClassIndex].stulist) { //自定义名单学生
|
|
|
+ if (this.schdList[this.curClassIndex] && this.schdList[this.curClassIndex].stulist) { //自定义名单学生
|
|
|
let stulist = this.stuList.find(item => {
|
|
|
return item.id == this.schdList[this.curClassIndex].stulist
|
|
|
})
|
|
|
if (stulist) { //有对应的自定义名单
|
|
|
if (stulist.full) {
|
|
|
- this.students = stulist.students
|
|
|
+ // this.students = stulist.students
|
|
|
} else {
|
|
|
+ this.stuLoading = true
|
|
|
this.$api.courseMgmt.findStuSummary({
|
|
|
students: stulist.students
|
|
|
}).then(
|
|
@@ -1451,20 +1354,18 @@ export default {
|
|
|
})
|
|
|
stulist.students = res.stus
|
|
|
stulist.full = true
|
|
|
- this.students = res.stus
|
|
|
+ // this.students = res.stus
|
|
|
+ this.schdList[this.curClassIndex].students = res.stus
|
|
|
}
|
|
|
- )
|
|
|
+ ).finally(()=>{
|
|
|
+ this.stuLoading = false
|
|
|
+ })
|
|
|
}
|
|
|
- } else { //没有对应的自定义名单
|
|
|
- this.students = []
|
|
|
- }
|
|
|
- } else { //教室默认学生
|
|
|
- if (this.schdList[this.curClassIndex].students) {
|
|
|
- this.students = this.schdList[this.curClassIndex].students
|
|
|
- } else {
|
|
|
- this.findClassStu(this.schdList[this.curClassIndex].classId)
|
|
|
}
|
|
|
}
|
|
|
+ //系统班级学生(初始化课程的时候就获取了这里就不用获取了)
|
|
|
+ else {
|
|
|
+ }
|
|
|
},
|
|
|
//查询班级学生
|
|
|
findClassStu(classId) {
|
|
@@ -1476,7 +1377,7 @@ export default {
|
|
|
this.$api.schoolSetting.getClassroomStudent(params).then(
|
|
|
(res) => {
|
|
|
if (!res.error) {
|
|
|
- this.students = res.stus.length ? res.stus[0] : []
|
|
|
+ // this.students = res.stus.length ? res.stus[0] : []
|
|
|
this.schdList[this.curClassIndex].students = res.stus.length ? res.stus[0] : []
|
|
|
} else {
|
|
|
this.$Message.error('API error!')
|
|
@@ -1567,38 +1468,6 @@ export default {
|
|
|
}
|
|
|
return []
|
|
|
},
|
|
|
- //选择教室名单列表
|
|
|
- roomTable() {
|
|
|
- let tbData = []
|
|
|
- tbData = this.roomList.filter(item => {
|
|
|
- return item.periodId == this.filterPeriod
|
|
|
- })
|
|
|
- return tbData
|
|
|
- },
|
|
|
- //级联选择年级班级
|
|
|
- csOptions() {
|
|
|
- let data = []
|
|
|
- if (this.filterPeriod && this.schoolBase.period.length && this.roomList.length) {
|
|
|
- let curPd = this.schoolBase.period.filter((item) => {
|
|
|
- return item.id == this.filterPeriod
|
|
|
- })
|
|
|
- if (curPd && curPd.length) {
|
|
|
- curPd[0].grades.forEach((item, index) => {
|
|
|
- let dataItem = {
|
|
|
- id: item.id,
|
|
|
- name: item.name,
|
|
|
- children: []
|
|
|
- }
|
|
|
- let child = this.roomList.filter(classItem => {
|
|
|
- return classItem.gradeId == item.id
|
|
|
- })
|
|
|
- dataItem.children = child
|
|
|
- data.push(dataItem)
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
- return data
|
|
|
- },
|
|
|
filterPeriodName() {
|
|
|
let data = this.schoolBase.period
|
|
|
let pId = this.filterPeriod
|
|
@@ -1624,7 +1493,7 @@ export default {
|
|
|
const ids = new Map()
|
|
|
return schds.filter(item => {
|
|
|
// return (item.classId || item.stulist) && (!ids.has(item.room) && ids.set(item.room, 1))
|
|
|
- return (item.classId && !ids.has(item.classId) && ids.set(item.classId, 1)) || (item.stulist && !ids.has(item.stulist) && ids.set(item.stulist, 1))
|
|
|
+ return (item.classId && !ids.has(item.classId) && ids.set(item.classId, 1)) || (item.stulist && !ids.has(item.stulist) && ids.set(item.stulist, 1))
|
|
|
})
|
|
|
} else {
|
|
|
return []
|
|
@@ -1640,7 +1509,6 @@ export default {
|
|
|
teaList() {
|
|
|
if (this.courseListShow && this.courseListShow[this.curCusIndex] && this.courseListShow[this.curCusIndex].schedule) {
|
|
|
let all = this.courseListShow[this.curCusIndex].schedule.map(item => {
|
|
|
- // return item.teacher
|
|
|
return {
|
|
|
id: item.teacherId,
|
|
|
name: item.teacherName
|
|
@@ -1652,7 +1520,14 @@ export default {
|
|
|
} else {
|
|
|
return []
|
|
|
}
|
|
|
- }
|
|
|
+ },
|
|
|
+ students() {
|
|
|
+ if (this.schdList && this.schdList[this.curClassIndex]) {
|
|
|
+ return this.schdList[this.curClassIndex].students
|
|
|
+ } else {
|
|
|
+ return []
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
watch: {
|
|
|
curCusIndex() {
|