ソースを参照

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

zhouj1203@hotmail.com 4 年 前
コミット
abc168a75a
41 ファイル変更768 行追加636 行削除
  1. 89 1
      TEAMModelFunction/ActivityHttpTrigger.cs
  2. 2 2
      TEAMModelGrpc/Startup.cs
  3. 0 20
      TEAMModelOS.SDK/Extension/DataResult/JsonRequest/AzureJsonRequest.cs
  4. 0 16
      TEAMModelOS.SDK/Extension/DataResult/JsonRequest/BaseJosnRequest.cs
  5. 0 14
      TEAMModelOS.SDK/Extension/DataResult/JsonRequest/JosnRequest.cs
  6. 0 15
      TEAMModelOS.SDK/Extension/DataResult/JsonRequest/PaginationRequest.cs
  7. 0 13
      TEAMModelOS.SDK/Extension/DataResult/JsonResponse/BaseResponse.cs
  8. 0 19
      TEAMModelOS.SDK/Extension/DataResult/JsonResponse/DataJsonResponse.cs
  9. 0 14
      TEAMModelOS.SDK/Extension/DataResult/JsonResponse/EmptyJosnResponse.cs
  10. 0 19
      TEAMModelOS.SDK/Extension/DataResult/JsonResponse/ErrorJosnResponse.cs
  11. 0 15
      TEAMModelOS.SDK/Extension/DataResult/JsonResponse/ErrorModel.cs
  12. 0 16
      TEAMModelOS.SDK/Extension/DataResult/JsonResponse/JsonRPCResult.cs
  13. 0 20
      TEAMModelOS.SDK/Extension/DataResult/JsonResponse/PageJosnResponse.cs
  14. 0 15
      TEAMModelOS.SDK/Extension/DataResult/JsonResponse/PageJsonResult.cs
  15. 0 175
      TEAMModelOS.SDK/Extension/DataResult/JsonResponse/ResponseBuilder.cs
  16. 0 20
      TEAMModelOS.SDK/Extension/DataResult/JsonResponse/TokenJosnResponse.cs
  17. 0 18
      TEAMModelOS.SDK/Extension/DataResult/JsonResponse/TokenJsonResult.cs
  18. 0 13
      TEAMModelOS.SDK/Extension/DataResult/PageToken/AzurePagination.cs
  19. 0 17
      TEAMModelOS.SDK/Extension/DataResult/PageToken/AzureTableToken.cs
  20. 0 31
      TEAMModelOS.SDK/Extension/DataResult/PageToken/Pagination.cs
  21. 0 13
      TEAMModelOS.SDK/Extension/DataResult/RequestData/AzureTokenRequest.cs
  22. 0 12
      TEAMModelOS.SDK/Extension/DataResult/RequestData/BaseRequest.cs
  23. 0 10
      TEAMModelOS.SDK/Extension/DataResult/RequestData/PaginationRequest.cs
  24. 0 38
      TEAMModelOS.SDK/Extension/Language/Implements/LanguageService.cs
  25. 0 12
      TEAMModelOS.SDK/Extension/Language/Interfaces/ILanguageService.cs
  26. 0 18
      TEAMModelOS.SDK/Extension/Language/LanguageExtension.cs
  27. 0 10
      TEAMModelOS.SDK/Extension/Language/Model/SmsCountryCode.cs
  28. 93 0
      TEAMModelOS.SDK/Models/Cosmos/Common/Notice.cs
  29. 2 0
      TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContentTypeTemplate/LessonTestReport.vue
  30. 5 1
      TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContentTypeTemplate/PaperView.vue
  31. 17 25
      TEAMModelOS/ClientApp/src/components/student-web/EventView/EventList.vue
  32. 0 8
      TEAMModelOS/ClientApp/src/components/student-web/HomeView/HomeView.vue
  33. 12 3
      TEAMModelOS/ClientApp/src/components/student-web/HomeView/MissionListCard.vue
  34. 6 3
      TEAMModelOS/ClientApp/src/view/settings/Index.vue
  35. 152 0
      TEAMModelOS/ClientApp/src/view/settings/OpenMgmt.less
  36. 318 0
      TEAMModelOS/ClientApp/src/view/settings/OpenMgmt.vue
  37. 0 6
      TEAMModelOS/ClientApp/src/view/settings/SchoolMgmt.vue
  38. 6 2
      TEAMModelOS/Controllers/Common/ExamController.cs
  39. 1 1
      TEAMModelOS/Controllers/School/CourseController.cs
  40. 1 1
      TEAMModelOS/Controllers/School/SchoolTeacherController.cs
  41. 64 0
      TEAMModelOS/Controllers/XTest/TestController.cs

+ 89 - 1
TEAMModelFunction/ActivityHttpTrigger.cs

@@ -35,6 +35,83 @@ namespace TEAMModelFunction
             _azureStorage = azureStorage;
             _azureRedis = azureRedis;
         }
+
+        /// <summary>
+        /// 修复已存在的课程且未初始化学生课程列表的业务。
+        /// </summary>
+        /// <param name="req"></param>
+        /// <param name="log"></param>
+        /// <returns></returns>
+        [FunctionName("fix-stu-course")]
+        public async Task<IActionResult> StuCourse([HttpTrigger(AuthorizationLevel.Anonymous, "post", Route = null)] HttpRequest req, ILogger log)
+        {
+            log.LogInformation("fix-stu-course...");
+            string originCode = await new StreamReader(req.Body).ReadToEndAsync();
+            List<Course> courses = new List<Course>();
+            var client = _azureCosmos.GetCosmosClient();
+            var query = $"select  *  from c ";
+            await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<Course>(queryText: query,
+                    requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.PartitionKey($"Course-{originCode}") }))
+            {
+                courses.Add(item);
+            }
+            await foreach (var item in client.GetContainer("TEAMModelOS", "Teacher").GetItemQueryIterator<Course>(queryText: query,
+                    requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.PartitionKey($"Course-{originCode}") }))
+            {
+                courses.Add(item);
+            }
+            //2.获取课程的id 并尝试添加或移除对应的学生课程记录StuCourse。
+            foreach (var course in courses)
+            {
+                if (course.schedule.IsNotEmpty())
+                {
+                    foreach (var sc in course.schedule)
+                    {
+                        if (!string.IsNullOrEmpty(sc.stulist))
+                        {
+                            (List<string> tmdids, List<Students> studentss) = await TriggerStuActivity.GetStuList(client, new List<string>() { sc.stulist }, course.school);
+                            foreach (var addStu in studentss)
+                            {
+                                var stuCourse = new StuCourse
+                                {
+                                    id = course.id,
+                                    scode = course.code,
+                                    name = course.name,
+                                    code = $"StuCourse-{course.school}-{addStu.id}",
+                                    scope = course.scope,
+                                    school = course.school,
+                                    creatorId = course.creatorId,
+                                    pk = "StuCourse"
+                                };
+                                await client.GetContainer("TEAMModelOS", "Student").UpsertItemAsync(stuCourse, new PartitionKey(stuCourse.code));
+                            }
+                            foreach (var addTmd in tmdids)
+                            {
+                                var tmdCourse = new StuCourse
+                                {
+                                    id = course.id,
+                                    scode = course.code,
+                                    name = course.name,
+                                    code = $"StuCourse-{addTmd}",
+                                    scope = course.scope,
+                                    //school = courseChange.school,
+                                    creatorId = course.creatorId,
+                                    pk = "StuCourse"
+                                };
+                                await client.GetContainer("TEAMModelOS", "Teacher").UpsertItemAsync(tmdCourse, new PartitionKey(tmdCourse.code));
+                            }
+                        }
+                    }
+                }
+            }
+            return new OkObjectResult(new { });
+        }
+        /// <summary>
+        /// 设置评测未初始化学生列表的
+        /// </summary>
+        /// <param name="req"></param>
+        /// <param name="log"></param>
+        /// <returns></returns>
         [FunctionName("fix-exam-activity")]
         public   async Task<IActionResult> ExamActivity([HttpTrigger(AuthorizationLevel.Anonymous, "post", Route = null)] HttpRequest req,ILogger log)
         {
@@ -121,7 +198,12 @@ namespace TEAMModelFunction
             }
             return new OkObjectResult(new { });
         }
