Explorar el Código

Merge branch 'develop6.0-tmd' of http://52.130.252.100:10000/TEAMMODEL/TEAMModelOS into develop6.0-tmd

zhouj1203@hotmail.com hace 3 años
padre
commit
a2773a91c1
Se han modificado 44 ficheros con 1008 adiciones y 367 borrados
  1. 55 9
      TEAMModelAPI/Controllers/School/CourseController.cs
  2. 3 0
      TEAMModelBI/Controllers/BISchool/RoomController.cs
  3. 1 1
      TEAMModelOS.FunctionV4/CosmosDB/TriggerCorrect.cs
  4. 1 1
      TEAMModelOS.FunctionV4/CosmosDB/TriggerExam.cs
  5. 1 1
      TEAMModelOS.FunctionV4/CosmosDB/TriggerExamLite.cs
  6. 1 1
      TEAMModelOS.FunctionV4/CosmosDB/TriggerHomework.cs
  7. 1 1
      TEAMModelOS.FunctionV4/CosmosDB/TriggerStudy.cs
  8. 1 1
      TEAMModelOS.FunctionV4/CosmosDB/TriggerSurvey.cs
  9. 1 1
      TEAMModelOS.FunctionV4/CosmosDB/TriggerVote.cs
  10. 7 7
      TEAMModelOS.FunctionV4/ServiceBus/ActiveTaskTopic.cs
  11. 1 39
      TEAMModelOS/ClientApp/src/access/index.js
  12. 102 99
      TEAMModelOS/ClientApp/src/access/login.js
  13. 5 0
      TEAMModelOS/ClientApp/src/api/learnActivity.js
  14. 14 0
      TEAMModelOS/ClientApp/src/assets/student-web/component_styles/quesnaire.less
  15. 4 0
      TEAMModelOS/ClientApp/src/components/homework/BaseHwForm.vue
  16. 1 1
      TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContent.vue
  17. 51 26
      TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContentTypeTemplate/QuesNaire.vue
  18. 7 0
      TEAMModelOS/ClientApp/src/locale/lang/en-US/homework.js
  19. 2 2
      TEAMModelOS/ClientApp/src/locale/lang/en-US/studentWeb.js
  20. 2 1
      TEAMModelOS/ClientApp/src/locale/lang/en-US/survey.js
  21. 4 0
      TEAMModelOS/ClientApp/src/locale/lang/en-US/syllabus.js
  22. 7 0
      TEAMModelOS/ClientApp/src/locale/lang/zh-CN/homework.js
  23. 3 2
      TEAMModelOS/ClientApp/src/locale/lang/zh-CN/studentWeb.js
  24. 2 1
      TEAMModelOS/ClientApp/src/locale/lang/zh-CN/survey.js
  25. 3 1
      TEAMModelOS/ClientApp/src/locale/lang/zh-CN/syllabus.js
  26. 1 1
      TEAMModelOS/ClientApp/src/locale/lang/zh-CN/vote.js
  27. 7 0
      TEAMModelOS/ClientApp/src/locale/lang/zh-TW/homework.js
  28. 2 2
      TEAMModelOS/ClientApp/src/locale/lang/zh-TW/studentWeb.js
  29. 2 1
      TEAMModelOS/ClientApp/src/locale/lang/zh-TW/survey.js
  30. 3 1
      TEAMModelOS/ClientApp/src/locale/lang/zh-TW/syllabus.js
  31. 1 1
      TEAMModelOS/ClientApp/src/locale/lang/zh-TW/vote.js
  32. 6 2
      TEAMModelOS/ClientApp/src/store/module/user.js
  33. 159 6
      TEAMModelOS/ClientApp/src/view/homework/ManageHomeWork.vue
  34. 2 1
      TEAMModelOS/ClientApp/src/view/learnactivity/MgtSchoolEva.vue
  35. 16 20
      TEAMModelOS/ClientApp/src/view/login/Index.vue
  36. 12 5
      TEAMModelOS/ClientApp/src/view/login/page/Student.vue
  37. 32 22
      TEAMModelOS/ClientApp/src/view/login/page/Teacher.vue
  38. 43 21
      TEAMModelOS/ClientApp/src/view/questionnaire/ManageQuestionnaire.less
  39. 158 9
      TEAMModelOS/ClientApp/src/view/questionnaire/ManageQuestionnaire.vue
  40. 8 3
      TEAMModelOS/ClientApp/src/view/shareSyllabus/ShareSyllabus.vue
  41. 16 25
      TEAMModelOS/ClientApp/src/view/sso/Index.vue
  42. 26 9
      TEAMModelOS/ClientApp/src/view/vote/ManageVote.less
  43. 233 42
      TEAMModelOS/ClientApp/src/view/vote/ManageVote.vue
  44. 1 1
      TEAMModelOS/Controllers/Teacher/TeacherCommonController.cs

+ 55 - 9
TEAMModelAPI/Controllers/School/CourseController.cs

@@ -75,11 +75,11 @@ namespace TEAMModelAPI.Controllers
                 return Ok(new { error = 1, msg = "学段不存在!" });
             }
         }
-       
+
 
         [ProducesDefaultResponseType]
         [HttpPost("upsert-course-info")]
-        [ApiToken(Auth = "1302", Name = "课程详细信息", RW = "R", Limit = false)]
+        [ApiToken(Auth = "1302", Name = "课程详细信息", RW = "W", Limit = false)]
         public async Task<IActionResult> UpsertCourseInfo(JsonElement json)
         {
             var (id, school) = HttpContext.GetApiTokenInfo();
@@ -102,19 +102,53 @@ namespace TEAMModelAPI.Controllers
                                 id = Guid.NewGuid().ToString(),
                                 code = $"Course-{school}",
                                 name = courseDto.name,
-                                subject = new SubjectSimple { id = subject.id, name = subject.name  },
-                                period= new PeriodSimple { id = period.id, name = period.name },
-
+                                subject = new SubjectSimple { id = subject.id, name = subject.name },
+                                period = new PeriodSimple { id = period.id, name = period.name },
+                                school = school,
+                                desc = courseDto.desc,
+                                scope = "school",
+                                no = courseDto.no,
                             };
+                            await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.School).CreateItemAsync(course, new PartitionKey(course.code));
                         }
                         else
                         {
-
+                            Azure.Response response = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync($"{course.id}", new PartitionKey($"Course-{school}"));
+                            if (response.Status == 200)
+                            {
+                                JsonDocument jsonDocument = JsonDocument.Parse(response.Content);
+                                course = jsonDocument.RootElement.ToObject<Course>();
+                                course.pk = "Course";
+                                course.name = string.IsNullOrWhiteSpace(courseDto.name) ? course.name : courseDto.name;
+                                course.subject = new SubjectSimple { id = subject.id, name = subject.name };
+                                course.period = new PeriodSimple { id = period.id, name = period.name };
+                                course.school = school;
+                                course.desc = string.IsNullOrWhiteSpace(courseDto.desc) ? course.desc : courseDto.desc;
+                                course.scope = "school";
+                                course.no = string.IsNullOrWhiteSpace(courseDto.no) ? course.no : courseDto.no;
+                                await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.School).CreateItemAsync(course, new PartitionKey(course.code));
+                            }
+                            else {
+                                course = new Course
+                                {
+                                    pk = "Course",
+                                    id = Guid.NewGuid().ToString(),
+                                    code = $"Course-{school}",
+                                    name = courseDto.name,
+                                    subject = new SubjectSimple { id = subject.id, name = subject.name },
+                                    period = new PeriodSimple { id = period.id, name = period.name },
+                                    school = school,
+                                    desc = courseDto.desc,
+                                    scope = "school",
+                                    no = courseDto.no,
+                                };
+                                await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.School).CreateItemAsync(course, new PartitionKey(course.code));
+                            }
                         }
-                        return Ok(new { period.subjects, period.timetable, period.grades, period.majors });
+                        return Ok(new { period.subjects, period.timetable, course = course });
                     }
                     else {
-                        return Ok(new { error = 2, msg = "科目不存在!" });
+                        return Ok(new { error =4, msg = "科目不存在!" });
                     }
                 }
                 else
@@ -126,8 +160,20 @@ namespace TEAMModelAPI.Controllers
             {
                 return Ok(new { error = 3, msg = courseDto.Valid() });
             }
-            
         }
+
+        [ProducesDefaultResponseType]
+        [HttpPost("upsert-course-schedule")]
+        [ApiToken(Auth = "1302", Name = "更新课程的排课信息", RW = "W", Limit = false)]
+        public async Task<IActionResult> UpsertCourseSchedule(JsonElement json)
+        {
+            var (id, school) = HttpContext.GetApiTokenInfo();
+            if (!json.TryGetProperty("courseId", out JsonElement _courseId)) { return Ok(new { error = 1, msg = "课程参数错误" }); }
+            School data = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "School").ReadItemAsync<School>(school, new PartitionKey("Base"));
+            Azure.Response response = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync($"{_courseId}", new PartitionKey($"Course-{school}"));
+            return Ok();
+        }
+
         [ProducesDefaultResponseType]
         [HttpPost("get-course-list")]
         [ApiToken(Auth = "1303", Name = "获取课程列表信息", RW = "R", Limit = false)]

+ 3 - 0
TEAMModelBI/Controllers/BISchool/RoomController.cs

@@ -7,6 +7,7 @@ using System;
 using System.Text;
 using System.Text.Json;
 using System.Threading.Tasks;
+using TEAMModelBI.Filter;
 using TEAMModelBI.Tool.Extension;
 using TEAMModelOS.Models;
 using TEAMModelOS.SDK.DI;
@@ -41,6 +42,8 @@ namespace TEAMModelBI.Controllers.BISchool
         /// </summary>
         /// <param name="jsonElement"></param>
         /// <returns></returns>
