|
@@ -62,16 +62,74 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div slot="right" class="cus-schd-box">
|
|
|
- <Split v-model="split2">
|
|
|
+ <!-- 添加名单UI -->
|
|
|
+ <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">
|
|
|
+ <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>
|
|
|
+ <el-cascader size="small" placeholder="请设置上课教室" :show-all-levels="false" clearable v-model="schedule.classInfo.id" :options="csOptions" :props="props" @change="setClassName" style="width:180px;">
|
|
|
+ </el-cascader>
|
|
|
+ <span v-show="teaClass" class="attr-label" style="margin-left:20px">默认名单</span>
|
|
|
+ <Tooltip v-show="teaClass" content="默认名单为教室对应的名单,否则需要指定自定义名单。" max-width="200">
|
|
|
+ <Icon type="ios-information-circle-outline" style="margin-left:2px;margin-right:5px" />
|
|
|
+ </Tooltip>
|
|
|
+ <span v-show="teaClass">
|
|
|
+ <i-switch v-model="isDefault" size="small" />
|
|
|
+ </span>
|
|
|
+ <span class="add-list-label" v-show="!isDefault || !teaClass" style="margin-left:40px">名单:</span>
|
|
|
+ <Select ref="sltStuList" v-show="!isDefault || !teaClass" clearable v-model="schedule.stulist" style="width:200px;margin-right:5px" size="small" @on-change="checkCreate">
|
|
|
+ <Option v-for="(item,index) in stuList" :value="item" :key="index">{{ item }}</Option>
|
|
|
+ </Select>
|
|
|
+ <Icon type="md-add-circle" v-show="!isDefault || !teaClass" class="create-list-icon" @click="goMgtStuList" />
|
|
|
+ <div class="action-btn-wrap">
|
|
|
+ <span class="action-btn" style="margin-right:40px" @click="confirmAddSchd">
|
|
|
+ <Icon type="md-add" size="16" />
|
|
|
+ <span>确认添加</span>
|
|
|
+ </span>
|
|
|
+ <span class="action-btn" @click="cancelAddSchd">
|
|
|
+ <Icon type="md-close" size="16" />
|
|
|
+ <span>取消添加</span>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <Table v-if="schdList[curClassIndex]" :columns="schdList[curClassIndex].stulist ? listColumn : classColumn" :data="students" class="stu-list-table" :loading="stuLoading" no-data-text="暂无学生">
|
|
|
+ <Loading slot="loading" :top="0" bgColor="rgba(103, 103, 103, 0.27)"></Loading>
|
|
|
+ <template slot-scope="{ row }" slot="picture">
|
|
|
+ <PersonalPhoto :name="row.name" :picture="row.picture" />
|
|
|
+ </template>
|
|
|
+ <template slot-scope="{ row,index }" slot="no">
|
|
|
+ <span v-show="editIndex !== index">{{row.no}}</span>
|
|
|
+ <Input v-model="students[index].no" v-show="editIndex == index" style="width: 60px;" type="number" />
|
|
|
+ <Icon type="md-checkmark" v-show="editIndex == index" @click="confirmSetNo()" class="reset-no-btn" />
|
|
|
+ <Icon type="md-close" v-show="editIndex == index" @click="cancelSetNo()" class="reset-no-btn" />
|
|
|
+ </template>
|
|
|
+ <template slot-scope="{ row ,index}" slot="action">
|
|
|
+ <div class="item-tools" v-if="$access.can('admin.*|student-upd')">
|
|
|
+ <Icon type="md-create" size="18" color="white" @click="resetNo(index)" :title="$t('schoolBaseInfo.editSeat')" />
|
|
|
+ <Icon type="md-remove-circle" size="18" color="white" style="margin-left:10px" @click="removeStudent(index)" :title="$t('schoolBaseInfo.delStuBtn')" />
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template slot-scope="{ row, index }" slot="groupId">
|
|
|
+ <span>{{row.groupId ? row.groupId : '- -'}}</span>
|
|
|
+ </template>
|
|
|
+ <template slot-scope="{ row, index }" slot="groupName">
|
|
|
+ <span>{{row.groupName ? row.groupName : '未分组'}}</span>
|
|
|
+ </template>
|
|
|
+ </Table>
|
|
|
+ </div>
|
|
|
+ <Split v-model="split2" v-show="!isAddStuList">
|
|
|
<!-- 授课教师列表 -->
|
|
|
<div slot="left" class="teacher-list">
|
|
|
<div class="teacher-list-header">
|
|
|
<span>教师</span>
|
|
|
- <Icon type="md-add" size="16" class="tea-action-icon" @click="addTeaStatus = true" />
|
|
|
+ <Icon type="md-add" size="16" class="tea-action-icon" @click="isAddStuList = true" />
|
|
|
<Icon type="md-trash" size="16" class="tea-action-icon" @click="delTeacher" />
|
|
|
</div>
|
|
|
- <div class="tea-list-content" v-if="courseListShow && courseListShow[curCusIndex]">
|
|
|
- <div v-for="(item,index) in courseListShow[curCusIndex].teachers" :key="index" @click="curTeaIndex = index" :class="['block-bg','tea-item',curTeaIndex == index ? 'block-bg-active':'']">
|
|
|
+ <div class="tea-list-content">
|
|
|
+ <div v-for="(item,index) in teaList" :key="index" @click="selectTea(index)" :class="['block-bg','tea-item',curTeaIndex == index ? 'block-bg-active':'']">
|
|
|
<PersonalPhoto :name="item.name" />
|
|
|
<div class="tea-info">
|
|
|
<p class="tea-name">{{item.name}}</p>
|
|
@@ -81,7 +139,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- 上课名单、上课时段设置 -->
|
|
|
- <div slot="right" class="class-setting" v-show="!isAddStuList">
|
|
|
+ <div slot="right" class="class-setting">
|
|
|
<div class="teacher-list-header">
|
|
|
<span @click="curTab = 0" :class="curTab == 0 ? 'tab-label line-bottom line-bottom-active':'tab-label line-bottom'">
|
|
|
课程名单
|
|
@@ -104,45 +162,44 @@
|
|
|
<div class="cus-time-setting">
|
|
|
<!-- 设置授课教室名单 -->
|
|
|
<div class="set-cus-class" v-show="curTab == 0">
|
|
|
- <Split v-model="split3">
|
|
|
+ <Split v-model="split3" v-show="schdList.length > 0">
|
|
|
<!-- 教室列表 -->
|
|
|
<div slot="left" class="class-list">
|
|
|
- <div v-for="(item,index) in testClassList" :key="index" @click="curClassIndex = index" :class="['block-bg','tea-class-item',curClassIndex == index ? 'block-bg-active':'']">
|
|
|
+ <div v-for="(item,index) in schdList" :key="index" @click="selectClass(index)" :class="['block-bg','tea-class-item',curClassIndex == index ? 'block-bg-active':'']">
|
|
|
<p class="class-attr-item">
|
|
|
<span class="attr-label">教室:</span>
|
|
|
- <span class="class-name">{{item.name}}</span>
|
|
|
- <span class="class-label" :style="{color:item.type == '专科教室' ? '#2db7f5' : item.type == '普通教室' ? '#19be6b' : '#ff9900',borderColor:item.type == '专科教室' ? '#2db7f5' : item.type == '普通教室' ? '#19be6b' : '#ff9900'}">
|
|
|
+ <span class="class-name">{{item.classInfo.id ? item.classInfo.name:'未设置'}}</span>
|
|
|
+ <!-- <span class="class-label" :style="{color:item.type == '专科教室' ? '#2db7f5' : item.type == '普通教室' ? '#19be6b' : '#ff9900',borderColor:item.type == '专科教室' ? '#2db7f5' : item.type == '普通教室' ? '#19be6b' : '#ff9900'}">
|
|
|
{{item.type}}
|
|
|
- </span>
|
|
|
+ </span> -->
|
|
|
</p>
|
|
|
<p class="class-attr-item">
|
|
|
<span class="attr-label">名单:</span>
|
|
|
- <span class="class-name">默认名单</span>
|
|
|
+ <span class="class-name">{{item.stulist ? '自定义名单':'默认名单'}}</span>
|
|
|
</p>
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- 设置教室名单 -->
|
|
|
- <div slot="right" class="set-stu-list dark-iview-table dark-el-cascader ">
|
|
|
+ <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">教室:</span>
|
|
|
<!-- <span>{{testClassList[curClassIndex].name }}</span> -->
|
|
|
- <el-cascader size="mini" placeholder="请设置上课教室" :show-all-levels="false" clearable v-model="teaClass" :options="csOptions" :props="props" @change="treeChange" style="width:180px;">
|
|
|
+ <el-cascader size="mini" placeholder="请设置上课教室" :show-all-levels="false" clearable v-model="schdList[curClassIndex].classInfo.id" :options="csOptions" :props="props" @change="setClassName" style="width:180px;">
|
|
|
</el-cascader>
|
|
|
<span class="attr-label" style="margin-left:50px">默认名单</span>
|
|
|
<Tooltip content="默认名单为教室对应的名单,否则需要指定自定义名单。" max-width="200">
|
|
|
<Icon type="ios-information-circle-outline" style="margin-left:2px;margin-right:5px" />
|
|
|
</Tooltip>
|
|
|
<span>
|
|
|
- <i-switch v-model="isDefault" size="small" @on-change="setIsDefList" />
|
|
|
-
|
|
|
+ <i-switch v-model="isDefault" size="small" :before-change="handleSwitch"/>
|
|
|
</span>
|
|
|
<span v-show="!isDefault" class="attr-label" style="margin-left:50px">名单:</span>
|
|
|
- <Select ref="sltStuList" v-show="!isDefault" clearable v-model="dyStu" style="width:200px;margin-right:5px" size="small" @on-change="checkCreate">
|
|
|
+ <Select ref="sltStuList" v-show="!isDefault" clearable v-model="schdList[curClassIndex].stulist" style="width:200px;margin-right:5px" size="small" @on-change="checkCreate">
|
|
|
<Option v-for="(item,index) in stuList" :value="item" :key="index">{{ item }}</Option>
|
|
|
</Select>
|
|
|
<Icon type="md-add-circle" v-show="!isDefault" style="cursor:pointer" @click="goMgtStuList" />
|
|
|
</div>
|
|
|
- <Table :columns="dyStu ? listColumn : classColumn" :data="students" class="stu-list-table" :loading="stuLoading" no-data-text="暂无学生">
|
|
|
+ <Table v-if="schdList[curClassIndex]" :columns="schdList[curClassIndex].stulist ? listColumn : classColumn" :data="students" class="stu-list-table" :loading="stuLoading" no-data-text="暂无学生">
|
|
|
<Loading slot="loading" :top="0" bgColor="rgba(103, 103, 103, 0.27)"></Loading>
|
|
|
<template slot-scope="{ row }" slot="picture">
|
|
|
<PersonalPhoto :name="row.name" :picture="row.picture" />
|
|
@@ -168,6 +225,7 @@
|
|
|
</Table>
|
|
|
</div>
|
|
|
</Split>
|
|
|
+ <EmptyData v-show="schdList.length == 0" textContent="暂无课程名单,请先前往添加名单"></EmptyData>
|
|
|
</div>
|
|
|
<!-- 教师课表 -->
|
|
|
<vuescroll v-show="curTab == 1">
|
|
@@ -182,60 +240,7 @@
|
|
|
</vuescroll>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <!-- 添加名单UI -->
|
|
|
- <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>
|
|
|
- <el-cascader size="small" placeholder="请设置上课教室" :show-all-levels="false" clearable v-model="teaClass" :options="csOptions" :props="props" @change="treeChange" style="width:180px;">
|
|
|
- </el-cascader>
|
|
|
- <span v-show="teaClass" class="attr-label" style="margin-left:20px">默认名单</span>
|
|
|
- <Tooltip v-show="teaClass" content="默认名单为教室对应的名单,否则需要指定自定义名单。" max-width="200">
|
|
|
- <Icon type="ios-information-circle-outline" style="margin-left:2px;margin-right:5px" />
|
|
|
- </Tooltip>
|
|
|
- <span v-show="teaClass">
|
|
|
- <i-switch v-model="isDefault" size="small" @on-change="setIsDefList" />
|
|
|
- </span>
|
|
|
- <span class="add-list-label" v-show="!isDefault || !teaClass" style="margin-left:40px">名单:</span>
|
|
|
- <Select ref="sltStuList" v-show="!isDefault || !teaClass" clearable v-model="dyStu" style="width:200px;margin-right:5px" size="small" @on-change="checkCreate">
|
|
|
- <Option v-for="(item,index) in stuList" :value="item" :key="index">{{ item }}</Option>
|
|
|
- </Select>
|
|
|
- <Icon type="md-add-circle" v-show="!isDefault || !teaClass" class="create-list-icon" @click="goMgtStuList" />
|
|
|
- <div class="action-btn-wrap">
|
|
|
- <span class="action-btn" style="margin-right:40px" @click="isAddStuList = false">
|
|
|
- <Icon type="md-add" size="16" />
|
|
|
- <span>确认添加</span>
|
|
|
- </span>
|
|
|
- <span class="action-btn" @click="isAddStuList = false">
|
|
|
- <Icon type="md-close" size="16" />
|
|
|
- <span>取消添加</span>
|
|
|
- </span>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <Table :columns="dyStu ? listColumn : classColumn" :data="students" class="stu-list-table" :loading="stuLoading" no-data-text="暂无学生">
|
|
|
- <Loading slot="loading" :top="0" bgColor="rgba(103, 103, 103, 0.27)"></Loading>
|
|
|
- <template slot-scope="{ row }" slot="picture">
|
|
|
- <PersonalPhoto :name="row.name" :picture="row.picture" />
|
|
|
- </template>
|
|
|
- <template slot-scope="{ row,index }" slot="no">
|
|
|
- <span v-show="editIndex !== index">{{row.no}}</span>
|
|
|
- <Input v-model="students[index].no" v-show="editIndex == index" style="width: 60px;" type="number" />
|
|
|
- <Icon type="md-checkmark" v-show="editIndex == index" @click="confirmSetNo()" class="reset-no-btn" />
|
|
|
- <Icon type="md-close" v-show="editIndex == index" @click="cancelSetNo()" class="reset-no-btn" />
|
|
|
- </template>
|
|
|
- <template slot-scope="{ row ,index}" slot="action">
|
|
|
- <div class="item-tools" v-if="$access.can('admin.*|student-upd')">
|
|
|
- <Icon type="md-create" size="18" color="white" @click="resetNo(index)" :title="$t('schoolBaseInfo.editSeat')" />
|
|
|
- <Icon type="md-remove-circle" size="18" color="white" style="margin-left:10px" @click="removeStudent(index)" :title="$t('schoolBaseInfo.delStuBtn')" />
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- <template slot-scope="{ row, index }" slot="groupId">
|
|
|
- <span>{{row.groupId ? row.groupId : '- -'}}</span>
|
|
|
- </template>
|
|
|
- <template slot-scope="{ row, index }" slot="groupName">
|
|
|
- <span>{{row.groupName ? row.groupName : '未分组'}}</span>
|
|
|
- </template>
|
|
|
- </Table>
|
|
|
- </div>
|
|
|
+
|
|
|
</Split>
|
|
|
</div>
|
|
|
</Split>
|
|
@@ -270,8 +275,11 @@
|
|
|
</Form>
|
|
|
</Modal>
|
|
|
<!-- 添加授课教师 -->
|
|
|
- <Modal v-model="addTeaStatus" title="添加教师" class-name="dark-iview-modal dark-iview-select">
|
|
|
- <Select label-in-value multiple v-model="teacherId" :placeholder="$t('cusMgt.teacherHolder')" :max-tag-count="3" filterable @on-change="getTeahcers">
|
|
|
+ <Modal v-model="addTeaStatus" title="添加教师" class-name="dark-iview-modal dark-iview-select" @on-ok="confirmAddTea">
|
|
|
+ <!-- <div style="margin-bottom:20px;">
|
|
|
+ <Tag closable v-for="(item,index) in courseListShow[curCusIndex].teachers" :key="index">{{item.name}}</Tag>
|
|
|
+ </div> -->
|
|
|
+ <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>
|
|
@@ -309,7 +317,6 @@ export default {
|
|
|
}
|
|
|
return {
|
|
|
props: {
|
|
|
- // multiple: true,
|
|
|
value: 'id',
|
|
|
label: 'name',
|
|
|
emitPath: false
|
|
@@ -320,7 +327,6 @@ export default {
|
|
|
isSearch: false,
|
|
|
stuLoading: false,
|
|
|
students: [],
|
|
|
- dyStu: '',
|
|
|
stuList: ['选修名单1', '选修名单2', '选修名单3', '选修名单4', '选修名单5', '选修名单6'],
|
|
|
isDefault: true,
|
|
|
testClassList: [
|
|
@@ -401,6 +407,7 @@ export default {
|
|
|
align: 'center'
|
|
|
},
|
|
|
],
|
|
|
+ addTeachers: [],
|
|
|
curClassIndex: 0,
|
|
|
hasTimeTable: false,
|
|
|
selections: [],
|
|
@@ -450,10 +457,149 @@ export default {
|
|
|
addCourseStatus: false,
|
|
|
keyWord: '',
|
|
|
courseList: [],
|
|
|
- courseListShow: []
|
|
|
+ courseListShow: [],
|
|
|
+ schedule: {
|
|
|
+ classInfo: {
|
|
|
+ id: '',
|
|
|
+ name: ''
|
|
|
+ },
|
|
|
+ teacher: {
|
|
|
+ id: '',
|
|
|
+ name: ''
|
|
|
+ },
|
|
|
+ stulist: '',
|
|
|
+ time: [
|
|
|
+ // {
|
|
|
+ // week: "Mon",
|
|
|
+ // start: "8:00",
|
|
|
+ // end: "8:40"
|
|
|
+ // }
|
|
|
+ ],
|
|
|
+ notice: ''
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ //教室列表
|
|
|
+ selectClass(index){
|
|
|
+ this.curClassIndex = index
|
|
|
+ this.setIsDefault()
|
|
|
+ },
|
|
|
+ //教师列表选择事件
|
|
|
+ selectTea(index) {
|
|
|
+ this.curClassIndex = 0
|
|
|
+ this.curTeaIndex = index
|
|
|
+ this.setIsDefault()
|
|
|
+ },
|
|
|
+ //默认名单切换判断
|
|
|
+ handleSwitch() {
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ if (!this.isDefault) {
|
|
|
+ this.$Modal.confirm({
|
|
|
+ title: '默认名单',
|
|
|
+ content: '如果使用默认名单将会移除当前自定义名单,您确认要使用默认名单吗?',
|
|
|
+ onOk: () => {
|
|
|
+ this.schdList[this.curClassIndex].stulist = ''
|
|
|
+ resolve()
|
|
|
+ },
|
|
|
+ onCancel: () => {
|
|
|
+ reject()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ resolve()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //下拉选择授课教师,并设置教师名称
|
|
|
+ setTeaName(data) {
|
|
|
+ this.schedule.teacher.name = data.label
|
|
|
+ console.log(this.schedule)
|
|
|
+ },
|
|
|
+ //设置教室名称
|
|
|
+ setClassName(data) {
|
|
|
+ console.log(data)
|
|
|
+ let curClass = this.classList.find(item => {
|
|
|
+ return item.id == data
|
|
|
+ })
|
|
|
+ if (curClass) {
|
|
|
+ this.schedule.classInfo.name = curClass.name
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //确认添加名单
|
|
|
+ confirmAddSchd() {
|
|
|
+ if (!this.schedule.teacher.id) {
|
|
|
+ this.$Message.warning('请设置授课老师')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!(this.schedule.classInfo.id || this.schedule.stulist)) {
|
|
|
+ this.$Message.warning('请设置教室或者名单')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.courseListShow[this.curCusIndex].schedule.push(this.schedule)
|
|
|
+ console.log(this.courseListShow[this.curCusIndex])
|
|
|
+ this.isAddStuList = false
|
|
|
+ this.updCusInfo()
|
|
|
+ this.initSchedule()
|
|
|
+ },
|
|
|
+ //取消添加Schd
|
|
|
+ cancelAddSchd() {
|
|
|
+ this.isAddStuList = false
|
|
|
+ this.initSchedule()
|
|
|
+ },
|
|
|
+ //确认或取消添加后初始化数据
|
|
|
+ initSchedule() {
|
|
|
+ this.schedule = {
|
|
|
+ classInfo: {
|
|
|
+ id: '',
|
|
|
+ name: ''
|
|
|
+ },
|
|
|
+ teacher: {
|
|
|
+ id: '',
|
|
|
+ name: ''
|
|
|
+ },
|
|
|
+ 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()
|
|
|
+ },
|
|
|
+ // 更新课程数据
|
|
|
+ updCusInfo() {
|
|
|
+ this.courseListShow[this.curCusIndex].code = this.courseListShow[this.curCusIndex].code.replace('Course-', '')
|
|
|
+ this.$api.courseMgmt.saveOrUpdateCourse({
|
|
|
+ course: this.courseListShow[this.curCusIndex],
|
|
|
+ option: 'update',
|
|
|
+ scope: this.courseListShow[this.curCusIndex].scope
|
|
|
+ }).then().catch(() => {
|
|
|
+ this.$Message.error('更新失败')
|
|
|
+ })
|
|
|
+ },
|
|
|
//删除授课教师
|
|
|
delTeacher() {
|
|
|
this.$Modal.confirm({
|
|
@@ -485,16 +631,6 @@ export default {
|
|
|
name: 'MgtStuList'
|
|
|
})
|
|
|
},
|
|
|
- //设置是否为默认名单
|
|
|
- setIsDefList(status) {
|
|
|
- if (status) {
|
|
|
- this.dyStu = ''
|
|
|
- }
|
|
|
- },
|
|
|
- treeChange(data) {
|
|
|
- console.log(data)
|
|
|
- console.log('modal', this.teaClass)
|
|
|
- },
|
|
|
//跳转名单管理页面
|
|
|
mgtStuList() {
|
|
|
this.$Message.warning("名单管理开发中.......")
|
|
@@ -591,10 +727,10 @@ export default {
|
|
|
(res) => {
|
|
|
if (!res.error) {
|
|
|
// [this.curCusIndex] = res.courses[0]
|
|
|
- if(res.courses && res.courses.length > 0){
|
|
|
+ if (res.courses && res.courses.length > 0) {
|
|
|
res.courses[0].schedule = res.courses[0].schedule ? res.courses[0].schedule : []
|
|
|
}
|
|
|
- this.$set(this.courseListShow,this.curCusIndex,res.courses[0])
|
|
|
+ this.$set(this.courseListShow, this.curCusIndex, res.courses[0])
|
|
|
}
|
|
|
}
|
|
|
).finally(() => {
|
|
@@ -744,6 +880,11 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ setIsDefault() {
|
|
|
+ if (this.schdList.length) {
|
|
|
+ this.isDefault = !this.schdList[this.curClassIndex].stulist
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
created() {
|
|
|
//直接读取登录成功拿到得学校基础信息
|
|
@@ -806,20 +947,44 @@ export default {
|
|
|
return name
|
|
|
},
|
|
|
//当前老师的课程安排
|
|
|
- teaSchd(){
|
|
|
- if(this.courseListShow && this.courseListShow[this.curCusIndex] && this.courseListShow[this.curCusIndex].teachers){
|
|
|
- return this.courseListShow[this.curCusIndex].schedule.filter(item=>{
|
|
|
- return item.teacher.id == this.courseListShow[this.curCusIndex].teachers[this.curTeaIndex].id
|
|
|
+ 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
|
|
|
})
|
|
|
- }else{
|
|
|
+ return schds
|
|
|
+ } else {
|
|
|
+ return []
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //当前课程的授课老师列表
|
|
|
+ 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
|
|
|
+ })
|
|
|
+ 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 []
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- watch:{
|
|
|
- curCusIndex(){
|
|
|
+ watch: {
|
|
|
+ curCusIndex() {
|
|
|
this.getCusInfo()
|
|
|
- }
|
|
|
+ },
|
|
|
+ // schdList:{
|
|
|
+ // handler(){
|
|
|
+ // console.log('watch',this.isDefault)
|
|
|
+ // this.setIsDefault()
|
|
|
+ // console.log('watch',this.isDefault)
|
|
|
+ // },
|
|
|
+ // deep:true
|
|
|
+ // }
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
@@ -830,4 +995,8 @@ export default {
|
|
|
.class-setting thead {
|
|
|
background: #505050;
|
|
|
}
|
|
|
+.add-list-header .el-input--small .el-input__inner {
|
|
|
+ height: 26px;
|
|
|
+ line-height: 26px;
|
|
|
+}
|
|
|
</style>
|