-
+        /// <summary>
+        /// 设置投票未初始化学生列表的业务
+        /// </summary>
+        /// <param name="req"></param>
+        /// <param name="log"></param>
+        /// <returns></returns>
         [FunctionName("fix-vote-activity")]
         public async Task<IActionResult> VoteActivity(
             [HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)] HttpRequest req,
@@ -208,6 +290,12 @@ namespace TEAMModelFunction
             }
             return new OkObjectResult(new { });
         }
+        /// <summary>
+        /// 设置问卷调查未初始化学生列表的业务
+        /// </summary>
+        /// <param name="req"></param>
+        /// <param name="log"></param>
+        /// <returns></returns>
         [FunctionName("fix-survey-activity")]
         public async Task<IActionResult> SurveyActivity(
             [HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)] HttpRequest req,

+ 2 - 2
TEAMModelGrpc/Startup.cs

@@ -77,8 +77,8 @@ namespace TEAMModelGrpc
             //    .AddCosmosSerializer(new SystemTextJsonCosmosSerializer(new JsonSerializerOptions() { IgnoreNullValues = true }));
  
             //注入CSRedis
-            var csredis = new CSRedis.CSRedisClient(_conf.GetSection("Azure:Redis:ConnectionString").Get<string>());
-            RedisHelper.Initialization(csredis);
+           // var csredis = new CSRedis.CSRedisClient(_conf.GetSection("Azure:Redis:ConnectionString").Get<string>());
+           // RedisHelper.Initialization(csredis);
 
             //全局扫描基于IBusinessService接口的实现类
             //services.Scan(scan => scan.FromApplicationDependencies()

+ 0 - 20
TEAMModelOS.SDK/Extension/DataResult/JsonRequest/AzureJsonRequest.cs

@@ -1,20 +0,0 @@
-using TEAMModelOS.SDK;
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace TEAMModelOS.SDK
-{
-    /// <summary>
-    /// 
-    /// </summary>
-    /// <typeparam name="T"></typeparam>
-    public class AzureJsonRequest<T> : BaseJosnRequest
-    {
-
-        public AzureJsonRequest (){
-            @params = new AzureTokenRequest<T>();
-        }
-        public AzureTokenRequest<T> @params { get; set; }
-    }
-}

+ 0 - 16
TEAMModelOS.SDK/Extension/DataResult/JsonRequest/BaseJosnRequest.cs

@@ -1,16 +0,0 @@
-
-using System;
-
-namespace TEAMModelOS.SDK
-{
-    
-    public abstract class BaseJosnRequest
-    {
-      //  public long requestTime { get; set; } = DateTime.Now.ToUniversalTime().Ticks - 621355968000000000;
-       // public string jsonrpc { get; set; } = "2.0";
-        public string method { get; set; }
-    //    public int id { get; set; } = 1;
-      //  public int timeOffset { get; set; }
-        public string lang { get; set; } = "zh-CN";
-    }
-}

+ 0 - 14
TEAMModelOS.SDK/Extension/DataResult/JsonRequest/JosnRequest.cs

@@ -1,14 +0,0 @@
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace TEAMModelOS.SDK
-{
-    
-    public class JosnRequest<T>:BaseJosnRequest
-    {
-
-        public T @params { get; set; }
-    }
-}

+ 0 - 15
TEAMModelOS.SDK/Extension/DataResult/JsonRequest/PaginationRequest.cs

@@ -1,15 +0,0 @@
-
-
-using TEAMModelOS.SDK;
-
-namespace TEAMModelOS.SDK
-{
-    public  class PaginationJsonRequest<T> : BaseJosnRequest
-    {
-        public PaginationJsonRequest()
-        {
-            @params = new PaginationRequest<T>();
-        }
-        public PaginationRequest<T> @params { get; set; }
-    }
-}

+ 0 - 13
TEAMModelOS.SDK/Extension/DataResult/JsonResponse/BaseResponse.cs

@@ -1,13 +0,0 @@
-
-using Microsoft.VisualBasic;
-
-namespace TEAMModelOS.SDK
-{
-    
-    public class BaseResponse 
-    {
-      //  public string jsonrpc { get; set; } = "2.0";
-       // public double id { get; set; } = 1;
-       
-    }
-}

+ 0 - 19
TEAMModelOS.SDK/Extension/DataResult/JsonResponse/DataJsonResponse.cs

@@ -1,19 +0,0 @@
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace TEAMModelOS.SDK
-{
-    
-    public class DataJsonResponse<T> : BaseResponse
-    {
-		public DataJsonResponse() { 
-		  result=  new JsonRPCResult<T>();
-		}
-        public Dictionary<string, object> error { get; set; } = null;
-        public   JsonRPCResult<T> result { get; set; }
-        public int code { get; set; } = 0;
-        public string message { get; set; } = "Success";
-    }
-}

+ 0 - 14
TEAMModelOS.SDK/Extension/DataResult/JsonResponse/EmptyJosnResponse.cs

@@ -1,14 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace TEAMModelOS.SDK
-{
-    public class EmptyJosnResponse :BaseResponse
-    {
-        public object result { get; set; } = null;
-        public Dictionary<string,object> error { get; set; } = null;
-        public int code { get; set; } = 1;
-        public string message { get; set; } = "Empty";
-    }
-}

+ 0 - 19
TEAMModelOS.SDK/Extension/DataResult/JsonResponse/ErrorJosnResponse.cs

@@ -1,19 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace TEAMModelOS.SDK
-{
-
-    public class ErrorJosnResponse : BaseResponse
-    {
-        public ErrorJosnResponse()
-        {
-            error = new Dictionary<string, object>();
-        }
-        public object result { get; set; } = null;
-        public Dictionary<string, object> error { get; set; }
-        public int code { get; set; } = 0;
-        public string message { get; set; } = "Error";
-    }
-}

+ 0 - 15
TEAMModelOS.SDK/Extension/DataResult/JsonResponse/ErrorModel.cs

@@ -1,15 +0,0 @@
-
-
-using System.Collections.Generic;
-
-namespace TEAMModelOS.SDK
-{
-    
-   
-
-    public class ErrorModel {
-        public int code { get; set; }
-        public string message { get; set; }
-        public Dictionary<string, object> data { get; set; } = null;
-    }
-}

+ 0 - 16
TEAMModelOS.SDK/Extension/DataResult/JsonResponse/JsonRPCResult.cs

@@ -1,16 +0,0 @@
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace TEAMModelOS.SDK
-{
-    
-    public class JsonRPCResult<T>
-    {
-        public Dictionary<string, object> extend { get; set; } = null;
-     //   public long responseTime { get; set; } = DateTime.Now.ToUniversalTime().Ticks - 621355968000000000;
-        public T data { get; set; }
-       
-    }
-}

+ 0 - 20
TEAMModelOS.SDK/Extension/DataResult/JsonResponse/PageJosnResponse.cs

@@ -1,20 +0,0 @@
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace TEAMModelOS.SDK
-{
-    
-    public class PageJosnResponse<T> : BaseResponse
-    {
-		public PageJosnResponse()
-		{
-			result = new PageJsonResult<T>();
-		}
-		public   PageJsonResult<T> result { get; set; }
-		public Dictionary<string, object> error { get; set; } = null;
-		public int code { get; set; } = 0;
-		public string message { get; set; } = "Success";
-	}
-}

