소스 검색

合并冲突

JAELYS 4 년 전
부모
커밋
e2a533a81d
77개의 변경된 파일1342개의 추가작업 그리고 890개의 파일을 삭제
  1. 9 7
      TEAMModelFunction/MonitorCosmosDB.cs
  2. 1 1
      TEAMModelOS/ClientApp/src/api/courseMgmt.js
  3. 2 0
      TEAMModelOS/ClientApp/src/boot-app.js
  4. 23 21
      TEAMModelOS/ClientApp/src/common/BaseLayout.vue
  5. 12 12
      TEAMModelOS/ClientApp/src/common/BaseSelectSchool.vue
  6. 0 13
      TEAMModelOS/ClientApp/src/components/coursemgmt/StudentList.less
  7. 0 328
      TEAMModelOS/ClientApp/src/components/coursemgmt/StudentList.vue
  8. 30 0
      TEAMModelOS/ClientApp/src/components/coursemgt/StudentList.less
  9. 287 0
      TEAMModelOS/ClientApp/src/components/coursemgt/StudentList.vue
  10. 0 0
      TEAMModelOS/ClientApp/src/components/homework/BaseHwForm.less
  11. 1 1
      TEAMModelOS/ClientApp/src/components/learnactivity/BaseHwForm.vue
  12. 0 0
      TEAMModelOS/ClientApp/src/components/homework/BaseHwTable.less
  13. 0 0
      TEAMModelOS/ClientApp/src/components/homework/BaseHwTable.vue
  14. 108 23
      TEAMModelOS/ClientApp/src/components/learnactivity/ClassList.vue
  15. 0 1
      TEAMModelOS/ClientApp/src/components/learnactivity/GradeList.vue
  16. 1 2
      TEAMModelOS/ClientApp/src/components/learnactivity/GradeTable.vue
  17. 22 12
      TEAMModelOS/ClientApp/src/components/questionnaire/BaseJudge.vue
  18. 22 12
      TEAMModelOS/ClientApp/src/components/questionnaire/BaseMultiple.vue
  19. 2 1
      TEAMModelOS/ClientApp/src/components/questionnaire/BaseSingle.less
  20. 21 11
      TEAMModelOS/ClientApp/src/components/questionnaire/BaseSingle.vue
  21. 0 0
      TEAMModelOS/ClientApp/src/components/selflearn/ChooseContent.less
  22. 0 0
      TEAMModelOS/ClientApp/src/components/selflearn/ContentFileList.less
  23. 0 0
      TEAMModelOS/ClientApp/src/components/selflearn/ContentFileList.vue
  24. 0 1
      TEAMModelOS/ClientApp/src/components/learnactivity/NewChooseContent.vue
  25. 0 0
      TEAMModelOS/ClientApp/src/components/selflearn/SelectLearnUnit.less
  26. 0 0
      TEAMModelOS/ClientApp/src/components/selflearn/SelectLearnUnit.vue
  27. 0 0
      TEAMModelOS/ClientApp/src/components/selflearn/SelectOrderLearn.less
  28. 0 0
      TEAMModelOS/ClientApp/src/components/selflearn/SelectOrderLearn.vue
  29. 1 1
      TEAMModelOS/ClientApp/src/components/syllabus/DragTree.vue
  30. 0 0
      TEAMModelOS/ClientApp/src/components/vote/BaseVoteBar.vue
  31. 0 0
      TEAMModelOS/ClientApp/src/components/vote/BaseVoteForm.less
  32. 0 0
      TEAMModelOS/ClientApp/src/components/vote/BaseVoteForm.vue
  33. 0 0
      TEAMModelOS/ClientApp/src/components/vote/BaseVotePie.vue
  34. 0 0
      TEAMModelOS/ClientApp/src/components/vote/BaseVoteSsTable.vue
  35. 0 0
      TEAMModelOS/ClientApp/src/components/vote/BaseVoteTable.less
  36. 0 0
      TEAMModelOS/ClientApp/src/components/vote/BaseVoteTable.vue
  37. 2 0
      TEAMModelOS/ClientApp/src/store/module/user.js
  38. 1 0
      TEAMModelOS/ClientApp/src/view/Home.vue
  39. 1 2
      TEAMModelOS/ClientApp/src/view/classmgt/ManageClass.vue
  40. 2 8
      TEAMModelOS/ClientApp/src/view/evaluation/bank/ExerciseList.vue
  41. 1 0
      TEAMModelOS/ClientApp/src/view/evaluation/components/BaseChild.vue
  42. 2 2
      TEAMModelOS/ClientApp/src/view/evaluation/components/BaseChildList.vue
  43. 2 5
      TEAMModelOS/ClientApp/src/view/evaluation/components/BaseCreateChild.vue
  44. 18 21
      TEAMModelOS/ClientApp/src/view/evaluation/components/BaseEditExercise.vue
  45. 1 5
      TEAMModelOS/ClientApp/src/view/evaluation/components/BaseExerciseList.vue
  46. 1 1
      TEAMModelOS/ClientApp/src/view/evaluation/components/BaseRepair.vue
  47. 20 0
      TEAMModelOS/ClientApp/src/view/evaluation/components/index.js
  48. 12 12
      TEAMModelOS/ClientApp/src/view/evaluation/index/CreateExercises.vue
  49. 1 1
      TEAMModelOS/ClientApp/src/view/evaluation/index/CreatePaper.vue
  50. 342 0
      TEAMModelOS/ClientApp/src/view/evaluation/types/BaseMultipleNew.vue
  51. 1 6
      TEAMModelOS/ClientApp/src/view/evaluation/types/BaseSingle.vue
  52. 2 2
      TEAMModelOS/ClientApp/src/view/homework/ManageHomeWork.vue
  53. 3 5
      TEAMModelOS/ClientApp/src/view/learnactivity/AutoCreate.vue
  54. 58 49
      TEAMModelOS/ClientApp/src/view/learnactivity/CreateEvaluation.vue
  55. 34 188
      TEAMModelOS/ClientApp/src/view/learnactivity/ManageEvaluation.vue
  56. 3 3
      TEAMModelOS/ClientApp/src/view/learnactivity/ManageRecord.vue
  57. 3 6
      TEAMModelOS/ClientApp/src/view/learnactivity/ManualCreate.vue
  58. 61 47
      TEAMModelOS/ClientApp/src/view/learnactivity/selectTree.vue
  59. 1 0
      TEAMModelOS/ClientApp/src/view/newcourse/MyCourse.less
  60. 167 28
      TEAMModelOS/ClientApp/src/view/newcourse/MyCourse.vue
  61. 1 1
      TEAMModelOS/ClientApp/src/view/schoolmgmt/SystemSetting/SystemSetting.vue
  62. 2 2
      TEAMModelOS/ClientApp/src/view/selfstudy/CreateLearnUnit.vue
  63. 3 3
      TEAMModelOS/ClientApp/src/view/selfstudy/CreateOrderLearn.vue
  64. 1 1
      TEAMModelOS/ClientApp/src/view/selfstudy/OrderLearnInfo.vue
  65. 1 1
      TEAMModelOS/ClientApp/src/view/selfstudy/SelfLearn.vue
  66. 2 4
      TEAMModelOS/ClientApp/src/view/selfstudy/UnitInfo.vue
  67. 1 1
      TEAMModelOS/ClientApp/src/view/student-account/AddStudent.vue
  68. 24 18
      TEAMModelOS/ClientApp/src/view/student-account/Index.vue
  69. 1 1
      TEAMModelOS/ClientApp/src/view/student-analysis/total-analysis/AchievementAnalysis/AchievementAnalysis.vue
  70. 1 1
      TEAMModelOS/ClientApp/src/view/student-analysis/total-analysis/ScatterAnalysis/ScatterAnalysis.vue
  71. 1 0
      TEAMModelOS/ClientApp/src/view/student-analysis/total-analysis/TestAnalysis/QuestionList.vue
  72. 1 2
      TEAMModelOS/ClientApp/src/view/teachcontent/index.vue
  73. 5 5
      TEAMModelOS/ClientApp/src/view/vote/ManageVote.vue
  74. 1 1
      TEAMModelOS/Controllers/Exam/ExamController.cs
  75. 13 9
      TEAMModelOS/Controllers/School/ClassRoomController.cs
  76. 1 1
      TEAMModelOS/Controllers/School/CourseController.cs
  77. 2 1
      TEAMModelOS/Models/TeacherInfo/TeacherCourse.cs

+ 9 - 7
TEAMModelFunction/MonitorCosmosDB.cs

