|
@@ -34,7 +34,7 @@
|
|
</div>
|
|
</div>
|
|
<div class="class-list">
|
|
<div class="class-list">
|
|
<vuescroll>
|
|
<vuescroll>
|
|
- <div class="class-list-item" v-for="(item,index) in classroomListShow" :key="index" @click="chooseClassroom(index)" :class="curClassIndex == index ? 'block-bg block-bg-active':'block-bg'">
|
|
|
|
|
|
+ <div class="class-list-item" v-for="(item,index) in classListShow" :key="index" @click="chooseClassroom(index)" :class="curClassIndex == index ? 'block-bg block-bg-active':'block-bg'">
|
|
<div class="class-list-item-left">
|
|
<div class="class-list-item-left">
|
|
<!-- <p style="color: #a5a5a5;">{{$jsFn.getGradeName(schoolBase,item.gradeId)}}</p> -->
|
|
<!-- <p style="color: #a5a5a5;">{{$jsFn.getGradeName(schoolBase,item.gradeId)}}</p> -->
|
|
<p style="color: #a5a5a5;">2020级</p>
|
|
<p style="color: #a5a5a5;">2020级</p>
|
|
@@ -48,14 +48,14 @@
|
|
</p>
|
|
</p>
|
|
<p class="class-type">
|
|
<p class="class-type">
|
|
<p class="second-text-color">
|
|
<p class="second-text-color">
|
|
- <span>{{ $t('schoolBaseInfo.headmaster') }}</span>
|
|
|
|
|
|
+ <span>{{ $t('schoolBaseInfo.headmaster')}}:</span>
|
|
<span class="primary-text-color">{{item.teacher.name}}</span>
|
|
<span class="primary-text-color">{{item.teacher.name}}</span>
|
|
<!-- <span style="margin-left:15px">学生人数:</span>
|
|
<!-- <span style="margin-left:15px">学生人数:</span>
|
|
<span class="primary-text-color">40人</span> -->
|
|
<span class="primary-text-color">40人</span> -->
|
|
</p>
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- <EmptyData v-if="classroomListShow.length == 0" style="padding-top:120px;"></EmptyData>
|
|
|
|
|
|
+ <EmptyData v-if="classListShow.length == 0" style="padding-top:120px;"></EmptyData>
|
|
</vuescroll>
|
|
</vuescroll>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -86,43 +86,43 @@
|
|
<!--班级属性-->
|
|
<!--班级属性-->
|
|
<div class="class-attr-wrap disabled-iview-select dark-iview-select">
|
|
<div class="class-attr-wrap disabled-iview-select dark-iview-select">
|
|
<vuescroll>
|
|
<vuescroll>
|
|
- <Form v-if="classroomListShow[curClassIndex]" ref="classInfo" :model="classroomListShow[curClassIndex]" :rules="classValidate" style="padding-top:20px;">
|
|
|
|
|
|
+ <Form v-if="classListShow[curClassIndex]" ref="classInfo" :model="classListShow[curClassIndex]" :rules="classValidate" style="padding-top:20px;">
|
|
<FormItem prop="name" :label="$t('schoolBaseInfo.classroomName')" @click.native.stop class="requird-color">
|
|
<FormItem prop="name" :label="$t('schoolBaseInfo.classroomName')" @click.native.stop class="requird-color">
|
|
<span slot="label" class="class-attr-wrap-label">名称</span>
|
|
<span slot="label" class="class-attr-wrap-label">名称</span>
|
|
- <Input @on-change="watchUpdate" :disabled="editStatus" v-model="classroomListShow[curClassIndex].name" clearable :placeholder="$t('schoolBaseInfo.classroomNameHolder')" />
|
|
|
|
|
|
+ <Input @on-change="watchUpdate" :disabled="editStatus" v-model="classListShow[curClassIndex].name" clearable :placeholder="$t('schoolBaseInfo.classroomNameHolder')" />
|
|
</FormItem>
|
|
</FormItem>
|
|
<FormItem prop="no" @click.native.stop class="requird-color">
|
|
<FormItem prop="no" @click.native.stop class="requird-color">
|
|
<span slot="label" class="class-attr-wrap-label">编码</span>
|
|
<span slot="label" class="class-attr-wrap-label">编码</span>
|
|
- <Input @on-change="watchUpdate" :disabled="editStatus" v-model="classroomListShow[curClassIndex].no" clearable :placeholder="$t('schoolBaseInfo.classroomCodeHolder')" />
|
|
|
|
|
|
+ <Input @on-change="watchUpdate" :disabled="editStatus" v-model="classListShow[curClassIndex].no" clearable :placeholder="$t('schoolBaseInfo.classroomCodeHolder')" />
|
|
</FormItem>
|
|
</FormItem>
|
|
<FormItem prop="gradeId" :label="$t('schoolBaseInfo.setGrade')" @click.native.stop class="requird-color">
|
|
<FormItem prop="gradeId" :label="$t('schoolBaseInfo.setGrade')" @click.native.stop class="requird-color">
|
|
<span slot="label" class="class-attr-wrap-label">学级</span>
|
|
<span slot="label" class="class-attr-wrap-label">学级</span>
|
|
- <Select @on-change="watchUpdate" :disabled="editStatus" v-model="classroomListShow[curClassIndex].gradeId" clearable>
|
|
|
|
- <Option v-for="(item,index) in $jsFn.getPeriod($store.state.user.schoolProfile.school_base,classroomListShow[curClassIndex].periodId).grades" :value="item.id" :key="index">
|
|
|
|
|
|
+ <Select @on-change="watchUpdate" :disabled="editStatus" v-model="classListShow[curClassIndex].gradeId" clearable>
|
|
|
|
+ <Option v-for="(item,index) in $jsFn.getPeriod($store.state.user.schoolProfile.school_base,classListShow[curClassIndex].periodId).grades" :value="item.id" :key="index">
|
|
{{ item.name }}
|
|
{{ item.name }}
|
|
</Option>
|
|
</Option>
|
|
</Select>
|
|
</Select>
|
|
</FormItem>
|
|
</FormItem>
|
|
<FormItem prop="teacher" :label="$t('schoolBaseInfo.headmaster')" @click.native.stop class="requird-color">
|
|
<FormItem prop="teacher" :label="$t('schoolBaseInfo.headmaster')" @click.native.stop class="requird-color">
|
|
<span slot="label" class="class-attr-wrap-label">{{$t('schoolBaseInfo.headmaster')}}</span>
|
|
<span slot="label" class="class-attr-wrap-label">{{$t('schoolBaseInfo.headmaster')}}</span>
|
|
- <Select @on-change="watchUpdate" :disabled="editStatus" v-model="classroomListShow[curClassIndex].teacher.id" clearable filterable>
|
|
|
|
- <Option v-for="(item,index) in $store.state.teachers.teacherList.filter(item=>item.status == 'join')" :value="item.id" :key="index" @click.native="classroomListShow[curClassIndex].teacher = {id:item.id, name:item.name}">
|
|
|
|
|
|
+ <Select @on-change="watchUpdate" :disabled="editStatus" v-model="classListShow[curClassIndex].teacher.id" clearable filterable>
|
|
|
|
+ <Option v-for="(item,index) in $store.state.teachers.teacherList.filter(item=>item.status == 'join')" :value="item.id" :key="index" @click.native="classListShow[curClassIndex].teacher = {id:item.id, name:item.name}">
|
|
{{ item.name }}
|
|
{{ item.name }}
|
|
</Option>
|
|
</Option>
|
|
</Select>
|
|
</Select>
|
|
</FormItem>
|
|
</FormItem>
|
|
<FormItem prop="profession" @click.native.stop class="requird-color">
|
|
<FormItem prop="profession" @click.native.stop class="requird-color">
|
|
- <span slot="label" class="class-attr-wrap-label">专业</span>
|
|
|
|
- <Select @on-change="watchUpdate" :disabled="editStatus" v-model="classroomListShow[curClassIndex].marjorId" clearable not-found-text="暂未设置专业">
|
|
|
|
- <Option v-for="(item,index) in $jsFn.getPeriod($store.state.user.schoolProfile.school_base,classroomListShow[curClassIndex].periodId).majors" :value="item.id" :key="index">
|
|
|
|
|
|
+ <span slot="label" class="class-attr-wrap-label">默认教室</span>
|
|
|
|
+ <Select @on-change="watchUpdate" :disabled="editStatus" v-model="classListShow[curClassIndex].room" clearable not-found-text="暂无教室">
|
|
|
|
+ <Option v-for="(item,index) in roomList" :value="item.id" :key="index">
|
|
{{ item.name }}
|
|
{{ item.name }}
|
|
</Option>
|
|
</Option>
|
|
</Select>
|
|
</Select>
|
|
</FormItem>
|
|
</FormItem>
|
|
<FormItem prop="profession" @click.native.stop class="requird-color">
|
|
<FormItem prop="profession" @click.native.stop class="requird-color">
|
|
- <span slot="label" class="class-attr-wrap-label">默认教室</span>
|
|
|
|
- <Select @on-change="watchUpdate" :disabled="editStatus" v-model="classroomListShow[curClassIndex].roomId" clearable not-found-text="暂无教室">
|
|
|
|
- <Option v-for="(item,index) in $jsFn.getPeriod($store.state.user.schoolProfile.school_base,classroomListShow[curClassIndex].periodId).majors" :value="item.id" :key="index">
|
|
|
|
|
|
+ <span slot="label" class="class-attr-wrap-label">专业</span>
|
|
|
|
+ <Select @on-change="watchUpdate" :disabled="editStatus" v-model="classListShow[curClassIndex].marjorId" clearable not-found-text="暂未设置专业">
|
|
|
|
+ <Option v-for="(item,index) in $jsFn.getPeriod($store.state.user.schoolProfile.school_base,classListShow[curClassIndex].periodId).majors" :value="item.id" :key="index">
|
|
{{ item.name }}
|
|
{{ item.name }}
|
|
</Option>
|
|
</Option>
|
|
</Select>
|
|
</Select>
|
|
@@ -134,7 +134,7 @@
|
|
|
|
|
|
<!--学生名单-->
|
|
<!--学生名单-->
|
|
<div id="sut-list-box" class="dark-iview-table dark-iview-input" style="width:100%;height:100%;" v-show="currentTabIndex == 2">
|
|
<div id="sut-list-box" class="dark-iview-table dark-iview-input" style="width:100%;height:100%;" v-show="currentTabIndex == 2">
|
|
- <vuescroll style="height:100%;" v-if="classroomListShow[curClassIndex]">
|
|
|
|
|
|
+ <vuescroll style="height:100%;" v-if="classListShow[curClassIndex]">
|
|
<Table :columns="studentColumn" :data="students" @on-selection-change="(selections)=>{delSelections = selections}" :height="tableHeight" class="system-classroom-table" :loading="stuLoading" :no-data-text="$t('schoolBaseInfo.noStu')">
|
|
<Table :columns="studentColumn" :data="students" @on-selection-change="(selections)=>{delSelections = selections}" :height="tableHeight" class="system-classroom-table" :loading="stuLoading" :no-data-text="$t('schoolBaseInfo.noStu')">
|
|
<Loading slot="loading" :top="0" bgColor="rgba(103, 103, 103, 0.27)"></Loading>
|
|
<Loading slot="loading" :top="0" bgColor="rgba(103, 103, 103, 0.27)"></Loading>
|
|
<template slot-scope="{ row }" slot="picture">
|
|
<template slot-scope="{ row }" slot="picture">
|
|
@@ -185,7 +185,8 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return {
|
|
return {
|
|
- filterYear:'',
|
|
|
|
|
|
+ roomList:[],
|
|
|
|
+ filterYear: '',
|
|
// years:[2021,2020,2019,2018,2017,2016,2015,2014],
|
|
// years:[2021,2020,2019,2018,2017,2016,2015,2014],
|
|
studentColumn: [
|
|
studentColumn: [
|
|
{
|
|
{
|
|
@@ -244,8 +245,8 @@ export default {
|
|
isSaveLoading: false,
|
|
isSaveLoading: false,
|
|
isInit: true,
|
|
isInit: true,
|
|
updated: false,
|
|
updated: false,
|
|
- classroomList: [],
|
|
|
|
- classroomListShow: [],
|
|
|
|
|
|
+ classList: [],
|
|
|
|
+ classListShow: [],
|
|
curClassIndex: 0,
|
|
curClassIndex: 0,
|
|
keyword: '',
|
|
keyword: '',
|
|
serchCode: '',
|
|
serchCode: '',
|
|
@@ -294,19 +295,19 @@ export default {
|
|
|
|
|
|
students() {
|
|
students() {
|
|
if (this.currentTabIndex == '2') {
|
|
if (this.currentTabIndex == '2') {
|
|
- if (this.classroomListShow[this.curClassIndex] && this.classroomListShow[this.curClassIndex].students) {
|
|
|
|
- return this.classroomListShow[this.curClassIndex].students
|
|
|
|
|
|
+ if (this.classListShow[this.curClassIndex] && this.classListShow[this.curClassIndex].students) {
|
|
|
|
+ return this.classListShow[this.curClassIndex].students
|
|
} else {
|
|
} else {
|
|
let params = {
|
|
let params = {
|
|
'school_code': this.$store.state.userInfo.schoolCode,
|
|
'school_code': this.$store.state.userInfo.schoolCode,
|
|
- 'ids': [this.classroomListShow[this.curClassIndex].id],
|
|
|
|
|
|
+ 'ids': [this.classListShow[this.curClassIndex].id],
|
|
'scope': 'school'
|
|
'scope': 'school'
|
|
}
|
|
}
|
|
this.stuLoading = true
|
|
this.stuLoading = true
|
|
this.$api.schoolSetting.getClassroomStudent(params).then(
|
|
this.$api.schoolSetting.getClassroomStudent(params).then(
|
|
res => {
|
|
res => {
|
|
if (res.stus.length > 0) {
|
|
if (res.stus.length > 0) {
|
|
- this.$set(this.classroomListShow[this.curClassIndex], 'students', res.stus[0])
|
|
|
|
|
|
+ this.$set(this.classListShow[this.curClassIndex], 'students', res.stus[0])
|
|
}
|
|
}
|
|
},
|
|
},
|
|
err => {
|
|
err => {
|
|
@@ -321,12 +322,12 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
- years(){
|
|
|
|
- if(this.schoolBase && this.schoolBase.period.length && this.filterPeriod){
|
|
|
|
- let pData = this.schoolBase.period.find(item=>{
|
|
|
|
|
|
+ years() {
|
|
|
|
+ if (this.schoolBase && this.schoolBase.period.length && this.filterPeriod) {
|
|
|
|
+ let pData = this.schoolBase.period.find(item => {
|
|
return item.id == this.filterPeriod
|
|
return item.id == this.filterPeriod
|
|
})
|
|
})
|
|
- if(pData){
|
|
|
|
|
|
+ if (pData) {
|
|
let date = new Date()
|
|
let date = new Date()
|
|
let year = date.getFullYear()
|
|
let year = date.getFullYear()
|
|
let month = date.getMonth() + 1
|
|
let month = date.getMonth() + 1
|
|
@@ -337,15 +338,15 @@ export default {
|
|
if (start && month < start.month) {
|
|
if (start && month < start.month) {
|
|
year--
|
|
year--
|
|
}
|
|
}
|
|
- let res = pData.grades.map(item=>{
|
|
|
|
|
|
+ let res = pData.grades.map(item => {
|
|
return {
|
|
return {
|
|
- label:`${item.name}(${year}级)`,
|
|
|
|
- value:year--
|
|
|
|
|
|
+ label: `${item.name}(${year}级)`,
|
|
|
|
+ value: year--
|
|
}
|
|
}
|
|
})
|
|
})
|
|
this.filterYear = res[0].label
|
|
this.filterYear = res[0].label
|
|
return res
|
|
return res
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
return []
|
|
return []
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -419,9 +420,9 @@ export default {
|
|
console.log(this.selections)
|
|
console.log(this.selections)
|
|
let data = this._.cloneDeep(this.selections)
|
|
let data = this._.cloneDeep(this.selections)
|
|
data.forEach(item => {
|
|
data.forEach(item => {
|
|
- item.classId = this.classroomListShow[this.curClassIndex].id
|
|
|
|
- item.className = this.classroomListShow[this.curClassIndex].name
|
|
|
|
- item.classNo = this.classroomListShow[this.curClassIndex].no
|
|
|
|
|
|
+ item.classId = this.classListShow[this.curClassIndex].id
|
|
|
|
+ item.className = this.classListShow[this.curClassIndex].name
|
|
|
|
+ item.classNo = this.classListShow[this.curClassIndex].no
|
|
})
|
|
})
|
|
|
|
|
|
this.listLoading = true
|
|
this.listLoading = true
|
|
@@ -484,7 +485,7 @@ export default {
|
|
break;
|
|
break;
|
|
case 'total':
|
|
case 'total':
|
|
data.sort(function (a, b) {
|
|
data.sort(function (a, b) {
|
|
- return b.studCount - a.studCount;
|
|
|
|
|
|
+ return b.studCount - a.studCount
|
|
})
|
|
})
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
@@ -493,12 +494,12 @@ export default {
|
|
filterByPeriod() {
|
|
filterByPeriod() {
|
|
this.curClassIndex = 0
|
|
this.curClassIndex = 0
|
|
if (this.filterPeriod) {
|
|
if (this.filterPeriod) {
|
|
- this.classroomListShow = this.classroomList.filter(item => item.periodId == this.filterPeriod || !item.periodId)
|
|
|
|
|
|
+ this.classListShow = this.classList.filter(item => item.periodId == this.filterPeriod || !item.periodId)
|
|
} else {
|
|
} else {
|
|
- this.classroomListShow = [...this.classroomList]
|
|
|
|
|
|
+ this.classListShow = [...this.classList]
|
|
}
|
|
}
|
|
// 排序
|
|
// 排序
|
|
- this.classroomListShow = this.dataSort(this.classroomListShow)
|
|
|
|
|
|
+ this.classListShow = this.dataSort(this.classListShow)
|
|
|
|
|
|
},
|
|
},
|
|
filterClassname() {
|
|
filterClassname() {
|
|
@@ -507,15 +508,15 @@ export default {
|
|
} else {
|
|
} else {
|
|
let filterRes = []
|
|
let filterRes = []
|
|
if (this.filterPeriod) {
|
|
if (this.filterPeriod) {
|
|
- filterRes = this.classroomList.filter(item => item.periodId == this.filterPeriod)
|
|
|
|
|
|
+ filterRes = this.classList.filter(item => item.periodId == this.filterPeriod)
|
|
} else {
|
|
} else {
|
|
- filterRes = [...this.classroomList]
|
|
|
|
|
|
+ filterRes = [...this.classList]
|
|
}
|
|
}
|
|
- this.classroomListShow = filterRes.filter(item => item.name.indexOf(this.keyword) != -1)
|
|
|
|
|
|
+ this.classListShow = filterRes.filter(item => item.name.indexOf(this.keyword) != -1)
|
|
// 排序
|
|
// 排序
|
|
- this.classroomListShow = this.dataSort(this.classroomListShow)
|
|
|
|
|
|
+ this.classListShow = this.dataSort(this.classListShow)
|
|
this.curClassIndex = 0
|
|
this.curClassIndex = 0
|
|
- this.updateBefore = JSON.stringify(this.classroomListShow[this.curClassIndex])
|
|
|
|
|
|
+ this.updateBefore = JSON.stringify(this.classListShow[this.curClassIndex])
|
|
}
|
|
}
|
|
},
|
|
},
|
|
selectTab(index) {
|
|
selectTab(index) {
|
|
@@ -526,36 +527,36 @@ export default {
|
|
if (!valid) {
|
|
if (!valid) {
|
|
this.$Message.error(this.$t('schoolBaseInfo.formWarning'))
|
|
this.$Message.error(this.$t('schoolBaseInfo.formWarning'))
|
|
} else {
|
|
} else {
|
|
- let option = this.classroomListShow[this.curClassIndex].option
|
|
|
|
|
|
+ let option = this.classListShow[this.curClassIndex].option
|
|
if (!option) {
|
|
if (!option) {
|
|
option = 'update'
|
|
option = 'update'
|
|
} else {
|
|
} else {
|
|
- this.classroomListShow[this.curClassIndex]['code'] = this.$store.state.userInfo.schoolCode
|
|
|
|
|
|
+ this.classListShow[this.curClassIndex]['code'] = this.$store.state.userInfo.schoolCode
|
|
}
|
|
}
|
|
- delete this.classroomListShow[this.curClassIndex].option
|
|
|
|
|
|
+ delete this.classListShow[this.curClassIndex].option
|
|
this.isSaveLoading = true
|
|
this.isSaveLoading = true
|
|
this.isListLoading = true
|
|
this.isListLoading = true
|
|
- if (this.classroomListShow[this.curClassIndex].openType == '2') {
|
|
|
|
- this.classroomListShow[this.curClassIndex].teacher.id = ''
|
|
|
|
- this.classroomListShow[this.curClassIndex].teacher.name = ''
|
|
|
|
|
|
+ if (this.classListShow[this.curClassIndex].openType == '2') {
|
|
|
|
+ this.classListShow[this.curClassIndex].teacher.id = ''
|
|
|
|
+ this.classListShow[this.curClassIndex].teacher.name = ''
|
|
}
|
|
}
|
|
this.$api.schoolSetting.classUpsert({
|
|
this.$api.schoolSetting.classUpsert({
|
|
- classroom: this.classroomListShow[this.curClassIndex],
|
|
|
|
|
|
+ classroom: this.classListShow[this.curClassIndex],
|
|
option: option,
|
|
option: option,
|
|
school_code: this.$store.state.userInfo.schoolCode
|
|
school_code: this.$store.state.userInfo.schoolCode
|
|
}).then(
|
|
}).then(
|
|
res => {
|
|
res => {
|
|
if (res) {
|
|
if (res) {
|
|
if (res.error) {
|
|
if (res.error) {
|
|
- this.classroomListShow[this.curClassIndex].option = option
|
|
|
|
|
|
+ this.classListShow[this.curClassIndex].option = option
|
|
this.$Message.error(res.v)
|
|
this.$Message.error(res.v)
|
|
} else {
|
|
} else {
|
|
this.$Message.success(this.$t('schoolBaseInfo.csTips3'))
|
|
this.$Message.success(this.$t('schoolBaseInfo.csTips3'))
|
|
this.updated = false
|
|
this.updated = false
|
|
if (option == 'insert') {
|
|
if (option == 'insert') {
|
|
- this.classroomListShow[this.curClassIndex].code = 'Class-' + this.classroomListShow[this.curClassIndex].code
|
|
|
|
- this.classroomList.unshift(this.classroomListShow[this.curClassIndex])
|
|
|
|
- this.$store.dispatch('user/addSchoolClasses', this.classroomListShow[this.curClassIndex]);
|
|
|
|
|
|
+ this.classListShow[this.curClassIndex].code = 'Class-' + this.classListShow[this.curClassIndex].code
|
|
|
|
+ this.classList.unshift(this.classListShow[this.curClassIndex])
|
|
|
|
+ this.$store.dispatch('user/addSchoolClasses', this.classListShow[this.curClassIndex]);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
@@ -574,37 +575,12 @@ export default {
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- getClassroom() {
|
|
|
|
- this.isListLoading = true
|
|
|
|
- this.$store.dispatch('user/getSchoolProfile').then(
|
|
|
|
- (res) => {
|
|
|
|
- if (res) {
|
|
|
|
- this.classroomList = res.school_classes
|
|
|
|
- this.schoolBase = res.school_base
|
|
|
|
- if (this.classroomList.length > 0) {
|
|
|
|
- this.updateBefore = JSON.stringify(this.classroomList[0])
|
|
|
|
- }
|
|
|
|
- this.filterClassname()
|
|
|
|
- // 預設搜尋給第一個
|
|
|
|
- if (this.periods) this.filterPeriod = this.periods[0].id
|
|
|
|
- this.filterByPeriod()
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- (err) => {
|
|
|
|
- this.$Message.error('API error!')
|
|
|
|
- }
|
|
|
|
- ).finally(() => {
|
|
|
|
- setTimeout(() => {
|
|
|
|
- this.isListLoading = false
|
|
|
|
- }, 500)
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
/**显示确认删除班级对话框 */
|
|
/**显示确认删除班级对话框 */
|
|
showConfirmDelete() {
|
|
showConfirmDelete() {
|
|
if (this.$access.can('admin.*|classroom-upd')) {
|
|
if (this.$access.can('admin.*|classroom-upd')) {
|
|
this.$Modal.confirm({
|
|
this.$Modal.confirm({
|
|
title: this.$t('schoolBaseInfo.delClass'),
|
|
title: this.$t('schoolBaseInfo.delClass'),
|
|
- content: this.$t('schoolBaseInfo.delete') + this.classroomListShow[this.curClassIndex].name + this.$t('schoolBaseInfo.delContent'),
|
|
|
|
|
|
+ content: this.$t('schoolBaseInfo.delete') + this.classListShow[this.curClassIndex].name + this.$t('schoolBaseInfo.delContent'),
|
|
onOk: () => {
|
|
onOk: () => {
|
|
this.delClassroom(this.curClassIndex)
|
|
this.delClassroom(this.curClassIndex)
|
|
}
|
|
}
|
|
@@ -615,32 +591,32 @@ export default {
|
|
},
|
|
},
|
|
delClassroom(index) {
|
|
delClassroom(index) {
|
|
this.isListLoading = true
|
|
this.isListLoading = true
|
|
- if (this.classroomListShow[index].option !== 'insert') {
|
|
|
|
|
|
+ if (this.classListShow[index].option !== 'insert') {
|
|
this.$api.schoolSetting.delClassroom({
|
|
this.$api.schoolSetting.delClassroom({
|
|
- id: this.classroomListShow[index].id,
|
|
|
|
- scope: this.classroomListShow[index].scope,
|
|
|
|
|
|
+ id: this.classListShow[index].id,
|
|
|
|
+ scope: this.classListShow[index].scope,
|
|
school_code: this.$store.state.userInfo.schoolCode
|
|
school_code: this.$store.state.userInfo.schoolCode
|
|
}).then(
|
|
}).then(
|
|
(res) => {
|
|
(res) => {
|
|
if (res.error == null) {
|
|
if (res.error == null) {
|
|
if (this.curClassIndex >= index && index > 0) {
|
|
if (this.curClassIndex >= index && index > 0) {
|
|
this.curClassIndex = 0
|
|
this.curClassIndex = 0
|
|
- this.updateBefore = JSON.stringify(this.classroomListShow[this.curClassIndex])
|
|
|
|
|
|
+ this.updateBefore = JSON.stringify(this.classListShow[this.curClassIndex])
|
|
}
|
|
}
|
|
let originIndex = -1
|
|
let originIndex = -1
|
|
- for (let i in this.classroomList) {
|
|
|
|
- if (this.classroomList[i].id == this.classroomListShow[index].id) {
|
|
|
|
|
|
+ for (let i in this.classList) {
|
|
|
|
+ if (this.classList[i].id == this.classListShow[index].id) {
|
|
originIndex = i
|
|
originIndex = i
|
|
break
|
|
break
|
|
}
|
|
}
|
|
}
|
|
}
|
|
this.$api.schoolSetting.hiteachUnlinkByClassId({
|
|
this.$api.schoolSetting.hiteachUnlinkByClassId({
|
|
- classId: this.classroomListShow[index].id,
|
|
|
|
|
|
+ classId: this.classListShow[index].id,
|
|
school_code: this.$store.state.userInfo.schoolCode
|
|
school_code: this.$store.state.userInfo.schoolCode
|
|
- })
|
|
|
|
- this.$store.dispatch('user/delSchoolClasses', this.classroomListShow[index].id);
|
|
|
|
- this.classroomList.splice(originIndex, 1)
|
|
|
|
- this.classroomListShow.splice(index, 1)
|
|
|
|
|
|
+ })
|
|
|
|
+ this.$store.dispatch('user/delSchoolClasses', this.classListShow[index].id);
|
|
|
|
+ this.classList.splice(originIndex, 1)
|
|
|
|
+ this.classListShow.splice(index, 1)
|
|
this.$Message.success(this.$t('schoolBaseInfo.csTips7'))
|
|
this.$Message.success(this.$t('schoolBaseInfo.csTips7'))
|
|
this.updated = false
|
|
this.updated = false
|
|
}
|
|
}
|
|
@@ -654,9 +630,9 @@ export default {
|
|
} else {
|
|
} else {
|
|
if (this.curClassIndex >= index && index > 0) {
|
|
if (this.curClassIndex >= index && index > 0) {
|
|
this.curClassIndex = 0
|
|
this.curClassIndex = 0
|
|
- this.updateBefore = JSON.stringify(this.classroomListShow[this.curClassIndex])
|
|
|
|
|
|
+ this.updateBefore = JSON.stringify(this.classListShow[this.curClassIndex])
|
|
}
|
|
}
|
|
- this.classroomListShow.splice(index, 1)
|
|
|
|
|
|
+ this.classListShow.splice(index, 1)
|
|
this.isListLoading = false
|
|
this.isListLoading = false
|
|
this.updated = false
|
|
this.updated = false
|
|
}
|
|
}
|
|
@@ -669,29 +645,29 @@ export default {
|
|
content: this.$t('schoolBaseInfo.saveClassWarning'),
|
|
content: this.$t('schoolBaseInfo.saveClassWarning'),
|
|
okText: this.$t('schoolBaseInfo.leaveText'),
|
|
okText: this.$t('schoolBaseInfo.leaveText'),
|
|
onOk: () => {
|
|
onOk: () => {
|
|
- if (this.classroomListShow[this.curClassIndex].option == 'insert') {
|
|
|
|
|
|
+ if (this.classListShow[this.curClassIndex].option == 'insert') {
|
|
this.delClassroom(this.curClassIndex)
|
|
this.delClassroom(this.curClassIndex)
|
|
} else {
|
|
} else {
|
|
this.updated = false
|
|
this.updated = false
|
|
- this.$set(this.classroomListShow, this.curClassIndex, JSON.parse(this.updateBefore))
|
|
|
|
|
|
+ this.$set(this.classListShow, this.curClassIndex, JSON.parse(this.updateBefore))
|
|
this.curClassIndex = index
|
|
this.curClassIndex = index
|
|
- this.updateBefore = JSON.stringify(this.classroomListShow[this.curClassIndex])
|
|
|
|
|
|
+ this.updateBefore = JSON.stringify(this.classListShow[this.curClassIndex])
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
this.$Modal.confirm(config)
|
|
this.$Modal.confirm(config)
|
|
} else {
|
|
} else {
|
|
this.curClassIndex = index
|
|
this.curClassIndex = index
|
|
- this.updateBefore = JSON.stringify(this.classroomListShow[this.curClassIndex])
|
|
|
|
|
|
+ this.updateBefore = JSON.stringify(this.classListShow[this.curClassIndex])
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
addClassroom() {
|
|
addClassroom() {
|
|
if (this.$access.can('admin.*|classroom-upd')) {
|
|
if (this.$access.can('admin.*|classroom-upd')) {
|
|
this.keyword = ''
|
|
this.keyword = ''
|
|
- this.classroomListShow.unshift({
|
|
|
|
|
|
+ this.classListShow.unshift({
|
|
id: this.$jsFn.uuid(),
|
|
id: this.$jsFn.uuid(),
|
|
- name: this.$t('schoolBaseInfo.presetClassroomName') + (this.classroomList.length + 1),
|
|
|
|
|
|
+ name: this.$t('schoolBaseInfo.presetClassroomName') + (this.classList.length + 1),
|
|
no: '',
|
|
no: '',
|
|
teacher: {
|
|
teacher: {
|
|
id: '',
|
|
id: '',
|
|
@@ -703,7 +679,7 @@ export default {
|
|
option: 'insert'
|
|
option: 'insert'
|
|
})
|
|
})
|
|
this.curClassIndex = 0
|
|
this.curClassIndex = 0
|
|
- this.updateBefore = JSON.stringify(this.classroomListShow[this.curClassIndex])
|
|
|
|
|
|
+ this.updateBefore = JSON.stringify(this.classListShow[this.curClassIndex])
|
|
} else {
|
|
} else {
|
|
this.$Message.warning(this.$t('schoolBaseInfo.authWarning'))
|
|
this.$Message.warning(this.$t('schoolBaseInfo.authWarning'))
|
|
}
|
|
}
|
|
@@ -733,13 +709,27 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
|
|
+ this.isListLoading = true
|
|
this.$store.dispatch('user/getSchoolProfile').then(
|
|
this.$store.dispatch('user/getSchoolProfile').then(
|
|
res => {
|
|
res => {
|
|
|
|
+ console.log('数据',res)
|
|
this.schoolBase = res.school_base
|
|
this.schoolBase = res.school_base
|
|
|
|
+ this.classList = res.school_classes
|
|
|
|
+ this.roomList = res.school_rooms
|
|
|
|
+ if (this.classList.length > 0) {
|
|
|
|
+ this.updateBefore = JSON.stringify(this.classList[0])
|
|
|
|
+ }
|
|
|
|
+ this.filterClassname()
|
|
|
|
+ // 預設搜尋給第一個
|
|
|
|
+ if (this.periods) this.filterPeriod = this.periods[0].id
|
|
|
|
+ this.filterByPeriod()
|
|
}
|
|
}
|
|
- )
|
|
|
|
|
|
+ ).finally(() => {
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ this.isListLoading = false
|
|
|
|
+ }, 500)
|
|
|
|
+ })
|
|
if (this.$access.can('admin.*|classroom-upd')) this.editStatus = this.noStatus
|
|
if (this.$access.can('admin.*|classroom-upd')) this.editStatus = this.noStatus
|
|
- this.getClassroom()
|
|
|
|
this.$store.dispatch('teachers/getTeacherList').then(res => { })
|
|
this.$store.dispatch('teachers/getTeacherList').then(res => { })
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -800,7 +790,6 @@ export default {
|
|
.class-attr-wrap .ivu-divider {
|
|
.class-attr-wrap .ivu-divider {
|
|
background-color: #424242;
|
|
background-color: #424242;
|
|
}
|
|
}
|
|
-
|
|
|
|
</style>
|
|
</style>
|
|
<style lang="less">
|
|
<style lang="less">
|
|
.gradient {
|
|
.gradient {
|