+ 0 - 15
TEAMModelOS.SDK/Extension/DataResult/JsonResponse/PageJsonResult.cs

@@ -1,15 +0,0 @@
-using TEAMModelOS.SDK;
-
-
-namespace TEAMModelOS.SDK
-{
-    
-    public class PageJsonResult<T> : JsonRPCResult<T>
-    {
-        public Pagination page { get; set; }
-
-        public PageJsonResult()
-        {
-        }
-    }
-}

+ 0 - 175
TEAMModelOS.SDK/Extension/DataResult/JsonResponse/ResponseBuilder.cs

@@ -1,175 +0,0 @@
-using TEAMModelOS.SDK;
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace TEAMModelOS.SDK
-{
-    
-    public  class ResponseBuilder
-    {
-        private string message="Success";
-        private object data;
-        private long total;
-        private int currPage;
-        private int pageSize;
-        private int totalPage;
-        private Dictionary<string, object> extend;
-        private Pagination page;
-        private AzureTableToken token;
-        private ErrorModel error =null;
-        
-        public ResponseBuilder()
-        {
-        }
-        public ResponseBuilder Success()
-        {
-            error = null;
-            return this;
-        }
-
-        public ResponseBuilder Success(String message)
-        {
-            this.message = message;
-            return this;
-        }
-        public static ResponseBuilder custom()
-        {
-            return new ResponseBuilder();
-        }
-
-        public ResponseBuilder Data(object data)
-        {
-            this.data = data;
-            return this;
-        }
-		public ResponseBuilder Error( int code, string message)
-		{
-			
-			this.error = new ErrorModel { code=code, message=message, data = null };
-			return this;
-		}
-        public ResponseBuilder Error(int code, Dictionary<string,object> errorData)
-        {
-           
-            this.error = new ErrorModel { code = code, message = message ,data= errorData };
-            return this;
-        }
-        public ResponseBuilder Error( int code)
-		{
-
-            this.error = new ErrorModel { code = code, message = "Error", data = null };
-            return this;
-		}
-        public ResponseBuilder Error(int code, string message, Dictionary<string, object> errorData)
-        {
-
-            this.error = new ErrorModel { code = code, message = message, data = errorData };
-            return this;
-        }
-
-        public ResponseBuilder Extend(Dictionary<String, object> extend)
-        {
-            this.extend = extend;
-            return this;
-        }
-        public ResponseBuilder Token(AzureTableToken token)
-        {
-            this.token = token;
-            return this;
-        }
-        public ResponseBuilder Page(Pagination page)
-        {
-            this.pageSize = page.pageSize;
-            this.currPage = page.currPage;
-            this.total = page.total;
-            this.page = page;
-            this.totalPage = (int)Math.Ceiling((double)this.total / (double)this.pageSize);
-            return this;
-        }
-        public ResponseBuilder totalCount(int totalCount)
-        {
-            this.total = totalCount;
-            return this;
-        }
-
-        public ResponseBuilder CurrPage(int currPage)
-        {
-            this.currPage = currPage;
-            return this;
-        }
-
-        public ResponseBuilder PageSize(int pageSize)
-        {
-            this.pageSize = pageSize;
-            return this;
-        }
-
-        public ResponseBuilder TotalPage(int totalPage)
-        {
-            this.totalPage = totalPage;
-            return this;
-        }
-        public BaseResponse build()
-        {
-
-            object baseResponse = null;
-            if (error != null) {
-                ErrorJosnResponse errorJosnRPCResponse = new ErrorJosnResponse();
-                errorJosnRPCResponse.error = error.data;
-                errorJosnRPCResponse.code = error.code;
-                errorJosnRPCResponse.message = error.message;
-                return errorJosnRPCResponse;
-            }
-            if (this.total > 0 && this.pageSize > 0)
-            {
-                this.totalPage = (int)Math.Ceiling((double)this.total / (double)this.pageSize);
-            }
-            if (null != this.data && this.token != null)
-            {
-                TokenJosnResponse<object> response = new TokenJosnResponse<object>();
-                response.result.data = this.data;
-                response.result.extend = this.extend;
-                response.result.azureToken = this.token;
-                response.code = 0;
-                response.message = message;
-
-                baseResponse = response;
-            }
-            else if (null != this.data && this.total > 0 && this.currPage > 0 && this.pageSize > 0 && this.totalPage > 0)
-            {
-                PageJosnResponse<object> response = new PageJosnResponse<object>();
-                response.result.data = this.data;
-                response.result.page = new Pagination(this.total, this.currPage, this.pageSize, this.totalPage);
-                response.result.extend = this.extend;
-                response.message = message;
-                response.code = 0;
-                baseResponse = response;
-            }
-            else if (this.data != null)
-            {
-                DataJsonResponse<object> response = new DataJsonResponse<object>();
-                response.result.data = this.data;
-                response.result.extend = this.extend;
-                response.message = message;
-                response.code = 0;
-                baseResponse = response;
-            }
-            else if (this.data == null) {
-                DataJsonResponse<object> response = new DataJsonResponse<object>();
-                response.result.data = this.data;
-                response.result.extend = this.extend;
-                response.message = message;
-                response.code = 0;
-                baseResponse = response;
-            }
-            else
-            {
-                return new EmptyJosnResponse() ;
-            }
-            return (BaseResponse)baseResponse;
-        }
-         
-    }
-}

+ 0 - 20
TEAMModelOS.SDK/Extension/DataResult/JsonResponse/TokenJosnResponse.cs

@@ -1,20 +0,0 @@
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace TEAMModelOS.SDK
-{
-    
-    public class TokenJosnResponse<T>: BaseResponse
-    {
-		public TokenJosnResponse()
-		{
-			result = new TokenJsonResult<T>();
-		}
-		public  TokenJsonResult<T> result { get; set; }
-		public Dictionary<string, object> error { get; set; } = null;
-		public int code { get; set; } = 0;
-		public string message { get; set; } = "Success";
-	}
-}

+ 0 - 18
TEAMModelOS.SDK/Extension/DataResult/JsonResponse/TokenJsonResult.cs

@@ -1,18 +0,0 @@
-using TEAMModelOS.SDK;
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace TEAMModelOS.SDK
-{
-    
-    public class TokenJsonResult<T> : JsonRPCResult<T>
-    {
-       
-        public AzureTableToken azureToken { get; set; }
-        public TokenJsonResult() { }
-       // public int code { get; set; } = 0;
-      //  public string message { get; set; } = "Success";
-    }
-}

+ 0 - 13
TEAMModelOS.SDK/Extension/DataResult/PageToken/AzurePagination.cs

@@ -1,13 +0,0 @@
-
-using System.Collections.Generic;
-
-namespace TEAMModelOS.SDK
-{
-    
-    public class AzurePagination<T>
-    {
-        public AzurePagination(){}
-        public List<T> data { get; set; }
-        public AzureTableToken token { get; set; }
-    }
-}

+ 0 - 17
TEAMModelOS.SDK/Extension/DataResult/PageToken/AzureTableToken.cs

@@ -1,17 +0,0 @@
-
-using System.ComponentModel.DataAnnotations;
-
-namespace TEAMModelOS.SDK
-{
-    
-    public class AzureTableToken
-    {
-        //[Required]
-        public string NextPartitionKey { get; set; }
-        //[Required]
-        public string NextRowKey { get; set; }
-        public string NextTableName { get; set; }
-        //[Required]
-        public int? TargetLocation { get; set; }
-    }
-}

+ 0 - 31
TEAMModelOS.SDK/Extension/DataResult/PageToken/Pagination.cs

