|
@@ -8,14 +8,14 @@
|
|
|
<Option v-for="(item,index) in teachClassList" :key="index" :value="item.classroomCode">{{item.classroomName}}</Option>
|
|
|
<Option value="all">所有课程</Option>
|
|
|
</Select> -->
|
|
|
- <span class="label">班级: </span>
|
|
|
+ <!-- <span class="label">班级: </span>
|
|
|
<Select v-model="curClass" size="small" style="width: 150px;display:inline-block;">
|
|
|
<Option v-for="(item,index) in teachClassList" :key="index" :value="item.classroomCode">{{item.classroomName}}</Option>
|
|
|
<Option value="all">所有班级</Option>
|
|
|
- </Select>
|
|
|
+ </Select> -->
|
|
|
</div>
|
|
|
</div>
|
|
|
- <Table :columns="timeColumns" disabled-hover :data="timetable" border :span-method="handleSpan" style="width:calc(100% - 15px);margin-top:10px;">
|
|
|
+ <Table :columns="timeColumns" disabled-hover :data="timetable" border :span-method="handleSpan" style="width:calc(100% - 15px);margin-top:00px;">
|
|
|
<!--上午/下午-->
|
|
|
<template slot-scope="{ row, index }" slot="sub">
|
|
|
<p style="padding:10px 0px 4px 0px;font-size: 20px;">
|
|
@@ -35,8 +35,8 @@
|
|
|
<template slot-scope="{ row, index }" slot="MON">
|
|
|
<div :class="row.weeklies.MON.status == 1 ? 'week-day-cell':'week-day-cell vact-status'">
|
|
|
<div class="toggle-status-btn-wrap">
|
|
|
- <Icon class="cell-action-icon" type="ios-settings" title="设置课程" @click="showSetCus(row,'MON')" />
|
|
|
- <Icon v-if="row.weeklies.MON.courseName" class="cell-action-icon" type="md-trash" title="取消课程" @click="showCancelCus(row,'MON')" />
|
|
|
+ <Icon class="cell-action-icon" custom="iconfont icon-choose" title="设置课程" @click="selectCell(row,'MON')" />
|
|
|
+ <Icon v-if="row.weeklies.MON.courseName" class="cell-action-icon" type="md-close" title="取消课程" @click="cancelCell(row,'MON')" />
|
|
|
</div>
|
|
|
<p class="course-name" v-show="curClass == 'all' || curClass == row.weeklies.MON.classroomCode">{{row.weeklies.MON.courseName}}</p>
|
|
|
<p class="classroom-name" v-show="curClass == 'all' || curClass == row.weeklies.MON.classroomCode">{{row.weeklies.MON.classroomName}}</p>
|
|
@@ -46,8 +46,8 @@
|
|
|
<template slot-scope="{ row, index }" slot="TUE">
|
|
|
<div :class="row.weeklies.TUE.status == 1 ? 'week-day-cell':'week-day-cell vact-status'">
|
|
|
<div class="toggle-status-btn-wrap">
|
|
|
- <Icon class="cell-action-icon" type="ios-settings" title="设置课程" @click="showSetCus(row,'TUE')" />
|
|
|
- <Icon v-if="row.weeklies.TUE.courseName" class="cell-action-icon" type="md-trash" title="取消课程" @click="showCancelCus(row,'TUE')" />
|
|
|
+ <Icon class="cell-action-icon" custom="iconfont icon-choose" title="设置课程" @click="selectCell(row,'TUE')" />
|
|
|
+ <Icon v-if="row.weeklies.TUE.courseName" class="cell-action-icon" type="md-close" title="取消课程" @click="cancelCell(row,'TUE')" />
|
|
|
</div>
|
|
|
<p class="course-name" v-show="curClass == 'all' || curClass == row.weeklies.TUE.classroomCode">{{row.weeklies.TUE.courseName}}</p>
|
|
|
<p class="classroom-name" v-show="curClass == 'all' || curClass == row.weeklies.TUE.classroomCode">{{row.weeklies.TUE.classroomName}}</p>
|
|
@@ -57,8 +57,8 @@
|
|
|
<template slot-scope="{ row, index }" slot="WED">
|
|
|
<div :class="row.weeklies.WED.status == 1 ? 'week-day-cell':'week-day-cell vact-status'">
|
|
|
<div class="toggle-status-btn-wrap">
|
|
|
- <Icon class="cell-action-icon" type="ios-settings" title="设置课程" @click="showSetCus(row,'WED')" />
|
|
|
- <Icon v-if="row.weeklies.WED.courseName" class="cell-action-icon" type="md-trash" title="取消课程" @click="showCancelCus(row,'WED')" />
|
|
|
+ <Icon class="cell-action-icon" custom="iconfont icon-choose" title="设置课程" @click="selectCell(row,'WED')" />
|
|
|
+ <Icon v-if="row.weeklies.WED.courseName" class="cell-action-icon" type="md-close" title="取消课程" @click="cancelCell(row,'WED')" />
|
|
|
</div>
|
|
|
<p class="course-name" v-show="curClass == 'all' || curClass == row.weeklies.WED.classroomCode">{{row.weeklies.WED.courseName}}</p>
|
|
|
<p class="classroom-name" v-show="curClass == 'all' || curClass == row.weeklies.WED.classroomCode">{{row.weeklies.WED.classroomName}}</p>
|
|
@@ -68,8 +68,8 @@
|
|
|
<template slot-scope="{ row, index }" slot="THU">
|
|
|
<div :class="row.weeklies.THU.status == 1 ? 'week-day-cell':'week-day-cell vact-status'">
|
|
|
<div class="toggle-status-btn-wrap">
|
|
|
- <Icon class="cell-action-icon" type="ios-settings" title="设置课程" @click="showSetCus(row,'THU')" />
|
|
|
- <Icon v-if="row.weeklies.THU.courseName" class="cell-action-icon" type="md-trash" title="取消课程" @click="showCancelCus(row,'THU')" />
|
|
|
+ <Icon class="cell-action-icon" custom="iconfont icon-choose" title="设置课程" @click="selectCell(row,'THU')" />
|
|
|
+ <Icon v-if="row.weeklies.THU.courseName" class="cell-action-icon" type="md-close" title="取消课程" @click="cancelCell(row,'THU')" />
|
|
|
</div>
|
|
|
<p class="course-name" v-show="curClass == 'all' || curClass == row.weeklies.THU.classroomCode">{{row.weeklies.THU.courseName}}</p>
|
|
|
<p class="classroom-name" v-show="curClass == 'all' || curClass == row.weeklies.THU.classroomCode">{{row.weeklies.THU.classroomName}}</p>
|
|
@@ -79,8 +79,8 @@
|
|
|
<template slot-scope="{ row, index }" slot="FRI">
|
|
|
<div :class="row.weeklies.FRI.status == 1 ? 'week-day-cell':'week-day-cell vact-status'">
|
|
|
<div class="toggle-status-btn-wrap">
|
|
|
- <Icon class="cell-action-icon" type="ios-settings" title="设置课程" @click="showSetCus(row,'FRI')" />
|
|
|
- <Icon v-if="row.weeklies.FRI.courseName" class="cell-action-icon" type="md-trash" title="取消课程" @click="showCancelCus(row,'FRI')" />
|
|
|
+ <Icon class="cell-action-icon" custom="iconfont icon-choose" title="设置课程" @click="selectCell(row,'FRI')" />
|
|
|
+ <Icon v-if="row.weeklies.FRI.courseName" class="cell-action-icon" type="md-close" title="取消课程" @click="cancelCell(row,'FRI')" />
|
|
|
</div>
|
|
|
<p class="course-name" v-show="curClass == 'all' || curClass == row.weeklies.FRI.classroomCode">{{row.weeklies.FRI.courseName}}</p>
|
|
|
<p class="classroom-name" v-show="curClass == 'all' || curClass == row.weeklies.FRI.classroomCode">{{row.weeklies.FRI.classroomName}}</p>
|
|
@@ -110,6 +110,17 @@ export default {
|
|
|
periodId: {
|
|
|
type: String,
|
|
|
default: ''
|
|
|
+ },
|
|
|
+ //课程对象数据
|
|
|
+ schedData: {
|
|
|
+ type: Array,
|
|
|
+ default: () => {
|
|
|
+ return []
|
|
|
+ }
|
|
|
+ },
|
|
|
+ teacher:{
|
|
|
+ type: String,
|
|
|
+ default:''
|
|
|
}
|
|
|
},
|
|
|
data() {
|
|
@@ -120,7 +131,7 @@ export default {
|
|
|
schoolBase: {
|
|
|
period: []
|
|
|
},
|
|
|
- tableData: [],
|
|
|
+ classList: [],
|
|
|
timeColumns: [
|
|
|
{
|
|
|
title: ' ',
|
|
@@ -174,11 +185,13 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- showSetCus(){
|
|
|
-
|
|
|
+ selectCell(row, col) {
|
|
|
+ console.log(row, col)
|
|
|
+ this.$emit('selectCell', { row, col })
|
|
|
},
|
|
|
- showCancelCus(){
|
|
|
-
|
|
|
+ cancelCell(row, col) {
|
|
|
+ console.log(row, col)
|
|
|
+ this.$emit('cancelCell', { row, col })
|
|
|
},
|
|
|
//根据上下午合并单元格
|
|
|
handleSpan({ row, column, rowIndex, columnIndex }) {
|
|
@@ -208,6 +221,7 @@ export default {
|
|
|
this.$store.dispatch('user/getSchoolProfile').then(
|
|
|
res => {
|
|
|
this.schoolBase = res.school_base
|
|
|
+ this.classList = res.school_classes
|
|
|
},
|
|
|
err => {
|
|
|
this.$Message.warning(this.$t('cusMgt.noSchool'))
|
|
@@ -243,7 +257,31 @@ export default {
|
|
|
SAT: {},
|
|
|
SUN: {},
|
|
|
}
|
|
|
+ this.schedData.forEach(cusItem => {
|
|
|
+ if (cusItem && cusItem.schedule) {
|
|
|
+ cusItem.schedule.forEach((schedItem, sIndex) => {
|
|
|
+ let classInfo = this.classList.find(classItem => {
|
|
|
+ return classItem.id == schedItem.classId
|
|
|
+ })
|
|
|
+ if(this.teacher){
|
|
|
+ if(this.teacher != schedItem.teacher.id){
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ schedItem.time.forEach(timeItem => {
|
|
|
+ if (timeItem.id == item.id) {
|
|
|
+ console.log('1212', timeItem)
|
|
|
+ item.weeklies[timeItem.week].courseName = cusItem.name
|
|
|
+
|
|
|
+ item.weeklies[timeItem.week].classroomName = classInfo ? classInfo.name : '暂无数据'
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
})
|
|
|
+ console.log('timetable', timetable)
|
|
|
return timetable
|
|
|
} else {
|
|
|
return []
|