ソースを参照

重新调整班级管理数据结构

liqk 4 年 前
コミット
5ae00bf00b

+ 1 - 1
TEAMModelGrpc/Services/ClassroomService.cs

@@ -42,7 +42,7 @@ namespace TEAMModelGrpc.Services
                 {
                     ClassStudent students = new ClassStudent();
                     students.code = classroom.code;
-                    students.id = classroom.classroomCode;
+                    //students.id = classroom.classroomCode;
                     await _azureCosmos.SaveOrUpdate(students);
                     classrooms.Add(await _azureCosmos.SaveOrUpdate(classroom));
 

+ 11 - 11
TEAMModelOS/ClientApp/src/utils/js-fn.js

@@ -54,17 +54,17 @@ function getBtwRandom(start, end) {
 function getPeriod(data, periodCode) {
     if (data == undefined) {
         return {
-            periodName: '暂无数据',
-            periodCode: '00',
+            name: '暂无数据',
+            id: '00',
             grades: [],
             subjects: []
         }
     } else {
-        let result = JSONPath.query(data, "$..[?(@.periodCode=='" + periodCode + "')]")
+        let result = JSONPath.query(data, "$..[?(@.id=='" + periodCode + "')]")
         if (result.length == 0) {
             return {
-                periodName: '暂无数据',
-                periodCode: '00',
+                name: '暂无数据',
+                id: '00',
                 grades: [],
                 subjects: []
             }
@@ -77,22 +77,22 @@ function getPeriod(data, periodCode) {
  * 根据年级编码获取对应Name
  */
 function getGradeName(data, gradeCode) {
-    let result = JSONPath.query(data, "$..[?(@.gradeCode=='" + gradeCode + "')]")
+    let result = JSONPath.query(data, "$..[?(@.id=='" + gradeCode + "')]")
     if (result.length == 0) {
         return '暂无数据'
     } else {
-        return result[0].gradeName
+        return result[0].name
     }
 }
 /*
  * 根据学科编码获取对应Name
  */
 function getSubjectName(data, subjectCode) {
-    let result = JSONPath.query(data, "$..[?(@.subjectCode=='" + subjectCode + "')]")
+    let result = JSONPath.query(data, "$..[?(@.id=='" + subjectCode + "')]")
     if (result.length == 0) {
         return '暂无数据'
     } else {
-        return result[0].subjectName
+        return result[0].name
     }
 }
 /*
@@ -124,7 +124,7 @@ function compressImgByUrl(url, name, quality) {
                 let ctx = canvas.getContext('2d')
                 ctx.drawImage(img, 0, 0, img.width, img.height, 0, 0, canvas.width, canvas.height)
                 let newImgData = canvas.toDataURL('image/png', quality)
-                let resultFile = dataURLtoFile(newImgData, name)
+                //let resultFile = dataURLtoFile(newImgData, name)
                 r(newImgData)
             }
         }
@@ -153,7 +153,7 @@ function createVideoPoster(url, name, quality) {
                     let ctx = canvas.getContext('2d')
                     ctx.drawImage(video, 0, 0, video.videoWidth, video.videoHeight, 0, 0, canvas.width, canvas.height)
                     let newVideoData = canvas.toDataURL('image/png', quality)
-                    let resultFile = dataURLtoFile(newVideoData, name)
+                    //let resultFile = dataURLtoFile(newVideoData, name)
                     r(newVideoData)
                 })
             }

+ 34 - 44
TEAMModelOS/ClientApp/src/view/schoolmgmt/ClassroomSetting/ClassroomSetting.vue

@@ -10,7 +10,7 @@
                     <Icon class="action-btn-icon" type="md-add" @click="addClassroom()" />
                     <Icon class="action-btn-icon" type="md-trash" @click.stop="showConfirmDelete()" />
                     <Tag v-show="filterPeriod != undefined" closable @on-close="filterPeriod = undefined" color="#606060" style="margin-right:15px;margin-top:-5px;">
-                        {{$jsFn.getPeriod( $store.state.schoolBaseInfo.schoolBaseInfo.period,filterPeriod).periodName}}
+                        {{$jsFn.getPeriod( $store.state.schoolBaseInfo.schoolBaseInfo.period,filterPeriod).name}}
                     </Tag>
                     <Poptip trigger="hover" placement="bottom" offset="-8">
                         <Icon type="ios-funnel" class="action-btn-icon" size="16" style="padding-top:1px;" />
@@ -18,8 +18,8 @@
                             <div style="margin-top:5px;margin-bottom:10px;">
                                 <span>学段:</span>
                                 <Select v-model="filterPeriod" style="width:80px" size="small" clearable @on-change="filterByPeriod">
-                                    <Option v-for="(item,index) in $store.state.schoolBaseInfo.schoolBaseInfo.period" :value="item.periodCode" :key="index">
-                                        {{ item.periodName }}
+                                    <Option v-for="(item,index) in $store.state.schoolBaseInfo.schoolBaseInfo.period" :value="item.id" :key="index">
+                                        {{ item.name }}
                                     </Option>
                                 </Select>
                             </div>
@@ -41,9 +41,9 @@
                     <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.name}}</p>
-                            <p class="class-hiteach-code second-text-color">{{item.hiteach}}</p>
+                            <p class="class-hiteach-code second-text-color">{{item.sn}}</p>
                             <p class="class-type">
-                                <Icon type="md-arrow-dropright" size="18" />{{item.classroomType}}
+                                <Icon type="md-arrow-dropright" size="18" />{{item.style}}
                             </p>
                             <p class="second-text-color">
                                 <span>{{$t('schoolBaseInfo.headmaster')}}</span>
@@ -86,20 +86,19 @@
                                         <Option v-for="(item,index) in attributeList" :value="item.value" :key="index">{{ item.label }}</Option>
                                     </Select>
                                 </FormItem>
-                                <FormItem prop="period.periodCode" :label="$t('schoolBaseInfo.setPeriod')" @click.native.stop>
+                                <FormItem prop="periodId" :label="$t('schoolBaseInfo.setPeriod')" @click.native.stop>
                                     <span slot="label" class="class-attr-wrap-label">{{$t('schoolBaseInfo.setPeriod')}}</span>
-                                    <Select @on-change="watchUpdate" :disabled="editStatus" v-model="classroomListShow[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 }}
+                                    <Select @on-change="watchUpdate" :disabled="editStatus" v-model="classroomListShow[curClassIndex].periodId" clearable>
+                                        <Option v-for="(item,index) in $store.state.schoolBaseInfo.schoolBaseInfo.period" :value="item.id" :key="index">
+                                            {{ item.name }}
                                         </Option>
                                     </Select>
                                 </FormItem>
-                                <FormItem prop="grade.gradeCode" :label="$t('schoolBaseInfo.setGrade')" @click.native.stop>
+                                <FormItem prop="gradeId" :label="$t('schoolBaseInfo.setGrade')" @click.native.stop>
                                     <span slot="label" class="class-attr-wrap-label">{{$t('schoolBaseInfo.setGrade')}}</span>
-                                    <Select @on-change="watchUpdate" :disabled="editStatus" v-model="classroomListShow[curClassIndex].grade.gradeCode" clearable>
-                                        <Option v-for="(item,index) in $jsFn.getPeriod($store.state.schoolBaseInfo.schoolBaseInfo,classroomListShow[curClassIndex].period.periodCode).grades" :value="item.gradeCode" :key="index"
-                                                @click.native="classroomListShow[curClassIndex].grade = {gradeName: item.gradeName, gradeCode:item.gradeCode}">
-                                            {{ item.gradeName }}
+                                    <Select @on-change="watchUpdate" :disabled="editStatus" v-model="classroomListShow[curClassIndex].gradeId" clearable>
+                                        <Option v-for="(item,index) in $jsFn.getPeriod($store.state.schoolBaseInfo.schoolBaseInfo,classroomListShow[curClassIndex].periodId).grades" :value="item.id" :key="index">
+                                            {{ item.name }}
                                         </Option>
                                     </Select>
                                 </FormItem>
@@ -111,9 +110,9 @@
                                         </Option>
                                     </Select>
                                 </FormItem>
-                                <FormItem prop="hiteach" :label="$t('schoolBaseInfo.setHiteachCode')" @click.native.stop>
+                                <FormItem prop="sn" :label="$t('schoolBaseInfo.setHiteachCode')" @click.native.stop>
                                     <span slot="label" class="class-attr-wrap-label">{{$t('schoolBaseInfo.setHiteachCode')}}</span>
-                                    <Input @on-change="watchUpdate" ref="hiteachCode" @on-focus="toBlur" v-model="classroomListShow[curClassIndex].hiteach" :disabled="editStatus" :placeholder="$t('schoolBaseInfo.hiTeachHolder')" clearable />
+                                    <Input @on-change="watchUpdate" ref="hiteachCode" @on-focus="toBlur" v-model="classroomListShow[curClassIndex].sn" :disabled="editStatus" :placeholder="$t('schoolBaseInfo.hiTeachHolder')" clearable />
                                 </FormItem>
                             </Form>
                         </vuescroll>
@@ -327,10 +326,10 @@
                     openType: [
                         { required: true, message: '请教室属性', trigger: 'change' }
                     ],
-                    'period.periodCode': [
+                    periodId: [
                         { required: true, message: '请设置学段', trigger: 'change' }
                     ],
-                    'grade.gradeCode': [
+                    gradeId: [
                         { required: true, message: '请设置年级', trigger: 'change' }
                     ]
                 },
@@ -347,7 +346,7 @@
             },
             filterByPeriod() {
                 if (this.filterPeriod) {
-                    this.classroomListShow = this.classroomList.filter(item => item.period.periodCode == this.filterPeriod)
+                    this.classroomListShow = this.classroomList.filter(item => item.periodId == this.filterPeriod)
                 } else {
                     this.classroomListShow = [...this.classroomList]
                 }
@@ -358,7 +357,7 @@
                 } else {
                     let filterRes = []
                     if (this.filterPeriod) {
-                        filterRes = this.classroomList.filter(item => item.period.periodCode == this.filterPeriod)
+                        filterRes = this.classroomList.filter(item => item.periodId == this.filterPeriod)
                     } else {
                         filterRes = [...this.classroomList]
                     }
@@ -367,10 +366,6 @@
                     this.updateBefore = JSON.stringify(this.classroomListShow[this.curClassIndex])
                 }
             },
-            setPeriodObj(item) {
-                this.classroomList[this.curClassIndex].period.periodName = item.periodName
-                this.classroomList[this.curClassIndex].period.periodCode = item.periodCode
-            },
             //处理失去焦点
             toBlur() {
                 this.$Message.warning('请从右侧序列号列表中选择')
@@ -811,16 +806,16 @@
                         if (this.hiTeachs[i].using > 0) {
                             this.$Message.warning(this.$t('schoolBaseInfo.csTips6'))
                         } else {
-                            if (!this.isEmpty(this.classroomListShow[this.curClassIndex].hiteach)) {
+                            if (!this.isEmpty(this.classroomListShow[this.curClassIndex].sn)) {
                                 let showIndex = -1
                                 let allIndex = -1
                                 this.hiTeachsShow.forEach((v, i) => {
-                                    if (v.code == this.classroomListShow[this.curClassIndex].hiteach) {
+                                    if (v.code == this.classroomListShow[this.curClassIndex].sn) {
                                         showIndex = i
                                     }
                                 })
                                 this.hiTeachs.forEach((v, i) => {
-                                    if (v.code == this.classroomListShow[this.curClassIndex].hiteach) {
+                                    if (v.code == this.classroomListShow[this.curClassIndex].sn) {
                                         allIndex = i
                                     }
                                 })
@@ -829,21 +824,21 @@
                                 }
                             }
                             this.hiTeachs[i].using = 1
-                            this.classroomListShow[this.curClassIndex].hiteach = this.hiTeachsShow[index].code
-                            this.classroomListShow[this.curClassIndex].classroomType = '智慧班级'
+                            this.classroomListShow[this.curClassIndex].sn = this.hiTeachsShow[index].code
+                            this.classroomListShow[this.curClassIndex].style = 'smart'
                             this.updated = true
                         }
                     } else {
-                        if (!this.isEmpty(this.classroomListShow[this.curClassIndex].hiteach)) {
+                        if (!this.isEmpty(this.classroomListShow[this.curClassIndex].sn)) {
                             let showIndex = -1
                             let allIndex = -1
                             this.hiTeachsShow.forEach((v, i) => {
-                                if (v.code == this.classroomListShow[this.curClassIndex].hiteach) {
+                                if (v.code == this.classroomListShow[this.curClassIndex].sn) {
                                     showIndex = i
                                 }
                             })
                             this.hiTeachs.forEach((v, i) => {
-                                if (v.code == this.classroomListShow[this.curClassIndex].hiteach) {
+                                if (v.code == this.classroomListShow[this.curClassIndex].sn) {
                                     allIndex = i
                                 }
                             })
@@ -852,8 +847,8 @@
                             }
                         }
                         this.hiTeachs[i].using++
-                        this.classroomListShow[this.curClassIndex].hiteach = this.hiTeachsShow[index].code
-                        this.classroomListShow[this.curClassIndex].classroomType = '智慧班级'
+                        this.classroomListShow[this.curClassIndex].sn = this.hiTeachsShow[index].code
+                        this.classroomListShow[this.curClassIndex].style = 'smart'
                         this.updated = true
                     }
                     this.filterCode()
@@ -887,25 +882,20 @@
                 this.classroomListShow.unshift({
                     id: '',
                     name: this.$t('schoolBaseInfo.presetClassroomName') + (this.classroomList.length + 1),
-                    classroomType: '一般班级',
-                    hiteach: '',
+                    style: 'normal',
+                    sn: '',
                     openType: '1',
                     teacher: {
                         id: '',
                         name: ''
                     },
-                    period: {
-                        periodCode: '',
-                        periodName: ''
-                    },
-                    grade: {
-                        gradeName: '',
-                        gradeCode:''
-                    },
+                    periodId:'',
+                    gradeId:'',
                     point: {
                         x: 5,
                         y: 5
                     },
+                    scope:'school',
                     option:'insert'
                 })
                 //this.classroomListShow = [...this.classroomList]

+ 3 - 2
TEAMModelOS/ClientApp/src/view/schoolmgmt/SystemSetting/SystemSetting.less

@@ -237,9 +237,10 @@
             border: 1px solid aqua;
             width: fit-content;
             padding: 0px 5px;
-            border-radius: 10px;
+            border-radius: 4px;
             font-size: 10px;
             float: right;
+            margin-right:5px;
             margin-top: 5px;
         }
     }
@@ -268,7 +269,7 @@
             color: var(--primary-text-color);
             font-weight: bold;
             margin: 2px 0px;
-
+            width:100%;
             .period-btn-edit {
                 font-size: var(--font-size-normal);
                 margin-left: 10px;

+ 102 - 69
TEAMModelOS/ClientApp/src/view/schoolmgmt/SystemSetting/SystemSetting.vue

@@ -5,11 +5,11 @@
             <span class="setting-title">{{$t('schoolBaseInfo.schoolNameLabel')}}</span>
             <div class="editable school-name dark-iview-input disabled-iview-select text-cursor-disabled" @click.stop>
                 <Input v-model="schoolSetting.name" :disabled="!editSchNmStatus" placeholder="设置学段..." :style="{width: snWitdh+'px'}" />
-                <Icon type="md-create" class="edit-btn" title="编辑" @click.stop="editSchNmStatus = !editSchNmStatus"/>
+                <Icon type="md-create" class="edit-btn" title="编辑" @click.stop="editSchNmStatus = !editSchNmStatus" />
             </div>
             <div class="editable time-zone-select" style="margin-left:100px;" @click.stop>
                 <span class="setting-title">时区设置:</span>
-                <Select filterable v-model="schoolSetting.timeZone.value" label-in-value :style="{width: tzWidth+'px'}" placeholder="请设置时区...">
+                <Select filterable v-model="schoolSetting.timeZone.value" label-in-value :style="{width: tzWidth+'px', verticalAlign:'baseline'}" placeholder="请设置时区...">
                     <Option v-for="(item,index) in timeZoneList" :value="item.value" :key="index" @click.native="setTimeZone(item)">{{ item.label }}</Option>
                 </Select>
             </div>
@@ -30,9 +30,9 @@
                             <Draggable ghost-class="ghost" class="period-list list-group" :list="schoolSetting.period" :animation='200'>
                                 <div class="period-item list-group-item" v-for="(item,index) in schoolSetting.period" :key="index" @click.capture="choosePeriod(index)" :class="index == curPriodIndex ? 'block-bg-active block-bg':'block-bg'">
                                     <p class="period-item-name semester-name-label dark-iview-input" @click.stop>
-                                        <Input v-model="item.periodName" :disabled="editPrdIndex !== index" placeholder="设置学段..." style="width: 180px" />
+                                        <Input v-model="item.name" :disabled="editPrdIndex !== index" placeholder="设置学段..." style="width: 180px" />
                                         <span class="campus-label" @click="setCampus">
-                                            {{item.campusCode === null ? '请设置校区': $JSONPath.query(schoolSetting, "$..campuses[?(@.campusCode=='" + item.campusCode + "')]").length > 0 ? $JSONPath.query(schoolSetting, "$..campuses[?(@.campusCode=='" + item.campusCode + "')]")[0].campusName : '请设置校区' }}
+                                            {{item.campusId === null ? '请设置校区': $JSONPath.query(schoolSetting, "$..campuses[?(@.id=='" + item.campusId + "')]").length > 0 ? $JSONPath.query(schoolSetting, "$..campuses[?(@.id=='" + item.campusId + "')]")[0].name : '请设置校区' }}
                                         </span>
                                     </p>
                                     <p class="period-item-num"><span></span>{{ $t('schoolBaseInfo.semesterNum') + item.semesters.length}}</p>
@@ -55,7 +55,7 @@
                                     <div v-for="(item,index) in schoolSetting.period[curPriodIndex].semesters" :key="index" :class="index == curSemIndex ? 'term-item block-bg block-bg-active':'term-item block-bg'" @click.capture="chooseSemester(index)">
                                         <span class="term-item-name-line" :style="{backgroundColor: colorList[index]}"></span>
                                         <p class="semester-name-label" @click.stop>
-                                            <Input v-model="item.semesterName" :disabled="editSemIndex !== index" placeholder="设置学期..." style="width: 180px" />
+                                            <Input v-model="item.name" :disabled="editSemIndex !== index" placeholder="设置学期..." style="width: 180px" />
                                         </p>
                                         <div class="term-item-start" @click.stop>
                                             <span>{{$t('schoolBaseInfo.startDate')}}</span>
@@ -74,7 +74,8 @@
                                 <div class="term-item-time-line" v-if="schoolSetting.period[curPriodIndex].semesters.length">
                                     <ul>
                                         <li v-for="(item,index) in monthList" :key="index" :title="timeLineColor(index).text">
-                                            <span class="time-label" :style="{color: timeLineColor(index).color}">{{item}}</span>
+                                            <!--<span class="time-label" :style="{color: timeLineColor(index).color}">{{item}}</span>-->
+                                            <span class="time-label">{{item}}</span>
                                             <span class="time-dot" :style="{borderColor: timeLineColor(index).color}">
                                                 <span class="time-inner-dot" :style="{backgroundColor: timeLineColor(index).color}"></span>
                                                 <span class="time-line-tail"></span>
@@ -102,11 +103,11 @@
                             </div>
                             <div class="grade-body">
                                 <Draggable ghost-class="ghost" class="grade-list list-group" :list="schoolSetting.period[curPriodIndex].grades" :animation='200'>
-                                        <div class="grade-item list-group-item" v-for="(item,index) in schoolSetting.period[curPriodIndex].grades" :key="index">
-                                            <span class="grade-order">{{index + 1}}</span>
-                                            <Input class="grade-name" v-model="item.gradeName" :disabled="!editGraStatus" placeholder="设置年级..." :style="{width: getWidth(index,item.gradeName)+'px'}" />
-                                            <Icon type="md-close" @click="showDelGrade(index)" style="cursor:pointer;flex:0.1" v-show="delGraStatus" />
-                                        </div>
+                                    <div class="grade-item list-group-item" v-for="(item,index) in schoolSetting.period[curPriodIndex].grades" :key="index">
+                                        <span class="grade-order">{{index + 1}}</span>
+                                        <Input class="grade-name" v-model="item.name" :disabled="!editGraStatus" placeholder="设置年级..." :style="{width: getWidth(index,item.name)+'px'}" />
+                                        <Icon type="md-close" @click="showDelGrade(index)" style="cursor:pointer;flex:0.1" v-show="delGraStatus" />
+                                    </div>
                                 </Draggable>
                             </div>
                         </div>
@@ -121,7 +122,7 @@
                             <div class="subject-body dark-iview-input disabled-iview-input">
                                 <div class="subject-item item-active" @click.stop v-for="(item,index) in schoolSetting.period[curPriodIndex].subjects" :key="index">
                                     <span class="subject-item-icon"></span>
-                                    <Input v-model="item.subjectName" :disabled="!editSubStatus" placeholder="设置学科..." :style="{width: getWidth(index,item.subjectName)+'px'}" />
+                                    <Input v-model="item.name" :disabled="!editSubStatus" placeholder="设置学科..." :style="{width: getWidth(index,item.name)+'px'}" />
                                     <Icon type="md-close" @click="showDelSubject(index)" v-show="delSubStatus" />
                                 </div>
                                 <EmptyData v-if="schoolSetting.period[curPriodIndex].subjects.length == 0" textContent="暂无学科"></EmptyData>
@@ -135,7 +136,7 @@
             <p slot="header" style="color:#DDDDDD;letter-spacing:2px;font-weight:400;">设置校区</p>
             <p v-for="(item,index) in schoolSetting.campuses" class="campus-name-item dark-iview-input disabled-iview-select text-cursor-disabled" :key="index" @click.stop="selectCampus(index)">
                 <Icon type="md-checkmark" size="20" style="margin-right:10px;position:absolute;left:15px;" v-if="index == selectedCampusIndex" />
-                <Input v-model="item.campusName" :disabled="editCamIndex !== index" placeholder="设置校区..." :style="{width: getWidth(0, item.campusName)+'px'}" />
+                <Input v-model="item.name" :disabled="editCamIndex !== index" placeholder="设置校区..." :style="{width: getWidth(0, item.name)+'px'}" />
                 <Icon type="md-create" class="campus-btn-edit" title="编辑" size="20" @click.stop="editCamIndex = index" />
             </p>
             <Icon type="md-add-circle" size="40" style="margin:auto;cursor:pointer;margin-top:30px;" @click="addCampus" />
@@ -143,22 +144,22 @@
         <Modal v-model="delPeriodStatus"
                title="删除学段"
                @on-ok="delPeriod(curPriodIndex)">
-            <p>删除学段后,与之关联的数据将不能查询,确认删除 {{schoolSetting.period[curPriodIndex].periodName}} 吗?</p>
+            <p>删除学段后,与之关联的数据将不能查询,确认删除 {{schoolSetting.period[curPriodIndex].name}} 吗?</p>
         </Modal>
         <Modal v-model="delSemesterStatus"
                title="删除学期"
                @on-ok="delSemester(curSemIndex)">
-            <p>删除学期后,与之关联的数据将不能查询,确认删除 {{schoolSetting.period[curPriodIndex].semesters[curSemIndex].semesterName}} 吗?</p>
+            <p>删除学期后,与之关联的数据将不能查询,确认删除 {{schoolSetting.period[curPriodIndex].semesters[curSemIndex].name}} 吗?</p>
         </Modal>
         <Modal v-model="delGraShow"
                title="删除年级"
                @on-ok="delGrade(delGraIndex)">
-            <p v-if="delGraShow">删除年级后,与之关联的数据将不能查询,确认删除 {{schoolSetting.period[curPriodIndex].grades[delGraIndex].gradeName}} 吗?</p>
+            <p v-if="delGraShow">删除年级后,与之关联的数据将不能查询,确认删除 {{schoolSetting.period[curPriodIndex].grades[delGraIndex].name}} 吗?</p>
         </Modal>
         <Modal v-model="delSubShow"
                title="删除科目"
                @on-ok="delSubject(delSubIndex)">
-            <p v-if="delSubShow">删除科目后,与之关联的数据将不能查询,确认删除 {{schoolSetting.period[curPriodIndex].subjects[delSubIndex].subjectName}} 吗?</p>
+            <p v-if="delSubShow">删除科目后,与之关联的数据将不能查询,确认删除 {{schoolSetting.period[curPriodIndex].subjects[delSubIndex].name}} 吗?</p>
         </Modal>
     </div>
 
@@ -182,11 +183,11 @@
             return {
                 editCamIndex: -1,
                 editSchNmStatus: false,
-                split1:0.5,
+                split1: 0.5,
                 split2: 0.38,
-                split3:0.38,
+                split3: 0.38,
                 monthList: [],
-                timeZoneList:[],
+                timeZoneList: [],
                 delSubShow: false,
                 delGraShow: false,
                 editPrdIndex: -1,
@@ -229,26 +230,48 @@
         methods: {
             //计算时间轴选中颜色
             timeLineColor(index) {
-                for (let i in this.schoolSetting.period[this.curPriodIndex].semesters) {
-                    if (this.schoolSetting.period[this.curPriodIndex].semesters[i].month == (index + 1)) {
-                        return {
-                            color: this.colorList[i],
-                            text: this.schoolSetting.period[this.curPriodIndex].semesters[i].semesterName
+                let len = this.schoolSetting.period[this.curPriodIndex].semesters.length
+                let curIndex = -1
+                if (this.schoolSetting.period[this.curPriodIndex].semesters[this.curSemIndex].month <= (index + 1)) {
+                    if (this.curSemIndex < len - 1) {
+                        if (this.schoolSetting.period[this.curPriodIndex].semesters[this.curSemIndex + 1].month > (index + 1)) {
+                            curIndex = this.curSemIndex
                         }
                     }
                 }
-                return {
-                    color: "#606060",
-                    text: ''
+                if (curIndex != -1) {
+                    return {
+                        color: this.colorList[curIndex],
+                        text: this.schoolSetting.period[this.curPriodIndex].semesters[curIndex].name
+                    }
+                } else if (this.curSemIndex == len - 1) {
+                    if (this.schoolSetting.period[this.curPriodIndex].semesters[0].month > (index + 1) || this.schoolSetting.period[this.curPriodIndex].semesters[this.curSemIndex].month <= (index + 1)) {
+                        curIndex = this.curSemIndex
+                        return {
+                            color: this.colorList[curIndex],
+                            text: this.schoolSetting.period[this.curPriodIndex].semesters[curIndex].name
+                        }
+                    } else {
+                        return {
+                            color: '#606060',
+                            text: ''
+                        }
+                    }
+                } else {
+                    return {
+                        color: '#606060',
+                        text: ''
+                    }
                 }
+
             },
             //获取月份列表
             getMonthList() {
                 let lang = window.localStorage.getItem('local')
                 if (lang.indexOf('CN') != -1 || lang.indexOf('cn') != -1) {
-                    this.monthList = ['1月','2月','3月','4月','5月','6月','7月','8月','9月','10月','11月','12月']
+                    this.monthList = ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']
                 } else if (lang.indexOf('TW') != -1 || lang.indexOf('tw') != -1) {
-                    this.monthList = ['1月','2月','3月','4月','5月','6月','7月','8月','9月','10月','11月','12月']
+                    this.monthList = ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']
                 } else {
                     this.monthList = ['JAN.', 'FEB.', 'MAR.', 'APR.', 'MAY.', 'JUN.', 'JUL.', 'AUG.', 'SEP.', 'OCT.', 'NOV.', 'DEC.']
                 }
@@ -362,7 +385,7 @@
             },
             confirmCampus() {
                 if (this.selectedCampusIndex !== -1) {
-                    this.schoolSetting.period[this.curPriodIndex].campusCode = this.schoolSetting.campuses[this.selectedCampusIndex].campusCode
+                    this.schoolSetting.period[this.curPriodIndex].campusId = this.schoolSetting.campuses[this.selectedCampusIndex].id
                     this.selectedCampusIndex = -1
                 }
             },
@@ -378,8 +401,8 @@
                     })
                 } else {
                     this.schoolSetting.campuses.push({
-                        campusName: '设置校区名字',
-                        campusCode: Math.uuid()
+                        name: '设置校区名字',
+                        id: Math.uuid()
                     })
                 }
             },
@@ -431,9 +454,9 @@
                 this.schoolSetting.id = this.$store.state.userInfo.schoolCode
                 this.schoolSetting.code = this.$store.state.userInfo.schoolCode
                 this.schoolSetting.name = this.$store.state.userInfo.school
-                
+
                 this.schoolSetting.period.push({
-                    periodName: this.$t('schoolBaseInfo.presetPeriod') + '1',
+                    name: this.$t('schoolBaseInfo.presetPeriod') + '1',
                     periodCode: this.guid(),
                     gradeCount: 0,
                     semesterCount: 0,
@@ -441,37 +464,37 @@
                     semesters: [],
                     grades: [],
                     subjects: [],
-                    campusCode: ""
+                    campusId: ""
                 })
                 this.schoolSetting.period[0].semesters.push({
-                    semesterName: this.$t('schoolBaseInfo.persetSemester'),
-                    semesterCode: this.guid(),
+                    name: this.$t('schoolBaseInfo.persetSemester'),
+                    id: this.guid(),
                     month: 1,
                     day: 1
                 })
                 this.schoolSetting.period[0].grades.push({
-                    gradeName: this.$t('schoolBaseInfo.presetGrade1'),
-                    gradeCode: this.guid()
+                    name: this.$t('schoolBaseInfo.presetGrade1'),
+                    id: this.guid()
                 })
                 this.schoolSetting.period[0].grades.push({
-                    gradeName: this.$t('schoolBaseInfo.presetGrade2'),
-                    gradeCode: this.guid()
+                    name: this.$t('schoolBaseInfo.presetGrade2'),
+                    id: this.guid()
                 })
                 this.schoolSetting.period[0].grades.push({
-                    gradeName: this.$t('schoolBaseInfo.presetGrade3'),
-                    gradeCode: this.guid()
+                    name: this.$t('schoolBaseInfo.presetGrade3'),
+                    id: this.guid()
                 })
                 this.schoolSetting.period[0].subjects.push({
-                    subjectName: this.$t('schoolBaseInfo.presetSubject1'),
-                    subjectCode: this.guid()
+                    name: this.$t('schoolBaseInfo.presetSubject1'),
+                    id: this.guid()
                 })
                 this.schoolSetting.period[0].subjects.push({
-                    subjectName: this.$t('schoolBaseInfo.presetSubject2'),
-                    subjectCode: this.guid()
+                    name: this.$t('schoolBaseInfo.presetSubject2'),
+                    id: this.guid()
                 })
                 this.schoolSetting.period[0].subjects.push({
-                    subjectName: this.$t('schoolBaseInfo.presetSubject3'),
-                    subjectCode: this.guid()
+                    name: this.$t('schoolBaseInfo.presetSubject3'),
+                    id: this.guid()
                 })
                 this.updated = false
             },
@@ -487,7 +510,7 @@
                 this.curSemIndex = 0
                 this.curPriodIndex = index
                 for (let item in this.schoolSetting.campuses) {
-                    if (this.schoolSetting.campuses[item].campusCode === this.schoolSetting.period[this.curPriodIndex].campusCode) {
+                    if (this.schoolSetting.campuses[item].campusId === this.schoolSetting.period[this.curPriodIndex].campusId) {
                         this.selectedCampusIndex = item
                         break
                     }
@@ -569,7 +592,7 @@
                                 this.updated = false
                             }
                         } else {
-                            
+
                             this.getLocalDefaultData()
                             this.isInit = true
                             this.schoolSetting.period[0].grades = JSON.parse(JSON.stringify(this.dataDefault.grades))
@@ -582,7 +605,7 @@
                 ).finally(() => {
                     setTimeout(() => {
                         this.isLoading = false
-                    },500)
+                    }, 500)
                 })
             },
             handleData() {
@@ -599,8 +622,8 @@
                 if (this.termList.length < this.TERM_MAX_LENGTH) {
                     let newTerm = Object.assign({}, defaultTerm)
                     this.schoolSetting.period[this.curPriodIndex].subjects.push({
-                        subjectName: this.$t('schoolBaseInfo.presetSubject') + (this.schoolSetting.period[this.curPriodIndex].subjects.length + 1),
-                        subjectCode: this.guid()
+                        name: this.$t('schoolBaseInfo.presetSubject') + (this.schoolSetting.period[this.curPriodIndex].subjects.length + 1),
+                        id: this.guid()
                     })
                 } else {
                     this.$Message.info(this.$t('schoolBaseInfo.ssTips5'))
@@ -616,8 +639,8 @@
                 if (this.termList.length < this.TERM_MAX_LENGTH) {
                     let newTerm = Object.assign({}, defaultTerm)
                     this.schoolSetting.period[this.curPriodIndex].grades.push({
-                        gradeName: this.$t('schoolBaseInfo.persetGrade') + (this.schoolSetting.period[this.curPriodIndex].grades.length),
-                        gradeCode: this.guid()
+                        name: this.$t('schoolBaseInfo.persetGrade') + (this.schoolSetting.period[this.curPriodIndex].grades.length),
+                        id: this.guid()
                     })
                 } else {
                     this.$Message.info(this.$t('schoolBaseInfo.ssTips6'))
@@ -625,7 +648,7 @@
             },
             addPeriod() {
                 this.schoolSetting.period.push({
-                    periodName: this.$t('schoolBaseInfo.presetPeriod') + (this.schoolSetting.period.length + 1),
+                    name: this.$t('schoolBaseInfo.presetPeriod') + (this.schoolSetting.period.length + 1),
                     periodCode: this.guid(),
                     gradeCount: 0,
                     semesterCount: 0,
@@ -638,21 +661,21 @@
                 this.$nextTick(() => {
                     setTimeout(() => {
                         this.editSemIndex = this.curSemIndex
-                    },400)
+                    }, 400)
                 })
             },
-            
+
             // 添加学期
             handleAddTerm() {
                 if (this.termList.length < this.TERM_MAX_LENGTH) {
                     let newTerm = Object.assign({}, defaultTerm)
                     let defMonth = this.schoolSetting.period[this.curPriodIndex].semesters.length == 0 ? 1 : this.schoolSetting.period[this.curPriodIndex].semesters[this.curSemIndex].month + 1
                     this.schoolSetting.period[this.curPriodIndex].semesters.push({
-                        semesterName: this.$t('schoolBaseInfo.persetSemester') + (this.schoolSetting.period[this.curPriodIndex].semesters.length + 1),
+                        name: this.$t('schoolBaseInfo.persetSemester') + (this.schoolSetting.period[this.curPriodIndex].semesters.length + 1),
                         studentCount: '学生人数',
                         month: defMonth,
                         day: 26,
-                        semesterCode: this.guid()
+                        id: this.guid()
                     })
                     this.countSemDays()
                 } else {
@@ -731,7 +754,7 @@
             this.colorList = ['#F16C6A', '#68CDF1', '#1cc0f3', '#00796B', '#0288D1', '#D32F2F', '#00796B', '#7C4DFF', '#0288D1', '#D32F2F', '#00796B', '#7C4DFF']
         },
         computed: {
-            
+
             //计算时区设置宽度
             tzWidth() {
                 if (this.schoolSetting.timeZone && this.schoolSetting.timeZone.label) {
@@ -793,7 +816,7 @@
                     return false
                 }
             },
-            
+
         }
 
     }
@@ -808,40 +831,50 @@
         margin-top: -4px;
         font-weight: 800;
     }
+
     .time-zone-select .ivu-icon-ios-arrow-down:before {
         display: none;
     }
+
     .time-zone-select .ivu-select-selection {
         border-color: transparent;
     }
+
     .time-zone-select:hover .ivu-select-selection {
         border-color: #606060;
     }
+
     .time-zone-select:hover .ivu-icon-ios-arrow-down:before {
-        display:inline-block;
+        display: inline-block;
     }
+
     .ghost {
         opacity: 0;
         background: #c8ebfb;
     }
+
     .second-arrow {
         margin-left: -14px;
     }
+
     .semester-name-label .ivu-input[disabled] {
         font-size: 20px !important;
         font-weight: bold;
         color: white;
     }
+
     .subject-item .ivu-input[disabled] {
         font-size: 16px !important;
         font-weight: bold;
         color: white;
-        margin-top:-5px;
+        margin-top: -5px;
     }
-    .term-item-start .ivu-select-single .ivu-select-selection .ivu-select-placeholder,.term-item-start .ivu-select-single .ivu-select-selection .ivu-select-selected-value {
-        padding-right:6px;
+
+    .term-item-start .ivu-select-single .ivu-select-selection .ivu-select-placeholder, .term-item-start .ivu-select-single .ivu-select-selection .ivu-select-selected-value {
+        padding-right: 6px;
     }
+
     .grade-item .ivu-input {
-        text-align:center;
+        text-align: center;
     }
 </style>