@@ -1,31 +0,0 @@
-
-using System;
-using System.Collections.Generic;
-
-namespace TEAMModelOS.SDK
-{
-    
-    public class Pagination
-    {
-        public long total { get; set; }
-        public int currPage { get; set; }
-        public int pageSize { get; set; } 
-        public int totalPage { get; set; }
-      
-        public Pagination() { }
-        public Pagination(long total, int currPage, int pageSize)
-        {
-            this.total = total;
-            this.currPage = currPage;
-            this.pageSize = pageSize;
-            this.totalPage = (int)Math.Ceiling((double)this.total / (double)this.pageSize);
-        }
-        public Pagination(long total, int currPage, int pageSize, int totalPage)
-        {
-            this.total = total;
-            this.currPage = currPage;
-            this.pageSize = pageSize;
-            this.totalPage = totalPage;
-        }
-    }
-}

+ 0 - 13
TEAMModelOS.SDK/Extension/DataResult/RequestData/AzureTokenRequest.cs

@@ -1,13 +0,0 @@
-using TEAMModelOS.SDK;
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace TEAMModelOS.SDK
-{
-   public class AzureTokenRequest<T> :BaseRequest
-   {
-        public T data { get; set; }
-        public AzureTableToken azureToken { get; set; }
-   }
-}

+ 0 - 12
TEAMModelOS.SDK/Extension/DataResult/RequestData/BaseRequest.cs

@@ -1,12 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-namespace TEAMModelOS.SDK
-{
-    public class BaseRequest
-    {
-        public long requestTime { get; set; } = DateTime.Now.ToUniversalTime().Ticks - 621355968000000000;
-        public string method { get; set; }
-        public string repeatToken { get; set; }
-    }
-}

+ 0 - 10
TEAMModelOS.SDK/Extension/DataResult/RequestData/PaginationRequest.cs

@@ -1,10 +0,0 @@
-using TEAMModelOS.SDK;
-
-namespace TEAMModelOS.SDK
-{
-    public class PaginationRequest<T> : BaseRequest
-    {
-        public T data { get; set; }
-        public Pagination  page{ get; set; }
-    }
-}

+ 0 - 38
TEAMModelOS.SDK/Extension/Language/Implements/LanguageService.cs

@@ -1,38 +0,0 @@
-using TEAMModelOS.SDK.Extension.Language.Interfaces;
-using TEAMModelOS.SDK.Extension.Language.Model;
-using Microsoft.Extensions.Options;
-using System.Collections.Generic;
-
-namespace TEAMModelOS.SDK.Extension.Language.Implements
-{
-    public class LanguageService : ILanguageService
-    {
-        private Dictionary<string, SmsCountryCode> smsMap { get; set; }
-        public List<SmsCountryCode> countryCodes;
-
-        public LanguageService(IOptions<List<SmsCountryCode>> _option)
-        {
-            countryCodes = _option.Value;
-           
-        }
-        private LanguageService SmsLanguage()
-        {
-            foreach (SmsCountryCode sms in countryCodes) {
-                if (this.smsMap == null)
-                {
-                    smsMap = new Dictionary<string, SmsCountryCode>();
-                }
-                if (!smsMap.ContainsKey(sms.CountryCode))
-                {
-                    smsMap.Add(sms.CountryCode, sms);
-                }
-            }
-            return this;
-        }
-        public Dictionary<string, SmsCountryCode> GetSmsLanguage()
-        {
-            SmsLanguage();
-            return smsMap;
-        }
-    }
-}

+ 0 - 12
TEAMModelOS.SDK/Extension/Language/Interfaces/ILanguageService.cs

@@ -1,12 +0,0 @@
-using TEAMModelOS.SDK.Extension.Language.Model;
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace TEAMModelOS.SDK.Extension.Language.Interfaces
-{
-    public interface ILanguageService
-    {
-        Dictionary<string, SmsCountryCode> GetSmsLanguage();
-    }
-}

+ 0 - 18
TEAMModelOS.SDK/Extension/Language/LanguageExtension.cs

@@ -1,18 +0,0 @@
-using TEAMModelOS.SDK.Extension.Language.Implements;
-using TEAMModelOS.SDK.Extension.Language.Interfaces;
-using TEAMModelOS.SDK.Extension.Language.Model;
-using Microsoft.Extensions.Configuration;
-using Microsoft.Extensions.DependencyInjection;
-using System.Collections.Generic;
-
-namespace TEAMModelOS.SDK.Extension.Language
-{
-    public static class RedisExtension
-    {
-        public static void AddLanguage(this IServiceCollection services, IConfigurationSection LangConfiguration)
-        {
-            services.Configure<List<SmsCountryCode>>(LangConfiguration);
-            services.AddScoped<ILanguageService, LanguageService>();
-        }
-    }
-}

+ 0 - 10
TEAMModelOS.SDK/Extension/Language/Model/SmsCountryCode.cs

@@ -1,10 +0,0 @@
-namespace TEAMModelOS.SDK.Extension.Language.Model
-{
-    public  class SmsCountryCode
-    {
-        public string Name { get; set; }
-        public string CountryCode { get; set; }
-        public string Language { get; set; }
-        public string SmsLang { get; set; }
-    }
-}

+ 93 - 0
TEAMModelOS.SDK/Models/Cosmos/Common/Notice.cs

@@ -0,0 +1,93 @@
+using Microsoft.Azure.Cosmos.Table;
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace TEAMModelOS.SDK.Models.Table
+{
+
+
+    /// <summary>
+    /// 前端多语言处理
+    /// </summary>
+    //public string title { get; set; }
+    /// <summary>
+    /// 前端多语言处理
+    /// </summary>
+    //public string content { get; set; }
+    /*
+     {
+        "title":"通知标题",
+        "type":"通知类型",
+        "level":"重要程度",
+        "content":"通知内容",
+        "data":"传输数据josn",
+        "stime":"发起时间戳",
+        "etime":"到期时间戳",
+        "id":"通知id",
+        "code":"发起人"
+        "pk":"notice"
+    }
+     */
+    /// <summary>
+    /// 通知主体存放位置:/notice/{业务id}.json
+    /// 通知主体存放位置:  /notice/{业务id}.json
+    /// 活跃通知放在CosmosDB  Common表中,并设置"ttl":2592000,不能超过30天(2592000),一天(3600),一周(25200),允许删除
+    /// 过期通知存放至blob中,存放位置, 允许被删除,直接删除记录
+    ///             stuid:/student/stuid/receiver/xxxx时间戳排序.json
+    ///             tmdid:/receiver/xxxx时间戳排序.json
+    /// </summary>
+    public class Notice
+    {
+        /// <summary>
+        /// 业务的id
+        /// </summary>
+        public string id { get; set; }
+        /// <summary>
+        /// Notice-{hbcn/tmdid}
+        /// </summary>
+        public string code { get; set; }
+        public string scode { get; set; }
+        public string school { get; set; }
+        public string scope { get; set; }
+        public string spk { get; set; }
+        /// <summary>
+        /// 通知
+        /// </summary>
+        public string pk { get; set; } = "Notice";
+        /// <summary>
+        /// 类型
+        /// </summary>
+        public string type { get; set; }
+        public int level { get; set; }
+        public string data { get; set; }
+        public int stime { get; set; }
+        public int etime { get; set; }
+        /// <summary>
+        /// 被通知的醍摩豆账号
+        /// </summary>
+        public List<string> tmdids { get; set; }
+        /// <summary>
+        /// 被通知的学校学生账号
+        /// </summary>
+        public List<string> stuids { get; set; }
+    }
+    /*
+    {
+        "id":"通知id"
+        "code":"接收者1",
+        "status":"接收状态/已发送/已查看",
+        "pk":"receiver",
+        "ttl":2592000,不能超过30天(2592000),一天(3600),一周(25200)
+    }
+     */
+    public class Receiver : CosmosEntity
+    {
+        public string pk { get; set; } = "Receiver";
+        /// <summary>
+        /// 0 已发送,1已查看,2已处理,-1已过期
+        /// </summary>
+        public int status { get; set; }=0;
+
+    }
+}

