瀏覽代碼

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

zhouj1203@hotmail.com 4 年之前
父節點
當前提交
6fac890dbd

+ 1 - 1
TEAMModelOS/ClientApp/src/api/learnActivity.js

@@ -234,7 +234,7 @@ export default {
 	* 保存评测学生作答数据(分数)
 	*/
     UpsertAllRecord: function (data) {
-        return post('/api/Exam/upsertAllRecord', data)
+        return post('/school/exam/upsert-record-by-teacher', data)
     },
     /*
 	* 发布自主学习活动

+ 1 - 1
TEAMModelOS/ClientApp/src/common/BaseLayout.vue

@@ -97,7 +97,7 @@
                             },
                             {
                                 icon: 'iconfont icon-class-mgt',
-                                name: '班级管理',
+                                name: '教室管理',
                                 router: '/home/classroom',
                                 tag: '*',
                                 role: 'admin',

+ 2 - 1
TEAMModelOS/ClientApp/src/components/learnactivity/ClassList.less

@@ -52,7 +52,7 @@
     }
 }
 .class-filter {
-    margin-left: 15px;
+    margin-left: 0px;
     margin-top: 15px;
     width:90%;
     color:#ffffff;
@@ -80,6 +80,7 @@
     font-size: 16px;
 }
 .table-show{
+    margin-top:15px;
     margin-bottom:10px;
 }
 .class-list {

+ 13 - 11
TEAMModelOS/ClientApp/src/components/learnactivity/ClassList.vue

@@ -10,23 +10,26 @@
             <div class="class-info">
                 <div class="learn-progress-main " v-if="currentActivityIndex == 0">
                     <vuescroll>
-                        <p style="color:#EEEEEE;font-size:16px;margin-top:5px;">测验成绩分析</p>
+                        <!--<p style="color:#EEEEEE;font-size:16px;margin-top:5px;">测验成绩分析</p>-->
                         <div class="class-filter dark-iview-select">
-                            <span class="filter-label">测验班级:</span>
+                            <span class="filter-label">测验年级:</span>
+                            <Select filterable style="display: inline-block;width: 100px;" @on-change="getClass" size="small">
+                                <Option v-for="item in studentData" :value="item.classId" :key="item.classId">{{ item.name }}</Option>
+                            </Select>
+                            <span style="margin-left:5px">班级:</span>
                             <Select filterable style="display: inline-block;width: 150px;" @on-change="getClass" size="small">
                                 <Option v-for="item in studentData" :value="item.classId" :key="item.classId">{{ item.name }}</Option>
                             </Select>
-                            <span style="margin-right: 5px;float: right;cursor:pointer" @click="getTestData"><Icon :type="testStatus ? 'md-list-box':'md-stats'" />{{testStatus ? '成绩列表':'成绩分析'}}</span>
-                        </div>
-                        <div class="chart-show">
-                            <div v-if="!testStatus" class="chart" style="margin:auto">
+                        </div>         
+                        <!--<div class="chart-show">-->
+                            <!--<div v-if="!testStatus" class="chart" style="margin:auto">
                                 <Grade v-if="studentList.length !== 0" :studentData="studentList"></Grade>
                             </div>
                             <div v-if="testStatus" class="chart">
                                 <Analyse></Analyse>
-                            </div>
-                        </div>
-                        <p style="color:#EEEEEE;padding-left:15px;font-size:16px;margin-top:10%;margin-bottom:10px;">学生成绩数据</p>
+                            </div>-->
+                        <!--</div>-->
+                        <!--<p style="color:#EEEEEE;padding-left:15px;font-size:16px;margin-top:10%;margin-bottom:10px;">学生成绩数据</p>-->
                         <div class="table-show">
                             <Table v-if="studentList.length !== 0" @fixScore="getScore" :studentData="studentList"></Table>
                         </div>
@@ -100,11 +103,11 @@
                 this.testStatus = !this.testStatus
             },
             selectActivity(index) {
+                console.log(this.paper)
                 this.paperData = {}
                 this.currentActivityIndex = 0 
                 this.currentActivityIndex = index
                 this.paperData = this.paper[this.currentActivityIndex]
-                console.log(this.currentActivityIndex)
                 console.log(this.paperData)
             },
             getData() {
@@ -135,7 +138,6 @@
             },
         },
         mounted() {
-            console.log(this.paper)
             this.getData()
         }
     }

+ 29 - 37
TEAMModelOS/ClientApp/src/components/learnactivity/GradeList.vue

@@ -29,7 +29,7 @@
                     <div class="student-list">
                         <vuescroll>
                             <ul>
-                                <li :class="index == selectIndex ?' block-bg-active block-bg':' block-bg'" :key="index" v-for="(item,index) in studentData" @click="getStudentInfo(item,index)">
+                                <li :class="index == selectIndex ?' block-bg-active block-bg':' block-bg'" :key="index" v-for="(item,index) in studentData.students" @click="getStudentInfo(item,index)">
                                     <div class="student-show">
                                         <span>{{item.name}}</span>
                                         <span :style="{ background: (item.mark === 0 ? '#949594' : item.mark === 1 ? '#0BADD4' : '#1CC0F3')}" class="activity-status">{{item.mark === 0 ? '未开始' : item.mark === 2 ? '已完成' : '未完成'}}</span>
@@ -85,9 +85,9 @@
         },
         computed: {
             studentList() {
-                let filterData = this.studentData
+                let filterData = this.studentData.students
                 if (this.inputData) {
-                    filterData = this.studentData.filter(res => {
+                    filterData = this.studentData.students.filter(res => {
                         let a = res.name
                         return (a.indexOf(this.inputData) >= 0)
                     })
@@ -123,43 +123,36 @@
             //保存学生作答信息
             savePaper(data) {
                 console.log(this.paperInfo)
-                if (this.answer.length !== 0) {
-                    let exam = []
+                if (this.paperInfo.papers.item.length !== 0) {
+                    let point = []
                     let config = 0 //已评审题目数量
-                    let mark = 0  //是否评审完毕
-                    for (let i = 0; i < this.answer.length; i++) {
-                        if (this.answer[i].score !== null) {
-                            this.answer[i].mark = 1
+                    for (let i = 0; i < this.paperInfo.papers.item.length; i++) {
+                        if (this.paperInfo.papers.item[i].stuScore !== null) {
+                            point.push(this.paperInfo.papers.item[i].stuScore)
                             config++
-                        } else {
-                            this.answer[i].mark = 0
                         }
-                        exam.push(this.answer[i])
-                    }
-                    if (config == this.answer.length) {
-                        mark = 2
-                    } else {
-                        mark = 1
                     }
-                    let requestData = []
-                    requestData.push(
-                        {
+                    if (config == this.paperInfo.papers.item.length) {
+                       let requestData = {
                             "id": this.paperInfo.id,
-                            "code": this.studentCode,
-                            "examCode": this.paperInfo.code,
-                            "status": 1,
-                            "mark": mark,
-                            "answers": exam
-                        }
-                    )
-                    this.$api.learnActivity.UpsertAllRecord(requestData).then(res => {
-                        if (res.error == null) {
-                            this.$Message.success('成绩保存成功!')
-                            this.getStudentData()
-                        } else {
-                            this.$Message.error('成绩保存失败!')
+                            "code": this.paperInfo.code,
+                            "point": point,
+                            "studentId": this.studentData.students[this.selectIndex].id,
+                            "classId": this.studentData.id,
+                            "school": this.paperInfo.papers.code,
+                            "subjectId": this.paperInfo.papers.subjectId
                         }
-                    })
+                        this.$api.learnActivity.UpsertAllRecord(requestData).then(res => {
+                            if (res.error == null) {
+                                this.$Message.success('成绩保存成功!')
+                                this.getAllStudentData()
+                            } else {
+                                this.$Message.error('成绩保存失败!')
+                            }
+                        })
+                    } else {
+                        this.$Message.warning('请完善学生评分信息!')
+                    }
                 }
             },
             openAnswer() {
@@ -177,7 +170,7 @@
                     this.studentName = data.name
                     let filData = ''
                     if (data == -1) {
-                        filData = this.studentData[0].id
+                        filData = this.studentData.students[0].id
                     } else {
                         filData = data.id
                     }
@@ -193,7 +186,6 @@
                         for (let k = 0; k < this.paperInfo.papers.item.length; k++) {
                             this.$set(this.paperInfo.papers.item[k], 'answerData', ans[k])
                             this.$set(this.paperInfo.papers.item[k], 'stuScore', score[k])
-                            //this.paperInfo.papers.item[k].stuScore = ans[k]
                             console.log('修改paperinfo')
                         }
                     }
@@ -301,7 +293,7 @@
                         this.$api.schoolSetting.getClassroomStudent(requestData).then(
                             res => {
                                 if (res.error == null) {
-                                    this.studentData = res.classrooms[0].students
+                                    this.studentData = res.classrooms[0]
                                     this.getAllStudentData()
                                 } else {
                                     this.$Message.error('API ERROR!')

+ 6 - 3
TEAMModelOS/ClientApp/src/components/learnactivity/NewChooseContent.vue

@@ -339,9 +339,12 @@ import { json } from 'd3'
             //初始化数据
             initData() {
                 this.questionFilter.code = this.$store.state.userInfo.TEAMModelId
-                this.questionFilter.periodId = this.$store.state.user.schoolProfile.school_base.period[0].id
-                this.questionFilter.subjectId = this.$store.state.user.schoolProfile.school_base.period[0].subjects[0].id
-                this.questionFilter.gradeIds = [this.$store.state.user.schoolProfile.school_base.period[0].grades[0].id]
+                this.$store.dispatch('user/getSchoolProfile').then(res => {
+                    this.questionFilter.periodId = this.$store.state.user.schoolProfile.school_base.period[0].id
+                    this.questionFilter.subjectId = this.$store.state.user.schoolProfile.school_base.period[0].subjects[0].id
+                    this.questionFilter.gradeIds = [this.$store.state.user.schoolProfile.school_base.period[0].grades[0].id]
+                })
+                
             },
             /**
              * 选择全部逻辑

文件差異過大導致無法顯示
+ 26 - 27
TEAMModelOS/ClientApp/src/components/student-web/EventView/EventList.vue


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

@@ -17,7 +17,7 @@ export default {
   addStu: '新增学生',
   editInfo: '编辑资讯',
   delStu: '删除学生',
-  searchHolder: '请输入关键字或账号资讯...',
+  searchHolder: '输入关键字或账号资讯搜索',
   periodHolder: '选择学制',
   gradeHolder: '选择年级',
   classroomHolder: '选择教室',

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

@@ -3,7 +3,7 @@ export default {
         text1: '教师帐号管理',
         text2: '添加教师帐号'
     },
-    blurryFilter: '请输入关键字或帐号资讯...',
+    blurryFilter: '通过关键字或帐号资讯搜索',
     mulitSet: '批量权限管理',
     table: {
         text1: '基本',

+ 30 - 59
TEAMModelOS/ClientApp/src/view/learnactivity/CreateEvaluation.vue

@@ -25,7 +25,7 @@
                         </FormItem>
                         <FormItem label="测试学段" prop="school" >
                             <Select v-model="evaluationInfo.school" @on-change="getPeriod">
-                                <Option v-for="(item,index) in $store.state.schoolBaseInfo.schoolBaseInfo.period" :value="item.id" :key="index">{{ item.name }}</Option>
+                                <Option v-for="(item,index) in $store.state.user.schoolProfile.school_base.period" :value="item.id" :key="index">{{ item.name }}</Option>
                             </Select>
                         </FormItem>
                         <FormItem label="测试类型" prop="examType" >
@@ -58,8 +58,8 @@
                     <p>测试科目:</p>
                     <span v-for="(item,index) in evaluationInfo.paperInfo" :key="index" :class="index == currentSubjectIndex ? 'subject-item subject-item-active':'subject-item'" @click="selectSubject(index)">
                         <!--{{ jsFn.getPeriod($store.state.schoolBaseInfo.schoolBaseInfo, item.periodId+1).name}}
-                        <span style="margin:0px 5px;">·</span>-->
-                        {{jsFn.getSubjectName(jsFn.getPeriod($store.state.schoolBaseInfo.schoolBaseInfo, item.periodId), item.subjectId)}}
+    <span style="margin:0px 5px;">·</span>-->
+                        {{jsFn.getSubjectName(jsFn.getPeriod( $store.state.user.schoolProfile.school_base, item.periodId), item.subjectId)}}
                         <Icon type="ios-close" size="18" class="delete-subject-btn" @click="deleteSubject(index)" />
                     </span>
                     <Icon @click="addSubject" type="md-add-circle" title="添加科目" color="white" class="add-subject-icon" size="20" />
@@ -297,7 +297,6 @@
              * 多選組件配置信息
              * */
             async setChangeScope(data) {
-                console.log(data)
                 let classInfo = []
                 let periodInfo = []
                 let periodData = []
@@ -312,7 +311,6 @@
                 }
                 let datas = await this.unique(periodData)
                 this.gradeChoose = this.getexamGradeName(datas)
-                console.log(this.gradeChoose)
                 let dataInfo =[]
                 dataInfo = await this.getChooseClass(periodInfo)
                 if (dataInfo.length !== 0) {
@@ -335,7 +333,6 @@
                 }
                 code = this.unique(code)
                 return code
-                console.log(code)
             },
             changeSon() {
                 this.open = true
@@ -345,7 +342,7 @@
                 let classData = []
                 if (data.length !== 0) {
                     for (let item of data) {
-                        for (let code of this.$store.state.schoolBaseInfo.classroomList) {
+                        for (let code of this.$store.state.user.schoolProfile.school_classes) {
                             if (code.gradeId == item) {
                                 classData.push(code.id)
                             }
@@ -371,9 +368,6 @@
             //获取选择的学段
             async getPeriod(data) {
                 if (data !== '') {
-                    console.log(data)
-                    console.log(this.$store.state)
-                   await this.getSchoolBaseInfo()
                     //初始化选择数据
                     this.testSubject = []
                     this.evaluationInfo.paperInfo = []
@@ -397,7 +391,7 @@
             //处理施测对象
             getPeriodInfo(data) {
                 if (data !== '') {
-                    let gradeInfo = this.$store.state.schoolBaseInfo.schoolBaseInfo.period
+                    let gradeInfo = this.$store.state.user.schoolProfile.school_base.period
                     for (let item of gradeInfo) {
                         if (item.id == data) {
                             return item
@@ -409,8 +403,7 @@
                 //拼接年級和班級信息
                 let grade = []
                 let grades = []
-                let classData = this.$jsFn.groupBy(this.$store.state.schoolBaseInfo.classroomList, 'gradeId')
-                console.log(this.evaluationInfo.school)
+                let classData = this.$jsFn.groupBy(this.$store.state.user.schoolProfile.school_classes, 'gradeId')
                 grade = this.getPeriodInfo(this.evaluationInfo.school).grades
                 for (let i = 0; i < grade.length; i++) {
                     for (let j = 0; j < classData.length; j++) {
@@ -428,10 +421,7 @@
                         grades.push(grade[i])
                     }
                 }
-                console.log(grades)
                 this.config.data = this.convertTree(grades, this.map)
-                console.log('8888888888888888888888888888888')
-                console.log(this.config.data)
             },
             /**显示试卷分析 */
             showAnalysis() {
@@ -462,18 +452,13 @@
              * @param data
              */
             selectPaper(data,info) {
-                console.log('返回試卷')
-                console.log(data)
-                console.log(info)
                 this.selectedPaper = info
                 this.selectedPaperInfo = data
-                console.log(this.selectedPaperInfo)
                 this.confirmPaperStatus = true
             },
             comfirmSelectPaper() {
                 //this.evaluationInfo.paperInfo[this.currentSubjectIndex].item = [...this.selectedPaper.item]
                 //this.evaluationInfo.paperInfo[this.currentSubjectIndex].markConfig = this.selectedPaper.markConfig
-                console.log(this.evaluationInfo.paperInfo)
                 this.evaluationInfo.paperInfo[this.currentSubjectIndex] = JSON.parse(JSON.stringify(this.selectedPaper))
                 this.evaluationInfo.papers[this.currentSubjectIndex] = JSON.parse(JSON.stringify(this.selectedPaperInfo))
                 this.evaluationInfo.paperInfo[this.currentSubjectIndex].id = undefined
@@ -557,7 +542,6 @@
             //    }
             //},
             deleteSubject(index) {
-                console.log(index)
                 this.deleteIndex = index
                 this.$Modal.confirm({
                     title: '删除科目',
@@ -587,7 +571,7 @@
                     onCancel: () => {
                         this.deleteIndex = -1
                     },
-                })
+                }) 
             },
             confirmAddSubject() {
                 let data = {
@@ -612,7 +596,6 @@
                     scope: this.mode,
                     create: Math.round(new Date() / 1000)
                 }
-                console.log(this.newAddSubjects.length)
                 for (let item of this.newAddSubjects) {
                      let periodData = this.getPeriodInfo(this.evaluationInfo.school)
                     this.evaluationInfo.paperInfo.push({
@@ -627,7 +610,6 @@
                         name: this.evaluationInfo.name + '--' +periodData.subjects[item.i].name
                     })
                 }
-                console.log(this.evaluationInfo)
                 this.newAddSubjects.length = 0
                 this.addSubjectBefore.length = 0
             },
@@ -654,29 +636,29 @@
                  this.addSubjectBefore = [...this.testSubjects]
             },
             //获取学校基本信息
-            getSchoolBaseInfo() {
-                this.$store.dispatch('schoolBaseInfo/getSchoolBaseData').then(
-                    (res) => {
-                        console.log(this.$store.state)
-                        if (res.code == 2) {
-                            alert('数据为空!')
-                        }
-                    },
-                    (err) => {
-                        this.$Message.error('API error!')
-                    }
-                )
-                this.$store.dispatch('schoolBaseInfo/getClassroom').then(
-                    (res) => {
-                        if (res.code == 2) {
-                            alert('数据为空!')
-                        } 
-                    },
-                    (err) => {
-                        this.$Message.error('API error!')
-                    }
-                )
-            },
+            //getSchoolBaseInfo() {
+            //    this.$store.dispatch('schoolBaseInfo/getSchoolBaseData').then(
+            //        (res) => {
+            //            console.log(this.$store.state)
+            //            if (res.code == 2) {
+            //                alert('数据为空!')
+            //            }
+            //        },
+            //        (err) => {
+            //            this.$Message.error('API error!')
+            //        }
+            //    )
+            //    this.$store.dispatch('schoolBaseInfo/getClassroom').then(
+            //        (res) => {
+            //            if (res.code == 2) {
+            //                alert('数据为空!')
+            //            } 
+            //        },
+            //        (err) => {
+            //            this.$Message.error('API error!')
+            //        }
+            //    )
+            //},
             /**
              * 查找教师课程下的班级
              * */
@@ -800,9 +782,6 @@
                 }
             },
             saveEvaluation() {
-                console.log('最後數據')
-                console.log(this.evaluationInfo)
-
                 let data = {
                     pk: 'Exam',
                     code: this.$store.state.userInfo.schoolCode,
@@ -831,11 +810,9 @@
                     scope: this.mode,
                     createDate: Math.round(new Date())
                 }
-                console.log(data)
                 this.$api.learnActivity.SaveExamInfo(data).then(
                     res => {
                         if (res.error == null) {
-                            console.log(res)
                             this.$Message.success('评测发布成功!')
                             this.evaluationInfo.papers = res.exam
                         } else {
@@ -918,7 +895,6 @@
                     }
                     if (children !== undefined) {
                         children.map(item => {
-                            console.log(item)
                             item['type'] = 'class'
                             item = delete item.children
                         })
@@ -935,7 +911,6 @@
         },
         created() {
             let routerData = this.$route.params.evaluationInfo
-            console.log(routerData)
             if (routerData !== undefined) {
                 this.startTime = new Date(routerData.startTime)    
                 this.endTime = new Date(routerData.endTime)   
@@ -953,13 +928,10 @@
                 }
                 this.activeTab = 'preview'
             }
-            this.getSchoolBaseInfo()
             this.findClassroom()
         },
         mounted() {
-            console.log(this.$store)
             this.mode = this.$route.query.type
-            this.getSchoolBaseInfo()
             if (this.mode == 'class') {
                 this.getClassType()
             }
@@ -967,7 +939,6 @@
         watch: {
             evaluationInfo() {
                 deep:true
-                console.log('88888888888')
             }
         }
     }

+ 5 - 8
TEAMModelOS/ClientApp/src/view/learnactivity/ManageEvaluation.vue

@@ -51,12 +51,12 @@
         <div class="evaluation-detail-wrap">
             <!--顶部菜单-->
             <div class="evaluation-detail-bar">
-                <span :class="currentBraIndex == 0 ? 'evalustion-bar-item line-bottom-active line-bottom':'evalustion-bar-item line-bottom'" @click="selectBar(0)">评测信息</span>
-                <span :class="currentBraIndex == 1 ? 'evalustion-bar-item line-bottom-active line-bottom':'evalustion-bar-item line-bottom'" @click="selectBar(1)">评测数据</span>
+                <span :class="currentBraIndex == 0 ? 'evalustion-bar-item line-bottom-active line-bottom':'evalustion-bar-item line-bottom'" @click="selectBar(0)">评测数据</span>
+                <span :class="currentBraIndex == 1 ? 'evalustion-bar-item line-bottom-active line-bottom':'evalustion-bar-item line-bottom'" @click="selectBar(1)">评测信息</span>
                 <!--<span :class="evaluationList.length == 0 ? 'edit-evaluation custom-label-disabeld':'edit-evaluation'" @click="publishEvaluation"><Icon type="ios-send" size="20" />发布评测</span>-->
             </div>
             <!--评测信息-->
-            <div :class="currentBraIndex == 0 ? 'animated fadeIn evaluation-base-info':'evaluation-base-info animated fadeOutRight'" v-show="currentBraIndex == 0">
+            <div :class="currentBraIndex == 1 ? 'animated fadeIn evaluation-base-info':'evaluation-base-info animated fadeOutRight'" v-show="currentBraIndex == 1">
                 <!-- 试卷详细信息 -->
                 <div class="evaluation-test-paper">
                     <div class="evaluation-test-paper-header">
@@ -84,7 +84,7 @@
                 </div>
             </div>
             <!-- 试卷评测打分 -->
-            <div :class="currentBraIndex == 1 ? 'animated fadeIn evaluation-base-info':'evaluation-base-info animated fadeOutRight'" v-if="currentBraIndex == 1">
+            <div :class="currentBraIndex == 0 ? 'animated fadeIn evaluation-base-info':'evaluation-base-info animated fadeOutRight'" v-if="currentBraIndex == 0">
                 <ClassList :paper="examPaperList"></ClassList>
             </div>
         </div>
@@ -468,7 +468,6 @@
                 }
             },
             selectSubject(index) {
-                console.log(index)
                 //this.showPaperInfo = {}
                 this.currentSubjectIndex = index
                 //this.showPaperInfo = this.
@@ -501,7 +500,6 @@
                 this.startTime = this.dateFormat( start)
             },
             selectEvaluation(index) {
-                console.log(index)
                 this.isLoading =true
                 this.currentSubjectIndex = 0
                 this.currentBraIndex = 0
@@ -517,7 +515,6 @@
                     res => {
                         if (res.error == null) {
                             this.evaluationList = res.examInfo
-                            console.log(this.evaluationList)
                             if (this.evaluationList.length > 0) {
                                 this.selectEvaluation(0)
                             }
@@ -556,10 +553,10 @@
                 this.examPaperList = []
                 for (let i = 0; i < dataInfo.papers.length; i++) {
                     let resData = {}
-                    console.log(dataInfo)
                     resData.period = dataInfo.period.name
                     resData.subjectName = dataInfo.subjects[i].name
                     resData.class = dataInfo.targetClassIds
+                    resData.code = dataInfo.code
                     resData.id = dataInfo.id
                     resData.papers = await this.$evTools.getFullPaper(dataInfo.papers[i])
                     this.examPaperList.push(resData)

+ 8 - 8
TEAMModelOS/ClientApp/src/view/newcourse/NewCoursePlan.vue

@@ -367,16 +367,16 @@
         async created() {
             this.isLoading = true
             await this.getCourseList()
-            this.classList = JSON.parse(JSON.stringify(this.$store.state.user.schoolProfile.school_classes))
-            this.classListShow = [...this.classList]
-            this.findClassPlan(0)
-            this.schoolInfo = this.$store.state.user.schoolProfile.school_base
-            /*await this.$store.dispatch('schoolBaseInfo/getClassroom').then(res => {
-                this.classList = JSON.parse(JSON.stringify(this.$store.state.schoolBaseInfo.classroomList))
+            await this.$store.dispatch('user/getSchoolProfile').then(res => {
+                //this.classList = JSON.parse(JSON.stringify(this.$store.state.schoolBaseInfo.classroomList))
+                //this.classListShow = [...this.classList]
+                //this.findClassPlan(0)
+                //this.schoolInfo = this.$store.state.schoolBaseInfo.schoolBaseInfo
+                this.classList = res.school_classes
                 this.classListShow = [...this.classList]
                 this.findClassPlan(0)
-                this.schoolInfo = this.$store.state.schoolBaseInfo.schoolBaseInfo
-            })*/
+                this.schoolInfo = res.school_base
+            })
         },
         computed: {
             //动态绑定已选择教师id

+ 20 - 44
TEAMModelOS/ClientApp/src/view/schoolmgmt/ClassroomSetting/ClassroomSetting.less

@@ -14,13 +14,13 @@
     flex-direction: row;
 
     .class-list-wrap {
-        width: 500px;
+        width: 400px;
         height: 100%;
         border-right: 1px solid @borderColor;
     }
 
     .class-info-wrap {
-        width: ~"calc(100% - 500px)";
+        width: ~"calc(100% - 400px)";
         height: 100%;
         padding-left:15px;
     }
@@ -47,18 +47,19 @@
         align-items: center;
     }
 }
-.action-btn{
+.action-btn {
     float: right;
-    color: white;
-    font-size: 12px;
     display: flex;
     align-items: center;
     margin-right: 15px;
-    cursor: pointer;
-    &-icon{
-        color:white;
+    &-icon {
+        color: white;
+        font-size: 16px;
         margin-right: 12px;
-        &.hide-icon{
+        margin-left: 10px;
+        cursor: pointer;
+
+        &.hide-icon {
             display: none;
         }
     }
@@ -196,7 +197,7 @@
 }
 .class-list {
     width: 100%;
-    height:~"calc(100% - 45px)";
+    height:~"calc(100% - 95px)";
     padding-left: 15px;
     
 }
@@ -268,8 +269,6 @@
         display:inline-block;
         color:@second-textColor;
         font-size:@second-fontSize - 4px;
-        /*margin-top:30px;
-        margin-bottom:10px;*/
     }
 }
 .hiteach-code-wrap {
@@ -292,49 +291,17 @@
         height: ~"calc(100% - 72px)";
         padding-left: 25px;
         h1 {
-        //     margin-top: -120px;
             font-weight: 400;
         }
 
         ul {
             list-style: none;
-            // padding-left: 20px;
-            // margin-top: 15px;
 
             li {
                 color: #dbdbdb;
                 display: flex;
                 align-items: center;
                 margin-bottom: 5px;
-                // span {
-                //     text-overflow: ellipsis;
-                //     overflow: hidden;
-                //     white-space: nowrap;
-                //     display: inline-block;
-                //     width: calc(100% - 50px);
-                // }
-
-                // &:hover {
-                //     background: @borderColor;
-                //     color: white;
-                // }
-
-                // height: 40px;
-                // line-height: 40px;
-                // color: @second-textColor;
-                // font-size: @second-fontSize - 1;
-                // padding-left: 5px;
-                // cursor: pointer;
-                // .border(bottom);
-
-                // .ivu-icon {
-                //     margin-top: -4px;
-                // }
-
-                // .ivu-tag {
-                //     float: right;
-                //     margin-top: 8px;
-                // }
             }
         }
     }
@@ -397,3 +364,12 @@
         }
     }
 }
+
+.class-id-tag {
+    color: aqua;
+    font-size: 12px;
+    margin-left: 5px;
+    border: 1px solid aqua;
+    padding: 1px 3px;
+    border-radius: 3px;
+}

+ 79 - 103
TEAMModelOS/ClientApp/src/view/schoolmgmt/ClassroomSetting/ClassroomSetting.vue

@@ -4,43 +4,30 @@
         <div class="class-list-wrap">
             <!--班级列表-->
             <div class="class-list-header">
-                <!-- <span>班级列表</span> -->
-                <Dropdown class="sort-dropdown" trigger="click" placement="bottom-start" @on-click="function(e){ filterPeriod = e }" @on-visible-change="dropdownStates">
+                <Dropdown class="sort-dropdown" trigger="click" placement="bottom-start" @on-click="function(e){ filterPeriod = e }" @on-visible-change="dropdownStates" v-if="$store.state.user.schoolProfile.school_base">
                     <span style="cursor: pointer;">
                         <b class="title">{{ filterPeriodName }}</b>
-                        {{ '班级列表' }}
-                        <Icon type="ios-arrow-down"></Icon>
+                        <!--{{ '班级列表' }}-->
+                        <Icon type="ios-arrow-down" style="margin-left:8px;"></Icon>
                     </span>
-                    <DropdownMenu slot="list" v-for="(item,index) in this.$store.state.schoolBaseInfo.schoolBaseInfo.period" :value="item.id" :key="index">
+                    <DropdownMenu slot="list" v-for="(item,index) in $store.state.user.schoolProfile.school_base.period" :value="item.id" :key="index">
                         <DropdownItem :name="item.id">{{ item.name }}</DropdownItem>
                     </DropdownMenu>
                 </Dropdown>
-                    
-                <div v-if="!isSearch" style="float:right;">
-                    <!-- <Icon class="action-btn-icon" type="ios-search" @click="isSearch = true" /> -->
-                    <!-- 新增班級 -->
-                    <div class="action-btn" @click="addClassroom()">
-                        <Icon class="action-btn-icon" type="md-add" />
-                        <span>{{ $t('新增教室') }}</span>
-                    </div>
 
-                     <!-- 學段篩選 先註解 -->
-                        <!-- <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).name}}
-                    </Tag>
-                    <Poptip trigger="hover" placement="bottom" offset="-8">
-                        <Icon type="ios-funnel" class="action-btn-icon" size="16" style="padding-top:1px;" />
-                        <div slot="content">
-                            <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.user.schoolProfile.school_base.period" :value="item.id" :key="index">
-                                        {{ item.name }}
-                                    </Option>
-                                </Select>
-                            </div>
-                        </div>
-                    </Poptip> -->
+                <div v-if="!isSearch" style="float:right;">
+                    <Icon class="action-btn-icon" type="ios-search" @click="isSearch = true" />
+                    <Icon class="action-btn-icon" type="md-trash"  @click.stop="showConfirmDelete()" />
+                    <Icon class="action-btn-icon" type="md-add" @click="addClassroom()" />
+                </div>
+                <div v-else class="dark-iview-input" style="float:right;width:calc(100% - 100px);padding-right:10px;">
+                    <Input icon="ios-close"
+                           v-model="keyword"
+                           placeholder="关键字搜索..."
+                           autofocus
+                           style="width:100%"
+                           @on-click="closeKeySearch"
+                           @on-change="filterClassname" />
                 </div>
             </div>
             <div class="class-list-filter">
@@ -57,13 +44,6 @@
                             <DropdownItem name="total">{{ '依學生數排序' }}</DropdownItem>
                         </DropdownMenu>
                     </Dropdown>
-                    <div class="dark-iview-input" style="padding-right:10px;">
-                        <Input size="small" suffix="ios-search"
-                           v-model="keyword"
-                           style="width: 110px"
-                           @on-click="closeKeySearch"
-                           @on-change="filterClassname" />
-                    </div>
                 </div>
             </div>
             <div class="class-list">
@@ -71,32 +51,42 @@
                     <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>{{getPeriodName(item.periodId)}}</p> -->
-                            <p class="class-name">{{item.id}}, {{item.name}}</p>
-                            <!-- <p class="class-hiteach-code second-text-color">{{item.sn}}</p> -->
+                            <p class="class-name">
+                                <span>
+                                    {{item.name}}
+                                </span>    
+                                <span class="class-id-tag">
+                                    {{item.id}}
+                                </span>
+                            </p>
                             <p class="class-type">
                                 <template v-if="item.style != 'smart'">
                                     <div class="iconHi" >
                                         <v-icon iconClass="hi" style="color:#333;" />
                                     </div>
                                     <span>
-                                        {{ $t('TEAM Model 智慧教室') }}
+                                        <!--多语系后面统一处理-->
+                                        <!--{{ $t('TEAM Model 智慧教室') }}-->
+                                        TEAM Model 智慧教室
                                     </span>
                                 </template>
                                 <template v-else>
                                     <span style="color:#a5a5a5;">
-                                        <v-icon iconClass="board" /> {{ $t('普通教室') }}
+                                        <v-icon iconClass="board" />
+                                        <!--{{ $t('普通教室') }}-->
+                                        普通教室
                                     </span>
                                 </template>
                             <p class="second-text-color">
-                                <span class="title">{{ $t('學生人數') + ':' }}</span>
-                                <span class="primary-text-color">{{item.studCount}}</span>
-                                <span style="margin-left:5px;margin-right: 13px;">|</span>
+                                <!--<span class="title">{{ $t('學生人數') + ':' }}</span>
+                                <span class="primary-text-color">{{item.studCount}}</span>-->
+                                <!--<span style="margin-left:5px;margin-right: 13px;">|</span>-->
                                 <span>{{$t('schoolBaseInfo.headmaster') + ':'}}</span>
                                 <span class="primary-text-color">{{item.teacher.name}}</span>
                             </p>
                         </div>
                         <!-- 刪除教室 -->
-                        <Icon class="action-btn-icon" :class="curClassIndex == index ? '' : 'hide-icon'" size="19" type="md-trash" @click.stop="showConfirmDelete()" /> 
+                        <!--<Icon class="action-btn-icon" :class="curClassIndex == index ? '' : 'hide-icon'" size="19" type="md-trash"/>--> 
                     </div>
                     <EmptyData v-if="classroomListShow.length == 0" style="padding-top:120px;"></EmptyData>
                 </vuescroll>
@@ -119,29 +109,20 @@
                     <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;">
-                                <FormItem prop="id" @click.native.stop class="requird-color">
-                                    <span slot="label" class="class-attr-wrap-label">{{$t('schoolBaseInfo.classroomCode')}}</span>
-                                    <Input @on-change="watchUpdate" :disabled="editStatus" v-model="classroomListShow[curClassIndex].id" clearable :placeholder="$t('schoolBaseInfo.classroomCodeHolder')" />
-                                </FormItem>
                                 <FormItem prop="name" :label="$t('schoolBaseInfo.classroomName')" @click.native.stop class="requird-color">
                                     <span slot="label" class="class-attr-wrap-label">{{$t('schoolBaseInfo.classroomName')}}</span>
                                     <Input @on-change="watchUpdate" :disabled="editStatus" v-model="classroomListShow[curClassIndex].name" clearable :placeholder="$t('schoolBaseInfo.classroomNameHolder')" />
                                 </FormItem>
+                                <FormItem prop="id" @click.native.stop class="requird-color">
+                                    <span slot="label" class="class-attr-wrap-label">{{$t('schoolBaseInfo.classroomCode')}}</span>
+                                    <Input @on-change="watchUpdate" :disabled="editStatus" v-model="classroomListShow[curClassIndex].id" clearable :placeholder="$t('schoolBaseInfo.classroomCodeHolder')" />
+                                </FormItem>
                                 <FormItem prop="openType" @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].openType" clearable>
                                         <Option v-for="(item,index) in attributeList" :value="item.value" :key="index">{{ item.label }}</Option>
                                     </Select>
                                 </FormItem>
-                                <!-- 暫時註解 不修改 Osbert 
-                                    <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].periodId" clearable>
-                                        <Option v-for="(item,index) in $store.state.user.schoolProfile.school_base.period" :value="item.id" :key="index">
-                                            {{ item.name }}
-                                        </Option>
-                                    </Select>
-                                </FormItem> -->
                                 <FormItem prop="gradeId" :label="$t('schoolBaseInfo.setGrade')" @click.native.stop class="requird-color">
                                     <span slot="label" class="class-attr-wrap-label">{{$t('schoolBaseInfo.setGrade')}}</span>
                                     <Select @on-change="watchUpdate" :disabled="editStatus" v-model="classroomListShow[curClassIndex].gradeId" clearable>
@@ -159,10 +140,10 @@
                                     </Select>
                                 </FormItem>
                                 <!-- 暫時註解改為旁邊勾選 Osbert
-                                    <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].sn" :disabled="editStatus" :placeholder="$t('schoolBaseInfo.hiTeachHolder')" clearable />
-                                </FormItem> -->
+        <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].sn" :disabled="editStatus" :placeholder="$t('schoolBaseInfo.hiTeachHolder')" clearable />
+    </FormItem> -->
                             </Form>
                         </vuescroll>
                     </div>
