Explorar o código

Merge branch 'develop5.0-tmd' of http://106.12.23.251:10080/TEAMMODEL/TEAMModelOS into develop5.0-tmd

CrazyIter_Bin %!s(int64=4) %!d(string=hai) anos
pai
achega
431da7f224

+ 1 - 1
TEAMModelFunction/TriggerCorrect.cs

@@ -134,7 +134,7 @@ namespace TEAMModelFunction
                                     foreach (string stuId in examClass.studentIds)
                                     {
                                         int index = examClass.studentIds.IndexOf(stuId);
-                                        tasks.Add(redisClient.HashSetAsync($"Exam:Scoring:{eid}-{subjectId}", stuId, new { ans = examClass.studentAnswers[index][0], score = examClass.studentScores[index] }.ToJsonString()));
+                                        tasks.Add(redisClient.HashSetAsync($"Exam:Scoring:{eid}-{subjectId}", stuId, new { tmdId = "" , ans = examClass.studentAnswers[index][0], score = examClass.studentScores[index] }.ToJsonString()));
                                     }
 
                                 }

+ 2 - 2
TEAMModelFunction/TriggerExam.cs

@@ -566,7 +566,7 @@ namespace TEAMModelFunction
                                 if (str.Contains(knowledgeName[i]))
                                 {
                                     var itemPersent = str.Count > 0 ? 1 / Convert.ToDouble(str.Count) : 0;
-                                    allScore += info.papers[no].point[n] * itemPersent;
+                                    allScore += info.papers[no].point.Count > 0 ? info.papers[no].point[n] * itemPersent : 0;
                                     foreach (string id in classResult.studentIds)
                                     {
                                         int index = classResult.studentIds.IndexOf(id);
@@ -662,7 +662,7 @@ namespace TEAMModelFunction
                                 if (str == knowledgeName[i])
                                 {
                                     var itemPersent = 1;
-                                    allScore += info.papers[no].point[n] * itemPersent;
+                                    allScore += info.papers[no].point.Count > 0 ? info.papers[no].point[n] * itemPersent : 0;
                                     foreach (string id in classResult.studentIds)
                                     {
                                         int index = classResult.studentIds.IndexOf(id);

+ 1 - 1
TEAMModelOS/ClientApp/src/locale/lang/en-US/schoolBaseInfo.js

@@ -82,7 +82,7 @@ export default {
   classroomAttr: '教室属性',
   classroomCode: '教室编码',
   classroomName: '教室名称',
-  headmaster: '班主任',
+  headmaster: '班主任',
   setPeriod: '选择教室学段',
   setGrade: '设置教室年级',
   setHiteachCode: 'HiTeach软件序号',

+ 1 - 1
TEAMModelOS/ClientApp/src/locale/lang/zh-CN/courseManage.js

@@ -49,7 +49,7 @@ export default {
     classroom: {
         classroomList: '课程名单',
         studentCount: '学生人数:',
-        headmaster: '班主任',
+        headmaster: '班主任',
         classroomManage: '班级管理',
         baseSetting: '基础设置',
         studentList: '学生名单',

+ 1 - 1
TEAMModelOS/ClientApp/src/locale/lang/zh-CN/schoolBaseInfo.js

@@ -104,7 +104,7 @@ export default {
   classroomAttr: '教室属性',
   classroomCode: '教室编码',
   classroomName: '教室名称',
-  headmaster: '班主任',
+  headmaster: '班主任',
   setPeriod: '选择教室学段',
   setGrade: '设置教室年级',
   setHiteachCode: 'HiTeach软件序号',

+ 1 - 1
TEAMModelOS/ClientApp/src/locale/lang/zh-TW/schoolBaseInfo.js

@@ -82,7 +82,7 @@ export default {
   classroomAttr: '教室内容',
   classroomCode: '教室編碼',
   classroomName: '教室名稱',
-  headmaster: '班主任',
+  headmaster: '班主任',
   setPeriod: '選擇教室學段',
   setGrade: '設定教室年級',
   setHiteachCode: 'HiTeach軟件序號',

+ 2 - 0
TEAMModelOS/ClientApp/src/store/module/user.js

@@ -187,6 +187,7 @@ export default {
 			state.schoolProfile.school_courses = undefined // 学校排课
 			state.schoolProfile.school_syllabus = undefined // 校本课纲
 			state.schoolProfile.school_classes = undefined // 学校班级
+			state.schoolProfile.school_rooms = undefined // 学校教室
 			state.schoolProfile.periods = undefined // 學制
 			state.schoolProfile.grades = undefined // 年級
 			state.schoolProfile.school_base = undefined // 区班校基础数据
@@ -208,6 +209,7 @@ export default {
             state.schoolProfile.school_courses = data.school_courses // 学校排课
             state.schoolProfile.school_syllabus = data.school_syllabus // 校本课纲
             state.schoolProfile.school_classes = data.school_classes // 学校班级
+            state.schoolProfile.school_rooms = data.school_rooms // 学校教室
             state.schoolProfile.periods = data.fmtPeriods // 學制
             state.schoolProfile.grades = data.fmtGrades // 年級
             state.schoolProfile.school_base = data.school_base // 区班校基础数据

+ 8 - 5
TEAMModelOS/ClientApp/src/view/schoolmgmt/ClassroomSetting/ClassroomSetting.vue

@@ -636,6 +636,7 @@ export default {
                         res => {
                             if (res.stus.length > 0) {
                                 this.$set(this.classroomListShow[this.curClassIndex], 'students', res.stus[0])
+                                this.initIcon()
                             }
                         },
                         err => {
@@ -831,9 +832,9 @@ export default {
         },
         selectTab(index) {
             this.currentTabIndex = index
-            if (index == 1) {
-                this.bundleScoll()
-            }
+            // if (index == 1) {
+            //     this.bundleScoll()
+            // }
         },
         confirmAdd() {
             this.hiTeachs.push(this.hiTeachItem)
@@ -1057,8 +1058,9 @@ export default {
                     PNGImg.onload = function () {
                         _this.schoolImageData = PNGImg
                         _this.isFirstDraw++
+                        _this.initIcon()
                     }
-                    _this.initIcon()
+                    
                 }
             } else {
                 if (this.schoolImageData) {
@@ -1343,6 +1345,7 @@ export default {
             white.onload = function () {
                 _this.whiteImageData = white
                 _this.drawSchoolPlan()
+                _this.initIcon()
             }
             pink.onload = function () {
                 _this.pinImageData = pink
@@ -1350,6 +1353,7 @@ export default {
             green.onload = function () {
                 _this.greenImageData = green
             }
+            this.bundleScoll()
         },
         addClassroom() {
             // if (this.$access.can('admin.*|classroom-upd')) {
@@ -1612,7 +1616,6 @@ export default {
         }
     },
     created() {
-        this.initData()
         if (this.$access.can('admin.*|classroom-upd')) this.editStatus = this.noStatus
         this.getClassroom()
         this.$store.dispatch('teachers/getTeacherList').then(res => { })

+ 93 - 104
TEAMModelOS/ClientApp/src/view/student-account/ClassMgt.vue

@@ -34,7 +34,7 @@
             </div>
             <div class="class-list">
                 <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">
                             <!-- <p style="color: #a5a5a5;">{{$jsFn.getGradeName(schoolBase,item.gradeId)}}</p> -->
                             <p style="color: #a5a5a5;">2020级</p>
@@ -48,14 +48,14 @@
                             </p>
                             <p class="class-type">
                             <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 style="margin-left:15px">学生人数:</span>
                                 <span class="primary-text-color">40人</span> -->
                             </p>
                         </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>
             </div>
         </div>
@@ -86,43 +86,43 @@
                     <!--班级属性-->
                     <div class="class-attr-wrap disabled-iview-select dark-iview-select">
                         <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">
                                     <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 prop="no" @click.native.stop class="requird-color">
                                     <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 prop="gradeId" :label="$t('schoolBaseInfo.setGrade')" @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].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 }}
                                         </Option>
                                     </Select>
                                 </FormItem>
                                 <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>
-                                    <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 }}
                                         </Option>
                                     </Select>
                                 </FormItem>
                                 <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 }}
                                         </Option>
                                     </Select>
                                 </FormItem>
                                 <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 }}
                                         </Option>
                                     </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">
-                    <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')">
                             <Loading slot="loading" :top="0" bgColor="rgba(103, 103, 103, 0.27)"></Loading>
                             <template slot-scope="{ row }" slot="picture">
@@ -185,7 +185,8 @@ export default {
             }
         }
         return {
-            filterYear:'',
+            roomList:[],
+            filterYear: '',
             // years:[2021,2020,2019,2018,2017,2016,2015,2014],
             studentColumn: [
                 {
@@ -244,8 +245,8 @@ export default {
             isSaveLoading: false,
             isInit: true,
             updated: false,
-            classroomList: [],
-            classroomListShow: [],
+            classList: [],
+            classListShow: [],
             curClassIndex: 0,
             keyword: '',
             serchCode: '',
@@ -294,19 +295,19 @@ export default {
 
         students() {
             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 {
                     let params = {
                         'school_code': this.$store.state.userInfo.schoolCode,
-                        'ids': [this.classroomListShow[this.curClassIndex].id],
+                        'ids': [this.classListShow[this.curClassIndex].id],
                         'scope': 'school'
                     }
                     this.stuLoading = true
                     this.$api.schoolSetting.getClassroomStudent(params).then(
                         res => {
                             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 => {
@@ -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
                 })
-                if(pData){
+                if (pData) {
                     let date = new Date()
                     let year = date.getFullYear()
                     let month = date.getMonth() + 1
@@ -337,15 +338,15 @@ export default {
                     if (start && month < start.month) {
                         year--
                     }
-                    let res = pData.grades.map(item=>{
+                    let res = pData.grades.map(item => {
                         return {
-                            label:`${item.name}(${year}级)`,
-                            value:year--
+                            label: `${item.name}(${year}级)`,
+                            value: year--
                         }
                     })
                     this.filterYear = res[0].label
                     return res
-                }else{
+                } else {
                     return []
                 }
             }
@@ -419,9 +420,9 @@ export default {
                 console.log(this.selections)
                 let data = this._.cloneDeep(this.selections)
                 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
@@ -484,7 +485,7 @@ export default {
                     break;
                 case 'total':
                     data.sort(function (a, b) {
-                        return b.studCount - a.studCount;
+                        return b.studCount - a.studCount
                     })
                     break;
             }
@@ -493,12 +494,12 @@ export default {
         filterByPeriod() {
             this.curClassIndex = 0
             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 {
-                this.classroomListShow = [...this.classroomList]
+                this.classListShow = [...this.classList]
             }
             // 排序
-            this.classroomListShow = this.dataSort(this.classroomListShow)
+            this.classListShow = this.dataSort(this.classListShow)
 
         },
         filterClassname() {
@@ -507,15 +508,15 @@ export default {
             } else {
                 let filterRes = []
                 if (this.filterPeriod) {
-                    filterRes = this.classroomList.filter(item => item.periodId == this.filterPeriod)
+                    filterRes = this.classList.filter(item => item.periodId == this.filterPeriod)
                 } 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.updateBefore = JSON.stringify(this.classroomListShow[this.curClassIndex])
+                this.updateBefore = JSON.stringify(this.classListShow[this.curClassIndex])
             }
         },
         selectTab(index) {
@@ -526,36 +527,36 @@ export default {
                 if (!valid) {
                     this.$Message.error(this.$t('schoolBaseInfo.formWarning'))
                 } else {
-                    let option = this.classroomListShow[this.curClassIndex].option
+                    let option = this.classListShow[this.curClassIndex].option
                     if (!option) {
                         option = 'update'
                     } 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.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({
-                        classroom: this.classroomListShow[this.curClassIndex],
+                        classroom: this.classListShow[this.curClassIndex],
                         option: option,
                         school_code: this.$store.state.userInfo.schoolCode
                     }).then(
                         res => {
                             if (res) {
                                 if (res.error) {
-                                    this.classroomListShow[this.curClassIndex].option = option
+                                    this.classListShow[this.curClassIndex].option = option
                                     this.$Message.error(res.v)
                                 } else {
                                     this.$Message.success(this.$t('schoolBaseInfo.csTips3'))
                                     this.updated = false
                                     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 {
@@ -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() {
             if (this.$access.can('admin.*|classroom-upd')) {
                 this.$Modal.confirm({
                     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: () => {
                         this.delClassroom(this.curClassIndex)
                     }
@@ -615,32 +591,32 @@ export default {
         },
         delClassroom(index) {
             this.isListLoading = true
-            if (this.classroomListShow[index].option !== 'insert') {
+            if (this.classListShow[index].option !== 'insert') {
                 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
                 }).then(
                     (res) => {
                         if (res.error == null) {
                             if (this.curClassIndex >= index && index > 0) {
                                 this.curClassIndex = 0
-                                this.updateBefore = JSON.stringify(this.classroomListShow[this.curClassIndex])
+                                this.updateBefore = JSON.stringify(this.classListShow[this.curClassIndex])
                             }
                             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
                                     break
                                 }
                             }
                             this.$api.schoolSetting.hiteachUnlinkByClassId({
-                                classId: this.classroomListShow[index].id,
+                                classId: this.classListShow[index].id,
                                 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.updated = false
                         }
@@ -654,9 +630,9 @@ export default {
             } else {
                 if (this.curClassIndex >= index && index > 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.updated = false
             }
@@ -669,29 +645,29 @@ export default {
                         content: this.$t('schoolBaseInfo.saveClassWarning'),
                         okText: this.$t('schoolBaseInfo.leaveText'),
                         onOk: () => {
-                            if (this.classroomListShow[this.curClassIndex].option == 'insert') {
+                            if (this.classListShow[this.curClassIndex].option == 'insert') {
                                 this.delClassroom(this.curClassIndex)
                             } else {
                                 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.updateBefore = JSON.stringify(this.classroomListShow[this.curClassIndex])
+                                this.updateBefore = JSON.stringify(this.classListShow[this.curClassIndex])
                             }
                         }
                     }
                     this.$Modal.confirm(config)
                 } else {
                     this.curClassIndex = index
-                    this.updateBefore = JSON.stringify(this.classroomListShow[this.curClassIndex])
+                    this.updateBefore = JSON.stringify(this.classListShow[this.curClassIndex])
                 }
             }
         },
         addClassroom() {
             if (this.$access.can('admin.*|classroom-upd')) {
                 this.keyword = ''
-                this.classroomListShow.unshift({
+                this.classListShow.unshift({
                     id: this.$jsFn.uuid(),
-                    name: this.$t('schoolBaseInfo.presetClassroomName') + (this.classroomList.length + 1),
+                    name: this.$t('schoolBaseInfo.presetClassroomName') + (this.classList.length + 1),
                     no: '',
                     teacher: {
                         id: '',
@@ -703,7 +679,7 @@ export default {
                     option: 'insert'
                 })
                 this.curClassIndex = 0
-                this.updateBefore = JSON.stringify(this.classroomListShow[this.curClassIndex])
+                this.updateBefore = JSON.stringify(this.classListShow[this.curClassIndex])
             } else {
                 this.$Message.warning(this.$t('schoolBaseInfo.authWarning'))
             }
@@ -733,13 +709,27 @@ export default {
         }
     },
     created() {
+        this.isListLoading = true
         this.$store.dispatch('user/getSchoolProfile').then(
             res => {
+                console.log('数据',res)
                 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
-        this.getClassroom()
         this.$store.dispatch('teachers/getTeacherList').then(res => { })
     }
 }
@@ -800,7 +790,6 @@ export default {
 .class-attr-wrap .ivu-divider {
     background-color: #424242;
 }
-
 </style>
 <style lang="less">
 .gradient {