+ 2 - 0
TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContentTypeTemplate/LessonTestReport.vue

@@ -483,6 +483,8 @@
                }
                this.paperData = [...paper]
                if (this.paperData.length) {
+                   console.log(this.examInfo)
+                   console.log(this.examInfo.stuAns[0])
                    this.ansData = await this.getItem(this.examInfo.stuAns[0])
                }
                console.log('5456465456456')

+ 5 - 1
TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContentTypeTemplate/PaperView.vue

@@ -130,7 +130,11 @@
                                 this.paperData[i].stuAns = []
                                 this.paperData[i].stuScore = []
                             } else {
-                                this.paperData[i].stuAns = resData.stuAns[i]
+                                if (resData.mark[i] !== undefined) {
+                                    this.paperData[i].stuAns = [resData.mark[i]]
+                                } else {
+                                    this.paperData[i].stuAns = resData.stuAns[i]
+                                }
                                 this.paperData[i].stuScore = resData.stuScore[i]
                                 if (resData.stuAns[i][0] !== undefined) {
                                     let k = 0

+ 17 - 25
TEAMModelOS/ClientApp/src/components/student-web/EventView/EventList.vue

@@ -3,7 +3,6 @@
         <div class="list">
             <!--活動搜尋與篩選區域-->
             <div class="event-selector-block">
-                <!---搜尋--->
                 <div class="search">
                     <div class="search-btn" @click="openSearch = !openSearch">
                         <svg-icon icon-class="search"
@@ -14,7 +13,6 @@
                         <Input type="text" v-model="search" :placeholder="$t('studentWeb.public.search')" clearable />
                     </div>
                 </div>
-                <!---搜尋--->
                 <!--下拉選單-->
                 <div>
                     <Dropdown>
@@ -23,19 +21,12 @@
                             <Icon type="ios-arrow-down"></Icon>
                         </a>
                         <DropdownMenu slot="list">
-                            <div @click="sentEventStatus('all')">
-                                <DropdownItem>{{ $t("studentWeb.event.allStatus") }}</DropdownItem>
-                            </div>
-                            <div @click="sentEventStatus('going')">
-                                <DropdownItem>{{ $t("studentWeb.event.unFinished") }}</DropdownItem>
-                            </div>
-                            <div @click="sentEventStatus('finish')">
-                                <DropdownItem>{{ $t("studentWeb.event.Fineshed") }}</DropdownItem>
+                            <div @click="sentEventStatus(item)" v-for="(item,index) in $t('studentWeb.state')">
+                                <DropdownItem>{{ item.status }}</DropdownItem>
                             </div>
                         </DropdownMenu>
                     </Dropdown>
                 </div>
-                <!---->
                 <!---按鈕搜尋區(多選)--->
                 <ul class="icon-selector" v-if="hideIconbtn == false">
                     <li class="icon-btn"
@@ -57,7 +48,6 @@
                 </ul>
                 <!---按鈕搜尋區(多選)--->
             </div>
-            <!--活動搜尋與篩選區域-->
             <!--活動清單分頁-->
             <div class="list-block"
                 :style="{ height: hideIconbtn == false ? '84vh' : '90vh' }">
@@ -111,11 +101,10 @@
                                 {{ dateFormat(item.startTime) }} ~ {{ dateFormat(item.endTime) }}
                             </p>
                         </li>
-                            <!--<div>已交卷</div>-->
-                        <li class="list-item-unDone" v-show="item.progress == 'going'">
+                        <li class="list-item-unDone" v-show="timeStatus(item) == 'going'">
                             <div class="isAllowRetry">{{$t("studentWeb.public.going")}}</div>
                         </li>
-                        <li class="list-item-unDone" v-show="item.progress == 'finish'">
+                        <li class="list-item-unDone" v-show="timeStatus(item) == 'finish'">
                             <div class="isOvertime">{{$t("studentWeb.public.finish")}}</div>
                         </li>
                     </ul>
@@ -123,7 +112,6 @@
                 <div class="list-end"></div>
             </div>
         </div>
-        <!--活動清單分頁-->
         {{ scrollListfromInfoPop() }}
     </div>
 </template>
@@ -171,7 +159,7 @@
                 ],
                 activityType: this.$t('studentWeb.state'),
                 mockdata: "",
-                eventPageType: ["Preview", "Exam", "HomeWork", "Vote", "Survey"], //本頁出現的類型
+                eventPageType: ["Learn", "Exam", "HomeWork", "Vote", "Survey"], //本頁出現的類型
                 openSearch: false, //打開搜尋器
                 search: "",
                 alreadyScrolltimes: 0,
@@ -180,7 +168,8 @@
                 hideIconbtn: false,
                 isListNoItem: false, //清單為空
                 eventList: [],
-                eventShow:[]
+                eventShow: [],
+                dateTime: Date.parse(new Date())
             };
         },
         components: { PreviewProgressPie },
@@ -276,37 +265,41 @@
                     x = e.clientX;
                     y = e.clientY;
                 }
-
                 return { x: x, y: y }; //posx posy就是游標的X,Y值了
             },
             //取得座標
             getPosition(element) {
                 var x = 0;
                 var y = 0;
-
                 while (element) {
                     x += element.offsetLeft - element.scrollLeft + element.clientLeft;
                     y += element.offsetTop - element.scrollLeft + element.clientTop;
                     element = element.offsetParent;
                 }
-
                 return { x: x, y: y };
             },
