Browse Source

Merge branch 'TPE/feat/classroomManage' into TPE/develop

Mickey 4 years ago
parent
commit
fcf7449826
100 changed files with 4654 additions and 3418 deletions
  1. 64 60
      TEAMModelFunction/MonitorCosmosDB.cs
  2. 84 24
      TEAMModelFunction/ServiceBusTopic.cs
  3. 3 3
      TEAMModelFunction/local.settings.json
  4. 79 0
      TEAMModelFunction/model/Classroom.cs
  5. 52 0
      TEAMModelFunction/model/ExamClassResult.cs
  6. 120 0
      TEAMModelFunction/model/ExamInfo.cs
  7. 51 0
      TEAMModelFunction/model/ExamResult.cs
  8. 141 0
      TEAMModelFunction/model/Survey.cs
  9. 108 0
      TEAMModelFunction/model/Vote.cs
  10. 2 2
      TEAMModelOS.SDK/Context/Constant/Constants.cs
  11. 30 7
      TEAMModelOS.SDK/DI/AzureServiceBus/AzureServiceBusExtensions.cs
  12. 6 6
      TEAMModelOS/ClientApp/src/access/index.js
  13. 12 0
      TEAMModelOS/ClientApp/src/api/classroom.js
  14. 4 0
      TEAMModelOS/ClientApp/src/api/index.js
  15. 2 2
      TEAMModelOS/ClientApp/src/api/learnActivity.js
  16. 5 5
      TEAMModelOS/ClientApp/src/api/login.js
  17. 4 4
      TEAMModelOS/ClientApp/src/api/stuAccount.js
  18. 15 1
      TEAMModelOS/ClientApp/src/api/studentWeb.js
  19. 46 0
      TEAMModelOS/ClientApp/src/assets/iconfont/demo_index.html
  20. 14 6
      TEAMModelOS/ClientApp/src/assets/iconfont/iconfont.css
  21. BIN
      TEAMModelOS/ClientApp/src/assets/iconfont/iconfont.eot
  22. 1 1
      TEAMModelOS/ClientApp/src/assets/iconfont/iconfont.js
  23. 14 0
      TEAMModelOS/ClientApp/src/assets/iconfont/iconfont.json
  24. 6 0
      TEAMModelOS/ClientApp/src/assets/iconfont/iconfont.svg
  25. BIN
      TEAMModelOS/ClientApp/src/assets/iconfont/iconfont.ttf
  26. BIN
      TEAMModelOS/ClientApp/src/assets/iconfont/iconfont.woff
  27. BIN
      TEAMModelOS/ClientApp/src/assets/iconfont/iconfont.woff2
  28. 1 0
      TEAMModelOS/ClientApp/src/assets/student-web/component_styles/lesson-testpop.less
  29. 5 1
      TEAMModelOS/ClientApp/src/boot-app.js
  30. 91 65
      TEAMModelOS/ClientApp/src/common/BaseSelectSchool.vue
  31. 0 1
      TEAMModelOS/ClientApp/src/common/BaseUserPoptip.vue
  32. 28 9
      TEAMModelOS/ClientApp/src/common/NewUploadFile.vue
  33. 3 3
      TEAMModelOS/ClientApp/src/components/coursemgmt/StudentList.vue
  34. 2 3
      TEAMModelOS/ClientApp/src/components/learnactivity/BaseHwForm.vue
  35. 56 28
      TEAMModelOS/ClientApp/src/components/learnactivity/BaseVoteForm.vue
  36. 21 6
      TEAMModelOS/ClientApp/src/components/learnactivity/ChooseContent.vue
  37. 35 65
      TEAMModelOS/ClientApp/src/components/learnactivity/GradeList.vue
  38. 25 10
      TEAMModelOS/ClientApp/src/components/learnactivity/NewChooseContent.vue
  39. 27 12
      TEAMModelOS/ClientApp/src/components/questionnaire/BaseAddItem.vue
  40. 213 0
      TEAMModelOS/ClientApp/src/components/questionnaire/BaseAddSingle.vue
  41. 25 6
      TEAMModelOS/ClientApp/src/components/questionnaire/BaseQnForm.vue
  42. 2 1
      TEAMModelOS/ClientApp/src/components/questionnaire/BaseQuestionnaire.vue
  43. 48 31
      TEAMModelOS/ClientApp/src/components/student-web/EventBasicInfo.vue
  44. 8 7
      TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContent.vue
  45. 372 364
      TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContentTypeTemplate/LessonTest.vue
  46. 720 770
      TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContentTypeTemplate/LessonTestPop.vue
  47. 848 901
      TEAMModelOS/ClientApp/src/components/student-web/EventView/EventList.vue
  48. 15 16
      TEAMModelOS/ClientApp/src/components/student-web/EventView/EventView.vue
  49. 160 124
      TEAMModelOS/ClientApp/src/components/student-web/HomeView/MissionListCard.vue
  50. 34 1
      TEAMModelOS/ClientApp/src/mock/index.js
  51. 0 1
      TEAMModelOS/ClientApp/src/service/User.js
  52. 0 3
      TEAMModelOS/ClientApp/src/store/index.js
  53. 4 0
      TEAMModelOS/ClientApp/src/store/module/schoolBaseInfo.js
  54. 215 206
      TEAMModelOS/ClientApp/src/store/module/studentWeb.js
  55. 89 35
      TEAMModelOS/ClientApp/src/store/module/user.js
  56. 3 0
      TEAMModelOS/ClientApp/src/utils/blobTool.js
  57. 32 2
      TEAMModelOS/ClientApp/src/utils/evTools.js
  58. 4 4
      TEAMModelOS/ClientApp/src/utils/public.js
  59. 0 14
      TEAMModelOS/ClientApp/src/view/Home.vue
  60. 12 5
      TEAMModelOS/ClientApp/src/view/classmgt/ManageClass.vue
  61. 15 12
      TEAMModelOS/ClientApp/src/view/evaluation/bank/ExerciseList.vue
  62. 5 6
      TEAMModelOS/ClientApp/src/view/evaluation/bank/TestPaperList.vue
  63. 0 1
      TEAMModelOS/ClientApp/src/view/evaluation/components/BaseChild.vue
  64. 13 11
      TEAMModelOS/ClientApp/src/view/evaluation/components/BaseCreateChild.vue
  65. 14 11
      TEAMModelOS/ClientApp/src/view/evaluation/components/BaseEditExercise.vue
  66. 4 4
      TEAMModelOS/ClientApp/src/view/evaluation/components/BaseExerciseList.vue
  67. 89 84
      TEAMModelOS/ClientApp/src/view/evaluation/components/BaseFilter.vue
  68. 10 7
      TEAMModelOS/ClientApp/src/view/evaluation/components/BaseRepair.vue
  69. 8 16
      TEAMModelOS/ClientApp/src/view/evaluation/index/CreateExercises.vue
  70. 4 12
      TEAMModelOS/ClientApp/src/view/evaluation/index/CreatePaper.vue
  71. 3 2
      TEAMModelOS/ClientApp/src/view/evaluation/index/TestPaper.vue
  72. 41 30
      TEAMModelOS/ClientApp/src/view/evaluation/types/BaseCompletion.vue
  73. 10 0
      TEAMModelOS/ClientApp/src/view/evaluation/types/BaseCompose.vue
  74. 10 0
      TEAMModelOS/ClientApp/src/view/evaluation/types/BaseJudge.vue
  75. 13 0
      TEAMModelOS/ClientApp/src/view/evaluation/types/BaseMultiple.vue
  76. 9 0
      TEAMModelOS/ClientApp/src/view/evaluation/types/BaseSubjective.vue
  77. 58 35
      TEAMModelOS/ClientApp/src/view/knowledge-point/index/Index.vue
  78. 8 6
      TEAMModelOS/ClientApp/src/view/knowledge-point/index/operation/AddBlock.vue
  79. 25 21
      TEAMModelOS/ClientApp/src/view/knowledge-point/index/operation/ComposeBlock.vue
  80. 3 2
      TEAMModelOS/ClientApp/src/view/learnactivity/ExamPaperAnalysis.vue
  81. 21 5
      TEAMModelOS/ClientApp/src/view/learnactivity/ManageEvaluation.vue
  82. 5 7
      TEAMModelOS/ClientApp/src/view/login/Index.vue
  83. 8 18
      TEAMModelOS/ClientApp/src/view/newcourse/CourseBaseSetting.vue
  84. 4 4
      TEAMModelOS/ClientApp/src/view/newcourse/CourseClassroom.vue
  85. 13 21
      TEAMModelOS/ClientApp/src/view/newcourse/CoursePlan.vue
  86. 7 9
      TEAMModelOS/ClientApp/src/view/newcourse/CourseTable.vue
  87. 1 1
      TEAMModelOS/ClientApp/src/view/newcourse/CourseTime.vue
  88. 11 5
      TEAMModelOS/ClientApp/src/view/newcourse/ManageCourse.vue
  89. 8 5
      TEAMModelOS/ClientApp/src/view/newcourse/MyCourse.vue
  90. 6 2
      TEAMModelOS/ClientApp/src/view/newcourse/NewCoursePlan.vue
  91. 2 2
      TEAMModelOS/ClientApp/src/view/questionnaire/ManageQuestionnaire.vue
  92. 12 0
      TEAMModelOS/ClientApp/src/view/schoolmgmt/ClassroomSetting/ClassroomSetting.less
  93. 129 200
      TEAMModelOS/ClientApp/src/view/schoolmgmt/ClassroomSetting/ClassroomSetting.vue
  94. 46 11
      TEAMModelOS/ClientApp/src/view/schoolmgmt/SystemSetting/SystemSetting.vue
  95. 2 2
      TEAMModelOS/ClientApp/src/view/selfstudy/CreateOrderLearn.vue
  96. 2 2
      TEAMModelOS/ClientApp/src/view/selfstudy/OrderLearnInfo.vue
  97. 55 34
      TEAMModelOS/ClientApp/src/view/settings/SchoolMgmt.vue
  98. 9 4
      TEAMModelOS/ClientApp/src/view/student-account/Index.vue
  99. 10 11
      TEAMModelOS/ClientApp/src/view/student-analysis/total-analysis/EvaluationList/TotalIndex.vue
  100. 0 0
      TEAMModelOS/ClientApp/src/view/student-web/App.vue

+ 64 - 60
TEAMModelFunction/MonitorCosmosDB.cs

@@ -6,10 +6,7 @@ using System.Threading.Tasks;
 using Azure.Cosmos;
 using Azure.Cosmos;
 using Microsoft.Azure.Documents;
 using Microsoft.Azure.Documents;
 using Microsoft.Azure.WebJobs;
 using Microsoft.Azure.WebJobs;
-using Microsoft.Azure.WebJobs.Host;
 using Microsoft.Extensions.Logging;
 using Microsoft.Extensions.Logging;
-using TEAMModelOS.Models.CommonInfo;
-using TEAMModelOS.Models.SchoolInfo;
 using TEAMModelOS.SDK.DI;
 using TEAMModelOS.SDK.DI;
 using TEAMModelOS.SDK.Extension;
 using TEAMModelOS.SDK.Extension;
 
 
@@ -20,11 +17,11 @@ namespace TEAMModelFunction
         private readonly IHttpClientFactory _clientFactory;
         private readonly IHttpClientFactory _clientFactory;
         private readonly AzureCosmosFactory _azureCosmos;
         private readonly AzureCosmosFactory _azureCosmos;
 
 
-        public MonitorCosmosDB( IHttpClientFactory clientFactory,AzureCosmosFactory azureCosmos)
+        public MonitorCosmosDB(IHttpClientFactory clientFactory, AzureCosmosFactory azureCosmos)
         {
         {
             _clientFactory = clientFactory;
             _clientFactory = clientFactory;
             _azureCosmos = azureCosmos;
             _azureCosmos = azureCosmos;
-    }
+        }
 
 
         [FunctionName("School")]
         [FunctionName("School")]
         public async Task School([CosmosDBTrigger(
         public async Task School([CosmosDBTrigger(
@@ -32,17 +29,18 @@ namespace TEAMModelFunction
             collectionName: "Common",
             collectionName: "Common",
             ConnectionStringSetting = "CosmosConnection",
             ConnectionStringSetting = "CosmosConnection",
             LeaseCollectionName = "leases")]IReadOnlyList<Document> input, ILogger log)
             LeaseCollectionName = "leases")]IReadOnlyList<Document> input, ILogger log)
-        {          
-                if (input != null && input.Count > 0)
-                {
-                    log.LogInformation("Documents modified " + input.Count);
-                    log.LogInformation("First document Id " + input[0].Id);
-                }
+        {
+            if (input != null && input.Count > 0)
+            {
+                log.LogInformation("Documents modified " + input.Count);
+                log.LogInformation("First document Id " + input[0].Id);
+            }
             //input[0]
             //input[0]
             var client = _azureCosmos.GetCosmosClient();
             var client = _azureCosmos.GetCosmosClient();
             List<ExamInfo> exams = new List<ExamInfo>();
             List<ExamInfo> exams = new List<ExamInfo>();
             string pk = input[0].GetPropertyValue<string>("pk");
             string pk = input[0].GetPropertyValue<string>("pk");
-            if (!string.IsNullOrEmpty(pk) &&  pk.Equals("Exam")) {
+            if (!string.IsNullOrEmpty(pk) && pk.Equals("Exam"))
+            {
                 string code = input[0].GetPropertyValue<string>("code");
                 string code = input[0].GetPropertyValue<string>("code");
                 await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIterator(queryText: $"select value(c) from c where c.id = '{input[0].Id}'", requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.PartitionKey($"{code}") }))
                 await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIterator(queryText: $"select value(c) from c where c.id = '{input[0].Id}'", requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.PartitionKey($"{code}") }))
                 {
                 {
@@ -58,62 +56,71 @@ namespace TEAMModelFunction
                 }
                 }
                 for (int i = 0; i < exams.Count; i++)
                 for (int i = 0; i < exams.Count; i++)
                 {
                 {
+                    List<ExamClassResult> examClassResults = new List<ExamClassResult>();
+                    await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIterator(queryText: $"select value(c) from c where c.examId = '{exams[i].id}'", requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.PartitionKey($"{code}") }))
+                    {
+                        using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                        if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
+                        {
+                            foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
+                            {
+                                examClassResults.Add(obj.ToObject<ExamClassResult>());
+                            }
+                        }
+                    }
                     /*if (exams[i].startTime.CompareTo(DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()) < 0 
                     /*if (exams[i].startTime.CompareTo(DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()) < 0 
                         && exams[i].endTime.CompareTo(DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()) > 0 )
                         && exams[i].endTime.CompareTo(DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()) > 0 )
                     {*/
                     {*/
-                    if (exams[i].progress.Equals("going")) { 
+                    if (examClassResults.Count < 0)
+                    {
+                        if (exams[i].progress.Equals("going"))
+                        {
 
 
-                        //await client.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync(exams[i], exams[i].id.ToString(), new Azure.Cosmos.PartitionKey($"{exams[i].code}"));
-                        for (int j = 0;j< exams[i].subjects.Count;j++) {
-                            for (int k = 0; k < exams[i].targetClassIds.Count; k++) {                         
-                                ExamClassResult result = new ExamClassResult();
-                                result.code = "ExamClassResult-" + exams[i].school;
-                                result.examId = exams[i].id;
-                                result.id = Guid.NewGuid().ToString();
-                                result.subjectId = exams[i].subjects[j].id;
-                                result.year = exams[i].year;
-                                result.ttl = -1;
-                                result.pk = typeof(ExamClassResult).Name;
-                                result.info.id = exams[i].targetClassIds[k];
-                                var sresponse = await client.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(exams[i].targetClassIds[k], new Azure.Cosmos.PartitionKey($"Class-{exams[i].school}"));
-                                if (sresponse.Status == 200)
+                            //await client.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync(exams[i], exams[i].id.ToString(), new Azure.Cosmos.PartitionKey($"{exams[i].code}"));
+                            for (int j = 0; j < exams[i].subjects.Count; j++)
+                            {
+                                for (int k = 0; k < exams[i].targetClassIds.Count; k++)
                                 {
                                 {
-                                    using var json = await JsonDocument.ParseAsync(sresponse.ContentStream);
-                                    Classroom classroom = json.ToObject<Classroom>();
-                                    result.info.name = classroom.name;
-                                    List<List<string>> ans = new List<List<string>>();
-                                    List<double> ansPoint = new List<double>();
-                                    foreach (double p in exams[i].papers[j].point) {
-                                        ans.Add(new List<string>());
-                                        ansPoint.Add(0);
-                                    }
-                                    foreach (StudentSimple stu in classroom.students) {
-                                        result.studentIds.Add(stu.id);
-                                        result.studentAnswers.Add(ans);
-                                        result.studentScores.Add(ansPoint);
+                                    ExamClassResult result = new ExamClassResult();
+                                    result.code = "ExamClassResult-" + exams[i].school;
+                                    result.examId = exams[i].id;
+                                    result.id = Guid.NewGuid().ToString();
+                                    result.subjectId = exams[i].subjects[j].id;
+                                    result.year = exams[i].year;
+                                    result.ttl = -1;
+                                    result.scope = exams[i].scope;
+                                    result.pk = typeof(ExamClassResult).Name;
+                                    result.info.id = exams[i].targetClassIds[k];
+                                    var sresponse = await client.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(exams[i].targetClassIds[k], new Azure.Cosmos.PartitionKey($"Class-{exams[i].school}"));
+                                    if (sresponse.Status == 200)
+                                    {
+                                        using var json = await JsonDocument.ParseAsync(sresponse.ContentStream);
+                                        Classroom classroom = json.ToObject<Classroom>();
+                                        result.info.name = classroom.name;
+                                        List<List<string>> ans = new List<List<string>>();
+                                        List<double> ansPoint = new List<double>();
+                                        foreach (double p in exams[i].papers[j].point)
+                                        {
+                                            ans.Add(new List<string>());
+                                            ansPoint.Add(0);
+                                        }
+                                        foreach (StudentSimple stu in classroom.students)
+                                        {
+                                            result.studentIds.Add(stu.id);
+                                            result.studentAnswers.Add(ans);
+                                            result.studentScores.Add(ansPoint);
+                                        }
                                     }
                                     }
-                                }                               
-                                result.progress = exams[i].progress;
-                                result.school = exams[i].school;
-                                await client.GetContainer("TEAMModelOS", "Common").CreateItemAsync(result, new Azure.Cosmos.PartitionKey($"{result.code}"));
+                                    result.progress = exams[i].progress;
+                                    result.school = exams[i].school;
+                                    await client.GetContainer("TEAMModelOS", "Common").CreateItemAsync(result, new Azure.Cosmos.PartitionKey($"{result.code}"));
 
 
+                                }
                             }
                             }
                         }
                         }
                     }
                     }
                     if (exams[i].progress.Equals("finish"))
                     if (exams[i].progress.Equals("finish"))
-                    {                       
-                        List<ExamClassResult> examClassResults = new List<ExamClassResult>();
-                        await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIterator(queryText: $"select value(c) from c where c.examId = '{exams[i].id}'"))
-                        {
-                            using var json = await JsonDocument.ParseAsync(item.ContentStream);
-                            if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
-                            {
-                                foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
-                                {
-                                    examClassResults.Add(obj.ToObject<ExamClassResult>());
-                                }
-                            }
-                        }
+                    {
                         for (int j = 0; j < exams[i].subjects.Count; j++)
                         for (int j = 0; j < exams[i].subjects.Count; j++)
                         {
                         {
                             ExamResult result = new ExamResult();
                             ExamResult result = new ExamResult();
@@ -171,11 +178,8 @@ namespace TEAMModelFunction
                             await _azureCosmos.GetCosmosClient().GetContainer("TEAMModelOS", "Common").CreateItemAsync(result, new Azure.Cosmos.PartitionKey($"ExamResult-{result.school}"));
                             await _azureCosmos.GetCosmosClient().GetContainer("TEAMModelOS", "Common").CreateItemAsync(result, new Azure.Cosmos.PartitionKey($"ExamResult-{result.school}"));
                         }
                         }
                     }
                     }
-
                 }
                 }
             }
             }
-            
-            //_clientFactory.CreateClient().
         }
         }
     }
     }
 }
 }

+ 84 - 24
TEAMModelFunction/ServiceBusTopic.cs

@@ -6,48 +6,108 @@ using Azure.Cosmos;
 using Microsoft.Azure.WebJobs;
 using Microsoft.Azure.WebJobs;
 using Microsoft.Azure.WebJobs.Host;
 using Microsoft.Azure.WebJobs.Host;
 using Microsoft.Extensions.Logging;
 using Microsoft.Extensions.Logging;
-using TEAMModelOS.Models.SchoolInfo;
 using TEAMModelOS.SDK.DI;
 using TEAMModelOS.SDK.DI;
 using TEAMModelOS.SDK.Extension;
 using TEAMModelOS.SDK.Extension;
 
 
 namespace TEAMModelFunction
 namespace TEAMModelFunction
 {
 {
-    public   class ServiceBusTopic
+    public  class ServiceBusTopic
     {
     {
         private readonly AzureCosmosFactory _azureCosmos;
         private readonly AzureCosmosFactory _azureCosmos;
-        public ServiceBusTopic(  AzureCosmosFactory azureCosmos)
+        private readonly DingDing _dingDing;
+        public ServiceBusTopic(  AzureCosmosFactory azureCosmos, DingDing dingDing)
         {
         {
             _azureCosmos = azureCosmos;
             _azureCosmos = azureCosmos;
+            _dingDing = dingDing;
         }
         }
         [FunctionName("ServiceBusTopic")]
         [FunctionName("ServiceBusTopic")]
-        public async Task Run([ServiceBusTrigger("test_topic_ActiveTask", "test_topic_ReciveTask", Connection = "ConnectionBusName")] string mySbMsg, ILogger log)
+        public async Task ExamBus([ServiceBusTrigger("active-task", "active-exam-recive-task", Connection = "ConnectionBusName")] string mySbMsg)
         {
         {
-            log.LogInformation($"C# ServiceBus topic trigger function processed message: {mySbMsg}");
-            Dictionary<string, object> keyValuePairs = mySbMsg.ToObject<Dictionary<string, object>>();
-            var client = _azureCosmos.GetCosmosClient();
-            keyValuePairs.TryGetValue("id", out object id);
-            keyValuePairs.TryGetValue("name", out object name);
-            keyValuePairs.TryGetValue("code", out object code);
-            keyValuePairs.TryGetValue("status", out object progress);
-            if (name.ToString().Equals("ExamInfo")) {
-                ExamInfo exam = await client.GetContainer("TEAMModelOS", "Common").ReadItemAsync<ExamInfo>(id.ToString(), new PartitionKey($"{code}"));
-                exam.progress = progress.ToString();
-                await client.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync(exam, id.ToString(), new PartitionKey($"{code}"));
-                /*List<object> classes = new List<object>();
-                await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIterator(queryText: $"select value(c) from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Exam-hbcn") }))
+            try
+            {
+                Dictionary<string, object> keyValuePairs = mySbMsg.ToObject<Dictionary<string, object>>();
+                var client = _azureCosmos.GetCosmosClient();
+                keyValuePairs.TryGetValue("id", out object id);
+                keyValuePairs.TryGetValue("name", out object name);
+                keyValuePairs.TryGetValue("code", out object code);
+                //keyValuePairs.TryGetValue("status", out object progress);
+                if (name.ToString().Equals("ExamInfo", StringComparison.OrdinalIgnoreCase))
                 {
                 {
-                    using var json = await JsonDocument.ParseAsync(item.ContentStream);
-                    if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
+                    ExamInfo exam = await client.GetContainer("TEAMModelOS", "Common").ReadItemAsync<ExamInfo>(id.ToString(), new PartitionKey($"{code}"));
+                    if (DateTimeOffset.UtcNow.ToUnixTimeMilliseconds().CompareTo(exam.startTime) > 0 && DateTimeOffset.UtcNow.ToUnixTimeMilliseconds().CompareTo(exam.endTime) < 0)
                     {
                     {
-                        foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
+                        exam.progress = "going";
+                    }
+                    else if (DateTimeOffset.UtcNow.ToUnixTimeMilliseconds().CompareTo(exam.endTime) > 0)
+                    {
+                        exam.progress = "finish";
+                    }
+                    await client.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync(exam, id.ToString(), new PartitionKey($"{code}"));
+                }
+            } catch (Exception ex) {
+                await _dingDing.SendBotMsg($"ServiceBusㄛExamBus()\n{ex.Message}", GroupNames.醍摩豆服務運維群組);               
+            }
+                              
+        }
+        public async Task VoteBus([ServiceBusTrigger("active-task", "active-vote-recive-task", Connection = "ConnectionBusName")] string mySbMsg)
+        {
+            try {
+                Dictionary<string, object> keyValuePairs = mySbMsg.ToObject<Dictionary<string, object>>();
+                var client = _azureCosmos.GetCosmosClient();
+                keyValuePairs.TryGetValue("id", out object id);
+                keyValuePairs.TryGetValue("name", out object name);
+                keyValuePairs.TryGetValue("code", out object code);
+                //keyValuePairs.TryGetValue("status", out object progress);
+                if (name.ToString().Equals("Vote", StringComparison.OrdinalIgnoreCase))
+                {
+                    Vote vote;
+                    var sresponse = await client.GetContainer("TEAMModelOS", "Common").ReadItemStreamAsync(id.ToString(), new PartitionKey($"{code}"));
+                    if (sresponse.Status == 200)
+                    {
+                        using var json = await JsonDocument.ParseAsync(sresponse.ContentStream);
+                        vote = json.ToObject<Vote>();
+                        if (DateTimeOffset.UtcNow.ToUnixTimeMilliseconds().CompareTo(vote.startTime) > 0 && DateTimeOffset.UtcNow.ToUnixTimeMilliseconds().CompareTo(vote.endTime) < 0)
                         {
                         {
-
-                            classes.Add(obj.ToObject<object>());
+                            vote.progress = "going";
                         }
                         }
+                        else if (DateTimeOffset.UtcNow.ToUnixTimeMilliseconds().CompareTo(vote.endTime) > 0)
+                        {
+                            vote.progress = "finish";
+                        }
+                        await client.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync(vote, id.ToString(), new PartitionKey($"{code}"));
+                    }
+                }
+            } catch (Exception ex){
+                await _dingDing.SendBotMsg($"ServiceBusㄛVoteBus()\n{ex.Message}", GroupNames.醍摩豆服務運維群組);               
+            }
+                         
+        }
+        public async Task SurveyBus([ServiceBusTrigger("active-task", "active-survey-recive-task", Connection = "ConnectionBusName")] string mySbMsg)
+        {
+            try {
+                Dictionary<string, object> keyValuePairs = mySbMsg.ToObject<Dictionary<string, object>>();
+                var client = _azureCosmos.GetCosmosClient();
+                keyValuePairs.TryGetValue("id", out object id);
+                keyValuePairs.TryGetValue("name", out object name);
+                keyValuePairs.TryGetValue("code", out object code);
+                //keyValuePairs.TryGetValue("status", out object progress);
+                if (name.ToString().Equals("Survey", StringComparison.OrdinalIgnoreCase))
+                {
+                    Survey survey = await client.GetContainer("TEAMModelOS", "Common").ReadItemAsync<Survey>(id.ToString(), new PartitionKey($"{code}"));
+                    if (DateTimeOffset.UtcNow.ToUnixTimeMilliseconds().CompareTo(survey.startTime) > 0 && DateTimeOffset.UtcNow.ToUnixTimeMilliseconds().CompareTo(survey.endTime) < 0)
+                    {
+                        survey.progress = "going";
+                    }
+                    else if (DateTimeOffset.UtcNow.ToUnixTimeMilliseconds().CompareTo(survey.endTime) > 0)
+                    {
+                        survey.progress = "finish";
                     }
                     }
-                }*/
+                    await client.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync(survey, id.ToString(), new PartitionKey($"{code}"));
+                }
             }
             }
-            
+            catch (Exception ex){
+                await _dingDing.SendBotMsg($"ServiceBusㄛVoteBus()\n{ex.Message}", GroupNames.醍摩豆服務運維群組);                
+            }                       
         }
         }
     }
     }
 }
 }

+ 3 - 3
TEAMModelFunction/local.settings.json

@@ -3,9 +3,9 @@
   "Values": {
   "Values": {
     "AzureWebJobsStorage": "UseDevelopmentStorage=true",
     "AzureWebJobsStorage": "UseDevelopmentStorage=true",
     "FUNCTIONS_WORKER_RUNTIME": "dotnet",
     "FUNCTIONS_WORKER_RUNTIME": "dotnet",
-    "ConnectionBusName": "Endpoint=sb://teammodelos.servicebus.chinacloudapi.cn/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=Sy4h4EQ8zP+7w/lOLi1X3tGord/7ShFHimHs1vC50Dc=",
+    "ConnectionBusName": "Endpoint=sb://coreiotservicebuscnpro.servicebus.chinacloudapi.cn/;SharedAccessKeyName=TEAMModelOS;SharedAccessKey=llRPBMDJG9w1Nnifj+pGhV0g4H2REcq0PjvX2qqpcOg=",
     "CosmosConnection": "AccountEndpoint=https://teammodelos.documents.azure.cn:443/;AccountKey=clF73GwPECfP1lKZTCvs8gLMMyCZig1HODFbhDUsarsAURO7TcOjVz6ZFfPqr1HzYrfjCXpMuVD5TlEG5bFGGg==;",
     "CosmosConnection": "AccountEndpoint=https://teammodelos.documents.azure.cn:443/;AccountKey=clF73GwPECfP1lKZTCvs8gLMMyCZig1HODFbhDUsarsAURO7TcOjVz6ZFfPqr1HzYrfjCXpMuVD5TlEG5bFGGg==;",
-    "ScanModel": "TEAMModelOS" ,
-    "Database":  "TEAMModelOS" 
+    "ScanModel": "TEAMModelOS",
+    "Database": "TEAMModelOS"
   }  
   }  
 }
 }

+ 79 - 0
TEAMModelFunction/model/Classroom.cs

@@ -0,0 +1,79 @@
+using Azure.Cosmos;
+using ProtoBuf;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Text;
+using System.Text.Json;
+using System.Text.Json.Serialization;
+using TEAMModelOS.SDK.Context.Attributes.Azure;
+using TEAMModelOS.SDK.DI;
+
+namespace TEAMModelFunction
+{
+    //[CosmosDB(Database = "TEAMModelOS", Name = "School")]
+    public class Classroom:ID
+    {
+        public string pk { get; set; }
+        public   int? ttl { get; set; }
+        public Classroom()
+        {
+            students = new List<StudentSimple>();
+            teacher = new Teachers();
+        }
+        [JsonPropertyName("id")]
+        public string id { get; set; }
+        public float x { get; set; }
+        //[ProtoMember(2)]
+        public float y { get; set; }
+        [ProtoMember(5)]
+        public string name { get; set; }
+        [ProtoMember(6)]
+        public Teachers teacher { get; set; }
+        [ProtoMember(7)]
+        public string periodId { get; set; }
+        [ProtoMember(8)]
+        public string gradeId { get; set; }
+        [ProtoMember(9)]
+        public string sn { get; set; }
+        /*[ProtoMember(10)]
+        public int studentCount { get; set; }*/
+        public List<StudentSimple> students { get; set; }
+        /// <summary>
+        /// TBL IRS 类型区分
+        /// </summary>
+        [ProtoMember(11)]
+        public string style { get; set; }
+        [ProtoMember(12)]
+        public int status { get; set; } = 1;
+        /// <summary>
+        /// </summary>
+        /*[ProtoMember(13)]
+        [Required(ErrorMessage = "{0} 必须填写,请设置个人教室还是学校教室")]
+        public int type { get; set; } = 1;*/
+        [PartitionKey]
+        [Required(ErrorMessage = "{0} 必须填写")]
+        public string code { get; set; }
+        /// <summary>
+        /// 教室属性,普通 /专设的教室
+        /// </summary>
+        public string openType { get; set; }
+        public string scope { get; set; }
+    }
+    public class StudentSimple
+    {
+        public string id { get; set; }
+
+        public string name { get; set; }
+
+        public string no { get; set; }
+
+        public string groupId { get; set; }
+        public string groupName { get; set; }
+    }
+    public class Teachers
+    {
+        public string id { get; set; }
+        public string name { get; set; }
+    }
+}

+ 52 - 0
TEAMModelFunction/model/ExamClassResult.cs

@@ -0,0 +1,52 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using TEAMModelOS.SDK.Context.Attributes.Azure;
+using TEAMModelOS.SDK.DI;
+
+namespace TEAMModelFunction
+{
+    //[CosmosDB(Database = "TEAMModelOS", Name = "Common")]
+    public class ExamClassResult : ID
+    {
+        public ExamClassResult() {
+            //paper = new PaperSimple();
+            studentAnswers = new List<List<List<string>>>();
+            studentScores = new List<List<double>>();
+            info = new ClassInfo();
+            studentIds = new List<string>();
+            studentAnswers = new List<List<List<string>>>();
+            studentScores = new List<List<double>>();
+        }
+        public string pk { get; set; }
+        [PartitionKey]
+        public string code { get; set; }
+        public string school { get; set; }
+        public string id { get; set; }
+        public string examId { get; set; }
+        public string subjectId { get; set; }
+        public int year { get; set; }
+        public ClassInfo info { get; set; }
+        public string progress { get; set; }
+        //public PaperSimple paper { get; set; }
+        //public List<double> point { get; set; }
+        public List<string> studentIds { get; set; }
+        public List<List<List<string>>> studentAnswers { get; set; }
+        public List<List<double>> studentScores { get; set; }
+        public string scope { get; set; }
+        public int? ttl { get; set; }
+    }
+/*    public class PaperSimple {
+        public string id { get; set; }
+        public string name { get; set; }
+        public string code { get; set; }
+        public string blob { get; set; }
+        public string scope { get; set; }
+    }*/
+    public class ClassInfo {
+        public string id { get; set; }
+        public string name { get; set; }
+        //public string code { get; set; }
+    }
+}

+ 120 - 0
TEAMModelFunction/model/ExamInfo.cs

@@ -0,0 +1,120 @@
+using DocumentFormat.OpenXml.Bibliography;
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Text;
+using System.Text.Json.Serialization;
+using TEAMModelOS.SDK.Context.Attributes.Azure;
+using TEAMModelOS.SDK.DI;
+
+namespace TEAMModelFunction
+{
+    /// <summary>
+    /// 考试基础信息
+    /// </summary>
+    //[CosmosDB(Database = "TEAMModelOS", Name = "School")]
+    public class ExamInfo : ID
+    {
+        [PartitionKey]
+        [Required(ErrorMessage = "{0} 必须填写")]
+        public string code { get; set; }
+    
+        public string pk { get; set; }
+        public int? ttl { get; set; } 
+        public ExamInfo() {
+            period = new PeriodSimple();
+            grades = new List<Grade>();
+            subjects = new List<Subject>();
+            papers = new List<PaperSimple>();
+            targetClassIds = new List<string>();
+        }
+        [JsonProperty(PropertyName = "id")]
+        public string id { get; set; }
+
+        public string name { get; set; }
+        public string school { get; set; }
+        public string creatorId { get; set; }
+        public int stuCount { get; set; }
+/*        //实际考试人数
+        public int realCount { get; set; }
+        //平均分
+        public double piont { get; set; }*/
+        //指标
+        //public double index { get; set; }
+        public long createTime { get; set; }
+        //public string examCode { get; set; }
+        
+        /// <summary>
+        /// 施测起始时间
+        /// </summary>
+        public long startTime { get; set; }
+        /// <summary>
+        /// 施测结束时间
+        /// </summary>
+        public long endTime { get; set; }
+        /// <summary>
+        /// 施测对象
+        /// </summary>
+       // public List<string> target { get; set; }
+        /// <summary>
+        /// 发布
+        /// </summary>
+        public string publish { get; set; }
+
+        public int status { get; set; }
+        public int year { get; set; }
+        public string range { get; set; }
+        public string source { get; set; }
+        public List<string> targetClassIds { get; set; }
+        public List<PaperSimple> papers { get; set; }
+        ///考试类型 段考 stage  联考 union 平常考 normal 其他 other
+        /// </summary>
+        public string type { get; set; }
+        public PeriodSimple period { get; set; }
+        public List<Grade> grades { get; set; }
+        public List<Subject> subjects { get; set; }
+        public long sequenceNumber { get; set; }
+        //public Condition conditions { get; set; }
+        public List<string> blobUrl { get; set; }
+        public string progress { get; set; }
+        public string scope { get; set; }
+        public Custom examType { get; set; }
+        /// <summary>
+        /// 所有试卷阅卷状态
+        /// </summary>
+        //public List<int> marks { get; set; }
+    }
+    public class Custom {
+        public string id { get; set; }
+        public string name { get; set; }
+    }
+    public class PaperSimple { 
+        public string id { get; set; }
+        public string code { get; set; }
+        public string name { get; set; }
+        public string blob { get; set; }
+        public string scope { get; set; }
+        public int multipleRule { get; set; }
+        //该试卷配分情况
+        public List<double> point { get; set; }
+        public List<List<string>> answers { get; set; }
+    }
+    public class PeriodSimple
+    {
+        public string id { get; set; }
+        public string name { get; set; }
+    }
+    public class Grade
+    {
+        public string id { get; set; }
+        public string name { get; set; }
+    }
+    public class Subject
+    {
+        public string id { get; set; }
+        public string name { get; set; }
+
+
+    }
+}

+ 51 - 0
TEAMModelFunction/model/ExamResult.cs

@@ -0,0 +1,51 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Text;
+using TEAMModelOS.SDK.Context.Attributes.Azure;
+using TEAMModelOS.SDK.DI;
+
+namespace TEAMModelFunction
+{
+    /// <summary>
+    /// 考试成绩信息
+    /// </summary>
+    //[CosmosDB(Database = "TEAMModelOS", Name = "School")]
+    public  class ExamResult:ID
+    {
+        [PartitionKey]
+        [Required(ErrorMessage = "{0} 必须填写")]
+        public string code { get; set; }
+        // [PartitionKey(name = "ExamResult")]
+        public string pk { get; set; }
+        public int? ttl { get; set; } 
+        public ExamResult()
+        {
+            classes = new List<ClassRange>();
+            studentScores = new List<List<double>>();
+            studentIds = new List<string>();
+            point = new List<double>();
+        }
+        public string id { get; set; }
+        public string name { get; set; }
+        public string time { get; set; }
+        public string subjectId { get; set; }
+        public List<ClassRange> classes { get; set; }
+        public List<List<double>> studentScores { get; set; }
+        public List<string> studentIds { get; set; }
+        public List<double> point { get; set; }
+     
+        public string schoolId { get; set; }
+        public PaperSimple paper { get; set; }
+        public string scope { get; set; }
+        public string examId { get; set; }
+        public string school { get; set; }
+        public int year { get; set; }
+    }
+    public class ClassRange {
+
+        public string id { get; set; }
+        public string name { get; set; }
+        public List<int> range { get; set; }
+    }
+}

+ 141 - 0
TEAMModelFunction/model/Survey.cs

@@ -0,0 +1,141 @@
+using ProtoBuf;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Text;
+using TEAMModelOS.Models.CommonInfo;
+using TEAMModelOS.SDK.Context.Attributes.Azure;
+using TEAMModelOS.SDK.DI;
+
+namespace TEAMModelFunction
+{
+    /// <summary>
+    /// 问卷调查
+    /// </summary>
+    [CosmosDB(Database = "TEAMModelOS",Name = "School")]
+    public class Survey : ID
+    {
+        public Survey() {
+            questions = new List<Questions>();
+            classes = new List<Classes>();
+        }
+        public string id { get; set; }
+        public int? ttl { get; set; }
+        public string pk { get; set; }
+        /// <summary>
+        /// 学校编码 或者醍摩豆ID
+        /// </summary>
+        [PartitionKey]
+        [Required(ErrorMessage = "{0} 必须填写")]
+        public string code { get; set; }
+        public string name { get; set; }   //测试问卷名称', // 问卷名称
+        public string description { get; set; }   //测试问卷描述', // 问卷描述
+        //public string type { get; set; }   //normal', // 问卷类型
+        public string school { get; set; }
+        public string creatorId { get; set; }
+        public int year { get; set; }
+        public string progress { get; set; }
+        public List<Questions> questions { get; set; }
+        public List<string> targetClassIds { get; set; }
+        public int stuCount { get; set; }
+        public int status { get; set; } // 问卷状态(100:待发布 200:已发布 300:已结束)
+        /// <summary>
+        /// 发布对象
+        /// </summary>
+        //[ProtoMember(4)]
+        //public List<Target> target { get; set; }
+
+        /// <summary>
+        /// 发布模式 0 立即发布 1 定时
+        /// </summary>
+        [ProtoMember(5)]
+        public string publishModel { get; set; }
+
+        /// <summary>
+        /// 开始时间
+        /// </summary>
+        [ProtoMember(6)]
+        public long startTime { get; set; }
+
+        /// <summary>
+        /// 结束时间
+        /// </summary>
+        [ProtoMember(7)]
+        public long endTime { get; set; }
+        public long createTime { get; set; } // 问卷发布时间
+        public List<Classes> classes { get; set; }
+
+        public long sequenceNumber { get; set; }
+
+        public string url { get; set; }
+        public string scope { get; set; }
+
+    }
+    /*public class Item {
+        public string stem { get; set; }
+        /// <summary>
+        ///  Complete Single Multiple Subjective, Judge判断
+        /// </summary>
+        //public string type { get; set; }
+        public bool required { get; set; }
+        public int order { get; set; }
+        public string description { get; set; } = null;
+        public List<CodeValue> options { get; set; }
+        public List<CodeVal> result { get; set; }
+    }*/
+     public class Questions { 
+        public string qid { get; set; }
+        public string question { get; set; }
+        public List<Options> option { get; set; }
+        public string type { get; set; }
+        public QuestionResult result { get; set; }
+
+    }
+    public class Options { 
+        public string code { get; set; }
+        public string value { get; set; }
+        public Result result { get; set; }
+    }
+    public class QuestionResult
+    {
+        public double finish { get; set; }
+        public double finishRate { get; set; }
+    }
+    public class Result { 
+        public double count { get; set; }
+        public double rate { get; set; }
+    }
+    public class Classes { 
+        public string code { get; set; }
+        public string id { get; set; }
+        public string name { get; set; }
+        public string scope { get; set; }
+        public Result result { get; set; }
+        public List<StudentInfo> students { get; set; }
+        public List<AnswerRate> answers { get; set; }
+    }
+    public class AnswerRate {
+        public string qid { get; set; }
+        public double answerRate { get; set; }
+        public List<Options> option { get; set; }
+    }
+    public class StudentInfo {
+        public string id { get; set; }
+        public string name { get; set; }
+        public long finishTime { get; set; }
+        public List<AnswerInfo> answers { get; set; }
+        public ResultInfo result { get; set; }
+    }
+    public class ResultInfo
+    {
+        public double answerRate { get; set; }
+    }
+    public class AnswerInfo { 
+        public string qid { get; set; }
+        public string answer { get; set; }
+    }
+    /*public class CodeVal{
+        public string code { get; set; }
+        public int value { get; set; }
+    }*/
+}

+ 108 - 0
TEAMModelFunction/model/Vote.cs

@@ -0,0 +1,108 @@
+using ProtoBuf;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using TEAMModelOS.SDK.Context.Attributes.Azure;
+using TEAMModelOS.SDK.DI;
+
+namespace TEAMModelFunction
+{
+    /// <summary>
+    /// 投票
+    /// </summary>
+    //[CosmosDB(Database = "TEAMModelOS", Name = "School")]
+    public class Vote : ID
+    {
+        [PartitionKey]
+        [Required(ErrorMessage = "{0} 必须填写")]
+        public string code { get; set; }
+        public string pk { get; set; }
+
+        public Vote()
+        {
+            options = new List<OptionsVote>();
+
+        }
+
+        [ProtoMember(1)]
+        public string id { get; set; }
+        /// <summary>
+        /// 投票名称
+        /// </summary>
+        [ProtoMember(3)]
+        public string name { get; set; }
+        public string school { get; set; }
+        public string creatorId { get; set; }
+        public int year { get; set; }
+        public string progress { get; set; }
+        public List<OptionsVote> options { get; set; }
+        public bool secret { get; set; }
+        public int selectMax { get; set; }
+        public int stuCount { get; set; }
+        public string scope { get; set; }
+        public List<string> targetClassIds { get; set; }
+        /// <summary>
+        /// 发布模式 0 立即发布 1 定时
+        /// </summary>
+        [ProtoMember(5)]
+        public string publishModel { get; set; }
+
+        /// <summary>
+        /// 开始时间
+        /// </summary>
+        [ProtoMember(6)]
+        public long startTime { get; set; }
+        public long createTime { get; set; }
+
+        /// <summary>
+        /// 结束时间
+        /// </summary>
+        [ProtoMember(7)]
+        public long endTime { get; set; }
+
+
+        /// <summary>
+        /// 投票描述
+        /// </summary>
+        [ProtoMember(8)]
+        public string description { get; set; }
+
+
+/*        /// <summary>
+        /// 投票附件
+        /// </summary>
+        [ProtoMember(9)]
+        public List<ProcessRes> resource { get; set; }
+*/
+
+        /// <summary>
+        /// 状态 (100:待发布 200:已发布 300:已结束)
+        /// </summary>
+        [ProtoMember(10)]
+        public int status { get; set; }
+
+
+/*        /// <summary>
+        /// 模式
+        /// </summary>
+        [ProtoMember(11)]
+        public List<string> other { get; set; }*/
+
+/*
+        public string url { get; set; }
+
+        /// <summary>
+        /// 选项
+        /// </summary>
+        [ProtoMember(12)]
+        public List<Option> option { get; set; }*/
+
+        public int? ttl { get; set; }
+
+        public long sequenceNumber { get; set; }
+    }
+    public class OptionsVote { 
+        public string code { get; set; }
+        public string value { get; set; }
+    }
+}

+ 2 - 2
TEAMModelOS.SDK/Context/Constant/Constants.cs

@@ -22,10 +22,10 @@ namespace TEAMModelOS.SDK.Context.Constant.Common
         /// <summary>
         /// <summary>
         /// 主题
         /// 主题
         /// </summary>
         /// </summary>
-        public static   string TopicName = "test_topic_ActiveTask";
+        public static readonly string TopicName = "active-task";
         /// <summary>
         /// <summary>
         /// 订阅
         /// 订阅
         /// </summary>
         /// </summary>
-        public static   string SubName = "test_topic_ReciveTask";
+        public static readonly string SubName = "active-recive-task";
     }
     }
 }
 }

+ 30 - 7
TEAMModelOS.SDK/DI/AzureServiceBus/AzureServiceBusExtensions.cs

@@ -105,23 +105,31 @@ namespace TEAMModelOS.SDK.DI
         }
         }
 
 
 
 
-        public static async Task<long> SendLeamMessage<T>(this ServiceBusClient client, string TopicName, string id, string pk, long startTime, string progress, string msgId)
+        public static async Task<long> SendLeamMessage<T>(this ServiceBusClient client, string TopicName, string id, string pk, long startTime)
         {
         {
             //微調代碼
             //微調代碼
             var timer = DateTimeOffset.FromUnixTimeMilliseconds(startTime);
             var timer = DateTimeOffset.FromUnixTimeMilliseconds(startTime);
-            if (timer.CompareTo(DateTimeOffset.UtcNow) < 0)
+            /*if (type.Equals("start"))
             {
             {
-                progress = "going";
-            } else if (timer.CompareTo(DateTimeOffset.UtcNow) > 0) {
-                progress = "finish";
+                if (timer.CompareTo(DateTimeOffset.UtcNow) < 0)
+                {
+                    progress = "going";
+                }
             }
             }
+            else if(type.Equals("end"))
+            {
+                if (timer.CompareTo(DateTimeOffset.UtcNow) < 0)
+                {
+                    progress = "finish";
+                }
+            }*/
+            
             
             
             //设定开始时间
             //设定开始时间
             Dictionary<string, object> dict = new Dictionary<string, object>() {
             Dictionary<string, object> dict = new Dictionary<string, object>() {
                     { "name",typeof(T).Name},
                     { "name",typeof(T).Name},
                     { "id",id},
                     { "id",id},
-                    { "code",pk},
-                    { "status",progress}
+                    { "code",pk}
                 };
                 };
             //var msgId = "1";
             //var msgId = "1";
             string messageBody = $"Message {dict}";
             string messageBody = $"Message {dict}";
@@ -130,5 +138,20 @@ namespace TEAMModelOS.SDK.DI
             long SequenceNumber = await client.SendScheduleMessageAsync(TopicName, new ServiceBusMessage(dict.ToJsonString()), timer);
             long SequenceNumber = await client.SendScheduleMessageAsync(TopicName, new ServiceBusMessage(dict.ToJsonString()), timer);
             return SequenceNumber;
             return SequenceNumber;
         }
         }
+
+        public static async Task cancelMessage(this ServiceBusClient client, string TopicName, long number)
+        {
+            try
+            {
+                ServiceBusSender sender = client.CreateSender(TopicName);
+                await sender.CancelScheduledMessageAsync(number);
+            }
+            catch
+            {
+                throw;
+            }
+
+
+        }
     }
     }
 }
 }

+ 6 - 6
TEAMModelOS/ClientApp/src/access/index.js

@@ -8,12 +8,12 @@ Vue.use(VueAccessControl, {
   loginRoute: { // 登入路由
   loginRoute: { // 登入路由
     path: '/login'
     path: '/login'
   },
   },
-  // permissionDenyRedirectRoute: {  // 權限拒絕重定向路由
-  //   path: '404'
-  // },
-  // defaultRoute: {  // 基本路由
-  //   name: 'home'
-  // },
+  permissionDenyRedirectRoute: {  // 權限拒絕重定向路由
+    path: '404'
+  },
+  defaultRoute: {  // 基本路由
+    name: 'home'
+  },
 });
 });
 
 
 
 

+ 12 - 0
TEAMModelOS/ClientApp/src/api/classroom.js

@@ -0,0 +1,12 @@
+import { fetch, post } from '@/api/http'
+import mockTools from '@/mock'
+
+export default {
+    GetHiteachList: function (data) {        
+        return post('/school/init/get-school-product', {'school_code': data} )
+        // return new Promise((resolve) => {
+        //     let res = {data: mockTools.data.hiteachSetting}
+        //     resolve(res)
+        // })
+    }
+}

+ 4 - 0
TEAMModelOS/ClientApp/src/api/index.js

@@ -20,11 +20,14 @@ import questionnaire from './questionnaire'
 import teachMgmt from './teachMgmt'
 import teachMgmt from './teachMgmt'
 import schoolUser from './schoolUser'
 import schoolUser from './schoolUser'
 import accessToken from './accessToken'
 import accessToken from './accessToken'
+import studentWeb from './studentWeb'
 import regist from './regist'
 import regist from './regist'
 import forgetPW from './forgetPW'
 import forgetPW from './forgetPW'
+import classroom from './classroom'
 export default {
 export default {
     accessToken,
     accessToken,
     learnActivity,
     learnActivity,
+    studentWeb,
 	questionnaire,
 	questionnaire,
     ClassMgmt,
     ClassMgmt,
     stuAccount,
     stuAccount,
@@ -44,6 +47,7 @@ export default {
     schoolUser,
     schoolUser,
     regist,
     regist,
     forgetPW,
     forgetPW,
+    classroom,
     // 获取登录跳转链接
     // 获取登录跳转链接
     getLoginLink: function (data) {
     getLoginLink: function (data) {
         return post('api/login/login', data)
         return post('api/login/login', data)

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

@@ -269,7 +269,7 @@ export default {
     /*
     /*
      * 查询单个学生作答信息
      * 查询单个学生作答信息
      */
      */
-    FindOneStudent: function (data) {
-        return post('/api/Exam/findByIdPk', data)
+    FindAllStudent: function (data) {
+        return post('/school/exam/find-summary-record', data)
     }
     }
 }
 }

+ 5 - 5
TEAMModelOS/ClientApp/src/api/login.js

@@ -48,7 +48,7 @@ export default {
 	},
 	},
 	// 學生登入
 	// 學生登入
 	studLoginbyIES: function(data) {
 	studLoginbyIES: function(data) {
-		return post('/api/Student/student-login', data)
+		return post('/student/login', data)
 	},
 	},
 	// 固定登入流程
 	// 固定登入流程
 	loginIES: function(item, schoolcode) {
 	loginIES: function(item, schoolcode) {
@@ -57,7 +57,6 @@ export default {
 			localStorage.setItem("id_token", item.id_token)
 			localStorage.setItem("id_token", item.id_token)
 			localStorage.setItem("access_token", item.access_token)
 			localStorage.setItem("access_token", item.access_token)
 			localStorage.setItem("expires_in", item.expires_in)
 			localStorage.setItem("expires_in", item.expires_in)
-
 			// 輸出暫存
 			// 輸出暫存
 			let result;
 			let result;
 
 
@@ -77,7 +76,9 @@ export default {
 			}).catch(err => {
 			}).catch(err => {
 				console.log(err)
 				console.log(err)
 			})
 			})
-			let defaultschool = schoolcode != '' ? schoolcode : result.defaultschool
+			let hasJoinSchool = result.schools.length && result.schools.filter(i => i.status === 'join').length
+			let joinSchools = hasJoinSchool ? result.schools.filter(i => i.status === 'join') : []
+			let defaultschool = schoolcode != '' ? schoolcode : result.defaultschool ? result.defaultschool : (joinSchools.length ? joinSchools[0].schoolId : null)
 			let authByUser = jwtDecode(result.auth_token)
 			let authByUser = jwtDecode(result.auth_token)
 			let info = {
 			let info = {
 				id: t_Data.sub,
 				id: t_Data.sub,
@@ -93,9 +94,9 @@ export default {
 					id_token: id_token,
 					id_token: id_token,
 					school_code: defaultschool
 					school_code: defaultschool
 				}).then(res => {
 				}).then(res => {
-
 					// 沒有錯誤的話
 					// 沒有錯誤的話
 					if (!res.error) {
 					if (!res.error) {
+						console.log(res)
 						// 儲存大雲Token
 						// 儲存大雲Token
 						localStorage.setItem("auth_token", res.auth_token)
 						localStorage.setItem("auth_token", res.auth_token)
 						store.dispatch('user/setSchoolCode', defaultschool)
 						store.dispatch('user/setSchoolCode', defaultschool)
@@ -131,7 +132,6 @@ export default {
 			// 進行API呼叫
 			// 進行API呼叫
 			await this.studLoginbyIES(data).then(res => {
 			await this.studLoginbyIES(data).then(res => {
 				if (res.error == 0) {
 				if (res.error == 0) {
-					console.log(res)
 					// 儲存大雲Token
 					// 儲存大雲Token
 					localStorage.setItem("auth_token", res.auth_token)
 					localStorage.setItem("auth_token", res.auth_token)
 					store.dispatch('user/setSchoolCode', data.school_code)
 					store.dispatch('user/setSchoolCode', data.school_code)

+ 4 - 4
TEAMModelOS/ClientApp/src/api/stuAccount.js

@@ -8,7 +8,7 @@ export default {
             "students": []
             "students": []
         }
         }
         format.students.push(...data)
         format.students.push(...data)
-        return post('/api/Student/student-manage', format)
+        return post('/student/student-manage', format)
     },
     },
     //��ѯѧ��
     //��ѯѧ��
     findStudent: function(schoolId) {
     findStudent: function(schoolId) {
@@ -16,7 +16,7 @@ export default {
             "grant_type": "read",
             "grant_type": "read",
             "schoolId": schoolId.toLowerCase()
             "schoolId": schoolId.toLowerCase()
         }
         }
-        return post('/api/Student/student-manage', format)
+        return post('/student/student-manage', format)
     },
     },
     saveAllStudent: function(schoolId, data) {
     saveAllStudent: function(schoolId, data) {
         let format = {
         let format = {
@@ -25,7 +25,7 @@ export default {
             "students": []
             "students": []
         }
         }
         format.students.push(...data)
         format.students.push(...data)
-        return post('/api/Student/student-manage', format)
+        return post('/student/student-manage', format)
     },
     },
     /**
     /**
      * 刪除學生
      * 刪除學生
@@ -38,7 +38,7 @@ export default {
             "students": []
             "students": []
         }
         }
         format.students.push(...data)
         format.students.push(...data)
-        return post('/api/Student/student-manage', format)
+        return post('/student/student-manage', format)
     },
     },
     updateStudent: function(data) {
     updateStudent: function(data) {
         return post('/api/Student/upsert', data)
         return post('/api/Student/upsert', data)

+ 15 - 1
TEAMModelOS/ClientApp/src/api/studentWeb.js

@@ -1,4 +1,5 @@
 import { Random } from 'mockjs'
 import { Random } from 'mockjs'
+import {  post } from '@/api/http'
 //----------
 //----------
 // 使用 Mock 測試
 // 使用 Mock 測試
 
 
@@ -139,7 +140,20 @@ export default {
     mocktime,
     mocktime,
     mockStudydata,
     mockStudydata,
     mockStudydata2,
     mockStudydata2,
-    mockQASheet
+    mockQASheet,
+
+    //查询学生参与评量数据
+    FindExamPaper: function (data) {
+        return post('/school/exam/find-all-by-student', data)
+    },
+    //查询学生的评量数据
+    FindStudentPaper: function (data) {
+        return post('/school/exam/find-summary-by-student', data)
+    },
+    //保存学生评量数据
+    SaveStuExamPaper: function (data) {
+        return post('/school/exam/upsert-record', data)
+    },
 
 
 }
 }
 
 

+ 46 - 0
TEAMModelOS/ClientApp/src/assets/iconfont/demo_index.html

@@ -30,6 +30,18 @@
       <div class="content unicode" style="display: block;">
       <div class="content unicode" style="display: block;">
           <ul class="icon_lists dib-box">
           <ul class="icon_lists dib-box">
           
           
+            <li class="dib">
+              <span class="icon iconfont">&#xe642;</span>
+                <div class="name">二维码</div>
+                <div class="code-name">&amp;#xe642;</div>
+              </li>
+          
+            <li class="dib">
+              <span class="icon iconfont">&#xe612;</span>
+                <div class="name">数据分析</div>
+                <div class="code-name">&amp;#xe612;</div>
+              </li>
+          
             <li class="dib">
             <li class="dib">
               <span class="icon iconfont">&#xe69b;</span>
               <span class="icon iconfont">&#xe69b;</span>
                 <div class="name">库存分析</div>
                 <div class="name">库存分析</div>
@@ -422,6 +434,24 @@
       <div class="content font-class">
       <div class="content font-class">
         <ul class="icon_lists dib-box">
         <ul class="icon_lists dib-box">
           
           
+          <li class="dib">
+            <span class="icon iconfont icon-qr-code"></span>
+            <div class="name">
+              二维码
+            </div>
+            <div class="code-name">.icon-qr-code
+            </div>
+          </li>
+          
+          <li class="dib">
+            <span class="icon iconfont icon-shujufenxi"></span>
+            <div class="name">
+              数据分析
+            </div>
+            <div class="code-name">.icon-shujufenxi
+            </div>
+          </li>
+          
           <li class="dib">
           <li class="dib">
             <span class="icon iconfont icon-school-analysis"></span>
             <span class="icon iconfont icon-school-analysis"></span>
             <div class="name">
             <div class="name">
@@ -964,6 +994,22 @@
       <div class="content symbol">
       <div class="content symbol">
           <ul class="icon_lists dib-box">
           <ul class="icon_lists dib-box">
           
           
+            <li class="dib">
+                <svg class="icon svg-icon" aria-hidden="true">
+                  <use xlink:href="#icon-qr-code"></use>
+                </svg>
+                <div class="name">二维码</div>
+                <div class="code-name">#icon-qr-code</div>
+            </li>
+          
+            <li class="dib">
+                <svg class="icon svg-icon" aria-hidden="true">
+                  <use xlink:href="#icon-shujufenxi"></use>
+                </svg>
+                <div class="name">数据分析</div>
+                <div class="code-name">#icon-shujufenxi</div>
+            </li>
+          
             <li class="dib">
             <li class="dib">
                 <svg class="icon svg-icon" aria-hidden="true">
                 <svg class="icon svg-icon" aria-hidden="true">
                   <use xlink:href="#icon-school-analysis"></use>
                   <use xlink:href="#icon-school-analysis"></use>

File diff suppressed because it is too large
+ 14 - 6
TEAMModelOS/ClientApp/src/assets/iconfont/iconfont.css


BIN
TEAMModelOS/ClientApp/src/assets/iconfont/iconfont.eot


File diff suppressed because it is too large
+ 1 - 1
TEAMModelOS/ClientApp/src/assets/iconfont/iconfont.js


+ 14 - 0
TEAMModelOS/ClientApp/src/assets/iconfont/iconfont.json

@@ -5,6 +5,20 @@
   "css_prefix_text": "icon-",
   "css_prefix_text": "icon-",
   "description": "",
   "description": "",
   "glyphs": [
   "glyphs": [
+    {
+      "icon_id": "993771",
+      "name": "二维码",
+      "font_class": "qr-code",
+      "unicode": "e642",
+      "unicode_decimal": 58946
+    },
+    {
+      "icon_id": "18205080",
+      "name": "数据分析",
+      "font_class": "shujufenxi",
+      "unicode": "e612",
+      "unicode_decimal": 58898
+    },
     {
     {
       "icon_id": "14745833",
       "icon_id": "14745833",
       "name": "库存分析",
       "name": "库存分析",

File diff suppressed because it is too large
+ 6 - 0
TEAMModelOS/ClientApp/src/assets/iconfont/iconfont.svg


BIN
TEAMModelOS/ClientApp/src/assets/iconfont/iconfont.ttf


BIN
TEAMModelOS/ClientApp/src/assets/iconfont/iconfont.woff


BIN
TEAMModelOS/ClientApp/src/assets/iconfont/iconfont.woff2


+ 1 - 0
TEAMModelOS/ClientApp/src/assets/student-web/component_styles/lesson-testpop.less

@@ -230,6 +230,7 @@
   .questioDes {
   .questioDes {
     font-weight: 900;
     font-weight: 900;
     font-size: 14px;
     font-size: 14px;
+    display:flex;
     @media screen and (max-width: 767px) {
     @media screen and (max-width: 767px) {
       font-size: 12px;
       font-size: 12px;
     }
     }

+ 5 - 1
TEAMModelOS/ClientApp/src/boot-app.js

@@ -108,9 +108,13 @@ Vue.component('icon', FontAwesomeIcon)
 
 
 store.dispatch('user/checkSchoolCode');// 設定登入成功的學校簡碼
 store.dispatch('user/checkSchoolCode');// 設定登入成功的學校簡碼
 store.dispatch('user/checkUserProfile');// 檢查使用者個人詳細資訊
 store.dispatch('user/checkUserProfile');// 檢查使用者個人詳細資訊
-store.dispatch('user/checkSchoolProfile');// 檢查使用者在學校的詳細資訊
 store.dispatch('user/checkStudentProfile');// 檢查學生的詳細資訊
 store.dispatch('user/checkStudentProfile');// 檢查學生的詳細資訊
 store.dispatch('config/checkSrvAdr');// 檢查現在站的位置
 store.dispatch('config/checkSrvAdr');// 檢查現在站的位置
+store.dispatch('user/checkSchoolProfile').then(res=>{
+    if(res) {
+        User.freshLogin()
+    }
+});// 檢查使用者在學校的詳細資訊
 
 
 router.beforeEach((to, from, next) => {
 router.beforeEach((to, from, next) => {
     document.body.scrollTop = 0
     document.body.scrollTop = 0

+ 91 - 65
TEAMModelOS/ClientApp/src/common/BaseSelectSchool.vue

@@ -1,25 +1,25 @@
 <template>
 <template>
 	<div class="base-school-select">
 	<div class="base-school-select">
-			<div v-if="!user.schools.length">暂未加入学校</div>
-			<Dropdown @on-click="onSchoolSelect" v-else>
-				<img class="school-logo" :src="curSchool.logo || defaultLogo" />
-				<a href="javascript:void(0)" :class="['base-user-post', user.schools.length === 1 ? 'single-school' : '']">
-					{{ curSchool.name }}
-					<Icon type="ios-arrow-down"></Icon>
-				</a>
-				<DropdownMenu slot="list">
-					<div v-for="(item,index) in user.schools" :key="index">
-						<DropdownItem :name="index">
-							<div class="school-item">
-								<img :src="item.logo || defaultLogo" alt="">
-								<span>{{ item.name }}</span>
-							</div>
-						</DropdownItem>
-					</div>
-
-				</DropdownMenu>
-			</Dropdown>
-		</div>
+		<div v-if="!user.schools.length">暂未加入学校</div>
+		<Dropdown @on-click="onSchoolSelect" v-else>
+			<img class="school-logo" :src="curSchool.logo || defaultLogo" />
+			<a href="javascript:void(0)" :class="['base-user-post', user.schools.length === 1 ? 'single-school' : '']">
+				{{ curSchool.name }}
+				<Icon type="ios-arrow-down"></Icon>
+			</a>
+			<DropdownMenu slot="list">
+				<div v-for="(item,index) in user.schools" :key="index">
+					<DropdownItem :name="index">
+						<div class="school-item">
+							<img :src="item.logo || defaultLogo" alt="">
+							<span>{{ item.name }}</span>
+						</div>
+					</DropdownItem>
+				</div>
+
+			</DropdownMenu>
+		</Dropdown>
+	</div>
 	</div>
 	</div>
 </template>
 </template>
 
 
@@ -28,11 +28,11 @@
 		data() {
 		data() {
 			return {
 			return {
 				curSchool: {
 				curSchool: {
-					logo:''
+					logo: ''
 				},
 				},
-				defaultLogo:'',
-				user:{
-					schools:[]
+				defaultLogo: '',
+				user: {
+					schools: []
 				}
 				}
 			}
 			}
 		},
 		},
@@ -40,27 +40,34 @@
 			this.defaultLogo = require('@/assets/icon/default_school.png')
 			this.defaultLogo = require('@/assets/icon/default_school.png')
 			// 获取本地存储中的 用户信息
 			// 获取本地存储中的 用户信息
 			let user = JSON.parse(decodeURIComponent(localStorage.user_profile, "utf-8"));
 			let user = JSON.parse(decodeURIComponent(localStorage.user_profile, "utf-8"));
-			console.log(user)
-			if(user.schools){
+			let school = localStorage.school_profile ? JSON.parse(decodeURIComponent(localStorage.school_profile, "utf-8")) :undefined;
+
+			let schools = user.schools.filter(i => i.status === 'join')
+			this.user.schools = schools
+			// 如果本地存储已经有保存学校信息 则刷新后会直接读取之前的学校信息
+			if (school) {
+				this.curSchool = schools.filter(i => i.schoolId === school.school_base.id)[0]
+				this.$store.commit('setSchoolCode', this.curSchool.schoolId)
+			} else if (user.schools) {
 				// 拿到用户管理的schools 必须是已加入的学校
 				// 拿到用户管理的schools 必须是已加入的学校
-				let schools = user.schools.filter(i => i.status === 'join')
-				if(schools.length){
-					this.user.schools = schools
+				if (schools.length) {
 					this.curSchool = user.defaultschool ? schools.filter(i => i.schoolId === user.defaultschool)[0] : schools[0]
 					this.curSchool = user.defaultschool ? schools.filter(i => i.schoolId === user.defaultschool)[0] : schools[0]
 					this.$store.commit('setSchoolCode', this.curSchool.schoolId)
 					this.$store.commit('setSchoolCode', this.curSchool.schoolId)
 				}
 				}
-			}else{
+			} else {
 				this.$Message.warning('用户暂无学校列表数据')
 				this.$Message.warning('用户暂无学校列表数据')
 			}
 			}
 		},
 		},
 		methods: {
 		methods: {
-			async onSchoolSelect(val){
-				this.$EventBus.$emit('onGlobalLoading',true)
+			async onSchoolSelect(val) {
+				this.$EventBus.$emit('onGlobalLoading', true)
 				this.curSchool = this.user.schools[val]
 				this.curSchool = this.user.schools[val]
 				let schoolCode = this.user.schools[val].schoolId
 				let schoolCode = this.user.schools[val].schoolId
 				let schoolInfo = await this.getTeacherSchoolInfo(schoolCode)
 				let schoolInfo = await this.getTeacherSchoolInfo(schoolCode)
-				this.$store.commit('setSchoolCode',schoolCode)
-				this.$store.commit('schoolBaseInfo/setSchoolInfo',{ period:[] })
+				this.$store.commit('setSchoolCode', schoolCode)
+				this.$store.commit('schoolBaseInfo/setSchoolInfo', {
+					period: []
+				})
 				this.$store.commit('schoolBaseInfo/setClassroomList', undefined)
 				this.$store.commit('schoolBaseInfo/setClassroomList', undefined)
 				this.$store.dispatch('user/setSchoolCode', schoolCode)
 				this.$store.dispatch('user/setSchoolCode', schoolCode)
 				this.$store.dispatch('user/setSchoolProfile', schoolInfo)
 				this.$store.dispatch('user/setSchoolProfile', schoolInfo)
@@ -68,16 +75,16 @@
 				console.log(this.$store.state)
 				console.log(this.$store.state)
 				console.log(JSON.parse(decodeURIComponent(localStorage.school_profile, "utf-8")))
 				console.log(JSON.parse(decodeURIComponent(localStorage.school_profile, "utf-8")))
 				setTimeout(() => {
 				setTimeout(() => {
-					this.$EventBus.$emit('onGlobalLoading',false)
-				},500)
+					this.$EventBus.$emit('onGlobalLoading', false)
+				}, 500)
 				this.$router.push({
 				this.$router.push({
-					name:'home'
+					name: 'home'
 				})
 				})
 			},
 			},
-			
+
 			/* 获取老师所在学校的信息 */
 			/* 获取老师所在学校的信息 */
 			getTeacherSchoolInfo(code) {
 			getTeacherSchoolInfo(code) {
-				return new Promise((r,j) => {
+				return new Promise((r, j) => {
 					this.$api.schoolSetting.getTeacherSchoolInfo({
 					this.$api.schoolSetting.getTeacherSchoolInfo({
 						id_token: localStorage.getItem('id_token'),
 						id_token: localStorage.getItem('id_token'),
 						school_code: code
 						school_code: code
@@ -95,8 +102,21 @@
 			},
 			},
 		},
 		},
 
 
+		mounted() {
+			this.$EventBus.$on('onChangeSchool', params => {
+				if (params.schoolCode !== this.curSchool.schoolId) {
+					console.log('检测到切换学校')
+					console.log(params)
+					this.user = params.user
+					this.curSchool = params.user.defaultschool ? params.user.schools.filter(i => i.schoolId === params.user.defaultschool)[
+						0] : params.user.schools[0]
+					this.onSchoolSelect(params.user.schools.map(i => i.schoolId).indexOf(params.schoolCode))
+				}
+			})
+		},
+
 		computed: {
 		computed: {
-			
+
 		}
 		}
 	}
 	}
 </script>
 </script>
@@ -104,57 +124,63 @@
 <style lang="less">
 <style lang="less">
 	.base-school-select {
 	.base-school-select {
 		font-family: '微軟正黑體', 'Heiti TC' !important;
 		font-family: '微軟正黑體', 'Heiti TC' !important;
-		
-		.ivu-dropdown{
+
+		.ivu-dropdown {
 			
 			
-			.ivu-dropdown-item:hover{
+			.ivu-select-dropdown{
+				width: max-content;
+				width: -webkit-max-content;
+				left: -35%;
+			}
+
+			.ivu-dropdown-item:hover {
 				background: #83d7ff;
 				background: #83d7ff;
 			}
 			}
-			
-			a{
-				color:var(--primary-textColor) !important;
-				
-				&:hover{
-					color:var(--primary-textColor) !important;
+
+			a {
+				color: var(--primary-textColor) !important;
+
+				&:hover {
+					color: var(--primary-textColor) !important;
 				}
 				}
-				
-				.ivu-icon{
+
+				.ivu-icon {
 					display: none;
 					display: none;
 				}
 				}
-				
-				&::after{
+
+				&::after {
 					content: '';
 					content: '';
 					display: inline-block;
 					display: inline-block;
 					width: 0;
 					width: 0;
 					height: 0;
 					height: 0;
-					border-right:solid 8px transparent;
-					border-left:solid 8px transparent ;
-					border-top:solid 8px #d0d0d0;
+					border-right: solid 8px transparent;
+					border-left: solid 8px transparent;
+					border-top: solid 8px #d0d0d0;
 					margin-left: 8px;
 					margin-left: 8px;
 					margin-bottom: 3px;
 					margin-bottom: 3px;
 				}
 				}
 			}
 			}
 		}
 		}
-		
-		.single-school{
-			&::after{
+
+		.single-school {
+			&::after {
 				display: none !important;
 				display: none !important;
 			}
 			}
 		}
 		}
-		
-		.school-logo{
+
+		.school-logo {
 			width: 30px;
 			width: 30px;
 			border-radius: 50%;
 			border-radius: 50%;
 			margin-right: 10px;
 			margin-right: 10px;
 			margin-bottom: 5px;
 			margin-bottom: 5px;
 			vertical-align: middle;
 			vertical-align: middle;
 		}
 		}
-		
-		.school-item{
+
+		.school-item {
 			display: flex;
 			display: flex;
 			align-items: center;
 			align-items: center;
-			
-			img{
+
+			img {
 				width: 30px;
 				width: 30px;
 				margin-right: 15px;
 				margin-right: 15px;
 			}
 			}

+ 0 - 1
TEAMModelOS/ClientApp/src/common/BaseUserPoptip.vue

@@ -137,7 +137,6 @@
                 containerClient.getSize().then(
                 containerClient.getSize().then(
                     res => {
                     res => {
                         this.sizeInfo = res
                         this.sizeInfo = res
-                        console.log(res)
                     },
                     },
                     err => {
                     err => {
                         this.$Message.error('空间计算异常')
                         this.$Message.error('空间计算异常')

+ 28 - 9
TEAMModelOS/ClientApp/src/common/NewUploadFile.vue

@@ -1,16 +1,20 @@
 <template>
 <template>
     <div class="upload-file-box"> 
     <div class="upload-file-box"> 
-        <Upload type="drag" action="" :show-upload-list="false"	 multiple :before-upload="customUpload" class="upload-wrap">
+        <Upload type="drag" action="" :show-upload-list="false"	multiple :before-upload="customUpload" class="upload-wrap">
             <Icon class="upload-icon" custom="iconfont icon-upload" />
             <Icon class="upload-icon" custom="iconfont icon-upload" />
             <p class="upload-text">{{$t('teachContent.uploadText')}}</p>
             <p class="upload-text">{{$t('teachContent.uploadText')}}</p>
         </Upload>
         </Upload>
         <div class="upload-file-box">
         <div class="upload-file-box">
             <div class="upload-file-item" v-for="(item,index) in uploadedList" :key="index">
             <div class="upload-file-item" v-for="(item,index) in uploadedList" :key="index">
                 <p class="upload-file-name">{{item.name}}</p>
                 <p class="upload-file-name">{{item.name}}</p>
-                <Icon type="ios-close" class="delete-btn" size="20" style="float:right;" @click="deleteFile(index)" />
-                <span style="float:right;margin-left:10px;vertical-align:middle;color:white;">{{parseInt(item.loadedBytes * 100 / item.size)+'%'}}</span>
-                <span style="float:right;font-size:12px;vertical-align:middle;margin-top:2px;">{{getSizeByBytes(item.loadedBytes)+'/'+getSizeByBytes(item.size)}}</span>
-                <Progress v-if="item.status == 0" :percent="item.loadedBytes * 100 / item.size" status="active" stroke-color="#1CC0F3" :stroke-width="2" hide-info/>
+                <Icon type="ios-close" class="delete-btn" color="red" size="30" style="float:right;" @click="deleteFile(index)" />
+                <span style="float:right;margin-left:10px;vertical-align:middle;color:white; line-height:30px;">
+                    {{parseInt(item.loadedBytes * 100 / item.size)+'%'}}
+                </span>
+                <span style="float: right;font-size: 12px;vertical-align: middle;line-height: 30px;">
+                    {{getSizeByBytes(item.loadedBytes)+'/'+getSizeByBytes(item.size)}}
+                </span>
+                <Progress style="top:-10px;" v-if="item.status == 0" :percent="item.loadedBytes * 100 / item.size" status="active" stroke-color="#1CC0F3" :stroke-width="2" hide-info/>
             </div>
             </div>
         </div>
         </div>
     </div>
     </div>
@@ -71,6 +75,19 @@
             }
             }
         },
         },
         methods: {
         methods: {
+            //删除文件
+            deleteFile(index) {
+                this.containerClient.deleteBlob(this.uploadedList[index].blob).then(
+                    res => {
+                        this.$emit('deleteFile', this._.cloneDeep(this.uploadedList[index]))
+                        this.uploadedList.splice(index,1)
+                        this.$Message.success('删除成功!')
+                    },
+                    err => {
+                        this.$Message.error('删除失败!')
+                    }
+                )
+            },
             getFileType(fileName) {
             getFileType(fileName) {
                 let extension = fileName.substring(fileName.lastIndexOf('.') + 1, fileName.length)
                 let extension = fileName.substring(fileName.lastIndexOf('.') + 1, fileName.length)
                 extension = extension.toUpperCase()
                 extension = extension.toUpperCase()
@@ -105,7 +122,7 @@
                 let fileType = this.getFileType(file.name)
                 let fileType = this.getFileType(file.name)
                 //上传文件
                 //上传文件
                 let fileInfo = {
                 let fileInfo = {
-                    url: this.urlString + '/ ' + this.containerName + '/ ' + fileType + '/ ' + file.name,
+                    url: this.urlString + '/' + this.containerName + '/' + fileType + '/' + file.name,
                     name: file.name,
                     name: file.name,
                     size: file.size,
                     size: file.size,
                     loadedBytes: 0,
                     loadedBytes: 0,
@@ -123,6 +140,7 @@
                 }).then(
                 }).then(
                     res => {
                     res => {
                         this.uploadedList[index].status = 1
                         this.uploadedList[index].status = 1
+                        this.uploadedList[index].blob = res.blob
                         this.$emit('successData',res)
                         this.$emit('successData',res)
                     },
                     },
                     err => {
                     err => {
@@ -239,11 +257,12 @@
         cursor: pointer;
         cursor: pointer;
         color: #909090;
         color: #909090;
         margin-top: 5px;
         margin-top: 5px;
+        padding:5px 2px 0px 5px;
     }
     }
 
 
         .upload-file-item:hover {
         .upload-file-item:hover {
             color: white;
             color: white;
-            background: #606060;
+            background: #585858;
             border-radius: 5px;
             border-radius: 5px;
         }
         }
 
 
@@ -255,8 +274,8 @@
     }
     }
     .upload-file-name {
     .upload-file-name {
         display: inline-block;
         display: inline-block;
-        /*margin-left: 10px;*/
-        color:#EEEEEE;
+        color: #EEEEEE;
+        line-height: 30px;
     }
     }
 
 
     .delete-btn {
     .delete-btn {

+ 3 - 3
TEAMModelOS/ClientApp/src/components/coursemgmt/StudentList.vue

@@ -202,7 +202,7 @@
                         if (res.error == null) {
                         if (res.error == null) {
                             this.tableData = res.result.data
                             this.tableData = res.result.data
                             for (let index in this.tableData) {
                             for (let index in this.tableData) {
-                                let currentClassroomlInfo = this.$JSONPath.query(this.$store.state.schoolBaseInfo.classroomList, "$..[?(@.classroomCode=='" + this.tableData[index].classroomCode + "')]")
+                                let currentClassroomlInfo = this.$JSONPath.query(this.$store.state.user.schoolProfile.school_classes, "$..[?(@.classroomCode=='" + this.tableData[index].classroomCode + "')]")
                                 if (currentClassroomlInfo.length > 0) {
                                 if (currentClassroomlInfo.length > 0) {
                                     let currentSchoolInfo = this.$JSONPath.query(this.$store.state.schoolBaseInfo.schoolBaseInfo, "$..period[?(@.periodCode=='" + currentClassroomlInfo[0].periodCode + "')]")
                                     let currentSchoolInfo = this.$JSONPath.query(this.$store.state.schoolBaseInfo.schoolBaseInfo, "$..period[?(@.periodCode=='" + currentClassroomlInfo[0].periodCode + "')]")
                                     if (currentSchoolInfo.length > 0) {
                                     if (currentSchoolInfo.length > 0) {
@@ -306,9 +306,9 @@
         computed: {
         computed: {
             classroomList() {
             classroomList() {
                 if (this.searchGrade == '') {
                 if (this.searchGrade == '') {
-                    return this.$store.state.schoolBaseInfo.classroomList
+                    return this.$store.state.user.schoolProfile.school_classes
                 } else {
                 } else {
-                    return this.$store.state.schoolBaseInfo.classroomList.filter((item) => {
+                    return this.$store.state.user.schoolProfile.school_classes.filter((item) => {
                         return item.gradeCode == this.searchGrade
                         return item.gradeCode == this.searchGrade
                     })
                     })
                 }
                 }

+ 2 - 3
TEAMModelOS/ClientApp/src/components/learnactivity/BaseHwForm.vue

@@ -82,8 +82,7 @@
             <ChooseContent :showSyllabus="isFalse"
             <ChooseContent :showSyllabus="isFalse"
                            :showOther="isFalse"
                            :showOther="isFalse"
                            :showQuestion="isFalse"
                            :showQuestion="isFalse"
-                           @on-select-file="onSelectFile"
-                           @on-cancel-file="onSelectFile"></ChooseContent>
+                           @on-file-change="onSelectFile"></ChooseContent>
 
 
             <Button class="modal-btn" :loading="isLoading" @click="onConfirmRelate">确认</Button>
             <Button class="modal-btn" :loading="isLoading" @click="onConfirmRelate">确认</Button>
         </Modal>
         </Modal>
@@ -92,7 +91,7 @@
 <script>
 <script>
     import E from '@/utils/wangEditor.js'
     import E from '@/utils/wangEditor.js'
     import UploadFile from '@/common/UploadFile.vue'
     import UploadFile from '@/common/UploadFile.vue'
-    import ChooseContent from '@/components/learnactivity/ChooseContent'
+    import ChooseContent from '@/components/learnactivity/NewChooseContent'
     export default {
     export default {
         props: {
         props: {
             editItem: {
             editItem: {

+ 56 - 28
TEAMModelOS/ClientApp/src/components/learnactivity/BaseVoteForm.vue

@@ -29,31 +29,39 @@
                             style="margin-top:10px"></DatePicker>
                             style="margin-top:10px"></DatePicker>
             </FormItem> -->
             </FormItem> -->
 			
 			
-			<FormItem label="开始时间" prop="startTime">
+<!-- 			<FormItem label="开始时间" prop="startTime">
 			    <DatePicker type="datetime" :class="!voteFormEdit ? 'vote-form-disabled':''" :editable="isDateEdit" placeholder="请选择投票开始时间" v-model="hwForm.startTime" :options="startTimeOptions"></DatePicker>
 			    <DatePicker type="datetime" :class="!voteFormEdit ? 'vote-form-disabled':''" :editable="isDateEdit" placeholder="请选择投票开始时间" v-model="hwForm.startTime" :options="startTimeOptions"></DatePicker>
 			</FormItem>
 			</FormItem>
 
 
             <FormItem label="结束时间" prop="endTime">
             <FormItem label="结束时间" prop="endTime">
                 <DatePicker type="datetime" :class="!voteFormEdit ? 'vote-form-disabled':''" :editable="isDateEdit" placeholder="请选择投票结束时间" v-model="hwForm.endTime"  :options="endTimeOptions"></DatePicker>
                 <DatePicker type="datetime" :class="!voteFormEdit ? 'vote-form-disabled':''" :editable="isDateEdit" placeholder="请选择投票结束时间" v-model="hwForm.endTime"  :options="endTimeOptions"></DatePicker>
-            </FormItem>
+            </FormItem> -->
+			
+			
+			<FormItem label="起止时间" prop="startTime">
+			    <!-- <DatePicker type="datetime" :class="!voteFormEdit ? 'vote-form-disabled':''" :editable="isDateEdit" placeholder="请选择投票结束时间" v-model="hwForm.endTime"  :options="endTimeOptions"></DatePicker> -->
+				<DatePicker type="datetimerange" @on-change="onChangeRange" format="yyyy-MM-dd HH:mm" :class="!voteFormEdit ? 'vote-form-disabled':''" :editable="isDateEdit" :value="[hwForm.startTime,hwForm.endTime]" placeholder="请选择投票结束时间"></DatePicker>
+			</FormItem>
 
 
             <FormItem label="投票描述" prop="description">
             <FormItem label="投票描述" prop="description">
                 <div ref="descriptionEditor" style="text-align:left" v-show="voteFormEdit"></div>
                 <div ref="descriptionEditor" style="text-align:left" v-show="voteFormEdit"></div>
                 <div v-html="hwForm.description" v-show="!voteFormEdit" style="margin:10px;font-size:16px;font-weight:bold;color:#fff"></div>
                 <div v-html="hwForm.description" v-show="!voteFormEdit" style="margin:10px;font-size:16px;font-weight:bold;color:#fff"></div>
             </FormItem>
             </FormItem>
 
 
-            <FormItem label="选项设置" prop="attachment">
-                <div v-for="(item,index) in voteOptions" :key="index" class="option-editor-wrap">
-					<div v-show="voteFormEdit" style="display: flex;">
-						<span class="option-order">{{ index + 1 }}<Icon type="md-trash" @click="deleteOption(index)"/></span>
-						<div :ref="'voteOption'+index" style="text-align:left" class="option-editor" @click="optionClick(index)"></div>
-					</div>
-					<div v-show="!voteFormEdit">
-						<span style="color:#fff;margin-left: 10px;">{{ index + 1 }} .</span>
-						<div v-html="(voteOptionsContent[index]) ? voteOptionsContent[index].value : ''" v-show="!voteFormEdit" style="margin:10px;font-size:16px;font-weight:bold;color:#fff;display: inline-block;vertical-align: middle;"></div>
+            <FormItem label="选项设置" prop="attachment" ref="optionsBox">
+				<div v-if="voteOptions.length">
+					<div v-for="(item,index) in voteOptions" :key="index" class="option-editor-wrap">
+						<div v-show="voteFormEdit" style="display: flex;">
+							<span class="option-order">{{ index + 1 }}<Icon type="md-trash" @click="deleteOption(index)"/></span>
+							<div :ref="'voteOption'+index" style="text-align:left" class="option-editor" @click="optionClick(index)"></div>
+						</div>
+						<div v-show="!voteFormEdit">
+							<span style="color:#fff;margin-left: 10px;">{{ index + 1 }} .</span>
+							<div v-html="(voteOptionsContent[index]) ? voteOptionsContent[index].value : ''" v-show="!voteFormEdit" style="margin:10px;font-size:16px;font-weight:bold;color:#fff;display: inline-block;vertical-align: middle;"></div>
+						</div>
 					</div>
 					</div>
-                    
-                </div>
+				</div>
+                
                 <p style="float:right;color:#BDBDBD;cursor:pointer" @click="onAddOption" v-show="voteFormEdit"><Icon type="md-add" />添加选项</p>
                 <p style="float:right;color:#BDBDBD;cursor:pointer" @click="onAddOption" v-show="voteFormEdit"><Icon type="md-add" />添加选项</p>
             </FormItem>
             </FormItem>
 
 
@@ -121,6 +129,7 @@
                     endTime: '',
                     endTime: '',
                     publishModel:'0',
                     publishModel:'0',
                     startTime:'',
                     startTime:'',
+					rangeTime:[],
                     description: '',
                     description: '',
                     isReset: [],
                     isReset: [],
                     selectMax:1,
                     selectMax:1,
@@ -160,11 +169,14 @@
                         { required: true, message: '投票对象不能为空' }
                         { required: true, message: '投票对象不能为空' }
                     ],
                     ],
                     endTime: [
                     endTime: [
-                        { required: true, type: 'date', message: '请设置结束时间', trigger: 'change' }
+                        { required: true, type: 'date', message: '请设置起止时间', trigger: 'change' }
                     ],
                     ],
                     startTime: [
                     startTime: [
-                        { required: true, type: 'date', message: '请设置开始时间', trigger: 'change' }
-                    ]
+                        { required: true, type: 'date', message: '请设置起止时间', trigger: 'change' }
+                    ],
+                    // rangeTime: [
+                    //     { required: true,  message: '请设置起止时间', trigger: 'change' }
+                    // ]
                     
                     
                 }
                 }
             }
             }
@@ -174,6 +186,18 @@
 			this.getClassrooms(this.userInfo.TEAMModelId).then(res => this.classRooms = res)
 			this.getClassrooms(this.userInfo.TEAMModelId).then(res => this.classRooms = res)
 		},
 		},
         methods: {
         methods: {
+			
+			onChangeRange(arr){
+				this.hwForm.startTime = this.getTimestampByString(arr[0])
+				this.hwForm.endTime = this.getTimestampByString(arr[1])
+			},
+			
+			getTimestampByString(str){
+				str = str.substring(0,19);
+				str = str.replace(/-/g,'/'); //必须把日期'-'转为'/'
+				var timestamp = new Date(str).getTime();
+				return timestamp
+			},
             /**
             /**
              * 提交新增投票表单
              * 提交新增投票表单
              * @param name FormName
              * @param name FormName
@@ -182,6 +206,7 @@
 				this.isBtnLoading = true
 				this.isBtnLoading = true
                 this.$refs[name].validate(async (valid) => {
                 this.$refs[name].validate(async (valid) => {
                     if (valid && this.getSimpleText(this.hwForm.description) && this.voteOptionsContent.length) {
                     if (valid && this.getSimpleText(this.hwForm.description) && this.voteOptionsContent.length) {
+						console.log(this.hwForm)
                         let params = Object.assign({}, this.defaultParams)
                         let params = Object.assign({}, this.defaultParams)
                         let target = []
                         let target = []
 						let fileName = this.$tools.guid()
 						let fileName = this.$tools.guid()
@@ -189,15 +214,14 @@
                         params.code = this.getCurCode,
                         params.code = this.getCurCode,
                         params.scope = this.getCurScope,
                         params.scope = this.getCurScope,
                         params.name = this.hwForm.name
                         params.name = this.hwForm.name
-                        params.startTime = Math.round(this.hwForm.startTime.getTime())
-                        params.endTime = Math.round(this.hwForm.endTime.getTime())
+                        params.startTime = this.hwForm.startTime
+                        params.endTime = this.hwForm.endTime
                         params.description = this.hwForm.description
                         params.description = this.hwForm.description
                         params.selectMax = this.hwForm.selectMax
                         params.selectMax = this.hwForm.selectMax
                         params.secret = this.hwForm.secret.indexOf('secret') > -1
                         params.secret = this.hwForm.secret.indexOf('secret') > -1
                         params.options = this.voteOptionsContent
                         params.options = this.voteOptionsContent
                         if (this.isEdit && this.editInfo.id && this.editInfo.code) {
                         if (this.isEdit && this.editInfo.id && this.editInfo.code) {
                             params.id = this.editInfo.id
                             params.id = this.editInfo.id
-							params.code = this.hwForm.code
                         }                                   
                         }                                   
                         params.targetClassIds = this.hwForm.targetClassIds
                         params.targetClassIds = this.hwForm.targetClassIds
 						console.log(params)
 						console.log(params)
@@ -223,7 +247,9 @@
             },
             },
 
 
             initEditors() {
             initEditors() {
-
+				console.log('进入编辑起初始化')
+				console.log(this.voteOptions)
+				console.log(this.voteOptionsContent)
                 this.$nextTick(() => {
                 this.$nextTick(() => {
                     // Editor默认配置
                     // Editor默认配置
                     if (this.voteOptions.length > 0) {
                     if (this.voteOptions.length > 0) {
@@ -403,19 +429,20 @@
              */
              */
             doRender(item) {
             doRender(item) {
 				console.log(item)
 				console.log(item)
+				this.voteOptionsContent = []
+				this.voteOptions = []
+				this.initEditors()
                 this.hwForm = {
                 this.hwForm = {
                     name: item.name,
                     name: item.name,
 					code:item.code,
 					code:item.code,
                     targetClassIds: item.targetClassIds || [],
                     targetClassIds: item.targetClassIds || [],
-                    startTime: item.publishModel === '0' ? '' : new Date(item.startTime),
-                    endTime: item.endTime ? new Date(item.endTime) : '',
+                    startTime: item.startTime,
+                    endTime: item.endTime,
                     description: item.description,
                     description: item.description,
                     secret: item.secret ? ['secret'] : [],
                     secret: item.secret ? ['secret'] : [],
                     selectMax: item.selectMax,
                     selectMax: item.selectMax,
                     isReset:[]
                     isReset:[]
                 }
                 }
-				console.log(this.hwForm.targetClassIds)
-                this.currentState = item.state
                 this.descriptionEditor.txt.html(item.description)
                 this.descriptionEditor.txt.html(item.description)
                 this.voteOptionsContent = item.options
                 this.voteOptionsContent = item.options
                 this.voteOptions = item.options.map((item, index) => index)
                 this.voteOptions = item.options.map((item, index) => index)
@@ -473,9 +500,10 @@
                     /** 编辑回显 */
                     /** 编辑回显 */
                     if (newValue) {
                     if (newValue) {
                         console.log(newValue)
                         console.log(newValue)
-                        this.doRender(JSON.parse(JSON.stringify(newValue)))
-                        this.isEdit = true
-                        this.editInfo = JSON.parse(JSON.stringify(newValue))
+						this.doRender(JSON.parse(JSON.stringify(newValue)))
+						this.isEdit = true
+						this.editInfo = JSON.parse(JSON.stringify(newValue))
+                        
                     } else {
                     } else {
                         /** 新增 */
                         /** 新增 */
 						console.log(newValue)
 						console.log(newValue)
@@ -484,7 +512,7 @@
                         this.editInfo = null
                         this.editInfo = null
                     }
                     }
                 },
                 },
-                deep: true,
+                // deep: true,
 				// immediate:true
 				// immediate:true
             }
             }
         }
         }

+ 21 - 6
TEAMModelOS/ClientApp/src/components/learnactivity/ChooseContent.vue

@@ -15,7 +15,7 @@
                         <div class="content-filter-item">
                         <div class="content-filter-item">
                             <span class="content-filter-label">学段:</span>
                             <span class="content-filter-label">学段:</span>
                             <RadioGroup v-model="syllabusFilter.periodCode" style="display:inline-block;" @on-change="getSubjectList">
                             <RadioGroup v-model="syllabusFilter.periodCode" style="display:inline-block;" @on-change="getSubjectList">
-                                <Radio class="radio-width" :key="index" v-for="(item,index) in $store.state.schoolBaseInfo.schoolBaseInfo.period" :label="item.id">{{item.name}}</Radio>
+                                <Radio class="radio-width" :key="index" v-for="(item,index) in $store.state.user.schoolProfile.school_base.period" :label="item.id">{{item.name}}</Radio>
                             </RadioGroup>
                             </RadioGroup>
                         </div>
                         </div>
                         <div class="content-filter-item">
                         <div class="content-filter-item">
@@ -122,7 +122,7 @@
                                 <span class="manual-filter-label">学段:</span>
                                 <span class="manual-filter-label">学段:</span>
                                 <RadioGroup v-model="questionFilter.periodCode" style="display: inline-block;" @on-change="getQSubjectList()">
                                 <RadioGroup v-model="questionFilter.periodCode" style="display: inline-block;" @on-change="getQSubjectList()">
                                     <!--<Checkbox label="all">全部</Checkbox>-->
                                     <!--<Checkbox label="all">全部</Checkbox>-->
-                                    <Radio :key="index" v-for="(item,index) in $store.state.schoolBaseInfo.schoolBaseInfo.period" :label="item.id">{{item.name}}</Radio>
+                                    <Radio :key="index" v-for="(item,index) in $store.state.user.schoolProfile.school_base.period" :label="item.id">{{item.name}}</Radio>
                                 </RadioGroup>
                                 </RadioGroup>
                             </div>
                             </div>
                             </Col>
                             </Col>
@@ -646,7 +646,22 @@
                 this.getSyllabus()
                 this.getSyllabus()
             },
             },
             getSchoolBaseInfo() {
             getSchoolBaseInfo() {
-                this.$store.dispatch('schoolBaseInfo/getSchoolBaseData').then(
+                //直接读取登录成功拿到得学校基础信息
+                let schoolBase = JSON.parse(JSON.stringify(this.$store.state.user.schoolProfile.school_base))
+                if (schoolBase) {
+                    if (schoolBase.period.length > 0) {
+                        this.syllabusFilter.periodCode = schoolBase.period[0].id
+                        this.subjectList = schoolBase.period[0].subjects
+                        if (this.subjectList.length > 0) {
+                            this.syllabusFilter.subjectCode = this.subjectList[0].subjectCode
+                        }
+                    }
+                } else {
+                    this.$Message.warning('尚未加入学校,没有学校相关信息')
+                }
+                this.getVolumes()
+
+                /*this.$store.dispatch('schoolBaseInfo/getSchoolBaseData').then(
                     (res) => {
                     (res) => {
                         if (res.code == 2) {
                         if (res.code == 2) {
                             alert('数据为空!')
                             alert('数据为空!')
@@ -664,7 +679,7 @@
                     (err) => {
                     (err) => {
                         this.$Message.error('API error!')
                         this.$Message.error('API error!')
                     }
                     }
-                )
+                )*/
             },
             },
             getVolumes() {
             getVolumes() {
                 this.currentVolumeIndex = 0
                 this.currentVolumeIndex = 0
@@ -690,7 +705,7 @@
             },
             },
             //课纲学科筛选条件
             //课纲学科筛选条件
             getSubjectList() {
             getSubjectList() {
-                let result = JSONPath.query(this.$store.state.schoolBaseInfo.schoolBaseInfo.period, "$..[?(@.id=='" + this.syllabusFilter.periodCode + "')]")
+                let result = JSONPath.query(this.$store.state.user.schoolProfile.school_base.period, "$..[?(@.id=='" + this.syllabusFilter.periodCode + "')]")
                 if (result.length > 0) {
                 if (result.length > 0) {
                     this.subjectList = result[0].subjects
                     this.subjectList = result[0].subjects
                     if (this.subjectList.length > 0) {
                     if (this.subjectList.length > 0) {
@@ -705,7 +720,7 @@
             },
             },
             //题库学科筛选条件
             //题库学科筛选条件
             getQSubjectList() {
             getQSubjectList() {
-                let result = JSONPath.query(this.$store.state.schoolBaseInfo.schoolBaseInfo.period, "$..[?(@.id=='" + this.questionFilter.periodCode + "')]")
+                let result = JSONPath.query(this.$store.state.user.schoolProfile.school_base.period, "$..[?(@.id=='" + this.questionFilter.periodCode + "')]")
                 if (result.length > 0) {
                 if (result.length > 0) {
                     this.subjectList = result[0].subjects
                     this.subjectList = result[0].subjects
                     if (this.subjectList.length > 0) {
                     if (this.subjectList.length > 0) {

+ 35 - 65
TEAMModelOS/ClientApp/src/components/learnactivity/GradeList.vue

@@ -14,7 +14,7 @@
             </div>
             </div>
         </div>
         </div>
         <div class="content" >
         <div class="content" >
-            <!--<Loading :top="200"  type="1" style="text-align:center"></Loading>-->
+            <Loading :top="200"  type="1" style="text-align:center" v-show="dataLoading"></Loading>
             <div class="left-box">
             <div class="left-box">
                 <div class="student-box">
                 <div class="student-box">
                     <div class="search-box dark-iview-select ">
                     <div class="search-box dark-iview-select ">
@@ -226,37 +226,40 @@
             },
             },
             //获取学生测验数据
             //获取学生测验数据
             getStudentData() {
             getStudentData() {
-
                 this.dataLoading = true
                 this.dataLoading = true
-                let requestData = {}
-                requestData.examCode = this.paperInfo.code
-                requestData.id = this.paperInfo.id
-                if (requestData.examCode !== undefined) {
-                    this.$api.learnActivity.FindSummaryRecord(requestData).then(
+                let requestData = {
+                    id: this.paperInfo.id,
+                    code: this.paperInfo.papers.code,
+                    subjectId: this.paperInfo.papers.subjectId
+                }
+                console.log('学生作答数据')
+                if (requestData.code !== undefined) {
+                    this.$api.learnActivity.FindAllStudent(requestData).then(
                         res => {
                         res => {
                             if (res.error == null) {
                             if (res.error == null) {
-                                let resData = []
-                                let data = []
-                                resData = res.result.data
-                                data = res.result.data.map((item) => {
-                                    return item.code
-                                })
-                                let students = {}
-                                students.studentId = data
-                                students.code = "HBCN"
-                                this.$api.learnActivity.FindStudent(students).then(
-                                    res => {
-                                        if (res.error == null) {
-                                            for (let i = 0; i < res.result.data.length; i++) {
-                                                resData[i].name = res.result.data[i].name
-                                            }
-                                            this.studentData = resData
-                                            this.getStudentInfo(-1)
-                                        }
-                                    }
-                                )
+                                console.log(res)
+                                //let resData = []
+                                //let data = []
+                                //resData = res.result.data
+                                //data = res.result.data.map((item) => {
+                                //    return item.code
+                                //})
+                                //let students = {}
+                                //students.studentId = data
+                                //students.code = "HBCN"
+                                //this.$api.learnActivity.FindStudent(students).then(
+                                //    res => {
+                                //        if (res.error == null) {
+                                //            for (let i = 0; i < res.result.data.length; i++) {
+                                //                resData[i].name = res.result.data[i].name
+                                //            }
+                                //            this.studentData = resData
+                                //            this.getStudentInfo(-1)
+                                //        }
+                                //    }
+                                //)
                                 this.dataLoading = false
                                 this.dataLoading = false
-                                this.getPaperInfo()
+                                //this.getPaperInfo()
                             } else {
                             } else {
                                 this.dataLoading = false
                                 this.dataLoading = false
                                 this.$Message.error('API ERROR!')
                                 this.$Message.error('API ERROR!')
@@ -296,17 +299,17 @@
                 }
                 }
             },
             },
             getClassData() {
             getClassData() {
-                console.log()
                 if (this.paperInfo.class.length !== 0) {
                 if (this.paperInfo.class.length !== 0) {
                     this.classList = []
                     this.classList = []
                     for (let item of this.paperInfo.class) {
                     for (let item of this.paperInfo.class) {
-                        for (let items of this.$store.state.schoolBaseInfo.classroomList) {
+                        for (let items of this.$store.state.user.schoolProfile.school_classes) {
                             if (item == items.id) {
                             if (item == items.id) {
                                 this.classList.push(items)
                                 this.classList.push(items)
                             }
                             }
                         }
                         }
                     }
                     }
                     this.getStudentDataInfo(this.classList[0].id)
                     this.getStudentDataInfo(this.classList[0].id)
+                    this.getStudentData()
                 } else {
                 } else {
                     this.$Message.warning('班级信息有误!')
                     this.$Message.warning('班级信息有误!')
                 }
                 }
@@ -324,12 +327,6 @@
                                 if (res.error == null) {
                                 if (res.error == null) {
                                     console.log(res)
                                     console.log(res)
                                     this.studentData = res.classrooms[0].students
                                     this.studentData = res.classrooms[0].students
-                                    //this.paperData = res.result.data[0]
-                                    //let data = res.result.data[0].item
-                                    //this.paperData.item = []
-                                    //for (let i = 0; i < data.length; i++) {
-                                    //    this.paperData.item.push(data[i])
-                                    //}
                                 } else {
                                 } else {
                                     this.$Message.error('API ERROR!')
                                     this.$Message.error('API ERROR!')
                                 }
                                 }
@@ -338,37 +335,10 @@
                     }
                     }
                 }
                 }
             },
             },
-            //获取学校基本信息
-            getSchoolBaseInfo() {
-                this.$store.dispatch('schoolBaseInfo/getSchoolBaseData').then(
-                    (res) => {
-                        console.log(this.$store.state)
-                        if (res.code == 2) {
-                            alert('数据为空!')
-                        }
-                    },
-                    (err) => {
-                        this.$Message.error('API error!')
-                    }
-                )
-                this.$store.dispatch('schoolBaseInfo/getClassroom').then(
-                    (res) => {
-                        if (res.code == 2) {
-                            alert('数据为空!')
-                        } else {
-                            this.getClassData()
-
-                        }
-                    },
-                    (err) => {
-                        this.$Message.error('API error!')
-                    }
-                )
-            },
     },
     },
         mounted() {
         mounted() {
-            this.getSchoolBaseInfo()
-            //this.getStudentData()
+            this.getClassData()
+            this.getStudentData()
             console.log('修改测试内容')
             console.log('修改测试内容')
             console.log(this.paperInfo)
             console.log(this.paperInfo)
         },
         },

+ 25 - 10
TEAMModelOS/ClientApp/src/components/learnactivity/NewChooseContent.vue

@@ -15,7 +15,7 @@
                         <div class="content-filter-item">
                         <div class="content-filter-item">
                             <span class="content-filter-label">学段:</span>
                             <span class="content-filter-label">学段:</span>
                             <RadioGroup v-model="syllabusFilter.periodId" style="display:inline-block;" @on-change="getSubjectList">
                             <RadioGroup v-model="syllabusFilter.periodId" style="display:inline-block;" @on-change="getSubjectList">
-                                <Radio class="radio-width" :key="index" v-for="(item,index) in $store.state.schoolBaseInfo.schoolBaseInfo.period" :label="item.id">{{item.name}}</Radio>
+                                <Radio class="radio-width" :key="index" v-for="(item,index) in $store.state.user.schoolProfile.school_base.period" :label="item.id">{{item.name}}</Radio>
                             </RadioGroup>
                             </RadioGroup>
                         </div>
                         </div>
                         <div class="content-filter-item">
                         <div class="content-filter-item">
@@ -126,7 +126,7 @@
                                 <span class="manual-filter-label">学段:</span>
                                 <span class="manual-filter-label">学段:</span>
                                 <RadioGroup v-model="questionFilter.periodId" style="display: inline-block;" @on-change="getQSubjectList()">
                                 <RadioGroup v-model="questionFilter.periodId" style="display: inline-block;" @on-change="getQSubjectList()">
                                     <!--<Checkbox label="all">全部</Checkbox>-->
                                     <!--<Checkbox label="all">全部</Checkbox>-->
-                                    <Radio :key="index" v-for="(item,index) in $store.state.schoolBaseInfo.schoolBaseInfo.period" :label="item.id">{{item.name}}</Radio>
+                                    <Radio :key="index" v-for="(item,index) in $store.state.user.schoolProfile.school_base.period" :label="item.id">{{item.name}}</Radio>
                                 </RadioGroup>
                                 </RadioGroup>
                             </div>
                             </div>
                             </Col>
                             </Col>
@@ -142,7 +142,7 @@
                             <div class="manual-filter-item">
                             <div class="manual-filter-item">
                                 <span class="manual-filter-label">年级:</span>
                                 <span class="manual-filter-label">年级:</span>
                                 <CheckboxGroup v-model="questionFilter.gradeIds" style="display:inline-block;" @on-change="refreshQuestionList()">
                                 <CheckboxGroup v-model="questionFilter.gradeIds" style="display:inline-block;" @on-change="refreshQuestionList()">
-                                    <Checkbox class="radio-width" v-for="(item,index) in  $jsFn.getPeriod($store.state.schoolBaseInfo.schoolBaseInfo.period, questionFilter.periodId).grades" :label="item.id" :key="index">{{item.name}}</Checkbox>
+                                    <Checkbox class="radio-width" v-for="(item,index) in  $jsFn.getPeriod($store.state.user.schoolProfile.school_base.period, questionFilter.periodId).grades" :label="item.id" :key="index">{{item.name}}</Checkbox>
                                 </CheckboxGroup>
                                 </CheckboxGroup>
                             </div>
                             </div>
                             </Col>
                             </Col>
@@ -336,9 +336,9 @@
             //初始化数据
             //初始化数据
             initData() {
             initData() {
                 this.questionFilter.code = this.$store.state.userInfo.TEAMModelId
                 this.questionFilter.code = this.$store.state.userInfo.TEAMModelId
-                this.questionFilter.periodId = this.$store.state.schoolBaseInfo.schoolBaseInfo.period[0].id
-                this.questionFilter.subjectId = this.$store.state.schoolBaseInfo.schoolBaseInfo.period[0].subjects[0].id
-                this.questionFilter.gradeIds = [this.$store.state.schoolBaseInfo.schoolBaseInfo.period[0].grades[0].id]
+                this.questionFilter.periodId = this.$store.state.user.schoolProfile.school_base.period[0].id
+                this.questionFilter.subjectId = this.$store.state.user.schoolProfile.school_base.period[0].subjects[0].id
+                this.questionFilter.gradeIds = [this.$store.state.user.schoolProfile.school_base.period[0].grades[0].id]
             },
             },
             /**
             /**
              * 选择全部逻辑
              * 选择全部逻辑
@@ -397,7 +397,7 @@
             },
             },
             //题库学科筛选条件
             //题库学科筛选条件
             getQSubjectList() {
             getQSubjectList() {
-                let result = JSONPath.query(this.$store.state.schoolBaseInfo.schoolBaseInfo.period, "$..[?(@.id=='" + this.questionFilter.periodId + "')]")
+                let result = JSONPath.query(this.$store.state.user.schoolProfile.school_base.period, "$..[?(@.id=='" + this.questionFilter.periodId + "')]")
                 if (result.length > 0) {
                 if (result.length > 0) {
                     this.subjectList = result[0].subjects
                     this.subjectList = result[0].subjects
                     if (this.subjectList.length > 0) {
                     if (this.subjectList.length > 0) {
@@ -648,7 +648,22 @@
             },
             },
             //获取区班校基础数据
             //获取区班校基础数据
             getSchoolBaseInfo() {
             getSchoolBaseInfo() {
-                this.$store.dispatch('schoolBaseInfo/getSchoolBaseData').then(
+                //直接读取登录成功拿到得学校基础信息
+                let schoolBase = JSON.parse(JSON.stringify(this.$store.state.user.schoolProfile.school_base))
+                if (schoolBase) {
+                    if (schoolBase.period.length > 0) {
+                        this.syllabusFilter.periodCode = schoolBase.period[0].id
+                        this.subjectList = schoolBase.period[0].subjects
+                        if (this.subjectList.length > 0) {
+                            this.syllabusFilter.subjectCode = this.subjectList[0].subjectCode
+                        }
+                    }
+                } else {
+                    this.$Message.warning('尚未加入学校,没有学校相关信息')
+                }
+                this.getVolumes()
+
+                /*this.$store.dispatch('schoolBaseInfo/getSchoolBaseData').then(
                     (res) => {
                     (res) => {
                         if (res.code == 2) {
                         if (res.code == 2) {
                             this.$Message.warning('暂无区班校数据!')
                             this.$Message.warning('暂无区班校数据!')
@@ -666,7 +681,7 @@
                     (err) => {
                     (err) => {
                         this.$Message.error('API error!')
                         this.$Message.error('API error!')
                     }
                     }
-                )
+                )*/
             },
             },
             //获取册别
             //获取册别
             getVolumes() {
             getVolumes() {
@@ -709,7 +724,7 @@
             },
             },
             //课纲学科筛选条件
             //课纲学科筛选条件
             getSubjectList() {
             getSubjectList() {
-                let result = JSONPath.query(this.$store.state.schoolBaseInfo.schoolBaseInfo.period, "$..[?(@.id=='" + this.syllabusFilter.periodId + "')]")
+                let result = JSONPath.query(this.$store.state.user.schoolProfile.school_base.period, "$..[?(@.id=='" + this.syllabusFilter.periodId + "')]")
                 if (result.length > 0) {
                 if (result.length > 0) {
                     this.subjectList = result[0].subjects
                     this.subjectList = result[0].subjects
                     if (this.subjectList.length > 0) {
                     if (this.subjectList.length > 0) {

+ 27 - 12
TEAMModelOS/ClientApp/src/components/questionnaire/BaseAddItem.vue

@@ -10,18 +10,21 @@
 				<span @click="addOption" class="btn-add-option" v-show="curType !== 'judge'">添加选项</span>
 				<span @click="addOption" class="btn-add-option" v-show="curType !== 'judge'">添加选项</span>
 			</p>
 			</p>
 			<div class="option-editors" id="optionEditors">
 			<div class="option-editors" id="optionEditors">
-				<div v-for="(item,index) in options" :key="index">
-					<div class="option-editor-wrap" v-show="(curType !== 'judge') || (curType === 'judge' && item < 2)">
-						<!-- 选项序号 -->
-						<div class="option-order">
-							<span>{{ index + 1 }}</span>
-							<span class="btn-delete" @click="deleteOption(index)" v-show="curType !== 'judge'">
-								<Icon type="md-trash" size="24" color="#fff" /></span>
+				<div v-if="options.length">
+					<div v-for="(item,index) in options" :key="index">
+						<div class="option-editor-wrap" v-show="(curType !== 'judge') || (curType === 'judge' && item < 2)">
+							<!-- 选项序号 -->
+							<div class="option-order">
+								<span>{{ index + 1 }}</span>
+								<span class="btn-delete" @click="deleteOption(index)" v-show="curType !== 'judge'">
+									<Icon type="md-trash" size="24" color="#fff" /></span>
+							</div>
+							<!-- 选项编辑器 -->
+							<div :ref="'singleOption' + item " style="text-align:left" class="option-editor" @click="optionClick(item)"></div>
 						</div>
 						</div>
-						<!-- 选项编辑器 -->
-						<div :ref="'singleOption' + item " style="text-align:left" class="option-editor" @click="optionClick(item)"></div>
 					</div>
 					</div>
 				</div>
 				</div>
+				
 			</div>
 			</div>
 		</div>
 		</div>
 
 
@@ -33,7 +36,7 @@
 		props: ['type','editItem'],
 		props: ['type','editItem'],
 		data() {
 		data() {
 			return {
 			return {
-				options: [0,1,2,3],
+				options: [],
 				trueIndex: 0,
 				trueIndex: 0,
 				curType: '',
 				curType: '',
 				editInfo: {},
 				editInfo: {},
@@ -55,7 +58,11 @@
 		},
 		},
 		methods: {
 		methods: {
 			initEditors() {
 			initEditors() {
-				this.optionEditors = []
+				console.log(this.optionEditors.length)
+				// this.optionEditors = []
+				console.log('进了initEditors')
+				console.log(this.options)
+				console.log(this.optionsContent)
 				// Editor默认配置
 				// Editor默认配置
 				if (this.options.length > 0) {
 				if (this.options.length > 0) {
 					this.$nextTick(() => {
 					this.$nextTick(() => {
@@ -157,6 +164,8 @@
 			// 置空内容
 			// 置空内容
 			resetContent(){
 			resetContent(){
 				this.options = [0,1,2,3]
 				this.options = [0,1,2,3]
+				this.optionsContent = []
+				this.stemContent = []
 				this.stemEditor.txt.clear()
 				this.stemEditor.txt.clear()
 				this.optionEditors.forEach(i => {
 				this.optionEditors.forEach(i => {
 					i.txt.clear()
 					i.txt.clear()
@@ -184,14 +193,20 @@
 			}
 			}
 			stemEditor.create()
 			stemEditor.create()
 			this.stemEditor = stemEditor
 			this.stemEditor = stemEditor
-			this.initEditors()
+			this.$nextTick(() => {
+			    this.initEditors()
+			})
 		},
 		},
 		watch: {
 		watch: {
 			type: {
 			type: {
 				handler(newValue) {
 				handler(newValue) {
 					if (!newValue) return
 					if (!newValue) return
 					this.curType = newValue
 					this.curType = newValue
+					this.options = newValue === 'judge' ? [0,1] : [0,1,2,3]
 					this.optionsContent = []
 					this.optionsContent = []
+					this.$nextTick(() => {
+					    this.initEditors()
+					})
 				}
 				}
 			},
 			},
 			editItem: {
 			editItem: {

+ 213 - 0
TEAMModelOS/ClientApp/src/components/questionnaire/BaseAddSingle.vue

@@ -0,0 +1,213 @@
+<template>
+	<div>
+		<div class="exersices-box">
+			<p class="title">题干</p>
+			<!-- 题干富文本 -->
+			<div ref="singleEditor" style="text-align:left"></div>
+			<!-- 选项富文本 -->
+			<p class="title">
+				<span>选项</span>
+				<span @click="addOption" class="btn-add-option" v-show="curType !== 'judge'">添加选项</span>
+			</p>
+			<div class="option-editors" id="optionEditors">
+				<div v-for="(item,index) in options" :key="index" :class="'editor-wrap-'+item" style="margin-top:10px;display:flex">
+				    <span class="fl-center option-editor-wrap">{{String.fromCharCode(64 + parseInt(index+1))}}</span>
+				    <div :ref="'singleOption'+item" style="text-align:left" class="option-editor" @click="optionClick(item)"></div>
+				</div>
+			</div>
+			
+			
+		</div>
+
+	</div>
+</template>
+<script>
+	import E from '@/utils/wangEditor.js'
+	export default {
+		props: ['type','editItem'],
+		data() {
+			return {
+				options: [0,1,2,3],
+				trueIndex: 0,
+				curType: '',
+				editInfo: {},
+				stemEditor: null,
+				stemContent: '',
+				optionsContent: [],
+				optionEditors:[],
+				existEditors:[],
+				defaultConfig: {
+					uploadImgServer: '/api/file/uploadWangEditor', // 图片上传地址
+					showLinkImg: false, // 是否展示网络图片链接上传
+					uploadFileName: 'files', // 上传图片后台获取的文件名
+					menus: this.$tools.wangEditorMenu
+				}
+			}
+		},
+		created() {
+			
+		},
+		methods: {
+			initEditors() {
+			    // Editor默认配置
+			    if (this.options.length > 0) {
+			        this.options.forEach((item, i) => {
+			            let that = this
+			            let editor = new E(that.$refs['singleOption' + i][0])
+			            editor.customConfig = this.defaultConfig
+						editor.customConfig.uploadVideoDisable = true,
+						// editor.customConfig.zIndex = 100
+			
+			            // 选项编辑器失焦隐藏工具栏
+			            editor.customConfig.onblur = function () {
+			                let allToolbars = document.getElementsByClassName('option-editor')
+			                for (let i = 0; i < allToolbars.length; i++) {
+			                    if (allToolbars[i].children.length) {
+			                        allToolbars[i].children[0].style.visibility = 'hidden'
+			                    }
+			                }
+			            }
+						
+						editor.customConfig.onVideoWarning = (text) => {
+							this.$Message.warning(text)
+						},
+			
+			            // 选项编辑器内容发生变化时
+			            editor.customConfig.onchange = (html) => {
+			                let key = String.fromCharCode(64 + parseInt(i + 1))
+			                let codeArr = this.optionsContent.map(item => item.code)
+			                // 如果已经编辑过则 修改选项内容
+			                if (codeArr.indexOf(key) !== -1) {
+			                    this.optionsContent[codeArr.indexOf(key)].value = html
+			                } else { // 否则创建新选项
+			                    let option = {
+			                        code: key,
+			                        value: html
+			                    }
+			                    this.optionsContent.push(option)
+			                }
+			            }
+			            editor.create()
+			
+			            // 如果是编辑状态 则将选项内容回显
+			            if (this.editItem && Object.keys(this.editItem).length > 0) {
+			            	editor.txt.html(this.editItem.option[i].value)
+			            }
+			        })
+			    }
+			},
+			// 添加选项
+			addOption() {
+				let that = this
+				let newIndex = parseInt(this.options[this.options.length - 1]) + 1
+				let optionsLength = this.options.length
+				if (optionsLength < 9) {
+					this.options.push(newIndex)
+					this.$nextTick(() => {
+						let editor = new E(that.$refs['singleOption' + newIndex][0])
+						editor.customConfig = this.defaultConfig
+
+						editor.customConfig.onchange = (html) => {
+							let key = String.fromCharCode(64 + parseInt(newIndex + 1))
+							let codeArr = this.optionsContent.map((item,index) => String.fromCharCode(64 + parseInt(index + 1)))
+							// 如果已经编辑过则 修改选项内容
+							if (codeArr.indexOf(key) !== -1) {
+								this.optionsContent[codeArr.indexOf(key)].value = html
+							} else { // 否则创建新选项
+								let option = {
+									code: key,
+									value: html
+								}
+								this.optionsContent.push(option)
+							}
+							console.log(this.optionsContent)
+						}
+						editor.create()
+					})
+				} else {
+					this.$Message.warning('最多只有9个选项!')
+				}
+			},
+			// 删除选项
+			deleteOption(index) {
+				console.log(index)
+				if (this.options.length > 2) {
+					this.options.splice(index, 1)
+					this.optionsContent.splice(index, 1)
+				} else {
+					this.$Message.warning('至少保留两个选项!')
+				}
+			},
+			// 模拟选项聚焦事件
+			optionClick(index) {
+				let allToolbars = document.getElementsByClassName('option-editor')
+				let that = this
+				for (let i = 0; i < allToolbars.length; i++) {
+					allToolbars[i].children[0].style.visibility = 'hidden'
+				}
+				setTimeout(function() {
+					let currentToolBar = that.$refs['singleOption' + index][0].children[0]
+					currentToolBar.style.visibility = 'visible'
+				}, 100)
+			},
+			// 置空内容
+			resetContent(){
+				this.options = [0,1,2,3]
+				this.stemEditor.txt.clear()
+				this.optionEditors.forEach(i => {
+					i.txt.clear()
+				})
+				
+			},
+			
+			// 渲染编辑试题的内容
+			doRender(item){
+				let newValue = JSON.parse(JSON.stringify(item))
+				this.stemEditor.txt.html(newValue.question)
+				this.stemContent = newValue.question
+				this.optionsContent = newValue.option
+				this.options = newValue.option.map((item, index) => index)
+				this.$nextTick(() => {
+				    this.initEditors()
+				})
+			}
+		},
+		mounted() {
+			let stemEditor = new E(this.$refs.singleEditor)
+			stemEditor.customConfig = this.defaultConfig
+			stemEditor.customConfig.onchange = (html) => {
+				this.stemContent = html
+			}
+			stemEditor.create()
+			this.stemEditor = stemEditor
+			// this.$nextTick(() => {
+			//     this.initEditors()
+			// })
+		},
+		watch: {
+			type: {
+				handler(newValue) {
+					if (!newValue) return
+					this.curType = newValue
+					this.options = [0,1,2,3]
+					this.optionsContent = []
+					this.$nextTick(() => {
+					    this.initEditors()
+					})
+				}
+			},
+			editItem: {
+				handler(newValue) {
+					if (!newValue) return
+					this.doRender(newValue)
+				},
+				
+			}
+
+		}
+	}
+</script>
+
+<style lang="less">
+	@import "./BaseAddItem.less";
+</style>

+ 25 - 6
TEAMModelOS/ClientApp/src/components/questionnaire/BaseQnForm.vue

@@ -21,7 +21,7 @@
 				 </DatePicker>
 				 </DatePicker>
 			</FormItem> -->
 			</FormItem> -->
 
 
-			<FormItem label="发布时间" prop="startTime">
+			<!-- 			<FormItem label="发布时间" prop="startTime">
 				<DatePicker :class="!qnFormEdit ? 'qn-form-disabled':''" type="datetime" :editable="isDateEdit" placeholder="请选择问卷发布时间"
 				<DatePicker :class="!qnFormEdit ? 'qn-form-disabled':''" type="datetime" :editable="isDateEdit" placeholder="请选择问卷发布时间"
 				 v-model="qnForm.startTime" :options="startTimeOptions"></DatePicker>
 				 v-model="qnForm.startTime" :options="startTimeOptions"></DatePicker>
 			</FormItem>
 			</FormItem>
@@ -29,8 +29,16 @@
 			<FormItem label="结束时间" prop="endTime">
 			<FormItem label="结束时间" prop="endTime">
 				<DatePicker :class="!qnFormEdit ? 'qn-form-disabled':''" type="datetime" :editable="isDateEdit" placeholder="请选择问卷结束时间"
 				<DatePicker :class="!qnFormEdit ? 'qn-form-disabled':''" type="datetime" :editable="isDateEdit" placeholder="请选择问卷结束时间"
 				 v-model="qnForm.endTime" :options="endTimeOptions"></DatePicker>
 				 v-model="qnForm.endTime" :options="endTimeOptions"></DatePicker>
+			</FormItem> -->
+
+			<FormItem label="起止时间" prop="startTime">
+				<DatePicker type="datetimerange" @on-change="onChangeRange" format="yyyy-MM-dd HH:mm" :class="!qnFormEdit ? 'qn-form-disabled':''"
+				  :editable="isDateEdit" placeholder="请选择问卷起止时间" :value="[qnForm.startTime,qnForm.endTime]">
+
+				</DatePicker>
 			</FormItem>
 			</FormItem>
 
 
+
 			<FormItem label="问卷描述" prop="description">
 			<FormItem label="问卷描述" prop="description">
 				<div ref="descriptionEditor" style="text-align:left" v-show="qnFormEdit"></div>
 				<div ref="descriptionEditor" style="text-align:left" v-show="qnFormEdit"></div>
 				<div v-html="qnForm.description" v-show="!qnFormEdit" style="margin:10px;font-size:16px;font-weight:bold;color:#fff"></div>
 				<div v-html="qnForm.description" v-show="!qnFormEdit" style="margin:10px;font-size:16px;font-weight:bold;color:#fff"></div>
@@ -155,6 +163,18 @@
 			}
 			}
 		},
 		},
 		methods: {
 		methods: {
+
+			onChangeRange(arr) {
+				this.qnForm.startTime = this.getTimestampByString(arr[0])
+				this.qnForm.endTime = this.getTimestampByString(arr[1])
+			},
+
+			getTimestampByString(str) {
+				str = str.substring(0, 19);
+				str = str.replace(/-/g, '/'); //必须把日期'-'转为'/'
+				var timestamp = new Date(str).getTime();
+				return timestamp
+			},
 			/**
 			/**
 			 * 提交新增问卷表单
 			 * 提交新增问卷表单
 			 * @param name FormName
 			 * @param name FormName
@@ -170,13 +190,12 @@
 							params.scope = this.getCurScope
 							params.scope = this.getCurScope
 							params.name = this.qnForm.name
 							params.name = this.qnForm.name
 							// params.publishModel = this.qnForm.publishModel
 							// params.publishModel = this.qnForm.publishModel
-							params.startTime = Math.round(this.qnForm.startTime.getTime())
-							params.endTime = Math.round(this.qnForm.endTime.getTime())
+							params.startTime = this.qnForm.startTime
+							params.endTime = this.qnForm.endTime
 							params.description = this.qnForm.description
 							params.description = this.qnForm.description
 							// params.other = this.qnForm.other
 							// params.other = this.qnForm.other
 							if (this.isEdit && this.editInfo.id && this.editInfo.code) {
 							if (this.isEdit && this.editInfo.id && this.editInfo.code) {
 								params.id = this.editInfo.id
 								params.id = this.editInfo.id
-								params.code = this.editInfo.code
 								params.createTime = this.editInfo.createTime
 								params.createTime = this.editInfo.createTime
 							}
 							}
 							params.targetClassIds = this.qnForm.targetClassIds
 							params.targetClassIds = this.qnForm.targetClassIds
@@ -257,8 +276,8 @@
 				this.qnForm = {
 				this.qnForm = {
 					name: item.name,
 					name: item.name,
 					targetClassIds: item.targetClassIds || [],
 					targetClassIds: item.targetClassIds || [],
-					startTime: item.endTime ? new Date(item.startTime) : '',
-					endTime: item.endTime ? new Date(item.endTime) : '',
+					startTime: item.endTime ? item.startTime : '',
+					endTime: item.endTime ? item.endTime : '',
 					description: item.description
 					description: item.description
 				}
 				}
 				this.currentState = item.state
 				this.currentState = item.state

+ 2 - 1
TEAMModelOS/ClientApp/src/components/questionnaire/BaseQuestionnaire.vue

@@ -145,6 +145,7 @@
 				let addItem = this.$refs.addItem
 				let addItem = this.$refs.addItem
 				console.log('新增Ref的内容')
 				console.log('新增Ref的内容')
 				console.log(addItem)
 				console.log(addItem)
+				console.log(addItem.optionsContent.map(i => i.value))
 				// 判断获取到的新题是否规范
 				// 判断获取到的新题是否规范
 				if ( this.getSimpleText(addItem.stemContent) && (addItem.options.length === this.curType === 'judge' ? 2 : addItem.optionsContent.length) && this.checkOptionNull(addItem.optionsContent)){
 				if ( this.getSimpleText(addItem.stemContent) && (addItem.options.length === this.curType === 'judge' ? 2 : addItem.optionsContent.length) && this.checkOptionNull(addItem.optionsContent)){
 					let newItem = {
 					let newItem = {
@@ -194,7 +195,7 @@
 			/* 编辑单个题目 */
 			/* 编辑单个题目 */
 			onItemEdit(item, index) {
 			onItemEdit(item, index) {
 				if(this.editIndex === index){
 				if(this.editIndex === index){
-					this.$refs.addItem.doRender(item)
+					// this.$refs.addItem.doRender(item)
 				}else{
 				}else{
 					this.curItem = item
 					this.curItem = item
 					this.editIndex = index
 					this.editIndex = index

+ 48 - 31
TEAMModelOS/ClientApp/src/components/student-web/EventBasicInfo.vue

@@ -3,71 +3,75 @@
     <i-col :xs="24" :sm="24" :md="24" :lg="getCurrentLang()=='tw'?12:24" class="title-part">
     <i-col :xs="24" :sm="24" :md="24" :lg="getCurrentLang()=='tw'?12:24" class="title-part">
       <h2 class="event-title">
       <h2 class="event-title">
         <span class="title-mark" v-if=" eventType=='自主學習' &&from!='hiteach'">
         <span class="title-mark" v-if=" eventType=='自主學習' &&from!='hiteach'">
-          {{ getCurrentLang()=='tw'?eventType:transTypetoEn(eventType) }}
+          {{ getCurrentLang()=='tw'?'评量':transTypetoEn(eventType) }}456
         </span>
         </span>
         <span class="title-mark" v-if=" eventType!='自主學習' &&from=='hiteach'">
         <span class="title-mark" v-if=" eventType!='自主學習' &&from=='hiteach'">
-          {{ 'T'+this.$store.getters.getItemTitle.eventID.substr(0, 5) }}
+          {{ 'T'+this.$store.getters.getItemTitle.eventID.substr(0, 5) }}456
         </span>
         </span>
         <span
         <span
           class="title-mark"
           class="title-mark"
           v-if="eventType!='自主學習' &&from!='hiteach'"
           v-if="eventType!='自主學習' &&from!='hiteach'"
-        >{{getCurrentLang()=='tw'?this.$store.getters.getItemTitle.eventType:transTypetoEn(this.$store.getters.getItemTitle.eventType)}}</span>
-        {{ this.$store.getters.getItemTitle.eventName }}
+        >评量</span>
+        {{ this.$store.getters.getItemTitle.name }}
       </h2>
       </h2>
     </i-col>
     </i-col>
     <i-col :xs="24" :sm="24" :md="24" :lg="getCurrentLang()=='tw'?12:24" class="info-part">
     <i-col :xs="24" :sm="24" :md="24" :lg="getCurrentLang()=='tw'?12:24" class="info-part">
       <ul class="base-info" :class="{'base-infoEn':getCurrentLang()=='en'}">
       <ul class="base-info" :class="{'base-infoEn':getCurrentLang()=='en'}">
         <li
         <li
-          v-if="
-            (from != '通知' &&
-              this.$store.getters.getItemTitle.eventType == '課前預習') ||
-              (from != '通知' &&
-                this.$store.getters.getItemTitle.eventType == '評量')
-          "
+          v-if="this.$store.getters.getItemTitle.eventType == 'exam' "
         >
         >
           <svg-icon icon-class="subject" class="base-info-icon" />{{ $t('studentWeb.baseInfo.subject')}}
           <svg-icon icon-class="subject" class="base-info-icon" />{{ $t('studentWeb.baseInfo.subject')}}
-          <span class="base-info-text" v-if="getCurrentLang()=='tw'">{{ this.$store.getters.getItemTitle.eventSubject }}</span>
+          <span class="base-info-text">综合科目</span>
            <span class="base-info-text" v-if="getCurrentLang()=='en'">{{ transSubjecttoEn(this.$store.getters.getItemTitle.eventSubject) }}</span>
            <span class="base-info-text" v-if="getCurrentLang()=='en'">{{ transSubjecttoEn(this.$store.getters.getItemTitle.eventSubject) }}</span>
         </li>
         </li>
 
 
-        <li>
+        <!--<li>
           <svg-icon icon-class="teacher" class="base-info-icon" />{{ $t('studentWeb.baseInfo.teacher')}}
           <svg-icon icon-class="teacher" class="base-info-icon" />{{ $t('studentWeb.baseInfo.teacher')}}
           <span class="base-info-text">{{ this.$store.getters.getItemTitle.teacher }}</span>
           <span class="base-info-text">{{ this.$store.getters.getItemTitle.teacher }}</span>
-        </li>
+        </li>-->
 
 
         <li>
         <li>
           <svg-icon icon-class="time" class="base-info-icon" />
           <svg-icon icon-class="time" class="base-info-icon" />
 
 
-          <span v-if="from == '通知' || from == 'hiteach'">
+          <!--<span v-if="from == '通知' || from == 'hiteach'">
             {{$t('studentWeb.baseInfo.postTime')}}
             {{$t('studentWeb.baseInfo.postTime')}}
-          </span>
-          <span v-else>{{ !eventType ?  $t('studentWeb.baseInfo.period') :  $t('studentWeb.baseInfo.postTime') }}</span>
+          </span>-->
+          <span>{{ !eventType ?  $t('studentWeb.baseInfo.period') :  $t('studentWeb.baseInfo.postTime') }}</span>
+
+
+
+
+
+
+
           <span class="base-info-text" v-if="from != '通知'&&from != 'hiteach'">
           <span class="base-info-text" v-if="from != '通知'&&from != 'hiteach'">
-            <span v-if="this.$store.getters.getItemTitle.endTime>'2020.02.10'&& !eventType">
-              {{ !eventType ? this.$store.getters.getItemTitle.startTime + "~" : ""}}
-            </span>
-            {{ this.$store.getters.getItemTitle.endTime }}
-            <span
-              v-if="this.$store.getters.getItemTitle.endTime<='2020.02.10'&& !eventType"
-            >{{$t('studentWeb.baseInfo.Closed')}}</span>
+              <span v-if="this.$store.getters.getItemTitle.eventType = 'exam'">
+                  {{ !eventType ? dateFormat(this.$store.getters.getItemTitle.startTime) + "~" : ""}}
+              </span>
+              {{ dateFormat(this.$store.getters.getItemTitle.endTime) }}
+              <!--<span v-if="dateFormat(this.$store.getters.getItemTitle.endTime)>='2020.12.10'&& !eventType">{{$t('studentWeb.baseInfo.Closed')}}</span>-->
           </span>
           </span>
+
+
+
+
           <span
           <span
             class="base-info-text"
             class="base-info-text"
             v-if="from == '通知'||from == 'hiteach'"
             v-if="from == '通知'||from == 'hiteach'"
-          >{{ this.$store.getters.getItemTitle.endTime + " 14:20" }}</span>
+          >{{ this.$store.getters.getItemTitle.endTime + " 14:20" }}54345</span>
         </li>
         </li>
-        <li v-if=" from == 'hiteach'">
+        <!--<li v-if=" from == 'hiteach'">
            <svg-icon icon-class="time" class="base-info-icon" />{{$t('studentWeb.baseInfo.classTime')}}:
            <svg-icon icon-class="time" class="base-info-icon" />{{$t('studentWeb.baseInfo.classTime')}}:
           <span class="base-info-text">{{ this.$store.getters.getItemTitle.endTime }}</span>
           <span class="base-info-text">{{ this.$store.getters.getItemTitle.endTime }}</span>
-        </li>
-        <li v-if="finishedCondition && !eventType && from != '通知'&&from!='hiteach'">
+        </li>-->
+        <!--<li v-if="finishedCondition && !eventType && from != '通知'&&from!='hiteach'">
            <svg-icon icon-class="done" class="base-info-icon" />
            <svg-icon icon-class="done" class="base-info-icon" />
           <span class="base-info-text">{{ $t('studentWeb.baseInfo.Fineshed')}}</span>
           <span class="base-info-text">{{ $t('studentWeb.baseInfo.Fineshed')}}</span>
         </li>
         </li>
         <li v-if="unfinishedCondition && !eventType && from != '通知'&&from!='hiteach'">
         <li v-if="unfinishedCondition && !eventType && from != '通知'&&from!='hiteach'">
            <svg-icon icon-class="undone" class="base-info-icon" />
            <svg-icon icon-class="undone" class="base-info-icon" />
           <span class="base-info-text">{{ $t('studentWeb.baseInfo.unFinished')}}</span>
           <span class="base-info-text">{{ $t('studentWeb.baseInfo.unFinished')}}</span>
-        </li>
+        </li>-->
       </ul>
       </ul>
     </i-col>
     </i-col>
   </Row>
   </Row>
@@ -76,7 +80,10 @@
 <script>
 <script>
 export default {
 export default {
   name: "EventBasicInfo",
   name: "EventBasicInfo",
-  props: ["eventType", "from"],
+        props: [
+            "eventType", "from",
+            "paper"
+        ],
 
 
   computed: {
   computed: {
     finishedCondition: function () {
     finishedCondition: function () {
@@ -95,8 +102,18 @@ export default {
         ) == false
         ) == false
       );
       );
     },
     },
-  },
-  methods: {
+        },
+        mounted() {
+            console.log(this.paper)
+        },
+        methods: {
+            dateFormat(timestamp) {
+                var date = new Date(timestamp)
+                var Y = date.getFullYear() + '-'
+                var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'
+                var D = date.getDate() + ' '
+                return Y + M + D;
+            },
     getCurrentLang() {
     getCurrentLang() {
       return localStorage.getItem('lang');
       return localStorage.getItem('lang');
     },
     },

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

@@ -1,23 +1,23 @@
 <template>
 <template>
   <div class="event-content">
   <div class="event-content">
-    <VoteHint v-if="this.$store.getters.getisVoteResulthover==true"/>
+    <!--<VoteHint v-if="this.$store.getters.getisVoteResulthover==true"/>-->
     <div v-if="this.$store.getters.getIsSelectedNow">
     <div v-if="this.$store.getters.getIsSelectedNow">
       
       
-      <div v-if="this.$store.getters.getItemTitle.eventType=='課前預習'">
+      <!--<div v-if="this.$store.getters.getItemTitle.eventType=='課前預習'">
         <PreviewMission/>
         <PreviewMission/>
       </div>
       </div>
       <div v-if="this.$store.getters.getItemTitle.eventType=='作業'">
       <div v-if="this.$store.getters.getItemTitle.eventType=='作業'">
         <Homework/>
         <Homework/>
-      </div>
-      <div v-if="this.$store.getters.getItemTitle.eventType=='評量'">
+      </div>-->
+      <div v-if="this.$store.getters.getItemTitle.eventType=='exam'">
         <LessonTest/>
         <LessonTest/>
       </div>
       </div>
-      <div v-if="this.$store.getters.getItemTitle.eventType=='投票'">
+      <!--<div v-if="this.$store.getters.getItemTitle.eventType=='投票'">
         <Vote/>
         <Vote/>
       </div>
       </div>
       <div v-if="this.$store.getters.getItemTitle.eventType=='問卷'">
       <div v-if="this.$store.getters.getItemTitle.eventType=='問卷'">
         <QuesNaire/>
         <QuesNaire/>
-      </div>
+      </div>-->
     </div>
     </div>
         <!-- 如果篩選時未選的時候預設顯示列表第一個-->
         <!-- 如果篩選時未選的時候預設顯示列表第一個-->
     <div class="noSelected" v-if="!this.$store.getters.getIsSelectedNow">
     <div class="noSelected" v-if="!this.$store.getters.getIsSelectedNow">
@@ -58,7 +58,8 @@ export default {
 
 
     }
     }
   },
   },
-  mounted() {
+        mounted() {
+            console.log(this.$store.getters.getItemTitle.eventType)
     //this.theFirstActiveEvent(); // <!-- 如果沒選的時候預設顯示列表第一個-->
     //this.theFirstActiveEvent(); // <!-- 如果沒選的時候預設顯示列表第一個-->
   },
   },
   data() {
   data() {

+ 372 - 364
TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContentTypeTemplate/LessonTest.vue

@@ -1,401 +1,409 @@
 <template>
 <template>
-  <div class="lesson-test">
-    <br />
-   
-      <div v-if="showHint == true" class="warmMessage">
-        <div class="messageCard previewNextItemCard animate__animated animate__fadeInDown">
-          <h2>前往下一個活動</h2>
-          <div class="list-item-icon">
-            <svg-icon v-if="nextItem.eventType == '作業'" icon-class="doc" />
-            <svg-icon
-              v-if="nextItem.eventType == '課前預習'"
-              icon-class="selflearninginTime"
-            />
-            <svg-icon
-              v-if="
+    <div class="lesson-test">
+        <br />
+
+        <div v-if="showHint == true" class="warmMessage">
+            <div class="messageCard previewNextItemCard animate__animated animate__fadeInDown">
+                <h2>前往下一個活動</h2>
+                <div class="list-item-icon">
+                    <svg-icon v-if="nextItem.eventType == '作業'" icon-class="doc" />
+                    <svg-icon v-if="nextItem.eventType == '課前預習'"
+                              icon-class="selflearninginTime" />
+                    <svg-icon v-if="
                 nextItem.eventType == '評量' &&
                 nextItem.eventType == '評量' &&
                 nextItem.eventSubject != '綜合學科'
                 nextItem.eventSubject != '綜合學科'
               "
               "
-              icon-class="test"
-              class="reset-testIcon"
-            />
-            <svg-icon
-              v-if="
+                              icon-class="test"
+                              class="reset-testIcon" />
+                    <svg-icon v-if="
                 nextItem.eventType == '評量' &&
                 nextItem.eventType == '評量' &&
                 nextItem.eventSubject == '綜合學科'
                 nextItem.eventSubject == '綜合學科'
               "
               "
-              icon-class="multiTest"
-              class="reset-testIcon"
-            />
-            <svg-icon v-if="nextItem.eventType == '投票'" icon-class="vote" />
-          </div>
-          <p class="nextItemTitle">
-            <span class="typeMark">{{ nextItem.eventType }}</span>
-            {{ nextItem.eventName }}
-          </p>
-           <div class="setting-checkbox">
-            <input type="checkbox" v-model="unhintNextItem" />
-            <label> 下次不再詢問,如欲恢復提示,於個人設定頁面勾選</label>
-          </div>
-          <br />
-          <button @click="cancelPreview()">取消,自行查看</button>
-          <button @click="gotoNextItem()">確定</button>
-        </div>
-      </div>
-   
-    <LessonTestPop
-      v-if="this.$store.getters.getisOpenLessonTestPopNow"
-      @isHintNextItem="getisHint"
-    />
-    <div>
-      <EventBasicInfo />
-      <div
-        v-if="
-          this.$store.getters.getItemTitle.isDone == false &&
-          this.$store.getters.getItemTitle.endTime <= '2020.02.10' &&
-          this.$store.getters.getItemTitle.allowRetryNow == false
-        "
-      >
-        <br v-if="!ishideHint" />
-        <div class="dec animate__animated animate__bounceInLeft" v-if="!ishideHint">
-          <svg-icon icon-class="handonHint" class="warm-icon" />
-          <span class="warm-hint">{{ $t("studentWeb.exam.timeoutHint") }}</span>
-        </div>
-      </div>
-      <div
-        v-if="
-          this.$store.getters.getItemTitle.isDone == false &&
-          this.$store.getters.getItemTitle.endTime <= '2020.02.10' &&
-          this.$store.getters.getItemTitle.allowRetryNow == true
-        "
-      >
-        <br v-if="!ishideHint" />
-        <div class="dec animate__animated animate__bounceInLeft" v-if="!ishideHint">
-          <svg-icon icon-class="handonHint" class="warm-icon" />
-          <span
-            class="warm-hint"
-            v-if="this.$store.getters.getCurrentLaguage == 'tw'"
-          >
-            評量活動時間已結束,請於
-            <span class="retry-date">2020.02.13 23:59 前</span
-            >完成補考,逾時將以0分計算。
-          </span>
-          <span
-            class="warm-hint"
-            v-if="this.$store.getters.getCurrentLaguage == 'en'"
-          >
-            The exam task time has ended, please make up the exam
-            <span class="retry-date">before 2020.02.13 23:59</span> or your
-            score would be 0.
-          </span>
-          <span @click="hidehint()" class="close-hint-btn">
-            <Icon type="md-close" class="close-icon" />
-          </span>
-        </div>
-      </div>
-      <div
-        class="title-rect-group"
-        v-if="
-          (this.$store.getters.getItemTitle.isDone == false &&
-            this.$store.getters.getItemTitle.endTime > '2020.02.10') ||
-          (this.$store.getters.getItemTitle.isDone == false &&
-            this.$store.getters.getItemTitle.endTime <= '2020.02.10' &&
-            this.$store.getters.getItemTitle.allowRetryNow == true)
-        "
-      >
-        <div class="title-rect" />
-        <h2 class="title-rect-name">{{ $t("studentWeb.exam.examLink") }}</h2>
-      </div>
-      <!--單一學科試卷-->
-      <div
-        v-if="(
-           this.$store.getters.getItemTitle.isDone == false &&
-           this.$store.getters.getItemTitle.endTime > '2020.02.10' &&
-            this.$store.getters.getItemTitle.eventSubject != '綜合學科') ||
-          (this.$store.getters.getItemTitle.isDone == false &&
-            this.$store.getters.getItemTitle.endTime <= '2020.02.10' &&
-            this.$store.getters.getItemTitle.allowRetryNow == true &&
-            this.$store.getters.getItemTitle.eventSubject != '綜合學科')
-        "
-        class="tasks"
-        @click="opentest()"
-      >
-        <div class="title" v-if="getCurrentLang() == 'tw'">
-          <span style="position: relative; top: 1px">
-            <svg-icon icon-class="test" class="title-icon" />
-          </span>
-          {{ this.$store.getters.getItemTitle.eventSubject }}科試卷
-        </div>
-        <div class="title" v-if="getCurrentLang() == 'en'">
-          <span style="position: relative; top: 1px">
-            <svg-icon icon-class="test" class="title-icon" />
-          </span>
-          {{ transSubjecttoEn(this.$store.getters.getItemTitle.eventSubject) }}
-          Exam
+                              icon-class="multiTest"
+                              class="reset-testIcon" />
+                    <svg-icon v-if="nextItem.eventType == '投票'" icon-class="vote" />
+                </div>
+                <p class="nextItemTitle">
+                    <span class="typeMark">{{ nextItem.eventType }}</span>
+                    {{ nextItem.name }}
+                </p>
+                <div class="setting-checkbox">
+                    <input type="checkbox" v-model="unhintNextItem" />
+                    <label> 下次不再詢問,如欲恢復提示,於個人設定頁面勾選</label>
+                </div>
+                <br />
+                <button @click="cancelPreview()">取消,自行查看</button>
+                <button @click="gotoNextItem()">確定</button>
+            </div>
         </div>
         </div>
-        <!--依試卷是否完成顯示打勾狀態-->
-        <li
-          :class="{
-            finished: finishedfromTestPop() == true,
-            unfinished: finishedfromTestPop() == false,
-          }"
-        >
-          <Icon class="doneicon" type="ios-checkmark" size="36" />
-        </li>
-      </div>
 
 
-      <!----->
-      <!--多學科試卷-->
 
 
 
 
+        <LessonTestPop v-if="openEva" />
 
 
 
 
 
 
-      <div
-        v-if="
-          (this.$store.getters.getItemTitle.isDone == false &&
-            this.$store.getters.getItemTitle.endTime > '2020.02.10' &&
-            this.$store.getters.getItemTitle.eventSubject == '綜合學科') ||
-          (this.$store.getters.getItemTitle.isDone == false &&
-            this.$store.getters.getItemTitle.endTime <= '2020.02.10' &&
-            this.$store.getters.getItemTitle.allowRetryNow == true &&
-            this.$store.getters.getItemTitle.eventSubject == '綜合學科')
-        "
-      >
-        <ul
-          v-for="(item, index) in multiSubject"
-          :key="index"
-          class="tasks"
-          @click="opentestWithSubject(item)"
-        >
-          <li class="title" v-if="getCurrentLang() == 'tw'">
-            <span style="position: relative; top: 1px">
-              <svg-icon icon-class="test" class="title-icon" />
-            </span>
-            {{ item }}科試卷
-          </li>
-          <li class="title" v-if="getCurrentLang() == 'en'">
-            <span style="position: relative; top: 1px">
-              <svg-icon icon-class="test" class="title-icon" />
-            </span>
-            {{ transSubjecttoEn(item) }} Exam
-          </li>
-          <!--依試卷是否完成顯示打勾狀態-->
-          <li
-            :class="{
-              finished: getNowdoneSubject().includes(item) == true,
-              unfinished: getNowdoneSubject().includes(item) == false,
-            }"
-          >
-            <Icon class="doneicon" type="ios-checkmark" size="36" />
-          </li>
-        </ul>
-      </div>
-      <!--多學科試卷-->
-      <!--如果評量已結束則顯示學情報告分頁-->
-      <br />
-      <Tabs
-        value="tab2"
-        v-if="this.$store.getters.getItemTitle.isDone == true"
-        :animated="false"
-      >
-        <TabPane :label="$t('studentWeb.exam.contentPage')" name="tab1">
-          <br />
-          <div class="dec animate__animated animate__headShake">
-            <span class="warm-hint">{{ $t("studentWeb.exam.practiceHint") }}</span>
-          </div>
-          <!--單一學科試卷-->
-          <div class="title-rect-group">
-            <div class="title-rect" />
-            <h2 class="title-rect-name">{{ $t("studentWeb.exam.examLink") }}</h2>
-          </div>
-          <div
-            v-if="this.$store.getters.getItemTitle.eventSubject != '綜合學科'"
-            class="tasks"
-            @click="opentest()"
-          >
-            <div class="title" v-if="getCurrentLang() == 'tw'">
-              <span style="position: relative; top: 1px">
-                <svg-icon icon-class="test" class="title-icon" />
-              </span>
-              {{ this.$store.getters.getItemTitle.eventSubject }}科試卷
-            </div>
-            <div class="title" v-if="getCurrentLang() == 'en'">
-              <span style="position: relative; top: 1px">
-                <svg-icon icon-class="test" class="title-icon" />
-              </span>
-              {{
-                transSubjecttoEn(this.$store.getters.getItemTitle.eventSubject)
-              }}
-              Exam
+        <div>
+            <EventBasicInfo :paper="paperData" />
+            <div v-if="this.$store.getters.getItemTitle.isDone == false && this.$store.getters.getItemTitle.endTime <= '2020.02.10' &&this.$store.getters.getItemTitle.allowRetryNow == false">
+                <br v-if="!ishideHint" />
+                <div class="dec animate__animated animate__bounceInLeft" v-if="!ishideHint">
+                    <svg-icon icon-class="handonHint" class="warm-icon" />
+                    <span class="warm-hint">{{ $t("studentWeb.exam.timeoutHint") }}</span>
+                </div>
             </div>
             </div>
-            <!--依試卷是否完成顯示打勾狀態-->
-            <!--li :class="{
-                finished: true,
-              }">
-              <Icon class="doneicon" type="ios-checkmark" size="36" />
-            </li-->
-          </div>
-
-          <!----->
-          <!--多學科試卷-->
-          <div
-            v-if="this.$store.getters.getItemTitle.eventSubject == '綜合學科'"
-          >
-            <ul
-              v-for="(item, index) in multiSubject"
-              :key="index"
+            <!--<div
+              v-if="  this.$store.getters.getItemTitle.isDone == false && this.$store.getters.getItemTitle.endTime <= '2020.02.10' && this.$store.getters.getItemTitle.allowRetryNow == true " >
+              <br v-if="!ishideHint" />
+              <div class="dec animate__animated animate__bounceInLeft" v-if="!ishideHint">
+                <svg-icon icon-class="handonHint" class="warm-icon" />
+                <span
+                  class="warm-hint"
+                  v-if="this.$store.getters.getCurrentLaguage == 'tw'"
+                >
+                  評量活動時間已結束,請於
+                  <span class="retry-date">2020.02.13 23:59 前</span
+                  >完成補考,逾時將以0分計算。
+                </span>
+                <span
+                  class="warm-hint"
+                  v-if="this.$store.getters.getCurrentLaguage == 'en'"
+                >
+                  The exam task time has ended, please make up the exam
+                  <span class="retry-date">before 2020.02.13 23:59</span> or your
+                  score would be 0.
+                </span>
+                <span @click="hidehint()" class="close-hint-btn">
+                  <Icon type="md-close" class="close-icon" />
+                </span>
+              </div>
+            </div>-->
+            <!--<div
+              class="title-rect-group"
+              v-if="
+                (this.$store.getters.getItemTitle.isDone == false &&
+                  this.$store.getters.getItemTitle.endTime > '2020.02.10') ||
+                (this.$store.getters.getItemTitle.isDone == false &&
+                  this.$store.getters.getItemTitle.endTime <= '2020.02.10' &&
+                  this.$store.getters.getItemTitle.allowRetryNow == true)
+              "
+            >
+              <div class="title-rect" />
+              <h2 class="title-rect-name">{{ $t("studentWeb.exam.examLink") }}</h2>
+            </div>-->
+            <!--單一學科試卷-->
+            <!--<div
+              v-if="(
+                 this.$store.getters.getItemTitle.isDone == false &&
+                 this.$store.getters.getItemTitle.endTime > '2020.02.10' &&
+                  this.$store.getters.getItemTitle.eventSubject != '綜合學科') ||
+                (this.$store.getters.getItemTitle.isDone == false &&
+                  this.$store.getters.getItemTitle.endTime <= '2020.02.10' &&
+                  this.$store.getters.getItemTitle.allowRetryNow == true &&
+                  this.$store.getters.getItemTitle.eventSubject != '綜合學科')
+              "
               class="tasks"
               class="tasks"
               @click="opentest()"
               @click="opentest()"
             >
             >
-              <li class="title" v-if="getCurrentLang() == 'tw'">
+              <div class="title" v-if="getCurrentLang() == 'tw'">
                 <span style="position: relative; top: 1px">
                 <span style="position: relative; top: 1px">
                   <svg-icon icon-class="test" class="title-icon" />
                   <svg-icon icon-class="test" class="title-icon" />
                 </span>
                 </span>
-                {{ item }}科試卷
-              </li>
-              <li class="title" v-if="getCurrentLang() == 'en'">
+                {{ this.$store.getters.getItemTitle.eventSubject }}科試卷
+              </div>
+              <div class="title" v-if="getCurrentLang() == 'en'">
                 <span style="position: relative; top: 1px">
                 <span style="position: relative; top: 1px">
                   <svg-icon icon-class="test" class="title-icon" />
                   <svg-icon icon-class="test" class="title-icon" />
                 </span>
                 </span>
-                {{ transSubjecttoEn(item) }} Exam
+                {{ transSubjecttoEn(this.$store.getters.getItemTitle.eventSubject) }}
+                Exam
+              </div>-->
+            <!--依試卷是否完成顯示打勾狀態-->
+            <!--<li
+                :class="{
+                  finished: finishedfromTestPop() == true,
+                  unfinished: finishedfromTestPop() == false,
+                }"
+              >
+                <Icon class="doneicon" type="ios-checkmark" size="36" />
               </li>
               </li>
-              <!--依試卷是否完成顯示打勾狀態-->
-            </ul>
-          </div>
+            </div>-->
+            <!----->
+            <!--多學科試卷-->
+            <div v-if="paperData.length >1 ">
+                <ul v-for="(item, index) in paperData"
+                    :key="index"
+                    class="tasks"
+                    @click="opentestWithSubject(item)">
+                    <li class="title" v-if="getCurrentLang() == 'tw'">
+                        <span style="position: relative; top: 1px">
+                            <svg-icon icon-class="test" class="title-icon" />
+                        </span>
+                        {{ item.subject.name }}科試卷
+                    </li>
+                    <!--<li class="title" v-if="getCurrentLang() == 'en'">
+                      <span style="position: relative; top: 1px">
+                        <svg-icon icon-class="test" class="title-icon" />
+                      </span>
+                      {{ transSubjecttoEn(item) }} Exam
+                    </li>-->
+                    <!--依試卷是否完成顯示打勾狀態-->
+                    <li :class="{
+              finished: getNowdoneSubject().includes(item) == true,
+              unfinished: getNowdoneSubject().includes(item) == false,
+            }">
+                        <Icon class="doneicon" type="ios-checkmark" size="36" />
+                    </li>
+                </ul>
+            </div>
 
 
-          <!----->
-        </TabPane>
-        <TabPane :label="$t('studentWeb.exam.scorePage')" name="tab2">
-          <LessonTestReport />
-        </TabPane>
-      </Tabs>
+
+            <!--多學科試卷-->
+            <!--如果評量已結束則顯示學情報告分頁-->
+            <br />
+            <Tabs value="tab2"
+                  v-if="this.$store.getters.getItemTitle.isDone == true"
+                  :animated="false">
+                <TabPane :label="$t('studentWeb.exam.contentPage')" name="tab1">
+                    <br />
+                    <div class="dec animate__animated animate__headShake">
+                        <span class="warm-hint">{{ $t("studentWeb.exam.practiceHint") }}</span>
+                    </div>
+                    <!--單一學科試卷-->
+                    <div class="title-rect-group">
+                        <div class="title-rect" />
+                        <h2 class="title-rect-name">{{ $t("studentWeb.exam.examLink") }}</h2>
+                    </div>
+                    <div v-if="this.$store.getters.getItemTitle.eventSubject != '綜合學科'"
+                         class="tasks"
+                         @click="opentest()">
+                        <div class="title" v-if="getCurrentLang() == 'tw'">
+                            <span style="position: relative; top: 1px">
+                                <svg-icon icon-class="test" class="title-icon" />
+                            </span>
+                            {{ this.$store.getters.getItemTitle.eventSubject }}科試卷
+                        </div>
+                        <div class="title" v-if="getCurrentLang() == 'en'">
+                            <span style="position: relative; top: 1px">
+                                <svg-icon icon-class="test" class="title-icon" />
+                            </span>
+                            {{ transSubjecttoEn(this.$store.getters.getItemTitle.eventSubject)}}
+                            Exam
+                        </div>
+                        <!--依試卷是否完成顯示打勾狀態-->
+                        <!--li :class="{
+                            finished: true,
+                          }">
+                          <Icon class="doneicon" type="ios-checkmark" size="36" />
+                        </li-->
+                    </div>
+
+                    <!----->
+                    <!--多學科試卷-->
+                    <div v-if="paperData.length >1">
+                        <ul v-for="(item, index) in multiSubject"
+                            :key="index"
+                            class="tasks"
+                            @click="opentest()">
+                            <li class="title" v-if="getCurrentLang() == 'tw'">
+                                <span style="position: relative; top: 1px">
+                                    <svg-icon icon-class="test" class="title-icon" />
+                                </span>
+                                {{ item }}科試卷
+                            </li>
+                            <li class="title" v-if="getCurrentLang() == 'en'">
+                                <span style="position: relative; top: 1px">
+                                    <svg-icon icon-class="test" class="title-icon" />
+                                </span>
+                                {{ transSubjecttoEn(item) }} Exam
+                            </li>
+                            <!--依試卷是否完成顯示打勾狀態-->
+                        </ul>
+                    </div>
+
+                    <!----->
+
+                </TabPane>
+                <!--评量分析数据返回-->
+                <TabPane :label="$t('studentWeb.exam.scorePage')" name="tab2">
+                    <LessonTestReport />
+                </TabPane>
+            </Tabs>
+        </div>
     </div>
     </div>
-  </div>
 </template>
 </template>
 
 
 <script>
 <script>
-import EventBasicInfo from "../../EventBasicInfo";
+    import EventBasicInfo from "../../EventBasicInfo";
+
+    import LessonTestReport from "./LessonTestReport";
+    import LessonTestPop from "./LessonTestPop";
+    //import mockdata from "@/api/newData";
+    //import mockdataEn from "@/api/newDataEn";
+    export default {
+        name: "LessonTest",
+        components: {
+            EventBasicInfo,
+            LessonTestReport,
+            LessonTestPop,
+        },
+        created() {
+
+            //if(localStorage.getItem("lang") == ""){
+            //  this.mockdata = mockdata.eventList;
+            //}
+            //if (localStorage.getItem("lang") == "tw") {
+            //  this.mockdata = mockdata.eventList;
+            //} else this.mockdata = mockdataEn.eventList;
+        },
+        mounted() {
+            this.getPaperData()
+        },
+        data() {
+            return {
+                unhintNextItem: false,
+                ishideHint: false,
+                multiSubject: ["國文", "英文", "數學"],
+
+                //提示下一個
+                mockdata: "",
+                nextItem: "", //存放下個活動預告
+                isHintNextItem: false,
+                showHint: false,
+                paperData: [],
+                openEva: false
+            };
+        },
+        methods: {
+            getPaperData() {
+                console.log(this.$store.getters.getPaperInfo)
+                if (this.$store.getters.getPaperInfo.name !== undefined) {
+                    let paper = this.$store.getters.getPaperInfo
+                    let req = {
+                        id: paper.id,
+                        code: paper.code,
+                        studentId: this.$store.state.userInfo.sub,
+                        school: paper.school
+                    }
+                    this.$api.studentWeb.FindStudentPaper(req).then(res => {
+                        console.log(res)
+                        let resData = res.props
+                        let sub = []
+                        for (let item of resData) {
+                            if (item.scope) {
+                                this.paperData.push(item)
+                            } else {
+                                sub = item
+                            }
+                        }
+                        console.log(sub)
+                        for (let i = 0; i < this.paperData.length; i++) {
+                            this.paperData[i].subject = sub.subjects[i]
+                            this.paperData[i].stuAns = res.stuAns[i]
+                        }
+                        console.log(this.paperData)
+                    })
+                }
+            },
+            dateFormat(timestamp) {
+                var date = new Date(timestamp)
+                var Y = date.getFullYear() + '-'
+                var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'
+                var D = date.getDate() + ' '
+                return Y + M + D;
+            },
 
 
-import LessonTestReport from "./LessonTestReport";
-import LessonTestPop from "./LessonTestPop";
-import mockdata from "@/api/newData";
-import mockdataEn from "@/api/newDataEn";
-export default {
-  name: "LessonTest",
-  components: {
-    EventBasicInfo,
-    LessonTestReport,
-    LessonTestPop,
-  },
-  created() {
-    if(localStorage.getItem("lang") == ""){
-      this.mockdata = mockdata.eventList;
-    }
-    if (localStorage.getItem("lang") == "tw") {
-      this.mockdata = mockdata.eventList;
-    } else this.mockdata = mockdataEn.eventList;
-  },
-  data() {
-    return {
-        unhintNextItem: false,
-      ishideHint: false,
-      multiSubject: ["國文", "英文", "數學"],
+            getisHint(data) {
+                this.isHintNextItem = data;
+                console.log(this.isHintNextItem);
+                this.previewNext();
+                console.log(localStorage.getItem("hintNextItem")) //讀取是否顯示提示下一個
+                if (localStorage.getItem("hintNextItem") != "false") {
+                    setTimeout(() => {
+                        this.showHint = true;
+                    }, 4000);
+                }
 
 
-      //提示下一個
-      mockdata: "",
-      nextItem: "", //存放下個活動預告
-      isHintNextItem: false,
-      showHint: false,
+                this.isHintNextItem = false;
+            },
+            cancelPreview() {
+                this.showHint = false;
+            },
+            gotoNextItem() {
+                if (this.unhintNextItem == true) {
+                    this.$store.commit("sethintNextItem", false);
+                }
+                if (this.nextItem != "allfinished") {
+                    this.$store.commit("ChangeItemName", this.nextItem);
+                    this.$router.push("/studentWeb/eventView#" + this.nextItem.eventID);
+                    this.$store.commit("SetisFromInfoPoptpScroll", true);
+                } else {
+                    this.$router.push("/studentWeb/homeView");
+                }
+            },
+            previewNext() {
+                this.isPreviewNextItem = true;
+                let eventPageType = ["課前預習", "評量", "作業", "投票"];
+                let nextItems = [];
+                for (let i = 0; i < this.mockdata.length; i++) {
+                    if (
+                        eventPageType.includes(this.mockdata[i].eventType) &&
+                        this.mockdata[i].isDone == false &&
+                        this.$store.getters.getFinishedItem.includes(
+                            this.mockdata[i].eventID
+                        ) == false
+                    ) {
+                        nextItems.push(this.mockdata[i]); //引導使用者前往下一個未完成的項目
+                    }
+                }
+                if (nextItems != "") {
+                    if (
+                        nextItems[0].eventName ==
+                        this.mockdata[this.mockdata.length - 1].eventName
+                    ) {
+                        console.log("沒有下一個!");
+                        this.nextItem = "allfinished";
+                    }
+                    console.log("下一個:" + nextItems[0].eventName);
+                    this.nextItem = nextItems[0];
+                }
+            },
+            getCurrentLang() {
+                return localStorage.getItem("lang");
+            },
+            getNowdoneSubject() {
+                return this.$store.getters.getCurrentfinishedSubject;
+            },
+            finishedfromTestPop() {
+                return this.$store.getters.getFinishedItem.includes(
+                    this.$store.getters.getItemTitle.eventID
+                );
+            },
+            hidehint() {
+                this.ishideHint = !this.ishideHint;
+            },
+            opentest: function () {
+                this.$store.commit("ToggleLessonTestPop");
+            },
+            opentestWithSubject: function (item) {
+                this.openEva = false
+                console.log(item)
+                if (item.name !== '') {
+                    this.$store.commit("ToggleLessonTestPopWithSubject", item);
+                    console.log('打开')
+                    this.openEva = true
+                }
+            },
+            transSubjecttoEn(type) {
+                if (type == "國文") return "Chinese";
+                else if (type == "英文") return "English";
+                else if (type == "數學") return "Math";
+                else if (type == "綜合學科") return "Comprehensive";
+            },
+        },
     };
     };
-  },
-  methods: {
-    getisHint(data) {
-      this.isHintNextItem = data;
-      console.log(this.isHintNextItem);
-      this.previewNext();
-       console.log(localStorage.getItem("hintNextItem") ) //讀取是否顯示提示下一個
-        if (localStorage.getItem("hintNextItem") != "false") {
-        setTimeout(() => {
-          this.showHint = true;
-        }, 4000);}
-      
-      this.isHintNextItem = false;
-    },
-    cancelPreview() {
-      this.showHint = false;
-    },
-    gotoNextItem() {
-      if (this.unhintNextItem == true) {
-        this.$store.commit("sethintNextItem", false);
-      }
-      if (this.nextItem != "allfinished") {
-        this.$store.commit("ChangeItemName", this.nextItem);
-          this.$router.push("/studentWeb/eventView#" + this.nextItem.eventID);
-        this.$store.commit("SetisFromInfoPoptpScroll", true);
-      } else {
-          this.$router.push("/studentWeb/homeView");
-      }
-    },
-    previewNext() {
-      this.isPreviewNextItem = true;
-      let eventPageType = ["課前預習", "評量", "作業", "投票"];
-      let nextItems = [];
-      for (let i = 0; i < this.mockdata.length; i++) {
-        if (
-          eventPageType.includes(this.mockdata[i].eventType) &&
-          this.mockdata[i].isDone == false &&
-          this.$store.getters.getFinishedItem.includes(
-            this.mockdata[i].eventID
-          ) == false
-        ) {
-          nextItems.push(this.mockdata[i]); //引導使用者前往下一個未完成的項目
-        }
-      }
-      if (nextItems != "") {
-        if (
-          nextItems[0].eventName ==
-          this.mockdata[this.mockdata.length - 1].eventName
-        ) {
-          console.log("沒有下一個!");
-          this.nextItem = "allfinished";
-        }
-        console.log("下一個:" + nextItems[0].eventName);
-        this.nextItem = nextItems[0];
-      }
-    },
-    getCurrentLang() {
-      return localStorage.getItem("lang");
-    },
-    getNowdoneSubject() {
-      return this.$store.getters.getCurrentfinishedSubject;
-    },
-    finishedfromTestPop() {
-      return this.$store.getters.getFinishedItem.includes(
-        this.$store.getters.getItemTitle.eventID
-      );
-    },
-    hidehint() {
-      this.ishideHint = !this.ishideHint;
-    },
-    opentest: function () {
-      this.$store.commit("ToggleLessonTestPop");
-    },
-    opentestWithSubject: function (item) {
-      console.log(item);
-      this.$store.commit("ToggleLessonTestPopWithSubject", item);
-      console.log(this.$store.getters.getCurrentSubject);
-    },
-    transSubjecttoEn(type) {
-      if (type == "國文") return "Chinese";
-      else if (type == "英文") return "English";
-      else if (type == "數學") return "Math";
-      else if (type == "綜合學科") return "Comprehensive";
-    },
-  },
-};
 </script>
 </script>
 
 
 <style>
 <style>
-@import "~@/assets/student-web/component_styles/lesson-test.css";
+    @import "~@/assets/student-web/component_styles/lesson-test.css";
 </style>
 </style>

File diff suppressed because it is too large
+ 720 - 770
TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContentTypeTemplate/LessonTestPop.vue


File diff suppressed because it is too large
+ 848 - 901
TEAMModelOS/ClientApp/src/components/student-web/EventView/EventList.vue


+ 15 - 16
TEAMModelOS/ClientApp/src/components/student-web/EventView/EventView.vue

@@ -1,24 +1,19 @@
 <template>
 <template>
     <div class="event-view">
     <div class="event-view">
         <EventList :class="{ 'hide-sidebar': this.$store.getters.getSidebarisOpen == false }"></EventList>
         <EventList :class="{ 'hide-sidebar': this.$store.getters.getSidebarisOpen == false }"></EventList>
-        <EventContentArea :class="{
-        'eventContentArea-Span': this.$store.getters.getSidebarisOpen == false,
-        'eventContentArea-left':
-          this.$store.getters.getOpenCommentList == true &&
-          this.$store.getters.getSidebarisOpen == false,
+        
+        
+        <EventContentArea :class="{'eventContentArea-Span': this.$store.getters.getSidebarisOpen == false,
+                          'eventContentArea-left':this.$store.getters.getOpenCommentList == true && this.$store.getters.getSidebarisOpen == false,
       }"></EventContentArea>
       }"></EventContentArea>
-        <CommentList v-if="
-        this.$store.getters.getOpenCommentList == true &&
-        this.$store.getters.getSidebarisOpen == false
-      " />
-        <div class="nextItemBtn"
+       
+        <CommentList v-if="this.$store.getters.getOpenCommentList == true &&this.$store.getters.getSidebarisOpen == false" />
+       
+        <!--<div class="nextItemBtn"
              @click="gotoNextItem()"
              @click="gotoNextItem()"
-             v-if="
-        this.$store.getters.getSidebarisOpen == false &&
-        this.$store.getters.getOpenCommentList == false
-      ">
+             v-if="this.$store.getters.getSidebarisOpen == false &&this.$store.getters.getOpenCommentList == false">
             {{ $t("studentWeb.nextTask") }} →
             {{ $t("studentWeb.nextTask") }} →
-        </div>
+        </div>-->
     </div>
     </div>
 </template>
 </template>
 
 
@@ -56,9 +51,11 @@
             this.$emit("onNavName", this.MyName);
             this.$emit("onNavName", this.MyName);
             this.$store.commit("ToggleSidebar", true);
             this.$store.commit("ToggleSidebar", true);
             this.$store.commit("SaveNowPage", '活動');
             this.$store.commit("SaveNowPage", '活動');
-            this.setPaperData()
+            //this.setPaperData()
         },
         },
         methods: {
         methods: {
+
+
             setPaperData() {
             setPaperData() {
                 let data = {
                 let data = {
                     scope: "school",
                     scope: "school",
@@ -68,6 +65,8 @@
                 console.log('学生端试卷信息')
                 console.log('学生端试卷信息')
                 console.log(info)
                 console.log(info)
             },
             },
+
+
             scrollList() {
             scrollList() {
                 //當從通知操作進行捲動時,將篩選條件清空
                 //當從通知操作進行捲動時,將篩選條件清空
                 this.selectedEventStatusNow = "所有活動狀態";
                 this.selectedEventStatusNow = "所有活動狀態";

+ 160 - 124
TEAMModelOS/ClientApp/src/components/student-web/HomeView/MissionListCard.vue

@@ -12,30 +12,33 @@
                 <li :id="`event${item.eventID}`"
                 <li :id="`event${item.eventID}`"
                     class="list-item"
                     class="list-item"
                     @click="sentSelectedEventTitle(item)"
                     @click="sentSelectedEventTitle(item)"
-                    v-show=" eventPageType.includes(item.eventType) == true && item.isDone == false && item.endTime > '2020.02.10' " v-for="(item, index) in mockdata" :key="index">
+                    v-for="(item, index) in TestData" :key="index">
                     <ul>
                     <ul>
+                        <!--v-show=" eventPageType.includes(item.eventType) == true && item.isDone == false && item.endTime > '2020.02.10'"-->
                         <li class="list-item-icon">
                         <li class="list-item-icon">
                             <svg-icon v-if="item.eventType == '作業'" icon-class="doc" />
                             <svg-icon v-if="item.eventType == '作業'" icon-class="doc" />
                             <svg-icon v-if="item.eventType == '課前預習'"
                             <svg-icon v-if="item.eventType == '課前預習'"
                                       icon-class="selflearninginTime" />
                                       icon-class="selflearninginTime" />
-                            <svg-icon v-if="  item.eventType == '評量' && item.eventSubject != '綜合學科' "
+                            <svg-icon v-if="  item.eventType == 'exam'"
                                       icon-class="test"
                                       icon-class="test"
                                       class="reset-testIcon" />
                                       class="reset-testIcon" />
-                            <svg-icon v-if=" item.eventType == '評量' && item.eventSubject == '綜合學科' "
-                                      icon-class="multiTest" />
+                            <!--<svg-icon v-if=" item.eventType == 'exam' && item.eventSubject == '綜合學科' "
+                  icon-class="multiTest" />-->
                             <svg-icon v-if="item.eventType == '投票'" icon-class="vote" />
                             <svg-icon v-if="item.eventType == '投票'" icon-class="vote" />
                             <svg-icon v-if="item.eventType == '問卷'" icon-class="quesnaire" />
                             <svg-icon v-if="item.eventType == '問卷'" icon-class="quesnaire" />
                         </li>
                         </li>
                         <li class="list-item-info" :class="{ 'list-item-infonoPie': isNoPie(item) }">
                         <li class="list-item-info" :class="{ 'list-item-infonoPie': isNoPie(item) }">
                             <p class="list-item-title" :class="{ 'list-item-titleEn': getCurrentLang() == 'en' }">
                             <p class="list-item-title" :class="{ 'list-item-titleEn': getCurrentLang() == 'en' }">
+                                <!--<span class="list-item-typeMark"
+                                      v-if="getCurrentLang() == 'tw'">{{ item.eventType }}</span>-->
                                 <span class="list-item-typeMark"
                                 <span class="list-item-typeMark"
-                                      v-if="getCurrentLang() == 'tw'">{{ item.eventType }}</span>
+                                      v-if="getCurrentLang() == 'tw'">评量</span>
                                 <span class="list-item-typeMark"
                                 <span class="list-item-typeMark"
                                       v-if="getCurrentLang() == 'en'">{{ transTypetoEn(item.eventType) }}</span>
                                       v-if="getCurrentLang() == 'en'">{{ transTypetoEn(item.eventType) }}</span>
-                                <span>{{ item.eventName }}</span>
+                                <span>{{ item.name }}</span>
                             </p>
                             </p>
                             <p class="list-item-time">
                             <p class="list-item-time">
-                                {{ item.startTime }} ~ {{ item.endTime }}
+                                {{ dateFormat(item.startTime) }} ~ {{ dateFormat(item.endTime) }}
                             </p>
                             </p>
                         </li>
                         </li>
                         <li class="list-item-unDone">
                         <li class="list-item-unDone">
@@ -52,127 +55,160 @@
 </template>
 </template>
 
 
 <script>
 <script>
-import { Random } from "mockjs";
-import mockdata from "@/api/newData";
-import mockdataEn from "@/api/newDataEn";
-import PreviewProgressPie from "../EventView/PreviewProgressPie";
-export default {
-  name: "MissionListCard",
-  components: {
-    PreviewProgressPie,
-  },
-  data() {
-    return {
-      //mockdataOriginal: mockdata.eventList,
-      //mockdata: mockdata.eventList.slice(0, 39),
-      listblockHeight:0,
-      mockdataOriginal: "",
-      mockdata: "",
-      templistArray: [],
-      eventPageType: ["課前預習", "評量", "作業", "投票","問卷"] //本頁出現的類型
-    };
-  },
-  created() {
-    this.createMockdataOriginal();
-    this.createMockdata();
-  },
-  mounted() {
-    //初始化抓取卡牌頭兩項項目高度,回傳給清單顯示範圍高度,解決原本寫死高度造成清單顯示範圍截斷在項目中間
-    if (document.querySelectorAll(".mission-list-card .list-item") != "") {
-      var listblockHeight=0;
-      for (let i = 0; i < 9; i++) {
-        if (
-          document.querySelectorAll(".mission-list-card .list-item")[i].style.display == "none"
-        ) {
-          document.querySelectorAll(".mission-list-card .list-item")[i].style.display = "block"
-          listblockHeight+=document.querySelectorAll(".mission-list-card .list-item")[i].offsetHeight; 
-          document.querySelectorAll(".mission-list-card .list-item")[i].style.display = "none" 
-        }
-        else{
-           listblockHeight+=document.querySelectorAll(".mission-list-card .list-item")[i].offsetHeight; 
-        }
-          
-      }
-      console.log(listblockHeight);
-      this.listblockHeight = listblockHeight;
-    }
-  },
-  methods: {
-    isNoPie(item) {
-      return (
-        !(item.eventType == "課前預習" && item.endTime > "2020.02.10") &&
-        !(
-          item.eventType == "評量" &&
-          item.eventSubject == "綜合學科" &&
-          item.endTime > "2020.02.10"
-        )
-      );
-    },
-    getCurrentLang() {
-      return localStorage.getItem("lang");
-    },
-    createMockdataOriginal: function () {
-      if (localStorage.getItem("lang") == "en") {
-        this.mockdataOriginal = mockdataEn.eventList;
-      } else this.mockdataOriginal = mockdata.eventList;
-    },
-    createMockdata: function () {
-      if (localStorage.getItem("lang") == "en") {
-        this.mockdata = mockdataEn.eventList.slice(0, 39);
-      } else this.mockdata = mockdata.eventList.slice(0, 39);
-    },
+    import { Random } from "mockjs";
+    import mockdata from "@/api/newData";
+    import mockdataEn from "@/api/newDataEn";
+    import PreviewProgressPie from "../EventView/PreviewProgressPie";
+    export default {
+        name: "MissionListCard",
+        components: {
+            PreviewProgressPie,
+        },
+        data() {
+            return {
+                //mockdataOriginal: mockdata.eventList,
+                //mockdata: mockdata.eventList.slice(0, 39),
+                listblockHeight: 0,
+                mockdataOriginal: "",
+                mockdata: "",
+                TestData: [],
+                templistArray: [],
+                eventPageType: ["課前預習", "評量", "作業", "投票", "問卷"] //本頁出現的類型
+            };
+        },
+        created() {
+            this.getPaperData()
+            //this.createMockdataOriginal();
+            //this.createMockdata();
+        },
+        mounted() {
+            //初始化抓取卡牌頭兩項項目高度,回傳給清單顯示範圍高度,解決原本寫死高度造成清單顯示範圍截斷在項目中間
+            if (document.querySelectorAll(".mission-list-card .list-item") != "") {
+                var listblockHeight = 0;
+                for (let i = 0; i < 9; i++) {
+                    if (
+                        document.querySelectorAll(".mission-list-card .list-item")[i].style.display == "none"
+                    ) {
+                        document.querySelectorAll(".mission-list-card .list-item")[i].style.display = "block"
+                        listblockHeight += document.querySelectorAll(".mission-list-card .list-item")[i].offsetHeight;
+                        document.querySelectorAll(".mission-list-card .list-item")[i].style.display = "none"
+                    }
+                    else {
+                        listblockHeight += document.querySelectorAll(".mission-list-card .list-item")[i].offsetHeight;
+                    }
+
+                }
+                this.getPaperData()
+                this.listblockHeight = listblockHeight;
+            }
+        },
+        methods: {
+            getPaperData() {
+                console.log('学生评量数据')
+                console.log(this.$store.state.user.studentProfile.classinfo.id)
+                if (this.$store.state.user.studentProfile.classinfo.id !== "") {
+                    let params = {
+                        'id': this.$store.state.user.studentProfile.classinfo.id
+                    }
+                    this.$api.studentWeb.FindExamPaper(params).then(res => {
+                        console.log(res)
+                        for (let item of res) {
+                            item.eventType = 'exam'
+                            this.TestData.push(item)
+                        }
+                        console.log(this.TestData)
+                    })
+                }
+            },
+            //处理时间结构
+            dateFormat(timestamp) {
+                var date = new Date(timestamp)
+                var Y = date.getFullYear() + '-'
+                var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'
+                var D = date.getDate() + ' '
+                return Y + M + D;
+            },
+            isNoPie(item) {
+                return (
+                    !(item.eventType == "課前預習" && item.endTime > "2020.02.10") &&
+                    !(
+                        item.eventType == "評量" &&
+                        item.eventSubject == "綜合學科" &&
+                        item.endTime > "2020.02.10"
+                    )
+                );
+            },
+            getCurrentLang() {
+                return localStorage.getItem("lang");
+            },
+            createMockdataOriginal: function () {
+                if (localStorage.getItem("lang") == "en") {
+                    this.mockdataOriginal = mockdataEn.eventList;
+                } else this.mockdataOriginal = mockdata.eventList;
+            },
+            createMockdata: function () {
+                if (localStorage.getItem("lang") == "en") {
+                    this.mockdata = mockdataEn.eventList.slice(0, 39);
+                } else this.mockdata = mockdata.eventList.slice(0, 39);
+            },
 
 
-    transTypetoEn(type) {
-      if (type == "投票") return "Vote";
-      else if (type == "評量") return "Exam";
-      else if (type == "作業") return "Homework";
-      else if (type == "課前預習") return "Preview";
-    },
-    handleReachBottom() {
-      return new Promise((resolve) => {
-        setTimeout(() => {
-          for (
-            let i = 1;
-            i < 11 && this.mockdata.length < this.mockdataOriginal.length - 1;
-            i++
-          ) {
-            //小於原始資料總長度在加入空陣列
+            transTypetoEn(type) {
+                if (type == "投票") return "Vote";
+                else if (type == "評量") return "Exam";
+                else if (type == "作業") return "Homework";
+                else if (type == "課前預習") return "Preview";
+            },
+            handleReachBottom() {
+                return new Promise((resolve) => {
+                    setTimeout(() => {
+                        for (
+                            let i = 1;
+                            i < 11 && this.mockdata.length < this.mockdataOriginal.length - 1;
+                            i++
+                        ) {
+                            //小於原始資料總長度在加入空陣列
 
 
-            this.mockdata.push(this.mockdataOriginal[this.mockdata.length + 1]);
-          }
+                            this.mockdata.push(this.mockdataOriginal[this.mockdata.length + 1]);
+                        }
 
 
-          resolve();
-        }, 6000);
-      });
-    },
-    randomScore: function () {
-      return Random.integer(70, 96);
-    },
-    sentSelectedEventTitle: function (item) {
-        this.$router.push("/studentWeb/eventView#" + item.eventID);
-      //螢幕寬度<767px時,直接關掉sidebar
-      if (window.innerWidth <= 768) {
-        this.$store.commit("ToggleSidebar", false);
-      }
-      //改變ItemName的狀態 vuex mutations
-      this.$store.commit("ChangeItemName", item);
-      if (
-        document.getElementById(`event${item.eventID}`).style.display == "none"
-      ) {
-        document.getElementById(`event${item.eventID}`).style.display = "block";
-        console.log(document.getElementById(`event${item.eventID}`).offsetTop);
-      }
-      if (document.getElementById(`event${item.eventID}`).offsetTop > 600) {
-        let scrollvalue = document.getElementById(`event${item.eventID}`)
-          .offsetTop;
-        console.log("選項在清單可視範圍外!!");
-        this.$store.commit("scrollList", scrollvalue);
-      }
-    },
-  },
-};
+                        resolve();
+                    }, 6000);
+                });
+            },
+            randomScore: function () {
+                return Random.integer(70, 96);
+            },
+            sentSelectedEventTitle: function (item) {
+                console.log(item)
+                this.$router.push({path: "/studentWeb/eventView",
+                  query: {
+                    id: item.id,
+                    type: item.eventType
+                }
+                })
+                //螢幕寬度<767px時,直接關掉sidebar
+                if (window.innerWidth <= 768) {
+                    this.$store.commit("ToggleSidebar", false);
+                }
+                //改變ItemName的狀態 vuex mutations
+                this.$store.commit("ChangeItemName", item);
+                if (
+                    document.getElementById(`event${item.eventID}`).style.display == "none"
+                ) {
+                    document.getElementById(`event${item.eventID}`).style.display = "block";
+                    console.log(document.getElementById(`event${item.eventID}`).offsetTop);
+                }
+                if (document.getElementById(`event${item.eventID}`).offsetTop > 600) {
+                    let scrollvalue = document.getElementById(`event${item.eventID}`)
+                        .offsetTop;
+                    console.log("選項在清單可視範圍外!!");
+                    this.$store.commit("scrollList", scrollvalue);
+                }
+            },
+        },
+    };
 </script>
 </script>
 
 
 <style>
 <style>
-@import "~@/assets/student-web/component_styles/mission-list-card.css";
+    @import "~@/assets/student-web/component_styles/mission-list-card.css";
 </style>
 </style>

+ 34 - 1
TEAMModelOS/ClientApp/src/mock/index.js

@@ -232,6 +232,39 @@ export default {
               'http://icons.iconarchive.com/icons/google/noto-emoji-people-face/256/10135-boy-light-skin-tone-icon.png',
               'http://icons.iconarchive.com/icons/google/noto-emoji-people-face/256/10135-boy-light-skin-tone-icon.png',
               'http://icons.iconarchive.com/icons/google/noto-emoji-people-face/256/10147-adult-light-skin-tone-icon.png'
               'http://icons.iconarchive.com/icons/google/noto-emoji-people-face/256/10147-adult-light-skin-tone-icon.png'
           ]
           ]
-      }
+      },
+      //Osbert-classroom的假資料
+      'hiteachSetting|20': [{
+        'id|+1': 1234567,
+        'serial': '12DLT43F-EE20-4775-93F5-6BCC',
+        'prodGroup': 'HiTeach 5',
+        'prodName|1' : ['PRO', 'TBL','STD'],
+        'deviceMax': '@natural(0, 10)', // 可綁定最大值,如只有一則回傳單一
+        'DateDate|1': [0, 1, 1602691199], //已到期,無限期或有一個結束時間
+        'aprule': {
+          'sokapp|1': true, // 蘇格拉底議課
+          'sokvdo|1': true, // 蘇格拉底報告
+          'ezs|1': true, // 錄播系統
+
+          // 目前沒有的
+          'remoteSys|1': true, // 遠距教室服務
+          'sokDestop|1': true, // 蘇格拉底桌面
+          'sokreport|1': true, // 蘇格拉底報告
+        },
+        "deviceBound": function(){
+          let max = this.deviceMax
+          let data = []
+          for(let i = 0; i< max; i++){
+            data.push({
+              'uuid': "OSBERT-COMPUTER",
+              'ip': '192.168.0.1',
+              'classId': 'hbcn0101',
+              'computer': "Microsoft Winfows NT 10.0.18883.0 | Intel(R Core(TM i7-10700 CPU @ 2.9Ghz",
+              'deveiceId': '12DLT43F-EE20-4775-93F5-6BCC'
+            })
+          }
+          return data
+        }
+      }],
   })
   })
 }
 }

+ 0 - 1
TEAMModelOS/ClientApp/src/service/User.js

@@ -12,7 +12,6 @@ export class User {
     static $access;
     static $access;
 
 
     static async login(userInfo) {
     static async login(userInfo) {
-		console.log(userInfo)
       let userAccess = {
       let userAccess = {
           userId: userInfo.id,
           userId: userInfo.id,
           roles: userInfo.roles,
           roles: userInfo.roles,

+ 0 - 3
TEAMModelOS/ClientApp/src/store/index.js

@@ -24,15 +24,12 @@ const mutations = {
         state.counter = obj.counter
         state.counter = obj.counter
     },
     },
     setPrivateSas(state, obj) {
     setPrivateSas(state, obj) {
-        console.log('state')
         state.privateSas = obj
         state.privateSas = obj
     },
     },
     setSchoolSas(state, obj) {
     setSchoolSas(state, obj) {
-        console.log('state')
         state.schoolSas = obj
         state.schoolSas = obj
     },
     },
     setUserInfo(state, obj) {
     setUserInfo(state, obj) {
-		console.log(obj)
         obj.schoolCode = obj.schoolCode || GLOBAL.DEFAULT_SCHOOL_CODE
         obj.schoolCode = obj.schoolCode || GLOBAL.DEFAULT_SCHOOL_CODE
         obj.hasSchool = obj.schoolCode !== GLOBAL.DEFAULT_SCHOOL_CODE
         obj.hasSchool = obj.schoolCode !== GLOBAL.DEFAULT_SCHOOL_CODE
 		state.userInfo = obj
 		state.userInfo = obj

+ 4 - 0
TEAMModelOS/ClientApp/src/store/module/schoolBaseInfo.js

@@ -47,6 +47,8 @@ export default {
     },
     },
     actions: {
     actions: {
         getSchoolBaseData(context) {
         getSchoolBaseData(context) {
+            throw new Error("getSchoolBaseData方法已经弃用,请从schoolProfile读取基础数据")
+            return 
             return new Promise(
             return new Promise(
                 (resolve, reject) => {
                 (resolve, reject) => {
                     if (context.state.schoolBaseInfo.period.length == 0) {
                     if (context.state.schoolBaseInfo.period.length == 0) {
@@ -97,6 +99,8 @@ export default {
             )
             )
         },
         },
         getClassroom(context) {
         getClassroom(context) {
+            throw new Error("getClassroom方法已经弃用,请从schoolProfile读取班级数据")
+            return 
             return new Promise(
             return new Promise(
                 (resolve, reject) => {
                 (resolve, reject) => {
                     if (!context.state.classroomList) {
                     if (!context.state.classroomList) {

File diff suppressed because it is too large
+ 215 - 206
TEAMModelOS/ClientApp/src/store/module/studentWeb.js


+ 89 - 35
TEAMModelOS/ClientApp/src/store/module/user.js

@@ -1,4 +1,6 @@
 import apiTools from '@/api'
 import apiTools from '@/api'
+import jwtDecode from 'jwt-decode'
+
 export default {
 export default {
     namespaced: true,
     namespaced: true,
     state: {
     state: {
@@ -18,11 +20,12 @@ export default {
         schoolProfile:{ // 老師在學校的設定檔
         schoolProfile:{ // 老師在學校的設定檔
             blob_uri: undefined,    // 學校Blob網址
             blob_uri: undefined,    // 學校Blob網址
             blob_sas: undefined,    // 學校Blob金鑰,讀
             blob_sas: undefined,    // 學校Blob金鑰,讀
-            courses: undefined,     // 老師的校本課程
-            syllabus: undefined,    // 老師的校本課綱
             periods: undefined,    // 學校的學制List
             periods: undefined,    // 學校的學制List
             grades: undefined,    // 學校的年級List
             grades: undefined,    // 學校的年級List
-            classes: undefined,    // 學校的教室List
+            school_base: undefined, // 区班校基础数据
+            school_classes: undefined, // 学校班级
+            school_courses: undefined, // 学校排课
+            school_syllabus: undefined // 校本课纲
         },
         },
         studentProfile:{ // 學生在學校的設定檔
         studentProfile:{ // 學生在學校的設定檔
             blob_uri: undefined,
             blob_uri: undefined,
@@ -148,13 +151,28 @@ export default {
             return state.schoolProfile.grades
             return state.schoolProfile.grades
         },
         },
         getClasses: state => {
         getClasses: state => {
-            return state.schoolProfile.classes
+            return state.schoolProfile.school_classes
         }
         }
     },
     },
     mutations: {
     mutations: {
         setSchoolUserList(state, data) {
         setSchoolUserList(state, data) {
             state.schoolUserList = data
             state.schoolUserList = data
         },
         },
+        //基础设置修改区班校数据后,更新vuex和localstorage
+        setSchoolBase(state, data) {
+            //更新localstorage
+            let schoolStr = localStorage.getItem('school_profile')
+            if (schoolStr) {
+                schoolStr = decodeURIComponent(schoolStr, "utf-8")
+                let schoolJson = JSON.parse(schoolStr)
+                schoolJson.school_base = data
+                schoolStr = encodeURIComponent(JSON.stringify(schoolJson), "utf-8")
+                localStorage.setItem('school_profile', schoolStr)
+            }
+            //更新vuex
+            state.schoolProfile.school_base = data
+        },
+
         setUserList(state, data) {
         setUserList(state, data) {
             state.userList = data
             state.userList = data
         },
         },
@@ -175,11 +193,12 @@ export default {
         setSchoolProfile(state, data) {
         setSchoolProfile(state, data) {
             state.schoolProfile.blob_sas = data.blob_sas // 老師在學校的Blob金鑰,讀寫
             state.schoolProfile.blob_sas = data.blob_sas // 老師在學校的Blob金鑰,讀寫
             state.schoolProfile.blob_uri = data.blob_uri // 老師在學校的Blob網址
             state.schoolProfile.blob_uri = data.blob_uri // 老師在學校的Blob網址
-            state.schoolProfile.courses = data.courses // 老師在學校的的個人課程
-            state.schoolProfile.syllabus = data.syllabus // 老師在學校的的個人課綱
-            state.schoolProfile.periods = data.periods // 學制
-            state.schoolProfile.grades = data.grades // 年級
-            state.schoolProfile.classes = data.classes // 課堂
+            state.schoolProfile.school_courses = data.school_courses // 学校排课
+            state.schoolProfile.school_syllabus = data.school_syllabus // 校本课纲
+            state.schoolProfile.school_classes = data.school_classes // 学校班级
+            state.schoolProfile.periods = data.fmtPeriods // 學制
+            state.schoolProfile.grades = data.fmtGrades // 年級
+            state.schoolProfile.school_base = data.school_base // 区班校基础数据
         },
         },
         setStudentProfile(state, data) {
         setStudentProfile(state, data) {
             state.studentProfile.blob_uri = data.blob_uri // 學生在學校的Blob網址
             state.studentProfile.blob_uri = data.blob_uri // 學生在學校的Blob網址
@@ -489,7 +508,7 @@ export default {
             if (addUserlist.length > 0) {
             if (addUserlist.length > 0) {
                 addUserlist.forEach(function (userAdd) {
                 addUserlist.forEach(function (userAdd) {
                     userAdd.status = status
                     userAdd.status = status
-                    userAdd.createDate = Math.round((new Date()).getTime() / 1000)
+                    userAdd.createTime = Math.round((new Date()).getTime() / 1000)
                     schoolUserListNow.push(userAdd)
                     schoolUserListNow.push(userAdd)
                 })
                 })
             }
             }
@@ -507,16 +526,72 @@ export default {
         },
         },
         setSchoolProfile(context, data) {
         setSchoolProfile(context, data) {
             localStorage.setItem('school_profile', encodeURIComponent(JSON.stringify(data),"utf-8"))
             localStorage.setItem('school_profile', encodeURIComponent(JSON.stringify(data),"utf-8"))
+            let fmtPeriods = [];
+            let fmtGrades = [];
+
+            data.school_base.period.forEach( item => {
+                // 學制List
+                fmtPeriods.push({ 'id': item.id, 'name': item.name})
+
+                // 年級List
+                item.grades.forEach( gradeItem => {
+                    fmtGrades.push({ 'periodId': item.id,  'id': gradeItem.id, 'name': gradeItem.name})
+                })
+            })
+            data.fmtPeriods = fmtPeriods
+            data.fmtGrades = fmtGrades
+
             context.commit('setSchoolProfile', data)
             context.commit('setSchoolProfile', data)
         },
         },
         setStudentProfile(context, data) {
         setStudentProfile(context, data) {
             localStorage.setItem('student_profile', encodeURIComponent(JSON.stringify(data),"utf-8"))
             localStorage.setItem('student_profile', encodeURIComponent(JSON.stringify(data),"utf-8"))
             context.commit('setStudentProfile', data)
             context.commit('setStudentProfile', data)
         },
         },
-        checkSchoolProfile(context) {
-            let school_profile = localStorage.getItem('school_profile')
-            if(school_profile){
-                context.commit('setSchoolProfile', JSON.parse(decodeURIComponent(school_profile,"utf-8")))
+        async checkSchoolProfile(context) {
+            let login_schooCode = localStorage.getItem('login_schooCode')
+            let id_token = localStorage.getItem('id_token')
+
+            if(login_schooCode && id_token){
+			    // 輸出暫存
+                let result;
+                
+                let info = {
+                    roles: '',
+                    permissions: ''
+                }
+
+                await apiTools.login.getTeacherSchoolInfo({
+                    id_token: id_token,
+                    school_code: login_schooCode
+                }).then( res => {
+                    // 沒有錯誤的話
+                    if (!res.error) {
+                        // 儲存大雲Token
+                        localStorage.setItem("auth_token", res.auth_token)
+                        context.dispatch('setSchoolProfile', res)
+                        result = res
+                    }
+                }).catch(err => {
+					console.log(err)
+                })
+
+                let authBySchool = jwtDecode(result.auth_token)
+				info.roles = authBySchool.roles
+                info.permissions = authBySchool.permissions == null ? [] : authBySchool.permissions
+                
+                let userInfo = JSON.parse(decodeURIComponent(localStorage.getItem('userInfo'),"utf-8"))
+                userInfo.roles = info.roles
+                userInfo.permissions = info.permissions
+                localStorage.setItem('userInfo', encodeURIComponent(JSON.stringify(userInfo),"utf-8"))
+
+                let userAccess = JSON.parse(decodeURIComponent(localStorage.getItem('userAccess'),"utf-8"))
+                userAccess.roles = info.roles
+                userAccess.permissions = info.permissions
+                localStorage.setItem('userAccess', encodeURIComponent(JSON.stringify(userAccess),"utf-8"))
+
+                return true
+            } else {
+                return false
             }
             }
         },
         },
         checkStudentProfile(context) {
         checkStudentProfile(context) {
@@ -535,27 +610,6 @@ export default {
             localStorage.setItem('login_schooCode', data)
             localStorage.setItem('login_schooCode', data)
             context.commit('setSchoolCode', data)
             context.commit('setSchoolCode', data)
         },
         },
-        updSchoolProfileBasicInfo(context){
-            let login_schooCode = localStorage.getItem('login_schooCode')
-            if(login_schooCode){
-                apiTools.schoolSetting.findSchoolBase(
-                    login_schooCode
-                ).then( res => {
-                        let school_profile = localStorage.getItem('school_profile')
-                        if(school_profile){
-                            let obj_school_profile = JSON.parse(decodeURIComponent(school_profile,"utf-8"))
-
-                            obj_school_profile.periods = res.periods
-                            obj_school_profile.grades = res.grades
-                            obj_school_profile.classes = res.classes
-
-                            localStorage.setItem('school_profile', encodeURIComponent(JSON.stringify(obj_school_profile),"utf-8"))
-                            context.commit('setSchoolProfile', obj_school_profile)
-                        }
-                    }
-                )
-            }
-        },
         getGradeById(context, gradeId) {
         getGradeById(context, gradeId) {
             return new Promise((resolve) => {
             return new Promise((resolve) => {
                 if (typeof context.state.schoolProfile !== 'undefined' && context.state.schoolProfile !== undefined) {
                 if (typeof context.state.schoolProfile !== 'undefined' && context.state.schoolProfile !== undefined) {

+ 3 - 0
TEAMModelOS/ClientApp/src/utils/blobTool.js

@@ -192,6 +192,9 @@ export default class BlobTool {
      * @param {string} filePath 文件url + 容器 之后的路径
      * @param {string} filePath 文件url + 容器 之后的路径
      */
      */
     deleteBlob(filePath) {
     deleteBlob(filePath) {
+        if (filePath) {
+            filePath = filePath.substring(1)
+        }
         return new Promise((r, j) => {
         return new Promise((r, j) => {
             this.containerClient.deleteBlob(filePath).then(
             this.containerClient.deleteBlob(filePath).then(
                 res => {
                 res => {

+ 32 - 2
TEAMModelOS/ClientApp/src/utils/evTools.js

@@ -158,9 +158,39 @@ export default {
 			}catch(e){
 			}catch(e){
 				j(e)
 				j(e)
 			}
 			}
-			
 		})
 		})
-		
+	},
+	
+	
+	/* 获取完整的试卷数据 */
+	getStuPaper(paper){
+		return new Promise(async (r,j) => {
+			let blobHost = JSON.parse(decodeURIComponent(localStorage.student_profile, "utf-8")).blob_uri
+			let splitHost = blobHost.split('/')
+			// 根据试卷的Blob地址 去读取JSON文件
+			let sasString = paper.scope === 'school' ?  await $tools.getSchoolSas(paper.code) : await $tools.getPrivateSas(paper.code)
+			try{
+				let jsonInfo = await $tools.getFile(sasString.url + '/' + paper.code + paper.blob + '/index.json' + sasString.sas)
+				let jsonData = JSON.parse(jsonInfo)
+				// 获取试卷包含的试题数据并包装好
+				if(jsonData.urls && jsonData.urls.length){
+					jsonData.item = []
+					const path = sasString.url + '/' + paper.code + paper.blob
+					jsonData.urls.forEach(async (itemUrl,index) => {
+						// 获取题目JSON并且包装成完整试题对象
+						let itemJson = JSON.parse(await $tools.getFile(path + '/' + itemUrl + sasString.sas))
+						itemJson.exercise.question = itemJson.item[0].question
+						itemJson.exercise.option = itemJson.item[0].option
+						itemJson.exercise.id = itemJson.id 
+						itemJson.exercise.score = jsonData.scoring[index].score
+						jsonData.item.push(itemJson.exercise)
+					})
+				}
+				r(jsonData)
+			}catch(e){
+				j(e)
+			}
+		})
 	},
 	},
 	
 	
 	/* 提取富文本内容中的文本 */
 	/* 提取富文本内容中的文本 */

+ 4 - 4
TEAMModelOS/ClientApp/src/utils/public.js

@@ -353,11 +353,11 @@ export default {
 	/**
 	/**
 	 * 获取个人容器授权
 	 * 获取个人容器授权
 	 */
 	 */
-	getPrivateSas() {
+	getPrivateSas(code) {
 		return new Promise((r, j) => {
 		return new Promise((r, j) => {
 			if (!store.state.privateSas || checkSas(store.state.privateSas.timeout) || store.state.privateSas.name !== store.state.userInfo.TEAMModelId) {
 			if (!store.state.privateSas || checkSas(store.state.privateSas.timeout) || store.state.privateSas.name !== store.state.userInfo.TEAMModelId) {
 				$api.uploadFile.blobSasRCW({
 				$api.uploadFile.blobSasRCW({
-					name: store.state.userInfo.TEAMModelId,
+					name: code || store.state.userInfo.TEAMModelId,
 					role: 'teacher'
 					role: 'teacher'
 				}).then(
 				}).then(
 					(res) => {
 					(res) => {
@@ -381,11 +381,11 @@ export default {
 	/**
 	/**
 	 * 获取学校容器授权
 	 * 获取学校容器授权
 	 */
 	 */
-	getSchoolSas() {
+	getSchoolSas(code) {
 		return new Promise((r, j) => {
 		return new Promise((r, j) => {
 			if (!store.state.schoolSas || checkSas(store.state.schoolSas.timeout)  || store.state.schoolSas.name !== store.state.userInfo.schoolCode) {
 			if (!store.state.schoolSas || checkSas(store.state.schoolSas.timeout)  || store.state.schoolSas.name !== store.state.userInfo.schoolCode) {
 				$api.uploadFile.blobSasRCW({
 				$api.uploadFile.blobSasRCW({
-					name: store.state.userInfo.schoolCode,
+					name: code || store.state.userInfo.schoolCode,
 					role: 'school'
 					role: 'school'
 				}).then(
 				}).then(
 					(res) => {
 					(res) => {

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

@@ -71,20 +71,6 @@
 				// this.isShowMock = true
 				// this.isShowMock = true
                 this.$router.push({ path: '/home/feedback' })
                 this.$router.push({ path: '/home/feedback' })
             },
             },
-            getSchoolBaseInfo() {
-                this.$store.dispatch('schoolBaseInfo/getSchoolBaseData').then(
-                    (res) => {
-                        if (res.code == 2) {
-                            this.$Message.warning('暂无数据!')
-                        } else {
-
-                        }
-                    },
-                    (err) => {
-                        this.$Message.error('API error!')
-                    }
-                )
-            },
             closeMenu() {
             closeMenu() {
                 this.isOpenDrawer = false
                 this.isOpenDrawer = false
             },
             },

+ 12 - 5
TEAMModelOS/ClientApp/src/view/classmgt/ManageClass.vue

@@ -30,7 +30,7 @@
                         <span class="name-header" :style="{background:bgColor[index % 12]}">{{getFirstChart(row.name)}}</span>
                         <span class="name-header" :style="{background:bgColor[index % 12]}">{{getFirstChart(row.name)}}</span>
                     </template>
                     </template>
                     <template slot-scope="{ row,index }" slot="action">
                     <template slot-scope="{ row,index }" slot="action">
-                        <div class="item-tools" v-if="$access.can('admin.*|student-upd')">
+                        <div class="item-tools">
                             <Icon type="md-refresh" size="18" style="cursor:pointer;" title="重置密码" @click="resetPassword(index)"/>
                             <Icon type="md-refresh" size="18" style="cursor:pointer;" title="重置密码" @click="resetPassword(index)"/>
                         </div>
                         </div>
                     </template>
                     </template>
@@ -341,7 +341,7 @@ import { Function } from 'core-js'
                         let startIndex = this.groupNum * i
                         let startIndex = this.groupNum * i
                         if (startIndex + j < stuLen) {
                         if (startIndex + j < stuLen) {
                             this.$set(this.classList[this.curClassIndex].students[startIndex + j], 'groupId', i + 1)
                             this.$set(this.classList[this.curClassIndex].students[startIndex + j], 'groupId', i + 1)
-                            this.$set(this.classList[this.curClassIndex].students[startIndex + j], 'groupName', '组别别名' + (i + 1))
+                            this.$set(this.classList[this.curClassIndex].students[startIndex + j], 'groupName', '第'+ (i + 1)+ '组' )
                         } else {
                         } else {
                             break
                             break
                         }
                         }
@@ -364,7 +364,7 @@ import { Function } from 'core-js'
                     for (let j = 0; j < maxCount; j++) {
                     for (let j = 0; j < maxCount; j++) {
                         if (startIndex + j < stuLen) {
                         if (startIndex + j < stuLen) {
                             this.$set(this.classList[this.curClassIndex].students[startIndex + j], 'groupId', i + 1)
                             this.$set(this.classList[this.curClassIndex].students[startIndex + j], 'groupId', i + 1)
-                            this.$set(this.classList[this.curClassIndex].students[startIndex + j], 'groupName', '组别别名' + (i + 1))
+                            this.$set(this.classList[this.curClassIndex].students[startIndex + j], 'groupName', '第' + (i + 1)+ '组')
                         } else {
                         } else {
                             break
                             break
                         }
                         }
@@ -403,7 +403,7 @@ import { Function } from 'core-js'
                         }
                         }
                     }
                     }
                     this.$set(this.classList[this.curClassIndex].students[index], 'groupId', groupIndex+'')
                     this.$set(this.classList[this.curClassIndex].students[index], 'groupId', groupIndex+'')
-                    this.$set(this.classList[this.curClassIndex].students[index], 'groupName', '组别别名' + groupIndex)
+                    this.$set(this.classList[this.curClassIndex].students[index], 'groupName', '第' + groupIndex + '组')
                     if (record[groupIndex] == maxCount) {
                     if (record[groupIndex] == maxCount) {
                         surplusCount--
                         surplusCount--
                     }
                     }
@@ -425,12 +425,19 @@ import { Function } from 'core-js'
             },
             },
             //导出名单
             //导出名单
             exportStudents() {
             exportStudents() {
-                const params = {
+                /*const params = {
                     title: this.columns.map(i => i.title),
                     title: this.columns.map(i => i.title),
                     key: this.columns.map(i => i.key),
                     key: this.columns.map(i => i.key),
                     data: this.classList[this.curClassIndex].students,
                     data: this.classList[this.curClassIndex].students,
                     autoWidth: true,
                     autoWidth: true,
                     filename: '学生名单'
                     filename: '学生名单'
+                }*/
+                const params = {
+                    title: ['姓名','账号','座号','组别','组名'],
+                    key: ['name','id','no','groupId','groupName'],
+                    data: this.classList[this.curClassIndex].students,
+                    autoWidth: true,
+                    filename: '学生名单'
                 }
                 }
                 excel.export_array_to_excel(params)
                 excel.export_array_to_excel(params)
             },
             },

+ 15 - 12
TEAMModelOS/ClientApp/src/view/evaluation/bank/ExerciseList.vue

@@ -68,7 +68,7 @@
 					<Radio label="createTime">新增时间
 					<Radio label="createTime">新增时间
 						<Icon type="md-arrow-round-down" />
 						<Icon type="md-arrow-round-down" />
 					</Radio>
 					</Radio>
-					<Radio label="usageCount">使用次数
+					<Radio label="useCount">使用次数
 						<Icon type="md-arrow-round-down" />
 						<Icon type="md-arrow-round-down" />
 					</Radio>
 					</Radio>
 				</RadioGroup>
 				</RadioGroup>
@@ -277,10 +277,10 @@
 				}
 				}
 			},
 			},
 			
 			
-			/* 频弹窗切换事件 */
+			/* 频弹窗切换事件 */
 			onVideoModalChange(val) {
 			onVideoModalChange(val) {
 				if (!val) {
 				if (!val) {
-					// this.$refs.audioPlayer.onCloseAudio()
+					this.$refs.videoPlayer.onCloseAudio()
 				}
 				}
 			},
 			},
 			
 			
@@ -305,17 +305,20 @@
 			/** 获取区班校信息 */
 			/** 获取区班校信息 */
 			getSchoolInfo() {
 			getSchoolInfo() {
 				this.dataLoading = true
 				this.dataLoading = true
-				this.$store.dispatch('schoolBaseInfo/getSchoolBaseData').then(res => {
-					console.log(res)
-					this.schoolInfo = JSON.parse(JSON.stringify(res.data))
-					this.schoolCode = res.data.id
+				
+				let schoolBaseInfo = JSON.parse(JSON.stringify(this.$store.state.user.schoolProfile.school_base))
+				if(schoolBaseInfo){
+					this.schoolInfo = schoolBaseInfo
+					this.schoolCode = schoolBaseInfo.id
 					this.userId = this.$store.state.userInfo.TEAMModelId
 					this.userId = this.$store.state.userInfo.TEAMModelId
 					this.filterOrigin = this.isShowSchoolBank ? this.$store.state.userInfo.schoolCode : this.$store.state.userInfo.TEAMModelId
 					this.filterOrigin = this.isShowSchoolBank ? this.$store.state.userInfo.schoolCode : this.$store.state.userInfo.TEAMModelId
-					this.periodList = res.data.period
-					this.gradeList = res.data.period[0].grades
-					this.subjectList = res.data.period[0].subjects
+					this.periodList = schoolBaseInfo.period
+					if(schoolBaseInfo.period.length){
+						this.gradeList = schoolBaseInfo.period[0].grades
+						this.subjectList = schoolBaseInfo.period[0].subjects
+					}
 					this.doFilter()
 					this.doFilter()
-				})
+				}
 			},
 			},
 			
 			
 			
 			
@@ -711,7 +714,7 @@
 					//初始化Blob
 					//初始化Blob
 					let containerClient = new blobTool(sasData.url, sasData.name, sasData.sas , this.curScope)
 					let containerClient = new blobTool(sasData.url, sasData.name, sasData.sas , this.curScope)
 					// 等待blob的返回结果
 					// 等待blob的返回结果
-					containerClient.deleteBlob(path.substring(1)).then(
+					containerClient.deleteBlob(path).then(
 					    (res) => {
 					    (res) => {
 					        r(res)
 					        r(res)
 					    },
 					    },

+ 5 - 6
TEAMModelOS/ClientApp/src/view/evaluation/bank/TestPaperList.vue

@@ -98,9 +98,8 @@
             },
             },
 
 
             onFilterChange(filterParams, findCountParams) {
             onFilterChange(filterParams, findCountParams) {
-
                 this.filterParams = {
                 this.filterParams = {
-                    // '@DESC': this.filterSort,
+                    '@DESC': filterParams.filterSort,
                     'code': filterParams.code,
                     'code': filterParams.code,
 					'scope': filterParams.code === this.$store.state.userInfo.schoolCode ? 'school' : 'private',
 					'scope': filterParams.code === this.$store.state.userInfo.schoolCode ? 'school' : 'private',
                     'periodId': filterParams.periodId[0],
                     'periodId': filterParams.periodId[0],
@@ -303,7 +302,7 @@
              * @param code
              * @param code
              */
              */
             getSubjectName(code) {
             getSubjectName(code) {
-                return this.$jsFn.getSubjectName(this.$store.state.schoolBaseInfo.schoolBaseInfo, code)
+                return this.$jsFn.getSubjectName(JSON.parse(JSON.stringify(this.$store.state.user.schoolProfile.school_base)), code)
             },
             },
 
 
             /**
             /**
@@ -311,7 +310,7 @@
              * @param code
              * @param code
              */
              */
             getPeriodName(code) {
             getPeriodName(code) {
-                return this.$jsFn.getPeriod(this.$store.state.schoolBaseInfo.schoolBaseInfo, code).name
+                return this.$jsFn.getPeriod(JSON.parse(JSON.stringify(this.$store.state.user.schoolProfile.school_base)), code).name
             },
             },
 
 
             /**
             /**
@@ -319,7 +318,7 @@
              * @param code
              * @param code
              */
              */
             getGradeName(periodId,code) {
             getGradeName(periodId,code) {
-                return this.$store.state.schoolBaseInfo.schoolBaseInfo.period.filter(i => i.id === periodId)[0].grades.filter(j => j.id === code)[0].name
+                return this.$store.state.user.schoolProfile.school_base.period.filter(i => i.id === periodId)[0].grades.filter(j => j.id === code)[0].name
             },
             },
 
 
             /**
             /**
@@ -333,7 +332,7 @@
 
 
         },
         },
         mounted() {
         mounted() {
-            this.schoolInfo = this.$store.state.schoolBaseInfo.schoolBaseInfo
+            this.schoolInfo = JSON.parse(JSON.stringify(this.$store.state.user.schoolProfile.school_base))
             this.periodList = this.schoolInfo.period
             this.periodList = this.schoolInfo.period
         },
         },
         computed: {
         computed: {

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

@@ -86,7 +86,6 @@
 		watch: {
 		watch: {
 			children:{
 			children:{
 				handler(n){
 				handler(n){
-					console.log(n)
 					this.$nextTick(()=>{
 					this.$nextTick(()=>{
 						window.MathJax.Hub.Queue(["Typeset", MathJax.Hub]);
 						window.MathJax.Hub.Queue(["Typeset", MathJax.Hub]);
 					})
 					})

+ 13 - 11
TEAMModelOS/ClientApp/src/view/evaluation/components/BaseCreateChild.vue

@@ -83,8 +83,10 @@
 		<!-- 关联内容弹窗 -->
 		<!-- 关联内容弹窗 -->
 		<Modal v-model="isRelatedContent" width="880" footer-hide class="relate-modal related-modal">
 		<Modal v-model="isRelatedContent" width="880" footer-hide class="relate-modal related-modal">
 			<div class="modal-header" slot="header">内容关联</div>
 			<div class="modal-header" slot="header">内容关联</div>
-			<ChooseContent :showSyllabus="isFalse" :showOther="isFalse" :showQuestion="isFalse" v-if="isRelatedContent"
-			 @on-select-file="onSelectFile" @on-cancel-file="onSelectFile"></ChooseContent>
+			<ChooseContent :showSyllabus="isFalse"
+			               :showOther="isFalse"
+			               :showQuestion="isFalse"
+			               @on-file-change="onSelectFile"></ChooseContent>
 
 
 			<Button class="modal-btn" :loading="isLoading" @click="onConfirmRelate">确认</Button>
 			<Button class="modal-btn" :loading="isLoading" @click="onConfirmRelate">确认</Button>
 		</Modal>
 		</Modal>
@@ -113,7 +115,7 @@
 	import BaseSubjective from '@/view/evaluation/types/BaseSubjective.vue'
 	import BaseSubjective from '@/view/evaluation/types/BaseSubjective.vue'
 	import BasePoints from '@/view/evaluation/components/BasePoints'
 	import BasePoints from '@/view/evaluation/components/BasePoints'
 	import BaseRepair from '@/view/evaluation/components/BaseRepair'
 	import BaseRepair from '@/view/evaluation/components/BaseRepair'
-	import ChooseContent from '@/components/learnactivity/ChooseContent'
+	import ChooseContent from '@/components/learnactivity/NewChooseContent'
 	import E from '@/utils/wangEditor.js'
 	import E from '@/utils/wangEditor.js'
 	// 默认创建题目模板
 	// 默认创建题目模板
 	const defaultExercise = {
 	const defaultExercise = {
@@ -200,14 +202,14 @@
 		},
 		},
 		methods: {
 		methods: {
 			getSchoolInfo() {
 			getSchoolInfo() {
-				this.$store.dispatch('schoolBaseInfo/getSchoolBaseData').then(res => {
-					this.schoolInfo = res.data
-					if (res.data.period.length) {
-						this.gradeList = res.data.period[0].grades
-						this.subjectList = res.data.period[0].subjects
+				let schoolBaseInfo = JSON.parse(JSON.stringify(this.$store.state.user.schoolProfile.school_base))
+				if(schoolBaseInfo){
+					this.schoolInfo = schoolBaseInfo
+					if(schoolBaseInfo.period.length){
+						this.gradeList = schoolBaseInfo.period[0].grades
+						this.subjectList = schoolBaseInfo.period[0].subjects
 					}
 					}
-
-				})
+				}
 			},
 			},
 			
 			
 			/* 音频弹窗切换事件 */
 			/* 音频弹窗切换事件 */
@@ -471,7 +473,7 @@
 
 
 			// 渲染编辑习题内容回显
 			// 渲染编辑习题内容回显
 			async renderExercise(editItem) {
 			async renderExercise(editItem) {
-				let schoolInfo = this.$store.state.schoolBaseInfo.schoolBaseInfo
+				let schoolInfo = JSON.parse(JSON.stringify(this.$store.state.user.schoolProfile.school_base))
 				this.isEdit = true
 				this.isEdit = true
 				this.exersicesDiff = editItem.level.toString() || '0'
 				this.exersicesDiff = editItem.level.toString() || '0'
 				this.exerciseScope = editItem.code === this.$store.state.userInfo.TEAMModelId ? 0 : 1
 				this.exerciseScope = editItem.code === this.$store.state.userInfo.TEAMModelId ? 0 : 1

+ 14 - 11
TEAMModelOS/ClientApp/src/view/evaluation/components/BaseEditExercise.vue

@@ -156,7 +156,6 @@
 	import BaseRepair from '@/view/evaluation/components/BaseRepair'
 	import BaseRepair from '@/view/evaluation/components/BaseRepair'
 	import BaseCreateChild from '@/view/evaluation/components/BaseCreateChild'
 	import BaseCreateChild from '@/view/evaluation/components/BaseCreateChild'
 	import BaseChildList from '@/view/evaluation/components/BaseChildList'
 	import BaseChildList from '@/view/evaluation/components/BaseChildList'
-	import ChooseContent from '@/components/learnactivity/ChooseContent'
 	import E from '@/utils/wangEditor.js'
 	import E from '@/utils/wangEditor.js'
 
 
 	export default {
 	export default {
@@ -172,8 +171,7 @@
 			BasePoints,
 			BasePoints,
 			BaseCreateChild,
 			BaseCreateChild,
 			BaseChildList,
 			BaseChildList,
-			BaseRepair,
-			ChooseContent
+			BaseRepair
 		},
 		},
 		data() {
 		data() {
 			return {
 			return {
@@ -184,7 +182,9 @@
 				selectPointsModal: false,
 				selectPointsModal: false,
 				isEdit: false,
 				isEdit: false,
 				editInfo: null,
 				editInfo: null,
-				schoolInfo: {},
+				schoolInfo: {
+					period:[]
+				},
 				exersicesType: null,
 				exersicesType: null,
 				exerciseField: 0,
 				exerciseField: 0,
 				exercisePeriod: 0,
 				exercisePeriod: 0,
@@ -224,12 +224,14 @@
 		},
 		},
 		methods: {
 		methods: {
 			getSchoolInfo() {
 			getSchoolInfo() {
-				this.$store.dispatch('schoolBaseInfo/getSchoolBaseData').then(res => {
-					console.log(res)
-					this.schoolInfo = res.data
-					this.gradeList = res.data.period[0].grades
-					this.subjectList = res.data.period[0].subjects
-				})
+				let schoolBaseInfo = JSON.parse(JSON.stringify(this.$store.state.user.schoolProfile.school_base))
+				if(schoolBaseInfo){
+					this.schoolInfo = schoolBaseInfo
+					if(schoolBaseInfo.period.length){
+						this.gradeList = schoolBaseInfo.period[0].grades
+						this.subjectList = schoolBaseInfo.period[0].subjects
+					}
+				}
 			},
 			},
 			
 			
 			/* 音频弹窗切换事件 */
 			/* 音频弹窗切换事件 */
@@ -460,6 +462,7 @@
 			},
 			},
 
 
 			onPeriodChange(val) {
 			onPeriodChange(val) {
+				if(!val) return
 				console.log(this.schoolInfo)
 				console.log(this.schoolInfo)
 				console.log(val)				
 				console.log(val)				
 				this.gradeList = this.schoolInfo.period[val].grades
 				this.gradeList = this.schoolInfo.period[val].grades
@@ -581,7 +584,7 @@
 			async renderExercise(editItem) {
 			async renderExercise(editItem) {
 				console.log(editItem)
 				console.log(editItem)
 				this.editInfo = editItem
 				this.editInfo = editItem
-				let schoolInfo = this.$store.state.schoolBaseInfo.schoolBaseInfo
+				let schoolInfo = JSON.parse(JSON.stringify(this.$store.state.user.schoolProfile.school_base)) 
 				this.isEdit = true
 				this.isEdit = true
 				this.exersicesDiff = editItem.level.toString() || '0'
 				this.exersicesDiff = editItem.level.toString() || '0'
 				this.exerciseScope = editItem.scope === 'private' ? 0 : 1
 				this.exerciseScope = editItem.scope === 'private' ? 0 : 1

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

@@ -58,7 +58,7 @@
 							</div>
 							</div>
 						</div>
 						</div>
 					</div>
 					</div>
-					<div class="item-btn-toggle" @click.stop>
+					<div class="item-btn-toggle" @click.stop v-show="isShowTools" >
 						<template>
 						<template>
 							<InputNumber :max="item.score + surPlusScore" :min="0" v-model="item.score" style="display: inline-block ;width: 60px;margin-right: 10px;height: 30px;"
 							<InputNumber :max="item.score + surPlusScore" :min="0" v-model="item.score" style="display: inline-block ;width: 60px;margin-right: 10px;height: 30px;"
 							 @click.stop></InputNumber>
 							 @click.stop></InputNumber>
@@ -301,11 +301,11 @@
 					this.$refs.audioPlayer.onCloseAudio()
 					this.$refs.audioPlayer.onCloseAudio()
 				}
 				}
 			},
 			},
-
-			/* 频弹窗切换事件 */
+			
+			/* 频弹窗切换事件 */
 			onVideoModalChange(val) {
 			onVideoModalChange(val) {
 				if (!val) {
 				if (!val) {
-					// this.$refs.audioPlayer.onCloseAudio()
+					this.$refs.videoPlayer.onCloseAudio()
 				}
 				}
 			},
 			},
 
 

+ 89 - 84
TEAMModelOS/ClientApp/src/view/evaluation/components/BaseFilter.vue

@@ -32,7 +32,7 @@
             <span class="filter-title">排序:</span>
             <span class="filter-title">排序:</span>
             <RadioGroup v-model="filterSort" type="button" @on-change="filterSortChange">
             <RadioGroup v-model="filterSort" type="button" @on-change="filterSortChange">
                 <Radio label="createDate">新增时间<Icon type="md-arrow-round-down" /></Radio>
                 <Radio label="createDate">新增时间<Icon type="md-arrow-round-down" /></Radio>
-                <Radio label="usageCount">使用次数<Icon type="md-arrow-round-down" /></Radio>
+                <Radio label="useCount">使用次数<Icon type="md-arrow-round-down" /></Radio>
             </RadioGroup>
             </RadioGroup>
         </div>
         </div>
     </div>
     </div>
@@ -88,8 +88,8 @@
             }
             }
         },
         },
         created() {
         created() {
-            this.getSchoolInfo()
 			this.isShowSchoolBank = this.$route.name === 'schoolBank'
 			this.isShowSchoolBank = this.$route.name === 'schoolBank'
+			this.getSchoolInfo()
 			this.$EventBus.$on('showSchoolBank',(val)=> {
 			this.$EventBus.$on('showSchoolBank',(val)=> {
 				if(val){
 				if(val){
 					this.isShowSchoolBank = val
 					this.isShowSchoolBank = val
@@ -102,22 +102,26 @@
         methods: {
         methods: {
             /** 获取区班校信息 */
             /** 获取区班校信息 */
             getSchoolInfo() {
             getSchoolInfo() {
-                this.$store.dispatch('schoolBaseInfo/getSchoolBaseData').then(res => {
-                    this.schoolInfo = JSON.parse(JSON.stringify(res.data))
-                    this.schoolCode = res.data.id
-                    this.userId = this.$store.state.userInfo.TEAMModelId
-                    this.filterOrigin = this.$route.name === 'personalBank' ? this.$store.state.userInfo.TEAMModelId : this.$store.state.userInfo.schoolCode
-                    this.periodList = res.data.period
-                    this.gradeList = res.data.period[0].grades
-                    this.subjectList = res.data.period[0].subjects
-                    this.doFilter()
-                })
+                let schoolBaseInfo = JSON.parse(JSON.stringify(this.$store.state.user.schoolProfile.school_base))
+                if(schoolBaseInfo){
+                	this.schoolInfo = schoolBaseInfo
+                	this.schoolCode = schoolBaseInfo.id
+                	this.userId = this.$store.state.userInfo.TEAMModelId
+                	this.filterOrigin = this.isShowSchoolBank ? this.$store.state.userInfo.schoolCode : this.$store.state.userInfo.TEAMModelId
+                	this.periodList = schoolBaseInfo.period
+                	if(schoolBaseInfo.period.length){
+                		this.gradeList = schoolBaseInfo.period[0].grades
+                		this.subjectList = schoolBaseInfo.period[0].subjects
+                	}
+                	this.doFilter()
+                }
             },
             },
 
 
             /** 执行筛选条件获取数据 */
             /** 执行筛选条件获取数据 */
             doFilter() {
             doFilter() {
                 /** 定义查询接口的参数规格 */
                 /** 定义查询接口的参数规格 */
                 this.filterParams = {
                 this.filterParams = {
+					'filterSort': this.filterSort,
                     'code': this.filterOrigin,
                     'code': this.filterOrigin,
                     'periodId': [this.periodList[this.filterPeriod].id],
                     'periodId': [this.periodList[this.filterPeriod].id],
                     'gradeIds': this.deleteFalse(this.filterGrade),
                     'gradeIds': this.deleteFalse(this.filterGrade),
@@ -157,79 +161,80 @@
                 this.doFilter()
                 this.doFilter()
             },
             },
 
 
-            /**
-             * 筛选年级
-             * @param val
-             */
-            filterGradeChange(val) {
-                if (val !== [false] && val.indexOf(false) === 0) {
-                    this.filterGrade.splice(val.indexOf(false), 1)
-                } else if (val.indexOf(false) > 0) {
-                    this.filterGrade = [false]
-                }
-                this.doFilter()
-            },
 
 
-            /**
-             * 筛选科目
-             * @param val
-             */
-            filterSubjectChange(val) {
-                if (val !== [false] && val.indexOf(false) === 0) {
-                   this.filterSubject.splice(val.indexOf(false), 1)
-                } else if (val.indexOf(false) > 0) {
-                   this.filterSubject = [false]
-                }
-                this.doFilter()
-            },
-
-            /**
-             * 根据题库加载题目
-             * @param val
-             */
-            filterOriginChange(origin) {
-                this.filterOrigin = origin
-                this.doFilter()
-            },
-
-            /**
-             * 筛选题型
-             * @param val
-             */
-            filterTypeChange(val) {
-                if (val !== ['all'] && val.indexOf('all') === 0) {
-                    this.filterType.splice(val.indexOf('all'), 1)
-                } else if (val.indexOf('all') > 0) {
-                    this.filterType = ['all']
-                }
-                this.doFilter()
-            },
-
-            /**
-             * 筛选难度
-             * @param val
-             */
-            filterDiffChange(val) {
-                if (val !== ['all'] && val.indexOf('all') === 0) {
-                    this.filterDiff.splice(val.indexOf('all'), 1)
-                } else if (val.indexOf('all') > 0) {
-                    this.filterDiff = ['all']
-                }
-                this.doFilter()
-            },
-
-            /**
-             * 筛选认知层次
-             * @param val
-             */
-            filterFieldChange(val) {
-                if (val !== ['all'] && val.indexOf('all') === 0) {
-                    this.filterField.splice(val.indexOf('all'), 1)
-                } else if (val.indexOf('all') > 0) {
-                    this.filterField = ['all']
-                }
-                this.doFilter(1)
-            },
+			/**
+			 * 筛选年级
+			 * @param val
+			 */
+			filterGradeChange(val) {
+				if (val.length > 1 && val.indexOf(false) === 0) {
+					this.filterGrade.splice(val.indexOf(false), 1)
+				} else if (val.indexOf(false) > -1 || val.length === 0) {
+					this.filterGrade = [false]
+				}
+				this.doFilter()
+			},
+
+			/**
+			 * 筛选科目
+			 * @param val
+			 */
+			filterSubjectChange(val) {
+				if (val.length > 1 && val.indexOf(false) === 0) {
+					this.filterSubject.splice(val.indexOf(false), 1)
+				} else if (val.indexOf(false) > -1 || val.length === 0) {
+					this.filterSubject = [false]
+				}
+				this.doFilter()
+			},
+
+			/**
+			 * 根据题库加载题目
+			 * @param val
+			 */
+			filterOriginChange(origin) {
+				this.filterOrigin = origin
+				this.doFilter()
+			},
+
+			/**
+			 * 筛选题型
+			 * @param val
+			 */
+			filterTypeChange(val) {
+				if (val.length > 1 && val.indexOf('all') === 0) {
+					this.filterType.splice(val.indexOf('all'), 1)
+				} else if (val.indexOf('all') > -1 || val.length === 0) {
+					this.filterType = ['all']
+				}
+				this.doFilter()
+			},
+
+			/**
+			 * 筛选难度
+			 * @param val
+			 */
+			filterDiffChange(val) {
+				if (val.length > 1 && val.indexOf('all') === 0) {
+					this.filterDiff.splice(val.indexOf('all'), 1)
+				} else if (val.indexOf('all') > -1 || val.length === 0) {
+					this.filterDiff = ['all']
+				}
+				this.doFilter()
+			},
+
+			/**
+			 * 筛选认知层次
+			 * @param val
+			 */
+			filterFieldChange(val) {
+				if (val.length > 1 && val.indexOf('all') === 0) {
+					this.filterField.splice(val.indexOf('all'), 1)
+				} else if (val.indexOf('all') > -1 || val.length === 0) {
+					this.filterField = ['all']
+				}
+				this.doFilter()
+			},
 
 
             /**
             /**
              * 排序条件更换
              * 排序条件更换

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

@@ -42,16 +42,15 @@
 		    <ChooseContent :showSyllabus="isFalse"
 		    <ChooseContent :showSyllabus="isFalse"
 		                   :showOther="isFalse"
 		                   :showOther="isFalse"
 		                   :showQuestion="isFalse"
 		                   :showQuestion="isFalse"
-						   v-if="isRelatedContent"
-		                   @on-select-file="onSelectFile"
-		                   @on-cancel-file="onSelectFile"></ChooseContent>
+						   ref="chooseContentRef"
+		                   @on-file-change="onSelectFile"></ChooseContent>
 		
 		
 		    <Button class="modal-btn" :loading="isLoading" @click="onConfirmRelate">确认</Button>
 		    <Button class="modal-btn" :loading="isLoading" @click="onConfirmRelate">确认</Button>
 		</Modal>
 		</Modal>
 	</div>
 	</div>
 </template>
 </template>
 <script>
 <script>
-	import ChooseContent from '@/components/learnactivity/ChooseContent'
+	import ChooseContent from '@/components/learnactivity/NewChooseContent'
 	export default {
 	export default {
 		components: { ChooseContent },
 		components: { ChooseContent },
 		props: {
 		props: {
@@ -70,7 +69,9 @@
 				relateFileList:[]
 				relateFileList:[]
 			}
 			}
 		},
 		},
-		created() {},
+		created() {
+			
+		},
 		methods: {
 		methods: {
 			onAddLink(type){
 			onAddLink(type){
 				let addObj = {
 				let addObj = {
@@ -97,7 +98,7 @@
 			onConfirmRelate() {
 			onConfirmRelate() {
 				this.relateFileList.forEach(i => {
 				this.relateFileList.forEach(i => {
 					this.datas.push({
 					this.datas.push({
-						blobUrl:i.blobUrl,
+						blobUrl:i.url,
 						type:'file'
 						type:'file'
 					})
 					})
 				})
 				})
@@ -127,7 +128,9 @@
 		},
 		},
 
 
 		mounted() {
 		mounted() {
-
+			if(this.$refs.chooseContentRef){
+				this.$refs.chooseContentRef.clickTab('content')
+			}
 		},
 		},
 
 
 		watch: {
 		watch: {

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

@@ -127,15 +127,6 @@
 			</div>
 			</div>
 		</Modal>
 		</Modal>
 
 
-		<!-- 关联内容弹窗 -->
-		<Modal v-model="isRelatedContent" width="880" footer-hide class="relate-modal related-modal">
-			<div class="modal-header" slot="header">内容关联</div>
-			<!-- <ChooseContent :showSyllabus="isFalse" :showOther="isFalse" :showQuestion="isFalse" v-if="isRelatedContent"
-			 @on-select-file="onSelectFile" @on-cancel-file="onSelectFile"></ChooseContent> -->
-
-			<Button class="modal-btn" :loading="isLoading" @click="onConfirmRelate">确认</Button>
-		</Modal>
-
 		<!-- 添加小题弹窗 -->
 		<!-- 添加小题弹窗 -->
 		<Modal v-model="addComposeChildModal" width="1080" footer-hide class="">
 		<Modal v-model="addComposeChildModal" width="1080" footer-hide class="">
 			<div class="modal-header" slot="header">添加小题</div>
 			<div class="modal-header" slot="header">添加小题</div>
@@ -168,7 +159,6 @@
 	import BasePoints from '@/view/evaluation/components/BasePoints'
 	import BasePoints from '@/view/evaluation/components/BasePoints'
 	import BaseRepair from '@/view/evaluation/components/BaseRepair'
 	import BaseRepair from '@/view/evaluation/components/BaseRepair'
 	import BaseCreateChild from '@/view/evaluation/components/BaseCreateChild'
 	import BaseCreateChild from '@/view/evaluation/components/BaseCreateChild'
-	import ChooseContent from '@/components/learnactivity/ChooseContent'
 	import E from '@/utils/wangEditor.js'
 	import E from '@/utils/wangEditor.js'
 	// 默认创建题目模板
 	// 默认创建题目模板
 	const defaultExercise = {
 	const defaultExercise = {
@@ -190,7 +180,6 @@
 			BaseCompose,
 			BaseCompose,
 			BasePoints,
 			BasePoints,
 			BaseRepair,
 			BaseRepair,
-			ChooseContent,
 			BaseCreateChild
 			BaseCreateChild
 		},
 		},
 		data() {
 		data() {
@@ -246,11 +235,14 @@
 		},
 		},
 		methods: {
 		methods: {
 			getSchoolInfo() {
 			getSchoolInfo() {
-				this.$store.dispatch('schoolBaseInfo/getSchoolBaseData').then(res => {
-					this.schoolInfo = res.data
-					this.gradeList = res.data.period[0].grades
-					this.subjectList = res.data.period[0].subjects
-				})
+				let schoolBaseInfo = JSON.parse(JSON.stringify(this.$store.state.user.schoolProfile.school_base))
+				if(schoolBaseInfo){
+					this.schoolInfo = schoolBaseInfo
+					if(schoolBaseInfo.period.length){
+						this.gradeList = schoolBaseInfo.period[0].grades
+						this.subjectList = schoolBaseInfo.period[0].subjects
+					}
+				}
 			},
 			},
 
 
 			/* 音频弹窗切换事件 */
 			/* 音频弹窗切换事件 */

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

@@ -320,18 +320,10 @@
 			/** 获取当前学校基础数据 */
 			/** 获取当前学校基础数据 */
 			getSchoolBaseInfo() {
 			getSchoolBaseInfo() {
 				return new Promise((r, j) => {
 				return new Promise((r, j) => {
-					this.$store.dispatch('schoolBaseInfo/getSchoolBaseData').then(
-						(res) => {
-							if (res.code == 2) {
-								alert('数据为空!')
-							} else {
-								r(res.data)
-							}
-						},
-						(err) => {
-							this.$Message.error('API error!')
-						}
-					)
+					let schoolBaseInfo = JSON.parse(JSON.stringify(this.$store.state.user.schoolProfile.school_base))
+					if(schoolBaseInfo){
+						r(schoolBaseInfo)
+					}
 				})
 				})
 
 
 			},
 			},

+ 3 - 2
TEAMModelOS/ClientApp/src/view/evaluation/index/TestPaper.vue

@@ -13,7 +13,7 @@
 				</div> -->
 				</div> -->
 				<div class="paper-body">
 				<div class="paper-body">
 					<!-- 试卷基础信息 -->
 					<!-- 试卷基础信息 -->
-					<div class="paper-base-info" v-show="isShowBaseInfo">
+					<div class="paper-base-info">
 						<div style="display: flex;">
 						<div style="display: flex;">
 							<div class="paper-info-items">
 							<div class="paper-info-items">
 								<span class="base-info-item">试卷总分:<span class="analysis-info" style="cursor: pointer;" @click="isSetScore = !isSetScore">{{ paperInfo.score }}</span>分</span>
 								<span class="base-info-item">试卷总分:<span class="analysis-info" style="cursor: pointer;" @click="isSetScore = !isSetScore">{{ paperInfo.score }}</span>分</span>
@@ -24,13 +24,14 @@
 								<span class="base-info-item">题量:<span class="analysis-info">{{ paperInfo.item ? paperInfo.item.length : 0 }}</span></span>
 								<span class="base-info-item">题量:<span class="analysis-info">{{ paperInfo.item ? paperInfo.item.length : 0 }}</span></span>
 							</div>
 							</div>
 						</div>
 						</div>
-						<div>
+						<div  v-show="isShowBaseInfo">
 							<Button class="base-info-btn" type="info" @click="onHandleToggle" v-show="paperInfo.item.length && !isShowAnalysis">{{ isAllOpen ? '全部折叠' : '全部展开'}}</Button>
 							<Button class="base-info-btn" type="info" @click="onHandleToggle" v-show="paperInfo.item.length && !isShowAnalysis">{{ isAllOpen ? '全部折叠' : '全部展开'}}</Button>
 							<Button class="base-info-btn" type="info" @click="onSetScoreByType" v-show="paperInfo.item.length && !isShowAnalysis">题型配分</Button>
 							<Button class="base-info-btn" type="info" @click="onSetScoreByType" v-show="paperInfo.item.length && !isShowAnalysis">题型配分</Button>
 							<Button class="base-info-btn" type="info" @click="onCleanPaper" v-show="paperInfo.item.length && !isShowAnalysis">清空试题</Button>
 							<Button class="base-info-btn" type="info" @click="onCleanPaper" v-show="paperInfo.item.length && !isShowAnalysis">清空试题</Button>
 							<Button class="base-info-btn" type="info" @click="onViewModelChange" v-show="paperInfo.item.length && !isShowAnalysis">{{ `依${ viewModel === 'type' ? '顺序' : '题型' }排列` }}</Button>
 							<Button class="base-info-btn" type="info" @click="onViewModelChange" v-show="paperInfo.item.length && !isShowAnalysis">{{ `依${ viewModel === 'type' ? '顺序' : '题型' }排列` }}</Button>
 							<Button class="base-info-btn" type="info" @click="isShowAnalysis = !isShowAnalysis" v-show="paperInfo.item.length">{{ isShowAnalysis ? '试卷详情' : '试卷分析'}}</Button>
 							<Button class="base-info-btn" type="info" @click="isShowAnalysis = !isShowAnalysis" v-show="paperInfo.item.length">{{ isShowAnalysis ? '试卷详情' : '试卷分析'}}</Button>
 						</div>
 						</div>
+						<div  v-show="!isShowBaseInfo"></div>
 					</div>
 					</div>
 
 
 					<!-- 试卷头部信息 -->
 					<!-- 试卷头部信息 -->

+ 41 - 30
TEAMModelOS/ClientApp/src/view/evaluation/types/BaseCompletion.vue

@@ -126,37 +126,37 @@
 				this.stemContent = html
 				this.stemContent = html
 				
 				
 				// 获取修改后的下划线列表与之前的内容进行对比
 				// 获取修改后的下划线列表与之前的内容进行对比
-			// 	let linesArr = Array.prototype.slice.call(document.getElementById('completionEditor').getElementsByClassName('complete-line'))
-			// 	let dataSetArr = linesArr.map((item, index) => index)
-			// 	this.linesIndexArr = JSON.parse(JSON.stringify(this.linesIndexArr))
+				let linesArr = Array.prototype.slice.call(document.getElementById('completionEditor').getElementsByClassName('complete-line'))
+				let dataSetArr = linesArr.map((item, index) => index)
+				this.linesIndexArr = JSON.parse(JSON.stringify(this.linesIndexArr))
 			
 			
-			// 	// 如果是删除了下划线则删除对应选项输入框
-			// 	if (this.linesIndexArr.length > dataSetArr.length) {
-			// 	    Array.prototype.diff = function(a) {
-			// 	        return this.filter(function(i) { return a.indexOf(i) < 0 })
-			// 	    }
-			// 	    let deleteIndexArr = this.linesIndexArr.diff(dataSetArr) // 获取要删除的选项下标
-			// 	    let optionsArr = Array.prototype.slice.call(document.getElementsByClassName('editor-wrap')) // 获取到所有的选项DOM
-			// 		console.log(deleteIndexArr)
-			// 	    // 对指定选项进行删除操作
-			// 	    this.$nextTick(() => {
-			// 	        deleteIndexArr.forEach(item => {
-			// 	            let deleteDom = document.getElementsByClassName('editor-wrap')[item - 1]
-			// 	            this.optionsIndexArr.splice(this.optionsIndexArr.indexOf(deleteDom), 1)
-			// 	            this.optionsContent.splice(item, 1)
-			// 	            optionsArr.splice(item, 1)
-			// 	        })
-			// 			console.log('删除后的选项')
-			// 			console.log(this.optionsContent)
-			// 	    })
-			// 	}
-			// 	this.linesIndexArr = [...dataSetArr]
-			// 	// 重新渲染下划线的下标
-			// 	linesArr.forEach((item, index) => {
-			// 	    let numCircle = '&#93' + (parseInt(index) + 12) + ''
-			// 	    item.innerHTML = numCircle
-			// 	    item.setAttribute('data-index', index)
-			// 	})
+				// 如果是删除了下划线则删除对应选项输入框
+				if (this.linesIndexArr.length > dataSetArr.length) {
+				    Array.prototype.diff = function(a) {
+				        return this.filter(function(i) { return a.indexOf(i) < 0 })
+				    }
+				    let deleteIndexArr = this.linesIndexArr.diff(dataSetArr) // 获取要删除的选项下标
+				    let optionsArr = Array.prototype.slice.call(document.getElementsByClassName('editor-wrap')) // 获取到所有的选项DOM
+					console.log(deleteIndexArr)
+				    // 对指定选项进行删除操作
+				    this.$nextTick(() => {
+				        deleteIndexArr.forEach(item => {
+				            let deleteDom = document.getElementsByClassName('editor-wrap')[item - 1]
+				            this.optionsIndexArr.splice(this.optionsIndexArr.indexOf(deleteDom), 1)
+				            this.optionsContent.splice(item, 1)
+				            optionsArr.splice(item, 1)
+				        })
+						console.log('删除后的选项')
+						console.log(this.optionsContent)
+				    })
+				}
+				this.linesIndexArr = [...dataSetArr]
+				// 重新渲染下划线的下标
+				linesArr.forEach((item, index) => {
+				    let numCircle = '&#93' + (parseInt(index) + 12) + ''
+				    item.innerHTML = numCircle
+				    item.setAttribute('data-index', index)
+				})
 			}
 			}
 
 
         },
         },
@@ -176,6 +176,17 @@
 			completionEditor.customConfig.onblur = function () {
 			completionEditor.customConfig.onblur = function () {
 				that.isStemFocus = false
 				that.isStemFocus = false
 			}
 			}
+			
+			completionEditor.customConfig.onVideoWarning = (text) => {
+				this.$Message.warning(text)
+			},
+			
+			// 选择视频文件后的上传Blob操作
+			completionEditor.customConfig.onVideoSelected = async (file) => {
+					this.$tools.doUploadVideo(this,file,completionEditor)
+			},
+			
+			
             completionEditor.create()
             completionEditor.create()
 
 
             this.stemEditor = completionEditor
             this.stemEditor = completionEditor

+ 10 - 0
TEAMModelOS/ClientApp/src/view/evaluation/types/BaseCompose.vue

@@ -35,6 +35,16 @@
 			stemEditor.customConfig.onchange = (html) => {
 			stemEditor.customConfig.onchange = (html) => {
 				this.stemContent = html
 				this.stemContent = html
 			}
 			}
+			
+			stemEditor.customConfig.onVideoWarning = (text) => {
+				this.$Message.warning(text)
+			},
+			
+			// 选择视频文件后的上传Blob操作
+			stemEditor.customConfig.onVideoSelected = async (file) => {
+					this.$tools.doUploadVideo(this,file,stemEditor)
+			},
+			
 			stemEditor.create()
 			stemEditor.create()
 			this.stemEditor = stemEditor
 			this.stemEditor = stemEditor
 			
 			

+ 10 - 0
TEAMModelOS/ClientApp/src/view/evaluation/types/BaseJudge.vue

@@ -43,6 +43,16 @@
 			stemEditor.customConfig.onchange = (html) => {
 			stemEditor.customConfig.onchange = (html) => {
 				this.stemContent = html
 				this.stemContent = html
 			}
 			}
+			stemEditor.customConfig.onVideoWarning = (text) => {
+				this.$Message.warning(text)
+			},
+			
+			// 选择视频文件后的上传Blob操作
+			stemEditor.customConfig.onVideoSelected = async (file) => {
+					this.$tools.doUploadVideo(this,file,stemEditor)
+			},
+			
+			
 			stemEditor.create()
 			stemEditor.create()
 			this.stemEditor = stemEditor
 			this.stemEditor = stemEditor
 			
 			

+ 13 - 0
TEAMModelOS/ClientApp/src/view/evaluation/types/BaseMultiple.vue

@@ -63,6 +63,9 @@
                             }
                             }
                         }
                         }
                     }
                     }
+					editor.customConfig.onVideoWarning = (text) => {
+						this.$Message.warning(text)
+					},
                     editor.customConfig.onchange = (html) => {
                     editor.customConfig.onchange = (html) => {
                         let key = String.fromCharCode(64 + parseInt(i + 1))
                         let key = String.fromCharCode(64 + parseInt(i + 1))
                         let codeArr = this.optionsContent.map(item => item.code)
                         let codeArr = this.optionsContent.map(item => item.code)
@@ -175,6 +178,16 @@
             stemEditor.customConfig.onchange = (html) => {
             stemEditor.customConfig.onchange = (html) => {
                 this.stemContent = html
                 this.stemContent = html
             }
             }
+			
+			stemEditor.customConfig.onVideoWarning = (text) => {
+				this.$Message.warning(text)
+			},
+			
+			// 选择视频文件后的上传Blob操作
+			stemEditor.customConfig.onVideoSelected = async (file) => {
+					this.$tools.doUploadVideo(this,file,stemEditor)
+			},
+			
             stemEditor.create()
             stemEditor.create()
             this.stemEditor = stemEditor
             this.stemEditor = stemEditor
             // 初始化选项编辑器
             // 初始化选项编辑器

+ 9 - 0
TEAMModelOS/ClientApp/src/view/evaluation/types/BaseSubjective.vue

@@ -49,6 +49,15 @@
 			stemEditor.customConfig.onchange = (html) => {
 			stemEditor.customConfig.onchange = (html) => {
 				this.stemContent = html
 				this.stemContent = html
 			}
 			}
+			
+			stemEditor.customConfig.onVideoWarning = (text) => {
+				this.$Message.warning(text)
+			},
+			
+			// 选择视频文件后的上传Blob操作
+			stemEditor.customConfig.onVideoSelected = async (file) => {
+					this.$tools.doUploadVideo(this,file,stemEditor)
+			},
 			stemEditor.create()
 			stemEditor.create()
 
 
 			let answerEditor = new E(this.$refs.answerEditor)
 			let answerEditor = new E(this.$refs.answerEditor)

+ 58 - 35
TEAMModelOS/ClientApp/src/view/knowledge-point/index/Index.vue

@@ -27,7 +27,7 @@
 							<Icon type="md-bookmark" color="#fff" size="20" />
 							<Icon type="md-bookmark" color="#fff" size="20" />
 							<span style="margin-left:5px">学科</span>
 							<span style="margin-left:5px">学科</span>
 						</span>
 						</span>
-						<Icon type="ios-search" color="#fff" size="18" style="cursor:pointer" @click="isSearchSubject = true" />
+						<Icon type="ios-search" color="#fff" size="18" v-show="subjectList.length" style="cursor:pointer" @click="isSearchSubject = true" />
 					</div>
 					</div>
 					<div class="ns-header-search" v-else>
 					<div class="ns-header-search" v-else>
 						<Input icon="ios-close" v-model="searchSubject" placeholder="搜索学科..." autofocus style="width: 100%" @on-click="onSearchSubjectClose"
 						<Input icon="ios-close" v-model="searchSubject" placeholder="搜索学科..." autofocus style="width: 100%" @on-click="onSearchSubjectClose"
@@ -35,7 +35,10 @@
 					</div>
 					</div>
 				</div>
 				</div>
 				<vuescroll>
 				<vuescroll>
-					<div class="gl">
+					<div v-if="subjectList.length === 0">
+						<EmptyData :top="100"></EmptyData>
+					</div>
+					<div class="gl" v-else>
 						<div :class='["gl-item",index == activeSubjectIndex ? "item-active":""]' v-for="(item,index) in subjectList" :key="index"
 						<div :class='["gl-item",index == activeSubjectIndex ? "item-active":""]' v-for="(item,index) in subjectList" :key="index"
 						 @click="hasModify ? handleConfirmSave({index},'2') : handleSubjectTap(index)">
 						 @click="hasModify ? handleConfirmSave({index},'2') : handleSubjectTap(index)">
 							<p class="gl-item-name">{{item.name}}</p>
 							<p class="gl-item-name">{{item.name}}</p>
@@ -54,14 +57,14 @@
 						<span>
 						<span>
 							<Icon type="md-cube" color="#fff" size="20" />
 							<Icon type="md-cube" color="#fff" size="20" />
 							<span style="margin-left:5px">知识点 ( {{ originPointList.length }} )</span>
 							<span style="margin-left:5px">知识点 ( {{ originPointList.length }} )</span>
-							<Input icon="ios-close" v-model="searchPoint" placeholder="搜索知识点..." autofocus style="width: 300px;margin-left: 20px;"
+							<Input icon="ios-close" v-model="searchPoint" v-show="originPointList.length" placeholder="搜索知识点..." autofocus style="width: 300px;margin-left: 20px;"
 							 @on-click="onSearchClear" @on-blur="isSearchPoint = false" @on-change="onSearchPointChange" @on-enter="onSearchPointChange"
 							 @on-click="onSearchClear" @on-blur="isSearchPoint = false" @on-change="onSearchPointChange" @on-enter="onSearchPointChange"
 							 @on-clear="onSearchClear" />
 							 @on-clear="onSearchClear" />
 						</span>
 						</span>
 						<div>
 						<div>
 							<!-- <Icon type="md-apps" title="切换到知识点视图" v-if="!isShowPoints" color="#fff" size="20" style="cursor:pointer;margin-right:10px" @click="onChangeShowType" /> -->
 							<!-- <Icon type="md-apps" title="切换到知识点视图" v-if="!isShowPoints" color="#fff" size="20" style="cursor:pointer;margin-right:10px" @click="onChangeShowType" /> -->
 							<!-- <Icon type="ios-photos" title="切换到知识块视图" v-if="isShowPoints" color="#fff" size="18" style="cursor:pointer;margin-right:10px" @click="onChangeShowType" /> -->
 							<!-- <Icon type="ios-photos" title="切换到知识块视图" v-if="isShowPoints" color="#fff" size="18" style="cursor:pointer;margin-right:10px" @click="onChangeShowType" /> -->
-							<Icon type="md-add" v-if="($access.can('admin.*|Point_Add'))" color="#fff" size="18" style="cursor:pointer;margin-right:10px"
+							<Icon type="md-add" v-if="($access.can('admin.*|Point_Add')) && subjectList.length" color="#fff" size="18" style="cursor:pointer;margin-right:10px"
 							 @click="onAddPoint" />
 							 @click="onAddPoint" />
 							<!-- <Icon type="ios-search" v-if="blockList.length !== 0" color="#fff" size="18" style="cursor:pointer" @click="isSearchPoint = true" /> -->
 							<!-- <Icon type="ios-search" v-if="blockList.length !== 0" color="#fff" size="18" style="cursor:pointer" @click="isSearchPoint = true" /> -->
 
 
@@ -114,9 +117,9 @@
 							<span style="margin-left:5px">知识块</span>
 							<span style="margin-left:5px">知识块</span>
 						</span>
 						</span>
 						<div>
 						<div>
-							<Icon type="md-add" v-if="$access.can('admin.*|Block_Add') || tabIndex === 1" color="#fff" size="18" style="cursor:pointer;margin-right:10px"
+							<Icon type="md-add" v-if="($access.can('admin.*|Block_Add') || tabIndex === 1)  && subjectList.length" color="#fff" size="18" style="cursor:pointer;margin-right:10px"
 							 @click="onAddBlock" />
 							 @click="onAddBlock" />
-							<Icon type="ios-search" color="#fff" size="18" style="cursor:pointer" @click="isSearchBlock = true" />
+							<Icon type="ios-search" color="#fff" size="18" style="cursor:pointer" v-show="subjectList.length && blockList.length" @click="isSearchBlock = true" />
 						</div>
 						</div>
 					</div>
 					</div>
 					<div class="ns-header-search" v-else>
 					<div class="ns-header-search" v-else>
@@ -374,20 +377,20 @@
 
 
 			// 获取当前学校学段学科等基本信息
 			// 获取当前学校学段学科等基本信息
 			initSchoolData() {
 			initSchoolData() {
-				this.$store.dispatch('schoolBaseInfo/getSchoolBaseData').then(res => {
-					if (res.data) {
-						this.originSchoolData = res.data // 默认选择第一个
-						this.originData = res.data // 默认选择第一个
-						this.periodList = this.originData.period
-						this.currentParams.code = this.originData.id
-						this.currentParams.school_code = this.originData.id
-						this.currentParams.periodId = this.originData.period[0].id
+				let schoolBaseInfo = JSON.parse(JSON.stringify(this.$store.state.user.schoolProfile.school_base))
+				if(schoolBaseInfo){
+					this.schoolInfo = schoolBaseInfo
+					this.originSchoolData = schoolBaseInfo // 默认选择第一个
+					this.originData = schoolBaseInfo // 默认选择第一个
+					if(schoolBaseInfo.period.length){
+						this.periodList = schoolBaseInfo.period
+						this.currentParams.code = schoolBaseInfo.id
+						this.currentParams.school_code = schoolBaseInfo.id
+						this.currentParams.periodId = schoolBaseInfo.period[0].id
 						this.currentPeriodIndex = 0 // 默认选择第一个学段
 						this.currentPeriodIndex = 0 // 默认选择第一个学段
 						this.onPeriodChange(0)
 						this.onPeriodChange(0)
-					} else {
-						this.$Message.warning('暂无学段数据')
 					}
 					}
-				})
+				}
 			},
 			},
 
 
 			// 获取当前册别数量(每次都获取最新的数据)
 			// 获取当前册别数量(每次都获取最新的数据)
@@ -421,7 +424,7 @@
 					if (!res.error && res.knowledges) {
 					if (!res.error && res.knowledges) {
 						let list = res.knowledges
 						let list = res.knowledges
 						this.blockList = list
 						this.blockList = list
-						this.originBlockList = list
+						this.originBlockList = JSON.parse(JSON.stringify(list))
 						// this.handleBlockTap(0, list.length ? list[0] : null)
 						// this.handleBlockTap(0, list.length ? list[0] : null)
 						setTimeout(function() {
 						setTimeout(function() {
 							that.isLoadBlocks = false
 							that.isLoadBlocks = false
@@ -442,7 +445,7 @@
 				this.$api.knowledge.GetSchoolPoints(this.currentParams).then(res => {
 				this.$api.knowledge.GetSchoolPoints(this.currentParams).then(res => {
 					if (!res.error && res.knowledges) {
 					if (!res.error && res.knowledges) {
 						this.pointList = res.knowledges
 						this.pointList = res.knowledges
-						this.originPointList = res.knowledges
+						this.originPointList = JSON.parse(JSON.stringify(res.knowledges))
 						setTimeout(function() {
 						setTimeout(function() {
 							that.isLoadPoints = false
 							that.isLoadPoints = false
 						}, 800)
 						}, 800)
@@ -480,27 +483,41 @@
 
 
 			// 学段切换处理
 			// 学段切换处理
 			onPeriodChange(index) {
 			onPeriodChange(index) {
-				this.preSelectVal = this.$refs.periodSelect.value
-				if (this.hasModify) {
-					this.handleConfirmSave({}, '3')
-				} else {
-					let that = this
-					this.isLoadSubject = true
-					this.activePeriodIndex = index
-					this.currentParams.periodId = this.originData.period[index].id
-					this.subjectList = this.periodList[index].subjects // 切换学段后更新 学科 列表
-					this.originSubjectList = this.periodList[index].subjects // 筛选学科源数据
-					this.handleSubjectTap(0)
-					this.initBlockCount()
-					setTimeout(function() {
-						that.isLoadSubject = false
-					}, 400)
-				}
+				this.$nextTick(() => {
+					this.preSelectVal = this.$refs.periodSelect.value
+					if (this.hasModify) {
+						this.handleConfirmSave({}, '3')
+					} else {
+						let that = this
+						this.isLoadSubject = true
+						this.activePeriodIndex = index
+						this.currentParams.periodId = this.originData.period[index].id
+						this.subjectList = this.periodList[index].subjects // 切换学段后更新 学科 列表
+						this.originSubjectList = this.periodList[index].subjects // 筛选学科源数据
+						if(this.subjectList.length){
+							this.handleSubjectTap(0)
+							this.initBlockCount()
+						}else{
+							this.pointList = []
+							this.originBlockList = []
+							this.blockList = []
+							this.originPointList = []
+						}
+						setTimeout(function() {
+							that.isLoadSubject = false
+						}, 400)
+					}
+				})
+				
 			},
 			},
 
 
 			// 学科点击事件
 			// 学科点击事件
 			handleSubjectTap(index) {
 			handleSubjectTap(index) {
 				this.checkedPointList = []
 				this.checkedPointList = []
+				this.blockList = []
+				this.originBlockList = []
+				this.pointList = []
+				this.originPointList = []
 				this.schoolParams = {
 				this.schoolParams = {
 					schoolCode: this.originData.id,
 					schoolCode: this.originData.id,
 					subjectId: this.subjectList[index].id,
 					subjectId: this.subjectList[index].id,
@@ -591,7 +608,13 @@
 							id: data.id
 							id: data.id
 						}).then(res => {
 						}).then(res => {
 							if (res.knowledges) {
 							if (res.knowledges) {
+								console.log(this.blockList)
+								console.log(this.originBlockList)
+								console.log(data)
 								this.blockList.splice(this.blockList.indexOf(data), 1)
 								this.blockList.splice(this.blockList.indexOf(data), 1)
+								this.originBlockList.splice(this.originBlockList.indexOf(data), 1)
+								console.log(this.blockList)
+								console.log(this.originBlockList)
 								this.handleBlockTap(0, this.blockList.length ? this.blockList[0] : null)
 								this.handleBlockTap(0, this.blockList.length ? this.blockList[0] : null)
 								setTimeout(() => {
 								setTimeout(() => {
 									that.blockCounts = []
 									that.blockCounts = []

+ 8 - 6
TEAMModelOS/ClientApp/src/view/knowledge-point/index/operation/AddBlock.vue

@@ -39,7 +39,10 @@
         },
         },
 
 
         created() {
         created() {
-
+			if(this.originData){
+				this.currentPeriod = this.originData.period[this.periodIndex]
+				this.originDatas = this.originData
+			}
         },
         },
         methods: {
         methods: {
             // 提交添加
             // 提交添加
@@ -107,24 +110,23 @@
             periodIndex: {
             periodIndex: {
                 handler(newValue, oldValue) {
                 handler(newValue, oldValue) {
                     this.currentPeriod = this.originDatas.period[newValue]
                     this.currentPeriod = this.originDatas.period[newValue]
-                    this.formTop.subject = this.currentPeriod.subjects[0].id
+                    this.formTop.subject = this.currentPeriod.subjects.length ? this.currentPeriod.subjects[0].id : ''
                     this.formTop.name = ''
                     this.formTop.name = ''
                 }
                 }
             },
             },
             subjectIndex: {
             subjectIndex: {
                 handler(newValue, oldValue) {
                 handler(newValue, oldValue) {
-                    this.formTop.subject = this.currentPeriod.subjects[newValue].id
+                    this.formTop.subject = this.currentPeriod.subjects ? this.currentPeriod.subjects[newValue].id : ''
                 }
                 }
             },
             },
             editBlock: {
             editBlock: {
                 handler(newValue, oldValue) {
                 handler(newValue, oldValue) {
-                    console.log(newValue)
                     if (newValue) { // 有编辑册别传过来则为编辑状态
                     if (newValue) { // 有编辑册别传过来则为编辑状态
                         this.editItem = newValue
                         this.editItem = newValue
-                        this.formTop.subject = newValue.id
+                        this.formTop.subject = this.formTop.subject || newValue.subjectId
                         this.formTop.name = newValue.name
                         this.formTop.name = newValue.name
                     } else { // 否则为新增状态
                     } else { // 否则为新增状态
-                        this.formTop.subject = this.currentPeriod.subjects[0].id
+                        this.formTop.subject = this.formTop.subject || this.currentPeriod.subjects[0].id
                         this.formTop.name = ''
                         this.formTop.name = ''
                         this.editItem = newValue
                         this.editItem = newValue
                     }
                     }

+ 25 - 21
TEAMModelOS/ClientApp/src/view/knowledge-point/index/operation/ComposeBlock.vue

@@ -104,24 +104,29 @@
 
 
             // 提交新增知识块
             // 提交新增知识块
             handleSubmit() {
             handleSubmit() {
-                this.isLoading = true
-                let selectBlockItem = this.existBlockList.filter(item => item.id === this.selectBlock)[0]
-                let pointList = selectBlockItem.points
-                pointList = Array.from(new Set(pointList.concat(this.checkedList.map(item => item.id)))) // 知识点合并去重
-                selectBlockItem.points = pointList
-
-                this.$api.knowledge.SaveOrUpdateKnowledge([selectBlockItem]).then(res => {
-                    if (!res.error && res.knowledges) {
-                        this.$emit('onFinish', false)
-                    } else {
-                        this.$Message.warning('操作失败,错误代码:' + res.error.code + ',错误信息:' + res.error.message)
-                    }
-                    this.isLoading = false
-                }).catch(err => {
-                    console.log(err)
-                    this.$Message.warning('操作失败')
-                    this.isLoading = false
-                })
+				if(this.existBlockList.length){
+					this.isLoading = true
+					let selectBlockItem = this.existBlockList.filter(item => item.id === this.selectBlock)[0]
+					let pointList = selectBlockItem.points
+					pointList = Array.from(new Set(pointList.concat(this.checkedList.map(item => item.id)))) // 知识点合并去重
+					selectBlockItem.points = pointList
+					
+					this.$api.knowledge.SaveOrUpdateKnowledge([selectBlockItem]).then(res => {
+					    if (!res.error && res.knowledges) {
+					        this.$emit('onFinish', false)
+					    } else {
+					        this.$Message.warning('操作失败,错误代码:' + res.error.code + ',错误信息:' + res.error.message)
+					    }
+					    this.isLoading = false
+					}).catch(err => {
+					    console.log(err)
+					    this.$Message.warning('操作失败')
+					    this.isLoading = false
+					})
+				}else{
+					this.$Message.warning('无现有知识块选择!')
+				}
+                
             },
             },
 
 
             onSplicePoint(item) {
             onSplicePoint(item) {
@@ -151,11 +156,10 @@
 
 
             blockList: {
             blockList: {
                 handler(newValue, oldValue) {
                 handler(newValue, oldValue) {
-                    if (newValue.length) {
-                        console.log(newValue)
+                    if (newValue) {
                         this.newBlockName = ''
                         this.newBlockName = ''
                         this.existBlockList = newValue
                         this.existBlockList = newValue
-                        this.selectBlock = newValue[0].id
+                        this.selectBlock = newValue.length ? newValue[0].id : ''
                     }
                     }
                 }
                 }
             }
             }

+ 3 - 2
TEAMModelOS/ClientApp/src/view/learnactivity/ExamPaperAnalysis.vue

@@ -19,8 +19,8 @@
                 <div class="whole-table-col">
                 <div class="whole-table-col">
                     <p class="while-table-question-type">{{examAnalysisData.whole.objectiveScore}}({{examAnalysisData.whole.objectiveScoreP}}%)</p>
                     <p class="while-table-question-type">{{examAnalysisData.whole.objectiveScore}}({{examAnalysisData.whole.objectiveScoreP}}%)</p>
                     <p class="while-table-question-type">{{examAnalysisData.whole.subjectiveScore}}({{examAnalysisData.whole.subjectiveScoreP}}%)</p>
                     <p class="while-table-question-type">{{examAnalysisData.whole.subjectiveScore}}({{examAnalysisData.whole.subjectiveScoreP}}%)</p>
+					<p class="while-table-question-type">{{examAnalysisData.whole.objectiveNum}}({{examAnalysisData.whole.objectiveNumP}}%)</p>
                     <p class="while-table-question-type">{{examAnalysisData.whole.subjectiveNum}}({{examAnalysisData.whole.subjectiveNumP}}%)</p>
                     <p class="while-table-question-type">{{examAnalysisData.whole.subjectiveNum}}({{examAnalysisData.whole.subjectiveNumP}}%)</p>
-                    <p class="while-table-question-type">{{examAnalysisData.whole.objectiveNum}}({{examAnalysisData.whole.objectiveNumP}}%)</p>
                 </div>
                 </div>
             </div>
             </div>
         </div>
         </div>
@@ -224,7 +224,7 @@
                 let subjectiveNumP = 0
                 let subjectiveNumP = 0
                 let objectiveNumP = 0
                 let objectiveNumP = 0
                 for (let key in this.groupQuestion) {
                 for (let key in this.groupQuestion) {
-                    if (key == 'Complete' || key == 'Subjective' || key == 'Compose') {
+                    if (key == 'complete' || key == 'subjective' || key == 'compose') {
                         subjectiveNum += this.groupQuestion[key].length
                         subjectiveNum += this.groupQuestion[key].length
                         subjectiveScore += this.groupQuestion[key].reduce((total, item) => total + item.score, 0)
                         subjectiveScore += this.groupQuestion[key].reduce((total, item) => total + item.score, 0)
                     } else {
                     } else {
@@ -333,6 +333,7 @@
             },
             },
             drawDiffChart() {
             drawDiffChart() {
                 this.option.series[0].data = this.examAnalysisData.difficult.count
                 this.option.series[0].data = this.examAnalysisData.difficult.count
+				console.log(this.examAnalysisData)
                 this.myPie.setOption(this.option)
                 this.myPie.setOption(this.option)
             },
             },
             getQuestionLabel(key) {
             getQuestionLabel(key) {

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

@@ -63,11 +63,12 @@
                         <span>测试科目:</span>
                         <span>测试科目:</span>
                         <span v-if="examPaperList.length > 0" v-for="(item,index) in examPaperList" :key="index" :class="index == currentSubjectIndex ? 'subject-item subject-item-active':'subject-item'" @click="selectSubject(index)">
                         <span v-if="examPaperList.length > 0" v-for="(item,index) in examPaperList" :key="index" :class="index == currentSubjectIndex ? 'subject-item subject-item-active':'subject-item'" @click="selectSubject(index)">
                             <!--{{item.period}}
                             <!--{{item.period}}
-                            <span style="margin:0px 2px;">·</span>-->
+            <span style="margin:0px 2px;">·</span>-->
                             {{item.subjectName}}
                             {{item.subjectName}}
                         </span>
                         </span>
                     </div>
                     </div>
                     <div class="test-paper-detail">
                     <div class="test-paper-detail">
+
                         <vuescroll ref="test-paper-detail" @handle-scroll="checkBackTop">
                         <vuescroll ref="test-paper-detail" @handle-scroll="checkBackTop">
                             <!--返回顶部-->
                             <!--返回顶部-->
                             <div class="back-to-top fl-col-center" title="返回顶部" v-if="showBack" @click="handleBackToTop">
                             <div class="back-to-top fl-col-center" title="返回顶部" v-if="showBack" @click="handleBackToTop">
@@ -75,7 +76,9 @@
                             </div>
                             </div>
                             <!--试卷题目信息-->
                             <!--试卷题目信息-->
                             <div v-if="examPaperList.length > 0">
                             <div v-if="examPaperList.length > 0">
-                                <TestPaper :paper="examPaperList[currentSubjectIndex].papers" style="color:#515a6e;margin-top:-10px;" :isShowTools="isShowTools"></TestPaper>
+                                <div v-if="examPaperList[currentSubjectIndex] !== undefined">
+                                    <TestPaper :paper="examPaperList[currentSubjectIndex].papers" style="color:#515a6e;margin-top:-10px;" :isBaseInfo="isShowTools" :isShowTools="isShowTools"></TestPaper>
+                                </div>
                             </div>
                             </div>
                             <EmptyData v-else style="margin-top:60px;"></EmptyData>
                             <EmptyData v-else style="margin-top:60px;"></EmptyData>
                         </vuescroll>
                         </vuescroll>
@@ -100,17 +103,20 @@
     </div>
     </div>
 </template>
 </template>
 <script>
 <script>
+    import Loading from '@/common/Loading.vue'
     import QuestionList from '@/components/learnactivity/QuestionList.vue'
     import QuestionList from '@/components/learnactivity/QuestionList.vue'
     import ExamPaperAnalysis from './ExamPaperAnalysis.vue'
     import ExamPaperAnalysis from './ExamPaperAnalysis.vue'
     import TestPaper from '@/view/evaluation/index/TestPaper.vue'
     import TestPaper from '@/view/evaluation/index/TestPaper.vue'
     import jsFn from '@/utils/js-fn.js'
     import jsFn from '@/utils/js-fn.js'
     import ClassList from '@/components/learnactivity/ClassList.vue'
     import ClassList from '@/components/learnactivity/ClassList.vue'
+
     export default {
     export default {
         components: {
         components: {
             QuestionList,
             QuestionList,
             ExamPaperAnalysis,
             ExamPaperAnalysis,
             TestPaper,
             TestPaper,
-            ClassList
+            ClassList,
+            Loading
         },
         },
         data() {
         data() {
             return {
             return {
@@ -188,7 +194,8 @@
                     }
                     }
                 ],
                 ],
                 showPaperInfo: {},
                 showPaperInfo: {},
-                startTime:''
+                startTime: '',
+                isLoadings: true
             }
             }
         },
         },
         methods: {
         methods: {
@@ -486,6 +493,8 @@
             },
             },
             selectEvaluation(index) {
             selectEvaluation(index) {
                 console.log(index)
                 console.log(index)
+                this.isLoading =true
+                this.currentSubjectIndex = 0
                 this.currentBraIndex = 0
                 this.currentBraIndex = 0
                 this.avtiveEvaluationIndex = index
                 this.avtiveEvaluationIndex = index
                 this.getMyDate(this.evaluationList[this.avtiveEvaluationIndex].startTime, this.evaluationList[this.avtiveEvaluationIndex].endTime)
                 this.getMyDate(this.evaluationList[this.avtiveEvaluationIndex].startTime, this.evaluationList[this.avtiveEvaluationIndex].endTime)
@@ -516,15 +525,22 @@
                     id: this.evaluationList[this.avtiveEvaluationIndex].id,
                     id: this.evaluationList[this.avtiveEvaluationIndex].id,
                     code: this.evaluationList[this.avtiveEvaluationIndex].code
                     code: this.evaluationList[this.avtiveEvaluationIndex].code
                 }
                 }
+                this.isLoading = true
                 this.$api.learnActivity.FindExamInfos(requestData).then(
                 this.$api.learnActivity.FindExamInfos(requestData).then(
                     res => {
                     res => {
                         if (res.error == null) {
                         if (res.error == null) {
-                         this.getPaperData(res.examInfo[0])
+                            setTimeout(() => {
+                                this.isLoading = false;
+                            }, 1000);
+                            this.getPaperData(res.examInfo[0])
                         } else {
                         } else {
                             this$Message.error('API ERROR!')
                             this$Message.error('API ERROR!')
+                            this.isLoading = false
                         }
                         }
                     },
                     },
                     res => {
                     res => {
+                        this.$Message.warning('暂无试卷信息!')
+                        this.isLoading = false
                     })
                     })
             },
             },
             async getPaperData(dataInfo) {
             async getPaperData(dataInfo) {

+ 5 - 7
TEAMModelOS/ClientApp/src/view/login/Index.vue

@@ -539,14 +539,13 @@ export default {
 
 
       //設定權限並登入
       //設定權限並登入
       let identity = localStorage.getItem('identity')
       let identity = localStorage.getItem('identity')
-	  console.log(result)
       User.login(result).then(res => {
       User.login(result).then(res => {
         if(res && identity) {
         if(res && identity) {
-			this.saveUserCodes({
-				TEAMModelId: result.id,
-				name:result.name,
-				schoolCode: result.defaultschool
-			})
+          this.saveUserCodes({
+            TEAMModelId: result.id,
+            name:result.name,
+            schoolCode: result.defaultschool
+          })
           let path = identity == 'student' ? '/studentWeb' : '/home'
           let path = identity == 'student' ? '/studentWeb' : '/home'
           this.$router.push({ path: path })
           this.$router.push({ path: path })
         } else {
         } else {
@@ -556,7 +555,6 @@ export default {
     },
     },
 	saveUserCodes:function(res){
 	saveUserCodes:function(res){
 		this.$store.commit('setUserInfo',res)
 		this.$store.commit('setUserInfo',res)
-		console.log(this.$store.state.userInfo)
 	},
 	},
     getSchools: function(){ // 取得學校清單
     getSchools: function(){ // 取得學校清單
       let _this = this
       let _this = this

+ 8 - 18
TEAMModelOS/ClientApp/src/view/newcourse/CourseBaseSetting.vue

@@ -13,12 +13,12 @@
                     </FormItem>
                     </FormItem>
                     <FormItem v-show="listType == 'school'" :label="$t('courseManage.base.coursePeriod')" prop="periodCode" class="disabled-iview-select">
                     <FormItem v-show="listType == 'school'" :label="$t('courseManage.base.coursePeriod')" prop="periodCode" class="disabled-iview-select">
                         <Select v-model="coursePlan.course.periodCode" :disabled="baseEditStatus" filterable style="width:100%" placeholder="请选择学制" :clearable="true">
                         <Select v-model="coursePlan.course.periodCode" :disabled="baseEditStatus" filterable style="width:100%" placeholder="请选择学制" :clearable="true">
-                            <Option v-for="(item,index) in $store.state.schoolBaseInfo.schoolBaseInfo.period" :value="item.periodCode" :key="index">{{ item.periodName }}</Option>
+                            <Option v-for="(item,index) in schoolBase.period" :value="item.periodCode" :key="index">{{ item.periodName }}</Option>
                         </Select>
                         </Select>
                     </FormItem>
                     </FormItem>
                     <FormItem v-show="listType == 'school'" :label="$t('courseManage.base.courseSubject')" prop="subjectCode" :class="baseEditStatus ? 'disabled-style':''">
                     <FormItem v-show="listType == 'school'" :label="$t('courseManage.base.courseSubject')" prop="subjectCode" :class="baseEditStatus ? 'disabled-style':''">
                         <Select v-model="coursePlan.course.subjectCode" :disabled="baseEditStatus" filterable style="width:100%" placeholder="请选择科目" :clearable="true">
                         <Select v-model="coursePlan.course.subjectCode" :disabled="baseEditStatus" filterable style="width:100%" placeholder="请选择科目" :clearable="true">
-                            <Option v-for="(item,index) in $jsFn.getPeriod($store.state.schoolBaseInfo.schoolBaseInfo,coursePlan.course.periodCode).subjects" :value="item.subjectCode" :key="index">{{ item.subjectName }}</Option>
+                            <Option v-for="(item,index) in $jsFn.getPeriod(schoolBase,coursePlan.course.periodCode).subjects" :value="item.subjectCode" :key="index">{{ item.subjectName }}</Option>
                         </Select>
                         </Select>
                     </FormItem>
                     </FormItem>
                     <FormItem :label="$t('courseManage.base.courseNotice')">
                     <FormItem :label="$t('courseManage.base.courseNotice')">
@@ -59,6 +59,7 @@
         },
         },
         data() {
         data() {
             return {
             return {
+                schoolBase: undefined,
                 isLoading: false,
                 isLoading: false,
                 edNoticeStatus: false,
                 edNoticeStatus: false,
                 noticeEditor: undefined,
                 noticeEditor: undefined,
@@ -143,7 +144,9 @@
                 )
                 )
             },
             },
             getSchoolBaseInfo() {
             getSchoolBaseInfo() {
-                this.$store.dispatch('schoolBaseInfo/getSchoolBaseData').then(
+                //直接读取登录成功拿到得学校基础信息
+                this.schoolBase = JSON.parse(JSON.stringify(this.$store.state.user.schoolProfile.school_base))
+                /*this.$store.dispatch('schoolBaseInfo/getSchoolBaseData').then(
                     (res) => {
                     (res) => {
                         if (res.code == 2) {
                         if (res.code == 2) {
                             alert('数据为空!')
                             alert('数据为空!')
@@ -152,27 +155,14 @@
                     (err) => {
                     (err) => {
                         this.$Message.error('API error!')
                         this.$Message.error('API error!')
                     }
                     }
-                )
-            },
-            getClassroom() {
-                this.$store.dispatch('schoolBaseInfo/getClassroom').then(
-                    (res) => {
-                        if (res.code == 2) {
-                            alert('数据为空!')
-                        }
-                    },
-                    (err) => {
-                        this.$Message.error('API error!')
-                    }
-                )
-            },
+                )*/
+            }
         },
         },
         mounted() {
         mounted() {
             
             
         },
         },
         created() {
         created() {
             this.getSchoolBaseInfo()
             this.getSchoolBaseInfo()
-            this.getClassroom()
             this.getSchoolTeacher()
             this.getSchoolTeacher()
         },
         },
         watch: {
         watch: {

+ 4 - 4
TEAMModelOS/ClientApp/src/view/newcourse/CourseClassroom.vue

@@ -103,7 +103,7 @@
             <Form ref="personalClassroom" :model="personalClassroom" label-position="top" label-colon>
             <Form ref="personalClassroom" :model="personalClassroom" label-position="top" label-colon>
                 <FormItem label="班级名称" prop="classroomName">
                 <FormItem label="班级名称" prop="classroomName">
                     <Select v-model="sysClass.classroomName" filterable>
                     <Select v-model="sysClass.classroomName" filterable>
-                        <Option @click.native="sysClass.classroomCode = item.classroomCode" v-for="(item, index) in $store.state.schoolBaseInfo.classroomList" :value="item.classroomCode" :key="index">{{ item.classroomName }}</Option>
+                        <Option @click.native="sysClass.classroomCode = item.classroomCode" v-for="(item, index) in $store.state.user.schoolProfile.school_classes" :value="item.classroomCode" :key="index">{{ item.classroomName }}</Option>
                     </Select>
                     </Select>
                 </FormItem>
                 </FormItem>
                 <FormItem :label="$t('courseManage.classroom.invitationCode')" prop="classroomCode">
                 <FormItem :label="$t('courseManage.classroom.invitationCode')" prop="classroomCode">
@@ -298,9 +298,9 @@
                         this.courseInfo.classes[this.curClassIndex].getStatus = true
                         this.courseInfo.classes[this.curClassIndex].getStatus = true
                         let students = res.result.extend.students
                         let students = res.result.extend.students
                         for (let index in students) {
                         for (let index in students) {
-                            let currentClassroomlInfo = this.$JSONPath.query(this.$store.state.schoolBaseInfo.classroomList, "$..[?(@.classroomCode=='" + students[index].classroomCode + "')]")
+                            let currentClassroomlInfo = this.$JSONPath.query(this.$store.state.user.schoolProfile.school_classes, "$..[?(@.classroomCode=='" + students[index].classroomCode + "')]")
                             if (currentClassroomlInfo.length > 0) {
                             if (currentClassroomlInfo.length > 0) {
-                                let currentSchoolInfo = this.$JSONPath.query(this.$store.state.schoolBaseInfo.schoolBaseInfo, "$..period[?(@.periodCode=='" + currentClassroomlInfo[0].periodCode + "')]")
+                                let currentSchoolInfo = this.$JSONPath.query(this.$store.state.user.schoolProfile.school_base, "$..period[?(@.periodCode=='" + currentClassroomlInfo[0].periodCode + "')]")
                                 students[index].periodName = currentSchoolInfo[0].periodName
                                 students[index].periodName = currentSchoolInfo[0].periodName
                                 students[index].periodCode = currentSchoolInfo[0].periodCode
                                 students[index].periodCode = currentSchoolInfo[0].periodCode
                                 students[index].gradeName = this.$JSONPath.query(currentSchoolInfo, "$..grades[?(@.gradeCode=='" + currentClassroomlInfo[0].gradeCode + "')]")[0].gradeName
                                 students[index].gradeName = this.$JSONPath.query(currentSchoolInfo, "$..grades[?(@.gradeCode=='" + currentClassroomlInfo[0].gradeCode + "')]")[0].gradeName
@@ -384,7 +384,7 @@
                 handler(n, o) {
                 handler(n, o) {
                     if (this.courseInfo.classes) {
                     if (this.courseInfo.classes) {
                         for (let index in this.courseInfo.classes) {
                         for (let index in this.courseInfo.classes) {
-                            let classroom = this.$store.state.schoolBaseInfo.classroomList.filter((item) => {
+                            let classroom = this.$store.state.user.schoolProfile.school_classes.filter((item) => {
                                 return item.classroomCode == this.courseInfo.classes[index].classroomCode
                                 return item.classroomCode == this.courseInfo.classes[index].classroomCode
                             })
                             })
                             if (classroom.length > 0) {
                             if (classroom.length > 0) {

+ 13 - 21
TEAMModelOS/ClientApp/src/view/newcourse/CoursePlan.vue

@@ -613,7 +613,17 @@
         async created() {
         async created() {
             await this.getCourseList()
             await this.getCourseList()
             await this.$store.dispatch('teachers/getTeacherList').then(res => { })
             await this.$store.dispatch('teachers/getTeacherList').then(res => { })
-            await this.$store.dispatch('schoolBaseInfo/getClassroom').then(res => {
+
+            //直接读取登录成功拿到得学校基础信息
+            this.schoolInfo = JSON.parse(JSON.stringify(this.$store.state.user.schoolProfile.school_base))
+            if (!this.schoolInfo) {
+                this.$Message.warning('尚未加入学校,没有学校数据')
+            }
+            this.classList = JSON.parse(JSON.stringify(this.$store.state.user.schoolProfile.school_class))
+            this.classListShow = [...this.classList]
+            this.findClassPlan()
+            
+            /*await this.$store.dispatch('schoolBaseInfo/getClassroom').then(res => {
                 this.classList = this.$store.state.schoolBaseInfo.classroomList
                 this.classList = this.$store.state.schoolBaseInfo.classroomList
                 this.classListShow = [...this.classList]
                 this.classListShow = [...this.classList]
                 this.findClassPlan()
                 this.findClassPlan()
@@ -621,25 +631,7 @@
                 this.tableData = this.$store.state.schoolBaseInfo.schoolBaseInfo.timetable.filter((item, index) => {
                 this.tableData = this.$store.state.schoolBaseInfo.schoolBaseInfo.timetable.filter((item, index) => {
                     return item.type == 1
                     return item.type == 1
                 })
                 })
-                //处理学期级联查询
-                //for (let item of this.$store.state.schoolBaseInfo.schoolBaseInfo.period) {
-                //    let root = {
-                //        value: item.periodCode,
-                //        label:item.periodName
-                //    }
-                //    let children = []
-                //    for (let semItem of item.semesters) {
-                //        children.push(
-                //            {
-                //                value: semItem.semesterCode,
-                //                label: semItem.semesterName
-                //            }
-                //        )
-                //    }
-                //    root.children = children
-                //    this.semesterTree.push(root)
-                //}
-            })
+            })*/
 
 
         },
         },
         mounted() {
         mounted() {
@@ -659,7 +651,7 @@
             },
             },
             semesterList() {
             semesterList() {
                 if (this.classListShow.length > 0) {
                 if (this.classListShow.length > 0) {
-                    let data = this.$jsFn.getPeriod(this.$store.state.schoolBaseInfo.schoolBaseInfo, this.classListShow[this.curClassIndex].periodCode)
+                    let data = this.$jsFn.getPeriod(this.$store.state.user.schoolProfile.school_base, this.classListShow[this.curClassIndex].periodCode)
 
 
                     return data
                     return data
                 } else {
                 } else {

+ 7 - 9
TEAMModelOS/ClientApp/src/view/newcourse/CourseTable.vue

@@ -199,7 +199,7 @@
                 if (this.courseInfo.classes) {
                 if (this.courseInfo.classes) {
                     //完善班级信息
                     //完善班级信息
                     for (let index in this.courseInfo.classes) {
                     for (let index in this.courseInfo.classes) {
-                        let classroom = this.$store.state.schoolBaseInfo.classroomList.filter((item) => {
+                        let classroom = this.$store.state.user.schoolProfile.school_classes.filter((item) => {
                             return item.classroomCode == this.courseInfo.classes[index].classroomCode
                             return item.classroomCode == this.courseInfo.classes[index].classroomCode
                         })
                         })
                         if (classroom.length > 0) {
                         if (classroom.length > 0) {
@@ -291,7 +291,7 @@
                 return new Promise(async (r, j) => {
                 return new Promise(async (r, j) => {
                     for (let i in this.myCusPlan) {
                     for (let i in this.myCusPlan) {
                         for (let j in this.myCusPlan[i].classes) {
                         for (let j in this.myCusPlan[i].classes) {
-                            let classroom = this.$store.state.schoolBaseInfo.classroomList.filter((item) => {
+                            let classroom = this.$store.state.user.schoolProfile.school_classes.filter((item) => {
                                 return item.classroomCode == this.myCusPlan[i].classes[j].classroomCode
                                 return item.classroomCode == this.myCusPlan[i].classes[j].classroomCode
                             })
                             })
                             if (classroom.length > 0) {
                             if (classroom.length > 0) {
@@ -376,14 +376,12 @@
         watch: {
         watch: {
             courseInfo: {
             courseInfo: {
                 handler(n, o) {
                 handler(n, o) {
-                    this.$store.dispatch('schoolBaseInfo/getClassroom').then(res => {
-                        this.schoolInfo = this.$store.state.schoolBaseInfo.schoolBaseInfo
-                        let timeTable = this.$store.state.schoolBaseInfo.schoolBaseInfo.timetable.filter((item, index) => {
-                            return item.type == 1
-                        })
-                        this.tableData = JSON.parse(JSON.stringify(timeTable))
-                        this.fullTable()
+                    this.schoolInfo = this.$store.state.user.schoolProfile.school_base
+                    let timeTable = this.$store.state.user.schoolProfile.school_base.timetable.filter((item, index) => {
+                        return item.type == 1
                     })
                     })
+                    this.tableData = JSON.parse(JSON.stringify(timeTable))
+                    this.fullTable()
                 },
                 },
                 deep: true,
                 deep: true,
                 immediate: true
                 immediate: true

+ 1 - 1
TEAMModelOS/ClientApp/src/view/newcourse/CourseTime.vue

@@ -413,7 +413,7 @@
             },
             },
         },
         },
         created() {
         created() {
-            this.schoolInfo = this.$store.state.schoolBaseInfo.schoolBaseInfo
+            this.schoolInfo = this.$store.state.user.schoolProfile.school_base
         },
         },
         computed: {
         computed: {
             tableData() {
             tableData() {

+ 11 - 5
TEAMModelOS/ClientApp/src/view/newcourse/ManageCourse.vue

@@ -24,7 +24,7 @@
                     {{index + 1}}
                     {{index + 1}}
                 </template>
                 </template>
                 <template slot-scope="{ row,index }" slot="period">
                 <template slot-scope="{ row,index }" slot="period">
-                    <!--<span>{{$jsFn.getPeriod($store.state.schoolBaseInfo.schoolBaseInfo,row.period.id).name}}</span>-->
+                    <!--<span>{{$jsFn.getPeriod(schoolBase,row.period.id).name}}</span>-->
                     <span>{{row.period.name}}</span>
                     <span>{{row.period.name}}</span>
                 </template>
                 </template>
                 <template slot-scope="{ row,index }" slot="count">
                 <template slot-scope="{ row,index }" slot="count">
@@ -59,7 +59,7 @@
                 </FormItem>
                 </FormItem>
                 <FormItem label="课程学段" prop="period.id">
                 <FormItem label="课程学段" prop="period.id">
                     <Select v-model="courseBaseInfo.period.id" placeholder="请选择学段">
                     <Select v-model="courseBaseInfo.period.id" placeholder="请选择学段">
-                        <Option v-for="(item,index) in $store.state.schoolBaseInfo.schoolBaseInfo.period" :value="item.id" :key="index" 
+                        <Option v-for="(item,index) in schoolBase.period" :value="item.id" :key="index" 
                                 @click.native="courseBaseInfo.period = { id: item.id, name: item.name }">
                                 @click.native="courseBaseInfo.period = { id: item.id, name: item.name }">
                             {{ item.name }}
                             {{ item.name }}
                         </Option>
                         </Option>
@@ -67,7 +67,7 @@
                 </FormItem>
                 </FormItem>
                 <FormItem label="课程学科" prop="subject.id">
                 <FormItem label="课程学科" prop="subject.id">
                     <Select v-model="courseBaseInfo.subject.id" placeholder="请选择学科">
                     <Select v-model="courseBaseInfo.subject.id" placeholder="请选择学科">
-                        <Option v-for="(item,index) in $jsFn.getPeriod($store.state.schoolBaseInfo.schoolBaseInfo, courseBaseInfo.period.id).subjects" 
+                        <Option v-for="(item,index) in $jsFn.getPeriod(schoolBase, courseBaseInfo.period.id).subjects" 
                                 :value="item.id" :key="index" @click.native="courseBaseInfo.subject = {name: item.name, id:item.id}">
                                 :value="item.id" :key="index" @click.native="courseBaseInfo.subject = {name: item.name, id:item.id}">
                             {{ item.name }}
                             {{ item.name }}
                         </Option>
                         </Option>
@@ -105,6 +105,7 @@
                 }
                 }
             }
             }
             return {
             return {
+                schoolBase: undefined,
                 tableHeight:780,
                 tableHeight:780,
                 teacherId:[],
                 teacherId:[],
                 actionType:0, //0新增 1编辑
                 actionType:0, //0新增 1编辑
@@ -400,8 +401,13 @@
                     this.tableHeight = dom[0].offsetHeight - 20
                     this.tableHeight = dom[0].offsetHeight - 20
                 }
                 }
             })
             })
-            this.$store.dispatch('schoolBaseInfo/getClassroom').then(res => {
-            })
+            //直接读取登录成功拿到得学校基础信息
+            this.schoolBase = JSON.parse(JSON.stringify(this.$store.state.user.schoolProfile.school_base))
+            this.classList = JSON.parse(JSON.stringify(this.$store.state.user.schoolProfile.school_classes))
+            if (!this.schoolBase) {
+                this.$Message.warning('尚未加入学校,没有学校数据')
+            }
+            //this.$store.dispatch('schoolBaseInfo/getClassroom').then(res => { })
             this.$store.dispatch('teachers/getTeacherList').then(res => {
             this.$store.dispatch('teachers/getTeacherList').then(res => {
             })
             })
         }
         }

+ 8 - 5
TEAMModelOS/ClientApp/src/view/newcourse/MyCourse.vue

@@ -80,7 +80,7 @@
                             <span class="classroom-info-label">{{$t('courseManage.classroom.headmaster')}}</span>
                             <span class="classroom-info-label">{{$t('courseManage.classroom.headmaster')}}</span>
                             <span class="classroom-info-value">{{item.teacher.name}}</span>
                             <span class="classroom-info-value">{{item.teacher.name}}</span>
                         </p>
                         </p>
-                        <Icon type="md-qr-scanner" class="qr-code-icon" @click="showQrCode" v-if="'private' == item.scope" />
+                        <Icon custom="iconfont icon-qr-code" class="qr-code-icon" @click="showQrCode" v-if="'private' == item.scope" />
                     </div>
                     </div>
                     <div v-if="classList.length == 0">
                     <div v-if="classList.length == 0">
                         <EmptyData :top="160" textContent="暂无上课班级"></EmptyData>
                         <EmptyData :top="160" textContent="暂无上课班级"></EmptyData>
@@ -222,7 +222,7 @@
             <Form ref="sysClass" :model="sysClass" label-position="top" label-colon>
             <Form ref="sysClass" :model="sysClass" label-position="top" label-colon>
                 <FormItem label="班级名称" prop="name">
                 <FormItem label="班级名称" prop="name">
                     <Select v-model="sysClass.name" filterable>
                     <Select v-model="sysClass.name" filterable>
-                        <Option @click.native="sysClass.id = item.id" v-for="(item, index) in $store.state.schoolBaseInfo.classroomList" :value="item.id" :key="index">{{ item.name }}</Option>
+                        <Option @click.native="sysClass.id = item.id" v-for="(item, index) in schoolClassList" :value="item.id" :key="index">{{ item.name }}</Option>
                     </Select>
                     </Select>
                 </FormItem>
                 </FormItem>
                 <FormItem :label="$t('courseManage.classroom.invitationCode')" prop="id">
                 <FormItem :label="$t('courseManage.classroom.invitationCode')" prop="id">
@@ -270,6 +270,7 @@
                 }
                 }
             }
             }
             return {
             return {
+                schoolClassList:[],
                 tableHeight:100,
                 tableHeight:100,
                 studentColumn: [
                 studentColumn: [
                     {
                     {
@@ -351,7 +352,7 @@
                 this.stuLoading = true
                 this.stuLoading = true
                 let params = {
                 let params = {
                     'school_code': this.$store.state.userInfo.schoolCode,
                     'school_code': this.$store.state.userInfo.schoolCode,
-                    'teacher.id': this.$store.state.userInfo.TEAMModelId,
+                    //'teacher.id': this.$store.state.userInfo.TEAMModelId,
                     'id': this.courseListS[this.curCusIndex][this.curClassIndex].id
                     'id': this.courseListS[this.curCusIndex][this.curClassIndex].id
                 }
                 }
                 this.$api.schoolSetting.getClassroomStudent(params).then(
                 this.$api.schoolSetting.getClassroomStudent(params).then(
@@ -546,7 +547,9 @@
             //添加上课班级
             //添加上课班级
             addClassroom(value) {
             addClassroom(value) {
                 if (value == 0) {
                 if (value == 0) {
-                    this.$store.dispatch('schoolBaseInfo/getClassroom')
+                    //直接读取登录成功拿到得学校基础信息
+                    this.schoolClassList = JSON.parse(JSON.stringify(this.$store.state.user.schoolProfile.school_classes))
+                    //this.$store.dispatch('schoolBaseInfo/getClassroom')
                     this.selectClassStatus = true
                     this.selectClassStatus = true
                 } else if (value == 1) {
                 } else if (value == 1) {
                     let randomCode = 'P'
                     let randomCode = 'P'
@@ -584,7 +587,7 @@
             },
             },
             //确认选择系统班级
             //确认选择系统班级
             confirmBindingClass() {
             confirmBindingClass() {
-                let curClass = this.$store.state.schoolBaseInfo.classroomList.filter((item) => {
+                let curClass = this.schoolClassList.filter((item) => {
                     return item.id == this.sysClass.id
                     return item.id == this.sysClass.id
                 })
                 })
                 if (curClass.length > 0) {
                 if (curClass.length > 0) {

+ 6 - 2
TEAMModelOS/ClientApp/src/view/newcourse/NewCoursePlan.vue

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

+ 2 - 2
TEAMModelOS/ClientApp/src/view/questionnaire/ManageQuestionnaire.vue

@@ -79,10 +79,10 @@
 								</DropdownMenu>
 								</DropdownMenu>
 							</Dropdown>
 							</Dropdown>
 						</div>
 						</div>
-						<div class="qn-box-header-tools-tool" style="margin-right: 25px;" @click="onShowAllAnalysis" v-show="currentQn.progress === 'finish' || currentQn.progress === 0">
+<!-- 						<div class="qn-box-header-tools-tool" style="margin-right: 25px;" @click="onShowAllAnalysis" v-show="currentQn.progress === 'finish' || currentQn.progress === 0">
 							<Icon type="md-podium" color="#dcdcdc" />
 							<Icon type="md-podium" color="#dcdcdc" />
 							<span>查看统计数据</span>
 							<span>查看统计数据</span>
-						</div>
+						</div> -->
 						<div class="qn-box-header-tools-tool" @click="onEditQn" v-show="currentQn.progress === 'pending' && qnList.length && !editable">
 						<div class="qn-box-header-tools-tool" @click="onEditQn" v-show="currentQn.progress === 'pending' && qnList.length && !editable">
 							<Icon type="md-create" color="#209460" />
 							<Icon type="md-create" color="#209460" />
 							<span>编辑问卷</span>
 							<span>编辑问卷</span>

+ 12 - 0
TEAMModelOS/ClientApp/src/view/schoolmgmt/ClassroomSetting/ClassroomSetting.less

@@ -385,3 +385,15 @@
         background: rgba(68,68,68,.5);
         background: rgba(68,68,68,.5);
     }
     }
 }
 }
+.hiteach-collapse{
+    &-main{
+        &:hover{
+            background-image: linear-gradient(90deg, rgba(30,30,30,0) 0%, rgba(110,110,110,.2) 50%, rgba(110,110,110,.4) 100%);
+        }
+    }
+    .hiteach-collapse-sub{
+        &:hover{
+            background-image: linear-gradient(90deg, #2a2a2e, #293942);
+        }
+    }
+}

+ 129 - 200
TEAMModelOS/ClientApp/src/view/schoolmgmt/ClassroomSetting/ClassroomSetting.vue

@@ -34,7 +34,7 @@
                             <div style="margin-top:5px;margin-bottom:10px;">
                             <div style="margin-top:5px;margin-bottom:10px;">
                                 <span>学段:</span>
                                 <span>学段:</span>
                                 <Select v-model="filterPeriod" style="width:80px" size="small" clearable @on-change="filterByPeriod">
                                 <Select v-model="filterPeriod" style="width:80px" size="small" clearable @on-change="filterByPeriod">
-                                    <Option v-for="(item,index) in $store.state.schoolBaseInfo.schoolBaseInfo.period" :value="item.id" :key="index">
+                                    <Option v-for="(item,index) in $store.state.user.schoolProfile.school_base.period" :value="item.id" :key="index">
                                         {{ item.name }}
                                         {{ item.name }}
                                     </Option>
                                     </Option>
                                 </Select>
                                 </Select>
@@ -137,7 +137,7 @@
                                     <FormItem prop="periodId" :label="$t('schoolBaseInfo.setPeriod')" @click.native.stop>
                                     <FormItem prop="periodId" :label="$t('schoolBaseInfo.setPeriod')" @click.native.stop>
                                     <span slot="label" class="class-attr-wrap-label">{{$t('schoolBaseInfo.setPeriod')}}</span>
                                     <span slot="label" class="class-attr-wrap-label">{{$t('schoolBaseInfo.setPeriod')}}</span>
                                     <Select @on-change="watchUpdate" :disabled="editStatus" v-model="classroomListShow[curClassIndex].periodId" clearable>
                                     <Select @on-change="watchUpdate" :disabled="editStatus" v-model="classroomListShow[curClassIndex].periodId" clearable>
-                                        <Option v-for="(item,index) in $store.state.schoolBaseInfo.schoolBaseInfo.period" :value="item.id" :key="index">
+                                        <Option v-for="(item,index) in $store.state.user.schoolProfile.school_base.period" :value="item.id" :key="index">
                                             {{ item.name }}
                                             {{ item.name }}
                                         </Option>
                                         </Option>
                                     </Select>
                                     </Select>
@@ -145,7 +145,7 @@
                                 <FormItem prop="gradeId" :label="$t('schoolBaseInfo.setGrade')" @click.native.stop class="requird-color">
                                 <FormItem prop="gradeId" :label="$t('schoolBaseInfo.setGrade')" @click.native.stop class="requird-color">
                                     <span slot="label" class="class-attr-wrap-label">{{$t('schoolBaseInfo.setGrade')}}</span>
                                     <span slot="label" class="class-attr-wrap-label">{{$t('schoolBaseInfo.setGrade')}}</span>
                                     <Select @on-change="watchUpdate" :disabled="editStatus" v-model="classroomListShow[curClassIndex].gradeId" clearable>
                                     <Select @on-change="watchUpdate" :disabled="editStatus" v-model="classroomListShow[curClassIndex].gradeId" clearable>
-                                        <Option v-for="(item,index) in $jsFn.getPeriod($store.state.schoolBaseInfo.schoolBaseInfo,classroomListShow[curClassIndex].periodId).grades" :value="item.id" :key="index">
+                                        <Option v-for="(item,index) in $jsFn.getPeriod($store.state.user.schoolProfile.school_base,classroomListShow[curClassIndex].periodId).grades" :value="item.id" :key="index">
                                             {{ item.name }}
                                             {{ item.name }}
                                         </Option>
                                         </Option>
                                     </Select>
                                     </Select>
@@ -153,7 +153,7 @@
                                 <FormItem prop="teacher" :label="$t('schoolBaseInfo.headmaster')" @click.native.stop class="requird-color">
                                 <FormItem prop="teacher" :label="$t('schoolBaseInfo.headmaster')" @click.native.stop class="requird-color">
                                     <span slot="label" class="class-attr-wrap-label">{{$t('schoolBaseInfo.headmaster')}}</span>
                                     <span slot="label" class="class-attr-wrap-label">{{$t('schoolBaseInfo.headmaster')}}</span>
                                     <Select @on-change="watchUpdate" :disabled="editStatus" v-model="classroomListShow[curClassIndex].teacher.id" clearable filterable>
                                     <Select @on-change="watchUpdate" :disabled="editStatus" v-model="classroomListShow[curClassIndex].teacher.id" clearable filterable>
-                                        <Option v-for="(item,index) in $store.state.teachers.teacherList" :value="item.id" :key="index" @click.native="classroomListShow[curClassIndex].teacher = {id:item.id, name:item.name}">
+                                        <Option v-for="(item,index) in $store.state.teachers.teacherList.filter(item=>item.status == 'join')" :value="item.id" :key="index" @click.native="classroomListShow[curClassIndex].teacher = {id:item.id, name:item.name}">
                                             {{ item.name }}
                                             {{ item.name }}
                                         </Option>
                                         </Option>
                                     </Select>
                                     </Select>
@@ -196,208 +196,72 @@
                         </div>
                         </div>
                         <div class="hiteach-code-wrap-list">
                         <div class="hiteach-code-wrap-list">
                             <vuescroll>
                             <vuescroll>
-                                <div class="hiteach-collapse" style="border-bottom: 1px solid #424242;position: relative;">
-                                    <div class="hiteach-collapse-main" style="display: flex;align-items: center;padding: 20px 0 20px 20px;">
+                                <div class="hiteach-collapse" style="border-bottom: 1px solid #424242;position: relative;cursor: pointer;" v-for="(item, index) in showhiteachData" :key="index">
+                                    <div @click="openHiSub(index)" class="hiteach-collapse-main" style="display: flex;align-items: center;padding: 20px 0 20px 20px;">
 
 
-                                        <Icon @click="stdFlag = !stdFlag" :type="stdFlag ? 'ios-arrow-up' : 'ios-arrow-down'" size="30" color="white" style="position: absolute;right: 5px;top: 20px;"/>
+                                        <Icon v-if="item.deviceMax > 1" :type="item.subOpen ? 'ios-arrow-up' : 'ios-arrow-down'" size="30" color="white" style="position: absolute;right: 5px;top: 20px;"/>
 
 
-                                        <v-icon style="width: 60px;height: 60px;margin-right: 30px;" iconClass="htc_std" />
-                                        <div style="font-size: 12px;letter-spacing: 1px;">
-                                            <ul>
-                                                <li>
-                                                    <h1 class="title" style="display: inline-block;margin-right: 12px;font-size: 16px;font-weight: 500;color: #bdbdbd;color:white;">HiTeach 5 STD</h1>
-                                                    <span style="margin-right: 12px;padding: 2px 5px;background: #1cc0f3;border-radius: 3px;color: white;;">大量</span>
-                                                    <span style="color: #1cc0f3;font-size:12px">2/2</span>
-                                                </li>
-                                                <li><span style="color: #1cc0f3;">3222IAVN-FJ4Y-F5EG-S3OI-4P1A</span></li>
-                                                <li>
-                                                    <Tag type="border" color="#8d8d8d">蘇格拉底議課</Tag>
-                                                    <Tag type="border" color="#8d8d8d">蘇格拉底報告</Tag>
-                                                    <Tag type="border" color="#8d8d8d">蘇格拉底桌面</Tag>
-                                                    <Tag type="border" color="#8d8d8d">蘇格拉底影片</Tag>
-                                                    <Tag type="border" color="#1cc0f3">遠距教室服務</Tag>
-                                                    <Tag type="border" color="#1cc0f3">錄播系統</Tag>
-                                                </li>
-                                                <li><span style="color: #8d8d8d;">序號到期日: </span>無到期日</li>
-                                            </ul>
-                                        </div>
-                                    </div>
-                                    <div v-if="stdFlag">
-                                        <div class="hiteach-collapse-sub testclass" style="display: flex;align-items: center;border-top: 1px solid rgb(66, 66, 66);margin-left: 20px;letter-spacing: 1px;font-size: 12px;padding: 20px;">
-                                            <Checkbox style="margin-right: 70px;" v-model="test1" disabled></Checkbox>
-                                            <div style="display: flex;justify-content: space-between;align-items: center;width: 100%;">
-                                                <ul>
-                                                    <!-- 被關聯要變色 -->
-                                                    <li style="color: #888888;">
-                                                        <h3>USER-PCCA062992</h3>
-                                                    </li>
-                                                    <li style="color: #888888;">
-                                                        <span>192.168.256 | 84FJID3LKSD88 </span>
-                                                    </li>
-                                                    <li style="color: #888888;">
-                                                        <span>Microsoft Winfows NT 10.0.18883.0 | Intel(R Core(TM i7-10700 CPU @ 2.9Ghz))</span>
-                                                    </li>
-                                                </ul>
-                                                <span style="color: #1cc0f3;padding: 0 15px;">
-                                                    已被關聯
-                                                </span>
-                                            </div>
-                                        </div>
-                                        <div class="hiteach-collapse-sub testclass" style="display: flex;align-items: center;border-top: 1px solid rgb(66, 66, 66);margin-left: 20px;letter-spacing: 1px;font-size: 12px;padding: 20px;">
-                                            <Checkbox style="margin-right: 70px;"></Checkbox>
-                                            <div style="display: flex;justify-content: space-between;align-items: center;width: 100%;">
-                                                <ul>
-                                                    <li>
-                                                        <h3>USER-PCCA062992</h3>
-                                                    </li>
-                                                    <li>
-                                                        <span>192.168.256 | 84FJID3LKSD88 </span>
-                                                    </li>
-                                                    <li>
-                                                        <span>Microsoft Winfows NT 10.0.18883.0 | Intel(R Core(TM i7-10700 CPU @ 2.9Ghz))</span>
-                                                    </li>
-                                                </ul>
-                                                <span v-if="false" style="color: #1cc0f3;padding: 0 15px;">
-                                                    已被關聯
-                                                </span>
-                                            </div>
-                                        </div>
-                                    </div>
-                                </div>
-                                <div class="hiteach-collapse" style="border-bottom: 1px solid #424242;position: relative;">
-                                    <div class="hiteach-collapse-main" style="display: flex;align-items: center;padding: 20px 0 20px 20px;">
-
-                                        <Icon @click="tblFlag = !tblFlag" :type="tblFlag ? 'ios-arrow-up' : 'ios-arrow-down'" size="30" color="white" style="position: absolute;right: 5px;top: 20px;"/>
-
-                                        <v-icon style="width: 60px;height: 60px;margin-right: 30px;" iconClass="htc_tbl" />
-                                        <div style="font-size: 12px;letter-spacing: 1px;">
-                                            <ul>
-                                                <li>
-                                                    <h1 class="title" style="display: inline-block;margin-right: 12px;font-size: 16px;font-weight: 500;color: #bdbdbd;color:white;">HiTeach 5 STD</h1>
-                                                    <span style="margin-right: 12px;padding: 2px 5px;background: #1cc0f3;border-radius: 3px;color: white;;">大量</span>
-                                                    <span style="color: #1cc0f3;font-size:12px">2/2</span>
-                                                </li>
-                                                <li><span style="color: #1cc0f3;">3222IAVN-FJ4Y-F5EG-S3OI-4P1A</span></li>
-                                                <li>
-                                                    <Tag type="border" color="#8d8d8d">蘇格拉底議課</Tag>
-                                                    <Tag type="border" color="#8d8d8d">蘇格拉底報告</Tag>
-                                                    <Tag type="border" color="#8d8d8d">蘇格拉底桌面</Tag>
-                                                    <Tag type="border" color="#8d8d8d">蘇格拉底影片</Tag>
-                                                    <Tag type="border" color="#1cc0f3">遠距教室服務</Tag>
-                                                    <Tag type="border" color="#1cc0f3">錄播系統</Tag>
-                                                </li>
-                                                <li><span style="color: #8d8d8d;">序號到期日: </span>無到期日</li>
-                                            </ul>
-                                        </div>
-                                    </div>
-                                    <div v-if="tblFlag">
-                                        <div class="hiteach-collapse-sub testclass" style="display: flex;align-items: center;border-top: 1px solid rgb(66, 66, 66);margin-left: 20px;letter-spacing: 1px;font-size: 12px;padding: 20px;">
-                                            <Checkbox style="margin-right: 70px;" v-model="test1" disabled></Checkbox>
-                                            <div style="display: flex;justify-content: space-between;align-items: center;width: 100%;">
-                                                <ul>
-                                                    <!-- 被關聯要變色 -->
-                                                    <li style="color: #888888;">
-                                                        <h3>USER-PCCA062992</h3>
-                                                    </li>
-                                                    <li style="color: #888888;">
-                                                        <span>192.168.256 | 84FJID3LKSD88 </span>
-                                                    </li>
-                                                    <li style="color: #888888;">
-                                                        <span>Microsoft Winfows NT 10.0.18883.0 | Intel(R Core(TM i7-10700 CPU @ 2.9Ghz))</span>
-                                                    </li>
-                                                </ul>
-                                                <span style="color: #1cc0f3;padding: 0 15px;">
-                                                    已被關聯
-                                                </span>
-                                            </div>
-                                        </div>
-                                        <div class="hiteach-collapse-sub testclass" style="display: flex;align-items: center;border-top: 1px solid rgb(66, 66, 66);margin-left: 20px;letter-spacing: 1px;font-size: 12px;padding: 20px;">
-                                            <Checkbox style="margin-right: 70px;"></Checkbox>
-                                            <div style="display: flex;justify-content: space-between;align-items: center;width: 100%;">
-                                                <ul>
-                                                    <li>
-                                                        <h3>USER-PCCA062992</h3>
-                                                    </li>
-                                                    <li>
-                                                        <span>192.168.256 | 84FJID3LKSD88 </span>
-                                                    </li>
-                                                    <li>
-                                                        <span>Microsoft Winfows NT 10.0.18883.0 | Intel(R Core(TM i7-10700 CPU @ 2.9Ghz))</span>
-                                                    </li>
-                                                </ul>
-                                                <span v-if="false" style="color: #1cc0f3;padding: 0 15px;">
-                                                    已被關聯
-                                                </span>
-                                            </div>
-                                        </div>
-                                    </div>
-                                </div>
-                                <div class="hiteach-collapse" style="border-bottom: 1px solid #424242;position: relative;">
-                                    <div class="hiteach-collapse-main" style="display: flex;align-items: center;padding: 20px 0 20px 20px;">
-
-                                        <Icon @click="proFlag = !proFlag" :type="proFlag ? 'ios-arrow-up' : 'ios-arrow-down'" size="30" color="white" style="position: absolute;right: 5px;top: 20px;"/>
+                                        <v-icon style="width: 60px;height: 60px;margin-right: 30px;" :iconClass="item.prodName == 'STD' ? 'htc_std' : item.prodName == 'TBL' ? 'htc_tbl' : 'htc_pro'" />
 
 
-                                        <v-icon style="width: 60px;height: 60px;margin-right: 30px;" iconClass="htc_pro" />
                                         <div style="font-size: 12px;letter-spacing: 1px;">
                                         <div style="font-size: 12px;letter-spacing: 1px;">
                                             <ul>
                                             <ul>
                                                 <li>
                                                 <li>
-                                                    <h1 class="title" style="display: inline-block;margin-right: 12px;font-size: 16px;font-weight: 500;color: #bdbdbd;color:white;">HiTeach 5 STD</h1>
-                                                    <span style="margin-right: 12px;padding: 2px 5px;background: #1cc0f3;border-radius: 3px;color: white;;">大量</span>
-                                                    <span style="color: #1cc0f3;font-size:12px">2/2</span>
+                                                    <h1 class="title" style="display: inline-block;margin-right: 12px;font-size: 16px;font-weight: 500;color: #bdbdbd;color:white;">
+                                                        {{ item.prodGroup +' '+item.prodName}}
+                                                    </h1>
+                                                    <span style="margin-right: 12px;padding: 2px 5px;background: #1cc0f3;border-radius: 3px;color: white;;">
+                                                        {{ item.deviceMax == 1 ? $t('單一') : $t('大量')}}
+                                                    </span>
+                                                    <span style="color: #1cc0f3;font-size:12px">
+                                                        <!-- 要增加被關聯了幾個 -->
+                                                        {{ item.deviceBound ? '0 / '+item.deviceMax : '-- / -- '}}
+                                                    </span>
                                                 </li>
                                                 </li>
-                                                <li><span style="color: #1cc0f3;">3222IAVN-FJ4Y-F5EG-S3OI-4P1A</span></li>
+                                                <li><span style="color: #1cc0f3;">{{ item.serial }}</span></li>
                                                 <li>
                                                 <li>
-                                                    <Tag type="border" color="#8d8d8d">蘇格拉底議課</Tag>
-                                                    <Tag type="border" color="#8d8d8d">蘇格拉底報告</Tag>
-                                                    <Tag type="border" color="#8d8d8d">蘇格拉底桌面</Tag>
-                                                    <Tag type="border" color="#8d8d8d">蘇格拉底影片</Tag>
-                                                    <Tag type="border" color="#1cc0f3">遠距教室服務</Tag>
-                                                    <Tag type="border" color="#1cc0f3">錄播系統</Tag>
+                                                    <Tag type="border" :color="item.aprule.sokapp ? '#1cc0f3' : '#8d8d8d'"> {{ $t('蘇格拉底議課')}}</Tag>
+                                                    <Tag type="border" :color="item.aprule.sokreport ? '#1cc0f3' : '#8d8d8d'"> {{ $t('蘇格拉底報告')}}</Tag>
+                                                    <Tag type="border" :color="item.aprule.sokDestop ? '#1cc0f3' : '#8d8d8d'"> {{ $t('蘇格拉底桌面')}}</Tag>
+                                                    <Tag type="border" :color="item.aprule.sokvdo ? '#1cc0f3' : '#8d8d8d'"> {{ $t('蘇格拉底影片')}}</Tag>
+                                                    <Tag type="border" :color="item.aprule.remoteSys ? '#1cc0f3' : '#8d8d8d'"> {{ $t('遠距教室服務')}}</Tag>
+                                                    <Tag type="border" :color="item.aprule.ezs ? '#1cc0f3' : '#8d8d8d'"> {{ $t('錄播系統')}}</Tag>
                                                 </li>
                                                 </li>
-                                                <li><span style="color: #8d8d8d;">序號到期日: </span>無到期日</li>
+                                                <li><span style="color: #8d8d8d;">序號到期日: </span>{{item.DateDate | timeFmt}}</li>
                                             </ul>
                                             </ul>
                                         </div>
                                         </div>
                                     </div>
                                     </div>
-                                    <div v-if="proFlag">
-                                        <div class="hiteach-collapse-sub testclass" style="display: flex;align-items: center;border-top: 1px solid rgb(66, 66, 66);margin-left: 20px;letter-spacing: 1px;font-size: 12px;padding: 20px;">
-                                            <Checkbox style="margin-right: 70px;" v-model="test1" disabled></Checkbox>
-                                            <div style="display: flex;justify-content: space-between;align-items: center;width: 100%;">
-                                                <ul>
-                                                    <!-- 被關聯要變色 -->
-                                                    <li style="color: #888888;">
-                                                        <h3>USER-PCCA062992</h3>
-                                                    </li>
-                                                    <li style="color: #888888;">
-                                                        <span>192.168.256 | 84FJID3LKSD88 </span>
-                                                    </li>
-                                                    <li style="color: #888888;">
-                                                        <span>Microsoft Winfows NT 10.0.18883.0 | Intel(R Core(TM i7-10700 CPU @ 2.9Ghz))</span>
-                                                    </li>
-                                                </ul>
-                                                <span style="color: #1cc0f3;padding: 0 15px;">
-                                                    已被關聯
-                                                </span>
+                                    <div v-if="item.subOpen" id="hiteach-1">
+                                        <template v-if="item.deviceBound.length >0">
+                                            <div v-for="(dbItem, dbIndex) in item.deviceBound" :key="dbIndex" class="hiteach-collapse-sub gradient" style="display: flex;align-items: center;border-top: 1px solid rgb(66, 66, 66);margin-left: 20px;letter-spacing: 1px;font-size: 12px;padding: 20px;">
+                                                <!-- 被關聯 disabled -->
+                                                <Checkbox style="margin-right: 70px;" v-model="test1"></Checkbox>
+                                                <div style="display: flex;justify-content: space-between;align-items: center;width: 100%;">
+                                                    <ul>
+                                                        <!-- 被關聯要變色 #888888;-->
+                                                        <li>
+                                                            <h3>{{ dbItem.uuid }}</h3>
+                                                        </li>
+                                                        <li>
+                                                            <span>{{ dbItem.ip }} | {{ dbItem.deveiceId }} </span>
+                                                        </li>
+                                                        <li>
+                                                            <span>{{ dbItem.computer }}</span>
+                                                        </li>
+                                                    </ul>
+                                                    <span v-if="false" style="color: #1cc0f3;padding: 0 15px;">
+                                                        已被關聯
+                                                    </span>
+                                                </div>
                                             </div>
                                             </div>
-                                        </div>
-                                        <div class="hiteach-collapse-sub testclass" style="display: flex;align-items: center;border-top: 1px solid rgb(66, 66, 66);margin-left: 20px;letter-spacing: 1px;font-size: 12px;padding: 20px;">
-                                            <Checkbox style="margin-right: 70px;"></Checkbox>
-                                            <div style="display: flex;justify-content: space-between;align-items: center;width: 100%;">
-                                                <ul>
-                                                    <li>
-                                                        <h3>USER-PCCA062992</h3>
-                                                    </li>
-                                                    <li>
-                                                        <span>192.168.256 | 84FJID3LKSD88 </span>
-                                                    </li>
-                                                    <li>
-                                                        <span>Microsoft Winfows NT 10.0.18883.0 | Intel(R Core(TM i7-10700 CPU @ 2.9Ghz))</span>
-                                                    </li>
-                                                </ul>
-                                                <span v-if="false" style="color: #1cc0f3;padding: 0 15px;">
-                                                    已被關聯
-                                                </span>
+                                        </template>
+                                        <template v-else>
+                                            <div class="hiteach-collapse-sub gradient" style="display: flex;align-items: center;border-top: 1px solid rgb(66, 66, 66);margin-left: 20px;letter-spacing: 1px;font-size: 12px;padding: 20px;">
+                                                <span style="margin-right: 70px;" ></span>
+                                                <div style="display: flex;justify-content: space-between;align-items: center;width: 100%;">
+                                                    {{ '此序號尚未啟用' }}
+                                                </div>
                                             </div>
                                             </div>
-                                        </div>
+                                        </template>
                                     </div>
                                     </div>
                                 </div>
                                 </div>
                                 <!-- <ul>
                                 <!-- <ul>
@@ -472,10 +336,12 @@
                 }
                 }
             }
             }
             return {
             return {
+                showhiteachData: [],
                 tblFlag: false,
                 tblFlag: false,
                 stdFlag: false,
                 stdFlag: false,
-                proFlag: false,                
+                proFlag: false,
                 test1: true,
                 test1: true,
+// 開發中
                 orderBy: 'id',
                 orderBy: 'id',
                 updateBefore:'',
                 updateBefore:'',
                 filterPeriod: undefined,
                 filterPeriod: undefined,
@@ -613,7 +479,30 @@
                 },
                 },
             }
             }
         },
         },
+        filters: {
+            timeFmt: function (val) {
+                if(val == 0 || val == 1){
+                    return val == 0 ? '已到期' : '無限期'
+                } else {
+                    let d = new Date(val),
+                    month = '' + (d.getMonth() + 1),
+                    day = '' + d.getDate(),
+                    year = d.getFullYear();
+
+                    if (month.length < 2) 
+                        month = '0' + month;
+                    if (day.length < 2) 
+                        day = '0' + day;
+
+                    return [year, month, day].join('/');
+                }
+            }
+        },
         computed: {
         computed: {
+            ...mapGetters({
+                periods: 'user/getPeriods', // 學制s
+                classes: 'user/getClasses', // 教室ID
+            }),
             filterPeriodName: function(){
             filterPeriodName: function(){
                 let pId = this.filterPeriod
                 let pId = this.filterPeriod
                 let name = ''
                 let name = ''
@@ -689,7 +578,6 @@
                         })
                         })
                         break;
                         break;
                 }
                 }
-                console.log(data)
                 return data
                 return data
             },
             },
             filterByPeriod() {
             filterByPeriod() {
@@ -996,7 +884,8 @@
                         this.isListLoading = true
                         this.isListLoading = true
                         this.$api.schoolSetting.classroomSettingSaveOrUpdate({
                         this.$api.schoolSetting.classroomSettingSaveOrUpdate({
                             classroom: this.classroomListShow[this.curClassIndex],
                             classroom: this.classroomListShow[this.curClassIndex],
-                            option: option
+                            option: option,
+                            school_code: this.$store.state.userInfo.schoolCode
                         }).then(
                         }).then(
                             res => {
                             res => {
                                 if (res) {
                                 if (res) {
@@ -1031,7 +920,16 @@
             },
             },
             getClassroom() {
             getClassroom() {
                 this.isListLoading = true
                 this.isListLoading = true
-                this.$store.dispatch('schoolBaseInfo/getClassroom').then(
+                //直接读取登录成功拿到得学校基础信息
+                this.classroomList = this.$store.state.user.schoolProfile.school_classes
+                if (this.classroomList.length > 0) {
+                    this.updateBefore = JSON.stringify(this.classroomList[0])
+                }
+                this.filterClassname()
+                setTimeout(() => {
+                    this.isListLoading = false
+                },500)
+                /*this.$store.dispatch('schoolBaseInfo/getClassroom').then(
                     (res) => {
                     (res) => {
                         if (res.code == 1 || res.code == 3) {
                         if (res.code == 1 || res.code == 3) {
                             this.classroomList = this.$store.state.schoolBaseInfo.classroomList
                             this.classroomList = this.$store.state.schoolBaseInfo.classroomList
@@ -1052,7 +950,7 @@
                     }
                     }
                 ).finally(() => {
                 ).finally(() => {
                     this.isListLoading = false
                     this.isListLoading = false
-                })
+                })*/
             },
             },
             /**显示确认删除班级对话框 */
             /**显示确认删除班级对话框 */
             showConfirmDelete() {
             showConfirmDelete() {
@@ -1072,7 +970,7 @@
                     this.$api.schoolSetting.delClassroom({
                     this.$api.schoolSetting.delClassroom({
                         id: this.classroomListShow[index].id,
                         id: this.classroomListShow[index].id,
                         scope: this.classroomListShow[index].scope,
                         scope: this.classroomListShow[index].scope,
-                        code: this.classroomListShow[index].code
+                        school_code: this.$store.state.userInfo.schoolCode
                     }).then(
                     }).then(
                         (res) => {
                         (res) => {
                             if (res.error == null) {
                             if (res.error == null) {
@@ -1258,12 +1156,44 @@
                 this.drawIcon(5, 6)
                 this.drawIcon(5, 6)
                 this.curClassIndex = 0
                 this.curClassIndex = 0
                 this.updateBefore = JSON.stringify(this.classroomListShow[this.curClassIndex])
                 this.updateBefore = JSON.stringify(this.classroomListShow[this.curClassIndex])
+            },
+            initHiteachData: async function () {
+                let temp;                
+                await this.getHiteachList().then( res=>{
+                    temp = res.map( item => {
+                        item.subOpen = false
+                        if(item.deviceMax == 1) item.subOpen = true
+                        return item        
+                    })
+                    console.log(temp, '3333333333333333333333')
+                })
+                console.log(temp, 'temp')
+                this.showhiteachData = temp
+                console.log(this.showhiteachData, 'showhiteachData')
+            },
+            getHiteachList: async function() {
+                let data = []
+                await this.$api.classroom.GetHiteachList(this.$store.state.user.schoolCode).then(
+                    (res) => {
+                        data = res.data
+                    },
+                    (err) => {
+                        this.$Message.error('API error!')
+                    }
+                )
+                return data
+            },
+            openHiSub(index){
+                if(this.showhiteachData.length > 0){
+                    this.showhiteachData[index].subOpen = !this.showhiteachData[index].subOpen
+                }
             }
             }
         },
         },
         mounted() {
         mounted() {
             this.filterClassname()
             this.filterClassname()
             this.filterCode()
             this.filterCode()
             this.initData()
             this.initData()
+            this.initHiteachData()
         },
         },
         beforeRouteLeave(to, from, next) {
         beforeRouteLeave(to, from, next) {
             if (this.updated) {
             if (this.updated) {
@@ -1294,7 +1224,6 @@
         },
         },
         created() {
         created() {
             this.editStatus = this.noStatus
             this.editStatus = this.noStatus
-            this.getClassroom()
             this.$store.dispatch('teachers/getTeacherList').then(res => { })
             this.$store.dispatch('teachers/getTeacherList').then(res => { })
         }
         }
     }
     }
@@ -1385,7 +1314,7 @@
         
         
 </style>
 </style>
 <style lang="less">
 <style lang="less">
-.testclass{
+.gradient{
     @keyframes Itemfadein {
     @keyframes Itemfadein {
           0% {
           0% {
             opacity: 0;
             opacity: 0;

+ 46 - 11
TEAMModelOS/ClientApp/src/view/schoolmgmt/SystemSetting/SystemSetting.vue

@@ -661,22 +661,59 @@
                 this.isLoading = true
                 this.isLoading = true
                 this.$api.schoolSetting.schoolSettingSaveOrUpdate(this.schoolSetting).then(
                 this.$api.schoolSetting.schoolSettingSaveOrUpdate(this.schoolSetting).then(
                     (res) => {
                     (res) => {
-                        if (res.error == null) {
+                        if (!res.error) {
                             this.$Message.success(this.$t('schoolBaseInfo.ssTips3'))
                             this.$Message.success(this.$t('schoolBaseInfo.ssTips3'))
                             this.updated = false
                             this.updated = false
-                            this.isLoading = false
-                            this.editSemIndex = -1
-                            this.editTZStatsu = true
+                            this.$store.commit('user/setSchoolBase', this.schoolSetting)
                         }
                         }
                     },
                     },
                     (err) => {
                     (err) => {
-                        this.isLoading = false
+                        console.log(err)
+                        this.$Message.error('保存失败!')
                     }
                     }
-                )
+                ).finally(() => {
+                    setTimeout(() => {
+                        this.isLoading = false
+                    },400)
+                })
             },
             },
             getSchoolBaseData() {
             getSchoolBaseData() {
                 this.isLoading = true
                 this.isLoading = true
-                this.$store.dispatch('schoolBaseInfo/getSchoolBaseData').then(
+                //直接读取登录成功拿到得学校基础信息
+                this.schoolSetting = JSON.parse(JSON.stringify(this.$store.state.user.schoolProfile.school_base))
+                if (this.schoolSetting) {
+                    if (this.schoolSetting.period[this.curPriodIndex].semesters.length > 0) {
+                        //计算学期天数
+                        if (!this.schoolSetting.period[this.curPriodIndex].semesters[0].days) {
+                            let count = 365
+                            let index = 0
+                            let year = new Date().getFullYear()
+                            for (let i = 0; i < this.schoolSetting.period[this.curPriodIndex].semesters.length; i++) {
+                                if (i == (this.schoolSetting.period[this.curPriodIndex].semesters.length - 1)) {
+                                    index = i
+                                    break
+                                } else {
+                                    let sDate = year + '-' + this.schoolSetting.period[this.curPriodIndex].semesters[i].month + '-' + this.schoolSetting.period[this.curPriodIndex].semesters[i].day
+                                    let eDate = year + '-' + this.schoolSetting.period[this.curPriodIndex].semesters[i + 1].month + '-' + this.schoolSetting.period[this.curPriodIndex].semesters[i + 1].day
+                                    let d = this.getDays(sDate, eDate)
+                                    count -= d
+                                    this.$set(this.schoolSetting.period[this.curPriodIndex].semesters[i], 'days', d)
+
+                                }
+                            }
+                            this.$set(this.schoolSetting.period[this.curPriodIndex].semesters[index], 'days', count)
+                        }
+                        this.updated = false
+                    }
+                } else {
+                    this.getLocalDefaultData()
+                    this.schoolSetting.period[0].grades = JSON.parse(JSON.stringify(this.dataDefault.grades))
+                    this.schoolSetting.period[0].subjects = JSON.parse(JSON.stringify(this.dataDefault.subjects))
+                }
+                setTimeout(() => {
+                    this.isLoading = false
+                }, 500)
+                /*this.$store.dispatch('schoolBaseInfo/getSchoolBaseData').then(
                     (res) => {
                     (res) => {
                         if (res.code == 1 || res.code == 3) {
                         if (res.code == 1 || res.code == 3) {
                             this.isInit = true
                             this.isInit = true
@@ -718,7 +755,7 @@
                     setTimeout(() => {
                     setTimeout(() => {
                         this.isLoading = false
                         this.isLoading = false
                     }, 500)
                     }, 500)
-                })
+                })*/
             },
             },
             handleData() {
             handleData() {
                 for (let i = 0; i < this.schoolSetting.period.length; i++) {
                 for (let i = 0; i < this.schoolSetting.period.length; i++) {
@@ -808,13 +845,11 @@
             },
             },
             getLocalDefaultData() {
             getLocalDefaultData() {
                 let data = require('@/static/baseDataDefault.json')
                 let data = require('@/static/baseDataDefault.json')
-                console.log(data)
                 let lang = window.localStorage.getItem('local')
                 let lang = window.localStorage.getItem('local')
                 let result = data.filter(item => {
                 let result = data.filter(item => {
                     return item.lang == lang
                     return item.lang == lang
                 })
                 })
                 this.dataDefault = result.length > 0 ? result[0] : data[0]
                 this.dataDefault = result.length > 0 ? result[0] : data[0]
-                console.log(this.dataDefault)
             },
             },
             //根据语言读取时区列表
             //根据语言读取时区列表
             getTimeZoneList() {
             getTimeZoneList() {
@@ -845,7 +880,7 @@
             }
             }
         },
         },
         created() {
         created() {
-            this.getLocalDefaultData()
+            //this.getLocalDefaultData()
             this.initData()
             this.initData()
             this.getSchoolBaseData()
             this.getSchoolBaseData()
             this.getTimeZoneList()
             this.getTimeZoneList()

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

@@ -19,12 +19,12 @@
                         </FormItem>
                         </FormItem>
                         <FormItem label="学段" prop="periodCode">
                         <FormItem label="学段" prop="periodCode">
                             <Select v-model="orderLearnInfo.periodCode">
                             <Select v-model="orderLearnInfo.periodCode">
-                                <Option v-for="(item,index) in $store.state.schoolBaseInfo.schoolBaseInfo.period" :value="item.id" :key="index">{{ item.name }}</Option>
+                                <Option v-for="(item,index) in $store.state.user.schoolProfile.school_base.period" :value="item.id" :key="index">{{ item.name }}</Option>
                             </Select>
                             </Select>
                         </FormItem>
                         </FormItem>
                         <FormItem label="科目" prop="subjectCode">
                         <FormItem label="科目" prop="subjectCode">
                             <Select v-model="orderLearnInfo.subjectCode" not-found-text="请先选择学段">
                             <Select v-model="orderLearnInfo.subjectCode" not-found-text="请先选择学段">
-                                <Option v-for="(item,index) in $jsFn.getPeriod($store.state.schoolBaseInfo.schoolBaseInfo,orderLearnInfo.periodCode).subjects" :value="item.id" :key="index">{{ item.name }}</Option>
+                                <Option v-for="(item,index) in $jsFn.getPeriod($store.state.user.schoolProfile.school_base,orderLearnInfo.periodCode).subjects" :value="item.id" :key="index">{{ item.name }}</Option>
                             </Select>
                             </Select>
                         </FormItem>
                         </FormItem>
                         <FormItem label="描述" prop="introduce">
                         <FormItem label="描述" prop="introduce">

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

@@ -21,7 +21,7 @@
                     <p class="base-info-value">
                     <p class="base-info-value">
 
 
                         <!--{{orderLearnInfo.periodCode}}-->
                         <!--{{orderLearnInfo.periodCode}}-->
-                        {{$jsFn.getPeriod($store.state.schoolBaseInfo.schoolBaseInfo, orderLearnInfo.periodCode).periodName}}
+                        {{$jsFn.getPeriod($store.state.user.schoolProfile.school_base, orderLearnInfo.periodCode).periodName}}
                     </p>
                     </p>
                 </div>
                 </div>
                 <div class="base-info-item">
                 <div class="base-info-item">
@@ -29,7 +29,7 @@
                         学科:
                         学科:
                     </span>
                     </span>
                     <p class="base-info-value">
                     <p class="base-info-value">
-                        {{$jsFn.getSubjectName($store.state.schoolBaseInfo.schoolBaseInfo, orderLearnInfo.subjectCode)}}
+                        {{$jsFn.getSubjectName($store.state.user.schoolProfile.school_base, orderLearnInfo.subjectCode)}}
                     </p>
                     </p>
                 </div>
                 </div>
                 <div class="base-info-item">
                 <div class="base-info-item">

+ 55 - 34
TEAMModelOS/ClientApp/src/view/settings/SchoolMgmt.vue

@@ -22,6 +22,7 @@
 								<span>{{ item.name }}</span>
 								<span>{{ item.name }}</span>
 								<span class="school-item-status" :style='{ background:bgFilter(item.status) }'>{{ statusFilter(item.status) }}</span>
 								<span class="school-item-status" :style='{ background:bgFilter(item.status) }'>{{ statusFilter(item.status) }}</span>
 								<span class="school-item-status" style="background-color: #008352;" v-show="item.schoolId === teacherInfo.defaultschool">默认学校</span>
 								<span class="school-item-status" style="background-color: #008352;" v-show="item.schoolId === teacherInfo.defaultschool">默认学校</span>
+								<span class="school-item-status" style="background-color: #f59a2a;" v-show="item.schoolId === curSchool">当前学校</span>
 							</span>
 							</span>
 							<span class="school-item-code">{{ item.schoolId  }}</span>
 							<span class="school-item-code">{{ item.schoolId  }}</span>
 							<span class="school-item-nums" v-if="item.status === 'join'">
 							<span class="school-item-nums" v-if="item.status === 'join'">
@@ -43,7 +44,7 @@
 								于 2020-08-02 送出添加邀请
 								于 2020-08-02 送出添加邀请
 							</span>
 							</span>
 							<span class="school-item-role">{{ item.role }}</span>
 							<span class="school-item-role">{{ item.role }}</span>
-							<span class="school-item-btn" v-if="item.status === 'join'" @click="onGoSchool(item)">
+							<span class="school-item-btn" v-if="item.status === 'join' && item.schoolId !== curSchool" @click="onGoSchool(item)">
 								<span>
 								<span>
 									<Icon type="md-swap" style="transform: rotate(90deg);" />
 									<Icon type="md-swap" style="transform: rotate(90deg);" />
 									<span>前往学校</span>
 									<span>前往学校</span>
@@ -151,6 +152,9 @@
 									props: {
 									props: {
 										type: 'primary'
 										type: 'primary'
 									},
 									},
+									style: {
+										display: this.mySchoolList.length ? (this.mySchoolList.map(i => i.schoolId).indexOf(params.row.id)  > -1 ? 'none' : 'unset') : 'unset'
+									},
 									on: {
 									on: {
 										click: () => {
 										click: () => {
 											this.onJoinSchool(params.row)
 											this.onJoinSchool(params.row)
@@ -164,13 +168,21 @@
 			}
 			}
 		},
 		},
 		created() {
 		created() {
-			this.getTeacherInfo()
+			this.initTeacherInfo()
 			this.getAllShoolList()
 			this.getAllShoolList()
 
 
 			this.mySchoolList = []
 			this.mySchoolList = []
 
 
 		},
 		},
 		methods: {
 		methods: {
+			
+			async initTeacherInfo(){
+				let teacherInfo = await this.getTeacherInfo()
+				this.teacherInfo = teacherInfo
+				this.mySchoolList = teacherInfo.schools
+				this.originMySchoolList = JSON.parse(JSON.stringify(this.mySchoolList))
+			},
+			
 			/* 前往学校 */
 			/* 前往学校 */
 			onGoSchool(school) {
 			onGoSchool(school) {
 				this.curSchoolItem = school
 				this.curSchoolItem = school
@@ -179,22 +191,24 @@
 
 
 			/* 获取老师的个人清单信息 */
 			/* 获取老师的个人清单信息 */
 			getTeacherInfo() {
 			getTeacherInfo() {
-				this.isLoading = true
-				this.$api.schoolSetting.getTeacherInfo({
-					id_token: localStorage.getItem('id_token')
-				}).then(
-					(res) => {
-						if (!res.error) {
-							this.teacherInfo = res
-							this.mySchoolList = res.schools
-							this.originMySchoolList = JSON.parse(JSON.stringify(this.mySchoolList))
-							this.isLoading = false
+				return new Promise((r,j) => {
+					this.isLoading = true
+					this.$api.schoolSetting.getTeacherInfo({
+						id_token: localStorage.getItem('id_token')
+					}).then(
+						(res) => {
+							if (!res.error) {
+								r(res)
+								this.isLoading = false
+							}
+						},
+						(err) => {
+							console.log(err)
+							this.$Message.error("数据获取失败!")
 						}
 						}
-					},
-					(err) => {
-						this.$Message.error("数据获取失败!")
-					}
-				)
+					)
+				})
+				
 			},
 			},
 
 
 			/* 获取老师所在学校的信息 */
 			/* 获取老师所在学校的信息 */
@@ -248,7 +262,7 @@
 								console.log(res)
 								console.log(res)
 								if (!res.error) {
 								if (!res.error) {
 									this.$Message.success("提交成功!")
 									this.$Message.success("提交成功!")
-									this.getTeacherInfo()
+									this.initTeacherInfo()
 									this.getAllShoolList()
 									this.getAllShoolList()
 								}
 								}
 							},
 							},
@@ -276,11 +290,23 @@
 							school_code:item.schoolId,
 							school_code:item.schoolId,
 							school_name:item.name
 							school_name:item.name
 						}).then(
 						}).then(
-							(res) => {
+							async (res) => {
 								console.log(res)
 								console.log(res)
 								if (!res.error) {
 								if (!res.error) {
 									this.$Message.success("加入成功!")
 									this.$Message.success("加入成功!")
-									this.getTeacherInfo()
+									// 如果之前用户没有加入任何学校
+									if(this.mySchoolList.filter(i => i.status === 'join').length === 0){
+										let teacherInfo = await this.getTeacherInfo()
+										let schoolCode = teacherInfo.schools[0].schoolId
+										let schoolInfo = await this.getTeacherSchoolInfo(schoolCode)
+										this.$EventBus.$emit('onChangeSchool', {
+											user:teacherInfo,
+											schoolCode:schoolCode
+										})
+										this.$EventBus.$off('onChangeSchool')
+									}else{
+										this.initTeacherInfo()
+									}
 								}
 								}
 							},
 							},
 							(err) => {
 							(err) => {
@@ -295,21 +321,13 @@
 			
 			
 			/* 前往学校 */
 			/* 前往学校 */
 			async onChangeSchool(){
 			async onChangeSchool(){
-				this.$EventBus.$emit('onGlobalLoading',true)
-				let schoolInfo = await this.getTeacherSchoolInfo(this.curSchoolItem.schoolId)
-				this.$store.commit('setSchoolCode',this.curSchoolItem.schoolId)
-				this.$store.commit('schoolBaseInfo/setSchoolInfo',{ period:[] })
-				this.$store.commit('schoolBaseInfo/setClassroomList', undefined)
-				this.$store.dispatch('user/setSchoolCode', this.curSchoolItem.schoolId)
-				this.$store.dispatch('user/setSchoolProfile', schoolInfo)
-				console.log('切换学校为' + this.curSchoolItem.schoolId)
-				console.log(this.$store.state)
-				setTimeout(() => {
-					this.$EventBus.$emit('onGlobalLoading',false)
-				},500)
-				this.$router.push({
-					name:'home'
+				console.log('触发切换学校')
+				this.$EventBus.$emit('onChangeSchool', {
+					user:this.teacherInfo,
+					schoolCode:this.curSchoolItem.schoolId
 				})
 				})
+				// this.$EventBus.$off('onChangeSchool')
+				this.goSchoolModal = false
 			},
 			},
 			
 			
 			/* 搜索我的学校 */
 			/* 搜索我的学校 */
@@ -334,6 +352,9 @@
 				return status => {
 				return status => {
 					return status === 'join' ? '#1CC0F3' : status === 'invite' ? '#ea6223' : '#019eff'
 					return status === 'join' ? '#1CC0F3' : status === 'invite' ? '#ea6223' : '#019eff'
 				}
 				}
+			},
+			curSchool(){
+				return this.$store.state.userInfo.schoolCode
 			}
 			}
 		}
 		}
 	}
 	}

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

@@ -265,7 +265,6 @@
                 let storePath = (data.action == 1 ? 'schoolBaseInfo/addStudentsToState' : 'schoolBaseInfo/uptStudentsToState')
                 let storePath = (data.action == 1 ? 'schoolBaseInfo/addStudentsToState' : 'schoolBaseInfo/uptStudentsToState')
                 this.$store.dispatch(storePath, newStudents)
                 this.$store.dispatch(storePath, newStudents)
                 this.addStudentStatus = false
                 this.addStudentStatus = false
-                this.$store.dispatch('user/updSchoolProfileBasicInfo')
                 this.filterData()
                 this.filterData()
             },
             },
             closeImportStudent(data) {
             closeImportStudent(data) {
@@ -277,7 +276,6 @@
                     return temp
                     return temp
                 })
                 })
                 this.$store.dispatch('schoolBaseInfo/addStudentsToState', newStudents)
                 this.$store.dispatch('schoolBaseInfo/addStudentsToState', newStudents)
-                this.$store.dispatch('user/updSchoolProfileBasicInfo')
                 this.importStudentStatus = false
                 this.importStudentStatus = false
                 this.filterData()
                 this.filterData()
                 // this.totalNum += data.length
                 // this.totalNum += data.length
@@ -557,8 +555,10 @@
                     data = data.filter(function(item){
                     data = data.filter(function(item){
                         return item.periodId == periodId
                         return item.periodId == periodId
                     })
                     })
+                    return data
+                } else {
+                    return []
                 }
                 }
-                return data
             },
             },
             filterClasses: function(){
             filterClasses: function(){
                 var data = this.classes
                 var data = this.classes
@@ -567,11 +567,16 @@
                     data = data.filter(function(item){
                     data = data.filter(function(item){
                         return item.gradeId == gradeId
                         return item.gradeId == gradeId
                     })
                     })
+                    return data
+                } else {
+                    return []
                 }
                 }
-                return data
             }
             }
         },
         },
         mounted() {
         mounted() {
+            if(Array.isArray(this.periods)){
+                this.searchPeriod = this.periods[0].id
+            }
         }
         }
     }
     }
 </script>
 </script>

+ 10 - 11
TEAMModelOS/ClientApp/src/view/student-analysis/total-analysis/EvaluationList/TotalIndex.vue

@@ -263,21 +263,20 @@
 		methods: {
 		methods: {
 			/* 获取当前学校基础信息 */
 			/* 获取当前学校基础信息 */
 			getSchoolInfo() {
 			getSchoolInfo() {
-				this.$store.dispatch('schoolBaseInfo/getSchoolBaseData').then(res => {
-					this.schoolData = res.data
-					let schoolData = res.data
-					let filterJson = this.$store.state.totalAnalysis.filterData
-					if(schoolData.period.length){
-						this.filterData.periodList = schoolData.period
-						this.filterData.gradeList = schoolData.period[0].grades
-						this.filterData.subjectList = schoolData.period[0].subjects
-						this.filterData.termList = schoolData.period[0].semesters
+				let schoolBaseInfo = JSON.parse(JSON.stringify(this.$store.state.user.schoolProfile.school_base))
+				let filterJson = this.$store.state.totalAnalysis.filterData
+				if(schoolBaseInfo){
+					this.schoolData = schoolBaseInfo
+					if(schoolBaseInfo.period.length){
+						this.filterData.periodList = schoolBaseInfo.period
+						this.filterData.gradeList = schoolBaseInfo.period[0].grades
+						this.filterData.subjectList = schoolBaseInfo.period[0].subjects
+						this.filterData.termList = schoolBaseInfo.period[0].semesters
 						this.filterData.typeList = filterJson.typeList
 						this.filterData.typeList = filterJson.typeList
 						this.filterData.areaList = filterJson.areaList
 						this.filterData.areaList = filterJson.areaList
 						this.filterData.feedbackList = filterJson.feedbackList
 						this.filterData.feedbackList = filterJson.feedbackList
 					}
 					}
-					console.log(res)
-				})
+				}
 			},
 			},
 			// 获取学情首页数据
 			// 获取学情首页数据
 			getHomePageData() {
 			getHomePageData() {

+ 0 - 0
TEAMModelOS/ClientApp/src/view/student-web/App.vue


Some files were not shown because too many files changed in this diff