|
@@ -43,7 +43,7 @@
|
|
|
</div>
|
|
|
<div class="cus-list-content">
|
|
|
<vuescroll>
|
|
|
- <div v-for="(item,index) in courseListShow" :key="index" @click="curCusIndex = index" :class="['block-bg','cus-item',curCusIndex == index ? 'block-bg-active':'']">
|
|
|
+ <div v-for="(item,index) in courseListShow" :key="index" @click="selectCus(index)" :class="['block-bg','cus-item',curCusIndex == index ? 'block-bg-active':'']">
|
|
|
<p class="cus-name">
|
|
|
<span class="cus-id">
|
|
|
{{item.no}}
|
|
@@ -67,7 +67,7 @@
|
|
|
<div slot="left" class="teacher-list">
|
|
|
<div class="teacher-list-header">
|
|
|
<span>教师</span>
|
|
|
- <Icon type="md-add" size="16" class="tea-action-icon" @click="isAddStuList = true" />
|
|
|
+ <Icon type="md-add" size="16" class="tea-action-icon" @click="addTeaStatus = true" />
|
|
|
<Icon type="md-trash" size="16" class="tea-action-icon" @click="removeTeacher" />
|
|
|
</div>
|
|
|
<div class="tea-list-content">
|
|
@@ -84,7 +84,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- 上课名单、上课时段设置 -->
|
|
|
- <div slot="right" class="class-setting" v-show="!isAddStuList">
|
|
|
+ <div slot="right" class="class-setting" v-show="!isAddStuList && !addTeaStatus">
|
|
|
<div class="teacher-list-header">
|
|
|
<span @click="curTab = 0" :class="curTab == 0 ? 'tab-label line-bottom line-bottom-active':'tab-label line-bottom'">
|
|
|
课程名单
|
|
@@ -174,7 +174,7 @@
|
|
|
</Table>
|
|
|
</div>
|
|
|
</Split>
|
|
|
- <EmptyData v-show="schdList.length == 0" textContent="暂无课程名单,请先前往添加名单"></EmptyData>
|
|
|
+ <EmptyData v-show="schdList.length == 0" textContent="暂无课程名单,请添加名单"></EmptyData>
|
|
|
</div>
|
|
|
<!-- 教师课表 -->
|
|
|
<vuescroll v-show="curTab == 1">
|
|
@@ -193,7 +193,7 @@
|
|
|
<div slot="right" class="class-setting dark-el-cascader dark-iview-select dark-iview-table" v-show="isAddStuList">
|
|
|
<div class="add-list-header">
|
|
|
<!-- <span class="add-list-label">教师:</span>
|
|
|
- <Select ref="sltStuList" clearable label-in-value v-model="schedule.teacher.id" style="width:200px;margin-right:30px" size="small" @on-change="setTeaName">
|
|
|
+ <Select ref="sltStuList" clearable label-in-value v-model="schedule.teacherId" style="width:200px;margin-right:30px" size="small" @on-change="setTeaName">
|
|
|
<Option v-for="(item,index) in $store.state.teachers.teacherList" :value="item.id" :key="index">{{ item.name }}</Option>
|
|
|
</Select> -->
|
|
|
<span class="add-list-label">教室:</span>
|
|
@@ -244,6 +244,32 @@
|
|
|
</template>
|
|
|
</Table>
|
|
|
</div>
|
|
|
+ <!-- 添加授课教师UI -->
|
|
|
+ <div slot="right" class="class-setting dark-iview-input dark-iview-table" v-show="addTeaStatus">
|
|
|
+ <vuescroll>
|
|
|
+ <div class="add-tea-header">
|
|
|
+ <Input search placeholder="" 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" />
|
|
|
+ <span>确认添加</span>
|
|
|
+ </span>
|
|
|
+ <span class="action-btn" @click="cancelAddTea">
|
|
|
+ <Icon type="md-close" size="16" />
|
|
|
+ <span>取消添加</span>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <Table :columns="teaCol" :data="teacherList" style="margin-top:10px" @on-selection-change="(selection)=>{sltTeachers = selection}">
|
|
|
+ <template slot-scope="{ row }" slot="picture">
|
|
|
+ <PersonalPhoto :name="row.name" :picture="row.picture" />
|
|
|
+ </template>
|
|
|
+ <template slot-scope="{ row }" slot="job">
|
|
|
+ <span>{{row.job || '--'}}</span>
|
|
|
+ </template>
|
|
|
+ </Table>
|
|
|
+ </vuescroll>
|
|
|
+ </div>
|
|
|
</Split>
|
|
|
</div>
|
|
|
</Split>
|
|
@@ -270,23 +296,14 @@
|
|
|
</Option>
|
|
|
</Select>
|
|
|
</FormItem>
|
|
|
- <!-- <FormItem :label="$t('cusMgt.cusTeachers')" prop="teachers">
|
|
|
- <Select label-in-value multiple v-model="teacherId" :placeholder="$t('cusMgt.teacherHolder')" :max-tag-count="3" filterable @on-change="getTeahcers">
|
|
|
- <Option v-for="(item,index) in $store.state.teachers.teacherList" :value="item.id" :key="index">{{ item.name }}</Option>
|
|
|
- </Select>
|
|
|
- </FormItem> -->
|
|
|
</Form>
|
|
|
</Modal>
|
|
|
<!-- 添加授课教师 -->
|
|
|
- <Modal v-model="addTeaStatus" title="添加教师" class-name="dark-iview-modal dark-iview-select" @on-ok="confirmAddTea">
|
|
|
+ <!-- <Modal v-model="addTeaStatus" title="添加教师" class-name="dark-iview-modal dark-iview-select" @on-ok="confirmAddTea">
|
|
|
<Select ref="addTea" label-in-value multiple clearable :placeholder="$t('cusMgt.teacherHolder')" :max-tag-count="3" filterable @on-change="seltChange">
|
|
|
<Option v-for="(item,index) in $store.state.teachers.teacherList" :value="item.id" :key="index">{{ item.name }}</Option>
|
|
|
</Select>
|
|
|
- </Modal>
|
|
|
- <!-- 创建名单 -->
|
|
|
- <Modal v-model="addStuStatus" :title="$t('cusMgt.addStu')" width="1200" @on-ok="confirmAddStu" class-name="dark-iview-modal">
|
|
|
- <StudentList @getSelectInfo="(selction)=>{selections = selction}"></StudentList>
|
|
|
- </Modal>
|
|
|
+ </Modal> -->
|
|
|
<!-- 时段设置 -->
|
|
|
<Drawer title="时段设置" class-name="dark-iview-drawer" :closable="false" v-model="showTime" :width="450">
|
|
|
<TimeSetting :periodId="filterPeriod"></TimeSetting>
|
|
@@ -332,6 +349,36 @@ export default {
|
|
|
preStus: [],
|
|
|
stuList: [],
|
|
|
isDefault: true,
|
|
|
+ teacherList: [],
|
|
|
+ sltTeachers: [],
|
|
|
+ teaCol: [
|
|
|
+ {
|
|
|
+ type: 'selection',
|
|
|
+ width: 60,
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: ' ',
|
|
|
+ slot: 'picture',
|
|
|
+ align: 'center ',
|
|
|
+ width: '120'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '姓名',
|
|
|
+ key: 'name',
|
|
|
+ align: 'center '
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: 'id',
|
|
|
+ key: 'id',
|
|
|
+ align: 'center '
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '职位',
|
|
|
+ slot: 'job',
|
|
|
+ align: 'center '
|
|
|
+ }
|
|
|
+ ],
|
|
|
classColumn: [
|
|
|
{
|
|
|
title: ' ',
|
|
@@ -392,7 +439,6 @@ export default {
|
|
|
align: 'center'
|
|
|
},
|
|
|
],
|
|
|
- addTeachers: [],
|
|
|
curClassIndex: 0,
|
|
|
hasTimeTable: false,
|
|
|
selections: [],
|
|
@@ -408,7 +454,6 @@ export default {
|
|
|
schoolBase: {
|
|
|
period: []
|
|
|
},
|
|
|
- teacherId: [],
|
|
|
actionType: 0, //0新增 1编辑
|
|
|
delCusList: [],
|
|
|
courseBaseInfo: {
|
|
@@ -449,23 +494,22 @@ export default {
|
|
|
id: '',
|
|
|
name: ''
|
|
|
},
|
|
|
- teacher: {
|
|
|
- id: '',
|
|
|
- name: ''
|
|
|
- },
|
|
|
+ teacherId:'',
|
|
|
+ teacherName:'',
|
|
|
stulist: '',
|
|
|
- time: [
|
|
|
- // {
|
|
|
- // week: "Mon",
|
|
|
- // start: "8:00",
|
|
|
- // end: "8:40"
|
|
|
- // }
|
|
|
- ],
|
|
|
+ time: [],
|
|
|
notice: ''
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ selectCus(index) {
|
|
|
+ this.selectClass(0)
|
|
|
+ this.selectTea(0)
|
|
|
+ this.cancelAddTea()
|
|
|
+ this.cancelAddSchd()
|
|
|
+ this.curCusIndex = index
|
|
|
+ },
|
|
|
selectTab(index) {
|
|
|
this.curTab = index
|
|
|
this.setDefClass()
|
|
@@ -483,14 +527,17 @@ export default {
|
|
|
},
|
|
|
//设置课程时段
|
|
|
selectCell(data) {
|
|
|
- console.log('data', data)
|
|
|
let teacher = this.teaList[this.curTeaIndex] ? this.teaList[this.curTeaIndex].id : ''
|
|
|
if (!teacher) {
|
|
|
this.$Message.warning("暂无教师信息,无法完成课程时段设置")
|
|
|
return
|
|
|
}
|
|
|
+ if (!data.setClass) {
|
|
|
+ this.$Message.warning("暂无教室信息,无法完成课程时段设置")
|
|
|
+ return
|
|
|
+ }
|
|
|
let schedule = this.courseListShow[this.curCusIndex].schedule.find(item => {
|
|
|
- return item.classId == data.setClass && item.teacher.id == this.teaList[this.curTeaIndex].id
|
|
|
+ return item.classId == data.setClass && item.teacherId == this.teaList[this.curTeaIndex].id
|
|
|
})
|
|
|
if (schedule) {
|
|
|
schedule.time.push({
|
|
@@ -503,7 +550,7 @@ export default {
|
|
|
//取消课程时段设置
|
|
|
cancelCell(data) {
|
|
|
let schedule = this.courseListShow[this.curCusIndex].schedule.find(item => {
|
|
|
- return item.classId == data.setClass && item.teacher.id == this.teaList[this.curTeaIndex].id
|
|
|
+ return item.classId == data.setClass && item.teacherId == this.teaList[this.curTeaIndex].id
|
|
|
})
|
|
|
if (schedule) {
|
|
|
for (let index in schedule.time) {
|
|
@@ -529,7 +576,8 @@ export default {
|
|
|
//设置默认授课老师
|
|
|
setDefaultTea() {
|
|
|
this.isAddStuList = true
|
|
|
- this.schedule.teacher = this.teaList[this.curTeaIndex]
|
|
|
+ this.schedule.teacherId = this.teaList[this.curTeaIndex].id
|
|
|
+ this.schedule.teacherName = this.teaList[this.curTeaIndex].name
|
|
|
},
|
|
|
//查询名单列表
|
|
|
findStuList() {
|
|
@@ -546,7 +594,7 @@ export default {
|
|
|
}
|
|
|
)
|
|
|
},
|
|
|
- //教室列表
|
|
|
+ //选择教室列表
|
|
|
selectClass(index) {
|
|
|
this.curClassIndex = index
|
|
|
this.setIsDefault()
|
|
@@ -610,17 +658,8 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- //下拉选择授课教师,并设置教师名称
|
|
|
- setTeaName(data) {
|
|
|
- console.log(data)
|
|
|
- if (data) {
|
|
|
- this.schedule.teacher.name = data.label
|
|
|
- console.log(this.schedule)
|
|
|
- }
|
|
|
- },
|
|
|
//设置教室名称
|
|
|
setClassName(data, option) {
|
|
|
- console.log(data, option)
|
|
|
let curClass = this.classList.find(item => {
|
|
|
return item.id == data
|
|
|
})
|
|
@@ -639,8 +678,8 @@ export default {
|
|
|
this.$api.schoolSetting.getClassroomStudent(params).then(
|
|
|
(res) => {
|
|
|
if (!res.error) {
|
|
|
- this.preStus = res.classrooms[0] ? res.classrooms[0].students : []
|
|
|
- curClass.students = res.classrooms[0] ? res.classrooms[0].students : []
|
|
|
+ this.preStus = res.stus.length ? res.stus[0] : []
|
|
|
+ curClass.students = res.stus.length ? res.stus[0] : []
|
|
|
} else {
|
|
|
this.$Message.error('API error!')
|
|
|
}
|
|
@@ -655,25 +694,27 @@ export default {
|
|
|
this.isUpd = true
|
|
|
if (curClass) this.schdList[this.curClassIndex].classInfo.name = curClass.name
|
|
|
}
|
|
|
-
|
|
|
- console.log(this)
|
|
|
},
|
|
|
//确认添加名单
|
|
|
confirmAddSchd() {
|
|
|
- if (!this.schedule.teacher.id) {
|
|
|
+ if (!this.schedule.teacherId) {
|
|
|
this.$Message.warning('请设置授课老师')
|
|
|
return
|
|
|
}
|
|
|
- if (!(this.schedule.classInfo.id || this.schedule.stulist)) {
|
|
|
+ if (!(this.schedule.classId || this.schedule.stulist)) {
|
|
|
this.$Message.warning('请设置教室或者名单')
|
|
|
return
|
|
|
}
|
|
|
+ this.courseListShow[this.curCusIndex].schedule.forEach((item, index) => {
|
|
|
+ if (item.teacherId == this.schedule.teacherId && !item.stulist && !item.classId) {
|
|
|
+ this.courseListShow[this.curCusIndex].schedule.splice(index, 1)
|
|
|
+ }
|
|
|
+ })
|
|
|
this.courseListShow[this.curCusIndex].schedule.push(this.schedule)
|
|
|
- console.log(this.courseListShow[this.curCusIndex])
|
|
|
this.isAddStuList = false
|
|
|
this.updCusInfo()
|
|
|
this.initSchedule()
|
|
|
- this.selectTea(0)
|
|
|
+ // this.selectTea(0)
|
|
|
},
|
|
|
//取消添加Schd
|
|
|
cancelAddSchd() {
|
|
@@ -687,41 +728,40 @@ export default {
|
|
|
id: '',
|
|
|
name: ''
|
|
|
},
|
|
|
- teacher: {
|
|
|
- id: '',
|
|
|
- name: ''
|
|
|
- },
|
|
|
+ teacherId:'',
|
|
|
+ teacherName:'',
|
|
|
stulist: '',
|
|
|
time: [],
|
|
|
notice: ''
|
|
|
}
|
|
|
},
|
|
|
- // // (废弃)
|
|
|
- // seltChange(data) {
|
|
|
- // this.addTeachers = data
|
|
|
- // },
|
|
|
- // //确认添加教师 (废弃)
|
|
|
- // confirmAddTea() {
|
|
|
- // let teachers = this.addTeachers.map(item => {
|
|
|
- // return {
|
|
|
- // id: item.value,
|
|
|
- // name: item.label
|
|
|
- // }
|
|
|
- // })
|
|
|
- // let ids = this.courseListShow[this.curCusIndex].teachers.map(item => {
|
|
|
- // return item.id
|
|
|
- // })
|
|
|
- // let isUpd = false
|
|
|
- // teachers.forEach(item => {
|
|
|
- // if (ids.indexOf(item.id) == -1) {
|
|
|
- // this.courseListShow[this.curCusIndex].teachers.push(item)
|
|
|
- // isUpd = true
|
|
|
- // }
|
|
|
- // })
|
|
|
- // this.addTeachers = []
|
|
|
- // this.$refs['addTea'].clearSingleSelect()
|
|
|
- // if (isUpd) this.updCusInfo()
|
|
|
- // },
|
|
|
+ //取消添加老师
|
|
|
+ cancelAddTea() {
|
|
|
+ this.addTeaStatus = false
|
|
|
+ },
|
|
|
+ //确认添加教师
|
|
|
+ confirmAddTea() {
|
|
|
+ this.addTeaStatus = false
|
|
|
+ if (this.sltTeachers.length > 0) {
|
|
|
+ let ids = this.teaList.map(item => {
|
|
|
+ return item.id
|
|
|
+ })
|
|
|
+ this.sltTeachers.forEach(item => {
|
|
|
+ if (ids.indexOf(item.id) == -1) {
|
|
|
+ this.courseListShow[this.curCusIndex].schedule.push({
|
|
|
+ classId: '',
|
|
|
+ teacherName: item.name,
|
|
|
+ teacherId: item.id,
|
|
|
+ stulist: '',
|
|
|
+ time: [],
|
|
|
+ notice: ''
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.updCusInfo()
|
|
|
+ this.sltTeachers = []
|
|
|
+ }
|
|
|
+ },
|
|
|
// 更新课程数据
|
|
|
updCusInfo() {
|
|
|
this.courseListShow[this.curCusIndex].code = this.courseListShow[this.curCusIndex].code.replace('Course-', '')
|
|
@@ -733,7 +773,6 @@ export default {
|
|
|
res => {
|
|
|
this.$Message.success('更新成功')
|
|
|
this.isUpd = false
|
|
|
- // this.$Modal.remove()
|
|
|
}
|
|
|
).catch(() => {
|
|
|
this.$Message.error('更新失败')
|
|
@@ -743,8 +782,7 @@ export default {
|
|
|
removeStuList() {
|
|
|
this.$Modal.confirm({
|
|
|
title: '移除名单',
|
|
|
- content: `是否确认移除${this.schdList[this.curClassIndex].className || this.schdList[this.curClassIndex].listName}?`,
|
|
|
- // loading:true,
|
|
|
+ content: `是否确认移除${this.schdList[this.curClassIndex].listName || this.schdList[this.curClassIndex].classInfo.name }?`,
|
|
|
onOk: () => {
|
|
|
for (let i in this.courseListShow[this.curCusIndex].schedule) {
|
|
|
let curSchd = this.schdList[this.curClassIndex]
|
|
@@ -755,9 +793,6 @@ export default {
|
|
|
}
|
|
|
this.updCusInfo()
|
|
|
this.selectClass(0)
|
|
|
- },
|
|
|
- onCancel: () => {
|
|
|
- // this.$Message.info('Clicked cancel')
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -769,12 +804,12 @@ export default {
|
|
|
onOk: () => {
|
|
|
let curTeacher = this.teaList[this.curTeaIndex]
|
|
|
for (let i in this.courseListShow[this.curCusIndex].schedule) {
|
|
|
- if (this.courseListShow[this.curCusIndex].schedule[i].teacher.id == curTeacher.id) {
|
|
|
+ if (this.courseListShow[this.curCusIndex].schedule[i].teacherId == curTeacher.id) {
|
|
|
this.courseListShow[this.curCusIndex].schedule.splice(i, 1)
|
|
|
i -= 1
|
|
|
}
|
|
|
}
|
|
|
- this.curTeaIndex = -1
|
|
|
+ this.curTeaIndex = 0
|
|
|
this.updCusInfo()
|
|
|
},
|
|
|
onCancel: () => { }
|
|
@@ -791,9 +826,6 @@ export default {
|
|
|
// name: 'CoursePlan'
|
|
|
// })
|
|
|
this.$Message.warning('课表模式开发中...')
|
|
|
- },
|
|
|
- confirmAddStu() {
|
|
|
-
|
|
|
},
|
|
|
dropdownStates(flag) {
|
|
|
if (!flag) this.filterByPeriod()
|
|
@@ -804,23 +836,6 @@ export default {
|
|
|
})
|
|
|
this.getCusInfo()
|
|
|
},
|
|
|
- // getTeahcers(val) {
|
|
|
- // this.courseBaseInfo.teachers.length = []
|
|
|
- // for (let item of val) {
|
|
|
- // this.courseBaseInfo.teachers.push({
|
|
|
- // id: item.value,
|
|
|
- // name: item.label
|
|
|
- // })
|
|
|
- // }
|
|
|
- // },
|
|
|
- //id换名字
|
|
|
- //获取名字集合
|
|
|
- getTeacherName(ids) {
|
|
|
- let names = ids.map(item => {
|
|
|
- return item.name
|
|
|
- })
|
|
|
- return names.join(', ')
|
|
|
- },
|
|
|
//关键字搜索课程
|
|
|
searchCourse() {
|
|
|
this.courseListShow = this.courseList.filter((item, index) => {
|
|
@@ -866,7 +881,6 @@ export default {
|
|
|
this.$api.courseMgmt.findCusInfo(requestData).then(
|
|
|
(res) => {
|
|
|
if (!res.error) {
|
|
|
- // [this.curCusIndex] = res.courses[0]
|
|
|
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 => {
|
|
@@ -898,7 +912,6 @@ export default {
|
|
|
}
|
|
|
|
|
|
})
|
|
|
- console.log('res', res)
|
|
|
}
|
|
|
this.$set(this.courseListShow, this.curCusIndex, res.courses[0])
|
|
|
this.selectTea(0)
|
|
@@ -930,7 +943,6 @@ export default {
|
|
|
teachers: [],
|
|
|
option: 'insert'
|
|
|
}
|
|
|
- this.teacherId.length = 0
|
|
|
},
|
|
|
//显示确认删除对话框
|
|
|
showConfirmDel(index) {
|
|
@@ -964,7 +976,6 @@ export default {
|
|
|
})
|
|
|
let code = this.$store.state.userInfo.schoolCode
|
|
|
this.$api.courseMgmt.deleteCourse({
|
|
|
- // ids, code
|
|
|
id: this.courseListShow[this.curCusIndex].id,
|
|
|
code: this.courseListShow[this.curCusIndex].code.replace('Course-', ''),
|
|
|
scope: this.courseListShow[this.curCusIndex].scope || 'school',
|
|
@@ -981,7 +992,6 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
this.keyWord = ''
|
|
|
- // this.searchCourse()
|
|
|
this.filterByPeriod()
|
|
|
} else {
|
|
|
this.$Message.error(this.$t('cusMgt.delErr'))
|
|
@@ -1008,9 +1018,6 @@ export default {
|
|
|
}
|
|
|
} else {
|
|
|
this.courseBaseInfo = this.courseListShow[index]
|
|
|
- // this.teacherId = this.courseBaseInfo.teachers.map(item => {
|
|
|
- // return item.id
|
|
|
- // })
|
|
|
this.addCourseStatus = true
|
|
|
}
|
|
|
},
|
|
@@ -1036,13 +1043,11 @@ export default {
|
|
|
this.courseList.push(this.courseBaseInfo)
|
|
|
this.$Message.success(this.$t('cusMgt.addOk'))
|
|
|
} else {
|
|
|
- // this.courseListShow[index].teachers = this._.cloneDeep(this.courseBaseInfo.teachers)
|
|
|
this.$Message.success(this.$t('cusMgt.editOk'))
|
|
|
}
|
|
|
this.keyWord = ''
|
|
|
this.searchCourse()
|
|
|
this.filterByPeriod()
|
|
|
- this.teacherId = []
|
|
|
} else {
|
|
|
this.$Message.error('API ERROR!')
|
|
|
}
|
|
@@ -1098,7 +1103,6 @@ export default {
|
|
|
stulist.students = res.stus
|
|
|
stulist.full = true
|
|
|
this.students = res.stus
|
|
|
- console.log('stuinfo', this.students)
|
|
|
}
|
|
|
)
|
|
|
}
|
|
@@ -1123,8 +1127,8 @@ export default {
|
|
|
this.$api.schoolSetting.getClassroomStudent(params).then(
|
|
|
(res) => {
|
|
|
if (!res.error) {
|
|
|
- this.students = res.classrooms[0] ? res.classrooms[0].students : []
|
|
|
- this.schdList[this.curClassIndex].students = res.classrooms[0] ? res.classrooms[0].students : []
|
|
|
+ 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!')
|
|
|
}
|
|
@@ -1132,12 +1136,7 @@ export default {
|
|
|
(err) => {
|
|
|
this.$Message.error('API error!')
|
|
|
}
|
|
|
- ).finally(() => {
|
|
|
- setTimeout(() => {
|
|
|
- // this.tableLoading = false
|
|
|
- console.log(this.courseListShow[this.curCusIndex])
|
|
|
- }, 500)
|
|
|
- })
|
|
|
+ )
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
@@ -1156,14 +1155,14 @@ export default {
|
|
|
}
|
|
|
)
|
|
|
this.$store.dispatch('teachers/getTeacherList').then(res => {
|
|
|
+ this.teacherList = this.$store.state.teachers.teacherList.filter(item => {
|
|
|
+ return item.status == 'join'
|
|
|
+ })
|
|
|
})
|
|
|
this.getCourseList()
|
|
|
this.findStuList()
|
|
|
},
|
|
|
computed: {
|
|
|
- // async students() {
|
|
|
-
|
|
|
- // },
|
|
|
//级联选择年级班级
|
|
|
csOptions() {
|
|
|
let data = []
|
|
@@ -1186,7 +1185,6 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
- console.log('数据', data)
|
|
|
return data
|
|
|
},
|
|
|
filterPeriodName() {
|
|
@@ -1208,9 +1206,11 @@ export default {
|
|
|
schdList() {
|
|
|
if (this.courseListShow && this.courseListShow[this.curCusIndex] && this.courseListShow[this.curCusIndex] && this.teaList.length) {
|
|
|
let schds = this.courseListShow[this.curCusIndex].schedule.filter(item => {
|
|
|
- return item.teacher.id == this.teaList[this.curTeaIndex].id
|
|
|
+ return item.teacherId == this.teaList[this.curTeaIndex].id
|
|
|
+ })
|
|
|
+ return schds.filter(item => {
|
|
|
+ return (item.classId || item.stulist)
|
|
|
})
|
|
|
- return schds
|
|
|
} else {
|
|
|
return []
|
|
|
}
|
|
@@ -1225,12 +1225,14 @@ 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 item.teacher
|
|
|
+ return {
|
|
|
+ id: item.teacherId,
|
|
|
+ name: item.teacherName
|
|
|
+ }
|
|
|
})
|
|
|
const res = new Map()
|
|
|
let removeRep = all.filter((a) => !res.has(a.id) && res.set(a.id, 1))
|
|
|
-
|
|
|
- console.log(removeRep)
|
|
|
return removeRep
|
|
|
} else {
|
|
|
return []
|
|
@@ -1240,15 +1242,7 @@ export default {
|
|
|
watch: {
|
|
|
curCusIndex() {
|
|
|
this.getCusInfo()
|
|
|
- },
|
|
|
- // schdList:{
|
|
|
- // handler(){
|
|
|
- // console.log('watch',this.isDefault)
|
|
|
- // this.setIsDefault()
|
|
|
- // console.log('watch',this.isDefault)
|
|
|
- // },
|
|
|
- // deep:true
|
|
|
- // }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
@@ -1259,6 +1253,9 @@ export default {
|
|
|
.class-setting thead {
|
|
|
background: #505050;
|
|
|
}
|
|
|
+.class-setting .ivu-input {
|
|
|
+ border-radius: 16px;
|
|
|
+}
|
|
|
.add-list-header .el-input--small .el-input__inner {
|
|
|
height: 26px;
|
|
|
line-height: 26px;
|