@@ -74,7 +74,7 @@ namespace TEAMModelFunction
                             case "pending":
                                 if (records.Count > 0)
                                 {
-                                    await _serviceBus.GetServiceBusClient().cancelMessage("active - task", records[0].sequenceNumber);
+                                    await _serviceBus.GetServiceBusClient().cancelMessage("active-task", records[0].sequenceNumber);
                                     long start = await _serviceBus.GetServiceBusClient().SendScheduleMessageAsync("active-task", message, DateTimeOffset.FromUnixTimeMilliseconds(stime));
                                     records[0].sequenceNumber = start;
                                     await _azureStorage.SaveOrUpdate<ChangeRecord>(records[0]);
@@ -139,7 +139,7 @@ namespace TEAMModelFunction
                                     if (records.Count > 0)
                                     {
                                         long end = await _serviceBus.GetServiceBusClient().SendScheduleMessageAsync("active-task", message, DateTimeOffset.FromUnixTimeMilliseconds(etime));
-                                        await _serviceBus.GetServiceBusClient().cancelMessage("active - task", records[0].sequenceNumber);
+                                        await _serviceBus.GetServiceBusClient().cancelMessage("active-task", records[0].sequenceNumber);
                                         records[0].sequenceNumber = end;
                                         await _azureStorage.SaveOrUpdate<ChangeRecord>(records[0]);
                                         //await client.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync(record, record.id, new Azure.Cosmos.PartitionKey($"{record.code}"));
@@ -233,7 +233,7 @@ namespace TEAMModelFunction
                                 if (voteRecords.Count > 0)
                                 {
                                     long start = await _serviceBus.GetServiceBusClient().SendScheduleMessageAsync("active-task", messageVote, DateTimeOffset.FromUnixTimeMilliseconds(stime));
-                                    await _serviceBus.GetServiceBusClient().cancelMessage("active - task", voteRecords[0].sequenceNumber);
+                                    await _serviceBus.GetServiceBusClient().cancelMessage("active-task", voteRecords[0].sequenceNumber);
                                     voteRecords[0].sequenceNumber = start;
                                     await _azureStorage.SaveOrUpdate<ChangeRecord>(voteRecords[0]);
                                     //await client.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync(voteRecord, voteRecord.id, new Azure.Cosmos.PartitionKey($"{voteRecord.code}"));
@@ -255,7 +255,7 @@ namespace TEAMModelFunction
                                 if (voteRecords.Count > 0)
                                 {
                                     long end = await _serviceBus.GetServiceBusClient().SendScheduleMessageAsync("active-task", messageVote, DateTimeOffset.FromUnixTimeMilliseconds(etime));
-                                    await _serviceBus.GetServiceBusClient().cancelMessage("active - task", voteRecords[0].sequenceNumber);
+                                    await _serviceBus.GetServiceBusClient().cancelMessage("active-task", voteRecords[0].sequenceNumber);
                                     voteRecords[0].sequenceNumber = end;
                                     await _azureStorage.SaveOrUpdate<ChangeRecord>(voteRecords[0]);
                                     //await client.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync(voteRecord, voteRecord.id, new Azure.Cosmos.PartitionKey($"{voteRecord.code}"));
@@ -279,15 +279,17 @@ namespace TEAMModelFunction
                         Survey survey = await client.GetContainer("TEAMModelOS", "Common").ReadItemAsync<Survey>(input[0].Id, new Azure.Cosmos.PartitionKey($"{code}"));
                         var messageSurvey = new ServiceBusMessage(new { id = input[0].Id, name = "Survey", code = code }.ToJsonString());
                         messageSurvey.Properties.Add("name", "Survey");
-                        List<ChangeRecord> changeRecords = await _azureStorage.FindListByDict<ChangeRecord>(new Dictionary<string, object>() { { "RowKey", input[0].Id }, { "PartitionKey", survey.progress } });
+                        //messageSurvey.ScheduledEnqueueTime = DateTimeOffset.FromUnixTimeMilliseconds(stime);
+                        //string msgid = messageSurvey.MessageId;
+                        List<ChangeRecord> changeRecords =  await _azureStorage.FindListByDict<ChangeRecord>(new Dictionary<string, object>() { { "RowKey", input[0].Id },{"PartitionKey", survey.progress} });
                         //ChangeRecord surveyRecord = await client.GetContainer("TEAMModelOS", "Common").ReadItemAsync<ChangeRecord>(input[0].Id, new Azure.Cosmos.PartitionKey($"{survey.progress}"));
                         switch (survey.progress)
                         {
                             case "pending":
                                 if (changeRecords.Count > 0)
                                 {
+                                    await _serviceBus.GetServiceBusClient().cancelMessage("active-task", changeRecords[0].sequenceNumber);
                                     long start = await _serviceBus.GetServiceBusClient().SendScheduleMessageAsync("active-task", messageSurvey, DateTimeOffset.FromUnixTimeMilliseconds(stime));
-                                    await _serviceBus.GetServiceBusClient().cancelMessage("active - task", changeRecords[0].sequenceNumber);
                                     changeRecords[0].sequenceNumber = start;
                                     await _azureStorage.SaveOrUpdate<ChangeRecord>(changeRecords[0]);
                                     //await client.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync(surveyRecord, surveyRecord.id, new Azure.Cosmos.PartitionKey($"{surveyRecord.code}"));
@@ -309,7 +311,7 @@ namespace TEAMModelFunction
                                 if (changeRecords.Count > 0)
                                 {
                                     long end = await _serviceBus.GetServiceBusClient().SendScheduleMessageAsync("active-task", messageSurvey, DateTimeOffset.FromUnixTimeMilliseconds(etime));
-                                    await _serviceBus.GetServiceBusClient().cancelMessage("active - task", changeRecords[0].sequenceNumber);
+                                    await _serviceBus.GetServiceBusClient().cancelMessage("active-task", changeRecords[0].sequenceNumber);
                                     changeRecords[0].sequenceNumber = end;
                                     await _azureStorage.SaveOrUpdate<ChangeRecord>(changeRecords[0]);
                                 }

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

@@ -57,7 +57,7 @@ export default {
     getPrivateCusMgt: function (data) {
         return post('/school/course/find-teacher-course', data)
     },
-    //新增个人课程
+    //新增/修改个人课程
     upsertPrivateCus: function (data) {
         return post('/school/course/upsert-teacher-course', data)
     },

+ 2 - 0
TEAMModelOS/ClientApp/src/boot-app.js

@@ -31,6 +31,7 @@ import access from './access/index';
 import _ from 'lodash'
 import Icon from './icons/index.js'
 import commonComponents from '@/common/index.js'
+import evaluationComponents from '@/view/evaluation/components/index.js'
 import '@/assets/iconfont/iconfont.css'
 import "videojs-markers/dist/videojs.markers.css"
 import vueAudioNative from 'vue-audio-native'
@@ -62,6 +63,7 @@ require('video.js/dist/video-js.css')
 require('vue-video-player/src/custom-theme.css')
 Vue.use(animated)
 Vue.use(commonComponents)
+Vue.use(evaluationComponents)
 Vue.use(Tree)
 
 const logoptions = {

+ 23 - 21
TEAMModelOS/ClientApp/src/common/BaseLayout.vue

@@ -28,7 +28,7 @@
             <Menu width="auto" :class="menuitemClasses" accordion :active-name="activeName" :open-names="openNames">
                 <vuescroll :ops="ops">
                     <div v-for="(item,index) in menuTree" :key="index">
-                        <Submenu :name="index" v-if="$access.ability(item.role,item.permission).validateAll && item.child.length > 0">
+                        <Submenu :name="index" v-if="$access.ability(item.role,item.permission).validateAll" v-show="(index == 0 && $store.state.userInfo.hasSchool) || index > 0">
                             <template slot="title">
                                 <Tooltip :content="item.name" placement="right" transfer v-show="isCollapsed">
                                     <Icon :custom="item.icon" style="width:55px;text-align:left;" :class="isCollapsed ? 'collapse-icon-size':''" size="20" />
@@ -84,8 +84,8 @@
                         icon: 'iconfont icon-school',
                         name: '智慧校园',
                         router: '',
-                        role: 'admin',
-                        permission: 'student-upd|student-read|classroom-upd|classroom-read|schoolSetting-read|schoolSetting-upd',
+                        role: 'teacher|admin',
+                        permission: '',
                         child: [
                             {
                                 icon: 'iconfont icon-basic-setting',
@@ -96,12 +96,12 @@
                                 permission: 'schoolSetting-read|schoolSetting-upd'
                             },
                             {
-                                icon: 'iconfont icon-class-mgt',
-                                name: '教室管理',
-                                router: '/home/classroom',
-                                tag: '*',
+                                icon: 'iconfont icon-teacher-mgt',
+                                name: '老师账号',
+                                router: '/home/teachermgmt',
+                                tag: '',
                                 role: 'admin',
-                                permission: 'classroom-upd|classroom-read'
+                                permission: ''
                             },
                             {
                                 icon: 'iconfont icon-student-mgt',
@@ -112,13 +112,15 @@
                                 permission: 'student-upd|student-read'
                             },
                             {
-                                icon: 'iconfont icon-teacher-mgt',
-                                name: '老师账号',
-                                router: '/home/teachermgmt',
-                                tag: '',
+                                icon: 'iconfont icon-class-mgt',
+                                name: '教室管理',
+                                router: '/home/classroom',
+                                tag: '*',
                                 role: 'admin',
-                                permission: ''
+                                permission: 'classroom-upd|classroom-read'
                             },
+                            
+                            
                             {
                                 icon: 'iconfont icon-kecheng',
                                 name: '课程设置',
@@ -143,6 +145,14 @@
                                 role: 'admin',
                                 permission: '',
                             },
+                            {
+                                icon: 'iconfont icon-auth',
+                                name: '授权管理',
+                                router: '/home/serviceDriveAuth',
+                                tag: '(预览)',
+                                role: 'admin',
+                                permission: ''
+                            },
                             {
                                 icon: 'iconfont icon-syllabus',
                                 name: '校本课纲',
@@ -174,14 +184,6 @@
                                 tag: '*',
                                 role: 'teacher|admin',
                                 permission: '',
-                            },
-                            {
-                                icon: 'iconfont icon-auth',
-                                name: '授权管理',
-                                router: '/home/serviceDriveAuth',
-                                tag: '(预览)',
-                                role: 'admin',
-                                permission: ''
                             }
                         ]
                     },

+ 12 - 12
TEAMModelOS/ClientApp/src/common/BaseSelectSchool.vue

@@ -24,6 +24,7 @@
 </template>
 
 <script>
+	import User from '@/service/User.js'
 	export default {
 		data() {
 			return {
@@ -63,17 +64,14 @@
 				this.$EventBus.$emit('onGlobalLoading', true)
 				this.curSchool = this.user.schools[val]
 				let schoolCode = this.user.schools[val].schoolId
-				let schoolInfo = await this.getTeacherSchoolInfo(schoolCode)
-				this.$store.commit('setSchoolCode', schoolCode)
-				this.$store.commit('schoolBaseInfo/setSchoolInfo', {
-					period: []
-				})
-				this.$store.commit('schoolBaseInfo/setClassroomList', undefined)
+				// 更新当前school_code
 				this.$store.dispatch('user/setSchoolCode', schoolCode)
-				this.$store.dispatch('user/setSchoolProfile', schoolInfo)
-				console.log('切换学校为' + schoolCode)
-				console.log(this.$store.state)
-				console.log(JSON.parse(decodeURIComponent(localStorage.school_profile, "utf-8")))
+				// 更新当前school_profile以及access
+				this.$store.dispatch('user/checkSchoolProfile').then(res=>{
+				    if(res) {
+				        this.$User.freshLogin()
+				    }
+				});
 				setTimeout(() => {
 					this.$EventBus.$emit('onGlobalLoading', false)
 				}, 500)
@@ -103,13 +101,15 @@
 		},
 
 		mounted() {
+			// 解绑之前的事件 防止多次触发
+			this.$EventBus.$off('onChangeSchool')
 			this.$EventBus.$on('onChangeSchool', params => {
 				if (params.schoolCode !== this.curSchool.schoolId) {
 					console.log('检测到切换学校')
 					console.log(params)
 					this.user = params.user
-					this.curSchool = params.user.defaultschool ? params.user.schools.filter(i => i.schoolId === params.user.defaultschool)[
-						0] : params.user.schools[0]
+					// this.curSchool = params.user.defaultschool ? params.user.schools.filter(i => i.schoolId === params.user.defaultschool)[
+					// 	0] : params.user.schools[0]
 					this.onSchoolSelect(params.user.schools.map(i => i.schoolId).indexOf(params.schoolCode))
 				}
 			})

+ 0 - 13
TEAMModelOS/ClientApp/src/components/coursemgmt/StudentList.less

@@ -1,13 +0,0 @@
-@first-bgColor: #141414;
-@second-bgColor: #1b1b1b;
-@third-bgColor: #222222;
-@borderColor: #424242;
-@primary-textColor: #fff; //文本主颜色
-@second-textColor: #a5a5a5; //文本副级颜色
-@primary-fontSize: 14px;
-@second-fontSize: 16px;
-
-.page-box {
-    padding-top: 5px;
-    text-align: center;
-}

+ 0 - 328
TEAMModelOS/ClientApp/src/components/coursemgmt/StudentList.vue

@@ -1,328 +0,0 @@
-<template>
-    <div class="dark-iview-table student-list">
-        <div class="sc-menu-left dark-iview-select dark-iview-input">
-            <Input v-model="searchText" clearable :placeholder="$t('stuAccount.searchHolder')" style="width: 28%;margin-left:20px;" search @on-search="searchData" @on-clear="searchData">
-            </Input>
-            <Select v-model="searchPeriod" style="width:20%;margin-left:5%;" :placeholder="$t('stuAccount.periodHolder')" clearable @on-change="filterStudentInfo">
-                <Option v-for="(item,index) in $store.state.schoolBaseInfo.schoolBaseInfo.period" :value="item.periodCode" :key="index">{{ item.periodName }}</Option>
-            </Select>
-            <Select v-model="searchGrade" style="width:20%;margin-left:1%;" :placeholder="$t('stuAccount.gradeHolder')" clearable @on-change="filterStudentInfo">
-                <Option v-for="(item,index) in $jsFn.getPeriod($store.state.schoolBaseInfo.schoolBaseInfo,searchPeriod).grades" :value="item.gradeCode" :key="index">{{ item.gradeName }}</Option>
-            </Select>
-            <Select v-model="searchClassroom" ref="classroom" style="width:20%;margin-left:1%;" :placeholder="$t('stuAccount.classroomHolder')" clearable @on-change="filterStudentInfo">
-                <Option v-for="(item,index) in classroomList" :value="item.classroomCode" :key="index">{{ item.classroomName }}</Option>
-            </Select>
-        </div>
-        <Table ref="selection" :columns="tableColumns" :data="tableShowData" height="630" :loading="tableLoading" @on-selection-change="getSelectInfo">
-            <Loading slot="loading"></Loading>
-            <template slot-scope="{ row,index }" slot="status">
-                <Icon v-if="index % 3 == 1" type="md-checkmark-circle-outline" size="18" color="#1CD0A1" />
-                <span v-else>—</span>
-            </template>
-            <template slot-scope="{ row,index }" slot="classroomName">
-                <span>{{row.classroomName}}</span>
-            </template>
-            <template slot-scope="{ row,index }" slot="classroomCode">
-                <span>{{row.classroomCode}}</span>
-            </template>
-            <template slot-scope="{ row,index }" slot="periodName">
-                <span>{{row.periodName}}</span>
-            </template>
-            <template slot-scope="{ row,index }" slot="gradeName">
-                <span>{{row.gradeName}}</span>
-            </template>
-            <template slot-scope="{ row,index }" slot="action">
-                <div class="item-tools" v-if="$access.can('admin.*|student-upd')">
-                    <Icon type="md-create" size="18" color="white" @click="editStudent(index)" />
-                    <Icon type="md-trash" size="18" color="white" @click="delStudent(index)" />
-                </div>
-            </template>
-        </Table>
-        <div class="page-box dark-iview-page">
-            <Page :total="totalNum" show-sizer :page-size="pageSize" show-total :current.sync="currentPage" @on-change="getPageData" @on-page-size-change="setPageSize" />
-        </div>
-    </div>
-</template>
-<script>
-    import Loading from '@/common/Loading.vue'
-    export default {
-        components: {
-            Loading
-        },
-        data() {
-            return {
-                searchText: '',
-                searchPeriod: '',
-                searchGrade: '',
-                searchClassroom: '',
-                selections: [],
-                currentPage: 1,
-                pageSize: 20,
-                tableShowData: [],
-                tableColumns: [],
-                totalNum: 0,
-                tableLoading: false,
-                schoolData: {},
-                classroomShowList:[]
-            }
-        },
-        methods: {
-            /**根据学段、年级、班级搜索 */
-            filterStudentInfo() {
-                if (this.searchClassroom !== '' && this.searchClassroom !== undefined) {
-                    let findCountParams = {
-                        "collectionName": "Student",
-                        "queryDict": {
-                            'code': this.$store.state.userInfo.schoolCode,
-                            'classroomCode': this.searchClassroom,
-                        }
-                    }
-                    this.getResultCount(findCountParams)
-                    this.currentPage = 1
-                    let params = {
-                        '@CURRPAGE': this.currentPage,
-                        '@PAGESIZE': this.pageSize,
-                        'code': this.$store.state.userInfo.schoolCode,
-                        'classroomCode': this.searchClassroom,
-                    }
-                    this.baseFindStudent(params)
-                } else {
-                    let classrooms = []
-                    let classroomCodes = []
-                    if (this.searchGrade == '' || this.searchGrade == undefined) {
-                        classrooms = this.classroomList.filter(
-                            (item, index) => {
-                                return item.periodCode == this.searchPeriod
-                            }
-                        )
-                    } else {
-                        classrooms = this.classroomList.filter(
-                            (item, index) => {
-                                return item.periodCode == this.searchPeriod && item.gradeCode == this.searchGrade
-                            }
-                        )
-                    }
-                    classroomCodes = classrooms.map((item) => {
-                        return item.classroomCode
-                    })
-                    if (classroomCodes.length == 0) {
-                        if (this.searchPeriod == '' || this.searchPeriod == undefined) {
-                            let findCountParams = {
-                                "collectionName": "Student",
-                                "queryDict": {
-                                    'code': this.$store.state.userInfo.schoolCode,
-                                }
-                            }
-                            this.getResultCount(findCountParams)
-
-                            let params = {
-                                '@CURRPAGE': this.currentPage,
-                                '@PAGESIZE': this.pageSize,
-                                'code': this.$store.state.userInfo.schoolCode,
-                            }
-                            this.baseFindStudent(params)
-                        } else {
-                            this.totalNum = 0
-                            this.tableShowData.length = 0
-                            this.tableData.length = 0
-                        }
-                    } else {
-                        let findCountParams = {
-                            "collectionName": "Student",
-                            "queryDict": {
-                                'code': this.$store.state.userInfo.schoolCode,
-                                'classroomCode': classroomCodes,
-                            }
-                        }
-                        this.getResultCount(findCountParams)
-
-                        let params = {
-                            '@CURRPAGE': this.currentPage,
-                            '@PAGESIZE': this.pageSize,
-                            'code': this.$store.state.userInfo.schoolCode,
-                            'classroomCode': classroomCodes,
-                        }
-                        this.baseFindStudent(params)
-                    }
-                }
-
-            },
-            /**
-            * 远程搜索
-            * 暂时只支持一个条件模糊查询
-            * 需要回车触发
-            * */
-            searchData() {
-                this.tableLoading = true
-                this.currentPage = 1
-
-                let findCountParams = {
-                    "collectionName": "Student",
-                    "queryDict": {
-                        'code': this.$store.state.userInfo.schoolCode,
-                        //'$.name': this.searchText,
-                        '$.studentId': this.searchText,
-                    }
-                }
-                this.getResultCount(findCountParams)
-                let params = {
-                    '@CURRPAGE': this.currentPage,
-                    '@PAGESIZE': this.pageSize,
-                    'code': this.$store.state.userInfo.schoolCode,
-                    //'$.name': this.searchText,
-                    '$.studentId': this.searchText,
-                }
-                this.baseFindStudent(params)
-            },
-            //获取选中的数据
-            getSelectInfo(selction, row) {
-                this.selections = selction
-                this.selectRow = row
-                this.$emit('selectedStudent', selction)
-            },
-            /**设置每页数量 */
-            setPageSize(pageSize) {
-                this.pageSize = pageSize
-                this.findStudentInfo()
-            },
-            /**查询当前Page学生信息 */
-            findStudentInfo() {
-                this.tableLoading = true
-                let params = {
-                    '@CURRPAGE': this.currentPage,
-                    '@PAGESIZE': this.pageSize,
-                    'code': this.$store.state.userInfo.schoolCode,
-                }
-                this.baseFindStudent(params)
-            },
-            /**基础查询数据 */
-            baseFindStudent(params) {
-                this.$api.stuAccount.findStudent(params).then(
-                    (res) => {
-                        if (res.error == null) {
-                            this.tableData = res.result.data
-                            for (let index in this.tableData) {
-                                let currentClassroomlInfo = this.$JSONPath.query(this.$store.state.user.schoolProfile.school_classes, "$..[?(@.classroomCode=='" + this.tableData[index].classroomCode + "')]")
-                                if (currentClassroomlInfo.length > 0) {
-                                    let currentSchoolInfo = this.$JSONPath.query(this.$store.state.schoolBaseInfo.schoolBaseInfo, "$..period[?(@.periodCode=='" + currentClassroomlInfo[0].periodCode + "')]")
-                                    if (currentSchoolInfo.length > 0) {
-                                        this.tableData[index].periodName = currentSchoolInfo[0].periodName
-                                        this.tableData[index].periodCode = currentSchoolInfo[0].periodCode
-                                        this.tableData[index].gradeName = this.$JSONPath.query(currentSchoolInfo, "$..grades[?(@.gradeCode=='" + currentClassroomlInfo[0].gradeCode + "')]")[0].gradeName
-                                        this.tableData[index].gradeCode = this.$JSONPath.query(currentSchoolInfo, "$..grades[?(@.gradeCode=='" + currentClassroomlInfo[0].gradeCode + "')]")[0].gradeCode
-                                        this.tableData[index].classroomName = currentClassroomlInfo[0].classroomName
-                                    }
-                                }
-                            }
-                            [...this.tableShowData] = this.tableData
-                            this.tableLoading = false
-                        } else {
-                            this.$Message.error('API error!')
-                            this.tableLoading = false
-                        }
-                    },
-                    (err) => {
-                        this.tableLoading = false
-                    }
-                )
-            },
-            /**查询学生总共人数 */
-            getResultCount(params) {
-                this.$api.newEvaluation.FindCount(params).then(res => {
-                    this.totalNum = res.result.data[0]
-                })
-            },
-            getPageData() {
-                this.findStudentInfo()
-            },
-            initData() {
-                this.tableColumns = [
-                    {
-                        type: 'selection',
-                        width: 80,
-                        align: 'center'
-                    },
-                    {
-                        key: 'seatNo',
-                        title: this.$t('stuAccount.seatNo'),
-                        align: 'center',
-                        width: 80
-                    },
-                    {
-                        key: 'studentId',
-                        title: this.$t('stuAccount.account'),
-                        align: 'center'
-                    },
-                    {
-                        key: 'name',
-                        title: this.$t('stuAccount.stuName'),
-                        align: 'center'
-                    },
-                    {
-                        slot: 'classroomName',
-                        title: this.$t('stuAccount.classroomName'),
-                        align: 'center'
-                    },
-                    {
-                        slot: 'classroomCode',
-                        title: this.$t('stuAccount.classroomCode'),
-                        align: 'center'
-                    },
-                    {
-                        slot: 'periodName',
-                        title: this.$t('stuAccount.period'),
-                        align: 'center'
-                    },
-                    {
-                        slot: 'gradeName',
-                        title: this.$t('stuAccount.grade'),
-                        align: 'center'
-                    },
-                    //{
-                    //    slot: 'status',
-                    //    title: this.$t('stuAccount.authStatus'),
-                    //    align: 'center'
-                    //},
-                    //{
-                    //    slot: 'action',
-                    //    title: ' ',
-                    //    width: 100,
-                    //    align: 'center'
-                    //}
-                ]
-            },
-        },
-        created() {
-            this.initData()
-            let findCountParams = {
-                "collectionName": "Student",
-                "queryDict": {
-                    'code': this.$store.state.userInfo.schoolCode
-                }
-            }
-            this.getResultCount(findCountParams)
-            this.getPageData()
-        },
-        computed: {
-            classroomList() {
-                if (this.searchGrade == '') {
-                    return this.$store.state.user.schoolProfile.school_classes
-                } else {
-                    return this.$store.state.user.schoolProfile.school_classes.filter((item) => {
-                        return item.gradeCode == this.searchGrade
-                    })
-                }
-                
-            }
-        }
-
-    }
-</script>
-<style lang="less" scoped>
-    @import "./StudentList.less";
-</style>
-<style>
-    .student-list #loadingBox {
-        margin-top: 0px !important;
-    }
-</style>

+ 30 - 0
TEAMModelOS/ClientApp/src/components/coursemgt/StudentList.less

@@ -0,0 +1,30 @@
+@first-bgColor: #141414;
+@second-bgColor: #1b1b1b;
+@third-bgColor: #222222;
+@borderColor: #424242;
+@primary-textColor: #fff; //文本主颜色
+@second-textColor: #a5a5a5; //文本副级颜色
+@primary-fontSize: 14px;
+@second-fontSize: 16px;
+
+.page-box {
+    padding-top: 5px;
+    text-align: center;
+}
+
+.student-filter-wrap{
+    margin-bottom:10px;
+}
+.name-header {
+    background: white;
+    width: 33px;
+    display: inline-block;
+    border-radius: 50%;
+    height: 33px;
+    text-align: center;
+    color: white;
+    line-height: 33px;
+    font-size: 18px;
+    font-weight: 600;
+    font-family: cursive;
+}

+ 287 - 0
TEAMModelOS/ClientApp/src/components/coursemgt/StudentList.vue

@@ -0,0 +1,287 @@
+<template>
+    <div class="dark-iview-table student-list">
+        <div class="student-filter-wrap dark-iview-select dark-iview-input">
+            <!-- 學制Select -->
+            <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:120px;margin-left:5px;" :placeholder="$t('stuAccount.gradeHolder')"
+                    not-found-text="请先选择学段" 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:150px;margin-left:5px;" :placeholder="$t('stuAccount.classroomHolder')"
+                    clearable @on-change="filterData" :not-found-text="searchGrade ? '此年级暂无教室':'请先选择年级'">
+                <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: 220px;margin-left:20px;" search @on-search="filterData" @on-clear="filterData"></Input>
+        </div>
+        <div class="sc-content dark-iview-table" style="position:relative">
+            <Scroll :on-reach-bottom="scrollLoad" height="600" :distance-to-edge="[15,15]">
+                <Table ref="selection" :columns="tableColumns" :data="tableShowData" @on-selection-change="getSelectInfo">
+                    <template slot-scope="{ row,index }" slot="status">
+                        <Icon custom="iconfont icon-auth-key" size="25" color="#565656" />
+                    </template>
+                    <template slot-scope="{ row,index }" slot="header">
+                        <span class="name-header" :style="{background:bgColor[index % 12]}">{{getFirstChart(row.name)}}</span>
+                    </template>
+                    <template slot-scope="{ row }" slot="gradeId">
+                        <span>{{ getGradeName(row.gradeId) }}</span>
+                    </template>
+                    <template slot-scope="{ row }" slot="classId">
+                        <span>{{ getClassName(row.classId)}}</span>
+                    </template>
+                    <template slot-scope="{ row }" slot="no">
+                        <span>{{row.no}}</span>
+                    </template>
+                    <template slot-scope="{ row }" slot="gradeName">
+                        <span>{{row.gradeName}}</span>
+                    </template>
+                    <template slot-scope="{ row }" slot="action">
+                        <div class="item-tools" v-if="$access.can('admin.*|student-upd')">
+                            <Icon type="md-create" size="18" color="white" @click="editStudent(row)" />
+                            <Icon custom="iconfont icon-reset" size="18" color="white" @click="resetPW(row)" />
+                            <Icon type="md-trash" size="18" color="white" @click="delStudent(row)" />
+                        </div>
+                    </template>
+                </Table>
+            </Scroll>
+            <Loading v-show="tableLoading" :top="100"></Loading>
+        </div>
+    </div>
+</template>
+<script>
+    import { mapGetters } from 'vuex'
+    export default {
+        data() {
+            return {
+                bgColor: ['#4ECDC4', '#F99406', '#075CD0', '#F7CA17', '#F2774B', '#67809F', '#BF55ED', '#00B169', '#F72459', '#F15A22', '#03C9A8', '#9A1294'],
+                searchText: '',
+                searchPeriod: '',
+                searchGrade: '',
+                searchClassroom: '',
+                selections: [],
+                currentPage: 1,
+                pageSize: 20,
+                tableShowData: [],
+                tableColumns: [],
+                totalNum: 0,
+                tableLoading: false,
+                schoolData: {},
+                tableFilterData: [],
+                basicCount: 99,
+            }
+        },
+        methods: {
+            initData() {
+                this.tableColumns = [
+                    {
+                        type: 'selection',
+                        width: 80,
+                        align: 'center'
+                    },
+                    {
+                        slot: 'header',
+                        title: ' ',
+                        align: 'center',
+                        width: 150
+                    },
+                    {
+                        key: 'id',
+                        title: this.$t('stuAccount.account'),
+                        align: 'center',
+                        sortable: true,
+                        sortMethod: (a, b, type) => {
+                            if (type == 'asc') {
+                                return a.localeCompare(b)
+                            } else {
+                                return b.localeCompare(a)
+                            }
+                        }
+                    },
+                    {
+                        key: 'no',
+                        title: this.$t('stuAccount.seatNo'),
+                        align: 'center',
+                        width: 120,
+                        sortable: true,
+                        sortMethod: (a, b, type) => {
+                            if (type == 'desc') {
+                                return parseInt(a) > parseInt(b) ? -1 : 1
+                            } else {
+                                return parseInt(a) < parseInt(b) ? -1 : 1
+                            }
+                        }
+                    },
+                    {
+                        key: 'name',
+                        title: this.$t('stuAccount.stuName'),
+                        align: 'center'
+                    },
+                    {
+                        slot: 'gradeId',
+                        title: this.$t('stuAccount.grade'),
+                        align: 'center',
+                        width: 140
+                    },
+                    {
+                        slot: 'classId',
+                        title: this.$t('stuAccount.classroomName'),
+                        align: 'center'
+                    }
+                ]
+            },
+            /**基础查询数据 */
+            baseFindStudent(params) {
+                this.$api.stuAccount.findStudent(this.$store.state.user.schoolCode).then(
+                    (res) => {
+                        this.tableLoading = false
+                        // 給一個 PW 讓AddStudent.vue 的Watch 可以動作
+                        let newStudents = res.students.map(function (item) {
+                            let temp = item
+                            temp.pw = '******'
+                            return temp
+                        })
+                        this.$store.dispatch('schoolBaseInfo/setStudentsToState', newStudents)
+                        this.filterData()
+                    },
+                    (err) => {
+                        this.tableLoading = false
+                    }
+                )
+            },
+            /**根据学段、年级、班级搜索 */
+            filterData: function () {
+                let data = this.students
+                // 帳號資訊搜尋
+                if (this.searchText) {
+                    let text = this.searchText
+                    data = data.filter(function (item) {
+                        return (item.name.indexOf(text) >= 0) || (item.id.indexOf(text) >= 0)
+                    })
+                }
+
+                // 學制篩選
+                if (this.searchPeriod) {
+                    let id = this.searchPeriod
+                    data = data.filter(function (item) {
+                        return item.periodId == id
+                    })
+                }
+
+                // 年級篩選
+                if (this.searchGrade) {
+                    let id = this.searchGrade
+                    data = data.filter(function (item) {
+                        return item.gradeId == id
+                    })
+                }
+
+                // 教室篩選
+                if (this.searchClassroom) {
+                    let id = this.searchClassroom
+                    data = data.filter(function (item) {
+                        return item.classId == id
+                    })
+                }
+
+                this.tableFilterData = data
+                this.pointNum = this.basicCount
+                this.tableShowData = data.slice(0, this.basicCount)
+            },
+
+            getSelectInfo(selction, row) {
+                this.selections = selction
+                this.selectRow = row
+                this.$emit('getSelectInfo', selction)
+            },
+
+            scrollLoad: function () {
+                setTimeout(() => {
+                    let maxLength = this.tableShowData.length
+                    let temp = this.tableFilterData.slice(this.pointNum + 1, this.pointNum + this.basicCount)
+                    this.pointNum += this.basicCount
+                    if (temp.length == 0) {
+                        this.$Message.info('已經到底了')
+                        //多语系后面统一处理
+                        //this.$Message.info(this.$t('已經到底了'))
+                    } else {
+                        this.tableShowData.push(...temp)
+                    }
+                }, 1500);
+            },
+            /** 取得年級Name */
+            getGradeName: function (gradeId) {
+                if (gradeId != null) {
+                    let gradeData = this.grades.filter(function (item) {
+                        return item.id == gradeId
+                    })
+                    return gradeData[0].name
+                } else {
+                    return ''
+                }
+            },
+            /** 取得教室Name */
+            getClassName: function (classId) {
+                if (classId != null) {
+                    let classesData = this.classes.filter(function (item) {
+                        return item.id == classId
+                    })
+                    return classesData[0].name
+                }
+
+            },
+            getFirstChart(name) {
+                if (name) {
+                    return name.substr(0, 1)
+                } else {
+                    return '--'
+                }
+            },
+        },
+        created() {
+            this.initData()
+            this.baseFindStudent()
+        },
+        computed: {
+            ...mapGetters({
+                periods: 'user/getPeriods', // 學制s
+                grades: 'user/getGrades', // 年級
+                classes: 'user/getClasses', // 教室ID
+                students: 'schoolBaseInfo/getStudent', // 學生List
+            }),
+            filterGrades: function () {
+                var data = this.grades
+                if (this.searchPeriod) {
+                    let periodId = this.searchPeriod
+                    data = data.filter(function (item) {
+                        return item.periodId == periodId
+                    })
+                    return data
+                } else {
+                    return []
+                }
+            },
+            filterClasses: function () {
+                var data = this.classes
+                if (this.searchGrade) {
+                    let gradeId = this.searchGrade
+                    data = data.filter(function (item) {
+                        return item.gradeId == gradeId
+                    })
+                    return data
+                } else {
+                    return []
+                }
+            }
+        }
+
+    }
+</script>
+<style lang="less" scoped>
+    @import "./StudentList.less";
+</style>
+<style>
+</style>

TEAMModelOS/ClientApp/src/components/learnactivity/BaseHwForm.less → TEAMModelOS/ClientApp/src/components/homework/BaseHwForm.less


+ 1 - 1
TEAMModelOS/ClientApp/src/components/learnactivity/BaseHwForm.vue

@@ -91,7 +91,7 @@
 <script>
     import E from '@/utils/wangEditor.js'
     import UploadFile from '@/common/UploadFile.vue'
-    import ChooseContent from '@/components/learnactivity/NewChooseContent'
+    import ChooseContent from '@/components/selflearn/NewChooseContent'
     export default {
         props: {
             editItem: {

TEAMModelOS/ClientApp/src/components/learnactivity/BaseHwTable.less → TEAMModelOS/ClientApp/src/components/homework/BaseHwTable.less


TEAMModelOS/ClientApp/src/components/learnactivity/BaseHwTable.vue → TEAMModelOS/ClientApp/src/components/homework/BaseHwTable.vue


+ 108 - 23
TEAMModelOS/ClientApp/src/components/learnactivity/ClassList.vue

@@ -13,12 +13,12 @@
                         <!--<p style="color:#EEEEEE;font-size:16px;margin-top:5px;">测验成绩分析</p>-->
                         <div class="class-filter dark-iview-select">
                             <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 filterable style="display: inline-block;width: 100px;" @on-change="getPeriod" size="small">
+                                <Option v-for="item in paperData.grade" :value="item.id" :key="item.id">{{ 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 filterable style="display: inline-block;width: 150px;" @on-change="getClassInfo" size="small">
+                                <Option v-for="item in classData" :value="item.id" :key="item.id">{{ item.name }}</Option>
                             </Select>
                         </div>         
                         <!--<div class="chart-show">-->
@@ -72,28 +72,56 @@
                 studentData: [],
                 studentList: [],
                 testStatus: false,
-                typeList: [
-                    {
-                        value: '1',
-                        label: '联考'
-                    },
-                    {
-                        value: '2',
-                        label: '段考'
-                    },
-                    {
-                        value: '3',
-                        label: '平常考'
-                    },
-                    {
-                        value: '4',
-                        label: '其他'
-                    }
-                ],
-                paperData: {}
+                //typeList: [
+                //    {
+                //        value: '1',
+                //        label: '联考'
+                //    },
+                //    {
+                //        value: '2',
+                //        label: '段考'
+                //    },
+                //    {
+                //        value: '3',
+                //        label: '平常考'
+                //    },
+                //    {
+                //        value: '4',
+                //        label: '其他'
+                //    }
+                //],
+                paperData: {},
+                classList: [],
+                classData:[], //当前班级信息
+                choosePeriod: "",
+
             }
         },
         methods: {
+            //初始化获取班级数据
+            getClassData(data) {
+                console.log(this.paperData)
+                this.classData.length = 0
+                if (data !== undefined) {
+                    for (let item of this.classList) {
+                        if (item.gradeId == data) {
+                            this.classData.push(item)
+                        }
+                    }
+                }
+            },
+            //年级数据获取
+            getPeriod(data) {
+                this.choosePeriod = ''
+                if (data) {
+                    this.choosePeriod = data
+                    this.getClassData(data)
+                }
+            },
+            //获取班级测评数据
+            getClassInfo(data) {
+                console.log(data)
+            },
             getScore(data) {
                 console.log(data)
                 this.currentActivityIndex = 1
@@ -102,6 +130,7 @@
             getTestData() {
                 this.testStatus = !this.testStatus
             },
+
             selectActivity(index) {
                 console.log(this.paper)
                 this.paperData = {}
@@ -110,6 +139,10 @@
                 this.paperData = this.paper[this.currentActivityIndex]
                 console.log(this.paperData)
             },
+            getStudentData() {
+
+            },
+
             getData() {
                 let data = this.$Mock.data.studentList
                 this.studentData = data
@@ -136,9 +169,61 @@
             closeAnswerDetail() {
                 this.showAnswer = false
             },
+            initClassData() {
+                if (this.paper.length) {
+                    this.paperData = this.paper[this.currentActivityIndex]
+                    console.log(this.paperData)
+                    if (this.paperData.class.length) {
+                        let classData = []
+                        this.classList.length = 0
+                        for (let item of this.paperData.class) {
+                            for (let items of this.$store.state.user.schoolProfile.school_classes) {
+                                if (item == items.id) {
+                                    classData.push(items)
+                                }
+                            }
+                        }
+                        this.classList = classData
+                        this.getClassData(this.paperData.grade[0].id)
+                    }
+                }
+            },
+            getAllStudentData() {
+                //this.dataLoading = true
+                let requestData = {
+                    id: this.paperData.id,
+                    school: this.paperData.papers.code,
+                    subjectId: this.paperData.papers.subjectId,
+                    classId: this.classList[0].id
+                }
+                if (requestData.school !== undefined) {
+                    this.$api.learnActivity.FindAllStudent(requestData).then(
+                        res => {
+                            if (res.error == null) {
+                                console.log(res.examClassResults[0])
+                                //this.getStudentInfo(-1)
+                            } else {
+                                //this.dataLoading = false
+                                this.$Message.error('API ERROR!')
+                            }
+                        }
+                    )
+                } else {
+                    //this.dataLoading = false
+                }
+
+            },
         },
         mounted() {
+            this.initClassData()
             this.getData()
+        },
+        watch: {
+            paper(oldVal,newVal) {
+                deep: true,
+                console.log(newVal)
+                this.initClassData()
+            }
         }
     }
 </script>

+ 0 - 1
TEAMModelOS/ClientApp/src/components/learnactivity/GradeList.vue

@@ -281,7 +281,6 @@
                 } else {
                     this.$Message.warning('班级信息有误!')
                 }
-                console.log(this.paperInfo)
             },
             getStudentDataInfo(data) {
                 if (data !== undefined) {

+ 1 - 2
TEAMModelOS/ClientApp/src/components/learnactivity/GradeTable.vue

@@ -22,7 +22,7 @@
         },
         data() {
             return {
-                pageSize: 10,
+                pageSize: 60,
                 currentPage: 1,
                 columns: [
                     {
@@ -65,7 +65,6 @@
                 if (data !== undefined) {
                     this.$emit('fixScore',data)
                 }
-
             },
             getPageData(number, type) {  //分页
                 let starIndex = this.pageSize * (this.currentPage - 1)

+ 22 - 12
TEAMModelOS/ClientApp/src/components/questionnaire/BaseJudge.vue

@@ -39,7 +39,7 @@
 				optionEditors: [],
 				defaultConfig: {
 					uploadImgShowBase64: true,
-					menus: this.$tools.wangEditorMenu
+					menus: this.$tools.wangEditorMenuSimple
 				}
 			}
 		},
@@ -139,11 +139,26 @@
 						editor.create()
 						this.optionEditors.push(editor);
 						this.$refs["singleOption" + newIndex][0].dataset.editorId = editor.id
+						this.refreshOrder()
 					})
 				} else {
 					this.$Message.warning('最多只有9个选项!')
 				}
 			},
+			
+			/* 根据页面上的选项DOM数量,刷新每个选项的Order显示 */
+			refreshOrder() {
+				let wraps = document.getElementsByClassName('option-order')
+				wraps.forEach((item, index) => {
+					item.innerHTML = this.renderIndex(index)
+				})
+			},
+			
+			/* 根据下标渲染对应的字母顺序 */
+			renderIndex(index) {
+				return String.fromCharCode(64 + parseInt(index + 1))
+			},
+			
 			// 删除选项
 			deleteOption(index) {
 				let wraps = document.getElementsByClassName('qn-option-editor')
@@ -151,17 +166,12 @@
 					this.optionsContent.splice(index, 1)
 					let textWrap = this.$refs['optionBox' + index][0]
 					textWrap.remove()
-
-					// 如果删除了已有选项 后面的code要降1
-					for (let i in this.optionsContent) {
-						if (i >= index) {
-							this.optionsContent[i].code = String.fromCharCode(64 + parseInt(parseInt(i) + 1))
-						}
-					}
-					// nextValue && curEditor.txt.html(nextValue)
+					
+					this.refreshOrder()
 				} else {
 					this.$Message.warning('至少保留两个选项!')
 				}
+				
 			},
 			
 			// 保存试题 获取最新选项数据
@@ -220,7 +230,7 @@
 
 			if (this.editInfo && this.editInfo.question) {
 				console.log('进入判断题Mounted编辑')
-				this.editSingleInfo = this.editInfo
+				this.editSingleInfo = JSON.parse(JSON.stringify(this.editInfo)) 
 				this.stemContent = this.editSingleInfo.question
 				this.optionsContent = this.editSingleInfo.option
 				this.options = this.editSingleInfo.option.map((item, index) => index)
@@ -236,7 +246,7 @@
 					if (newValue) {
 						console.log('判断接收到的数据')
 						console.log(newValue)
-						this.editSingleInfo = newValue
+						this.editSingleInfo = JSON.parse(JSON.stringify(newValue)) 
 						if (Object.keys(newValue).length > 0) {
 							this.stemContent = this.editSingleInfo.question
 							this.optionsContent = this.editSingleInfo.option
@@ -254,6 +264,6 @@
 		}
 	}
 </script>
-<style lang="less" scoped>
+<style lang="less">
 	@import "./BaseSingle.less";
 </style>

+ 22 - 12
TEAMModelOS/ClientApp/src/components/questionnaire/BaseMultiple.vue

@@ -39,7 +39,7 @@
 				optionEditors: [],
 				defaultConfig: {
 					uploadImgShowBase64: true,
-					menus: this.$tools.wangEditorMenu
+					menus: this.$tools.wangEditorMenuSimple
 				}
 			}
 		},
@@ -139,11 +139,26 @@
 						editor.create()
 						this.optionEditors.push(editor);
 						this.$refs["singleOption" + newIndex][0].dataset.editorId = editor.id
+						this.refreshOrder()
 					})
 				} else {
 					this.$Message.warning('最多只有9个选项!')
 				}
 			},
+			
+			/* 根据页面上的选项DOM数量,刷新每个选项的Order显示 */
+			refreshOrder() {
+				let wraps = document.getElementsByClassName('option-order')
+				wraps.forEach((item, index) => {
+					item.innerHTML = this.renderIndex(index)
+				})
+			},
+			
+			/* 根据下标渲染对应的字母顺序 */
+			renderIndex(index) {
+				return String.fromCharCode(64 + parseInt(index + 1))
+			},
+			
 			// 删除选项
 			deleteOption(index) {
 				let wraps = document.getElementsByClassName('qn-option-editor')
@@ -151,17 +166,12 @@
 					this.optionsContent.splice(index, 1)
 					let textWrap = this.$refs['optionBox' + index][0]
 					textWrap.remove()
-
-					// 如果删除了已有选项 后面的code要降1
-					for (let i in this.optionsContent) {
-						if (i >= index) {
-							this.optionsContent[i].code = String.fromCharCode(64 + parseInt(parseInt(i) + 1))
-						}
-					}
-					// nextValue && curEditor.txt.html(nextValue)
+					
+					this.refreshOrder()
 				} else {
 					this.$Message.warning('至少保留两个选项!')
 				}
+				
 			},
 			
 			// 保存试题 获取最新选项数据
@@ -220,7 +230,7 @@
 
 			if (this.editInfo && this.editInfo.question) {
 				console.log('进入多选题Mounted编辑')
-				this.editSingleInfo = this.editInfo
+				this.editSingleInfo = JSON.parse(JSON.stringify(this.editInfo)) 
 				this.stemContent = this.editSingleInfo.question
 				this.optionsContent = this.editSingleInfo.option
 				this.options = this.editSingleInfo.option.map((item, index) => index)
@@ -236,7 +246,7 @@
 					if (newValue) {
 						console.log('多选接收到的数据')
 						console.log(newValue)
-						this.editSingleInfo = newValue
+						this.editSingleInfo = JSON.parse(JSON.stringify(newValue)) 
 						if (Object.keys(newValue).length > 0) {
 							this.stemContent = this.editSingleInfo.question
 							this.optionsContent = this.editSingleInfo.option
@@ -254,6 +264,6 @@
 		}
 	}
 </script>
-<style lang="less" scoped>
+<style lang="less">
 	@import "./BaseSingle.less";
 </style>

+ 2 - 1
TEAMModelOS/ClientApp/src/components/questionnaire/BaseSingle.less

@@ -79,12 +79,13 @@
 		        min-height: 42px;
 		        border: none;
 		        width: 100%;
+				z-index: 0;
 		    }
 		
 		    .w-e-text-container {
 		        height: auto !important;
 		        min-height: 42px !important;
-		        z-index: 0 !important;
+		        // z-index: 0 !important;
 				border-top: 1px solid #4e4e4e !important;
 				border-left: none !important;
 		    }

+ 21 - 11
TEAMModelOS/ClientApp/src/components/questionnaire/BaseSingle.vue

@@ -39,7 +39,7 @@
 				optionEditors: [],
 				defaultConfig: {
 					uploadImgShowBase64: true,
-					menus: this.$tools.wangEditorMenu
+					menus: this.$tools.wangEditorMenuSimple
 				}
 			}
 		},
@@ -139,11 +139,26 @@
 						editor.create()
 						this.optionEditors.push(editor);
 						this.$refs["singleOption" + newIndex][0].dataset.editorId = editor.id
+						this.refreshOrder()
 					})
 				} else {
 					this.$Message.warning('最多只有9个选项!')
 				}
 			},