@@ -171,8 +152,8 @@
                         <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="addCode = true" /> -->
-                                {{$t('關聯Hiteach設備')}}
+                                <!--{{$t('關聯Hiteach設備')}}-->
+                                關聯Hiteach設備
                             </p>
                             <div class="class-list-filter">
                                 <div class="class-list-filter-box">
@@ -617,8 +598,8 @@
             filterPeriodName: function(){
                 let pId = this.filterPeriod
                 let name = ''
-                if(pId !== ''){
-                    let temp = this.$store.state.schoolBaseInfo.schoolBaseInfo.period.filter( item => {
+                if(pId){
+                    let temp = this.$store.state.user.schoolProfile.school_base.period.filter( item => {
                         return pId == item.id
                     })
                     if(temp.length >0 ) name = temp[0].name
@@ -693,13 +674,19 @@
                 return data
             },
             filterByPeriod() {
+                this.curClassIndex = 0
                 if (this.filterPeriod) {
-                    this.classroomListShow = this.classroomList.filter(item => item.periodId == this.filterPeriod)
+                    this.classroomListShow = this.classroomList.filter(item => item.periodId == this.filterPeriod || !item.periodId)
                 } else {
                     this.classroomListShow = [...this.classroomList]
                 }
                 // 排序
                 this.classroomListShow = this.dataSort(this.classroomListShow)
+
+                this.$nextTick(() => {
+                    this.drawSchoolPlan('')
+                    this.initIcon()
+                })
             },
             filterClassname() {
                 if (this.keyword == '' || this.keyword == undefined) {
@@ -807,7 +794,6 @@
                 this.schoolPlan = document.getElementById('school-plan')
                 this.schoolPlan.height = this.schoolImageData.height * this.scaleDefault
                 this.schoolPlan.width = this.schoolImageData.width * this.scaleDefault
-                let ctx = this.schoolPlan.getContext('2d')
                 this.drawSchoolPlan('imgUrl')
                 this.initIcon()
             },
@@ -836,28 +822,28 @@
                 this.schoolPlan = document.getElementById('school-plan')
                 let ctx = this.schoolPlan.getContext('2d')
                 let _this = this
-                for (let i = 0; i < _this.classroomList.length; i++) {
+                for (let i = 0; i < _this.classroomListShow.length; i++) {
                     if (this.activeIcon == i) {
                         ctx.drawImage(this.greenImageData, x * _this.scaleDefault, y * _this.scaleDefault, 20 * _this.scaleDefault, 20 * _this.scaleDefault)
                         this.updated = true
                     } else {
-                        ctx.drawImage(this.whiteImageData, _this.classroomList[i].x * _this.scaleDefault, _this.classroomList[i].y * _this.scaleDefault, 20 * _this.scaleDefault, 20 * _this.scaleDefault)
+                        ctx.drawImage(this.whiteImageData, _this.classroomListShow[i].x * _this.scaleDefault, _this.classroomListShow[i].y * _this.scaleDefault, 20 * _this.scaleDefault, 20 * _this.scaleDefault)
                     }
                 }
             },
             initIcon() {
                 this.schoolPlan = document.getElementById('school-plan')
                 let ctx = this.schoolPlan.getContext('2d')
-                for (let i = 0; i < this.classroomList.length; i++) {
+                for (let i = 0; i < this.classroomListShow.length; i++) {
                     let icon = i == this.curClassIndex ? this.greenImageData : this.whiteImageData
                     ctx.drawImage(icon,
-                        this.classroomList[i].x * this.scaleDefault, this.classroomList[i].y * this.scaleDefault,
+                        this.classroomListShow[i].x * this.scaleDefault, this.classroomListShow[i].y * this.scaleDefault,
                         20 * this.scaleDefault, 20 * this.scaleDefault)
                 }
             },
             checkActivieIcon(point) {
-                for (let item in this.classroomList) {
-                    if (point.x > this.classroomList[item].x * this.scaleDefault && point.x < (this.classroomList[item].x + 15) * this.scaleDefault && point.y > this.classroomList[item].y * this.scaleDefault && point.y < (this.classroomList[item].y + 15) * this.scaleDefault) {
+                for (let item in this.classroomListShow) {
+                    if (point.x > this.classroomListShow[item].x * this.scaleDefault && point.x < (this.classroomListShow[item].x + 15) * this.scaleDefault && point.y > this.classroomListShow[item].y * this.scaleDefault && point.y < (this.classroomListShow[item].y + 15) * this.scaleDefault) {
                         return item
                     }
                 }
@@ -899,12 +885,11 @@
                     let index = this.checkActivieIcon(this.point)
                     if (index != -1) {
                         if (this.textStatus == true) {
-                            this.drawText(this.classroomList[index].name, (this.classroomList[index].x + 25) * this.scaleDefault, (this.classroomList[index].y + 20) * this.scaleDefault)
+                            this.drawText(this.classroomListShow[index].name, (this.classroomListShow[index].x + 25) * this.scaleDefault, (this.classroomListShow[index].y + 20) * this.scaleDefault)
                             this.textStatus = false
                         }
                     } else {
                         this.drawSchoolPlan('')
-                        //this.moveIcon(this.point.x, this.point.y)
                         this.initIcon()
                         this.textStatus = true
                     }
@@ -913,15 +898,15 @@
             canvasMouseUp(e) {
                 this.isMouseDown = false
                 if (this.activeIcon != -1) {
-                    this.classroomList[this.activeIcon].x = this.point.x / this.scaleDefault
-                    this.classroomList[this.activeIcon].y = this.point.y / this.scaleDefault
+                    this.classroomListShow[this.activeIcon].x = this.point.x / this.scaleDefault
+                    this.classroomListShow[this.activeIcon].y = this.point.y / this.scaleDefault
                 }
                 this.activeIcon = -1
             },
             canvasMouseOut(e) {
                 this.isMouseDown = false
                 if (this.activeIcon != -1) {
-                    this.classroomList[this.activeIcon].point = this.point
+                    this.classroomListShow[this.activeIcon].point = this.point
                 }
                 this.activeIcon = -1
             },
@@ -973,8 +958,6 @@
                 reader.readAsDataURL(file)
                 reader.onload = () => {
                     const _base64 = reader.result
-                    //this.imgUrl = _base64 // 将_base64赋值给图片的src,实现图片预览
-                    //_this.drawSchoolPlan(this.imgUrl)
                     _this.drawSchoolPlan(_base64)
                 }
                 return false
@@ -1033,36 +1016,29 @@
             getClassroom() {
                 this.isListLoading = true
                 //直接读取登录成功拿到得学校基础信息
-                this.classroomList = this.$store.state.user.schoolProfile.school_classes
-                if (this.classroomList.length > 0) {
-                    this.updateBefore = JSON.stringify(this.classroomList[0])
-                }
-                this.filterClassname()
-                setTimeout(() => {
-                    this.isListLoading = false
-                },500)
-                /*this.$store.dispatch('schoolBaseInfo/getClassroom').then(
+                
+                this.$store.dispatch('user/getSchoolProfile').then(
                     (res) => {
-                        if (res.code == 1 || res.code == 3) {
-                            this.classroomList = this.$store.state.schoolBaseInfo.classroomList
-
-                            console.log(this.$store.state.schoolBaseInfo.classroomList, 'classroomList')
-
-                            // 預設搜尋給第一個
-                            this.filterPeriod = this.$store.state.schoolBaseInfo.schoolBaseInfo.period[0].id
-
+                        if (res) {
+                            this.classroomList = this.$store.state.user.schoolProfile.school_classes
                             if (this.classroomList.length > 0) {
                                 this.updateBefore = JSON.stringify(this.classroomList[0])
                             }
                             this.filterClassname()
+
+                            // 預設搜尋給第一個
+                            this.filterPeriod = res.school_base.period[0].id
+                            this.filterByPeriod()
                         }
                     },
                     (err) => {
                         this.$Message.error('API error!')
                     }
                 ).finally(() => {
-                    this.isListLoading = false
-                })*/
+                    setTimeout(() => {
+                        this.isListLoading = false
+                    }, 500)
+                })
             },
             /**显示确认删除班级对话框 */
             showConfirmDelete() {
@@ -1154,6 +1130,7 @@
                         this.updateBefore = JSON.stringify(this.classroomListShow[this.curClassIndex])
                     }
                     if (this.currentTabIndex == 1) {
+                        this.drawSchoolPlan('')
                         this.initIcon()
                     }
                 }
@@ -1257,14 +1234,13 @@
                         id: '',
                         name: ''
                     },
-                    periodId:'',
+                    periodId: this.filterPeriod,
                     gradeId: '',
                     x: 20 * (this.classroomList.length % 5),
                     y: 20 * (this.classroomList.length / 5).toFixed(0),
                     scope:'school',
                     option:'insert'
                 })
-                //this.classroomListShow = [...this.classroomList]
                 this.drawIcon(5, 6)
                 this.curClassIndex = 0
                 this.updateBefore = JSON.stringify(this.classroomListShow[this.curClassIndex])
@@ -1411,7 +1387,7 @@
 
 .sort-dropdown{
     .title{
-        color: #dcdee2;
+        color: white;
         font-size: 14px;
     }
     .ivu-select-dropdown{

+ 8 - 38
TEAMModelOS/ClientApp/src/view/schoolmgmt/SystemSetting/SystemSetting.vue

@@ -679,45 +679,11 @@
             },
             getSchoolBaseData() {
                 this.isLoading = true
-                //直接读取登录成功拿到得学校基础信息
-                this.schoolSetting = JSON.parse(JSON.stringify(this.$store.state.user.schoolProfile.school_base))
-                if (this.schoolSetting) {
-                    if (this.schoolSetting.period[this.curPriodIndex].semesters.length > 0) {
-                        //计算学期天数
-                        if (!this.schoolSetting.period[this.curPriodIndex].semesters[0].days) {
-                            let count = 365
-                            let index = 0
-                            let year = new Date().getFullYear()
-                            for (let i = 0; i < this.schoolSetting.period[this.curPriodIndex].semesters.length; i++) {
-                                if (i == (this.schoolSetting.period[this.curPriodIndex].semesters.length - 1)) {
-                                    index = i
-                                    break
-                                } else {
-                                    let sDate = year + '-' + this.schoolSetting.period[this.curPriodIndex].semesters[i].month + '-' + this.schoolSetting.period[this.curPriodIndex].semesters[i].day
-                                    let eDate = year + '-' + this.schoolSetting.period[this.curPriodIndex].semesters[i + 1].month + '-' + this.schoolSetting.period[this.curPriodIndex].semesters[i + 1].day
-                                    let d = this.getDays(sDate, eDate)
-                                    count -= d
-                                    this.$set(this.schoolSetting.period[this.curPriodIndex].semesters[i], 'days', d)
-
-                                }
-                            }
-                            this.$set(this.schoolSetting.period[this.curPriodIndex].semesters[index], 'days', count)
-                        }
-                        this.updated = false
-                    }
-                } else {
-                    this.getLocalDefaultData()
-                    this.schoolSetting.period[0].grades = JSON.parse(JSON.stringify(this.dataDefault.grades))
-                    this.schoolSetting.period[0].subjects = JSON.parse(JSON.stringify(this.dataDefault.subjects))
-                }
-                setTimeout(() => {
-                    this.isLoading = false
-                }, 500)
-                /*this.$store.dispatch('schoolBaseInfo/getSchoolBaseData').then(
+                this.$store.dispatch('user/getSchoolProfile').then(
                     (res) => {
-                        if (res.code == 1 || res.code == 3) {
+                        if (res) {
                             this.isInit = true
-                            this.schoolSetting = this.$store.state.schoolBaseInfo.schoolBaseInfo
+                            this.schoolSetting = res.school_base
                             //计算学期天数
                             if (this.schoolSetting.period[this.curPriodIndex].semesters.length > 0) {
                                 if (!this.schoolSetting.period[this.curPriodIndex].semesters[0].days) {
@@ -750,12 +716,16 @@
                     },
                     (err) => {
                         console.log(err)
+                        this.getLocalDefaultData()
+                        this.isInit = true
+                        this.schoolSetting.period[0].grades = JSON.parse(JSON.stringify(this.dataDefault.grades))
+                        this.schoolSetting.period[0].subjects = JSON.parse(JSON.stringify(this.dataDefault.subjects))
                     }
                 ).finally(() => {
                     setTimeout(() => {
                         this.isLoading = false
                     }, 500)
-                })*/
+                })
             },
             handleData() {
                 for (let i = 0; i < this.schoolSetting.period.length; i++) {

+ 1 - 1
TEAMModelOS/ClientApp/src/view/student-account/ImportStudent.vue

@@ -12,7 +12,7 @@
             </Upload>
             <p class="import-tips" style="margin-top:40px;">{{$t('stuAccount.importTips1')}}</p>
             <p class="import-tips">{{$t('stuAccount.importTips2') + $t('stuAccount.importTips3')}}</p>
-            <a style="margin-top:10px;color:turquoise;display:inline-block;" href="https://teammodelstorage.blob.core.chinacloudapi.cn/teammodelcontest/20191107/%E5%AD%A6%E7%94%9F%E8%B4%A6%E5%8F%B7%E5%90%8D%E5%8D%95(v1).xlsx">(下载名单模板)</a>
+            <a style="margin-top:10px;color:turquoise;display:inline-block;" href="https://teammodelstorage.blob.core.chinacloudapi.cn/teammodelcontest/20191107/%E5%AD%A6%E7%94%9F%E8%B4%A6%E5%8F%B7%E5%90%8D%E5%8D%95%20%E2%80%94%E6%AD%A3%E7%A1%AE%E6%95%B0%E6%8D%AE.xlsx">(下载名单模板)</a>
         </div>
         <div class="form-body" style="background:none;" v-else>
             <div class="ivu-upload-list-file">

+ 4 - 4
TEAMModelOS/ClientApp/src/view/student-account/Index.vue

@@ -11,19 +11,19 @@
         <div class="sc-menu">
             <div class="sc-menu-left dark-iview-select">
                 <!-- 學制Select -->
-                <Select v-model="searchPeriod" style="width:18%;" :placeholder="$t('stuAccount.periodHolder')" clearable @on-change="filterData">
+                <Select v-model="searchPeriod" style="width:120px;" :placeholder="$t('stuAccount.periodHolder')" clearable @on-change="filterData">
                     <Option v-for="(item,index) in periods" :value="item.id" :key="index">{{ item.name }}</Option>
                 </Select>
                 <!-- 學級Select -->
-                <Select v-model="searchGrade" style="width:18%;margin-left:1%;" :placeholder="$t('stuAccount.gradeHolder')" clearable @on-change="filterData">
+                <Select v-model="searchGrade" style="width:120px;margin-left:5px;" :placeholder="$t('stuAccount.gradeHolder')" clearable @on-change="filterData">
                     <Option v-for="(item,index) in filterGrades" :value="item.id" :key="index">{{ item.name }}</Option>
                 </Select>
                 <!-- 教室Select -->
-                <Select v-model="searchClassroom" ref="classroom" style="width:18%;margin-left:1%;" :placeholder="$t('stuAccount.classroomHolder')" clearable @on-change="filterData">
+                <Select v-model="searchClassroom" ref="classroom" style="width:150px;margin-left:5px;" :placeholder="$t('stuAccount.classroomHolder')" clearable @on-change="filterData">
                     <Option v-for="(item,index) in filterClasses" :value="item.id" :key="index">{{ item.name }}</Option>
                 </Select>
                 <!-- 字串模糊搜尋 -->
-                <Input v-model="searchText" clearable :placeholder="$t('stuAccount.searchHolder')" style="width: 28%;margin-left:6%;" search @on-search="filterData"  @on-clear="filterData"></Input>
+                <Input v-model="searchText" clearable :placeholder="$t('stuAccount.searchHolder')" style="width: 220px;margin-left:20px;" search @on-search="filterData"  @on-clear="filterData"></Input>
             </div>
             <div class="sc-menu-right sc-text-no-select">
                 <ul v-if="$access.can('admin.*|student-upd')">

+ 2 - 1
TEAMModelOS/Controllers/Exam/ExamController.cs

@@ -507,13 +507,14 @@ namespace TEAMModelOS.Controllers
                 if (!request.TryGetProperty("studentId", out JsonElement studentId)) return BadRequest();
                 if (!request.TryGetProperty("classId", out JsonElement classId)) return BadRequest();
                 if (!request.TryGetProperty("school", out JsonElement school)) return BadRequest();
+                if (!request.TryGetProperty("subjectId", out JsonElement subjectId)) return BadRequest();
                 //要先处理状态,判断卷子是否存在,并判断卷子归属的考试是否允许再次提交
                 //List<ExamInfo> exams = await _azureCosmos.FindByDict<ExamInfo>(new Dictionary<string, object> { { "id", request.examCode } });
                 List<double> ans = point.ToObject<List<double>>();
                 var client = _azureCosmos.GetCosmosClient();
                 List<ExamClassResult> examClassResults = new List<ExamClassResult>();
                 await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIterator(
-                    queryText: $"select value(c) from c where c.examId = '{id}' and c.subjectId = {studentId} and c.info.id = '{classId}'",
+                    queryText: $"select value(c) from c where c.examId = '{id}' and c.subjectId = '{subjectId}' and c.info.id = '{classId}'",
                     requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"ExamClassResult-{school}") }))
                 {
                     using var json = await JsonDocument.ParseAsync(item.ContentStream);