+        [ProducesDefaultResponseType]
+        [AuthToken(Roles = "assist")]
         [HttpPost("set-bind")]
         public async Task<IActionResult> SetBindProduct(JsonElement jsonElement) 
         {

+ 1 - 1
TEAMModelOS.FunctionV4/CosmosDB/TriggerCorrect.cs

@@ -424,7 +424,7 @@ namespace TEAMModelOS.FunctionV4
             }
             catch (CosmosException e)
             {
-                await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-CosmosDB异常{e.Message}\n{e.Status}", GroupNames.成都开发測試群組);
+                await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-CosmosDB异常{e.StackTrace}{e.Message}\n{e.Status}", GroupNames.成都开发測試群組);
             }
             catch (Exception e)
             {

+ 1 - 1
TEAMModelOS.FunctionV4/CosmosDB/TriggerExam.cs

@@ -424,7 +424,7 @@ namespace TEAMModelOS.FunctionV4
             }
             catch (CosmosException e)
             {
-                await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-CosmosDB异常{e.Message}\n{e.Status}", GroupNames.成都开发測試群組);
+                await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-CosmosDB异常{e.StackTrace}{e.Message}\n{e.Status}", GroupNames.成都开发測試群組);
             }
             catch (Exception e)
             {

+ 1 - 1
TEAMModelOS.FunctionV4/CosmosDB/TriggerExamLite.cs

@@ -163,7 +163,7 @@ namespace TEAMModelOS.FunctionV4
             }
             catch (CosmosException e)
             {
-                await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-CosmosDB异常{e.Message}\n{e.Status}", GroupNames.成都开发測試群組);
+                await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-CosmosDB异常{e.StackTrace}{e.Message}\n{e.Status}", GroupNames.成都开发測試群組);
             }
             catch (Exception ex)
             {

+ 1 - 1
TEAMModelOS.FunctionV4/CosmosDB/TriggerHomework.cs

@@ -250,7 +250,7 @@ namespace TEAMModelOS.FunctionV4
             }
             catch (CosmosException e)
             {
-                await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-CosmosDB异常{e.Message}\n{e.Status}", GroupNames.成都开发測試群組);
+                await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-CosmosDB异常{e.StackTrace}{e.Message}\n{e.Status}", GroupNames.成都开发測試群組);
             }
             catch (Exception ex)
             {

+ 1 - 1
TEAMModelOS.FunctionV4/CosmosDB/TriggerStudy.cs

@@ -175,7 +175,7 @@ namespace TEAMModelOS.FunctionV4
             }
             catch (CosmosException e)
             {
-                await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-CosmosDB异常{e.Message}\n{e.Status}", GroupNames.成都开发測試群組);
+                await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-CosmosDB异常{e.StackTrace}{e.Message}\n{e.Status}", GroupNames.成都开发測試群組);
             }
             catch (Exception ex)
             {

+ 1 - 1
TEAMModelOS.FunctionV4/CosmosDB/TriggerSurvey.cs

@@ -398,7 +398,7 @@ namespace TEAMModelOS.FunctionV4
 
             catch (CosmosException e)
             {
-                await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-CosmosDB异常{e.Message}\n{e.Status}", GroupNames.成都开发測試群組);
+                await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-CosmosDB异常{e.StackTrace}{e.Message}\n{e.Status}", GroupNames.成都开发測試群組);
             }
             catch (Exception ex)
             {

+ 1 - 1
TEAMModelOS.FunctionV4/CosmosDB/TriggerVote.cs

@@ -336,7 +336,7 @@ namespace TEAMModelOS.FunctionV4
             }
             catch (CosmosException e)
             {
-                await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-CosmosDB异常{e.Message}\n{e.Status}", GroupNames.成都开发測試群組);
+                await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-CosmosDB异常{e.StackTrace}{e.Message}\n{e.Status}", GroupNames.成都开发測試群組);
             }
             catch (Exception ex)
             {

+ 7 - 7
TEAMModelOS.FunctionV4/ServiceBus/ActiveTaskTopic.cs

@@ -68,7 +68,7 @@ namespace TEAMModelOS.FunctionV4.ServiceBus
             }
             catch (CosmosException e)
             {
-                await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,ExamBus()-CosmosDB异常{e.Message}\n{e.Status}", GroupNames.成都开发測試群組);
+                await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,ExamBus()-CosmosDB异常{e.Message}\n{e.Status}{e.StackTrace}", GroupNames.成都开发測試群組);
             }
             catch (Exception ex)
             {
@@ -92,7 +92,7 @@ namespace TEAMModelOS.FunctionV4.ServiceBus
             }
             catch (CosmosException e)
             {
-                await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,VoteBus()-CosmosDB异常{e.Message}\n{e.Status}", GroupNames.成都开发測試群組);
+                await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,VoteBus()-CosmosDB异常{e.Message}\n{e.Status}{e.StackTrace}", GroupNames.成都开发測試群組);
             }
             catch (Exception ex)
             {
@@ -116,7 +116,7 @@ namespace TEAMModelOS.FunctionV4.ServiceBus
             }
             catch (CosmosException e)
             {
-                await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,Correct()-CosmosDB异常{e.Message}\n{e.Status}", GroupNames.成都开发測試群組);
+                await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,Correct()-CosmosDB异常{e.Message}\n{e.Status}{e.StackTrace}", GroupNames.成都开发測試群組);
             }
             catch (Exception ex)
             {
@@ -141,7 +141,7 @@ namespace TEAMModelOS.FunctionV4.ServiceBus
             }
             catch (CosmosException e)
             {
-                await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,SurveyBus()-CosmosDB异常{e.Message}\n{e.Status}", GroupNames.成都开发測試群組);
+                await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,SurveyBus()-CosmosDB异常{e.StackTrace}{e.Message}\n{e.Status}", GroupNames.成都开发測試群組);
             }
             catch (Exception ex)
             {
@@ -164,7 +164,7 @@ namespace TEAMModelOS.FunctionV4.ServiceBus
             }
             catch (CosmosException e)
             {
-                await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,Homework()-CosmosDB异常{e.Message}\n{e.Status}", GroupNames.成都开发測試群組);
+                await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,Homework()-CosmosDB异常{e.StackTrace}{e.Message}{e.StackTrace}\n{e.Status}", GroupNames.成都开发測試群組);
             }
             catch (Exception ex)
             {
@@ -190,7 +190,7 @@ namespace TEAMModelOS.FunctionV4.ServiceBus
             }
             catch (CosmosException e)
             {
-                await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,Study()-CosmosDB异常{e.Message}\n{e.Status}\n{e.StackTrace}\n{activityId}", GroupNames.成都开发測試群組);
+                await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,Study()-CosmosDB异常{e.StackTrace}{e.Message}\n{e.Status}", GroupNames.成都开发測試群組);
             }
             catch (Exception ex)
             {
@@ -214,7 +214,7 @@ namespace TEAMModelOS.FunctionV4.ServiceBus
             }
             catch (CosmosException e)
             {
-                await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,ExamLite()-CosmosDB异常{e.Message}\n{e.Status}", GroupNames.成都开发測試群組);
+                await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,ExamLite()-CosmosDB异常{e.StackTrace}{e.Message}\n{e.Status}", GroupNames.成都开发測試群組);
             }
             catch (Exception ex)
             {

+ 1 - 39
TEAMModelOS/ClientApp/src/access/index.js

@@ -63,48 +63,10 @@ LoginMiddleware.handleExtend = function(next, ...arg) {
 		}
 	} else {
 		$router.push({
-			path: '/login'
+			path: '/login/' + toNextIdentity
 		})
 		next(true)
 	}
-	// let access_token = localStorage.getItem('access_token')
-	// let expires_in = localStorage.getItem('expires_in')
-	// if(identity && toNextIdentity && identity !== toNextIdentity){
-	// 	console.log('身份不匹配')
-	// 	if(id_token){
-	// 		if(toNextIdentity === 'student'){
-	// 			loginTools.stuLoginById(id_token)
-	// 		}else{
-	// 			loginTools.teacherLogin({ id_token:id_token,access_token:access_token,expires_in:expires_in })
-	// 		}
-	// 	}else{
-	// 		$router.push({ path:'/login' })
-	// 	}
-	// 	next(true);
-	// 	return
-	// }else{
-	// 	if (localStorage.userAccess) {
-	// 		userAccess = JSON.parse(decodeURIComponent(localStorage.userAccess, "utf-8"))
-	// 	}
-	// 	if (localStorage.userInfo) {
-	// 		userInfo = JSON.parse(decodeURIComponent(localStorage.userInfo, "utf-8"))
-	// 	}
-	// 	if (userAccess && userInfo) {
-	// 		if (toNextPath === '/login' && userAccess.isLogin) {
-	// 			window.location.href = identity == 'student' ? '/studentWeb' : '/home'
-	// 		} else {
-	// 			User.freshLogin().then(() => {
-	// 				next(true);
-	// 			}).catch(() => {
-	// 				next(false);
-	// 			});
-	// 		}
-	// 	} else {
-	// 		next(false);
-	// 	}
-	// }
-
-
 };
 
 const access = new VueAccessControl.Access({

+ 102 - 99
TEAMModelOS/ClientApp/src/access/login.js

@@ -5,80 +5,74 @@ import { User } from '@/service/User'
 import { app } from '@/boot-app.js'
 export default {
 	/* 教师醍摩豆ID登录 */
-	async teacherLogin(item,schoolCode){
-		try{
-			let { id_token,access_token,expires_in } = item
-			// 設定Token和保存時間
-			localStorage.setItem("id_token", id_token)
-			localStorage.setItem("access_token", access_token)
-			localStorage.setItem("expires_in", expires_in)
-			// 根据id_token去获取教师的基础信息
-			let teacherInfo = await $api.login.getTeacherInfo({ id_token:id_token })
-			localStorage.setItem("auth_token", teacherInfo.auth_token)
-			localStorage.setItem("location", teacherInfo.location)
-			$store.dispatch('user/setUserProfile', teacherInfo)
-			// 检查老师是否加入了学校 再去设定需要去获取哪个学校的基础信息
-			let hasJoinSchool = teacherInfo.schools && teacherInfo.schools.length && teacherInfo.schools.find(i => i.status === 'join')
-			let joinSchools = hasJoinSchool ? teacherInfo.schools.filter(i => i.status === 'join') : []
-			let defaultschool = schoolCode || teacherInfo.defaultschool || (joinSchools.length ? joinSchools[0].schoolId : null)
-			let authByUser = jwtDecode(teacherInfo.auth_token)
-			let t_Data = jwtDecode(id_token)
-			let areas = teacherInfo.areas
-			// 初始化老师登录后返回的数据
-			let info = {
-				id: t_Data.sub,
-				name: authByUser.name,
-				roles: authByUser.roles,
-				permissions: authByUser.permissions == null ? [] : authByUser.permissions,
-				picture: t_Data.picture ? t_Data.picture : '',
-				toArea: areas.length && !joinSchools.length
-			}
-			// 如果有默认学校 则需要去登录到该学校 获取学校基础信息 并完善返回数据info
-			if (defaultschool && defaultschool != 'null') {
-				let schoolInfo = await $api.login.getTeacherSchoolInfo({ id_token:id_token,school_code: defaultschool })
-				// 儲存大雲Token
-				localStorage.setItem("auth_token", schoolInfo.auth_token)
-				localStorage.setItem("hpAppraise", schoolInfo.school_base.hpappraise)
-				localStorage.setItem("currArea", JSON.stringify((schoolInfo.currArea && schoolInfo.currArea.homeworkType) ? schoolInfo.currArea.homeworkType : []))
-				$store.dispatch('user/setSchoolCode', defaultschool)
-				$store.dispatch('user/setSchoolProfile', schoolInfo)
-				// 如果老师加入了学校 则需要把学校信息里面的auth等权限信息替换老师原本默认的信息
-				let authBySchool = jwtDecode(schoolInfo.auth_token)
-				info.roles = authBySchool.roles
-				info.defaultschool = defaultschool
-				info.permissions = authBySchool.permissions == null ? [] : authBySchool.permissions
-			}
-			//进行登录权限写入
-			User.login(info,'teacher').then(res => {
-			    if (res) {
-					$store.commit('setUserInfo', {
-			            TEAMModelId: info.id,
-			            name: info.name,
-			            schoolCode: info.defaultschool
-			        })
-					// 前往区级平台
-			        if (info.toArea) {
-			            localStorage.setItem('platform', 'area')
-			            app.$router.push({ path: '/area' })
-			        } else {
-						// 前往校级平台 判断是否有记录的目标地址 如果没有则按照站点来进行对应跳转固定页面
-						let targetPath = localStorage.getItem('target_path')
-						let defaultPath = $store.state.config.srvAdr == 'China' ? '/home' : '/home/myCourse'
-			            let homePath = targetPath ? (targetPath.includes('home/') ? targetPath : defaultPath) : defaultPath
-			            localStorage.setItem('platform', 'school')
-						localStorage.setItem('target_path','')
+	teacherLogin(item,schoolCode){
+		return new Promise(async(r,j) => {
+			try{
+				let { id_token,access_token,expires_in } = item
+				// 設定Token和保存時間
+				localStorage.setItem("id_token", id_token)
+				localStorage.setItem("access_token", access_token)
+				localStorage.setItem("expires_in", expires_in)
+				// 根据id_token去获取教师的基础信息
+				let teacherInfo = await $api.login.getTeacherInfo({ id_token:id_token })
+				localStorage.setItem("auth_token", teacherInfo.auth_token)
+				localStorage.setItem("location", teacherInfo.location)
+				$store.dispatch('user/setUserProfile', teacherInfo)
+				// 检查老师是否加入了学校 再去设定需要去获取哪个学校的基础信息
+				let hasJoinSchool = teacherInfo.schools && teacherInfo.schools.length && teacherInfo.schools.find(i => i.status === 'join')
+				let joinSchools = hasJoinSchool ? teacherInfo.schools.filter(i => i.status === 'join') : []
+				let defaultschool = schoolCode || teacherInfo.defaultschool || (joinSchools.length ? joinSchools[0].schoolId : null)
+				let authByUser = jwtDecode(teacherInfo.auth_token)
+				let t_Data = jwtDecode(id_token)
+				let areas = teacherInfo.areas
+				// 初始化老师登录后返回的数据
+				let info = {
+					id: t_Data.sub,
+					name: authByUser.name,
+					roles: authByUser.roles,
+					permissions: authByUser.permissions == null ? [] : authByUser.permissions,
+					picture: t_Data.picture ? t_Data.picture : '',
+					toArea: areas.length && !joinSchools.length
+				}
+				// 如果有默认学校 则需要去登录到该学校 获取学校基础信息 并完善返回数据info
+				if (defaultschool && defaultschool != 'null') {
+					let schoolInfo = await $api.login.getTeacherSchoolInfo({ id_token:id_token,school_code: defaultschool })
+					// 儲存大雲Token
+					localStorage.setItem("auth_token", schoolInfo.auth_token)
+					localStorage.setItem("hpAppraise", schoolInfo.school_base.hpappraise)
+					localStorage.setItem("currArea", JSON.stringify((schoolInfo.currArea && schoolInfo.currArea.homeworkType) ? schoolInfo.currArea.homeworkType : []))
+					$store.dispatch('user/setSchoolCode', defaultschool)
+					$store.dispatch('user/setSchoolProfile', schoolInfo)
+					// 如果老师加入了学校 则需要把学校信息里面的auth等权限信息替换老师原本默认的信息
+					let authBySchool = jwtDecode(schoolInfo.auth_token)
+					info.roles = authBySchool.roles
+					info.defaultschool = defaultschool
+					info.permissions = authBySchool.permissions == null ? [] : authBySchool.permissions
+				}
+				//进行登录权限写入
+				User.login(info,'teacher').then(res => {
+				    if (res) {
+						$store.commit('setUserInfo', {
+				            TEAMModelId: info.id,
+				            name: info.name,
+				            schoolCode: info.defaultschool
+				        })
 						console.log('教师登录成功!',info)
-			            app.$router.push({ path: homePath })
-			        }
-			    }
-			})
-		}catch(e){
-			console.error(e)
-		}
+						r(info)
+				    }
+				})
+			}catch(e){
+				j(e)
+				console.error(e)
+			}
+		})
+		
 	},
 	/* 学生醍摩豆ID登录 */
-	async stuLoginById(id_token){
+	async stuLoginById(item){
 		try{
+			let { id_token,access_token } = item
+			localStorage.setItem("access_token", access_token)
 			let studentInfo = await $api.login.getStudentInfo({ id_token:id_token })
 			console.log('学生醍摩豆ID登录后的学生信息 > ', studentInfo)
 			// 儲存大雲Token
@@ -107,34 +101,43 @@ export default {
 	},
 	/* 学生校内账号登录 与醍摩豆ID无关 */
 	async stuLoginByAccount(params){
-		try{
-			let studentInfo = await $api.login.getStudentInfoByAccount(params)
-			console.log('学生校内账号登录后的学生信息 > ', studentInfo)
-			// 儲存大雲Token
-			localStorage.setItem("access_token", studentInfo.token.access_token)
-			localStorage.setItem("stu_auth_token", studentInfo.auth_token)
-			localStorage.setItem("stu_id_token", studentInfo.token.id_token)
-			// 更新vuex学生基础信息
-			$store.dispatch('user/setSchoolCode', params.school_code)
-			$store.dispatch('user/setStudentProfile', studentInfo)
-			// 注入身份权限
-			let auth = jwtDecode(studentInfo.auth_token)
-			User.login({
-			    id: params.id,
-			    roles: ['student'],
-			    permissions: auth.permissions == null ? [] : auth.permissions,
-			    picture: ''
-			},'student').then(r => {
-			    if (r) {
-			        sessionStorage.setItem('identity', 'student')
-					let targetPath = localStorage.getItem('target_path')
-					let toPath = targetPath ? (targetPath.includes('studentWeb/') ? targetPath : '/studentWeb') : '/studentWeb'
-			        app.$router.push({ path: toPath })
-					localStorage.setItem('target_path','')
-			    }
-			})
-		}catch(e){
-			console.log(e)
-		}
+		return new Promise(async (r,j) => {
+			try{
+				let studentInfo = await $api.login.getStudentInfoByAccount(params)
+				if(studentInfo.error){
+					j(studentInfo)
+					return
+				}
+				console.log('学生校内账号登录后的学生信息 > ', studentInfo)
+				// 儲存大雲Token
+				localStorage.setItem("access_token", studentInfo.token.access_token)
+				localStorage.setItem("stu_auth_token", studentInfo.auth_token)
+				localStorage.setItem("stu_id_token", studentInfo.token.id_token)
+				// 更新vuex学生基础信息
+				$store.dispatch('user/setSchoolCode', params.school_code)
+				$store.dispatch('user/setStudentProfile', studentInfo)
+				// 注入身份权限
+				let auth = jwtDecode(studentInfo.auth_token)
+				User.login({
+				    id: params.id,
+				    roles: ['student'],
+				    permissions: auth.permissions == null ? [] : auth.permissions,
+				    picture: ''
+				},'student').then(res => {
+					r(200)
+				    if (r) {
+				        sessionStorage.setItem('identity', 'student')
+						let targetPath = localStorage.getItem('target_path')
+						let toPath = targetPath ? (targetPath.includes('studentWeb/') ? targetPath : '/studentWeb') : '/studentWeb'
+				        app.$router.push({ path: toPath })
+						localStorage.setItem('target_path','')
+				    }
+				})
+			}catch(e){
+				j(500)
+				console.log(e)
+			}
+		})
+		
 	}
 }

+ 5 - 0
TEAMModelOS/ClientApp/src/api/learnActivity.js

@@ -338,5 +338,10 @@ export default {
     findMarkProgress: function (data) {
         return post('/common/exam/analysis-scoring', data)
     },
+	
+	/* 修改活动信息 */
+	updateAcInfo: function (data) {
+	    return post('/common/update-end-time', data)
+	},
 
 }

+ 14 - 0
TEAMModelOS/ClientApp/src/assets/student-web/component_styles/quesnaire.less

@@ -95,4 +95,18 @@
         left: 0px;
         margin: 10px 0px;
     }
+
+    
+    .scoreboard {
+        width: 100%;
+        /*height: 638px;*/
+        background: rgb(240, 240, 240);
+        /*border: 1px solid rgba(0, 0, 0, 0.1);*/
+        border-radius: 8px;
+        padding: 15px;
+
+        .ivu-card {
+            margin-bottom: 20px;
+        }
+    }
 }

+ 4 - 0
TEAMModelOS/ClientApp/src/components/homework/BaseHwForm.vue

@@ -58,6 +58,9 @@
             <CheckboxGroup v-model="voteForm.allowComment">
               <Checkbox label="allow">{{ $t('homework.form.allowComment') }}</Checkbox>
             </CheckboxGroup>
+			<CheckboxGroup v-model="voteForm.mustSubmit">
+			  <Checkbox label="mustSubmit">{{ $t('homework.form.mustSubmit') }}</Checkbox>
+			</CheckboxGroup>
             <CheckboxGroup v-model="voteForm.extLimit">
               <Checkbox label="extLimit">{{ $t('homework.form.allowFileType') }}</Checkbox>
             </CheckboxGroup>
@@ -155,6 +158,7 @@ export default {
         allowSupply: [],
         allowComment: [],
         extLimit: [],
+		mustSubmit:[]
       },
       defaultParams: {
         code: "",

+ 1 - 1
TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContent.vue

@@ -22,7 +22,7 @@
         </template>
         <!-- 如果篩選時未選的時候預設顯示列表第一個-->
         <div class="noSelected" v-if="!getIsSelectedNow">
-            <h3>{{$t("studentWeb.event.selectActivity")}}</h3>
+            <h3>{{ $t("studentWeb.event.selectActivity") }}</h3>
         </div>
     </div>
 </template>

+ 51 - 26
TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContentTypeTemplate/QuesNaire.vue

@@ -44,31 +44,24 @@
 		<Loading v-show="isLoad" bgColor="rgba(0, 0, 0, 0.3)"></Loading>
 		<EventBasicInfo :info="nowActive" />
 		<div>
-			<!-- 已提交 -->
-			<div v-if="alreadyAnswered" style="text-align: center; padding-top: 15%;">
-				<Icon type="md-checkmark-circle-outline" color="#00ad6c" size="80"/>
-				<p style="font-size: 30px; color:#00ad6c; font-weight: 600; margin:20px;">{{ $t('survey.studentWeb.already') }}</p>
-			</div>
-			<!-- 活动结束 -->
-			<div v-if="!alreadyAnswered && surveyInfo.progress === 'finish'" style="text-align: center; padding-top: 15%;">
-				<Icon type="md-stopwatch" color="#00ad6c" size="80"/>
-				<p style="font-size: 30px; color:#00ad6c; font-weight: 600; margin:20px;">{{ $t('survey.studentWeb.overtime') }}</p>
-			</div>
-			
-
 			<!--問卷完成後,在時間結束前仍可修改答案再提交-->
-			<div v-if="surveyInfo.progress !== 'finish' && !alreadyAnswered">
+			<div style="margin-bottom: 100px;">
+				<div class="scoreboard" v-if="!alreadyAnswered && surveyInfo.progress === 'finish'">
+					<!-- 未作答 -->
+					<h4 style="padding: 25px;">
+						<svg-icon icon-class="handonHint" class="warm-icon" />
+						{{ $t('survey.studentWeb.noanswer') }}
+					</h4>
+				</div>
 				<!-- 描述 -->
 				<BillBoardandLightBox :activityData="surveyInfo" />
 				<!-- 内容 -->
-				<div class="title-rect-group">
+				<div class="title-rect-group" style="margin-bottom: 20px;">
 					<!-- <div class="title-rect" /> -->
 					<h2 class="title-rect-name">{{ $t('survey.studentWeb.content') }}</h2>
 				</div>
-				<br />
 				<!-- 问卷内容 -->
 				<div v-for="(item, index) in surveyInfo.items" :key="index" class="survey-item">
-					<!-- <br /> -->
 					<div style="display: flex; font-weight: bold;">
 						<span>{{ index + 1 }}. </span>
 						<span v-html="item.question" @click="showImg($event)"></span>({{ typeList[item.type] }})<span></span>
@@ -77,7 +70,9 @@
 					<div v-if="item.type !== 'subjective'">
 						<div class="unitTestBtn" v-for="(option, optionIndex) in item.option" :key="optionIndex">
 							<div class="unitTestbg" @click="onOptionClick(item, index, option.code)"
-								:style="{ backgroundColor: submitArr[index].includes(option.code) ? '#24b880' : 'transparent'}"
+								:style="{ backgroundColor: submitArr[index].includes(option.code) ? '#24b880' : 'transparent',
+											cursor: (alreadyAnswered || surveyInfo.progress === 'finish') ? 'not-allowed' : 'pointer'
+								}"
 							>
 								{{ option.code }}. <span v-html="option.value" style="margin-left: 10px;" @click="showImg($event)"></span>
 							</div>
@@ -85,13 +80,14 @@
 					</div>
 					<!-- 问答 -->
 					<div v-if="item.type === 'subjective'">
-						<Input v-special-char v-model="submitArr[index][0]" type="textarea" :rows="8" :placeholder="$t('studentWeb.exam.inputAnswers')" />
+						<Input v-special-char v-model="submitArr[index][0]" type="textarea" :rows="8"
+								:placeholder="$t('studentWeb.exam.inputAnswers')"
+								:disabled="alreadyAnswered || surveyInfo.progress === 'finish'"
+						/>
 					</div>
 					<Divider v-if="index != surveyInfo.items.length - 1" />
 				</div>
-				<br />
-				<br />
-				<button class="uploadBtn" @click="submitMessage()">
+				<button class="uploadBtn" @click="submitMessage()" v-if="!alreadyAnswered && surveyInfo.progress != 'finish'">
 					<svg-icon icon-class="quesnaire" class="uloadBtn-icon" />
 					<span>{{ $t('survey.studentWeb.submit') }}</span>
 				</button>
@@ -135,7 +131,7 @@
 				surveyInfo: { //问卷信息
 					items: []
 				},
-				alreadyAnswered:false, //提交状态
+				alreadyAnswered: false, //提交状态
 				undo: 0,
 				showMessageNum: 0,
 				WarmMessageisOpen: false,
@@ -154,6 +150,7 @@
                     img: "",
                     show: false
                 },
+				answerRec: [],
 			};
 		},
 		created() {
@@ -170,6 +167,9 @@
 		methods: {
 			// 非问答的答案
 			onOptionClick(item, index, code) {
+				if(this.alreadyAnswered || this.surveyInfo.progress === 'finish') {
+					return
+				}
 				if (this.submitArr[index].includes(code)) {
 					this.submitArr[index].splice(this.submitArr[index].indexOf(code), 1)
 				} else {
@@ -239,16 +239,18 @@
 			async getSurveyInfo() {
 				// this.surveyInfo = {}
 				this.isLoad = true
+				this.answerRec = []
 				if(this.getItemTitle.id) {
 					let params = {
 						"id": this.getItemTitle.id,
 						"code": this.getItemTitle.scode
 					}
 					let isAnswerd = await this.isAnswerd(params)
-					if(!isAnswerd) {
+					// if(!isAnswerd) {
 						// 没有提交
 						this.$api.studentWeb.getSurveyInfo(params).then(async res => {
 							if (res) {
+								this.alreadyAnswered = isAnswerd
 								this.isLoad = false
 								if(res.status == 404) {
 									this.$Modal.confirm({
@@ -262,6 +264,9 @@
 								} else if(res.status == 200) {
 									this.surveyInfo = res.survey
 									this.surveyInfo.items = await this.getBlobItems(res.survey)
+									if(isAnswerd) {
+										this.answerRec = await this.getRecordItems(res.survey)
+									}
 									this.submitArr = []
 									this.surveyInfo.items.forEach(i => {
 										this.submitArr.push([])
@@ -272,10 +277,10 @@
 						}).catch(err => {
 							console.log(err)
 						})
-					} else {
+					/* } else {
 						this.isLoad = false
 						this.alreadyAnswered = true
-					}
+					} */
 				}
 			},
 			//放大图片
@@ -347,6 +352,19 @@
 					
 				})
 			},
+			// 获取作答的内容
+			getRecordItems(qnItem) {
+				return new Promise(async (resolve, reject) => {
+					// let blobHost = this.$tools.getBlobHost()
+					let cntr = qnItem.scope === 'school' ? qnItem.school : qnItem.code.replace('Survey-','')
+					let sas = await this.$tools.getBlobSas(cntr)
+					let sasString = "?" + sas.sas
+					let blobHost = sas.url
+					let fullIndexJsonPath = blobHost + '/' + cntr + qnItem.recordUrl + sasString
+					let indexJson = await this.getBlobJsonFile(fullIndexJsonPath)
+					resolve(indexJson.urecord[0].ans)
+				})
+			},
 			
 			// 获取blob里的问卷信息
 			getBlobJsonFile(indexJsonUrl) {
@@ -425,7 +443,14 @@
 					this.alreadyAnswered = false
 					this.getSurveyInfo()
 				}
-			}
+			},
+			answerRec: {
+				handler(n, o) {
+					// if(n.length) {
+						this.submitArr = n
+					// }
+				},
+			},
 		},
 		
 		computed: {

+ 7 - 0
TEAMModelOS/ClientApp/src/locale/lang/en-US/homework.js

@@ -1,4 +1,10 @@
 export default {
+	modifyAcName:'修改活動名稱',
+	modifyAcNameTip:'請輸入活動名稱',
+	modifyAcTimeTip:'請選擇活動結束時間',
+	noEndTimeTip:'請選擇活動結束時間!',
+	endTip:'是否立即結束活動',
+	endSuc:'活動已結束',
 	noAttachments:'No attachments uploaded',
 	noSaveTip:'The current activity is not saved, leaving will automatically remove the activity, do you want to continue?',
 	noFindTip:'No current activity found!',
@@ -51,6 +57,7 @@ export default {
 		allowFix: 'Allow supplement homework',
 		allowComment: 'Open student mutual evaluation',
 		allowFileType: 'Limit homework submission format',
+		mustSubmit:'必須上傳作業',
 		once: 'Once',
 		day: 'Daily',
 		week: 'Weekly',

+ 2 - 2
TEAMModelOS/ClientApp/src/locale/lang/en-US/studentWeb.js

@@ -195,8 +195,8 @@ export default {
     newAddCourse: 'The latest addition',
     addTime: "Join time",
     missionListCardTitle: 'Activity Task List',
-    missionListCardTitle1: 'Task List',
-    missionListCardTitle2: 'Activity List',
+    missionListCardTitle1: '評測工作任務',
+    missionListCardTitle2: '投票問卷活動',
     choiceTime: "Filter Time",
     missionListCardPlace: "Default display activities within 30 days",
     missionListCardLoading: 'Loading',

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

@@ -89,7 +89,8 @@ export default {
 		content:'Content',
 		submit:'Submit Survey',
 		already:'You have successfully submitted the response record for this activity',
-		overtime:'This activity has ended'
+		overtime:'This activity has ended',
+		noanswer: "該活動已結束,無法提交作答資訊",
 	},
 	optionLimitTip:'Keep at least two options',
 	optionMaxTip:'Maximum of 9 options',

+ 4 - 0
TEAMModelOS/ClientApp/src/locale/lang/en-US/syllabus.js

@@ -1,4 +1,8 @@
 export default {
+	receivedSuc1:'接收成功,可前往',
+	receivedSuc2:'IES5-個人課綱',
+	receivedSuc3:'進行查看',
+	receiveBtn:'確認接收',
 	noMatchTerm:'No Match Semester',
 	emptyTip: 'Empty books are not available for sharing!',
 	chooseChapterTip: 'Please select the topic you want to save first!',

+ 7 - 0
TEAMModelOS/ClientApp/src/locale/lang/zh-CN/homework.js

@@ -1,4 +1,10 @@
 export default {
+	modifyAcName:'修改活动名称',
+	modifyAcNameTip:'请输入活动名称',
+	modifyAcTimeTip:'请选择活动结束时间',
+	noEndTimeTip:'请选择活动结束时间!',
+	endTip:'是否立即结束活动',
+	endSuc:'活动已结束',
 	noAttachments:'未上传附件',
 	noSaveTip:'当前活动未保存,离开将自动移除该活动,是否继续?',
 	noFindTip:'未查询到当前活动!',
@@ -51,6 +57,7 @@ export default {
 		allowFix:'允许补交作业',
 		allowComment:'允许学生互评',
 		allowFileType:'限制作业提交格式',
+		mustSubmit:'必须上传作业',
 		once:'单次',
 		day:'每日',
 		week:'每周',

+ 3 - 2
TEAMModelOS/ClientApp/src/locale/lang/zh-CN/studentWeb.js

@@ -195,8 +195,8 @@ export default {
     newAddCourse: '最新加入课程',
     addTime: "加入时间",
     missionListCardTitle: '活动任务清单',
-    missionListCardTitle1: '任务清单',
-    missionListCardTitle2: '活动清单',
+    missionListCardTitle1: '评测作业任务',
+    missionListCardTitle2: '投票问卷活动',
     choiceTime: "筛选时间",
     missionListCardPlace: "默认展示近30天的活动",
     missionListCardLoading: '载入中',
@@ -628,6 +628,7 @@ export default {
             evMode3: '阅卷评测',
         },
         missExam: "缺考",
+        nojoin: "未参与",
         noScoreType: "未评分",
         finishOk: "已完成",
         practiceType: {

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

@@ -89,7 +89,8 @@ export default {
 		content:'内容',
 		submit:'提交问卷',
 		already:'该活动已成功提交作答记录',
-		overtime:'当前活动已结束'
+		overtime:'当前活动已结束',
+		noanswer: "该活动已结束,无法提交作答信息",
 	},
 	optionLimitTip:'至少保留两个选项',
 	optionMaxTip:'最多只有9个选项',

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

@@ -1,5 +1,7 @@
 export default{
-	receivedSuc:'接收成功,可前往IES5-个人课纲进行查看',
+	receivedSuc1:'接收成功,可前往',
+	receivedSuc2:'IES5-个人课纲',
+	receivedSuc3:'进行查看',
 	receiveBtn:'确认接收',
 	noMatchTerm:'无匹配学期',
 	emptyTip:'空目录册别无法进行分享!',

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

@@ -67,6 +67,6 @@ export default {
 	optionMaxTip:'当前投票数大于选项数,请务必勾选 允许重复投票 !',
 	alreadyVote:'已投票',
 	name:'姓名',
-	className:'班级',
+	className:'课程名单',
 	rate:'占比'
 }

+ 7 - 0
TEAMModelOS/ClientApp/src/locale/lang/zh-TW/homework.js

@@ -1,4 +1,10 @@
 export default {
+	modifyAcName:'修改活動名稱',
+	modifyAcNameTip:'請輸入活動名稱',
+	modifyAcTimeTip:'請選擇活動結束時間',
+	noEndTimeTip:'請選擇活動結束時間!',
+	endTip:'是否立即結束活動',
+	endSuc:'活動已結束',
 	noAttachments:'未上傳附件',
 	noSaveTip:'當前活動未保存,離開將自動移除該活動,是否繼續?',
 	noFindTip:'未查詢到當前活動!',
@@ -51,6 +57,7 @@ export default {
 		allowFix: '允許補交作業',
 		allowComment: '允許學生互評',
 		allowFileType: '限制作業提交格式',
+		mustSubmit:'必須上傳作業',
 		once: '單次',
 		day: '每日',
 		week: '每週',

+ 2 - 2
TEAMModelOS/ClientApp/src/locale/lang/zh-TW/studentWeb.js

@@ -195,8 +195,8 @@ export default {
     newAddCourse: '最新加入課程',
     addTime: "加入時間",
     missionListCardTitle: '活動任務清單',
-    missionListCardTitle1: '任務清單',
-    missionListCardTitle2: '活動清單',
+    missionListCardTitle1: '評測工作任務',
+    missionListCardTitle2: '投票問卷活動',
     choiceTime: "篩選時間",
     missionListCardPlace: "預設展示近30天的活動",
     missionListCardLoading: '載入中',

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

@@ -89,7 +89,8 @@ export default {
 		content: '內容',
 		submit: '提交問卷',
 		already:'該活動已成功提交作答記錄',
-		overtime:'當前活動已結束'
+		overtime:'當前活動已結束',
+		noanswer: "該活動已結束,無法提交作答資訊",
 	},
 	optionLimitTip:'至少保留兩個選項',
 	optionMaxTip:'最多只有9個選項',

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

@@ -1,5 +1,7 @@
 export default {
-	receivedSuc:'接收成功,可前往IES5-個人課綱進行查看',
+	receivedSuc1:'接收成功,可前往',
+	receivedSuc2:'IES5-個人課綱',
+	receivedSuc3:'進行查看',
 	receiveBtn:'確認接收',
 	noMatchTerm: '無匹配學期',
 	emptyTip: '空目錄冊別無法進行分享!',

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

@@ -67,6 +67,6 @@ export default {
 	optionMaxTip:'當前投票數大於選項數,請務必勾選允許重複投票!',
 	alreadyVote:'已投票',
 	name:'姓名',
-	className:'班級',
+	className:'課程名單',
 	rate:'比例'
 }

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

@@ -170,6 +170,7 @@ export default {
         /* 设置当前学段 */
         setCurPeriod(state, data) {
             state.curPeriod = data
+            localStorage.setItem('curPeriod', JSON.stringify(data))
         },
         //更新userProfile schools
         setSchoolsInfo(state, data) {
@@ -268,8 +269,8 @@ export default {
             state.schoolProfile.school_base = data.school_base // 区班校基础数据
             state.schoolProfile.svcStatus = data.svcStatus //学校购买服务模组状态
             state.schoolProfile.productSum = data.productSum //学校购买服务模组信息
-            state.osblob_sas = data.osblob_sas 
-            state.osblob_uri = data.osblob_uri 
+            state.osblob_sas = data.osblob_sas
+            state.osblob_uri = data.osblob_uri
             sessionStorage.setItem('standard', data.school_base.standard)
         },
         setStudentProfile(state, data) {
@@ -749,6 +750,9 @@ export default {
             }
             data.svcStatus = svcStatus
             context.commit('setSchoolProfile', data)
+            let curPd = data.school_base.period.find(item => item.id === context.state.curPeriod?.id)
+            if (curPd) context.commit('setCurPeriod', curPd)
+
             // 设置学校空间
             context.commit('setSchoolSpace', data.school_base.size, { root: true })
         },

+ 159 - 6
TEAMModelOS/ClientApp/src/view/homework/ManageHomeWork.vue

@@ -26,17 +26,27 @@
 									<div :class='["hw-item",index === activeVoteIndex ? "item-active":""]'
 										v-for="(item,index) in voteList" :key="index" @click="onVoteClick(item,index)">
 										<p class="hw-item-name">
-											<!-- <span class="owner-tag" v-if="item.owner === 'school'">校</span>
-											<span class="owner-tag" v-if="item.owner === 'area'" style="background-color: #dc6f28;">区</span> -->
 											{{ item.name }}
+											<Icon type="md-create" class="ac-edit-icon" color="#12cce8" size="16" @click="doEditAc('name')" :title="$t('homework.modifyAcName')" v-if="item.id"/>
 										</p>
 										<div class="hw-item-info">
 											<span class="hw-item-nums">
-												<Icon type="md-time" size="14" style="margin-right:5px" />
-												{{ $tools.formatTime(item.startTime || item.createTime,'yyyy-MM-dd hh:mm') }}
+												<span class="time-item">
+													<Icon type="md-time" size="14" style="margin-right:5px" />
+													<span>{{ $t('learnActivity.createEv.startTime') }}:</span>
+													{{ $tools.formatTime(item.startTime || item.createTime,'yyyy-MM-dd hh:mm') }}
+												</span>
+												<span class="time-item">
+													<Icon type="md-time" size="14" style="margin-right:5px" />
+													<span>{{ $t('learnActivity.createEv.endTime') }}:</span>
+													{{ $tools.formatTime(item.endTime,'yyyy-MM-dd hh:mm') }}
+													<Icon type="md-create" class="ac-edit-icon" size="14" v-if="item.progress == 'going'" @click="doEditAc('time')" :title="$t('homework.modifyAcTime')" />
+												</span>
 											</span>
-											<span class="hw-item-status"
-												:style="{ background: (item.progress === 'pending' ? '#0BADD4' : item.progress === 'going' ? '#1fb06d' : '#949594')}">{{ item.progress === 'pending' ? $t('homework.pending') : item.progress === 'going' ? $t('homework.going') : $t('homework.finish') }}</span>
+											<div class="hw-item-status">
+												<span :style="{ color:getStatusColor(item.progress),borderColor:getStatusColor(item.progress) }">{{ item.progress === 'pending' ? $t('vote.pending') : item.progress === 'going' ? $t('vote.going') : $t('vote.finish') }}</span>
+												<span style="background: #ed4014;color: #fff;" v-if="item.progress === 'going'" @click="handleEnd(index)">{{$t('learnActivity.mgtScEv.stop')}}</span>
+											</div>
 										</div>
 									</div>
 								</div>
@@ -143,11 +153,39 @@
 				<p class="activity-info-item-title">{{ $t('homework.form.other') }}</p>
 				<Tag color="geekblue" v-if="currentVote.allowSupply">{{ $t('homework.form.allowFix') }}</Tag>
 				<Tag color="geekblue" v-if="currentVote.allowComment">{{ $t('homework.form.allowComment') }}</Tag>
+				<Tag color="geekblue" v-if="currentVote.mustSubmit">{{ $t('homework.form.allowComment') }}</Tag>
 				<div v-if="currentVote.extLimit.length">
 					<Tag color="geekblue" v-for="(ext,extIndex) in currentVote.extLimit">{{ ext }}</Tag><br>
 				</div>
 			</div>
 		</Drawer>
+		
+		<!-- 修改活动结束时间 -->
+		<Modal v-model="editTimeStatus" footer-hide className="ed-name-modal">
+		    <div slot="header" class="modal-header">
+		        {{$t('learnActivity.mgtScEv.editEndTime')}}
+		    </div>
+		    <div class="edit-name-content">
+		        <p class="edit-name-label">
+		            {{$t('cusMgt.listName')}}
+		        </p>
+		        <DatePicker v-model="editTime" :options="dateOpt1" type="datetime" @on-change="handleTime" format="yyyy-MM-dd HH:mm" :placeholder="$t('homework.modifyAcTimeTip')" style="width: 100%"></DatePicker>
+		        <Button :loading="btnLoading" @click="confirmEditEndtime" long type="primary" class="confirm-btn">{{ $t('syllabus.confirm') }}</Button>
+		    </div>
+		</Modal>
+		<!-- 修改活动名称 -->
+		<Modal v-model="editNameStatus" footer-hide className="ed-name-modal" @on-ok="confirmEditName">
+		    <div slot="header" class="modal-header">
+		        {{ $t('homework.modifyAcName') }}
+		    </div>
+		    <div class="edit-name-content">
+		        <p class="edit-name-label">
+		            {{$t('cusMgt.listName')}}
+		        </p>
+		        <Input v-model="currentVote.name" :placeholder="$t('homework.modifyAcNameTip')" />
+		        <Button :loading="btnLoading" @click="confirmEditName" long type="primary" class="confirm-btn">{{ $t('syllabus.confirm') }}</Button>
+		    </div>
+		</Modal>
 	</div>
 </template>
 <script>
@@ -168,6 +206,10 @@
 		},
 		data() {
 			return {
+				editTime:null,
+				editTimeStatus:false,
+				editNameStatus:false,
+				btnLoading:false,
 				isBtnLoading: false,
 				isShowDetail: false,
 				isAddActivity: false,
@@ -202,6 +244,103 @@
 			}
 		},
 		methods: {
+			/* 编辑活动结束时间或者名字 */
+			doEditAc(type,item){
+				if(type === 'time'){
+					this.editTimeStatus = true
+					this.editTime = new Date(this.currentVote.endTime)
+				}else{
+					this.editNameStatus = true
+				}
+			},
+			/* 格式化结束时间 */
+			handleTime(value) {
+			    if (value.indexOf('00:00') > 0) {
+			        value = value.replace('00:00', '23:59:59')
+			        this.editTime = value
+			    }
+			},
+			/* 确认修改结束时间 */
+			confirmEditEndtime(){
+				if (this.editTime) {
+				    this.btnLoading = true
+				    this.$api.learnActivity.updateAcInfo({
+				        id: this.currentVote.id,
+				        code: this.currentVote.code,
+				        time: this.editTime.getTime()
+				    }).then(
+				        res => {
+				            if (res.code == 200) {
+								this.voteList[this.activeVoteIndex].endTime = this.editTime.getTime()
+								this.onVoteClick(this.currentVote,this.activeVoteIndex)
+				                this.$Message.success(this.$t('learnActivity.mgtScEv.updOk'))
+				            } else {
+				                this.$Message.error(this.$t('learnActivity.mgtScEv.updErr'))
+				            }
+				        },
+				        err => {
+				            this.$Message.error(this.$t('learnActivity.mgtScEv.updErr'))
+				        }
+				    ).finally(() => {
+				        this.editTimeStatus = false
+				        this.btnLoading = false
+				    })
+				} else {
+				    this.$Message.warning(this.$t('homework.noEndTimeTip'))
+				}
+			},
+			/* 确认修改活动名称 */
+			confirmEditName() {
+			    if (this.currentVote.name.trim()) {
+			        this.btnLoading = true
+			        this.$api.learnActivity.updateAcInfo({
+			            id: this.currentVote.id,
+			            code: this.currentVote.code,
+			            name: this.currentVote.name
+			        }).then(
+			            res => {
+			                if (res.code == 200) {
+								this.voteList[this.activeVoteIndex].name = this.currentVote.name
+								this.onVoteClick(this.currentVote,this.activeVoteIndex)
+			                    this.$Message.success(this.$t('learnActivity.mgtScEv.updOk'))
+			                } else {
+			                    this.$Message.error(this.$t('learnActivity.mgtScEv.updErr'))
+			                }
+			            },
+			            err => {
+			                this.$Message.error(this.$t('learnActivity.mgtScEv.updErr'))
+			            }
+			        ).finally(() => {
+			            this.editNameStatus = false
+			            this.btnLoading = false
+			        })
+			    } else {
+			        this.$Message.warning(this.$t('homework.modifyAcNameTip'))
+			    }
+			},
+			/* 立即结束活动 */
+			handleEnd(index) {
+			    this.$Modal.confirm({
+			        title: this.$t('learnActivity.mgtScEv.stopTitle'),
+			        content: `${ this.$t('homework.endTip') } 【 ${this.currentVote.name} 】 ?`,
+			        onOk: () => {
+			            this.$api.learnActivity.FinishEva({
+			                id: this.currentVote.id,
+			                code: this.currentVote.code
+			            }).then(
+			                res => {
+			                    if (!res.error) {
+			                        this.$Message.success(this.$t('homework.endSuc'))
+			                        this.voteList[index].progress = 'finish'
+									this.onVoteClick(this.currentVote,this.activeVoteIndex)
+			                    } else {
+			                        this.$Message.error(this.$t('learnActivity.mgtScEv.actionErr'))
+			                    }
+			                }
+			            )
+			        }
+			    })
+			},
 			/* 导出表格 */
 			exportTable(){
 				const params = {
@@ -616,6 +755,20 @@
 			getCurScope() {
 				return this.$route.name === 'manageHomeWork' ? 'private' : 'school'
 			},
+			getStatusColor(){
+				return status => {
+					return status === 'pending' ? '#2d8cf0' : status === 'going' ? '#19be6b' : '#515a6e'
+				}
+			},
+			dateOpt1() {
+			    let that = this
+			    return {
+			        disabledDate(date) {
+			            let d = that.currentVote.startTime ? that.currentVote.startTime : Date.now()
+			            return d && d > date.valueOf() + 86400000
+			        }
+			    }
+			},
 		},
 		watch: {
 			$route: {

+ 2 - 1
TEAMModelOS/ClientApp/src/view/learnactivity/MgtSchoolEva.vue

@@ -83,7 +83,8 @@
                                 <Icon size="25" custom="iconfont icon-qr-code" class="qr-code-icon" />
                             </span>
                         </div>
-                        <EmptyData v-if="evaListShow.length == 0" style="margin-top:100px;" :textContent="`${scope == 'school' ? curPdInfo.name || '' : ''}${$t('learnActivity.mgtScEv.nodata')}`"></EmptyData>
+                        <!-- <EmptyData v-if="evaListShow.length == 0" style="margin-top:100px;" :textContent="`${scope == 'school' ? curPdInfo.name || '' : ''}${$t('learnActivity.mgtScEv.nodata')}`"></EmptyData> -->
+                        <EmptyData v-if="evaListShow.length == 0" style="margin-top:100px;" :textContent="`${$t('learnActivity.mgtScEv.nodata')}`"></EmptyData>
                     </vuescroll>
                 </div>
             </div>

+ 16 - 20
TEAMModelOS/ClientApp/src/view/login/Index.vue

@@ -519,26 +519,22 @@ export default {
             }
             // 登录教师端
             else {
-                this.$loginTools.teacherLogin(item, schoolCode)
-                // await this.$api.login.teacherLogin(item, schoolCode).then(res => {
-                //     result = res
-                // })
-                // //設定權限並登入
-                // User.login(result).then(res => {
-                //     if (res && identity) {
-                //         this.saveUserCodes({
-                //             TEAMModelId: result.id,
-                //             name: result.name,
-                //             schoolCode: result.defaultschool
-                //         })
-                //         let homePath = this.$store.state.config.srvAdr == 'China' ? 'home' : 'myCourse'
-                //         this.$router.push({ name: homePath })
-                //     } else {
-                //         this.identityFlag = true;
-                //     }
-                // }).finally(()=>{
-                //     this.$Spin.hide(); //關閉加載畫面
-                // })
+				/* 进行教师登录 */
+				this.$loginTools.teacherLogin(res,schoolCode).then(info => {
+					// 前往区级平台
+					if (info.toArea) {
+					    localStorage.setItem('platform', 'area')
+					    this.$router.push({ path: '/area' })
+					} else {
+						// 前往校级平台 判断是否有记录的目标地址 如果没有则按照站点来进行对应跳转固定页面
+						let targetPath = localStorage.getItem('target_path')
+						let defaultPath = this.$store.state.config.srvAdr == 'China' ? '/home' : '/home/myCourse'
+					    let homePath = targetPath ? (targetPath.includes('home/') ? targetPath : defaultPath) : defaultPath
+					    localStorage.setItem('platform', 'school')
+						localStorage.setItem('target_path','')
+					    this.$router.push({ path: homePath })
+					}
+				})
             }
         },
         saveUserCodes: function (res) {

+ 12 - 5
TEAMModelOS/ClientApp/src/view/login/page/Student.vue

@@ -457,12 +457,20 @@
 									this.loginErrText = this.$t('login.apiError.text1')
 									this.loading = false
 								} else {
-									localStorage.setItem("access_token", result.access_token)
-									this.$loginTools.stuLoginById(result.id_token)
+									this.$loginTools.stuLoginById(result)
 								}
 								break;
 							case 'studForm':
-								this.$loginTools.stuLoginByAccount({ school_code: this.studForm.schoolCode,id: this.studForm.id,pw: this.studForm.pass })
+								this.$loginTools.stuLoginByAccount({ school_code: this.studForm.schoolCode,id: this.studForm.id,pw: this.studForm.pass }).then(res => {
+									sessionStorage.setItem('identity', 'student')
+									let targetPath = localStorage.getItem('target_path')
+									let toPath = targetPath ? (targetPath.includes('studentWeb/') ? targetPath : '/studentWeb') : '/studentWeb'
+									this.$router.push({ path: toPath })
+									localStorage.setItem('target_path','')
+								}).catch(e => {
+									this.$Message.warning(e.message)
+									this.loading = false
+								})
 								break;
 						}
 						return false;
@@ -481,8 +489,7 @@
 					this.$Spin.hide(); // 關閉加載畫面
 					if (!res.error) {
 						// 登入大雲開始
-						localStorage.setItem("access_token", res.access_token)
-                        this.$loginTools.stuLoginById(res.id_token)
+                        this.$loginTools.stuLoginById(res)
 					} else {
 						this.$Message.warning(this.$t('login.sse.error.text1'));
 					}

+ 32 - 22
TEAMModelOS/ClientApp/src/view/login/page/Teacher.vue

@@ -325,26 +325,22 @@ export default {
                         this.loginErrText = this.$t('login.apiError.text1')
                         this.loading = false
                     } else {
-                        // console.log('登录数据', result, this.defaultSchool.code)
-                        // if (this.loginType === 'trainsso') {
-                        //     this.$Modal.confirm({
-                        //         title: '账号绑定',
-                        //         content: `登录成功,是否应用此账号绑定省平台账号?`,
-                        //         okText: '是',
-                        //         cancelText: '否',
-                        //         onOk: () => {
-                        //             console.log(result)
-                        //             this.bandingID(result.id_token, result)
-
-                        //         },
-                        //         onCancel: () => {
-                        //             //不绑定处理逻辑
-                        //         }
-                        //     })
-                        // } else {
-                        // this.loginProcess(result, this.defaultSchool.code)
-						this.$loginTools.teacherLogin(result)
-                        // }
+						/* 进行教师登录 */
+						this.$loginTools.teacherLogin(result).then(info => {
+							// 前往区级平台
+							if (info.toArea) {
+							    localStorage.setItem('platform', 'area')
+							    this.$router.push({ path: '/area' })
+							} else {
+								// 前往校级平台 判断是否有记录的目标地址 如果没有则按照站点来进行对应跳转固定页面
+								let targetPath = localStorage.getItem('target_path')
+								let defaultPath = this.$store.state.config.srvAdr == 'China' ? '/home' : '/home/myCourse'
+							    let homePath = targetPath ? (targetPath.includes('home/') ? targetPath : defaultPath) : defaultPath
+							    localStorage.setItem('platform', 'school')
+								localStorage.setItem('target_path','')
+							    this.$router.push({ path: homePath })
+							}
+						})
                     }
                 }
             })
@@ -490,8 +486,22 @@ export default {
             this.$api.SSOLogin(code).then(async res => {
                 this.$Spin.hide(); // 關閉加載畫面
                 if (!res.error) {
-                    // 登入大雲開始
-					this.$loginTools.teacherLogin(res)
+					/* 进行教师登录 */
+					this.$loginTools.teacherLogin(res).then(info => {
+						// 前往区级平台
+						if (info.toArea) {
+						    localStorage.setItem('platform', 'area')
+						    this.$router.push({ path: '/area' })
+						} else {
+							// 前往校级平台 判断是否有记录的目标地址 如果没有则按照站点来进行对应跳转固定页面
+							let targetPath = localStorage.getItem('target_path')
+							let defaultPath = this.$store.state.config.srvAdr == 'China' ? '/home' : '/home/myCourse'
+						    let homePath = targetPath ? (targetPath.includes('home/') ? targetPath : defaultPath) : defaultPath
+						    localStorage.setItem('platform', 'school')
+							localStorage.setItem('target_path','')
+						    this.$router.push({ path: homePath })
+						}
+					})
                     // this.loginProcess(res, this.defaultSchool.code)
                 } else {
                     this.$Message.warning(this.$t('login.sse.error.text1'));

+ 43 - 21
TEAMModelOS/ClientApp/src/view/questionnaire/ManageQuestionnaire.less

@@ -156,41 +156,63 @@
             .qn-item {
                 width: 100%;
                 padding: 15px;
-                // border-bottom: 1px solid #c7c7c7;
+                border-bottom: 1px solid #ebebeb;
                 cursor: pointer;
-
+                // &:first-child {
+                //     .item-active;
+                // }
+            
                 &:hover {
-                    .item-active;
+                    // .item-active;
+                    background-color: var(--hover-text-color);
+            		.ac-edit-icon{
+            			display: unset;
+            		}
                 }
-
+            	
+            	.ac-edit-icon{
+            		display: none;
+            	}
+            
                 &-name {
-                    font-size: @second-fontSize;
+                    font-size: 16px;
                     color: @primary-textColor;
                     // font-weight: bold;
-					word-break: break-all;
+            		word-break: break-all;
                 }
-
+            
                 &-info {
                     font-size: 12px;
                     color: @second-textColor;
-                    margin-top: 10px;
+                    margin-top: 2px;
+            		display: flex;
+            		flex-direction: column;
                 }
-
+            
                 &-status {
-                    padding: 0 5px;
-                    background: @status-pending;
-                    color: #fff;
-                    display: inline-block;
-                    border-radius: 5px;
+            		span{
+            			display: inline-block;
+            			border: 1px solid;
+            			border-radius: 2px;
+            			padding: 1px 2px;
+            			white-space: nowrap;
+            			font-size: 12px;
+            			margin-right: 4px;
+            		}
                 }
-
+            
                 &-nums {
-					display: inline-block;
-					margin: 0 20px 5px 0;
-
-					.ivu-icon{
-						color: #70B1E7;
-					}
+            		display: inline-flex;
+            		flex-direction: column;
+            		margin: 0 20px 5px 0;
+            		
+            		.time-item{
+            			padding: 1px 0;
+            		}
+            
+                    .ivu-icon{
+                        color: #70B1E7;
+                    }
                 }
             }
         }

+ 158 - 9
TEAMModelOS/ClientApp/src/view/questionnaire/ManageQuestionnaire.vue

@@ -33,19 +33,27 @@
 									<div :class="['qn-item',index === activeQnIndex ? 'item-active' : '']"
 										v-for="(item, index) in qnList" :key="index" @click="onQnClick(item, index)">
 										<p class="qn-item-name">
-											<span class="owner-tag" v-if="item.owner === 'school'">{{ $t('learnActivity.school') }}</span>
-											<span class="owner-tag" v-if="item.owner === 'area'" style="background-color: #dc6f28;">{{ $t('learnActivity.area') }}</span>
 											{{ item.name }}
+											<Icon type="md-create" class="ac-edit-icon" color="#12cce8" size="16" @click="doEditAc('name')" :title="$t('homework.modifyAcName')" v-if="item.id"/>
 										</p>
 										<div class="qn-item-info">
 											<span class="qn-item-nums">
-												<Icon type="md-time" size="14" style="margin-right: 5px" />
-												{{ $tools.formatTime(item.startTime,'yyyy-MM-dd hh:mm') }}
-											</span>
-											<span class="qn-item-status"
-												:style="{ background: item.progress === 'pending' ? '#0BADD4'  : item.progress === 'going' ? '#1fb06d' : '#afb0af', }">
-												{{ item.progress === "pending" ? $t('survey.pending') : item.progress === "going"  ? $t('survey.going') : $t('survey.finish')  }}
+												<span class="time-item">
+													<Icon type="md-time" size="14" style="margin-right:5px" />
+													<span>{{ $t('learnActivity.createEv.startTime') }}:</span>
+													{{ $tools.formatTime(item.startTime || item.createTime,'yyyy-MM-dd hh:mm') }}
+												</span>
+												<span class="time-item">
+													<Icon type="md-time" size="14" style="margin-right:5px" />
+													<span>{{ $t('learnActivity.createEv.endTime') }}:</span>
+													{{ $tools.formatTime(item.endTime,'yyyy-MM-dd hh:mm') }}
+													<Icon type="md-create" class="ac-edit-icon" size="14" v-if="item.progress == 'going'" @click="doEditAc('time')" :title="$t('homework.modifyAcTime')" />
+												</span>
 											</span>
+											<div class="qn-item-status">
+												<span :style="{ color:getStatusColor(item.progress),borderColor:getStatusColor(item.progress) }">{{ item.progress === 'pending' ? $t('vote.pending') : item.progress === 'going' ? $t('vote.going') : $t('vote.finish') }}</span>
+												<span style="background: #ed4014;color: #fff;" v-if="item.progress === 'going'" @click="handleEnd(index)">{{$t('learnActivity.mgtScEv.stop')}}</span>
+											</div>
 										</div>
 									</div>
 								</div>
@@ -174,6 +182,32 @@
 				</div>
 			</Split>
 		</div>
+		<!-- 修改活动结束时间 -->
+		<Modal v-model="editTimeStatus" footer-hide className="ed-name-modal">
+		    <div slot="header" class="modal-header">
+		        {{$t('learnActivity.mgtScEv.editEndTime')}}
+		    </div>
+		    <div class="edit-name-content">
+		        <p class="edit-name-label">
+		            {{$t('cusMgt.listName')}}
+		        </p>
+		        <DatePicker v-model="editTime" :options="dateOpt1" type="datetime" @on-change="handleTime" format="yyyy-MM-dd HH:mm" :placeholder="$t('homework.modifyAcTimeTip')" style="width: 100%"></DatePicker>
+		        <Button :loading="btnLoading" @click="confirmEditEndtime" long type="primary" class="confirm-btn">{{ $t('syllabus.confirm') }}</Button>
+		    </div>
+		</Modal>
+		<!-- 修改活动名称 -->
+		<Modal v-model="editNameStatus" footer-hide className="ed-name-modal" @on-ok="confirmEditName">
+		    <div slot="header" class="modal-header">
+		        {{ $t('homework.modifyAcName') }}
+		    </div>
+		    <div class="edit-name-content">
+		        <p class="edit-name-label">
+		            {{$t('cusMgt.listName')}}
+		        </p>
+		        <Input v-model="currentQn.name" :placeholder="$t('homework.modifyAcNameTip')" />
+		        <Button :loading="btnLoading" @click="confirmEditName" long type="primary" class="confirm-btn">{{ $t('syllabus.confirm') }}</Button>
+		    </div>
+		</Modal>
 	</div>
 </template>
 <script>
@@ -193,6 +227,10 @@
 		},
 		data() {
 			return {
+				editTime:null,
+				editTimeStatus:false,
+				editNameStatus:false,
+				btnLoading:false,
 				split1: 0.2,
 				split2: 0.35,
 				tabIndex: 0,
@@ -227,6 +265,103 @@
 
 		},
 		methods: {
+			/* 编辑活动结束时间或者名字 */
+			doEditAc(type,item){
+				if(type === 'time'){
+					this.editTimeStatus = true
+					this.editTime = new Date(this.currentQn.endTime)
+				}else{
+					this.editNameStatus = true
+				}
+			},
+			/* 格式化结束时间 */
+			handleTime(value) {
+			    if (value.indexOf('00:00') > 0) {
+			        value = value.replace('00:00', '23:59:59')
+			        this.editTime = value
+			    }
+			},
+			/* 确认修改结束时间 */
+			confirmEditEndtime(){
+				if (this.editTime) {
+				    this.btnLoading = true
+				    this.$api.learnActivity.updateAcInfo({
+				        id: this.currentQn.id,
+				        code: this.currentQn.code,
+				        time: this.editTime.getTime()
+				    }).then(
+				        res => {
+				            if (res.code == 200) {
+								this.qnList[this.activeQnIndex].endTime = this.editTime.getTime()
+								this.onQnClick(this.currentQn,this.activeQnIndex)
+				                this.$Message.success(this.$t('learnActivity.mgtScEv.updOk'))
+				            } else {
+				                this.$Message.error(this.$t('learnActivity.mgtScEv.updErr'))
+				            }
+				        },
+				        err => {
+				            this.$Message.error(this.$t('learnActivity.mgtScEv.updErr'))
+				        }
+				    ).finally(() => {
+				        this.editTimeStatus = false
+				        this.btnLoading = false
+				    })
+				} else {
+				    this.$Message.warning(this.$t('homework.noEndTimeTip'))
+				}
+			},
+			/* 确认修改活动名称 */
+			confirmEditName() {
+			    if (this.currentQn.name.trim()) {
+			        this.btnLoading = true
+			        this.$api.learnActivity.updateAcInfo({
+			            id: this.currentQn.id,
+			            code: this.currentQn.code,
+			            name: this.currentQn.name
+			        }).then(
+			            res => {
+			                if (res.code == 200) {
+								this.qnList[this.activeQnIndex].name = this.currentQn.name
+								this.onQnClick(this.currentQn,this.activeQnIndex)
+			                    this.$Message.success(this.$t('learnActivity.mgtScEv.updOk'))
+			                } else {
+			                    this.$Message.error(this.$t('learnActivity.mgtScEv.updErr'))
+			                }
+			            },
+			            err => {
+			                this.$Message.error(this.$t('learnActivity.mgtScEv.updErr'))
+			            }
+			        ).finally(() => {
+			            this.editNameStatus = false
+			            this.btnLoading = false
+			        })
+			    } else {
+			        this.$Message.warning(this.$t('homework.modifyAcNameTip'))
+			    }
+			},
+			/* 立即结束活动 */
+			handleEnd(index) {
+			    this.$Modal.confirm({
+			        title: this.$t('learnActivity.mgtScEv.stopTitle'),
+			        content: `${ this.$t('homework.endTip') } 【 ${this.currentQn.name} 】 ?`,
+			        onOk: () => {
+			            this.$api.learnActivity.FinishEva({
+			                id: this.currentQn.id,
+			                code: this.currentQn.code
+			            }).then(
+			                res => {
+			                    if (!res.error) {
+			                        this.$Message.success(this.$t('homework.endSuc'))
+			                        this.qnList[index].progress = 'finish'
+									this.onQnClick(this.currentQn,this.activeQnIndex)
+			                    } else {
+			                        this.$Message.error(this.$t('learnActivity.mgtScEv.actionErr'))
+			                    }
+			                }
+			            )
+			        }
+			    })
+			},
 			// 校本课纲与个人课纲切换
 			handleTabClick(index) {
 				this.tabIndex = index;
@@ -1180,7 +1315,21 @@
 				return owner => {
 					return this.$route.name !== 'manageAreaQuestionnaire' && owner === 'area'
 				}
-			}
+			},
+			getStatusColor(){
+				return status => {
+					return status === 'pending' ? '#2d8cf0' : status === 'going' ? '#19be6b' : '#515a6e'
+				}
+			},
+			dateOpt1() {
+			    let that = this
+			    return {
+			        disabledDate(date) {
+			            let d = that.currentQn.startTime ? that.currentQn.startTime : Date.now()
+			            return d && d > date.valueOf() + 86400000
+			        }
+			    }
+			},
 		},
 		watch: {
 			$route: {

+ 8 - 3
TEAMModelOS/ClientApp/src/view/shareSyllabus/ShareSyllabus.vue

@@ -8,7 +8,7 @@
 			</p>
 			<div v-show="isJoin || isRep" style="margin-bottom:50px">
 				<Icon type="md-checkmark-circle-outline" color="#19be6b" size="120" />
-				<p v-if="isJoin" class="success-tips">{{ $t('syllabus.receivedSuc') }}</p>
+				<p v-if="isJoin" class="success-tips">{{ $t('syllabus.receivedSuc1') }} <span @click="goSyllabus" style="text-decoration: underline;color: #19BF6C;cursor: pointer;">{{ $t('syllabus.receivedSuc2') }}</span> {{ $t('syllabus.receivedSuc3') }}</p>
 				<!-- <p v-else-if="isRep" class="success-tips">您已收藏成功,请勿重复操作!</p> -->
 			</div>
 			<p v-show="!isJoin && !isRep" class="course-name">{{ params.name }}</p>
@@ -106,7 +106,9 @@
 							if (tokenData) {
 								this.userId = tokenData.sub
 								this.userName = tokenData.name
-								this.doShare()
+								this.$loginTools.teacherLogin(res).then(info => {
+									this.doShare()
+								})
 							} else {
 								this.$Message.error(this.$t('cusMgt.join.parseErr'))
 							}
@@ -124,6 +126,9 @@
 			this.isPC = !(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent))
 		},
 		methods: {
+			goSyllabus(){
+				this.$router.push('/home/personalSyllabus')
+			},
 			/* 根据册别查询对应课纲树形结构 */
 			getTreeByVolumeId(volume) {
 				return new Promise((r, j) => {
@@ -170,7 +175,7 @@
 				}
 				this.$api.syllabus.ShareTree(params).then(res => {
 					if(!res.error && res.code === 200){
-						this.$Message.success(this.$t('syllabus.receivedSuc'))
+						this.$Message.success(this.$t('syllabus.doSuc'))
 						this.isJoin = true
 					}else{
 						this.$Message.success(this.$t('syllabus.saveFailTip'))

+ 16 - 25
TEAMModelOS/ClientApp/src/view/sso/Index.vue

@@ -94,32 +94,23 @@ export default {
         },
         loginProcess(idRes) { // 登入用function
             this.clearData() //这里暂定解决登录失败的问题
-            // localStorage.setItem("id_token", idRes.id_token)
-            // localStorage.setItem("access_token", idRes.access_token)
-            // localStorage.setItem("expires_in", idRes.expires_in)
 			sessionStorage.setItem('identity','teacher')
-            this.$loginTools.teacherLogin(idRes)
-			// this.$api.login.teacherLogin(idRes).then(res => {
-            //     //設定權限並登入
-            //     User.login(res).then(res => {
-            //         if (res) {
-            //             this.$store.commit('setUserInfo', {
-            //                 TEAMModelId: res.id,
-            //                 name: res.name,
-            //                 schoolCode: res.defaultschool
-            //             })
-            //             if (res.toArea) {
-            //                 localStorage.setItem('platform', 'area')
-            //                 this.$router.push({ path: '/area' })
-            //             } else {
-            //                 localStorage.setItem('platform', 'school')
-            //                 let homePath = this.$store.state.config.srvAdr == 'China' ? 'home' : 'myCourse'
-            //                 this.$router.push({ name: homePath })
-            //             }
-            //         }
-            //     })
-            // })
-
+			/* 进行教师登录 */
+			this.$loginTools.teacherLogin(idRes).then(info => {
+				// 前往区级平台
+				if (info.toArea) {
+				    localStorage.setItem('platform', 'area')
+				    this.$router.push({ path: '/area' })
+				} else {
+					// 前往校级平台 判断是否有记录的目标地址 如果没有则按照站点来进行对应跳转固定页面
+					let targetPath = localStorage.getItem('target_path')
+					let defaultPath = this.$store.state.config.srvAdr == 'China' ? '/home' : '/home/myCourse'
+				    let homePath = targetPath ? (targetPath.includes('home/') ? targetPath : defaultPath) : defaultPath
+				    localStorage.setItem('platform', 'school')
+					localStorage.setItem('target_path','')
+				    this.$router.push({ path: homePath })
+				}
+			})
         },
     },
     created() {

+ 26 - 9
TEAMModelOS/ClientApp/src/view/vote/ManageVote.less

@@ -133,9 +133,8 @@
 
             .hw-item {
                 width: 100%;
-                height: 90px;
                 padding: 15px;
-                // border-bottom: 1px solid #c7c7c7;
+                border-bottom: 1px solid #ebebeb;
                 cursor: pointer;
 
                 // &:first-child {
@@ -145,7 +144,14 @@
                 &:hover {
                     // .item-active;
                     background-color: var(--hover-text-color);
+					.ac-edit-icon{
+						display: unset;
+					}
                 }
+				
+				.ac-edit-icon{
+					display: none;
+				}
 
                 &-name {
                     font-size: @title-fontSize;
@@ -157,20 +163,31 @@
                 &-info {
                     font-size: 12px;
                     color: @second-textColor;
-                    margin-top: 10px;
+                    margin-top: 2px;
+					display: flex;
+					flex-direction: column;
                 }
 
                 &-status {
-                    padding: 0 5px;
-                    background: @status-pending;
-                    color: #fff;
-                    display: inline-block;
-                    border-radius: 5px;
+					span{
+						display: inline-block;
+						border: 1px solid;
+						border-radius: 2px;
+						padding: 1px 2px;
+						white-space: nowrap;
+						font-size: 12px;
+						margin-right: 4px;
+					}
                 }
 
                 &-nums {
-					display: inline-block;
+					display: inline-flex;
+					flex-direction: column;
 					margin: 0 20px 5px 0;
+					
+					.time-item{
+						padding: 1px 0;
+					}
 
                     .ivu-icon{
                         color: #70B1E7;

+ 233 - 42
TEAMModelOS/ClientApp/src/view/vote/ManageVote.vue

@@ -26,17 +26,30 @@
 									<div :class='["hw-item",index === activeVoteIndex ? "item-active":""]'
 										v-for="(item,index) in voteList" :key="index" @click="onVoteClick(item,index)">
 										<p class="hw-item-name">
-											<span class="owner-tag" v-if="item.owner === 'school'">{{ $t('learnActivity.school') }}</span>
-											<span class="owner-tag" v-if="item.owner === 'area'" style="background-color: #dc6f28;">{{ $t('learnActivity.area') }}</span>
 											{{ item.name }}
+											<Icon type="md-create" class="ac-edit-icon" color="#12cce8" size="16" @click="doEditAc('name')" title="修改活动名称" v-if="item.id"/>
 										</p>
 										<div class="hw-item-info">
 											<span class="hw-item-nums">
-												<Icon type="md-time" size="14" style="margin-right:5px" />
-												{{ $tools.formatTime(item.startTime || item.createTime,'yyyy-MM-dd hh:mm') }}
+												<span class="time-item">
+													<Icon type="md-time" size="14" style="margin-right:5px" />
+													<span>{{ $t('learnActivity.createEv.startTime') }}:</span>
+													{{ $tools.formatTime(item.startTime || item.createTime,'yyyy-MM-dd hh:mm') }}
+												</span>
+												<span class="time-item">
+													<Icon type="md-time" size="14" style="margin-right:5px" />
+													<span>{{ $t('learnActivity.createEv.endTime') }}:</span>
+													{{ $tools.formatTime(item.endTime,'yyyy-MM-dd hh:mm') }}
+													<Icon type="md-create" class="ac-edit-icon" size="14" v-if="item.progress == 'going'" @click="doEditAc('time')" title="修改活动结束时间" />
+												</span>
 											</span>
-											<span class="hw-item-status"
-												:style="{ background: (item.progress === 'pending' ? '#0BADD4' : item.progress === 'going' ? '#1fb06d' : '#949594')}">{{ item.progress === 'pending' ? $t('vote.pending') : item.progress === 'going' ? $t('vote.going') : $t('vote.finish') }}</span>
+											<div class="hw-item-status">
+												<span style="color: #2eafea;border-color: #2eafea;" v-if="item.owner === 'school'">{{ $t('learnActivity.school') }}</span>
+												<span style="color: #ca7617;border-color: #ca7617;" v-if="item.owner === 'area'">{{ $t('learnActivity.area') }}</span>
+												<span :style="{ color:getStatusColor(item.progress),borderColor:getStatusColor(item.progress) }">{{ item.progress === 'pending' ? $t('vote.pending') : item.progress === 'going' ? $t('vote.going') : $t('vote.finish') }}</span>
+												<span :style="{ color:'#ff8229' ,borderColor:'#ff8229' }" v-if="item.secret">匿名投票</span>
+												<span style="background: #ed4014;color: #fff;" v-if="item.progress === 'going'" @click="handleEnd(index)">{{$t('learnActivity.mgtScEv.stop')}}</span>
+											</div>
 										</div>
 									</div>
 								</div>
@@ -118,6 +131,32 @@
 				</div>
 			</Split>
 		</div>
+		<!-- 修改活动结束时间 -->
+		<Modal v-model="editTimeStatus" footer-hide className="ed-name-modal">
+		    <div slot="header" class="modal-header">
+		        {{$t('learnActivity.mgtScEv.editEndTime')}}
+		    </div>
+		    <div class="edit-name-content">
+		        <p class="edit-name-label">
+		            {{$t('cusMgt.listName')}}
+		        </p>
+		        <DatePicker v-model="editTime" :options="dateOpt1" type="datetime" @on-change="handleTime" format="yyyy-MM-dd HH:mm" :placeholder="$t('homework.modifyAcTimeTip')" style="width: 100%"></DatePicker>
+		        <Button :loading="btnLoading" @click="confirmEditEndtime" long type="primary" class="confirm-btn">{{ $t('syllabus.confirm') }}</Button>
+		    </div>
+		</Modal>
+		<!-- 修改活动名称 -->
+		<Modal v-model="editNameStatus" footer-hide className="ed-name-modal" @on-ok="confirmEditName">
+		    <div slot="header" class="modal-header">
+		        {{ $t('homework.modifyAcName') }}
+		    </div>
+		    <div class="edit-name-content">
+		        <p class="edit-name-label">
+		            {{$t('cusMgt.listName')}}
+		        </p>
+		        <Input v-model="currentVote.name" :placeholder="$t('homework.modifyAcNameTip')" />
+		        <Button :loading="btnLoading" @click="confirmEditName" long type="primary" class="confirm-btn">{{ $t('syllabus.confirm') }}</Button>
+		    </div>
+		</Modal>
 	</div>
 </template>
 <script>
@@ -136,9 +175,13 @@
 		},
 		data() {
 			return {
+				editTime:null,
+				editTimeStatus:false,
+				editNameStatus:false,
 				split1: 0.2,
 				split2: 0.35,
 				tabIndex: 0,
+				btnLoading:false,
 				hasNewAdd: false,
 				isLoading: false,
 				isLoadList: false,
@@ -164,7 +207,103 @@
 		},
 		created() {},
 		methods: {
-
+			/* 编辑活动结束时间或者名字 */
+			doEditAc(type,item){
+				if(type === 'time'){
+					this.editTimeStatus = true
+					this.editTime = new Date(this.currentVote.endTime)
+				}else{
+					this.editNameStatus = true
+				}
+			},
+			/* 格式化结束时间 */
+			handleTime(value) {
+			    if (value.indexOf('00:00') > 0) {
+			        value = value.replace('00:00', '23:59:59')
+			        this.editTime = value
+			    }
+			},
+			/* 确认修改结束时间 */
+			confirmEditEndtime(){
+				if (this.editTime) {
+				    this.btnLoading = true
+				    this.$api.learnActivity.updateAcInfo({
+				        id: this.currentVote.id,
+				        code: this.currentVote.code,
+				        time: this.editTime.getTime()
+				    }).then(
+				        res => {
+				            if (res.code == 200) {
+								this.voteList[this.activeVoteIndex].endTime = this.editTime.getTime()
+								this.onVoteClick(this.currentVote,this.activeVoteIndex)
+				                this.$Message.success(this.$t('learnActivity.mgtScEv.updOk'))
+				            } else {
+				                this.$Message.error(this.$t('learnActivity.mgtScEv.updErr'))
+				            }
+				        },
+				        err => {
+				            this.$Message.error(this.$t('learnActivity.mgtScEv.updErr'))
+				        }
+				    ).finally(() => {
+				        this.editTimeStatus = false
+				        this.btnLoading = false
+				    })
+				} else {
+				    this.$Message.warning(this.$t('homework.noEndTimeTip'))
+				}
+			},
+			/* 确认修改活动名称 */
+			confirmEditName() {
+			    if (this.currentVote.name.trim()) {
+			        this.btnLoading = true
+			        this.$api.learnActivity.updateAcInfo({
+			            id: this.currentVote.id,
+			            code: this.currentVote.code,
+			            name: this.currentVote.name
+			        }).then(
+			            res => {
+			                if (res.code == 200) {
+								this.voteList[this.activeVoteIndex].name = this.currentVote.name
+								this.onVoteClick(this.currentVote,this.activeVoteIndex)
+			                    this.$Message.error(this.$t('learnActivity.mgtScEv.updOk'))
+			                } else {
+			                    this.$Message.error(this.$t('learnActivity.mgtScEv.updErr'))
+			                }
+			            },
+			            err => {
+			                this.$Message.error(this.$t('learnActivity.mgtScEv.updErr'))
+			            }
+			        ).finally(() => {
+			            this.editNameStatus = false
+			            this.btnLoading = false
+			        })
+			    } else {
+			        this.$Message.warning(this.$t('homework.modifyAcNameTip'))
+			    }
+			},
+			/* 立即结束活动 */
+			handleEnd(index) {
+			    this.$Modal.confirm({
+			        title: this.$t('learnActivity.mgtScEv.stopTitle'),
+			        content: `${ this.$t('homework.endTip') } 【 ${this.currentVote.name} 】 ?`,
+			        onOk: () => {
+			            this.$api.learnActivity.FinishEva({
+			                id: this.currentVote.id,
+			                code: this.currentVote.code
+			            }).then(
+			                res => {
+			                    if (!res.error) {
+			                        this.$Message.success(this.$t('homework.endSuc'))
+			                        this.voteList[index].progress = 'finish'
+									this.onVoteClick(this.currentVote,this.activeVoteIndex)
+			                    } else {
+			                        this.$Message.error(this.$t('learnActivity.mgtScEv.actionErr'))
+			                    }
+			                }
+			            )
+			        }
+			    })
+			},
 			// 校本课纲与个人课纲切换
 			handleTabClick(index) {
 				this.tabIndex = index
@@ -269,7 +408,7 @@
 								i.id === queryId)[0] : list[0]
 							let queryIndex = queryId ? list.indexOf(queryVote) : 0
 							this.isFromRecord = Boolean(queryId)
-							this.onVoteClick(queryVote, queryIndex)
+							this.onVoteClick(queryVote, queryIndex,false)
 						} else {
 							this.voteList = []
 						}
@@ -312,37 +451,73 @@
 			 * @param item
 			 * @param index
 			 */
-			async onVoteClick(item, index) {
-				console.log(item)
-				let fullItem = item.id ? await this.getVoteDetails(item) : item
-				console.log(fullItem)
-				this.currentVote = fullItem
-				this.activeVoteIndex = index
-				/* 如果是区级的活动 则需要根据recordUrl去换取区级活动的作答数据 */
-				if (this.isAreaVote && item.id) {
-					this.areaVoteTeachers = []
-					this.areaSchIndex = 0
-					this.areaSchList = this.areaRecord.map(i => i.name)
-					this.areaRecord.length && this.getAreaRecord(0)
-				}else{
-					/* 其余类型活动则需要去根据发布对象获取对应的作答数据 */
-					if (item.id && item.progress !== 'pending'){
-						if(fullItem.targetType === 'research'){
-							this.getVoteTeachers(fullItem, fullItem.tchLists)
-						}else{
-							this.getVoteStudents(fullItem, fullItem.classes)
+			async onVoteClick(item, index, needJudge = true) {
+				// 如果从未保存的活动跳到已有活动 则需要提示
+				if(!this.currentVote.id && item.id && needJudge){
+					this.$Modal.confirm({
+						title: this.$t('survey.questionaire.confirmTitle'),
+						content: this.$t('homework.noSaveTip'),
+						onOk: async () => {
+							this.voteList.splice(0,1)
+							index = index - 1
+							let fullItem = item.id ? await this.getVoteDetails(item) : item
+							console.log(fullItem)
+							this.currentVote = fullItem
+							this.activeVoteIndex = index
+							this.isAddActivity = false
+							/* 其余类型活动则需要去根据发布对象获取对应的作答数据 */
+							if (item.id && item.progress !== 'pending') {
+								this.getVoteStudents(fullItem, fullItem.classes)
+							}
+							
+							if (this.$refs.voteForm && this.$refs.voteFormScroll) {
+								this.$refs.voteForm.voteFormEdit = false
+								this.$refs.voteFormScroll.scrollTo({
+										y: 0,
+									},
+									200,
+									"easeInQuad"
+								);
+							}
+							
+							this.hasNewAdd = false
+							this.isOptionView = true
+						},
+						onCancel: () => {
+							console.log(this.currentVote)
 						}
-					} 
+					});
+				}else{
+					let fullItem = item.id ? await this.getVoteDetails(item) : item
+					console.log(fullItem)
+					this.currentVote = fullItem
+					this.activeVoteIndex = index
+					/* 如果是区级的活动 则需要根据recordUrl去换取区级活动的作答数据 */
+					if (this.isAreaVote && item.id) {
+						this.areaVoteTeachers = []
+						this.areaSchIndex = 0
+						this.areaSchList = this.areaRecord.map(i => i.name)
+						this.areaRecord.length && this.getAreaRecord(0)
+					}else{
+						/* 其余类型活动则需要去根据发布对象获取对应的作答数据 */
+						if (item.id && item.progress !== 'pending'){
+							if(fullItem.targetType === 'research'){
+								this.getVoteTeachers(fullItem, fullItem.tchLists)
+							}else{
+								this.getVoteStudents(fullItem, fullItem.classes)
+							}
+						} 
+					}
+					this.$refs.voteForm && (this.$refs.voteForm.voteFormEdit = false)
+					this.$refs.voteFormScroll.scrollTo({
+							y: 0,
+						},
+						200,
+						"easeInQuad"
+					);
+					this.hasNewAdd = false
+					this.isOptionView = true
 				}
-				this.$refs.voteForm && (this.$refs.voteForm.voteFormEdit = false)
-				this.$refs.voteFormScroll.scrollTo({
-						y: 0,
-					},
-					200,
-					"easeInQuad"
-				);
-				this.hasNewAdd = false
-				this.isOptionView = true
 			},
 			
 			/* 获取区级活动的作答数据 */
@@ -540,9 +715,10 @@
 								scope: this.getCurScope
 							}).then(res => {
 								if (!res.error && res.flag) {
-									console.log(this.voteList.indexOf(this.currentVote))
-									this.voteList.splice(this.voteList.reverse().indexOf(this
-										.currentVote), 1)
+									let newIndex = this.activeVoteIndex === this.voteList.length - 1 ? (this.activeVoteIndex - 1) : this.activeVoteIndex
+									this.voteList.splice(this.activeVoteIndex, 1)
+									this.activeVoteIndex = newIndex
+									if (this.voteList.length) this.onVoteClick(this.voteList[newIndex], newIndex, false)
 									setTimeout(() => {
 										this.isLoading = false
 										this.$Message.success(this.$t('vote.deleteSuc'))
@@ -564,8 +740,9 @@
 						} else {
 							this.voteList.splice(this.voteList.indexOf(this.currentVote), 1)
 							this.isLoading = false
+							this.isAddActivity = false
 							this.$Message.success(this.$t('vote.deleteSuc'))
-							if (this.voteList.length) this.onVoteClick(this.voteList[0], 0)
+							if (this.voteList.length) this.onVoteClick(this.voteList[0], 0,false)
 						}
 					}
 				})
@@ -801,7 +978,21 @@
 				return owner => {
 					return this.$route.name !== 'manageAreaVote' && owner === 'area'
 				}
-			}
+			},
+			getStatusColor(){
+				return status => {
+					return status === 'pending' ? '#2d8cf0' : status === 'going' ? '#19be6b' : '#515a6e'
+				}
+			},
+			dateOpt1() {
+			    let that = this
+			    return {
+			        disabledDate(date) {
+			            let d = that.currentVote.startTime ? that.currentVote.startTime : Date.now()
+			            return d && d > date.valueOf() + 86400000
+			        }
+			    }
+			},
 			
 		},
 		watch: {

+ 1 - 1
TEAMModelOS/Controllers/Teacher/TeacherCommonController.cs

@@ -147,7 +147,7 @@ namespace TEAMModelOS.Controllers
             }
             List<CourseCount> schoolCourse = new List<CourseCount>();
             if (!string.IsNullOrEmpty(school)) {
-                await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryIterator<CourseCount>(courseSql, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Course-{school}") }))
+                await foreach (var item in client.GetContainer(Constant.TEAMModelOS, Constant.School).GetItemQueryIterator<CourseCount>(courseSql, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Course-{school}") }))
                 {   
                     schoolCourse.Add(item);
                 }