-
+            timeStatus(data) {
+                console.log(data)
+                let date = (new Date()).getTime() //当前时间
+                if (date >= data.endTime) {
+                    return 'finish'
+                } else {
+                    return 'going'
+                }
+            },
             //將目前所滑過的投票項目之高度回傳到$store
             sentVoteResulthover(status) {
                 var hoverItem = {
                     status: status,
                     itemIDHeignt: this.getCursorPosition().y,
                 };
-
                 this.$store.commit("voteResulthover", hoverItem);
             },
             sentEventStatus(status) {
                 if (status == "reMake" || status == "reExam") {
                     this.eventTypeCheckers = [];
                 }
-                this.selectedEventStatusNow = status;
+                this.selectedEventStatusNow = status.status;
                 this.predealMockdatafirstItem();
             },
             predealMockdatafirstItem() {
@@ -337,7 +330,6 @@
                 if (currentfilterArray.length !== 0) {
                     this.eventShow = [...currentfilterArray]
                     this.isListNoItem = false;
-                    //this.sentSelectedEventTitle(currentfilterArray[0]);
                     document.querySelectorAll(".event-list .list-block")[0].scrollBy({
                         top: -document.querySelectorAll(".event-list .list-block")[0]
                             .scrollHeight,

+ 0 - 8
TEAMModelOS/ClientApp/src/components/student-web/HomeView/HomeView.vue

@@ -8,7 +8,6 @@
                         <svg-icon class="titleIcon" icon-class="calander" />
                         <span class="title">{{ $t("studentWeb.calenderCardTitle") }}</span>
                     </p>
-
                     <div>
                         <div class="title-rect" />
                         <p class="title-rect-name">{{ $t("studentWeb.recentClass") }}</p>
@@ -58,8 +57,6 @@
                                         </li>
                                         <li class="list-item-unDone"></li>
                                     </ul>
-                                    <!--<router-link :to="`/studentWeb/eventView#${item.eventID}`">
-                        </router-link>-->
                                 </li>
                             </div>
                         </div>
@@ -106,8 +103,6 @@
                         <div class="myTestProgress"></div>
                     </div>
                 </Card>
-                <!--<router-link to="/studentWeb/eventView">
-                </router-link>-->
                 <br />
                 <Card class="bar-card" @click.native="noData">
                     <h3 style="color: #575757; font-weight: 700">
@@ -125,8 +120,6 @@
                         <div class="myTestProgress"></div>
                     </div>
                 </Card>
-                <!--<router-link to="/studentWeb/studyView">
-                <!--</router-link>-->
             </i-col>
         </Row>
         <Row :gutter="30" v-if="spanCharts == true">
@@ -252,7 +245,6 @@
             },
             sentSelectedEventTitle: function (item) {
                 this.$router.push("/studentWeb/eventView#" + item.eventID);
-                //改變ItemName的狀態 vuex mutations
                 this.$store.commit("ChangeItemName", item);
             },
             setSpanCharts() {

+ 12 - 3
TEAMModelOS/ClientApp/src/components/student-web/HomeView/MissionListCard.vue

@@ -19,7 +19,7 @@
                             <svg-icon v-if="item.eventType == 'Homework'" icon-class="doc" />
                             <svg-icon v-if="item.eventType == 'Learn'"
                                       icon-class="selflearninginTime" />
-                            <svg-icon v-if="  item.eventType == 'exam'"
+                            <svg-icon v-if="  item.eventType == 'Exam'"
                                       icon-class="test"
                                       class="reset-testIcon" />
                             <svg-icon v-if="item.eventType == 'Vote'" icon-class="vote" />
@@ -32,10 +32,10 @@
                                 <span v-show="item.eventType == 'Survey'" class="list-item-typeMark">{{item.scope == 'school'? $t('studentWeb.public.schoolSurvey'):$t('studentWeb.public.privateSurvey')}}</span>
                                 <span>{{ item.name }}</span>
                                 <div style="float:right;margin-top:-20px">
-                                    <div class="list-item-unDone" v-show="item.progress == 'going'">
+                                    <div class="list-item-unDone" v-show="timeStatus(item) == 'going'">
                                         <span class="isAllowRetry">{{$t("studentWeb.public.going")}}</span>
                                     </div>
-                                    <div class="list-item-unDone" v-show="item.progress == 'finish'">
+                                    <div class="list-item-unDone" v-show="timeStatus(item) == 'finish'">
                                         <span class="isOvertime">{{$t("studentWeb.public.finish")}}</span>
                                     </div>
                                 </div>
@@ -148,6 +148,15 @@
             randomScore: function () {
                 return Random.integer(70, 96);
             },
+            timeStatus(data) {
+                console.log(data)
+                let date = (new Date()).getTime() //当前时间
+                if (date >= data.endTime) {
+                    return 'finish'
+                } else {
+                    return 'going'
+                }
+            },
             sentSelectedEventTitle: function (item) {
                 this.$router.push({path: "/studentWeb/eventView",
                   query: {

+ 6 - 3
TEAMModelOS/ClientApp/src/view/settings/Index.vue

@@ -3,6 +3,7 @@
         <div class="settings-header">
             <span :class="['settings-header-item',activeTab === '1' ?  'active-item' : '']" @click="onTabChange('1')">{{ $t('settings.setting_title1')}}</span>
 			<span :class="['settings-header-item',activeTab === '0' ?  'active-item' : '']" @click="onTabChange('0')">{{ $t('settings.setting_title2')}}</span>
+			<span :class="['settings-header-item',activeTab === '2' ?  'active-item' : '']" @click="onTabChange('2')">开放平台</span>
         </div>
 
         <div class="settings-body">
@@ -41,8 +42,8 @@
                     <!-- <Button @click="saveSetting">保存变更</Button> -->
                 </div>
             </div>
-
-            <SchoolMgmt v-else></SchoolMgmt>
+            <SchoolMgmt v-if="activeTab === '1'"></SchoolMgmt>
+            <OpenMgmt v-if="activeTab === '2'"></OpenMgmt>
         </div>
     </div>
 </template>
@@ -50,9 +51,11 @@
 <script>
     //import "@/css/less-variable.less"
     import SchoolMgmt from './SchoolMgmt.vue'
+    import OpenMgmt from './OpenMgmt.vue'
     export default {
         components: {
-            SchoolMgmt
+            SchoolMgmt,
+            OpenMgmt
         },
         data() {
             return {

+ 152 - 0
TEAMModelOS/ClientApp/src/view/settings/OpenMgmt.less

@@ -0,0 +1,152 @@
+@primaryColor: #1CC0F3;
+@borderColor: #424242;
+@second-textColor: #a5a5a5; //文本副级颜色
+
+.school-container {
+    display: flex;
+    height: 100%;
+
+    .school-container-header {
+        display: flex;
+        justify-content: space-between;
+        padding-right: 20px;
+        font-weight: bold;
+        color: #fff;
+    }
+
+    &-left {
+        width: 15%;
+        height: 100%;
+        border-right: 1px solid @borderColor;
+
+        .school-list-wrap {
+            height: 100%;
+            overflow: hidden;
+
+            .list-wrap {
+                width: 100%;
+                display: flex;
+                flex-direction: column;
+                padding-left: 10px;
+                padding-bottom: 50px;
+                overflow: hidden;
+
+                .school-item {
+                    position: relative;
+                    width: 100%;
+                    padding: 15px;
+                    border-bottom: 1px solid @borderColor;
+                    display: flex;
+                    flex-direction: column;
+
+                    &:last-child {
+                        border-bottom: none;
+                    }
+
+                    &-name {
+                        font-size: 18px;
+                        font-weight: bold;
+                        color: #fff;
+                    }
+
+                    &-status {
+                        font-size: 12px;
+                        background: @primaryColor;
+                        padding: 2px 8px;
+                        margin-left: 10px;
+                        border-radius: 5px;
+                    }
+
+                    &-code {
+                        margin: 5px 0;
+                        color: @second-textColor;
+                        letter-spacing: .6px;
+                    }
+
+                    &-nums {
+                        color: @primaryColor;
+                        margin-top: 5px;
+
+                        .ivu-icon {
+                            font-size: 18px;
+                            margin-right: 5px;
+                        }
+                    }
+
+                    &-role {
+                        position: absolute;
+                        right: 20px;
+                        top: 20px;
+                        color: @second-textColor;
+                    }
+
+                    &-btn {
+                        position: absolute;
+                        right: 20px;
+                        bottom: 20px;
+                        width: 100px;
+                        height: 30px;
+                        line-height: 30px;
+                        border-radius: 5px;
+                        color: #fff;
+                        background: @primaryColor;
+                        text-align: center;
+                        visibility: hidden;
+                        cursor: pointer;
+
+                        .ivu-icon {
+                            font-size: 16px;
+                            margin-right: 2px;
+                        }
+                    }
+
+                    &:hover {
+                        .item-active;
+
+                        .school-item-btn {
+                            visibility: visible;
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+    &-right {
+        // width: 60%;
+        flex: 1;
+        height: 100%;
+
+        .school-container-header {
+            width: 100%;
+            height: 50px;
+            border-bottom: 1px solid @borderColor;
+            display: flex;
+            align-items: center;
+            justify-content: space-between;
+            padding: 0 20px;
+        }
+
+        .table-wrap {
+            // padding: 0 20px;
+        }
+    }
+
+
+
+    &-header {
+        width: 100%;
+        height: 50px;
+        line-height: 50px;
+        padding-left: 20px;
+        color: @second-textColor;
+        border-bottom: 1px solid @borderColor;
+    }
+
+    .item-active {
+        background-image: -webkit-linear-gradient(90deg, rgba(30,30,30,0) 0%, rgba(110,110,110,.2) 50%, rgba(110,110,110,.4) 100%);
+        background-image: -o-linear-gradient(90deg, rgba(30,30,30,0) 0%, rgba(110,110,110,.2) 50%, rgba(110,110,110,.4) 100%);
+        background-image: -moz-linear-gradient(90deg, rgba(30,30,30,0) 0%, rgba(110,110,110,.2) 50%, rgba(110,110,110,.4) 100%);
+        background-image: linear-gradient(90deg, rgba(30,30,30,0) 0%, rgba(110,110,110,.2) 50%, rgba(110,110,110,.4) 100%);
+    }
+}

+ 318 - 0
TEAMModelOS/ClientApp/src/view/settings/OpenMgmt.vue

@@ -0,0 +1,318 @@
+<template>
+    <div class="school-container">
+        <!--<Loading v-show="isLoading"></Loading>-->
+        <div class="school-container-left">
+            <div class="school-container-header">
+                <span>开放平台设置</span>
+            </div>
+            <vuescroll>
+                <div class="school-list-wrap">
+                    <!--<div v-if="mySchoolList.length === 0">
+                        <EmptyData :top="50"></EmptyData>
+                    </div>-->
+                    <div class="list-wrap">
+                        <!--<Menu active-name="mge" :open-names="['1']">
+                            <Submenu name="1" >
+                                <template slot="title">
+                                    <Icon type="ios-analytics" />
+                                    应用管理
+                                </template>
+                                    <MenuItem  name="mge">应用列表</MenuItem>
+                                    <MenuItem  name="add">添加应用</MenuItem>
+                            </Submenu>
+                        </Menu>-->
+                        <div class="school-item" @click="getSelect('mge')">
+                            <span class="school-item-name">
+                                <span>应用管理</span>
+                            </span>
+                        </div>
+                        <div class="school-item" @click="getSelect('add')">
+                            <span class="school-item-name">
+                                <span>添加应用</span>
+                            </span>
+                        </div>
+                    </div>
+                </div>
+            </vuescroll>
+        </div>
+        <div class="school-container-right">
+            <div class="school-container-header">
+                <span>应用列表</span>
+                <div>
+                    <Input placeholder="请输入搜索名称或appkey">
+                    <Icon type="ios-search" slot="prefix" />
+                    </Input>
+                </div>
+            </div>
+            <div class="table-wrap" v-show="index == 'mge'">
+                <Table :data="tableData1" :columns="tableColumns1">
+                    <template slot-scope="{ row, index }" slot="status">
+                        <div v-show="row.status == 0">
+                            <Button type="primary" size="small" style="margin-right: 5px">通过</Button>
+                            <Button type="error" size="small">不通过</Button>
+                        </div>
+                    </template>            
+                    <template slot-scope="{ row, index }" slot="action">
+                            <Button type="primary" size="small" style="margin-right: 5px">编辑</Button>
+                            <Button type="error" size="small">删除</Button>
+                    </template>
+                </Table>
+                <div style="margin: 10px;overflow: hidden">
+                    <div style="float: right;">
+                        <Page :total="100" :current="1" @on-change="changePage"></Page>
+                    </div>
+                </div>
+            </div>          
+            <div style="width:45%;margin-top:30px;color:#fff;margin-left:30px" v-show="index == 'add'">
+                <Form ref="formValidate" :model="formValidate" :rules="ruleValidate" :label-width="120">
+                    <FormItem label="应用名称:" prop="name">
+                        <Input v-model="formValidate.name" placeholder="请输入应用名称"></Input>
+                    </FormItem>
+                    <FormItem label="app key:" prop="key">
+                        <Input v-model="formValidate.key" placeholder="请输入appkey"></Input>
+                    </FormItem>
+                    <FormItem label="app_secret:" prop="secret">
+                        <Input v-model="formValidate.secret" placeholder="请输入app_secret"></Input>
+                    </FormItem>
+                    <FormItem label="应用图标:">
+                        <Upload>
+                            <Button icon="ios-cloud-upload-outline">点击上传图片</Button>
+                        </Upload>
+                    </FormItem>
+                    <FormItem label="功能模块" prop="model">
+                        <CheckboxGroup v-model="formValidate.model">
+                            <Checkbox label="模块一"></Checkbox>
+                            <Checkbox label="模块二"></Checkbox>
+                            <Checkbox label="模块三"></Checkbox>
+                            <Checkbox label="模块四"></Checkbox>
+                            <Checkbox label="模块四"></Checkbox>
+                            <Checkbox label="模块四"></Checkbox>
+                            <Checkbox label="模块四"></Checkbox>
+                            <Checkbox label="模块四"></Checkbox>
+                            <Checkbox label="模块四"></Checkbox>
+                            <Checkbox label="模块四"></Checkbox>
+                        </CheckboxGroup>
+                    </FormItem>
+                    <FormItem label="限制连接次数:" prop="num">
+                        <Select v-model="formValidate.num" :autosize="{minRows: 2,maxRows: 5}" placeholder="不限制"></Select>
+                    </FormItem>
+                    <FormItem label="账号ID:" prop="id">
+                        <Input v-model="formValidate.id" :autosize="{minRows: 2,maxRows: 5}" placeholder="请输入账号ID"></Input>
+                    </FormItem>
+                    <FormItem>
+                        <Button type="primary">提交</Button>
+                    </FormItem>
+                </Form>
+            </div>
+        </div>
+
+    </div>
+</template>
+
+<script>
+    export default {
+        data() {
+            return {
+                teacherInfo: {
+                    defaultschool: ''
+                },
+                index: 'mge',
+                tableData1: this.mockTableData1(),
+                tableColumns1: [
+                    {
+                        title: 'appkey',
+                        key: 'key'
+                    },
+                    {
+                        title: '应用图标',
+                        key: 'pic'
+                    },
+                    {
+                        title: '应用名称',
+                        key: 'name'
+                    },
+                    {
+                        title: '开发者',
+                        key: 'author'
+                    },
+                    {
+                        title: '申请机构',
+                        key: 'company'
+                    },
+                    {
+                        title: '审核状态',
+                        slot: 'status'
+                    },
+                    {
+                        title: '操作',
+                        slot: 'action',
+                    }
+                ],
+                formValidate: {
+                    name: '',
+                    key: '',
+                    secret: '',
+                    id: '',
+                    model: [],
+                    num:0
+                },
+                ruleValidate: {
+                    name: [
+                        { required: true, message: '请输入应用名称', trigger: 'blur' }
+                    ],
+                    key: [
+                        { required: true, message: '请输入appkey', trigger: 'blur' }
+                    ],
+                    secret: [
+                        { required: true, message: '请输入app_secret', trigger: 'change' }
+                    ],
+                    id: [
+                        { required: true, message: '请输入使用者ID', trigger: 'change' }
+                    ],
+                    num: [
+                        { required: true, type: 'number', min: 1,message: '请输入使用者ID', trigger: 'change' }
+                    ],
+                    model: [
+                        { required: true, type: 'array', min: 1, message: '选择需要的功能模块', trigger: 'change' }
+                    ],
+                }
+            }
+        },
+        created() {
+
+        },
+        methods: {
+            mockTableData1() {
+                let data = [];
+                for (let i = 0; i < 10; i++) {
+                    data.push({
+                        name: 'Business' + Math.floor(Math.random() * 100 + 1),
+                        status: Math.floor(Math.random(0,3)),
+                        key: 'hjfgdhfdjkshkjhgjk',
+                        author: 'SOUL',
+                        company: 'habook',
+                        action: Math.floor(Math.random() * 7 + 1),
+                        update: new Date()
+                    })
+                }
+                return data;
+            },
+            getSelect(data) {
+                this.index = data || ''
+            },
+            formatDate(date) {
+                const y = date.getFullYear();
+                let m = date.getMonth() + 1;
+                m = m < 10 ? '0' + m : m;
+                let d = date.getDate();
+                d = d < 10 ? ('0' + d) : d;
+                return y + '-' + m + '-' + d;
+            },
+            changePage() {
+                this.tableData1 = this.mockTableData1();
+            },
+        },
+        computed: {
+
+        }
+    }
+</script>
+
+<style lang="less" scoped>
+    @import "./OpenMgmt.less";
+</style>
+
+<style lang="less">
+    @borderColor: #424242;
+    @second-textColor: #CBCBCB;
+
+    //文本副级颜色
+    .school-container-header {
+        .ivu-input
+
+    {
+        background: transparent;
+        width: 200px;
+        border-color: #4a4a4a;
+        color: @second-textColor;
+        &::-webkit-input-placeholder
+
+    {
+        /* WebKit browsers */
+        color: #999;
+        font-size: 12px;
+    }
+
+    }
+    }
+
+    .school-container-right {
+        .search-wrap
+
+    {
+        .ivu-input
+
+    {
+        background: transparent;
+        width: 250px;
+        border-color: #4a4a4a;
+        color: @second-textColor;
+        &::-webkit-input-placeholder
+
+    {
+        /* WebKit browsers */
+        color: #999;
+        font-size: 12px;
+    }
+
+    }
+
+    .ivu-select {
+        width: 200px;
+        margin-left: 20px;
+    }
+
+    }
+
+    .table-wrap {
+        .ivu-table
+
+    {
+        background: transparent;
+    }
+
+    .ivu-table th,
+    .ivu-table td {
+        background: transparent;
+        color: @second-textColor;
+        border-color: @borderColor;
+        height: 60px;
+    }
+
+    .ivu-table:before,
+    .ivu-table-border:after,
+    .ivu-table-wrapper-with-border {
+        background: @borderColor;
+        border-color: @borderColor;
+    }
+
+    .ivu-table-stripe .ivu-table-body tr:nth-child(2n) td,
+    .ivu-table-stripe .ivu-table-fixed-body tr:nth-child(2n) td {
+        background: #2a2a2a;
+    }
+
+    .ivu-table-stripe .ivu-table-body tr.ivu-table-row-hover td,
+    .ivu-table-stripe .ivu-table-fixed-body tr.ivu-table-row-hover td {
+        .ivu-btn
+
+    {
+        visibility: visible;
+    }
+
+    background: #5C5A5A;
+    }
+    }
+
+
+    }
+</style>

+ 0 - 6
TEAMModelOS/ClientApp/src/view/settings/SchoolMgmt.vue

@@ -45,12 +45,6 @@
 									<span>{{ $t('settings.goSchool')}}</span>
 								</span>
 							</span>
-<!-- 							<span class="school-item-btn" style="background: rgb(202,54,54);" v-if="item.status === 'request'">
-								<span>
-									<Icon type="md-close" />
-									<span>取消申请</span>
-								</span>
-							</span> -->
 							<span class="school-item-btn" style="background: #1CC0F3;right: 140px;" v-if="item.status === 'invite'" @click="onConfirmJoin(item)">
 								<span>
 									<Icon type="md-checkmark" />

+ 6 - 2
TEAMModelOS/Controllers/Common/ExamController.cs

@@ -1042,6 +1042,7 @@ namespace TEAMModelOS.Controllers
                 }
                 List<List<string>> stuAns = new List<List<string>>();
                 List<List<double>> stuScore = new List<List<double>>();
+                List<string> mark = new List<string> ();
                 List<double> total = new List<double>();
                 if (answers.Count > 0)
                 {
@@ -1053,14 +1054,17 @@ namespace TEAMModelOS.Controllers
                         }
                         stuAns.Add(result.studentAnswers[index]);
                         stuScore.Add(result.studentScores[index]);
+                        if (result.mark.Count > 0) {
+                            mark.Add(result.mark[index]);
+                        }            
                         total.Add(result.sum.Where(s => s <= 59).Count());
-                        total.Add(result.sum.Where(s => s > 59 && s <= 70 ).Count());
+                        total.Add(result.sum.Where(s => s > 59 && s <= 70 ).Count()); 
                         total.Add(result.sum.Where(s => s > 70 && s <= 80).Count());
                         total.Add(result.sum.Where(s => s > 80 && s <= 90).Count());
                         total.Add(result.sum.Where(s => s > 90 && s <= 100).Count());
                     }                   
                 }
-                return Ok(new { papers, subjects,stuScore, stuAns, total,claId = infoIds });
+                return Ok(new { papers, subjects,stuScore, stuAns, mark,total,claId = infoIds });
             }
             catch (Exception ex)
             {

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

@@ -1362,7 +1362,7 @@ namespace TEAMModelOS.Controllers
         [HttpPost("find-teach-class")]
         public async Task<IActionResult> FindPlanClass(JsonElement request)
         {
-            ResponseBuilder builder = ResponseBuilder.custom();
+            
             HashSet<string> data = new HashSet<string>();
             if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
             if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();

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

@@ -103,7 +103,7 @@ namespace TEAMModelOS.Controllers
         [HttpPost("get-teacher-authoritylist")]
         public async Task<IActionResult> GetSchoolAuthorityList()
         {
-            ResponseBuilder builder = ResponseBuilder.custom();
+             
             Dictionary<string, object> dict = new Dictionary<string, object>
             {
                 { "PartitionKey",  "authority"}

+ 64 - 0
TEAMModelOS/Controllers/XTest/TestController.cs

@@ -118,7 +118,71 @@ namespace TEAMModelOS.Controllers.XTest
 
 
 
+        [ProducesDefaultResponseType]
+        //[AuthToken(Roles = "teacher")]
+        [HttpPost("fix-stu-course")]
+        public async Task<IActionResult> fixStuCourse(JsonElement request) {
 
+            string originCode = request.GetProperty("originCode").GetString();
+            List<Course> courses = new List<Course>();
+            var client = _azureCosmos.GetCosmosClient();
+            var query = $"select  *  from c ";
+            await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<Course>(queryText: query,
+                    requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.PartitionKey($"Course-{originCode}") }))
+            {
+                courses.Add(item);
+            }
+            await foreach (var item in client.GetContainer("TEAMModelOS", "Teacher").GetItemQueryIterator<Course>(queryText: query,
+                    requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.PartitionKey($"Course-{originCode}") }))
+            {
+                courses.Add(item);
+            }
+            //2.获取课程的id 并尝试添加或移除对应的学生课程记录StuCourse。
+            foreach (var course in courses)
+            {
+                if (course.schedule.IsNotEmpty())
+                {
+                    foreach (var sc in course.schedule)
+                    {
+                        if (!string.IsNullOrEmpty(sc.stulist))
+                        {
+                            (List<string> tmdids, List<Students> studentss) = await TriggerStuActivity.GetStuList(client, new List<string>() { sc.stulist }, course.school);
+                            foreach (var addStu in studentss)
+                            {
+                                var stuCourse = new StuCourse
+                                {
+                                    id = course.id,
+                                    scode = course.code,
+                                    name = course.name,
+                                    code = $"StuCourse-{course.school}-{addStu.id}",
+                                    scope = course.scope,
+                                    school = course.school,
+                                    creatorId = course.creatorId,
+                                    pk = "StuCourse"
+                                };
+                                await client.GetContainer("TEAMModelOS", "Student").UpsertItemAsync(stuCourse, new PartitionKey(stuCourse.code));
+                            }
+                            foreach (var addTmd in tmdids)
+                            {
+                                var tmdCourse = new StuCourse
+                                {
+                                    id = course.id,
+                                    scode = course.code,
+                                    name = course.name,
+                                    code = $"StuCourse-{addTmd}",
+                                    scope = course.scope,
+                                    //school = courseChange.school,
+                                    creatorId = course.creatorId,
+                                    pk = "StuCourse"
+                                };
+                                await client.GetContainer("TEAMModelOS", "Teacher").UpsertItemAsync(tmdCourse, new PartitionKey(tmdCourse.code));
+                            }
+                        }
+                    }
+                }
+            }
+            return new OkObjectResult(new { });
+        }