+			
+			/* 根据页面上的选项DOM数量,刷新每个选项的Order显示 */
+			refreshOrder() {
+				let wraps = document.getElementsByClassName('option-order')
+				wraps.forEach((item, index) => {
+					item.innerHTML = this.renderIndex(index)
+				})
+			},
+			
+			/* 根据下标渲染对应的字母顺序 */
+			renderIndex(index) {
+				return String.fromCharCode(64 + parseInt(index + 1))
+			},
+			
 			// 删除选项
 			deleteOption(index) {
 				let wraps = document.getElementsByClassName('qn-option-editor')
@@ -151,17 +166,12 @@
 					this.optionsContent.splice(index, 1)
 					let textWrap = this.$refs['optionBox' + index][0]
 					textWrap.remove()
-
-					// 如果删除了已有选项 后面的code要降1
-					for (let i in this.optionsContent) {
-						if (i >= index) {
-							this.optionsContent[i].code = String.fromCharCode(64 + parseInt(parseInt(i) + 1))
-						}
-					}
-					// nextValue && curEditor.txt.html(nextValue)
+					
+					this.refreshOrder()
 				} else {
 					this.$Message.warning('至少保留两个选项!')
 				}
+				
 			},
 			
 			// 保存试题 获取最新选项数据
@@ -220,7 +230,7 @@
 
 			if (this.editInfo && this.editInfo.question) {
 				console.log('进入单选题Mounted编辑')
-				this.editSingleInfo = this.editInfo
+				this.editSingleInfo = JSON.parse(JSON.stringify(this.editInfo)) 
 				this.stemContent = this.editSingleInfo.question
 				this.optionsContent = this.editSingleInfo.option
 				this.options = this.editSingleInfo.option.map((item, index) => index)
@@ -236,7 +246,7 @@
 					if (newValue) {
 						console.log('单选接收到的数据')
 						console.log(newValue)
-						this.editSingleInfo = newValue
+						this.editSingleInfo = JSON.parse(JSON.stringify(newValue)) 
 						if (Object.keys(newValue).length > 0) {
 							this.stemContent = this.editSingleInfo.question
 							this.optionsContent = this.editSingleInfo.option

TEAMModelOS/ClientApp/src/components/learnactivity/ChooseContent.less → TEAMModelOS/ClientApp/src/components/selflearn/ChooseContent.less


TEAMModelOS/ClientApp/src/components/learnactivity/ContentFileList.less → TEAMModelOS/ClientApp/src/components/selflearn/ContentFileList.less


TEAMModelOS/ClientApp/src/components/learnactivity/ContentFileList.vue → TEAMModelOS/ClientApp/src/components/selflearn/ContentFileList.vue


+ 0 - 1
TEAMModelOS/ClientApp/src/components/learnactivity/NewChooseContent.vue

@@ -196,7 +196,6 @@
     import QuestionList from '@/components/learnactivity/QuestionList.vue'
     import E from '@/utils/wangEditor.js'
     import ExerciseList from '@/view/evaluation/bank/ExerciseList.vue'
-import { json } from 'd3'
     export default {
         components: {
             QuestionList, ExerciseList

TEAMModelOS/ClientApp/src/components/learnactivity/SelectLearnUnit.less → TEAMModelOS/ClientApp/src/components/selflearn/SelectLearnUnit.less


TEAMModelOS/ClientApp/src/components/learnactivity/SelectLearnUnit.vue → TEAMModelOS/ClientApp/src/components/selflearn/SelectLearnUnit.vue


TEAMModelOS/ClientApp/src/components/learnactivity/SelectOrderLearn.less → TEAMModelOS/ClientApp/src/components/selflearn/SelectOrderLearn.less


TEAMModelOS/ClientApp/src/components/learnactivity/SelectOrderLearn.vue → TEAMModelOS/ClientApp/src/components/selflearn/SelectOrderLearn.vue


+ 1 - 1
TEAMModelOS/ClientApp/src/components/syllabus/DragTree.vue

@@ -102,7 +102,7 @@
     import BaseResource from '@/view/syllabus/newSyllabus/operation/BaseResource'
     import BaseKnowledge from '@/view/syllabus/newSyllabus/operation/BaseKnowledge'
     import BaseQuestionList from '@/common/BaseQuestionList'
-    import ChooseContent from '@/components/learnactivity/NewChooseContent'
+    import ChooseContent from '@/components/selflearn/NewChooseContent'
     export default {
         props: ['volume', 'treeData', 'editable'],
         components: { BaseResource, BaseKnowledge, ChooseContent,BaseQuestionList },

TEAMModelOS/ClientApp/src/components/learnactivity/BaseVoteBar.vue → TEAMModelOS/ClientApp/src/components/vote/BaseVoteBar.vue


TEAMModelOS/ClientApp/src/components/learnactivity/BaseVoteForm.less → TEAMModelOS/ClientApp/src/components/vote/BaseVoteForm.less


TEAMModelOS/ClientApp/src/components/learnactivity/BaseVoteForm.vue → TEAMModelOS/ClientApp/src/components/vote/BaseVoteForm.vue


TEAMModelOS/ClientApp/src/components/learnactivity/BaseVotePie.vue → TEAMModelOS/ClientApp/src/components/vote/BaseVotePie.vue


TEAMModelOS/ClientApp/src/components/learnactivity/BaseVoteSsTable.vue → TEAMModelOS/ClientApp/src/components/vote/BaseVoteSsTable.vue


TEAMModelOS/ClientApp/src/components/learnactivity/BaseVoteTable.less → TEAMModelOS/ClientApp/src/components/vote/BaseVoteTable.less


TEAMModelOS/ClientApp/src/components/learnactivity/BaseVoteTable.vue → TEAMModelOS/ClientApp/src/components/vote/BaseVoteTable.vue


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

@@ -217,6 +217,7 @@ export default {
         },
     },
     actions: {
+		// 获取学校基本信息
         getSchoolProfile(context) {
             return new Promise((resolve, reject) => {
                 if (context.state.schoolProfile.school_base) {
@@ -630,6 +631,7 @@ export default {
             }
         },
         setSchoolCode(context, data) {
+			context.rootState.userInfo.schoolCode = data
             localStorage.setItem('login_schooCode', data)
             context.commit('setSchoolCode', data)
         },

+ 1 - 0
TEAMModelOS/ClientApp/src/view/Home.vue

@@ -99,6 +99,7 @@
             }
         },
         mounted() {
+			this.$EventBus.$off('onGlobalLoading')
 			this.$EventBus.$on('onGlobalLoading', val => {
 				this.isLoading = val
             })

+ 1 - 2
TEAMModelOS/ClientApp/src/view/classmgt/ManageClass.vue

@@ -55,7 +55,7 @@
                     </div>
                     <Draggable ghost-class="ghost" group="student" class="list-group" :list="item.students" :animation='200' @end="groupToList">
                         <div class="student-info-item" v-for="(stuItem,index) in item.students" :key="index">
-                            <span>{{stuItem.name}}</span>
+                            <span>{{stuItem.no+ '-' +stuItem.name}}</span>
                             <span>{{'('+stuItem.id+')'}}</span>
                         </div>
                         <EmptyData textContent="暂无学生" v-if="item.students.length == 0"></EmptyData>
@@ -99,7 +99,6 @@
 <script>
     import Draggable from 'vuedraggable'
     import excel from '@/utils/excel.js'
-import { Function } from 'core-js'
     export default {
         components: {
             Draggable

+ 2 - 8
TEAMModelOS/ClientApp/src/view/evaluation/bank/ExerciseList.vue

@@ -170,9 +170,9 @@
 					<!--<span class="item-tools-info" style="border:0">更新时间:{{ formatDateTime(new Date(item.createTime * 1000)) }}</span>-->
 					<!--<Button type="info" :style="{backgroundColor:basketList.all.indexOf(item) > -1 ? '#bbbbbb' : ''}" @click="handleChoose(item)">{{basketList.all.indexOf(item) > -1 ? '已选入' : '选题'}} </Button>-->
 
-					<Button type="text" @click.stop="handleEdit(item)" v-if="$access.can('admin.*|Exercise_Edit')" icon="md-create"
+					<Button type="text" @click.stop="handleEdit(item)" v-if="$access.can('admin.*|teacher.*|Exercise_Edit')" icon="md-create"
 					 style="margin-right: 10px">编辑</Button>
-					<Button type="text" @click.stop="handleDelete(item)" v-if="$access.can('admin.*|Exercise_Edit')" icon="md-trash"
+					<Button type="text" @click.stop="handleDelete(item)" v-if="$access.can('admin.*|teacher.*|Exercise_Edit')" icon="md-trash"
 					 style="margin-right: 10px">删除</Button>
 				</div>
 			</div>
@@ -207,14 +207,8 @@
 </template>
 <script>
 	import blobTool from "@/utils/blobTool.js";
-	import BaseChild from "../components/BaseChild";
-	import BaseEditExercise from "../components/BaseEditExercise.vue";
 
 	export default {
-		components: {
-			BaseChild,
-			BaseEditExercise
-		},
 		data() {
 			return {
 				userId: "",

+ 1 - 0
TEAMModelOS/ClientApp/src/view/evaluation/components/BaseChild.vue

@@ -56,6 +56,7 @@
 <script>
 	import '@/utils/Math.uuid'
 	export default {
+		name:'BaseChild',
 		components: {},
 		props: {
 			children: {

+ 2 - 2
TEAMModelOS/ClientApp/src/view/evaluation/components/BaseChildList.vue

@@ -26,11 +26,11 @@
 	</div>
 </template>
 <script>
-	import BaseCreateChild from '@/view/evaluation/components/BaseCreateChild'
 	import draggable from "vuedraggable"
 	export default {
+		name:'BaseChildList',
 		components: {
-			BaseCreateChild , draggable
+			draggable
 		},
 		props: {
 			childList: {

+ 2 - 5
TEAMModelOS/ClientApp/src/view/evaluation/components/BaseCreateChild.vue

@@ -108,9 +108,7 @@
 	import BaseCompletion from "@/view/evaluation/types/BaseCompletion.vue";
 	import BaseJudge from "@/view/evaluation/types/BaseJudge.vue";
 	import BaseSubjective from "@/view/evaluation/types/BaseSubjective.vue";
-	import BasePoints from "@/view/evaluation/components/BasePoints";
-	import BaseRepair from "@/view/evaluation/components/BaseRepair";
-	import NewChooseContent from "@/components/learnactivity/NewChooseContent";
+    import NewChooseContent from "@/components/selflearn/NewChooseContent";
 	import E from "@/utils/wangEditor.js";
 	// 默认创建题目模板
 	const defaultExercise = {
@@ -122,6 +120,7 @@
 		type: "",
 	};
 	export default {
+		name:'BaseCreateChild',
 		components: {
 			IconText,
 			BaseSingle,
@@ -129,8 +128,6 @@
 			BaseMultiple,
 			BaseCompletion,
 			BaseSubjective,
-			BasePoints,
-			BaseRepair,
 			NewChooseContent,
 		},
 		props: {

+ 18 - 21
TEAMModelOS/ClientApp/src/view/evaluation/components/BaseEditExercise.vue

@@ -15,7 +15,7 @@
 			</div>
 			<div class="exersices-attr my-radio-style">
 				<IconText :text="'选择科目'" :color="'#00b8ff'" :icon="'md-bookmarks'"></IconText>
-				<Select v-model="exerciseSubject">
+				<Select v-model="exerciseSubject" @on-change="onSubjectChange">
 					<Option v-for="(subject, index) in subjectList" :value="index" :key="index">{{ subject.name }}</Option>
 				</Select>
 			</div>
@@ -146,15 +146,11 @@
 	import "videojs-contrib-hls.js/src/videojs.hlsjs";
 	import IconText from "@/components/evaluation/IconText.vue";
 	import BaseSingle from "@/view/evaluation/types/BaseSingle.vue";
-	import BaseMultiple from "@/view/evaluation/types/BaseMultiple.vue";
+	import BaseMultiple from "@/view/evaluation/types/BaseMultipleNew.vue";
 	import BaseCompletion from "@/view/evaluation/types/BaseCompletion.vue";
 	import BaseJudge from "@/view/evaluation/types/BaseJudge.vue";
 	import BaseSubjective from "@/view/evaluation/types/BaseSubjective.vue";
 	import BaseCompose from "@/view/evaluation/types/BaseCompose.vue";
-	import BasePoints from "@/view/evaluation/components/BasePoints";
-	import BaseRepair from "@/view/evaluation/components/BaseRepair";
-	import BaseCreateChild from "@/view/evaluation/components/BaseCreateChild";
-	import BaseChildList from "@/view/evaluation/components/BaseChildList";
 	import E from "@/utils/wangEditor.js";
 
 	export default {
@@ -168,10 +164,6 @@
 			BaseCompletion,
 			BaseSubjective,
 			BaseCompose,
-			BasePoints,
-			BaseCreateChild,
-			BaseChildList,
-			BaseRepair,
 		},
 		data() {
 			return {
@@ -266,6 +258,7 @@
 			/* 滚回顶部 */
 			backToTop() {
 				this.$refs.editContainer.scrollIntoView();
+				this.exersicesType = ''
 			},
 
 			onSelectFile(val) {
@@ -296,17 +289,16 @@
 
 						break;
 					case "multiple":
-						exerciseItem.question = this.$refs.multiple._data.stemContent;
-						exerciseItem.option =
-							this.$refs.multiple.optionsContent.length ===
-							this.$refs.multiple.options.length &&
-							this.checkOptionNull(this.$refs.multiple.optionsContent) ?
-							this.$refs.multiple.optionsContent :
-							null;
-						exerciseItem.type = this.exersicesType;
-						exerciseItem.level = +this.exersicesDiff;
-						exerciseItem.answer = this.$refs.multiple._data.transferArr;
-						break;
+						this.$refs.multiple.doSave()
+							exerciseItem.question = this.$refs.multiple.stemContent;
+							exerciseItem.option = this.checkOptionNull(this.$refs.multiple.optionsContent) ?
+								this.$refs.multiple.optionsContent :
+								null;
+							exerciseItem.type = this.exersicesType;
+							exerciseItem.level = +this.exersicesDiff;
+							exerciseItem.explain = this.analysisContent;
+							exerciseItem.answer = this.$refs.multiple.multipleAnswers;
+							break;
 					case "judge":
 						exerciseItem.question = this.$refs.judge._data.stemContent;
 						exerciseItem.option = [];
@@ -512,6 +504,11 @@
 				this.exerciseSubject = 0;
 				this.exercisePoints = []; // 切换学段后 知识点需要重新选择
 			},
+			
+			/* 切换科目 将知识点重置 */
+			onSubjectChange(){
+				this.exercisePoints = []
+			},
 
 			// 提取富文本内容中的文本
 			getSimpleText(html) {

+ 1 - 5
TEAMModelOS/ClientApp/src/view/evaluation/components/BaseExerciseList.vue

@@ -201,9 +201,7 @@
 	</div>
 </template>
 
-
 <script>
-	import BaseChild from '../components/BaseChild'
 	export default {
 		props: {
 			paper: {
@@ -215,9 +213,6 @@
 				default: false
 			}
 		},
-		components: {
-			BaseChild
-		},
 		data() {
 			return {
 				schoolCode: '',
@@ -638,6 +633,7 @@
 
 		},
 		mounted() {
+			this.$EventBus.$off('importFinish')
 			this.$EventBus.$on('importFinish', list => {
 				this.errorList = list
 				this.noAnswerList = list.filter(i => i.answer.length === 0)

+ 1 - 1
TEAMModelOS/ClientApp/src/view/evaluation/components/BaseRepair.vue

@@ -50,7 +50,7 @@
 	</div>
 </template>
 <script>
-	import NewChooseContent from '@/components/learnactivity/NewChooseContent'
+    import NewChooseContent from '@/components/selflearn/NewChooseContent'
 	export default {
 		name:'BaseRepair',
 		components: { NewChooseContent },

+ 20 - 0
TEAMModelOS/ClientApp/src/view/evaluation/components/index.js

@@ -0,0 +1,20 @@
+import Vue from "vue";
+function changeStr(str) {
+    //首字母大写
+    return str.charAt(0).toUpperCase() + str.slice(1);
+  }
+  const requireComponent = require.context("./", false, /\.vue$/);
+  const install = (Vue) => {
+    requireComponent.keys().forEach((fileName) => {
+      let config = requireComponent(fileName);
+      let componentName = changeStr(
+        fileName.replace(/^\.\//, "").replace(/\.\w+$/, "")
+      );
+      Vue.component(componentName, config.default || config);
+    });
+  };
+  export default {
+    install,
+  };
+  
+  

+ 12 - 12
TEAMModelOS/ClientApp/src/view/evaluation/index/CreateExercises.vue

@@ -18,7 +18,7 @@
 			</div>
 			<div class="exersices-attr my-radio-style">
 				<IconText :text="'选择科目'" :color="'#00b8ff'" :icon="'md-bookmarks'"></IconText>
-				<Select v-model="exerciseSubject">
+				<Select v-model="exerciseSubject" @on-change="onSubjectChange">
 					<Option v-for="(subject, index) in subjectList" :value="index" :key="index">{{ subject.name }}</Option>
 				</Select>
 			</div>
@@ -148,7 +148,7 @@
 	import blobTool from "@/utils/blobTool.js";
 	import IconText from "@/components/evaluation/IconText.vue";
 	import BaseSingle from "@/view/evaluation/types/BaseSingle.vue";
-	import BaseMultiple from "@/view/evaluation/types/BaseMultiple.vue";
+	import BaseMultiple from "@/view/evaluation/types/BaseMultipleNew.vue";
 	import BaseCompletion from "@/view/evaluation/types/BaseCompletion.vue";
 	import BaseJudge from "@/view/evaluation/types/BaseJudge.vue";
 	import BaseSubjective from "@/view/evaluation/types/BaseSubjective.vue";
@@ -284,12 +284,9 @@
 				let exerciseItem = Object.assign({}, defaultExercise);
 				switch (type) {
 					case "single":
-					this.$refs.single.doSave()
+						this.$refs.single.doSave()
 						exerciseItem.question = this.$refs.single.stemContent;
-						exerciseItem.option =
-							this.checkOptionNull(this.$refs.single.optionsContent) ?
-							this.$refs.single.optionsContent :
-							null;
+						exerciseItem.option = this.checkOptionNull(this.$refs.single.optionsContent) ? this.$refs.single.optionsContent : null;
 						exerciseItem.type = this.exersicesType;
 						exerciseItem.level = +this.exersicesDiff;
 						exerciseItem.explain = this.analysisContent;
@@ -298,17 +295,15 @@
 						];
 						break;
 					case "multiple":
+					this.$refs.multiple.doSave()
 						exerciseItem.question = this.$refs.multiple.stemContent;
-						exerciseItem.option =
-							this.$refs.multiple.optionsContent.length ===
-							this.$refs.multiple.options.length &&
-							this.checkOptionNull(this.$refs.multiple.optionsContent) ?
+						exerciseItem.option = this.checkOptionNull(this.$refs.multiple.optionsContent) ?
 							this.$refs.multiple.optionsContent :
 							null;
 						exerciseItem.type = this.exersicesType;
 						exerciseItem.level = +this.exersicesDiff;
 						exerciseItem.explain = this.analysisContent;
-						exerciseItem.answer = this.$refs.multiple.transferArr;
+						exerciseItem.answer = this.$refs.multiple.multipleAnswers;
 						break;
 					case "judge":
 						exerciseItem.question = this.$refs.judge.stemContent;
@@ -539,6 +534,11 @@
 				this.exerciseSubject = 0;
 				this.exercisePoints = []; // 切换学段后 知识点需要重新选择
 			},
+			
+			/* 切换科目 将知识点重置 */
+			onSubjectChange(){
+				this.exercisePoints = []
+			},
 
 			// 提取富文本内容中的文本
 			getSimpleText(html) {

+ 1 - 1
TEAMModelOS/ClientApp/src/view/evaluation/index/CreatePaper.vue

@@ -712,7 +712,7 @@
 				this.evaluationInfo.createType == 'manual'
 				this.activeTab = 'preview'
 			}
-
+			this.$EventBus.$off('onBackToTop')
 			this.$EventBus.$on('onBackToTop', () => {
 				this.handleBackToTop()
 			})

+ 342 - 0
TEAMModelOS/ClientApp/src/view/evaluation/types/BaseMultipleNew.vue

@@ -0,0 +1,342 @@
+<template>
+	<div>
+		<div class="exersices-content">
+			<IconText :text="'题目'" :color="'#2d8cf0'" :icon="'ios-create'" style="margin-bottom:15px;"></IconText>
+			<div @click="onRichTextClick($event)">
+				<div ref="singleEditor" style="text-align:left"></div>
+			</div>
+		</div>
+		<div class="exersices-option">
+			<IconText :text="'多选选项'" :color="'#FF871C'" :icon="'md-reorder'"></IconText>
+			<div v-for="(item,index) in options" :key="index" :ref="'optionBox' + index" :class="'editor-wrap-'+item" style="margin-top:10px;display:flex"
+			 @click="onRichTextClick($event)">
+				<span class="fl-center option-order" :ref="'optionOrder' + index" :data-index="index">{{ renderIndex(index) }}</span>
+				<!-- <span class="fl-center option-order">{{String.fromCharCode(64 + parseInt(index+1))}}</span> -->
+				<div :ref="'singleOption'+index" style="text-align:left" class="option-editor" @click="optionClick(item)"></div>
+				<span :class="['fl-center', 'option-setting', trueArr.indexOf(index) > -1 ? 'option-true':'']" @click="settingAnswer(index)">{{ trueArr.indexOf(index) > -1  ? '正确答案' :'设为答案' }}</span>
+				<span class="fl-center option-delete" @click="deleteOption(index,item)">
+					<Icon type="ios-close-circle" /></span>
+			</div>
+			<p class="option-add"><span @click="addOption()">+ 添加选项 </span><span style="color:rgb(60,196,82);margin-left:15px;font-weight:bold">正确答案:{{ multipleAnswers.join('') }}</span></p>
+		</div>
+	</div>
+</template>
+<script>
+	import E from '@/utils/wangEditor.js'
+	import IconText from '@/components/evaluation/IconText.vue'
+	export default {
+		components: {
+			IconText
+		},
+		props: ['editInfo'],
+		data() {
+			return {
+				options: [...new Array(4).keys()], // 默认四个选项
+				existOptions: [...new Array(4).keys()],
+				initFlag: true,
+				trueIndex: 0,
+				optionTrueIndex:0,
+				trueArr:[0],
+				optionTrueArr:[0],
+				multipleAnswers:['A'],
+				editSingleInfo: {},
+				stemEditor: null,
+				stemContent: '',
+				transferArr:[],
+				optionsContent: [],
+				optionEditors: [],
+				defaultConfig: {
+					uploadImgShowBase64: true,
+					menus: this.$tools.wangEditorMenu
+				}
+			}
+		},
+		created() {},
+		methods: {
+			initEditors() {
+				// Editor默认配置
+				if (this.options.length > 0) {
+					this.options.forEach((item, i) => {
+						let that = this
+						let editor = new E(that.$refs['singleOption' + i][0])
+						editor.customConfig = this.defaultConfig
+						editor.customConfig.uploadVideoDisable = true,
+							// editor.customConfig.zIndex = 100
+
+							// 选项编辑器失焦隐藏工具栏
+							editor.customConfig.onblur = function() {
+								let allToolbars = document.getElementsByClassName('option-editor')
+								for (let i = 0; i < allToolbars.length; i++) {
+									if (allToolbars[i].children.length) {
+										allToolbars[i].children[0].style.visibility = 'hidden'
+									}
+								}
+							}
+
+						editor.customConfig.onVideoWarning = (text) => {
+								this.$Message.warning(text)
+							},
+
+							// 选项编辑器内容发生变化时
+							editor.customConfig.onchange = (html) => {
+								let key = String.fromCharCode(64 + parseInt(i + 1))
+								let codeArr = this.optionsContent.map(item => item.code)
+								// 如果已经编辑过则 修改选项内容
+								if (codeArr.indexOf(key) !== -1) {
+									this.optionsContent[codeArr.indexOf(key)].value = html
+								} else { // 否则创建新选项
+									let option = {
+										code: key,
+										value: html
+									}
+									this.optionsContent.push(option)
+								}
+							}
+						editor.create()
+						this.optionEditors.push(editor)
+						that.$refs["singleOption" + i][0].dataset.editorId = editor.id
+
+						// 如果是编辑状态 则将选项内容回显
+						if (Object.keys(this.editSingleInfo).length > 0) {
+							editor.txt.html(this.editSingleInfo.option[i].value)
+						}
+					})
+				}
+			},
+
+			onRichTextClick(e) {
+				this.$parent.onRichTextClick(e)
+			},
+			/* 添加选项 */
+			addOption() {
+				let that = this
+				let wraps = document.getElementsByClassName('option-editor')
+				let optionsLength = wraps.length;
+				let newIndex = parseInt(this.options[this.options.length - 1]) + 1
+				// let optionsLength = this.options.length
+				if (optionsLength < 10) {
+					this.options.push(newIndex)
+					this.existOptions.push(newIndex)
+					this.$nextTick(() => {
+						let editor = new E(that.$refs['singleOption' + newIndex][0])
+						editor.customConfig = this.defaultConfig
+
+						editor.customConfig.onchange = (html) => {
+							let key = String.fromCharCode(64 + parseInt(newIndex + 1))
+							let codeArr = this.optionsContent.map(item => item.code)
+							// 如果已经编辑过则 修改选项内容
+							if (codeArr.indexOf(key) !== -1) {
+								this.optionsContent[codeArr.indexOf(key)].value = html
+								console.log(this.optionsContent.map(item => item.code))
+								console.log(this.optionsContent.map(item => item.value))
+							} else { // 否则创建新选项
+								let option = {
+									code: key,
+									value: html
+								}
+								this.optionsContent.push(option)
+							}
+						}
+						editor.create()
+						this.optionEditors.push(editor);
+						this.$refs["singleOption" + newIndex][0].dataset.editorId = editor.id
+						this.refreshOrder()
+					})
+				} else {
+					this.$Message.warning('最多只有10个选项!')
+				}
+			},
+			
+			
+			/* 设置正确答案 */
+			settingAnswer(index) {
+				this.$nextTick(() => {
+				    if (this.trueArr.indexOf(index) > -1) {
+						if(this.trueArr.length === 1){
+							this.$Message.warning('至少保留一个正确答案!')
+						}else{
+							this.trueArr.splice(this.trueArr.indexOf(index), 1)
+						}
+				    } else {
+				        this.trueArr.push(index)
+				        this.trueArr = this.trueArr.sort() // 选项排序
+				    }
+					this.getAnswerOrder(this.trueArr)
+				})
+			},
+			
+			/* 获取最新答案选项 */
+			getAnswerOrder(arr){
+				let arr2 = []
+				arr.forEach(i => {
+					arr2.push(this.getOrderCode(i))
+				})
+				this.multipleAnswers = arr2.sort()
+			},
+			
+			/* 根据index获取对应选项字母的值 */
+			getOrderCode(index){
+				let wraps = document.getElementsByClassName('option-order')
+				for(let i=0;i<wraps.length;i++){
+					let item = wraps[i]
+					if(+index === +item.dataset.index){
+						return item.innerText
+						break;
+					}
+				}
+			},
+			
+			/* 根据页面上的选项DOM数量,刷新每个选项的Order显示 */
+			refreshOrder() {
+				let wraps = document.getElementsByClassName('option-order')
+				wraps.forEach((item, index) => {
+					item.innerHTML = this.renderIndex(index)
+				})
+			},
+			
+			/* 根据下标渲染对应的字母顺序 */
+			renderIndex(index) {
+				return String.fromCharCode(64 + parseInt(index + 1))
+			},
+			
+			
+
+			/* 删除选项 */
+			deleteOption(index,item) {
+				// 拿到所有选项
+				if (this.existOptions.length > 2 ) {
+					// 如果删除的是正确答案 则重置正确答案
+					if(this.trueArr.indexOf(index) > -1){
+						if(this.trueArr.length === 1){
+							this.$Message.warning('至少保留一个正确答案!')
+						}else{
+							this.trueArr.splice(this.trueArr.indexOf(index),1)
+							// 确保当前存在的options保持同步
+							this.existOptions.splice(this.existOptions.indexOf(item), 1)
+							this.optionsContent.splice(index, 1)
+							// 删除操作 移除选项DOM
+							let textWrap = this.$refs['optionBox' + index][0]
+							textWrap.remove()
+							// 刷新选项序号显示
+							this.refreshOrder()
+							this.getAnswerOrder(this.trueArr)
+						}
+					}else{
+						// 确保当前存在的options保持同步
+						this.existOptions.splice(this.existOptions.indexOf(item), 1)
+						this.optionsContent.splice(index, 1)
+						// 删除操作 移除选项DOM
+						let textWrap = this.$refs['optionBox' + index][0]
+						textWrap.remove()
+						// 刷新选项序号显示
+						this.refreshOrder()
+						this.getAnswerOrder(this.trueArr)
+					}
+					
+				} else {
+					this.$Message.warning('至少保留两个选项!')
+				}
+			},
+
+			/* 保存试题 获取最新选项数据 */
+			doSave() {
+				// 拿到当前还剩的选项DOM
+				let wraps = document.getElementsByClassName('option-editor')
+				let arr = []
+				wraps.forEach((item, index) => {
+					// 遍历选项 找到对应的 Editor 然后获取编辑器里面的内容
+					let id = item.dataset.editorId
+					let curEditor = this.optionEditors.filter(i => i.id === id)[0]
+					if(curEditor){
+						// 生成新的选项对象
+						let obj = {
+							code: String.fromCharCode(64 + parseInt(index + 1)),
+							value: curEditor.txt.html()
+						}
+						arr.push(obj)
+					}
+					
+				})
+				this.optionsContent = arr
+			},
+
+			/* 模拟选项聚焦事件 */
+			optionClick(index) {
+				let allToolbars = document.getElementsByClassName('option-editor')
+				let that = this
+				for (let i = 0; i < allToolbars.length; i++) {
+					allToolbars[i].children[0].style.visibility = 'hidden'
+				}
+				setTimeout(function() {
+					let currentToolBar = that.$refs['singleOption' + index][0].children[0]
+					currentToolBar.style.visibility = 'visible'
+				}, 100)
+			},
+			/* 渲染多选题 */
+			doRender(editInfo){
+				this.editSingleInfo = editInfo
+				this.stemContent = editInfo.question
+				this.optionsContent = editInfo.option
+				this.multipleAnswers = editInfo.answer
+				this.trueArr = editInfo.answer.map(item => item.charCodeAt() - 65)
+				this.options = editInfo.option.map((item, index) => index)
+				this.existOptions = editInfo.option.map((item, index) => index)
+				this.$nextTick(() => {
+					this.initEditors()
+					this.stemEditor.txt.html(editInfo.question)
+				})
+			}
+		},
+		mounted() {
+			let stemEditor = new E(this.$refs.singleEditor)
+			stemEditor.customConfig = this.defaultConfig
+			stemEditor.customConfig.uploadVideoDisable = false
+			stemEditor.customConfig.onchange = (html) => {
+				this.stemContent = html
+			}
+			stemEditor.customConfig.onVideoWarning = (text) => {
+					this.$Message.warning(text)
+				},
+
+			// 选择视频文件后的上传Blob操作
+			stemEditor.customConfig.onVideoSelected = async (file) => {
+					this.$tools.doUploadVideo(this, file, stemEditor)
+				},
+			stemEditor.create()
+			this.stemEditor = stemEditor
+			this.initEditors()
+
+			if (this.editInfo && this.editInfo.question) {
+				console.log('进入多选题Mounted编辑')
+				this.doRender(this.editInfo)
+			}
+		},
+		computed: {
+		    // 选项顺序转化成字母
+		    showTrueAnswers() {
+		        let arr = this.trueArr.map(item => String.fromCharCode(64 + parseInt(item + 1)))
+		        this.transferArr = arr
+		        return this.transferArr.sort().join('')
+		    }
+		},
+		watch: {
+			editInfo: {
+				handler(newValue, oldValue) {
+					if (newValue) {
+						console.log('多选接收到的数据')
+						console.log(newValue)
+						this.editSingleInfo = newValue
+						if (Object.keys(newValue).length > 0) {
+							this.doRender(newValue)
+						}
+					}
+				},
+				// immediate:true
+			},
+
+		}
+	}
+</script>
+<style lang="less" scoped>
+	@import"../index/CreateExercises.less";
+</style>

+ 1 - 6
TEAMModelOS/ClientApp/src/view/evaluation/types/BaseSingle.vue

@@ -180,12 +180,10 @@
 
 			/* 删除选项 */
 			deleteOption(index,item) {
-				
 				// 如果删除的是正确答案前面的选项 则正确答案需要往前排一位
 				if(index < this.optionTrueIndex){ this.trueIndex-- }
 				// 拿到所有选项
-				let wraps = document.getElementsByClassName('option-editor')
-				if (wraps.length > 2) {
+				if (this.existOptions.length > 2) {
 					// 确保当前存在的options保持同步
 					this.existOptions.splice(this.existOptions.indexOf(item), 1)
 					this.optionsContent.splice(index, 1)
@@ -267,9 +265,6 @@
 				this.optionTrueIndex = this.editSingleInfo.answer[0].charCodeAt() - 65
 				this.options = this.editSingleInfo.option.map((item, index) => index)
 				this.existOptions = this.editSingleInfo.option.map((item, index) => index)
-				console.log(this.options)
-				console.log(this.trueIndex)
-				console.log(this.optionTrueIndex)
 				this.$nextTick(() => {
 					this.initEditors()
 					this.stemEditor.txt.html(this.editSingleInfo.question)

+ 2 - 2
TEAMModelOS/ClientApp/src/view/homework/ManageHomeWork.vue

@@ -86,8 +86,8 @@
 	</div>
 </template>
 <script>
-	import BaseHwForm from '@/components/learnactivity/BaseHwForm'
-	import BaseHwTable from '@/components/learnactivity/BaseHwTable'
+	import BaseHwForm from '@/components/homework/BaseHwForm'
+	import BaseHwTable from '@/components/homework/BaseHwTable'
 	export default {
 		components: {
 			BaseHwForm,

+ 3 - 5
TEAMModelOS/ClientApp/src/view/learnactivity/AutoCreate.vue

@@ -34,7 +34,7 @@
                     <div class="question-condition-item">
                         <span class="condition-label">适用学段:</span>
                         <RadioGroup v-model="autoCreateFilter.periodCode" style="display:inline-block;">
-                            <Radio v-for="(item,index) in $store.state.schoolBaseInfo.schoolBaseInfo.period" :label="item.id" :key="index" style="margin-right:30px;"> {{item.name}}</Radio>
+                            <Radio v-for="(item,index) in $store.state.user.schoolProfile.school_base.period" :label="item.id" :key="index" style="margin-right:30px;"> {{item.name}}</Radio>
                         </RadioGroup>
                     </div>
                     <div class="question-condition-item question-num-item " v-if="schoolBaseInfo.length > 0">
@@ -248,9 +248,9 @@
         },
         methods: {
             async getData() {
-                await this.$store.dispatch('schoolBaseInfo/getSchoolBaseData').then(
+                await this.$store.dispatch('user/getSchoolProfile').then(
                     (res) => {
-                        this.schoolBaseInfo = this.$store.state.schoolBaseInfo.schoolBaseInfo.period
+                        this.schoolBaseInfo = this.$store.state.user.schoolProfile.school_base.period
                         if (res.code == 2) {
                             alert('数据为空!')
                         }
@@ -360,7 +360,6 @@
             },
             //提交组卷数据
             handleFilterData() {
-                console.log(this.$store.state.schoolBaseInfo)
                 let requestData = []
                 let filterData = {
                     code: 'Item-' + this.$store.state.userInfo.TEAMModelId.replace('#', '') ,
@@ -398,7 +397,6 @@
 										arr = arr.concat(res[i].item)
                                     }
 									this.$emit('autoQuestions', arr)
-									console.log(arr)
                                 }, 2000)
 
                             } else {

+ 58 - 49
TEAMModelOS/ClientApp/src/view/learnactivity/CreateEvaluation.vue

@@ -34,7 +34,7 @@
                             </Select>
                         </FormItem>
                         <FormItem label="施测对象">
-                            <select-tree  multiple :treeData="selectData" @on-select-change="selectChange"></select-tree>
+                            <select-tree v-model="queryVal" multiple :treeData="selectData" @on-select-change="selectChange"></select-tree>
                             <!--<MultiCascader ref="addMulti" v-bind="config" @son="changeSon" hasValue :firstOpen="open" v-model="formChange.scope" @on-change="setChangeScope"></MultiCascader>-->
                         </FormItem>
                         <FormItem label="发布方式" prop="publish">
@@ -58,8 +58,6 @@
                 <div class="wrap-label" v-if="mode == 'school'">
                     <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.user.schoolProfile.school_base, item.periodId), item.subjectId)}}
                         <Icon type="ios-close" size="18" class="delete-subject-btn" @click="deleteSubject(index)" />
                     </span>
@@ -70,9 +68,7 @@
                     <div class="create-type-wrap" v-if="evaluationInfo.paperInfo.length > 0 || mode == 'class'" >
                         <span>创建方式:</span>
                         <RadioGroup v-model="evaluationInfo.paperInfo[currentSubjectIndex].createType" style="margin-left:25px;" @on-change="setActiveTab">
-                            <!--<Radio label="auto">自动组题</Radio>-->
                             <Radio label="manualPaper">手动挑卷</Radio>
-                            <!--<Radio label="manualQuestion">手动挑题</Radio>-->
                             <Radio label="import">试卷导入</Radio>
                         </RadioGroup>
                     </div>
@@ -151,7 +147,7 @@
 <script>
     import AutoCreate from './AutoCreate.vue'
     import MultiCascader from './MultiCascader.vue'
-    import SelectTree from './SelectTree.vue'
+    import SelectTree from './SelectedTree.vue'
     import ManualCreate from './ManualCreate.vue'
     import ManualPaper from './ManualPaper.vue'
     import ImportCreate from './ImportCreate.vue'
@@ -271,7 +267,7 @@
                 ],
                 mode: '',
                 selectData:[],
-
+                queryVal:"",
 
 
 
@@ -303,42 +299,54 @@
         },
         methods: {
             //获取筛选的班级信息
-            selectChange(multipleShowVal, multipleHideVal) {
-                console.log(multipleShowVal, multipleHideVal);
+           async selectChange(multipleShowVal, multipleHideVal) {
+                if (multipleShowVal.length) {
+                    let grade = []
+                    for (let item of multipleShowVal) {
+                        for (let items of this.$store.state.user.schoolProfile.school_classes) {
+                            if (item == items.id) {
+                                grade.push(items)
+                            }
+                        }
+                    }
+                    let data = await this.unique(grade)
+                    this.gradeChoose = this.getexamGradeName(data)
+                    this.classChoose = multipleShowVal
+                }
             },
-
             /**
              * 多選組件配置信息
              * */
-            async setChangeScope(data) {
-                let classInfo = []
-                let periodInfo = []
-                let periodData = []
-                for (let i = 0; i < data.length; i++) {
-                    let str = (data[i].__value || "").split(',')
-                    periodData.push(str[0])
-                    if (data[i].grade == undefined) {
-                        classInfo.push(data[i].value)
-                    } else {
-                        periodInfo.push(data[i].grade)
-                    }
-                }
-                let datas = await this.unique(periodData)
-                this.gradeChoose = this.getexamGradeName(datas)
-                let dataInfo = []
-                dataInfo = await this.getChooseClass(periodInfo)
-                if (dataInfo.length !== 0) {
-                    this.classChoose = [...classInfo, ...dataInfo]
-                } else {
-                    this.classChoose = [...classInfo]
-                }
-            },
+            //async setChangeScope(data) {
+            //    console.log(data)
+            //    let classInfo = []
+            //    let periodInfo = []
+            //    let periodData = []
+            //    for (let i = 0; i < data.length; i++) {
+            //        let str = (data[i].__value || "").split(',')
+            //        periodData.push(str[0])
+            //        if (data[i].grade == undefined) {
+            //            classInfo.push(data[i].value)
+            //        } else {
+            //            periodInfo.push(data[i].grade)
+            //        }
+            //    }
+            //    let datas = await this.unique(periodData)
+            //    this.gradeChoose = this.getexamGradeName(datas)
+            //    let dataInfo = []
+            //    dataInfo = await this.getChooseClass(periodInfo)
+            //    if (dataInfo.length !== 0) {
+            //        this.classChoose = [...classInfo, ...dataInfo]
+            //    } else {
+            //        this.classChoose = [...classInfo]
+            //    }
+            //},
             getexamGradeName(data) {
                 let code = []
                 let key = {}
                 for (let datas of data) {
                     for (let item of this.getPeriodInfo(this.evaluationInfo.school).grades) {
-                        if (item.id = datas) {
+                        if (item.id = datas.gradeId) {
                             key.id = item.id
                             key.name = item.name
                             code.push(key)
@@ -352,21 +360,21 @@
                 this.open = true
             },
             //根据年级获取班级信息
-            getChooseClass(data) {
-                let classData = []
-                if (data.length !== 0) {
-                    for (let item of data) {
-                        for (let code of this.$store.state.user.schoolProfile.school_classes) {
-                            if (code.gradeId == item) {
-                                classData.push(code.id)
-                            }
-                        }
-                    }
-                    return classData
-                } else {
-                    return classData
-                }
-            },
+            //getChooseClass(data) {
+            //    let classData = []
+            //    if (data.length !== 0) {
+            //        for (let item of data) {
+            //            for (let code of this.$store.state.user.schoolProfile.school_classes) {
+            //                if (code.gradeId == item) {
+            //                    classData.push(code.id)
+            //                }
+            //            }
+            //        }
+            //        return classData
+            //    } else {
+            //        return classData
+            //    }
+            //},
             //数组查重
             unique(array) {
                 var res = []
@@ -436,6 +444,7 @@
                     }
                 }
                 this.selectData = this.convertTree(grades, this.map)
+                this.config.data = this.convertTree(grades, this.map)
             },
             /**显示试卷分析 */
             showAnalysis() {

+ 34 - 188
TEAMModelOS/ClientApp/src/view/learnactivity/ManageEvaluation.vue

@@ -3,35 +3,33 @@
         <!--评测列表-->
         <div class="evaluation-list-wrap">
             <div class="evaluation-list-title">
-                <Dropdown class="sort-dropdown" trigger="click" @on-visible-change="getPeriod" placement="bottom-end" v-if="$store.state.user.schoolProfile.school_base">
+                <Dropdown class="sort-dropdown" trigger="click" @on-click="getPeriod" placement="bottom-end" v-if="$store.state.user.schoolProfile.school_base">
                     <span>当前学段:</span>
                     <span>{{filterPeriodName}}</span>
                     <span style="cursor: pointer;">
                         <Icon type="ios-arrow-down" style="margin-left:8px;"></Icon>
                     </span>
-                    <DropdownMenu slot="list" >
-                        <DropdownItem :name="all">全部</DropdownItem>
+                    <DropdownMenu slot="list">
+                        <DropdownItem>全部</DropdownItem>
                         <DropdownItem v-for="(item,index) in $store.state.user.schoolProfile.school_base.period" :value="item.id" :key="index" :name="item.id">{{ item.name }}</DropdownItem>
                     </DropdownMenu>
                 </Dropdown>
-
-                <!--<Poptip trigger="hover" placement="bottom" offset="-8">
-        <Icon type="ios-funnel" :class="evaluationList.length == 0 ? 'custom-label-disabeld to-create-icon':'to-create-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.schoolBaseInfo.schoolBaseInfo.period" :value="item.id" :key="index">
-                        {{ item.name }}
-                    </Option>
-                </Select>
-            </div>
-        </div>
-    </Poptip>-->
-
-                <Icon type="md-add" class="to-create-icon" size="20" @click="goToCreate" title="新建" />
+                <Icon type="md-add" :class="evaluationList.length == 0 ? 'custom-label-disabeld to-create-icon':'to-create-icon'"  @click="goToCreate" title="新建" />
                 <Icon type="md-trash" :class="evaluationList.length == 0 ? 'custom-label-disabeld to-create-icon':'to-create-icon'" title="删除" @click="deleteEvaluation" />
                 <Icon type="md-create" :class="evaluationList.length == 0 ? 'custom-label-disabeld to-create-icon':'to-create-icon'" @click="editEvaluation" title="编辑" />
+                <!--<Poptip trigger="hover" placement="bottom" >
+                    <Icon type="ios-funnel" size="16" :class="custom-label-disabeld" />
+                    <div slot="content">
+                        <div>
+                            <span>学段:</span>
+                            <Select v-model="filterPeriod" style="width:80px" size="small" clearable @on-change="filterByPeriod">
+                                <Option v-for="(item,index) in $store.state.schoolBaseInfo.schoolBaseInfo.period" :value="item.id" :key="index">
+                                    {{ item.name }}
+                                </Option>
+                            </Select>
+                        </div>
+                    </div>
+                </Poptip>-->
             </div>
             <div class="evaluation-list-main">
                 <vuescroll>
@@ -131,16 +129,6 @@
         data() {
             return {
                 isShowTools: false,
-                publishTypeList: [
-                    {
-                        value: '0',
-                        label:'立即发布'
-                    },
-                    {
-                        value: '1',
-                        label:'定时发布'
-                    }
-                ],
                 publishStatus: false,
                 showBack: false,
                 deleteEvaluationStatus: false,
@@ -149,27 +137,10 @@
                     showScore: true,
                     editable: true
                 },
-                examAnalysisData: {
-                    whole: {},
-                    question: {},
-                    difficult: {},
-                    point: []
-                },
                 jsFn,
                 myDate: [],
                 groupQuestion: {},
                 currentSubjectIndex: 0,
-                ruleValidate: {
-                    name: [
-                        { required: true, message: '评测名称不能为空!', trigger: 'change' }
-                    ],
-                    type: [
-                        { required: true, message: '测试类型不能为空!', trigger: 'change' }
-                    ],
-                    //publish: [
-                    //    { required: true, message: '请选择发布方式!', trigger: 'change' }
-                    //]
-                },
                 currentBraIndex: 0,
                 avtiveEvaluationIndex: 0,
                 evaluationList: [],
@@ -189,16 +160,6 @@
                         label: '普通考'
                     }
                 ],
-                publishList: [
-                    {
-                        value: '0',
-                        label:'立即发布'
-                    },
-                    {
-                        value: '1',
-                        label:'定时发布'
-                    }
-                ],
                 showPaperInfo: {},
                 startTime: '',
                 isLoading: true,
@@ -207,17 +168,30 @@
         },
         methods: {
             getPeriod(data) {
-                console.log(data)
+                if (data == undefined) {
+                    this.filterPeriodName = '全部'
+                } else {
+                    this.filterPeriodName = this.getPeriodLabel(data)
+                    console.log(this.evaluationList)
+                }
             },
 
             /**获取type对应的label */
             getTypeLabel(code) {
-                for (let item of this.evaType) {
+                for (let item of this.evaType ) {
                     if (item.value == code) {
                         return item.label
                     }
                 }
             },
+            //获取对应数据
+            getPeriodLabel(code) {
+                for (let item of this.$store.state.user.schoolProfile.school_base.period) {
+                    if (item.id == code) {
+                        return item.name
+                    }
+                }
+            },
             /**
              * 查找班级课程下的班级
              * */
@@ -321,136 +295,6 @@
                 this.handleAnalysisData()
                 
             },
-            /**
-             * 处理试卷分析数据
-             */
-            handleAnalysisData() {
-                //计算试卷整体分析数据
-                let exmaData = this.getWholeAnalysis()
-                this.examAnalysisData.whole = {}
-                this.$set(this.examAnalysisData.whole, 'score', this.examPaperList[this.currentSubjectIndex].score)
-                this.examAnalysisData.whole.subjectiveScore = exmaData.subjectiveScore
-                this.examAnalysisData.whole.objectiveScore = exmaData.objectiveScore
-                this.examAnalysisData.whole.subjectiveNum = exmaData.subjectiveNum
-                this.examAnalysisData.whole.objectiveNum = exmaData.objectiveNum
-                this.examAnalysisData.whole.subjectiveScoreP = exmaData.subjectiveScoreP
-                this.examAnalysisData.whole.objectiveScoreP = exmaData.objectiveScoreP
-                this.examAnalysisData.whole.subjectiveNumP = exmaData.subjectiveNumP
-                this.examAnalysisData.whole.objectiveNumP = exmaData.objectiveNumP
-                //计算试卷题型分布数据
-                this.examAnalysisData.question = this.getQuestionType()
-                //计算试卷难度数据
-                this.examAnalysisData.difficult = this.getQuestionDiff()
-                //计算知识点分析
-                this.examAnalysisData.point = this.getPointData()
-            },
-            getWholeAnalysis() {
-                let subjectiveScore = 0
-                let objectiveScore = 0
-                let subjectiveNum = 0
-                let objectiveNum = 0
-                let subjectiveScoreP = 0
-                let objectiveScoreP = 0
-                let subjectiveNumP = 0
-                let objectiveNumP = 0
-                for (let key in this.groupQuestion) {
-                    if (key == 'Complete' || key == 'Subjective' || key == 'Compose') {
-                        subjectiveNum += this.groupQuestion[key].length
-                        subjectiveScore += this.groupQuestion[key].reduce((total, item) => total + item.score, 0)
-                    } else {
-                        objectiveNum += this.groupQuestion[key].length
-                        objectiveScore += this.groupQuestion[key].reduce((total, item) => total + item.score, 0)
-                    }
-                }
-                subjectiveScoreP = ((subjectiveScore + objectiveScore) == 0 ? 0 : subjectiveScore * 100 / (subjectiveScore + objectiveScore)).toFixed(1)
-                objectiveScoreP = (subjectiveScore + objectiveScore) == 0 ? 0 : objectiveScore == 0 ? 0 : 100 - subjectiveScoreP
-                subjectiveNumP = ((subjectiveNum + objectiveNum) == 0 ? 0 : subjectiveNum * 100 / (subjectiveNum + objectiveNum)).toFixed(1)
-                objectiveNumP = (subjectiveNum + objectiveNum) == 0 ? 0 : objectiveNum == 0 ? 0 : 100 - subjectiveNumP
-
-                return { subjectiveScore, objectiveScore, subjectiveNum, objectiveNum, subjectiveScoreP, objectiveScoreP, subjectiveNumP, objectiveNumP }
-            },
-            getQuestionType() {
-                let data = {}
-                for (let key in this.groupQuestion) {
-                    data[key] = {}
-                    data[key]['count'] = this.groupQuestion[key].length
-                    data[key]['countPercent'] = (this.groupQuestion[key].length * 100 / this.examPaperList[this.currentSubjectIndex].item.length).toFixed(1)
-                    data[key]['score'] = this.groupQuestion[key].reduce((total, item) => total + item.score, 0)
-                    data[key]['scorePercent'] = (data[key]['score'] * 100 / this.examPaperList[this.currentSubjectIndex].score).toFixed(1)
-                }
-                return data
-            },
-            getQuestionDiff() {
-                let count = []
-                let score = []
-                let group = jsFn.groupBy(this.examPaperList[this.currentSubjectIndex].item, 'level')
-                for (let item of group) {
-                    count.push(
-                        {
-                            value: item.length,
-                            name: this.getDiffLabel(item[0].level)
-                        }
-                    )
-                    score.push(
-                        {
-                            value: item.reduce((total, i) => total + i.score, 0),
-                            name: this.getDiffLabel(item[0].level)
-                        }
-                    )
-                }
-                return { count, score }
-            },
-            getDiffLabel(level) {
-                switch (level) {
-                    case 1:
-                        return '容易'
-                        break
-                    case 2:
-                        return '较易'
-                        break
-                    case 3:
-                        return '一般'
-                        break
-                    case 4:
-                        return '较难'
-                        break
-                    case 5:
-                        return '困难'
-                        break
-                }
-            },
-            getPointData() {
-                let data = {}
-                let str = ''
-                for (let i = 0; i < this.examPaperList[this.currentSubjectIndex].item.length; i++) {
-                    if (this.examPaperList[this.currentSubjectIndex].item[i].points.length > 0) {
-                        let avgScore = parseInt((this.examPaperList[this.currentSubjectIndex].item[i].score / this.examPaperList[this.currentSubjectIndex].item[i].points.length).toFixed(0))
-                        for (let j = 0; j < this.examPaperList[this.currentSubjectIndex].item[i].points.length; j++) {
-                            if (str.indexOf(this.examPaperList[this.currentSubjectIndex].item[i].points[j]) == -1) {
-                                str += this.examPaperList[this.currentSubjectIndex].item[i].points[j]
-                                data[this.examPaperList[this.currentSubjectIndex].item[i].points[j]] = {
-                                    questionIndex: [i + 1],
-                                    score: avgScore
-                                }
-                            } else {
-                                data[this.examPaperList[this.currentSubjectIndex].item[i].points[j]].questionIndex.push(i + 1)
-                                data[this.examPaperList[this.currentSubjectIndex].item[i].points[j]].score += avgScore
-                            }
-                        }
-                    }
-                }
-                let tableData = []
-                for (let key in data) {
-                    tableData.push(
-                        {
-                            point: key,
-                            score: data[key].score,
-                            questionIndex: data[key].questionIndex
-                        }
-                    )
-                }
-                return tableData
-            },
             confirmEdit() {
                 let evaluationInfo = this.evaluationList[this.avtiveEvaluationIndex]
                 evaluationInfo.testPaper = this.examPaperList
@@ -549,6 +393,7 @@
                     })
             },
             async getPaperData(dataInfo) {
+                console.log(dataInfo)
                 this.examPaperList = []
                 for (let i = 0; i < dataInfo.papers.length; i++) {
                     let resData = {}
@@ -557,6 +402,7 @@
                     resData.class = dataInfo.targetClassIds
                     resData.code = dataInfo.code
                     resData.id = dataInfo.id
+                    resData.grade = dataInfo.grades
                     resData.papers = await this.$evTools.getFullPaper(dataInfo.papers[i])
                     this.examPaperList.push(resData)
                 }

+ 3 - 3
TEAMModelOS/ClientApp/src/view/learnactivity/ManageRecord.vue

@@ -86,9 +86,9 @@
     import Analyse from '@/components/learnactivity/AnalyseChart.vue'
     import PassBar from '../selfstudy/PassBar.vue'
     import ProgressBar from '../selfstudy/ProgressBar.vue'
-    import BaseVoteTable from '@/components/learnactivity/BaseVoteTable'
-    import BaseVoteSsTable from '@/components/learnactivity/BaseVoteSsTable'
-    import BaseHwTable from '@/components/learnactivity/BaseHwTable'
+    import BaseVoteTable from '@/components/vote/BaseVoteTable'
+    import BaseVoteSsTable from '@/components/vote/BaseVoteSsTable'
+    import BaseHwTable from '@/components/homework/BaseHwTable'
     import BaseQuestionnaire from '@/components/questionnaire/BaseQuestionnaire'
     import Table from '@/components/learnactivity/GradeTable'
     export default {

+ 3 - 6
TEAMModelOS/ClientApp/src/view/learnactivity/ManualCreate.vue

@@ -187,7 +187,6 @@
             }
         },
         mounted() {
-			console.log(this.subjectId)
             //this.getResultCount()
             this.queryQuestionByPage()
             this.schoolPeriod = this.$store.state.schoolBaseInfo.schoolBaseInfo.period
@@ -198,12 +197,10 @@
             //    this.groupList[groupResult[i][0].exercise.type] = groupResult[i].length
             //}
 
-
+			this.$EventBus.$off('onPaperItemChange')
             this.$EventBus.$on('onPaperItemChange', data => {
-                console.log(data)
                 this.shoppingQuestionList = JSON.parse(JSON.stringify(data))
                 let groupResult = this.$jsFn.groupBy(data, 'type')
-                console.log(groupResult)
                 this.groupList = { ...this.groupQuestion }
                 for (let i = 0; i < groupResult.length; i++) {
                     this.groupList[groupResult[i][0].type] = groupResult[i].length
@@ -246,8 +243,8 @@
              * @param field:字段名
              */
             getCurrentPageData(pageNum) {
-                console.log(this.pageNum)
-                console.log(this.pageSize)
+                //console.log(this.pageNum)
+                //console.log(this.pageSize)
                 //this.queryQuestionByPage()
             },
             /**

+ 61 - 47
TEAMModelOS/ClientApp/src/view/learnactivity/selectTree.vue

@@ -3,23 +3,23 @@
         <div tabindex="0" class="ivu-select-selection ivu-form-item-content">
             <div @mouseover="mouseover" @mouseleave="mouseleave">
                 <div @click="clickInputShow">
-                    <div v-if="multiple" class="ivu-tag ivu-tag-checked" v-for="(item, index) in multipleShowVal" :key="item">
-                        <span class="ivu-tag-text">{{ item }}</span>
+                    <div v-if="multiple" style="margin-left:5px" class="ivu-tag ivu-tag-checked" v-for="(item, index) in multipleShowVal" :key="item">
+                        <span  class="ivu-tag-text">{{ item }}</span>
                         <i class="ivu-icon ivu-icon-ios-close" @click.stop="removeVal(index)"></i>
                     </div>
                     <span v-if="!multiple && queryVal != ''" class="ivu-select-selected-value">{{ queryVal }}</span>
-                    <span v-if="multipleHideVal.length === 0 && multiple" class="ivu-select-placeholder" style="">请选择</span>
-                    <span v-if="value === '' && !multiple" class="ivu-select-placeholder" style="">请选择</span>
+                    <span v-if="multipleHideVal.length === 0 && multiple" class="ivu-select-placeholder" style="color: #c5c8ce">请选择施测对象</span>
+                    <span v-if="value === '' && !multiple" class="ivu-select-placeholder" style="">请选择施测对象</span>
                     <span class="" style="display: none"></span>
                 </div>
                 <i :class="'ivu-icon ivu-icon-' + iconVal + ' ivu-select-arrow'" @click="clickIcon"></i>
             </div>
             <div v-show="showTree" class="ivu-select-dropdown" style="max-height:200px;overflow-y:scroll;z-index:9999;width:100%; ">
-                <div style="width: 95%; margin-left: 10px" v-show="showQuery">
-                    <Input v-model="queryTreeVal" placeholder="请输入筛选条件" @on-change="selectTreeChange" />
+                <div class="tree-box" v-show="showQuery">
+                    <Input v-model="queryTreeVal" clearable placeholder="请输入筛选条件" @on-change="selectTreeChange" />
                 </div>
-                <div style="width: 95%; margin-left: 10px">
-                    <Tree :data="queryData" :multiple="multiple" ref="tree" @on-select-change="selectChange"></Tree>
+                <div class="tree-box">
+                    <Tree :data="queryData":multiple="multiple" ref="tree" @on-select-change="selectChange"></Tree>
                 </div>
             </div>
         </div>
@@ -214,7 +214,6 @@ export default {
       if (this.multiple) {
         this.multipleShowVal = [];
         this.multipleHideVal = [];
-        let grade = [];
         for (let item of obj) {
           if (item.type == undefined) {
             if (item.children) {
@@ -226,12 +225,9 @@ export default {
           if (obj[k].grade == undefined) {
             obj.splice(k, 1);
             k--; //
-          }else if(obj[k].selected == undefined){
-              obj[k].selected =true
           }
-        }
+          }
         obj = this.unique(obj);
-        console.log(obj)
         for (let i = 0; i < obj.length; i++) {
           this.multipleShowVal.push(obj[i].title);
           this.multipleHideVal.push(obj[i].value);
@@ -258,7 +254,10 @@ export default {
       this.$emit("on-select-change", hideVal, showVal);
     },
     // 点击图标的时候展示树形菜单
-    clickInputShow() {
+      clickInputShow() {
+          if (this.treeData.length == 0) {
+              this.$Message.warning('请先选择评量学段!')
+          }
       if (this.disabled) {
         this.showSelectTree();
       }
@@ -319,43 +318,47 @@ export default {
       }
     },
     // 验证当前下拉
-    checkValueType() {
+      checkValueType() {
       if (typeof this.value !== "string") {
         this.valueType = "array";
       }
     },
-    initQueryMultiple() {
-      for (let i = 0; i < this.value.length; i++) {
-        for (let j = 0; j < this.cloneData.length; j++) {
-          if (this.cloneData[j].value === this.value[i]) {
-            this.multipleShowVal.push(this.cloneData[j].title);
-            this.multipleHideVal.push(this.cloneData[j].value);
-            this.$emit("input", this.multipleHideVal);
-            this.cloneData[j].selected = true;
-            break;
-          } else if (this.cloneData[j].children !== undefined) {
-            this.recursionQueryTreeData(
-              this.cloneData[j].children,
-              this.value[i]
-            );
+      initQueryMultiple() {
+          if (this.value) {
+              for (let i = 0; i < this.value.length; i++) {
+                  for (let j = 0; j < this.cloneData.length; j++) {
+                      if (this.cloneData[j].value === this.value[i]) {
+                          this.multipleShowVal.push(this.cloneData[j].title);
+                          this.multipleHideVal.push(this.cloneData[j].value);
+                          this.$emit("input", this.multipleHideVal);
+                          this.cloneData[j].selected = true;
+                          break;
+                      } else if (this.cloneData[j].children !== undefined) {
+                          this.recursionQueryTreeData(
+                              this.cloneData[j].children,
+                              this.value[i]
+                          );
+                      }
+                  }
+              }
           }
-        }
-      }
-    },
-    initQueryVal() {
-      this.$emit("input", "");
-      for (let i = 0; i < this.cloneData.length; i++) {
-        if (this.cloneData[i].value === this.value) {
-          this.hideValue = this.cloneData[i].value;
-          this.queryVal = this.cloneData[i].title;
-          this.$emit("input", this.cloneData[i].value);
-          this.cloneData[i].selected = true;
-          return;
-        } else if (this.cloneData[i].children !== undefined) {
-          this.recursionQueryTreeData(this.cloneData[i].children, this.value);
-        }
-      }
-    },
+      },
+      initQueryVal() {
+          this.$emit("input", "");
+          if (this.cloneData.length) {
+              for (let i = 0; i < this.cloneData.length; i++) {
+                  if (this.cloneData[i].value === this.value) {
+                      this.hideValue = this.cloneData[i].value;
+                      this.queryVal = this.cloneData[i].title;
+                      this.$emit("input", this.cloneData[i].value);
+                      this.cloneData[i].selected = true;
+                      return;
+                  } else if (this.cloneData[i].children !== undefined) {
+                      this.recursionQueryTreeData(this.cloneData[i].children, this.value);
+                  }
+              }
+          }
+      },
     recursionQueryTreeData(data, val) {
       for (let i = 0; i < data.length; i++) {
         if (data[i].value === val) {
@@ -455,7 +458,7 @@ export default {
         display: block;
         height: 30px;
         line-height: 30px;
-        color: #c5c8ce;
+        /*color: #c5c8ce;*/
         font-size: 14px;
         overflow: hidden;
         text-overflow: ellipsis;
@@ -464,6 +467,17 @@ export default {
         padding-right: 22px;
     }
 
+    .tree-box {
+        width: 95%; 
+        margin-left: 10px;
+        color:#000000;
+    }
+        .tree-box /deep/ .ivu-input {
+            color: #000000;
+        }
+        .tree-box /deep/ .ivu-tree-arrow {
+            color: black;
+        }
     .ivu-select-selected-value {
         display: block;
         height: 30px;

+ 1 - 0
TEAMModelOS/ClientApp/src/view/newcourse/MyCourse.less

@@ -130,4 +130,5 @@
 }
 .action-btn-wrap {
     margin-left:20px;
+    cursor:pointer;
 }

+ 167 - 28
TEAMModelOS/ClientApp/src/view/newcourse/MyCourse.vue

@@ -91,15 +91,15 @@
                 <div class="course-classroom-info-header" style="padding-right:50px;">
                     <span @click="tabName = 'record'" :class="tabName == 'record' ? 'course-classroom-label line-bottom line-bottom-active':'course-classroom-label line-bottom'">课堂记录</span>
                     <span @click="tabName = 'stus'" :class="tabName == 'stus' ? 'course-classroom-label line-bottom line-bottom-active':'course-classroom-label line-bottom'">{{$t('courseManage.classroom.studentList')}}</span>
-                    <div style="float:right;" v-if="listType == 'private' && tabName == 'stus'">
-                        <span class="disable-text-icon action-btn-wrap">
-                            <Icon type="md-add" size="16" />
-                            添加学生
-                        </span>
-                        <span class="disable-text-icon action-btn-wrap">
+                    <div style="float:right;color:white;" v-if="listType == 'private' && tabName == 'stus'">
+                        <span class="action-btn-wrap" @click="delStudents">
                             <Icon type="md-trash" size="16" />
                             删除学生
                         </span>
+                        <span class="action-btn-wrap" @click="addStuStatus = true">
+                            <Icon type="md-add" size="16" />
+                            添加学生
+                        </span>
                         <!--<span class="disable-text-icon action-btn-wrap">
                             <Icon type="md-shuffle" size="16" />
                             自动分组
@@ -112,7 +112,7 @@
                 </div>
                 <div class="course-classroom-info-content dark-iview-table animated fadeIn" v-show="tabName == 'stus'">
                     <vuescroll style="height:100%;">
-                        <Table :columns="studentColumn" :data="students"
+                        <Table :columns="studentColumn" :data="students" @on-selection-change="(selections)=>{delSelection = selections}"
                                :height="tableHeight" class="system-classroom-table" :loading="stuLoading" no-data-text="暂无学生">
                             <Loading slot="loading" bgColor="rgba(103, 103, 103, 0.27)"></Loading>
                             <template slot-scope="{ row ,index}" slot="action">
@@ -160,7 +160,7 @@
         </div>
         <Drawer title="课程信息" class-name="dark-iview-drawer" width="450" :closable="false" v-model="showCusInfo" @on-close="baseEditStatus = true">
             <!--基础信息-->
-            <div class="course-base-info-content dark-iview-form disabled-iview-select dark-wang-editor" >
+            <div class="course-base-info-content dark-iview-form disabled-iview-select dark-wang-editor">
                 <Form ref="courseBaseInfo" label-position="top">
                     <FormItem label="课程名称" prop="name" class="disabled-iview-select">
                         <Input v-if="listType == 'school' && courseListS[curCusIndex]" v-model="courseListS[curCusIndex][0].courseName" :disabled="true" style="width:100%" placeholder="课程名称" :clearable="true"></Input>
@@ -174,7 +174,7 @@
                         <div ref="courseNotice" v-show="!baseEditStatus"></div>
                         <div v-show="baseEditStatus" style="height:fit-content;color:white;font-size:16px;padding-left:10px;width:100%;">
                             <vuescroll>
-                                <div v-if="listType == 'school' && courseListS[curCusIndex] && checkNotice(courseListS[curCusIndex][0].notice)" 
+                                <div v-if="listType == 'school' && courseListS[curCusIndex] && checkNotice(courseListS[curCusIndex][0].notice)"
                                      v-html="courseListS[curCusIndex][0].notice" style=""></div>
                                 <div v-else-if="listType == 'private' && courseListP[curCusIndex] && checkNotice(courseListP[curCusIndex].notice)" v-html="courseListP[curCusIndex].notice" style=""></div>
                                 <div v-else style="">暂无公告!</div>
@@ -245,6 +245,13 @@
                 </FormItem>
             </Form>
         </Modal>
+        <Modal v-model="addStuStatus"
+               title="添加学生"
+               width="1200"
+               @on-ok="confirmAddStu"
+               class-name="dark-iview-modal">
+            <StudentList @getSelectInfo="(selction)=>{selections = selction}"></StudentList>
+        </Modal>
         <div class="qr-code-wrap" v-show="showQrStatus" @click="showQrStatus = false">
             <div id="qrcode" :class="showQrStatus ? 'animated fadeIn':'animated fadeOut'" ref="qrcode" style="padding:20px;background-color:white;width:320px;margin:auto;"></div>
         </div>
@@ -253,8 +260,10 @@
 <script>
     import QRCode from 'qrcodejs2'
     import E from '@/utils/wangEditor.js'
+    import StudentList from '@/components/coursemgt/StudentList.vue'
     export default {
         components: {
+            StudentList
         },
         data() {
             // 验证只能是字母和数字
@@ -270,6 +279,8 @@
                 }
             }
             return {
+                delSelection:[],
+                selections:[],
                 schoolClassList:[],
                 tableHeight:100,
                 studentColumn: [
@@ -284,24 +295,27 @@
                         key: 'name',
                         align: 'left '
                     },
+                    {
+                        title: '账号',
+                        key: 'id',
+                        align: 'center',
+                        sortable: true
+                    },
                     {
                         title: this.$t('courseManage.classroom.studentTableC1'),
                         key: 'no',
-                        //width: 140,
                         align: 'center',
                         sortable: true
                     },
                     {
                         title: this.$t('courseManage.classroom.studentTableC5'),
                         slot: 'groupId',
-                        //width: 150,
                         align: 'center',
                         sortable: true
                     },
                     {
                         title: this.$t('courseManage.classroom.studentTableC6'),
                         slot: 'groupName',
-                        //width: 150,
                         align: 'center'
                     }
                 ],
@@ -317,7 +331,7 @@
                 listType: 'school',
                 tabName: 'record',
                 addCusStatus: false,
-                delCusStatus: false,
+                addStuStatus: false,
                 joinQRcode: undefined,
                 curCusIndex: 0,
                 curClassIndex: 0,
@@ -347,19 +361,125 @@
             }
         },
         methods: {
+            //删除学生
+            delStudents() {
+                if (this.delSelection.length > 0) {
+                    let names = this.delSelection.map(item => {
+                        return item.name
+                    })
+                    this.$Modal.confirm({
+                        title: '删除学生',
+                        content: `确认删除${names.join(', ')}共${names.length}名学生吗?`,
+                        onOk: () => {
+                            this.listLoading = true
+                            this.delSelection.forEach(item => {
+                                let index = this.courseListP[this.curCusIndex].classes[this.curClassIndex].students.findIndex(stu => {
+                                    return stu.id == item.id
+                                })
+                                this.courseListP[this.curCusIndex].classes[this.curClassIndex].students.splice(index,1)
+                            })
+                            this.$api.courseMgmt.upsertPrivateCus({
+                                course: this.courseListP[this.curCusIndex],
+                                option: 'update'
+                            }).then(
+                                (res) => {
+                                    if (!res.error) {
+                                        this.selections.length = 0
+                                        this.$Message.success('删除成功!')
+                                    } else {
+                                        this.$Message.error('删除失败!')
+                                    }
+                                },
+                                (err) => {
+                                    this.$Message.error('删除失败!')
+                                }
+                            ).finally(() => {
+                                this.listLoading = false
+                                this.baseEditStatus = !this.baseEditStatus
+                            })
+                        }
+                    })
+                } else {
+                    this.$Message.warning('请先选择需要删除的学生!')
+                }
+                
+            },
+            //确认添加学生
+            confirmAddStu() {
+                if (this.selections.length > 0) {
+                    if (!this.courseListP[this.curCusIndex].classes[this.curClassIndex].students) {
+                        this.$set(this.courseListP[this.curCusIndex].classes[this.curClassIndex], 'students', [])
+                    }
+                    let stuIds = this.courseListP[this.curCusIndex].classes[this.curClassIndex].students.map(item => {
+                        return item.id
+                    })
+                    if (stuIds.length > 0) {
+                        //如果已经有学生,根据账号去重
+                        let hasRepeat = false
+                        this.selections.forEach(item => {
+                            if (stuIds.indexOf(item.id) == -1) {
+                                this.courseListP[this.curCusIndex].classes[this.curClassIndex].students.push({
+                                    id: item.id,
+                                    name: item.name,
+                                    no: item.no
+                                })
+                            } else {
+                                hasRepeat = true
+                            }
+                        })
+                        if (hasRepeat) {
+                            //this.$Message.warning('已经自动帮您去掉账号重复的学生!')
+                        }
+                    } else {
+                        let stus = this.selections.map(item => {
+                            return {
+                                id: item.id,
+                                name: item.name,
+                                no: item.no
+                            }
+                        })
+                        this.courseListP[this.curCusIndex].classes[this.curClassIndex].students.push(...stus)
+                    }
+                    //保存操作
+                    this.listLoading = true
+                    this.$api.courseMgmt.upsertPrivateCus({
+                        course: this.courseListP[this.curCusIndex],
+                        option: 'update'
+                    }).then(
+                        (res) => {
+                            if (!res.error) {
+                                this.selections.length = 0
+                                this.$Message.success('添加成功!')
+                            } else {
+                                this.$Message.error('添加失败!')
+                            }
+                        },
+                        (err) => {
+                            this.$Message.error('添加失败!')
+                        }
+                    ).finally(() => {
+                        this.listLoading = false
+                        this.baseEditStatus = !this.baseEditStatus
+                    })
+                }
+            },
             //查询班级学生名单
             findClassStu() {
                 this.stuLoading = true
                 let params = {
                     'school_code': this.$store.state.userInfo.schoolCode,
-                    //'teacher.id': this.$store.state.userInfo.TEAMModelId,
-                    'id': this.courseListS[this.curCusIndex][this.curClassIndex].id
+                    'id': this.classList[this.curClassIndex].id
                 }
                 this.$api.schoolSetting.getClassroomStudent(params).then(
                     (res) => {
                         if (!res.error) {
                             if (res.classrooms.length > 0) {
-                                this.$set(this.courseListS[this.curCusIndex][this.curClassIndex], 'students', res.classrooms[0].students)
+                                if (this.listType == 'school') {
+                                    this.$set(this.courseListS[this.curCusIndex][this.curClassIndex], 'students', res.classrooms[0].students)
+                                }
+                                //else {
+                                //    this.$set(this.courseListP[this.curCusIndex].classes[this.curClassIndex], 'students', res.classrooms[0].students)
+                                //}
                             }
                         } else {
                             this.$Message.error('API error!')
@@ -439,7 +559,7 @@
                 this.toggleCusInfo()
                 this.edNotice()
             },
-            //保存个人课程公告
+            //保存个人课程
             saveNotice() {
                 this.listLoading = true
                 this.$api.courseMgmt.upsertPrivateCus({
@@ -548,8 +668,9 @@
             addClassroom(value) {
                 if (value == 0) {
                     //直接读取登录成功拿到得学校基础信息
-                    this.schoolClassList = JSON.parse(JSON.stringify(this.$store.state.user.schoolProfile.school_classes))
-                    //this.$store.dispatch('schoolBaseInfo/getClassroom')
+                    this.$store.dispatch('user/getSchoolProfile').then(res => {
+                        this.schoolClassList = res.school_classes
+                    })
                     this.selectClassStatus = true
                 } else if (value == 1) {
                     let randomCode = 'P'
@@ -591,20 +712,38 @@
                     return item.id == this.sysClass.id
                 })
                 if (curClass.length > 0) {
-                    this.courseListP[this.curCusIndex].classes.push(curClass[0])
-                    this.$api.courseMgmt.upsertPrivateCus({
-                        course: this.courseListP[this.curCusIndex],
-                        option: 'update'
-                    }).then(
+                    let params = {
+                        'school_code': this.$store.state.userInfo.schoolCode,
+                        'id': this.sysClass.id
+                    }
+                    this.$api.schoolSetting.getClassroomStudent(params).then(
                         (res) => {
                             if (!res.error) {
-                                this.$Message.success('上课班级添加成功!')
+                                if (res.classrooms.length > 0) {
+                                    curClass[0].students = res.classrooms[0].students
+                                    this.courseListP[this.curCusIndex].classes.push(curClass[0])
+                                    this.$api.courseMgmt.upsertPrivateCus({
+                                        course: this.courseListP[this.curCusIndex],
+                                        option: 'update'
+                                    }).then(
+                                        (res) => {
+                                            if (!res.error) {
+                                                this.$Message.success('上课班级添加成功!')
+                                            } else {
+                                                this.$Message.error('上课班级添加失败!')
+                                            }
+                                        },
+                                        (err) => {
+                                            this.$Message.error('上课班级添加失败!')
+                                        }
+                                    )
+                                }
                             } else {
-                                this.$Message.error('上课班级添加失败!')
+                                this.$Message.error('API error!')
                             }
                         },
                         (err) => {
-                            this.$Message.error('上课班级添加失败!')
+                            this.$Message.error('API error!')
                         }
                     )
                 }
@@ -622,7 +761,7 @@
             },
             changeClassroom(index) {
                 this.curClassIndex = index
-                if (this.classList[index].scope == 'school' && !this.courseListS[this.curCusIndex][this.curClassIndex].students) {
+                if (this.listType == 'school' && !this.courseListS[this.curCusIndex][this.curClassIndex].students) {
                     this.findClassStu()
                 }
             },

+ 1 - 1
TEAMModelOS/ClientApp/src/view/schoolmgmt/SystemSetting/SystemSetting.vue

@@ -850,7 +850,7 @@
             }
         },
         created() {
-            //this.getLocalDefaultData()
+            this.getLocalDefaultData()
             this.initData()
             this.getSchoolBaseData()
             this.getTimeZoneList()

+ 2 - 2
TEAMModelOS/ClientApp/src/view/selfstudy/CreateLearnUnit.vue

@@ -43,8 +43,8 @@
 </template>
 <script>
     import QuestionList from '@/components/learnactivity/QuestionList.vue'
-    import NewChooseContent from '@/components/learnactivity/NewChooseContent.vue'
-    import ContentFileList from '@/components/learnactivity/ContentFileList.vue'
+    import NewChooseContent from '@/components/selflearn/NewChooseContent.vue'
+    import ContentFileList from '@/components/selflearn/ContentFileList.vue'
     export default {
         data() {
             return {

+ 3 - 3
TEAMModelOS/ClientApp/src/view/selfstudy/CreateOrderLearn.vue

@@ -164,9 +164,9 @@
 <script>
     
     import QuestionList from '@/components/learnactivity/QuestionList.vue'
-    import ChooseContent from '@/components/learnactivity/NewChooseContent.vue'
-    import SelectLearnUnit from '@/components/learnactivity/SelectLearnUnit.vue'
-    import ContentFileList from '@/components/learnactivity/ContentFileList.vue'
+    import ChooseContent from '@/components/selflearn/NewChooseContent.vue'
+    import SelectLearnUnit from '@/components/selflearn/SelectLearnUnit.vue'
+    import ContentFileList from '@/components/selflearn/ContentFileList.vue'
     import Loading from '@/common/Loading.vue'
     import { setTimeout } from 'core-js'
     export default {

+ 1 - 1
TEAMModelOS/ClientApp/src/view/selfstudy/OrderLearnInfo.vue

@@ -98,7 +98,7 @@
 </template>
 <script>
     import QuestionList from '@/components/learnactivity/QuestionList.vue'
-    import ContentFileList from '@/components/learnactivity/ContentFileList.vue'
+    import ContentFileList from '@/components/selflearn/ContentFileList.vue'
     
     import Loading from '@/common/Loading.vue'
     export default {

+ 1 - 1
TEAMModelOS/ClientApp/src/view/selfstudy/SelfLearn.vue

@@ -70,7 +70,7 @@
 </template>
 <script>
     import QuestionList from '@/components/learnactivity/QuestionList.vue'
-    import ContentFileList from '@/components/learnactivity/ContentFileList.vue'
+    import ContentFileList from '@/components/selflearn/ContentFileList.vue'
     import OrderLearnList from './OrderLearnList.vue'
     import UnitList from './UnitList.vue'
     import OrderLearnInfo from './OrderLearnInfo.vue'

+ 2 - 4
TEAMModelOS/ClientApp/src/view/selfstudy/UnitInfo.vue

@@ -20,9 +20,7 @@
 </template>
 <script>
     import QuestionList from '@/components/learnactivity/QuestionList.vue'
-    import ContentFileList from '@/components/learnactivity/ContentFileList.vue'
-    
-    import Loading from '@/common/Loading.vue'
+    import ContentFileList from '@/components/selflearn/ContentFileList.vue'
     export default {
         props: {
             unitInfo: {
@@ -42,7 +40,7 @@
             }
         },
         components: {
-            QuestionList, ContentFileList, Loading
+            QuestionList, ContentFileList
         },
         data() {
             return {

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

@@ -416,7 +416,7 @@
             },
             createClassroom() {
                 this.$router.push({
-                    path: '/school/classroom'
+                    path: '/home/classroom'
                 })
             },
             isRepeat(data){

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

@@ -15,11 +15,13 @@
                     <Option v-for="(item,index) in periods" :value="item.id" :key="index">{{ item.name }}</Option>
                 </Select>
                 <!-- 學級Select -->
-                <Select v-model="searchGrade" style="width:120px;margin-left:5px;" :placeholder="$t('stuAccount.gradeHolder')" clearable @on-change="filterData">
+                <Select v-model="searchGrade" style="width:120px;margin-left:5px;" :placeholder="$t('stuAccount.gradeHolder')"
+                         not-found-text="请先选择学段" 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:150px;margin-left:5px;" :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" :not-found-text="searchGrade ? '此年级暂无教室':'请先选择年级'">
                     <Option v-for="(item,index) in filterClasses" :value="item.id" :key="index">{{ item.name }}</Option>
                 </Select>
                 <!-- 字串模糊搜尋 -->
@@ -142,11 +144,9 @@
                 addStudentStatus: false,
                 importStudentStatus: false,
                 authorizationStatus: false,
-                tableData: [],
                 tableShowData: [],
                 tableFilterData: [],
                 tableColumns: [],
-                queryToken:'',
                 basicCount: 99,
                 pointNum: 0,
                 academicYear: new Date().getFullYear()
@@ -395,7 +395,14 @@
                         key: 'id',
                         title: this.$t('stuAccount.account'),
                         align: 'center',
-                        //width: 150
+                        sortable: true,
+                        sortMethod: (a, b, type) => {
+                            if (type == 'asc') {
+                                return a.localeCompare(b)
+                            } else {
+                                return b.localeCompare(a)
+                            }
+                        }
                     },
                     {
                         key: 'name',
@@ -417,19 +424,16 @@
                         key: 'no',
                         title: this.$t('stuAccount.seatNo'),
                         align: 'center',
-                        width: 120
+                        width: 120,
+                        sortable: true,
+                        sortMethod: (a, b, type) => {
+                            if (type == 'desc') {
+                                return parseInt(a) > parseInt(b) ? -1 : 1
+                            } else {
+                                return parseInt(a) < parseInt(b) ? -1 : 1
+                            }
+                        }
                     },
-                    //{
-                    //    slot: 'classId',
-                    //    title: this.$t('stuAccount.classId'),
-                    //    align: 'center'
-                    //},
-                    //{
-                    //    slot: 'periodName',
-                    //    title: this.$t('stuAccount.period'),
-                    //    align: 'center',
-                    //    width: 140
-                    //},
                     {
                         slot: 'status',
                         title: this.$t('stuAccount.authStatus'),
@@ -490,7 +494,9 @@
                     let temp = this.tableFilterData.slice(this.pointNum + 1, this.pointNum + this.basicCount)
                     this.pointNum += this.basicCount
                     if(temp.length == 0){
-                        this.$Message.info(this.$t('已經到底了'))
+                        this.$Message.info('已經到底了')
+                        //多语系后面统一处理
+                        //this.$Message.info(this.$t('已經到底了'))
                     } else {
                         this.tableShowData.push(...temp)
                     }

+ 1 - 1
TEAMModelOS/ClientApp/src/view/student-analysis/total-analysis/AchievementAnalysis/AchievementAnalysis.vue

@@ -171,7 +171,7 @@
                 this.subjectList = this.getAchievementData.average.datas.map(item => item.name)
                 this.passRate = this.getAchievementData.passRate
             }
-
+			this.$EventBus.$off('onExport')
             this.$EventBus.$on("onExport", exportTables => {
                 console.log(exportTables)
                 if (exportTables.indexOf('achievementTable') > -1) {

+ 1 - 1
TEAMModelOS/ClientApp/src/view/student-analysis/total-analysis/ScatterAnalysis/ScatterAnalysis.vue

@@ -142,7 +142,7 @@
             }
         },
         created() {
-
+			this.$EventBus.$off('onExport')
             this.$EventBus.$on("onExport", exportTables => {
                 console.log('收到')
                 console.log(exportTables)

+ 1 - 0
TEAMModelOS/ClientApp/src/view/student-analysis/total-analysis/TestAnalysis/QuestionList.vue

@@ -482,6 +482,7 @@
         },
 
         mounted() {
+			this.$EventBus.$off('onCollapseChange')
 			this.$EventBus.$on('onCollapseChange',val => {
 				// 如果侧边栏展开的时候
 				this.isOpen = !val

+ 1 - 2
TEAMModelOS/ClientApp/src/view/teachcontent/index.vue

@@ -82,7 +82,7 @@
                             <span>{{item}}</span>
                         </Checkbox>
                     </CheckboxGroup>
-                    <span :class="selections.length == 0 ? 'action-btn-wrap disable-text-icon':'action-btn-wrap'" @click="delFileBatch">
+                    <span :class="((rangeType == 0 && $access.can('admin.*|content-school-upd')) || rangeType == 1) ? 'action-btn-wrap' : 'disable-text-icon action-btn-wrap'" @click="delFileBatch">
                         <Icon type="md-trash" class="toggle-btn-icon" />
                         批量删除
                     </span>
@@ -548,7 +548,6 @@
                             })
                         }
                     })
-                    
                 }
             },
             /**

+ 5 - 5
TEAMModelOS/ClientApp/src/view/vote/ManageVote.vue

@@ -85,11 +85,11 @@
 	</div>
 </template>
 <script>
-	import BaseVoteForm from '@/components/learnactivity/BaseVoteForm'
-	import BaseVoteTable from '@/components/learnactivity/BaseVoteTable'
-	import BaseVoteSsTable from '@/components/learnactivity/BaseVoteSsTable'
-	import BaseVotePie from '@/components/learnactivity/BaseVotePie'
-	import BaseVoteBar from '@/components/learnactivity/BaseVoteBar'
+	import BaseVoteForm from '@/components/vote/BaseVoteForm'
+	import BaseVoteTable from '@/components/vote/BaseVoteTable'
+	import BaseVoteSsTable from '@/components/vote/BaseVoteSsTable'
+	import BaseVotePie from '@/components/vote/BaseVotePie'
+	import BaseVoteBar from '@/components/vote/BaseVoteBar'
 	export default {
 		components: {
 			BaseVoteForm,

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

@@ -186,7 +186,7 @@ namespace TEAMModelOS.Controllers
             //var id = jwt.Payload.Sub;
             var client = _azureCosmos.GetCosmosClient();
             List<ExamInfo> examInfo = new List<ExamInfo>();
-            var query = $"select c.id,c.name,c.code,c.startTime,c.stuCount,c.type,c.progress,c.examType from c ";
+            var query = $"select c.id,c.name,c.code,c.period,c.startTime,c.stuCount,c.type,c.progress,c.examType from c ";
             await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIterator(queryText: query, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Exam-{school_code}") }))
                 {
                     using var json = await JsonDocument.ParseAsync(item.ContentStream);

+ 13 - 9
TEAMModelOS/Controllers/School/ClassRoomController.cs

@@ -247,10 +247,10 @@ namespace TEAMModelOS.Controllers
         {
             //ResponseBuilder builder = ResponseBuilder.custom();
             if (!requert.TryGetProperty("school_code", out JsonElement school_code)) return BadRequest();
+            //if (!requert.TryGetProperty("scope", out JsonElement scope)) return BadRequest();
             var client = _azureCosmos.GetCosmosClient();
             List<object> classrooms = new List<object>();
             StringBuilder sql = new StringBuilder();
-            sql.Append("select c.name,c.id,c.students,c.code from c ");
             Dictionary<string, object> dict = new Dictionary<string, object>();
             var emobj = requert.EnumerateObject();
             while (emobj.MoveNext())
@@ -262,18 +262,22 @@ namespace TEAMModelOS.Controllers
             {
                 dict.Remove("school_code");
             }
-            AzureCosmosQuery cosmosDbQuery = SQLHelper.GetSQL(dict, sql);
-            await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIterator(queryDefinition: cosmosDbQuery.CosmosQueryDefinition, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Class-{school_code}") }))
-            {
-                using var json = await JsonDocument.ParseAsync(item.ContentStream);
-                if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
+           
+                sql.Append("select c.name,c.id,c.students,c.code from c ");               
+                AzureCosmosQuery cosmosDbQuery = SQLHelper.GetSQL(dict, sql);
+                await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIterator(queryDefinition: cosmosDbQuery.CosmosQueryDefinition, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Class-{school_code}") }))
                 {
-                    foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
+                    using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                    if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
                     {
-                        classrooms.Add(obj.ToObject<object>());
+                        foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
+                        {
+                            classrooms.Add(obj.ToObject<object>());
+                        }
                     }
                 }
-            }
+            
+             
             return Ok(new { classrooms });
             /*List<Classroom> sc = await _azureCosmos.FindByDict<Classroom>(request);
             return builder.Data(sc).build();*/

+ 1 - 1
TEAMModelOS/Controllers/School/CourseController.cs

@@ -680,7 +680,7 @@ namespace TEAMModelOS.Controllers
                 }
                 else
                 {
-                    course = await _azureCosmos.GetCosmosClient().GetContainer("TEAMModelOS", "Teacher").UpsertItemAsync(course, new PartitionKey($"{course.code}"));
+                    course = await _azureCosmos.GetCosmosClient().GetContainer("TEAMModelOS", "Teacher").ReplaceItemAsync(course,course.id, new PartitionKey($"{course.code}"));
                 }
                 return Ok(new { course });
             }

+ 2 - 1
TEAMModelOS/Models/TeacherInfo/TeacherCourse.cs

@@ -1,4 +1,4 @@
-using System;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Threading.Tasks;
@@ -28,5 +28,6 @@ namespace TEAMModelOS.Models.TeacherInfo
         public string scope { get; set; }
         public string code { get; set; }
         public Teachers teacher { get; set; }
+        public List<StudentSimple> students { get; set; }
     }
 }