|
@@ -23,17 +23,16 @@
|
|
|
</div>
|
|
|
<div class="class-list">
|
|
|
<vuescroll>
|
|
|
-
|
|
|
- <div class="class-list-item" v-for="(item,index) in classroomListShow" :key="index" @click="chooseClassroom(index)" :class="currentClassroomIndex == index ? 'block-bg block-bg-active':'block-bg'">
|
|
|
+ <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-left">
|
|
|
- <p class="class-name">{{item.classroomName}}</p>
|
|
|
+ <p class="class-name">{{item.name}}</p>
|
|
|
<p class="class-hiteach-code second-text-color">{{item.hiteach}}</p>
|
|
|
<p class="class-type">
|
|
|
<Icon type="md-arrow-dropright" size="18" />{{item.classroomType}}
|
|
|
</p>
|
|
|
<p class="second-text-color">
|
|
|
<span>{{$t('schoolBaseInfo.headmaster')}}</span>
|
|
|
- <span class="primary-text-color">{{item.headMaster}}</span>
|
|
|
+ <span class="primary-text-color">{{item.teacher.name}}</span>
|
|
|
</p>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -57,42 +56,49 @@
|
|
|
<!--班级属性-->
|
|
|
<div class="class-attr-wrap disabled-iview-select">
|
|
|
<vuescroll>
|
|
|
- <Form v-if="classroomList[currentClassroomIndex]" ref="classInfo" :model="classroomList[currentClassroomIndex]" :rules="classValidate" style="padding-top:20px;">
|
|
|
- <FormItem prop="classroomCode" @click.native.stop>
|
|
|
+ <Form v-if="classroomList[curClassIndex]" ref="classInfo" :model="classroomList[curClassIndex]" :rules="classValidate" style="padding-top:20px;">
|
|
|
+ <FormItem prop="id" @click.native.stop>
|
|
|
<span slot="label" class="class-attr-wrap-label">{{$t('schoolBaseInfo.classroomCode')}}</span>
|
|
|
- <Input :disabled="editStatus" v-model="classroomList[currentClassroomIndex].classroomCode" clearable :placeholder="$t('schoolBaseInfo.classroomCodeHolder')" />
|
|
|
+ <Input :disabled="editStatus" v-model="classroomList[curClassIndex].id" clearable :placeholder="$t('schoolBaseInfo.classroomCodeHolder')" />
|
|
|
</FormItem>
|
|
|
- <FormItem prop="classroomName" :label="$t('schoolBaseInfo.classroomName')" @click.native.stop>
|
|
|
+ <FormItem prop="name" :label="$t('schoolBaseInfo.classroomName')" @click.native.stop>
|
|
|
<span slot="label" class="class-attr-wrap-label">{{$t('schoolBaseInfo.classroomName')}}</span>
|
|
|
- <Input :disabled="editStatus" v-model="classroomList[currentClassroomIndex].classroomName" clearable :placeholder="$t('schoolBaseInfo.classroomNameHolder')" />
|
|
|
+ <Input :disabled="editStatus" v-model="classroomList[curClassIndex].name" clearable :placeholder="$t('schoolBaseInfo.classroomNameHolder')" />
|
|
|
</FormItem>
|
|
|
- <FormItem prop="classroomName" @click.native.stop>
|
|
|
+ <FormItem prop="openType" @click.native.stop>
|
|
|
<span slot="label" class="class-attr-wrap-label">班级属性</span>
|
|
|
- <Select :disabled="editStatus" v-model="classroomList[currentClassroomIndex].openType" clearable>
|
|
|
+ <Select :disabled="editStatus" v-model="classroomList[curClassIndex].openType" clearable>
|
|
|
<Option v-for="(item,index) in attributeList" :value="item.value" :key="index">{{ item.label }}</Option>
|
|
|
</Select>
|
|
|
</FormItem>
|
|
|
- <FormItem prop="headMaster" :label="$t('schoolBaseInfo.headmaster')" @click.native.stop>
|
|
|
- <span slot="label" class="class-attr-wrap-label">{{$t('schoolBaseInfo.headmaster')}}</span>
|
|
|
- <Select :disabled="editStatus" v-model="classroomList[currentClassroomIndex].headMaster" clearable>
|
|
|
- <Option v-for="(item,index) in $store.state.teachers.teacherList" :value="item.id" :key="index">{{ item.name }}</Option>
|
|
|
- </Select>
|
|
|
- </FormItem>
|
|
|
- <FormItem prop="periodCode" :label="$t('schoolBaseInfo.setPeriod')" @click.native.stop>
|
|
|
+ <FormItem prop="period.periodCode" :label="$t('schoolBaseInfo.setPeriod')" @click.native.stop>
|
|
|
<span slot="label" class="class-attr-wrap-label">{{$t('schoolBaseInfo.setPeriod')}}</span>
|
|
|
- <Select :disabled="editStatus" v-model="classroomList[currentClassroomIndex].periodCode" clearable>
|
|
|
- <Option v-for="(item,index) in $store.state.schoolBaseInfo.schoolBaseInfo.period" :value="item.periodCode" :key="index">{{ item.periodName }}</Option>
|
|
|
+ <Select :disabled="editStatus" v-model="classroomList[curClassIndex].period.periodCode" clearable>
|
|
|
+ <Option v-for="(item,index) in $store.state.schoolBaseInfo.schoolBaseInfo.period" :value="item.periodCode" :key="index" @click.native="classroomList[curClassIndex].period = { periodCode: item.periodCode, periodName: item.periodName }">
|
|
|
+ {{ item.periodName }}
|
|
|
+ </Option>
|
|
|
</Select>
|
|
|
</FormItem>
|
|
|
- <FormItem prop="gradeCode" :label="$t('schoolBaseInfo.setGrade')" @click.native.stop>
|
|
|
+ <FormItem prop="grade.gradeCode" :label="$t('schoolBaseInfo.setGrade')" @click.native.stop>
|
|
|
<span slot="label" class="class-attr-wrap-label">{{$t('schoolBaseInfo.setGrade')}}</span>
|
|
|
- <Select :disabled="editStatus" v-model="classroomList[currentClassroomIndex].gradeCode" clearable>
|
|
|
- <Option v-for="(item,index) in $jsFn.getPeriod($store.state.schoolBaseInfo.schoolBaseInfo,classroomList[currentClassroomIndex].periodCode).grades" :value="item.gradeCode" :key="index">{{ item.gradeName }}</Option>
|
|
|
+ <Select :disabled="editStatus" v-model="classroomList[curClassIndex].grade.gradeCode" clearable>
|
|
|
+ <Option v-for="(item,index) in $jsFn.getPeriod($store.state.schoolBaseInfo.schoolBaseInfo,classroomList[curClassIndex].period.periodCode).grades" :value="item.gradeCode" :key="index"
|
|
|
+ @click.native="classroomList[curClassIndex].grade = {gradeName: item.gradeName, gradeCode:item.gradeCode}">
|
|
|
+ {{ item.gradeName }}
|
|
|
+ </Option>
|
|
|
+ </Select>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem prop="teacher" :label="$t('schoolBaseInfo.headmaster')" @click.native.stop>
|
|
|
+ <span slot="label" class="class-attr-wrap-label">{{$t('schoolBaseInfo.headmaster')}}</span>
|
|
|
+ <Select :disabled="editStatus" v-model="classroomList[curClassIndex].teacher.id" clearable>
|
|
|
+ <Option v-for="(item,index) in $store.state.teachers.teacherList" :value="item.id" :key="index" @click.native="classroomList[curClassIndex].teacher = {id:item.id, name:item.name}">
|
|
|
+ {{ item.name }}
|
|
|
+ </Option>
|
|
|
</Select>
|
|
|
</FormItem>
|
|
|
<FormItem prop="hiteach" :label="$t('schoolBaseInfo.setHiteachCode')" @click.native.stop>
|
|
|
<span slot="label" class="class-attr-wrap-label">{{$t('schoolBaseInfo.setHiteachCode')}}</span>
|
|
|
- <Input ref="hiteachCode" @on-focus="toBlur" v-model="classroomList[currentClassroomIndex].hiteach" :disabled="editStatus" :placeholder="$t('schoolBaseInfo.hiTeachHolder')" clearable />
|
|
|
+ <Input ref="hiteachCode" @on-focus="toBlur" v-model="classroomList[curClassIndex].hiteach" :disabled="editStatus" :placeholder="$t('schoolBaseInfo.hiTeachHolder')" clearable />
|
|
|
</FormItem>
|
|
|
</Form>
|
|
|
</vuescroll>
|
|
@@ -102,7 +108,7 @@
|
|
|
<div class="hiteach-code-wrap-header">
|
|
|
<p>
|
|
|
{{$t('schoolBaseInfo.hiteachList')}}
|
|
|
- <Icon style="float:right;margin-right:12px;margin-top:2px;cursor:pointer;" class="label-icon" color="white" type="md-add" @click="addHiTeachCode" />
|
|
|
+ <Icon style="float:right;margin-right:12px;margin-top:2px;cursor:pointer;" class="label-icon" color="white" type="md-add" @click="addCode = true" />
|
|
|
</p>
|
|
|
<Input clearable v-model="serchCode" :placeholder="$t('schoolBaseInfo.codeHolder')" style="width: 100%;height:30px;" @on-change="filterCode">
|
|
|
<Icon style="margin-top:0px;" type="ios-search" slot="suffix" />
|
|
@@ -142,7 +148,6 @@
|
|
|
<Modal v-model="addCode"
|
|
|
:title="$t('schoolBaseInfo.addCodeTitle')"
|
|
|
@on-ok="confirmAdd"
|
|
|
- @on-cancel="cancelAdd"
|
|
|
class-name="dark-iview-modal dark-iview-form">
|
|
|
<Form :model="hiTeachItem" :label-width="80" label-position="left">
|
|
|
<FormItem :label="$t('schoolBaseInfo.hiTeach')">
|
|
@@ -156,69 +161,28 @@
|
|
|
</FormItem>
|
|
|
</Form>
|
|
|
</Modal>
|
|
|
- <Modal v-model="delClassroomStatus"
|
|
|
+ <Modal v-model="delClassStatus"
|
|
|
title="删除班级"
|
|
|
@on-ok="delClassroom(delIndex)">
|
|
|
- <p v-if="delIndex">确认删除 {{classroomListShow[delIndex].classroomName}} 吗?</p>
|
|
|
+ <p v-if="delIndex">确认删除 {{classroomListShow[delIndex].name}} 吗?</p>
|
|
|
</Modal>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-
|
|
|
- import Loading from '@/common/Loading.vue'
|
|
|
export default {
|
|
|
- components: {
|
|
|
- Loading
|
|
|
- },
|
|
|
data() {
|
|
|
return {
|
|
|
- attributeList: [
|
|
|
- {
|
|
|
- value: '1',
|
|
|
- label: '常规班级(有固定学生)'
|
|
|
- },
|
|
|
- {
|
|
|
- value: '2',
|
|
|
- label: '专科班级(无固定学生)'
|
|
|
- }
|
|
|
- ],
|
|
|
editStatus: true,//可切换编辑状态
|
|
|
noStatus: false,
|
|
|
- teacherList: [],
|
|
|
isSearch: false,
|
|
|
currentTabIndex: 0,
|
|
|
- classValidate: {
|
|
|
- classroomCode: [
|
|
|
- { required: true, message: '请设置班级编码', trigger: 'change' }
|
|
|
- ],
|
|
|
- classroomName: [
|
|
|
- { required: true, message: '请输入班级名称', trigger: 'change' }
|
|
|
- ],
|
|
|
- headMaster: [
|
|
|
- { required: true, message: '请设置班主任', trigger: 'change' }
|
|
|
- ],
|
|
|
- periodCode: [
|
|
|
- { required: true, message: '请设置学段', trigger: 'change' }
|
|
|
- ],
|
|
|
- gradeCode: [
|
|
|
- { required: true, message: '请设置年级', trigger: 'change' }
|
|
|
- ]
|
|
|
- },
|
|
|
- delClassroomStatus: false,
|
|
|
+ delClassStatus: false,
|
|
|
isListLoading: false,
|
|
|
isSaveLoading: false,
|
|
|
- hiTeachItem: {
|
|
|
- code: '',
|
|
|
- single: undefined,
|
|
|
- using: 0
|
|
|
- },
|
|
|
addCode: false,
|
|
|
isInit: true,
|
|
|
updated: false,
|
|
|
- model1: '',
|
|
|
- headMaster: '',
|
|
|
- className: '',
|
|
|
hiTeachsShow: [],
|
|
|
hiTeachs: [
|
|
|
{
|
|
@@ -288,23 +252,8 @@
|
|
|
],
|
|
|
classroomList: [],
|
|
|
classroomListShow: [],
|
|
|
- periodList: [
|
|
|
- {
|
|
|
- periodName: '暂无学段信息',
|
|
|
- periodCode: '',
|
|
|
- grades: [
|
|
|
- {
|
|
|
- gradeName: '暂无年级信息',
|
|
|
- gradeCode: ''
|
|
|
- }
|
|
|
- ]
|
|
|
- }
|
|
|
- ],
|
|
|
- gradeList: [],
|
|
|
- currentClassroomIndex: 0,
|
|
|
+ curClassIndex: 0,
|
|
|
schoolPlan: '',
|
|
|
- file: '',
|
|
|
- imgUrl: '',
|
|
|
point: {},
|
|
|
clickPoint: {},
|
|
|
isMouseDown: false,
|
|
@@ -317,16 +266,51 @@
|
|
|
textStatus: true,
|
|
|
serchClassName: '',
|
|
|
serchCode: '',
|
|
|
- serchHiteach: '',
|
|
|
scaleDefault: 1,
|
|
|
maxScale: 3,
|
|
|
minScale: 0.4,
|
|
|
scaleStep: 0.1,
|
|
|
stopScale: false,
|
|
|
- delIndex: undefined
|
|
|
+ delIndex: undefined,
|
|
|
+ hiTeachItem: {
|
|
|
+ code: '',
|
|
|
+ single: undefined,
|
|
|
+ using: 0
|
|
|
+ },
|
|
|
+ attributeList: [
|
|
|
+ {
|
|
|
+ value: '1',
|
|
|
+ label: '常规班级(有固定学生)'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: '2',
|
|
|
+ label: '专科班级(无固定学生)'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ classValidate: {
|
|
|
+ id: [
|
|
|
+ { required: true, message: '请设置班级编码', trigger: 'change' }
|
|
|
+ ],
|
|
|
+ name: [
|
|
|
+ { required: true, message: '请输入班级名称', trigger: 'change' }
|
|
|
+ ],
|
|
|
+ openType: [
|
|
|
+ { required: true, message: '请教室属性', trigger: 'change' }
|
|
|
+ ],
|
|
|
+ 'period.periodCode': [
|
|
|
+ { required: true, message: '请设置学段', trigger: 'change' }
|
|
|
+ ],
|
|
|
+ 'grade.gradeCode': [
|
|
|
+ { required: true, message: '请设置年级', trigger: 'change' }
|
|
|
+ ]
|
|
|
+ },
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ setPeriodObj(item) {
|
|
|
+ this.classroomList[this.curClassIndex].period.periodName = item.periodName
|
|
|
+ this.classroomList[this.curClassIndex].period.periodCode = item.periodCode
|
|
|
+ },
|
|
|
//处理失去焦点
|
|
|
toBlur() {
|
|
|
this.$Message.warning('请从右侧序列号列表中选择')
|
|
@@ -338,9 +322,6 @@
|
|
|
this.bundleScoll()
|
|
|
}
|
|
|
},
|
|
|
- addHiTeachCode() {
|
|
|
- this.addCode = true
|
|
|
- },
|
|
|
confirmAdd() {
|
|
|
this.hiTeachs.push(this.hiTeachItem)
|
|
|
this.filterCode()
|
|
@@ -349,9 +330,6 @@
|
|
|
single: undefined,
|
|
|
using: 0
|
|
|
}
|
|
|
- },
|
|
|
- cancelAdd() {
|
|
|
-
|
|
|
},
|
|
|
bundleScoll() {
|
|
|
let schoolPlanBox = document.getElementById('school-plan-box')
|
|
@@ -438,7 +416,7 @@
|
|
|
if (this.serchClassname == '') {
|
|
|
this.classroomListShow = [...this.classroomList]
|
|
|
} else {
|
|
|
- this.classroomListShow = this.classroomList.filter(item => item.classroomName.indexOf(_this.serchClassName) != -1)
|
|
|
+ this.classroomListShow = this.classroomList.filter(item => item.name.indexOf(_this.serchClassName) != -1)
|
|
|
}
|
|
|
},
|
|
|
drawText(text, x, y) {
|
|
@@ -470,7 +448,7 @@
|
|
|
this.schoolPlan = document.getElementById('school-plan')
|
|
|
let ctx = this.schoolPlan.getContext('2d')
|
|
|
for (let i = 0; i < this.classroomList.length; i++) {
|
|
|
- let icon = i == this.currentClassroomIndex ? this.greenImageData : this.whiteImageData
|
|
|
+ let icon = i == this.curClassIndex ? this.greenImageData : this.whiteImageData
|
|
|
ctx.drawImage(icon,
|
|
|
this.classroomList[i].point.x * this.scaleDefault, this.classroomList[i].point.y * this.scaleDefault,
|
|
|
20 * this.scaleDefault, 20 * this.scaleDefault)
|
|
@@ -497,7 +475,7 @@
|
|
|
this.point = this.getCanvasPoint(e.clientX, e.clientY)
|
|
|
this.clickPoint = this.getCanvasPoint(e.clientX, e.clientY)
|
|
|
this.activeIcon = this.checkActivieIcon(this.point)
|
|
|
- if (this.activeIcon != -1 && this.activeIcon != this.currentClassroomIndex) {
|
|
|
+ if (this.activeIcon != -1 && this.activeIcon != this.curClassIndex) {
|
|
|
this.$Message.warning('当前班级未选中,不能移动!')
|
|
|
this.activeIcon = -1
|
|
|
} else {
|
|
@@ -521,7 +499,7 @@
|
|
|
let index = this.checkActivieIcon(this.point)
|
|
|
if (index != -1) {
|
|
|
if (this.textStatus == true) {
|
|
|
- this.drawText(this.classroomList[index].classroomName, (this.classroomList[index].point.x + 25) * this.scaleDefault, (this.classroomList[index].point.y + 20) * this.scaleDefault)
|
|
|
+ this.drawText(this.classroomList[index].name, (this.classroomList[index].point.x + 25) * this.scaleDefault, (this.classroomList[index].point.y + 20) * this.scaleDefault)
|
|
|
this.textStatus = false
|
|
|
}
|
|
|
} else {
|
|
@@ -595,8 +573,9 @@
|
|
|
reader.readAsDataURL(file)
|
|
|
reader.onload = () => {
|
|
|
const _base64 = reader.result
|
|
|
- this.imgUrl = _base64 // 将_base64赋值给图片的src,实现图片预览
|
|
|
- _this.drawSchoolPlan(this.imgUrl)
|
|
|
+ //this.imgUrl = _base64 // 将_base64赋值给图片的src,实现图片预览
|
|
|
+ //_this.drawSchoolPlan(this.imgUrl)
|
|
|
+ _this.drawSchoolPlan(_base64)
|
|
|
}
|
|
|
return false
|
|
|
},
|
|
@@ -605,26 +584,37 @@
|
|
|
if (!valid) {
|
|
|
this.$Message.error('请先完善班级信息再保存!')
|
|
|
} else {
|
|
|
- this.classroomList[this.currentClassroomIndex]['code'] = this.$store.state.userInfo.schoolCode
|
|
|
+ let option = this.classroomList[this.curClassIndex].option
|
|
|
+ if (!option) {
|
|
|
+ option = 'update'
|
|
|
+ }
|
|
|
+ delete this.classroomList[this.curClassIndex].option
|
|
|
+ this.classroomList[this.curClassIndex]['code'] = this.$store.state.userInfo.schoolCode
|
|
|
this.isSaveLoading = true
|
|
|
this.isListLoading = true
|
|
|
- this.$api.schoolSetting.classroomSettingSaveOrUpdate(this.classroomList[this.currentClassroomIndex]).then(
|
|
|
+ this.$api.schoolSetting.classroomSettingSaveOrUpdate({
|
|
|
+ classroom: this.classroomList[this.curClassIndex],
|
|
|
+ option: option
|
|
|
+ }).then(
|
|
|
res => {
|
|
|
if (res) {
|
|
|
- this.$Message.success(this.$t('schoolBaseInfo.csTips3'))
|
|
|
- this.classroomList[this.currentClassroomIndex].id = res.id
|
|
|
- this.updated = false
|
|
|
- this.isSaveLoading = false
|
|
|
- this.isListLoading = false
|
|
|
- } else {
|
|
|
- if (res.error.code == 4) {
|
|
|
- this.$Message.error('班级编码已经存在,请重新设置班级编码!')
|
|
|
- this.isSaveLoading = false
|
|
|
- this.isListLoading = false
|
|
|
+ if (res.error) {
|
|
|
+ this.classroomList[this.curClassIndex].option = 'insert'
|
|
|
+ this.$Message.error(res.v)
|
|
|
+ } else {
|
|
|
+ this.$Message.success(this.$t('schoolBaseInfo.csTips3'))
|
|
|
+ this.updated = false
|
|
|
}
|
|
|
+
|
|
|
+ } else {
|
|
|
+ this.$Message.error('API error!')
|
|
|
}
|
|
|
},
|
|
|
err => {
|
|
|
+ console.log(err)
|
|
|
+ }
|
|
|
+ ).finally(
|
|
|
+ () => {
|
|
|
this.isSaveLoading = false
|
|
|
this.isListLoading = false
|
|
|
}
|
|
@@ -640,8 +630,7 @@
|
|
|
if (res.code == 1 || res.code == 3) {
|
|
|
this.classroomList = this.$store.state.schoolBaseInfo.classroomList
|
|
|
this.filterClassname()
|
|
|
- } else {
|
|
|
- }
|
|
|
+ }
|
|
|
setTimeout(() => {
|
|
|
this.isListLoading = false
|
|
|
}, 500)
|
|
@@ -649,12 +638,16 @@
|
|
|
(err) => {
|
|
|
this.isListLoading = false
|
|
|
}
|
|
|
- )
|
|
|
+ ).finally(() => {
|
|
|
+ setTimeout(() => {
|
|
|
+ this.isListLoading = false
|
|
|
+ }, 500)
|
|
|
+ })
|
|
|
},
|
|
|
/**显示确认删除班级对话框 */
|
|
|
showConfirmDelete(index) {
|
|
|
- this.delClassroomStatus = true
|
|
|
- this.delIndex = this.currentClassroomIndex
|
|
|
+ this.delClassStatus = true
|
|
|
+ this.delIndex = this.curClassIndex
|
|
|
},
|
|
|
|
|
|
delClassroom(index) {
|
|
@@ -665,8 +658,8 @@
|
|
|
}).then(
|
|
|
(res) => {
|
|
|
if (res.error == null) {
|
|
|
- if (this.currentClassroomIndex >= index && index > 0) {
|
|
|
- this.currentClassroomIndex = 0
|
|
|
+ if (this.curClassIndex >= index && index > 0) {
|
|
|
+ this.curClassIndex = 0
|
|
|
}
|
|
|
this.delIndex = undefined
|
|
|
this.classroomList.splice(index, 1)
|
|
@@ -684,8 +677,8 @@
|
|
|
}
|
|
|
)
|
|
|
} else {
|
|
|
- if (this.currentClassroomIndex >= index && index > 0) {
|
|
|
- this.currentClassroomIndex = 0
|
|
|
+ if (this.curClassIndex >= index && index > 0) {
|
|
|
+ this.curClassIndex = 0
|
|
|
}
|
|
|
this.delIndex = undefined
|
|
|
this.classroomList.splice(index, 1)
|
|
@@ -701,7 +694,7 @@
|
|
|
this.$Message.success(this.$t('schoolBaseInfo.csTips5'))
|
|
|
},
|
|
|
chooseClassroom(index) {
|
|
|
- if (index != this.currentClassroomIndex) {
|
|
|
+ if (index != this.curClassIndex) {
|
|
|
if (this.updated) {
|
|
|
let config = {
|
|
|
render: (h) => {
|
|
@@ -715,7 +708,7 @@
|
|
|
})
|
|
|
},
|
|
|
onOk: () => {
|
|
|
- this.delClassroom(this.currentClassroomIndex)
|
|
|
+ this.delClassroom(this.curClassIndex)
|
|
|
},
|
|
|
onCancel: () => {
|
|
|
|
|
@@ -723,7 +716,7 @@
|
|
|
}
|
|
|
this.$Modal.confirm(config)
|
|
|
} else {
|
|
|
- this.currentClassroomIndex = index
|
|
|
+ this.curClassIndex = index
|
|
|
}
|
|
|
if (this.currentTabIndex == 1) {
|
|
|
this.initIcon()
|
|
@@ -746,16 +739,16 @@
|
|
|
if (this.hiTeachs[i].using > 0) {
|
|
|
this.$Message.warning(this.$t('schoolBaseInfo.csTips6'))
|
|
|
} else {
|
|
|
- if (!this.isEmpty(this.classroomList[this.currentClassroomIndex].hiteach)) {
|
|
|
+ if (!this.isEmpty(this.classroomList[this.curClassIndex].hiteach)) {
|
|
|
let showIndex = -1
|
|
|
let allIndex = -1
|
|
|
this.hiTeachsShow.forEach((v, i) => {
|
|
|
- if (v.code == this.classroomList[this.currentClassroomIndex].hiteach) {
|
|
|
+ if (v.code == this.classroomList[this.curClassIndex].hiteach) {
|
|
|
showIndex = i
|
|
|
}
|
|
|
})
|
|
|
this.hiTeachs.forEach((v, i) => {
|
|
|
- if (v.code == this.classroomList[this.currentClassroomIndex].hiteach) {
|
|
|
+ if (v.code == this.classroomList[this.curClassIndex].hiteach) {
|
|
|
allIndex = i
|
|
|
}
|
|
|
})
|
|
@@ -765,20 +758,20 @@
|
|
|
}
|
|
|
}
|
|
|
this.hiTeachs[i].using = 1
|
|
|
- this.classroomList[this.currentClassroomIndex].hiteach = this.hiTeachsShow[index].code
|
|
|
- this.classroomList[this.currentClassroomIndex].classroomType = '智慧班级'
|
|
|
+ this.classroomList[this.curClassIndex].hiteach = this.hiTeachsShow[index].code
|
|
|
+ this.classroomList[this.curClassIndex].classroomType = '智慧班级'
|
|
|
}
|
|
|
} else {
|
|
|
- if (!this.isEmpty(this.classroomList[this.currentClassroomIndex].hiteach)) {
|
|
|
+ if (!this.isEmpty(this.classroomList[this.curClassIndex].hiteach)) {
|
|
|
let showIndex = -1
|
|
|
let allIndex = -1
|
|
|
this.hiTeachsShow.forEach((v, i) => {
|
|
|
- if (v.code == this.classroomList[this.currentClassroomIndex].hiteach) {
|
|
|
+ if (v.code == this.classroomList[this.curClassIndex].hiteach) {
|
|
|
showIndex = i
|
|
|
}
|
|
|
})
|
|
|
this.hiTeachs.forEach((v, i) => {
|
|
|
- if (v.code == this.classroomList[this.currentClassroomIndex].hiteach) {
|
|
|
+ if (v.code == this.classroomList[this.curClassIndex].hiteach) {
|
|
|
allIndex = i
|
|
|
}
|
|
|
})
|
|
@@ -787,8 +780,8 @@
|
|
|
}
|
|
|
}
|
|
|
this.hiTeachs[i].using++
|
|
|
- this.classroomList[this.currentClassroomIndex].hiteach = this.hiTeachsShow[index].code
|
|
|
- this.classroomList[this.currentClassroomIndex].classroomType = '智慧班级'
|
|
|
+ this.classroomList[this.curClassIndex].hiteach = this.hiTeachsShow[index].code
|
|
|
+ this.classroomList[this.curClassIndex].classroomType = '智慧班级'
|
|
|
}
|
|
|
this.filterCode()
|
|
|
}
|
|
@@ -825,23 +818,32 @@
|
|
|
addClassroom() {
|
|
|
this.serchClassName = ''
|
|
|
this.classroomList.unshift({
|
|
|
- classroomName: this.$t('schoolBaseInfo.presetClassroomName') + (this.classroomList.length + 1),
|
|
|
- hiteach: '',
|
|
|
- headMaster: this.$t('schoolBaseInfo.presetHeadmaster'),
|
|
|
- periodCode: '',
|
|
|
- gradeCode: '',
|
|
|
- studentCount: 0,
|
|
|
+ id: '',
|
|
|
+ name: this.$t('schoolBaseInfo.presetClassroomName') + (this.classroomList.length + 1),
|
|
|
classroomType: '一般班级',
|
|
|
- classroomCode: '',
|
|
|
+ hiteach: '',
|
|
|
+ openType: '1',
|
|
|
+ teacher: {
|
|
|
+ id: '',
|
|
|
+ name: ''
|
|
|
+ },
|
|
|
+ period: {
|
|
|
+ periodCode: '',
|
|
|
+ periodName: ''
|
|
|
+ },
|
|
|
+ grade: {
|
|
|
+ gradeName: '',
|
|
|
+ gradeCode:''
|
|
|
+ },
|
|
|
point: {
|
|
|
x: 5,
|
|
|
y: 5
|
|
|
- }
|
|
|
+ },
|
|
|
+ option:'insert'
|
|
|
})
|
|
|
this.classroomListShow = [...this.classroomList]
|
|
|
this.drawIcon(5, 6)
|
|
|
- //this.currentClassroomIndex = this.classroomList.length - 1
|
|
|
- this.currentClassroomIndex = 0
|
|
|
+ this.curClassIndex = 0
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|