|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<div class="my-course-container dark-iview-split">
|
|
|
<Loading v-if="listLoading" bgColor="rgba(103, 103, 103, 0.27)"></Loading>
|
|
|
- <Split v-model="split1">
|
|
|
+ <Split v-show="!isShowSchd" v-model="split1">
|
|
|
<!--课程列表-->
|
|
|
<div class="course-list" slot="left">
|
|
|
<!--列表内容-->
|
|
@@ -13,6 +13,7 @@
|
|
|
<div style="margin-top:5px;">
|
|
|
<Icon type="md-add" v-show="listType == 'private'" class="add-icon" :title="$t('cusMgt.addCus')" @click="addCusStatus = true" />
|
|
|
<Icon type="md-create" v-show="(listType == 'school' && courseListS.length) || (listType == 'private' && courseListP.length) " class="add-icon" :title="$t('cusMgt.editCus')" @click="editCus()" />
|
|
|
+ <Icon custom="iconfont icon-schedule" v-show="listType == 'school' && courseListS.length" class="add-icon" title="课表模式" @click="showSchedule" />
|
|
|
<Icon type="md-trash" v-show="listType == 'private'" class="add-icon" :title="$t('cusMgt.delCus')" @click="delCourse" />
|
|
|
</div>
|
|
|
</transition>
|
|
@@ -211,6 +212,42 @@
|
|
|
</Split>
|
|
|
</div>
|
|
|
</Split>
|
|
|
+ <div v-show="isShowSchd" class="priv-table-wrap">
|
|
|
+ <vuescroll>
|
|
|
+ <div class="table-header dark-iview-select">
|
|
|
+ <span v-show="cusPd.length > 1">学段:</span>
|
|
|
+ <Select v-model="curPd" style="width:200px" v-show="cusPd.length > 1">
|
|
|
+ <Option v-for="item in cusPd" :value="item.id" :key="item.id">{{ item.name }}</Option>
|
|
|
+ </Select>
|
|
|
+ <div class="cus-tips-wrap">
|
|
|
+ <Tooltip v-show="noClassCus.length">
|
|
|
+ <div slot="content">
|
|
|
+ <p v-for="(item,index) in noClassCus" :key="index">
|
|
|
+ {{`${index+1}.${item.name}`}}
|
|
|
+ </p>
|
|
|
+ </div>
|
|
|
+ <span class="no-class-tips">课程未安排教室:{{`${noClassCus.length}/${schdData.length}`}}</span>
|
|
|
+ </Tooltip>
|
|
|
+ <Tooltip v-show="noTimeCus.length" style="margin-left:15px;">
|
|
|
+ <div slot="content">
|
|
|
+ <p v-for="(item,index) in noTimeCus" :key="index">
|
|
|
+ {{`${index+1}.${item.name}`}}
|
|
|
+ </p>
|
|
|
+ </div>
|
|
|
+ <span class="no-time-tips">课程未设时间:{{`${noTimeCus.length}/${schdData.length}`}}</span>
|
|
|
+ </Tooltip>
|
|
|
+ </div>
|
|
|
+ <div class="action-btn-wrap">
|
|
|
+ <span @click="isShowSchd = !isShowSchd">
|
|
|
+ <Icon type="md-list" />
|
|
|
+ 列表模式
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </div>
|
|
|
+ <TeaTable :schedData="schdData" :teacher="$store.state.userInfo.TEAMModelId" :periodId="curPd" mode="view"></TeaTable>
|
|
|
+ </vuescroll>
|
|
|
+ </div>
|
|
|
<Drawer :title="$t('cusMgt.cusInfo')" 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">
|
|
@@ -274,9 +311,10 @@ import QRCode from 'qrcodejs2'
|
|
|
import PersonalPhoto from '@/components/public/personalPhoto/Index.vue'
|
|
|
import E from '@/utils/wangEditor.js'
|
|
|
import StudentList from '@/components/coursemgt/StudentList.vue'
|
|
|
+import TeaTable from './TeaTable.vue'
|
|
|
export default {
|
|
|
components: {
|
|
|
- StudentList, PersonalPhoto
|
|
|
+ StudentList, PersonalPhoto, TeaTable
|
|
|
},
|
|
|
data() {
|
|
|
// 验证只能是字母和数字
|
|
@@ -292,6 +330,11 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
return {
|
|
|
+ curPd: '',
|
|
|
+ isShowSchd: false,
|
|
|
+ schoolBase: {
|
|
|
+ period: []
|
|
|
+ },
|
|
|
split1: 0.2,
|
|
|
split2: 0.2,
|
|
|
acTypeList: [
|
|
@@ -425,6 +468,81 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ //显示课表模式
|
|
|
+ showSchedule() {
|
|
|
+ let promises = []
|
|
|
+ this.listLoading = true
|
|
|
+ this.isShowSchd = !this.isShowSchd
|
|
|
+ this.courseListS.forEach(item => {
|
|
|
+ let requestData = {
|
|
|
+ 'code': this.$store.state.userInfo.schoolCode,
|
|
|
+ 'scope': 'school',
|
|
|
+ 'id': item.id
|
|
|
+ }
|
|
|
+ promises.push(this.$api.courseMgmt.findCusInfo(requestData))
|
|
|
+ })
|
|
|
+ Promise.all(promises).then(
|
|
|
+ resAll => {
|
|
|
+ console.log('resALL', resAll)
|
|
|
+ resAll.forEach(async (res, index) => {
|
|
|
+ if (res.courses && res.courses.length > 0) {
|
|
|
+ res.courses[0].schedule = res.courses[0].schedule ? res.courses[0].schedule : []
|
|
|
+ //过滤当前教师的schedule
|
|
|
+ res.courses[0].schedule = res.courses[0].schedule.filter(item => {
|
|
|
+ return item.teacherId == this.$store.state.userInfo.TEAMModelId
|
|
|
+ })
|
|
|
+ console.log(res.courses[0].schedule)
|
|
|
+ // 获取自定义名单信息
|
|
|
+ let ids = res.courses[0].schedule.map(item => {
|
|
|
+ return item.stulist
|
|
|
+ })
|
|
|
+ for (let i = 0; i < ids.length; i++) {
|
|
|
+ if (!ids[i]) {
|
|
|
+ ids.splice(i, 1)
|
|
|
+ i--
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (ids.length) {
|
|
|
+ try {
|
|
|
+ let listRes = await this.getListInfo([...ids])
|
|
|
+ if (listRes) this.stuList.push(...listRes.stuList)
|
|
|
+ } catch (e) {
|
|
|
+ this.$Message.error('获取自定义名单失败')
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ res.courses[0].schedule.forEach(item => {
|
|
|
+ //补充教室信息
|
|
|
+ if (item.classId) {
|
|
|
+ let classInfo = this.classList.find(classItem => {
|
|
|
+ return classItem.id == item.classId
|
|
|
+ })
|
|
|
+ item.classInfo = {
|
|
|
+ id: item.classId,
|
|
|
+ name: classInfo ? classInfo.name : '--'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //补充名单信息
|
|
|
+ if (ids.length && item.stulist) {
|
|
|
+ let listInfo = this.stuList.find(listItem => {
|
|
|
+ return listItem.id == item.stulist
|
|
|
+ })
|
|
|
+ item.listName = listInfo ? listInfo.name : '未找到对应名单'
|
|
|
+ item.students = listInfo ? listInfo.students : []
|
|
|
+ item.fullStu = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ this.$set(this.courseListS, index, res.courses[0])
|
|
|
+ })
|
|
|
+ },
|
|
|
+ err => {
|
|
|
+ this.$Message.error('API ERROR')
|
|
|
+ }
|
|
|
+ ).finally(() => {
|
|
|
+ this.listLoading = false
|
|
|
+ })
|
|
|
+ },
|
|
|
//获取学生名单
|
|
|
getStuList() {
|
|
|
this.tabName = 'stus'
|
|
@@ -713,7 +831,7 @@ export default {
|
|
|
let index = _this.curClassIndex
|
|
|
_this.curClassIndex = 0
|
|
|
_this.courseListShow[_this.curCusIndex].schedule.splice(index, 1)
|
|
|
- _this.updCusInfo()
|
|
|
+ _this.updCusInfo()
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -733,7 +851,7 @@ export default {
|
|
|
this.baseEditStatus = !this.baseEditStatus
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
//初始化富文本编辑器
|
|
|
initEditor() {
|
|
|
if (!this.noticeEditor) {
|
|
@@ -753,7 +871,7 @@ export default {
|
|
|
'link', // 插入链接
|
|
|
'image' // 插入图片
|
|
|
],
|
|
|
- noticeEditor.customConfig.showLinkImg = false
|
|
|
+ noticeEditor.customConfig.showLinkImg = false
|
|
|
noticeEditor.customConfig.uploadFileName = 'files'
|
|
|
noticeEditor.create()
|
|
|
noticeEditor.txt.html(this.listType == 'school' ? this.courseListS[this.curCusIndex][0].notice : this.courseListP[this.curCusIndex].notice)
|
|
@@ -832,7 +950,7 @@ export default {
|
|
|
stulist: stuList.id,
|
|
|
teacherId: this.$store.state.userInfo.TEAMModelId,
|
|
|
teacherName: this.$store.state.userInfo.name,
|
|
|
- time:[]
|
|
|
+ time: []
|
|
|
})
|
|
|
this.updCusInfo()
|
|
|
},
|
|
@@ -956,7 +1074,7 @@ export default {
|
|
|
}
|
|
|
).catch(() => {
|
|
|
this.$Message.error('更新失败')
|
|
|
- }).finally(()=>{
|
|
|
+ }).finally(() => {
|
|
|
this.listLoading = false
|
|
|
})
|
|
|
},
|
|
@@ -1010,6 +1128,11 @@ export default {
|
|
|
if (!res.error) {
|
|
|
if (res.courses && res.courses.length > 0) {
|
|
|
res.courses[0].schedule = res.courses[0].schedule ? res.courses[0].schedule : []
|
|
|
+ //过滤当前教师的schedule
|
|
|
+ res.courses[0].schedule = res.courses[0].schedule.filter(item => {
|
|
|
+ return item.teacherId == this.$store.state.userInfo.TEAMModelId
|
|
|
+ })
|
|
|
+ console.log(res.courses[0].schedule)
|
|
|
// 获取自定义名单信息
|
|
|
let ids = res.courses[0].schedule.map(item => {
|
|
|
return item.stulist
|
|
@@ -1059,7 +1182,7 @@ export default {
|
|
|
this.changeClassroom(0)
|
|
|
}
|
|
|
}
|
|
|
- ).finally(()=>{
|
|
|
+ ).finally(() => {
|
|
|
this.listLoading = false
|
|
|
})
|
|
|
},
|
|
@@ -1077,6 +1200,7 @@ export default {
|
|
|
//直接读取登录成功拿到得学校基础信息
|
|
|
this.$store.dispatch('user/getSchoolProfile').then(res => {
|
|
|
this.classList = res.school_classes
|
|
|
+ this.schoolBase = res.school_base
|
|
|
this.getCourseList()
|
|
|
})
|
|
|
|
|
@@ -1086,6 +1210,53 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
computed: {
|
|
|
+ //课程学段
|
|
|
+ cusPd() {
|
|
|
+ let pds = this.courseListS.map(item => {
|
|
|
+ return item.period
|
|
|
+ })
|
|
|
+ let res = []
|
|
|
+ pds.forEach(item => {
|
|
|
+ let r = res.find(resItem => {
|
|
|
+ return item.id == resItem.id
|
|
|
+ })
|
|
|
+ if (!r) {
|
|
|
+ res.push(item)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if (res.length) {
|
|
|
+ this.curPd = res[0].id
|
|
|
+ }
|
|
|
+ return res
|
|
|
+ },
|
|
|
+ //课程表当前显示的课程
|
|
|
+ schdData() {
|
|
|
+ let pdCus = []
|
|
|
+ pdCus = this.courseListS.filter(item => {
|
|
|
+ return item.period.id == this.curPd && item.schedule
|
|
|
+ })
|
|
|
+ console.log(pdCus)
|
|
|
+ return pdCus
|
|
|
+ },
|
|
|
+ //无教室课程
|
|
|
+ noClassCus() {
|
|
|
+ console.log(this.schdData)
|
|
|
+ return this.schdData.filter(item => {
|
|
|
+ let res = item.schedule.find(schdItem => {
|
|
|
+ return schdItem.classId && schdItem.teacherId == this.$store.state.userInfo.TEAMModelId
|
|
|
+ })
|
|
|
+ return !res
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //无时段课程
|
|
|
+ noTimeCus() {
|
|
|
+ return this.schdData.filter(item => {
|
|
|
+ let res = item.schedule.find(schdItem => {
|
|
|
+ return (schdItem.time && schdItem.time.length) && schdItem.teacherId == this.$store.state.userInfo.TEAMModelId
|
|
|
+ })
|
|
|
+ return !res
|
|
|
+ })
|
|
|
+ },
|
|
|
//是否为默认名单
|
|
|
isDefList() {
|
|
|
if (this.teaClassList[this.curClassIndex] && this.teaClassList[this.curClassIndex].stulist) {
|
|
@@ -1113,16 +1284,16 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
//当前班级活动列表
|
|
|
- acList(){
|
|
|
+ acList() {
|
|
|
let list = []
|
|
|
let id = this.teaClassList[this.curClassIndex] ? this.teaClassList[this.curClassIndex].stulist || this.teaClassList[this.curClassIndex].classId : ''
|
|
|
- if(!id){
|
|
|
+ if (!id) {
|
|
|
return []
|
|
|
}
|
|
|
switch (this.curAcType) {
|
|
|
case 'ev':
|
|
|
- list = this.evList.filter(item=>{
|
|
|
- return item.targetClassIds.indexOf(id) > -1
|
|
|
+ list = this.evList.filter(item => {
|
|
|
+ return item.classes.indexOf(id) > -1
|
|
|
})
|
|
|
break
|
|
|
case 'vote':
|