瀏覽代碼

Merge remote-tracking branch 'origin/develop3.0' into develop3.0

osbert 4 年之前
父節點
當前提交
37c30e6c39
共有 94 個文件被更改,包括 3482 次插入2563 次删除
  1. 1 4
      TEAMModelFunction/MonitorCosmosDB.cs
  2. 34 6
      TEAMModelFunction/ServiceBusTopic.cs
  3. 79 0
      TEAMModelFunction/model/Classroom.cs
  4. 52 0
      TEAMModelFunction/model/ExamClassResult.cs
  5. 120 0
      TEAMModelFunction/model/ExamInfo.cs
  6. 51 0
      TEAMModelFunction/model/ExamResult.cs
  7. 141 0
      TEAMModelFunction/model/Survey.cs
  8. 108 0
      TEAMModelFunction/model/Vote.cs
  9. 29 7
      TEAMModelOS.SDK/DI/AzureServiceBus/AzureServiceBusExtensions.cs
  10. 4 2
      TEAMModelOS/ClientApp/src/api/login.js
  11. 4 4
      TEAMModelOS/ClientApp/src/api/stuAccount.js
  12. 10 1
      TEAMModelOS/ClientApp/src/api/studentWeb.js
  13. 46 0
      TEAMModelOS/ClientApp/src/assets/iconfont/demo_index.html
  14. 14 6
      TEAMModelOS/ClientApp/src/assets/iconfont/iconfont.css
  15. 二進制
      TEAMModelOS/ClientApp/src/assets/iconfont/iconfont.eot
  16. 1 1
      TEAMModelOS/ClientApp/src/assets/iconfont/iconfont.js
  17. 14 0
      TEAMModelOS/ClientApp/src/assets/iconfont/iconfont.json
  18. 6 0
      TEAMModelOS/ClientApp/src/assets/iconfont/iconfont.svg
  19. 二進制
      TEAMModelOS/ClientApp/src/assets/iconfont/iconfont.ttf
  20. 二進制
      TEAMModelOS/ClientApp/src/assets/iconfont/iconfont.woff
  21. 二進制
      TEAMModelOS/ClientApp/src/assets/iconfont/iconfont.woff2
  22. 1 0
      TEAMModelOS/ClientApp/src/assets/student-web/component_styles/lesson-testpop.less
  23. 78 70
      TEAMModelOS/ClientApp/src/common/BaseSelectSchool.vue
  24. 0 1
      TEAMModelOS/ClientApp/src/common/BaseUserPoptip.vue
  25. 28 9
      TEAMModelOS/ClientApp/src/common/NewUploadFile.vue
  26. 3 3
      TEAMModelOS/ClientApp/src/components/coursemgmt/StudentList.vue
  27. 2 3
      TEAMModelOS/ClientApp/src/components/learnactivity/BaseHwForm.vue
  28. 55 27
      TEAMModelOS/ClientApp/src/components/learnactivity/BaseVoteForm.vue
  29. 21 6
      TEAMModelOS/ClientApp/src/components/learnactivity/ChooseContent.vue
  30. 25 25
      TEAMModelOS/ClientApp/src/components/learnactivity/GradeList.vue
  31. 25 10
      TEAMModelOS/ClientApp/src/components/learnactivity/NewChooseContent.vue
  32. 25 6
      TEAMModelOS/ClientApp/src/components/questionnaire/BaseQnForm.vue
  33. 48 31
      TEAMModelOS/ClientApp/src/components/student-web/EventBasicInfo.vue
  34. 8 7
      TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContent.vue
  35. 372 364
      TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContentTypeTemplate/LessonTest.vue
  36. 720 770
      TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContentTypeTemplate/LessonTestPop.vue
  37. 327 379
      TEAMModelOS/ClientApp/src/components/student-web/EventView/EventList.vue
  38. 0 3
      TEAMModelOS/ClientApp/src/store/index.js
  39. 4 0
      TEAMModelOS/ClientApp/src/store/module/schoolBaseInfo.js
  40. 215 206
      TEAMModelOS/ClientApp/src/store/module/studentWeb.js
  41. 26 32
      TEAMModelOS/ClientApp/src/store/module/user.js
  42. 3 0
      TEAMModelOS/ClientApp/src/utils/blobTool.js
  43. 32 2
      TEAMModelOS/ClientApp/src/utils/evTools.js
  44. 4 4
      TEAMModelOS/ClientApp/src/utils/public.js
  45. 0 14
      TEAMModelOS/ClientApp/src/view/Home.vue
  46. 13 10
      TEAMModelOS/ClientApp/src/view/evaluation/bank/ExerciseList.vue
  47. 5 6
      TEAMModelOS/ClientApp/src/view/evaluation/bank/TestPaperList.vue
  48. 0 1
      TEAMModelOS/ClientApp/src/view/evaluation/components/BaseChild.vue
  49. 13 11
      TEAMModelOS/ClientApp/src/view/evaluation/components/BaseCreateChild.vue
  50. 14 11
      TEAMModelOS/ClientApp/src/view/evaluation/components/BaseEditExercise.vue
  51. 1 1
      TEAMModelOS/ClientApp/src/view/evaluation/components/BaseExerciseList.vue
  52. 89 84
      TEAMModelOS/ClientApp/src/view/evaluation/components/BaseFilter.vue
  53. 10 7
      TEAMModelOS/ClientApp/src/view/evaluation/components/BaseRepair.vue
  54. 8 16
      TEAMModelOS/ClientApp/src/view/evaluation/index/CreateExercises.vue
  55. 4 12
      TEAMModelOS/ClientApp/src/view/evaluation/index/CreatePaper.vue
  56. 3 2
      TEAMModelOS/ClientApp/src/view/evaluation/index/TestPaper.vue
  57. 30 30
      TEAMModelOS/ClientApp/src/view/evaluation/types/BaseCompletion.vue
  58. 9 0
      TEAMModelOS/ClientApp/src/view/evaluation/types/BaseSubjective.vue
  59. 58 35
      TEAMModelOS/ClientApp/src/view/knowledge-point/index/Index.vue
  60. 8 6
      TEAMModelOS/ClientApp/src/view/knowledge-point/index/operation/AddBlock.vue
  61. 25 21
      TEAMModelOS/ClientApp/src/view/knowledge-point/index/operation/ComposeBlock.vue
  62. 4 1
      TEAMModelOS/ClientApp/src/view/learnactivity/ManageEvaluation.vue
  63. 8 18
      TEAMModelOS/ClientApp/src/view/newcourse/CourseBaseSetting.vue
  64. 4 4
      TEAMModelOS/ClientApp/src/view/newcourse/CourseClassroom.vue
  65. 13 21
      TEAMModelOS/ClientApp/src/view/newcourse/CoursePlan.vue
  66. 7 9
      TEAMModelOS/ClientApp/src/view/newcourse/CourseTable.vue
  67. 1 1
      TEAMModelOS/ClientApp/src/view/newcourse/CourseTime.vue
  68. 11 5
      TEAMModelOS/ClientApp/src/view/newcourse/ManageCourse.vue
  69. 8 5
      TEAMModelOS/ClientApp/src/view/newcourse/MyCourse.vue
  70. 6 2
      TEAMModelOS/ClientApp/src/view/newcourse/NewCoursePlan.vue
  71. 2 2
      TEAMModelOS/ClientApp/src/view/questionnaire/ManageQuestionnaire.vue
  72. 12 0
      TEAMModelOS/ClientApp/src/view/schoolmgmt/ClassroomSetting/ClassroomSetting.less
  73. 27 17
      TEAMModelOS/ClientApp/src/view/schoolmgmt/ClassroomSetting/ClassroomSetting.vue
  74. 46 11
      TEAMModelOS/ClientApp/src/view/schoolmgmt/SystemSetting/SystemSetting.vue
  75. 2 2
      TEAMModelOS/ClientApp/src/view/selfstudy/CreateOrderLearn.vue
  76. 2 2
      TEAMModelOS/ClientApp/src/view/selfstudy/OrderLearnInfo.vue
  77. 9 4
      TEAMModelOS/ClientApp/src/view/student-account/Index.vue
  78. 10 11
      TEAMModelOS/ClientApp/src/view/student-analysis/total-analysis/EvaluationList/TotalIndex.vue
  79. 21 15
      TEAMModelOS/ClientApp/src/view/syllabus/newSyllabus/Index.vue
  80. 14 10
      TEAMModelOS/ClientApp/src/view/syllabus/newSyllabus/operation/AddVolume.vue
  81. 4 5
      TEAMModelOS/ClientApp/src/view/teachcontent/index.less
  82. 115 87
      TEAMModelOS/ClientApp/src/view/teachcontent/index.vue
  83. 2 2
      TEAMModelOS/ClientApp/src/view/teachermgmt/components/personnel/Index.vue
  84. 5 4
      TEAMModelOS/ClientApp/src/view/vote/ManageVote.vue
  85. 4 4
      TEAMModelOS/Controllers/Client/HiTeachController.cs
  86. 47 21
      TEAMModelOS/Controllers/Exam/ExamController.cs
  87. 19 17
      TEAMModelOS/Controllers/School/ClassRoomController.cs
  88. 3 3
      TEAMModelOS/Controllers/School/SchoolTeacherController.cs
  89. 15 5
      TEAMModelOS/Controllers/Task/SurveyController.cs
  90. 18 9
      TEAMModelOS/Controllers/Task/VoteController.cs
  91. 14 7
      TEAMModelOS/Controllers/Teacher/InitController.cs
  92. 1 1
      TEAMModelOS/Models/SchoolInfo/ExamInfo.cs
  93. 1 1
      TEAMModelOS/Models/SchoolInfo/SchoolTeacher.cs
  94. 1 1
      TEAMModelOS/Models/SchoolInfo/Vote.cs

+ 1 - 4
TEAMModelFunction/MonitorCosmosDB.cs

@@ -9,7 +9,6 @@ using Microsoft.Azure.WebJobs;
 using Microsoft.Azure.WebJobs.Host;
 using Microsoft.Extensions.Logging;
 using TEAMModelOS.Models.CommonInfo;
-using TEAMModelOS.Models.SchoolInfo;
 using TEAMModelOS.SDK.DI;
 using TEAMModelOS.SDK.Extension;
 
@@ -174,9 +173,7 @@ namespace TEAMModelFunction
                     }
 
                 }
-            }
-            
-            //_clientFactory.CreateClient().
+            }           
         }
     }
 }

+ 34 - 6
TEAMModelFunction/ServiceBusTopic.cs

@@ -6,7 +6,6 @@ using Azure.Cosmos;
 using Microsoft.Azure.WebJobs;
 using Microsoft.Azure.WebJobs.Host;
 using Microsoft.Extensions.Logging;
-using TEAMModelOS.Models.SchoolInfo;
 using TEAMModelOS.SDK.DI;
 using TEAMModelOS.SDK.Extension;
 
@@ -28,16 +27,45 @@ namespace TEAMModelFunction
             keyValuePairs.TryGetValue("id", out object id);
             keyValuePairs.TryGetValue("name", out object name);
             keyValuePairs.TryGetValue("code", out object code);
-            keyValuePairs.TryGetValue("status", out object progress);
+            //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();
+                if (DateTimeOffset.UtcNow.ToUnixTimeMilliseconds().CompareTo(exam.startTime) > 0 && DateTimeOffset.UtcNow.ToUnixTimeMilliseconds().CompareTo(exam.endTime) < 0) {
+                    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}"));
-            } else if (name.ToString().Equals("Survey")) { 
-            
+            } else if (name.ToString().Equals("Survey")) {
+                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}"));
             } else if (name.ToString().Equals("Vote")) {
-
+                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)
+                    {
+                        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}"));
+                }
             }
+                
 
         }
     }

+ 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; }
+    }
+}

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

@@ -108,21 +108,28 @@ namespace TEAMModelOS.SDK.DI
         public static async Task<long> SendLeamMessage<T>(this ServiceBusClient client, string TopicName, string id, string pk, long startTime)
         {
             //微調代碼
-            string progress = "pending";
             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>() {
                     { "name",typeof(T).Name},
                     { "id",id},
-                    { "code",pk},
-                    { "status",progress}
+                    { "code",pk}
                 };
             //var msgId = "1";
             string messageBody = $"Message {dict}";
@@ -131,5 +138,20 @@ namespace TEAMModelOS.SDK.DI
             long SequenceNumber = await client.SendScheduleMessageAsync(TopicName, new ServiceBusMessage(dict.ToJsonString()), timer);
             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;
+            }
+
+
+        }
     }
 }

+ 4 - 2
TEAMModelOS/ClientApp/src/api/login.js

@@ -57,7 +57,6 @@ export default {
 			localStorage.setItem("id_token", item.id_token)
 			localStorage.setItem("access_token", item.access_token)
 			localStorage.setItem("expires_in", item.expires_in)
-
 			// 輸出暫存
 			let result;
 
@@ -77,7 +76,9 @@ export default {
 			}).catch(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 info = {
 				id: t_Data.sub,
@@ -95,6 +96,7 @@ export default {
 				}).then(res => {
 					// 沒有錯誤的話
 					if (!res.error) {
+						console.log(res)
 						// 儲存大雲Token
 						localStorage.setItem("auth_token", res.auth_token)
 						store.dispatch('user/setSchoolCode', defaultschool)

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

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

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

@@ -145,6 +145,15 @@ export default {
     //查询学生参与评量数据
     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;">
           <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">
               <span class="icon iconfont">&#xe69b;</span>
                 <div class="name">库存分析</div>
@@ -422,6 +434,24 @@
       <div class="content font-class">
         <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">
             <span class="icon iconfont icon-school-analysis"></span>
             <div class="name">
@@ -964,6 +994,22 @@
       <div class="content symbol">
           <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">
                 <svg class="icon svg-icon" aria-hidden="true">
                   <use xlink:href="#icon-school-analysis"></use>

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


二進制
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-",
   "description": "",
   "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",
       "name": "库存分析",

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


二進制
TEAMModelOS/ClientApp/src/assets/iconfont/iconfont.ttf


二進制
TEAMModelOS/ClientApp/src/assets/iconfont/iconfont.woff


二進制
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 {
     font-weight: 900;
     font-size: 14px;
+    display:flex;
     @media screen and (max-width: 767px) {
       font-size: 12px;
     }

+ 78 - 70
TEAMModelOS/ClientApp/src/common/BaseSelectSchool.vue

@@ -1,25 +1,25 @@
 <template>
 	<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>
 </template>
 
@@ -28,11 +28,11 @@
 		data() {
 			return {
 				curSchool: {
-					logo:''
+					logo: ''
 				},
-				defaultLogo:'',
-				user:{
-					schools:[]
+				defaultLogo: '',
+				user: {
+					schools: []
 				}
 			}
 		},
@@ -40,27 +40,34 @@
 			this.defaultLogo = require('@/assets/icon/default_school.png')
 			// 获取本地存储中的 用户信息
 			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 必须是已加入的学校
-				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.$store.commit('setSchoolCode', this.curSchool.schoolId)
 				}
-			}else{
+			} else {
 				this.$Message.warning('用户暂无学校列表数据')
 			}
 		},
 		methods: {
-			async onSchoolSelect(val){
-				this.$EventBus.$emit('onGlobalLoading',true)
+			async onSchoolSelect(val) {
+				this.$EventBus.$emit('onGlobalLoading', true)
 				this.curSchool = this.user.schools[val]
 				let schoolCode = this.user.schools[val].schoolId
 				let schoolInfo = await this.getTeacherSchoolInfo(schoolCode)
-				this.$store.commit('setSchoolCode',schoolCode)
-				this.$store.commit('schoolBaseInfo/setSchoolInfo',{ period:[] })
+				this.$store.commit('setSchoolCode', schoolCode)
+				this.$store.commit('schoolBaseInfo/setSchoolInfo', {
+					period: []
+				})
 				this.$store.commit('schoolBaseInfo/setClassroomList', undefined)
 				this.$store.dispatch('user/setSchoolCode', schoolCode)
 				this.$store.dispatch('user/setSchoolProfile', schoolInfo)
@@ -68,16 +75,16 @@
 				console.log(this.$store.state)
 				console.log(JSON.parse(decodeURIComponent(localStorage.school_profile, "utf-8")))
 				setTimeout(() => {
-					this.$EventBus.$emit('onGlobalLoading',false)
-				},500)
+					this.$EventBus.$emit('onGlobalLoading', false)
+				}, 500)
 				this.$router.push({
-					name:'home'
+					name: 'home'
 				})
 			},
-			
+
 			/* 获取老师所在学校的信息 */
 			getTeacherSchoolInfo(code) {
-				return new Promise((r,j) => {
+				return new Promise((r, j) => {
 					this.$api.schoolSetting.getTeacherSchoolInfo({
 						id_token: localStorage.getItem('id_token'),
 						school_code: code
@@ -94,21 +101,22 @@
 				})
 			},
 		},
-		
+
 		mounted() {
-			this.$EventBus.$on('onChangeSchool',params => {
-				if(params.schoolCode !== this.curSchool.schoolId){
+			this.$EventBus.$on('onChangeSchool', params => {
+				if (params.schoolCode !== this.curSchool.schoolId) {
 					console.log('检测到切换学校')
 					console.log(params)
 					this.user = params.user
-					this.curSchool = params.user.defaultschool ? params.user.schools.filter(i => i.schoolId === params.user.defaultschool)[0] : params.user.schools[0]
+					this.curSchool = params.user.defaultschool ? params.user.schools.filter(i => i.schoolId === params.user.defaultschool)[
+						0] : params.user.schools[0]
 					this.onSchoolSelect(params.user.schools.map(i => i.schoolId).indexOf(params.schoolCode))
 				}
 			})
 		},
 
 		computed: {
-			
+
 		}
 	}
 </script>
@@ -116,57 +124,57 @@
 <style lang="less">
 	.base-school-select {
 		font-family: '微軟正黑體', 'Heiti TC' !important;
-		
-		.ivu-dropdown{
-			
-			.ivu-dropdown-item:hover{
+
+		.ivu-dropdown {
+
+			.ivu-dropdown-item:hover {
 				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;
 				}
-				
-				&::after{
+
+				&::after {
 					content: '';
 					display: inline-block;
 					width: 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-bottom: 3px;
 				}
 			}
 		}
-		
-		.single-school{
-			&::after{
+
+		.single-school {
+			&::after {
 				display: none !important;
 			}
 		}
-		
-		.school-logo{
+
+		.school-logo {
 			width: 30px;
 			border-radius: 50%;
 			margin-right: 10px;
 			margin-bottom: 5px;
 			vertical-align: middle;
 		}
-		
-		.school-item{
+
+		.school-item {
 			display: flex;
 			align-items: center;
-			
-			img{
+
+			img {
 				width: 30px;
 				margin-right: 15px;
 			}

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

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

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

@@ -1,16 +1,20 @@
 <template>
     <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" />
             <p class="upload-text">{{$t('teachContent.uploadText')}}</p>
         </Upload>
         <div class="upload-file-box">
             <div class="upload-file-item" v-for="(item,index) in uploadedList" :key="index">
                 <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>
@@ -71,6 +75,19 @@
             }
         },
         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) {
                 let extension = fileName.substring(fileName.lastIndexOf('.') + 1, fileName.length)
                 extension = extension.toUpperCase()
@@ -105,7 +122,7 @@
                 let fileType = this.getFileType(file.name)
                 //上传文件
                 let fileInfo = {
-                    url: this.urlString + '/ ' + this.containerName + '/ ' + fileType + '/ ' + file.name,
+                    url: this.urlString + '/' + this.containerName + '/' + fileType + '/' + file.name,
                     name: file.name,
                     size: file.size,
                     loadedBytes: 0,
@@ -123,6 +140,7 @@
                 }).then(
                     res => {
                         this.uploadedList[index].status = 1
+                        this.uploadedList[index].blob = res.blob
                         this.$emit('successData',res)
                     },
                     err => {
@@ -239,11 +257,12 @@
         cursor: pointer;
         color: #909090;
         margin-top: 5px;
+        padding:5px 2px 0px 5px;
     }
 
         .upload-file-item:hover {
             color: white;
-            background: #606060;
+            background: #585858;
             border-radius: 5px;
         }
 
@@ -255,8 +274,8 @@
     }
     .upload-file-name {
         display: inline-block;
-        /*margin-left: 10px;*/
-        color:#EEEEEE;
+        color: #EEEEEE;
+        line-height: 30px;
     }
 
     .delete-btn {

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

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

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

@@ -82,8 +82,7 @@
             <ChooseContent :showSyllabus="isFalse"
                            :showOther="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>
         </Modal>
@@ -92,7 +91,7 @@
 <script>
     import E from '@/utils/wangEditor.js'
     import UploadFile from '@/common/UploadFile.vue'
-    import ChooseContent from '@/components/learnactivity/ChooseContent'
+    import ChooseContent from '@/components/learnactivity/NewChooseContent'
     export default {
         props: {
             editItem: {

+ 55 - 27
TEAMModelOS/ClientApp/src/components/learnactivity/BaseVoteForm.vue

@@ -29,31 +29,39 @@
                             style="margin-top:10px"></DatePicker>
             </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>
 			</FormItem>
 
             <FormItem label="结束时间" prop="endTime">
                 <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">
                 <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>
             </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>
+                
                 <p style="float:right;color:#BDBDBD;cursor:pointer" @click="onAddOption" v-show="voteFormEdit"><Icon type="md-add" />添加选项</p>
             </FormItem>
 
@@ -121,6 +129,7 @@
                     endTime: '',
                     publishModel:'0',
                     startTime:'',
+					rangeTime:[],
                     description: '',
                     isReset: [],
                     selectMax:1,
@@ -160,11 +169,14 @@
                         { required: true, message: '投票对象不能为空' }
                     ],
                     endTime: [
-                        { required: true, type: 'date', message: '请设置结束时间', trigger: 'change' }
+                        { required: true, type: 'date', message: '请设置起止时间', trigger: 'change' }
                     ],
                     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)
 		},
         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
@@ -182,6 +206,7 @@
 				this.isBtnLoading = true
                 this.$refs[name].validate(async (valid) => {
                     if (valid && this.getSimpleText(this.hwForm.description) && this.voteOptionsContent.length) {
+						console.log(this.hwForm)
                         let params = Object.assign({}, this.defaultParams)
                         let target = []
 						let fileName = this.$tools.guid()
@@ -189,15 +214,14 @@
                         params.code = this.getCurCode,
                         params.scope = this.getCurScope,
                         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.selectMax = this.hwForm.selectMax
                         params.secret = this.hwForm.secret.indexOf('secret') > -1
                         params.options = this.voteOptionsContent
                         if (this.isEdit && this.editInfo.id && this.editInfo.code) {
                             params.id = this.editInfo.id
-							params.code = this.hwForm.code
                         }                                   
                         params.targetClassIds = this.hwForm.targetClassIds
 						console.log(params)
@@ -223,7 +247,9 @@
             },
 
             initEditors() {
-
+				console.log('进入编辑起初始化')
+				console.log(this.voteOptions)
+				console.log(this.voteOptionsContent)
                 this.$nextTick(() => {
                     // Editor默认配置
                     if (this.voteOptions.length > 0) {
@@ -403,19 +429,20 @@
              */
             doRender(item) {
 				console.log(item)
+				this.voteOptionsContent = []
+				this.voteOptions = []
+				this.initEditors()
                 this.hwForm = {
                     name: item.name,
 					code:item.code,
                     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,
                     secret: item.secret ? ['secret'] : [],
                     selectMax: item.selectMax,
                     isReset:[]
                 }
-				console.log(this.hwForm.targetClassIds)
-                this.currentState = item.state
                 this.descriptionEditor.txt.html(item.description)
                 this.voteOptionsContent = item.options
                 this.voteOptions = item.options.map((item, index) => index)
@@ -473,9 +500,10 @@
                     /** 编辑回显 */
                     if (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 {
                         /** 新增 */
 						console.log(newValue)

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

@@ -15,7 +15,7 @@
                         <div class="content-filter-item">
                             <span class="content-filter-label">学段:</span>
                             <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>
                         </div>
                         <div class="content-filter-item">
@@ -122,7 +122,7 @@
                                 <span class="manual-filter-label">学段:</span>
                                 <RadioGroup v-model="questionFilter.periodCode" style="display: inline-block;" @on-change="getQSubjectList()">
                                     <!--<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>
                             </div>
                             </Col>
@@ -646,7 +646,22 @@
                 this.getSyllabus()
             },
             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) => {
                         if (res.code == 2) {
                             alert('数据为空!')
@@ -664,7 +679,7 @@
                     (err) => {
                         this.$Message.error('API error!')
                     }
-                )
+                )*/
             },
             getVolumes() {
                 this.currentVolumeIndex = 0
@@ -690,7 +705,7 @@
             },
             //课纲学科筛选条件
             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) {
                     this.subjectList = result[0].subjects
                     if (this.subjectList.length > 0) {
@@ -705,7 +720,7 @@
             },
             //题库学科筛选条件
             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) {
                     this.subjectList = result[0].subjects
                     if (this.subjectList.length > 0) {

+ 25 - 25
TEAMModelOS/ClientApp/src/components/learnactivity/GradeList.vue

@@ -296,11 +296,10 @@
                 }
             },
             getClassData() {
-                console.log()
                 if (this.paperInfo.class.length !== 0) {
                     this.classList = []
                     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) {
                                 this.classList.push(items)
                             }
@@ -340,34 +339,35 @@
             },
             //获取学校基本信息
             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()
+                //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 {
+                //           
 
-                        }
-                    },
-                    (err) => {
-                        this.$Message.error('API error!')
-                    }
-                )
+                //        }
+                //    },
+                //    (err) => {
+                //        this.$Message.error('API error!')
+                //    }
+                //)
             },
     },
         mounted() {
             this.getSchoolBaseInfo()
+            this.getClassData()
             //this.getStudentData()
             console.log('修改测试内容')
             console.log(this.paperInfo)

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

@@ -15,7 +15,7 @@
                         <div class="content-filter-item">
                             <span class="content-filter-label">学段:</span>
                             <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>
                         </div>
                         <div class="content-filter-item">
@@ -126,7 +126,7 @@
                                 <span class="manual-filter-label">学段:</span>
                                 <RadioGroup v-model="questionFilter.periodId" style="display: inline-block;" @on-change="getQSubjectList()">
                                     <!--<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>
                             </div>
                             </Col>
@@ -142,7 +142,7 @@
                             <div class="manual-filter-item">
                                 <span class="manual-filter-label">年级:</span>
                                 <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>
                             </div>
                             </Col>
@@ -336,9 +336,9 @@
             //初始化数据
             initData() {
                 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() {
-                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) {
                     this.subjectList = result[0].subjects
                     if (this.subjectList.length > 0) {
@@ -648,7 +648,22 @@
             },
             //获取区班校基础数据
             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) => {
                         if (res.code == 2) {
                             this.$Message.warning('暂无区班校数据!')
@@ -666,7 +681,7 @@
                     (err) => {
                         this.$Message.error('API error!')
                     }
-                )
+                )*/
             },
             //获取册别
             getVolumes() {
@@ -709,7 +724,7 @@
             },
             //课纲学科筛选条件
             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) {
                     this.subjectList = result[0].subjects
                     if (this.subjectList.length > 0) {

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

@@ -21,7 +21,7 @@
 				 </DatePicker>
 			</FormItem> -->
 
-			<FormItem label="发布时间" prop="startTime">
+			<!-- 			<FormItem label="发布时间" prop="startTime">
 				<DatePicker :class="!qnFormEdit ? 'qn-form-disabled':''" type="datetime" :editable="isDateEdit" placeholder="请选择问卷发布时间"
 				 v-model="qnForm.startTime" :options="startTimeOptions"></DatePicker>
 			</FormItem>
@@ -29,8 +29,16 @@
 			<FormItem label="结束时间" prop="endTime">
 				<DatePicker :class="!qnFormEdit ? 'qn-form-disabled':''" type="datetime" :editable="isDateEdit" placeholder="请选择问卷结束时间"
 				 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 label="问卷描述" prop="description">
 				<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>
@@ -155,6 +163,18 @@
 			}
 		},
 		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
@@ -170,13 +190,12 @@
 							params.scope = this.getCurScope
 							params.name = this.qnForm.name
 							// 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.other = this.qnForm.other
 							if (this.isEdit && this.editInfo.id && this.editInfo.code) {
 								params.id = this.editInfo.id
-								params.code = this.editInfo.code
 								params.createTime = this.editInfo.createTime
 							}
 							params.targetClassIds = this.qnForm.targetClassIds
@@ -257,8 +276,8 @@
 				this.qnForm = {
 					name: item.name,
 					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
 				}
 				this.currentState = item.state

+ 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">
       <h2 class="event-title">
         <span class="title-mark" v-if=" eventType=='自主學習' &&from!='hiteach'">
-          {{ getCurrentLang()=='tw'?eventType:transTypetoEn(eventType) }}
+          {{ getCurrentLang()=='tw'?'评量':transTypetoEn(eventType) }}456
         </span>
         <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
           class="title-mark"
           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>
     </i-col>
     <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'}">
         <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')}}
-          <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>
         </li>
 
-        <li>
+        <!--<li>
           <svg-icon icon-class="teacher" class="base-info-icon" />{{ $t('studentWeb.baseInfo.teacher')}}
           <span class="base-info-text">{{ this.$store.getters.getItemTitle.teacher }}</span>
-        </li>
+        </li>-->
 
         <li>
           <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')}}
-          </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 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
             class="base-info-text"
             v-if="from == '通知'||from == 'hiteach'"
-          >{{ this.$store.getters.getItemTitle.endTime + " 14:20" }}</span>
+          >{{ this.$store.getters.getItemTitle.endTime + " 14:20" }}54345</span>
         </li>
-        <li v-if=" from == 'hiteach'">
+        <!--<li v-if=" from == 'hiteach'">
            <svg-icon icon-class="time" class="base-info-icon" />{{$t('studentWeb.baseInfo.classTime')}}:
           <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" />
           <span class="base-info-text">{{ $t('studentWeb.baseInfo.Fineshed')}}</span>
         </li>
         <li v-if="unfinishedCondition && !eventType && from != '通知'&&from!='hiteach'">
            <svg-icon icon-class="undone" class="base-info-icon" />
           <span class="base-info-text">{{ $t('studentWeb.baseInfo.unFinished')}}</span>
-        </li>
+        </li>-->
       </ul>
     </i-col>
   </Row>
@@ -76,7 +80,10 @@
 <script>
 export default {
   name: "EventBasicInfo",
-  props: ["eventType", "from"],
+        props: [
+            "eventType", "from",
+            "paper"
+        ],
 
   computed: {
     finishedCondition: function () {
@@ -95,8 +102,18 @@ export default {
         ) == 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() {
       return localStorage.getItem('lang');
     },

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

@@ -1,23 +1,23 @@
 <template>
   <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.getItemTitle.eventType=='課前預習'">
+      <!--<div v-if="this.$store.getters.getItemTitle.eventType=='課前預習'">
         <PreviewMission/>
       </div>
       <div v-if="this.$store.getters.getItemTitle.eventType=='作業'">
         <Homework/>
-      </div>
-      <div v-if="this.$store.getters.getItemTitle.eventType=='評量'">
+      </div>-->
+      <div v-if="this.$store.getters.getItemTitle.eventType=='exam'">
         <LessonTest/>
       </div>
-      <div v-if="this.$store.getters.getItemTitle.eventType=='投票'">
+      <!--<div v-if="this.$store.getters.getItemTitle.eventType=='投票'">
         <Vote/>
       </div>
       <div v-if="this.$store.getters.getItemTitle.eventType=='問卷'">
         <QuesNaire/>
-      </div>
+      </div>-->
     </div>
         <!-- 如果篩選時未選的時候預設顯示列表第一個-->
     <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(); // <!-- 如果沒選的時候預設顯示列表第一個-->
   },
   data() {

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

@@ -1,401 +1,409 @@
 <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.eventSubject != '綜合學科'
               "
-              icon-class="test"
-              class="reset-testIcon"
-            />
-            <svg-icon
-              v-if="
+                              icon-class="test"
+                              class="reset-testIcon" />
+                    <svg-icon v-if="
                 nextItem.eventType == '評量' &&
                 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>
-        <!--依試卷是否完成顯示打勾狀態-->
-        <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>
-            <!--依試卷是否完成顯示打勾狀態-->
-            <!--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"
               @click="opentest()"
             >
-              <li class="title" v-if="getCurrentLang() == 'tw'">
+              <div 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'">
+                {{ 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(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>
-              <!--依試卷是否完成顯示打勾狀態-->
-            </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>
 </template>
 
 <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>
 
 <style>
-@import "~@/assets/student-web/component_styles/lesson-test.css";
+    @import "~@/assets/student-web/component_styles/lesson-test.css";
 </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
+ 327 - 379
TEAMModelOS/ClientApp/src/components/student-web/EventView/EventList.vue


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

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

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

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

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


+ 26 - 32
TEAMModelOS/ClientApp/src/store/module/user.js

@@ -20,11 +20,12 @@ export default {
         schoolProfile:{ // 老師在學校的設定檔
             blob_uri: undefined,    // 學校Blob網址
             blob_sas: undefined,    // 學校Blob金鑰,讀
-            courses: undefined,     // 老師的校本課程
-            syllabus: undefined,    // 老師的校本課綱
             periods: undefined,    // 學校的學制List
             grades: undefined,    // 學校的年級List
-            classes: undefined,    // 學校的教室List
+            school_base: undefined, // 区班校基础数据
+            school_classes: undefined, // 学校班级
+            school_courses: undefined, // 学校排课
+            school_syllabus: undefined // 校本课纲
         },
         studentProfile:{ // 學生在學校的設定檔
             blob_uri: undefined,
@@ -150,13 +151,28 @@ export default {
             return state.schoolProfile.grades
         },
         getClasses: state => {
-            return state.schoolProfile.classes
+            return state.schoolProfile.school_classes
         }
     },
     mutations: {
         setSchoolUserList(state, 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) {
             state.userList = data
         },
@@ -177,11 +193,12 @@ export default {
         setSchoolProfile(state, data) {
             state.schoolProfile.blob_sas = data.blob_sas // 老師在學校的Blob金鑰,讀寫
             state.schoolProfile.blob_uri = data.blob_uri // 老師在學校的Blob網址
-            state.schoolProfile.courses = data.school_courses // 老師在學校的的個人課程
-            state.schoolProfile.syllabus = data.school_syllabus // 老師在學校的的個人課綱
-            state.schoolProfile.classes = data.school_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.grades = data.fmtGrades // 年級
+            state.schoolProfile.school_base = data.school_base // 区班校基础数据
         },
         setStudentProfile(state, data) {
             state.studentProfile.blob_uri = data.blob_uri // 學生在學校的Blob網址
@@ -491,7 +508,7 @@ export default {
             if (addUserlist.length > 0) {
                 addUserlist.forEach(function (userAdd) {
                     userAdd.status = status
-                    userAdd.createDate = Math.round((new Date()).getTime() / 1000)
+                    userAdd.createTime = Math.round((new Date()).getTime() / 1000)
                     schoolUserListNow.push(userAdd)
                 })
             }
@@ -531,7 +548,6 @@ export default {
             context.commit('setStudentProfile', data)
         },
         async checkSchoolProfile(context) {
-
             let login_schooCode = localStorage.getItem('login_schooCode')
             let id_token = localStorage.getItem('id_token')
 
@@ -548,7 +564,6 @@ export default {
                     id_token: id_token,
                     school_code: login_schooCode
                 }).then( res => {
-                    console.log(res,'uyuytuyutuytyutuu')
                     // 沒有錯誤的話
                     if (!res.error) {
                         // 儲存大雲Token
@@ -595,27 +610,6 @@ export default {
             localStorage.setItem('login_schooCode', 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) {
             return new Promise((resolve) => {
                 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 + 容器 之后的路径
      */
     deleteBlob(filePath) {
+        if (filePath) {
+            filePath = filePath.substring(1)
+        }
         return new Promise((r, j) => {
             this.containerClient.deleteBlob(filePath).then(
                 res => {

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

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

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

@@ -71,20 +71,6 @@
 				// this.isShowMock = true
                 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() {
                 this.isOpenDrawer = false
             },

+ 13 - 10
TEAMModelOS/ClientApp/src/view/evaluation/bank/ExerciseList.vue

@@ -68,7 +68,7 @@
 					<Radio label="createTime">新增时间
 						<Icon type="md-arrow-round-down" />
 					</Radio>
-					<Radio label="usageCount">使用次数
+					<Radio label="useCount">使用次数
 						<Icon type="md-arrow-round-down" />
 					</Radio>
 				</RadioGroup>
@@ -305,17 +305,20 @@
 			/** 获取区班校信息 */
 			getSchoolInfo() {
 				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.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()
-				})
+				}
 			},
 			
 			
@@ -711,7 +714,7 @@
 					//初始化Blob
 					let containerClient = new blobTool(sasData.url, sasData.name, sasData.sas , this.curScope)
 					// 等待blob的返回结果
-					containerClient.deleteBlob(path.substring(1)).then(
+					containerClient.deleteBlob(path).then(
 					    (res) => {
 					        r(res)
 					    },

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

@@ -98,9 +98,8 @@
             },
 
             onFilterChange(filterParams, findCountParams) {
-
                 this.filterParams = {
-                    // '@DESC': this.filterSort,
+                    '@DESC': filterParams.filterSort,
                     'code': filterParams.code,
 					'scope': filterParams.code === this.$store.state.userInfo.schoolCode ? 'school' : 'private',
                     'periodId': filterParams.periodId[0],
@@ -303,7 +302,7 @@
              * @param 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
              */
             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
              */
             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() {
-            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
         },
         computed: {

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

@@ -86,7 +86,6 @@
 		watch: {
 			children:{
 				handler(n){
-					console.log(n)
 					this.$nextTick(()=>{
 						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">
 			<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>
 		</Modal>
@@ -113,7 +115,7 @@
 	import BaseSubjective from '@/view/evaluation/types/BaseSubjective.vue'
 	import BasePoints from '@/view/evaluation/components/BasePoints'
 	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'
 	// 默认创建题目模板
 	const defaultExercise = {
@@ -200,14 +202,14 @@
 		},
 		methods: {
 			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) {
-				let schoolInfo = this.$store.state.schoolBaseInfo.schoolBaseInfo
+				let schoolInfo = JSON.parse(JSON.stringify(this.$store.state.user.schoolProfile.school_base))
 				this.isEdit = true
 				this.exersicesDiff = editItem.level.toString() || '0'
 				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 BaseCreateChild from '@/view/evaluation/components/BaseCreateChild'
 	import BaseChildList from '@/view/evaluation/components/BaseChildList'
-	import ChooseContent from '@/components/learnactivity/ChooseContent'
 	import E from '@/utils/wangEditor.js'
 
 	export default {
@@ -172,8 +171,7 @@
 			BasePoints,
 			BaseCreateChild,
 			BaseChildList,
-			BaseRepair,
-			ChooseContent
+			BaseRepair
 		},
 		data() {
 			return {
@@ -184,7 +182,9 @@
 				selectPointsModal: false,
 				isEdit: false,
 				editInfo: null,
-				schoolInfo: {},
+				schoolInfo: {
+					period:[]
+				},
 				exersicesType: null,
 				exerciseField: 0,
 				exercisePeriod: 0,
@@ -224,12 +224,14 @@
 		},
 		methods: {
 			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) {
+				if(!val) return
 				console.log(this.schoolInfo)
 				console.log(val)				
 				this.gradeList = this.schoolInfo.period[val].grades
@@ -581,7 +584,7 @@
 			async renderExercise(editItem) {
 				console.log(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.exersicesDiff = editItem.level.toString() || '0'
 				this.exerciseScope = editItem.scope === 'private' ? 0 : 1

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

@@ -58,7 +58,7 @@
 							</div>
 						</div>
 					</div>
-					<div class="item-btn-toggle" @click.stop>
+					<div class="item-btn-toggle" @click.stop v-show="isShowTools" >
 						<template>
 							<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>

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

@@ -32,7 +32,7 @@
             <span class="filter-title">排序:</span>
             <RadioGroup v-model="filterSort" type="button" @on-change="filterSortChange">
                 <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>
         </div>
     </div>
@@ -88,8 +88,8 @@
             }
         },
         created() {
-            this.getSchoolInfo()
 			this.isShowSchoolBank = this.$route.name === 'schoolBank'
+			this.getSchoolInfo()
 			this.$EventBus.$on('showSchoolBank',(val)=> {
 				if(val){
 					this.isShowSchoolBank = val
@@ -102,22 +102,26 @@
         methods: {
             /** 获取区班校信息 */
             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() {
                 /** 定义查询接口的参数规格 */
                 this.filterParams = {
+					'filterSort': this.filterSort,
                     'code': this.filterOrigin,
                     'periodId': [this.periodList[this.filterPeriod].id],
                     'gradeIds': this.deleteFalse(this.filterGrade),
@@ -157,79 +161,80 @@
                 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"
 		                   :showOther="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>
 		</Modal>
 	</div>
 </template>
 <script>
-	import ChooseContent from '@/components/learnactivity/ChooseContent'
+	import ChooseContent from '@/components/learnactivity/NewChooseContent'
 	export default {
 		components: { ChooseContent },
 		props: {
@@ -70,7 +69,9 @@
 				relateFileList:[]
 			}
 		},
-		created() {},
+		created() {
+			
+		},
 		methods: {
 			onAddLink(type){
 				let addObj = {
@@ -97,7 +98,7 @@
 			onConfirmRelate() {
 				this.relateFileList.forEach(i => {
 					this.datas.push({
-						blobUrl:i.blobUrl,
+						blobUrl:i.url,
 						type:'file'
 					})
 				})
@@ -127,7 +128,9 @@
 		},
 
 		mounted() {
-
+			if(this.$refs.chooseContentRef){
+				this.$refs.chooseContentRef.clickTab('content')
+			}
 		},
 
 		watch: {

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

@@ -127,15 +127,6 @@
 			</div>
 		</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="">
 			<div class="modal-header" slot="header">添加小题</div>
@@ -168,7 +159,6 @@
 	import BasePoints from '@/view/evaluation/components/BasePoints'
 	import BaseRepair from '@/view/evaluation/components/BaseRepair'
 	import BaseCreateChild from '@/view/evaluation/components/BaseCreateChild'
-	import ChooseContent from '@/components/learnactivity/ChooseContent'
 	import E from '@/utils/wangEditor.js'
 	// 默认创建题目模板
 	const defaultExercise = {
@@ -190,7 +180,6 @@
 			BaseCompose,
 			BasePoints,
 			BaseRepair,
-			ChooseContent,
 			BaseCreateChild
 		},
 		data() {
@@ -246,11 +235,14 @@
 		},
 		methods: {
 			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() {
 				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 class="paper-body">
 					<!-- 试卷基础信息 -->
-					<div class="paper-base-info" v-show="isShowBaseInfo">
+					<div class="paper-base-info">
 						<div style="display: flex;">
 							<div class="paper-info-items">
 								<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>
 							</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="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="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>
 						</div>
+						<div  v-show="!isShowBaseInfo"></div>
 					</div>
 
 					<!-- 试卷头部信息 -->

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

@@ -126,37 +126,37 @@
 				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)
+				})
 			}
 
         },

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

@@ -49,6 +49,15 @@
 			stemEditor.customConfig.onchange = (html) => {
 				this.stemContent = html
 			}
+			
+			stemEditor.customConfig.onVideoWarning = (text) => {
+				this.$Message.warning(text)
+			},
+			
+			// 选择视频文件后的上传Blob操作
+			stemEditor.customConfig.onVideoSelected = async (file) => {
+					this.$tools.doUploadVideo(this,file,stemEditor)
+			},
 			stemEditor.create()
 
 			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" />
 							<span style="margin-left:5px">学科</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 class="ns-header-search" v-else>
 						<Input icon="ios-close" v-model="searchSubject" placeholder="搜索学科..." autofocus style="width: 100%" @on-click="onSearchSubjectClose"
@@ -35,7 +35,10 @@
 					</div>
 				</div>
 				<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"
 						 @click="hasModify ? handleConfirmSave({index},'2') : handleSubjectTap(index)">
 							<p class="gl-item-name">{{item.name}}</p>
@@ -54,14 +57,14 @@
 						<span>
 							<Icon type="md-cube" color="#fff" size="20" />
 							<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-clear="onSearchClear" />
 						</span>
 						<div>
 							<!-- <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="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" />
 							<!-- <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>
 						<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" />
-							<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 class="ns-header-search" v-else>
@@ -374,20 +377,20 @@
 
 			// 获取当前学校学段学科等基本信息
 			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.onPeriodChange(0)
-					} else {
-						this.$Message.warning('暂无学段数据')
 					}
-				})
+				}
 			},
 
 			// 获取当前册别数量(每次都获取最新的数据)
@@ -421,7 +424,7 @@
 					if (!res.error && res.knowledges) {
 						let list = res.knowledges
 						this.blockList = list
-						this.originBlockList = list
+						this.originBlockList = JSON.parse(JSON.stringify(list))
 						// this.handleBlockTap(0, list.length ? list[0] : null)
 						setTimeout(function() {
 							that.isLoadBlocks = false
@@ -442,7 +445,7 @@
 				this.$api.knowledge.GetSchoolPoints(this.currentParams).then(res => {
 					if (!res.error && res.knowledges) {
 						this.pointList = res.knowledges
-						this.originPointList = res.knowledges
+						this.originPointList = JSON.parse(JSON.stringify(res.knowledges))
 						setTimeout(function() {
 							that.isLoadPoints = false
 						}, 800)
@@ -480,27 +483,41 @@
 
 			// 学段切换处理
 			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) {
 				this.checkedPointList = []
+				this.blockList = []
+				this.originBlockList = []
+				this.pointList = []
+				this.originPointList = []
 				this.schoolParams = {
 					schoolCode: this.originData.id,
 					subjectId: this.subjectList[index].id,
@@ -591,7 +608,13 @@
 							id: data.id
 						}).then(res => {
 							if (res.knowledges) {
+								console.log(this.blockList)
+								console.log(this.originBlockList)
+								console.log(data)
 								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)
 								setTimeout(() => {
 									that.blockCounts = []

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

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

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

@@ -104,24 +104,29 @@
 
             // 提交新增知识块
             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) {
@@ -151,11 +156,10 @@
 
             blockList: {
                 handler(newValue, oldValue) {
-                    if (newValue.length) {
-                        console.log(newValue)
+                    if (newValue) {
                         this.newBlockName = ''
                         this.existBlockList = newValue
-                        this.selectBlock = newValue[0].id
+                        this.selectBlock = newValue.length ? newValue[0].id : ''
                     }
                 }
             }

+ 4 - 1
TEAMModelOS/ClientApp/src/view/learnactivity/ManageEvaluation.vue

@@ -75,7 +75,9 @@
                             </div>
                             <!--试卷题目信息-->
                             <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;"  :isShowTools="isShowTools"></TestPaper>
+                                </div>
                             </div>
                             <EmptyData v-else style="margin-top:60px;"></EmptyData>
                         </vuescroll>
@@ -486,6 +488,7 @@
             },
             selectEvaluation(index) {
                 console.log(index)
+                this.currentSubjectIndex = 0
                 this.currentBraIndex = 0
                 this.avtiveEvaluationIndex = index
                 this.getMyDate(this.evaluationList[this.avtiveEvaluationIndex].startTime, this.evaluationList[this.avtiveEvaluationIndex].endTime)

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

@@ -13,12 +13,12 @@
                     </FormItem>
                     <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">
-                            <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>
                     </FormItem>
                     <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">
-                            <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>
                     </FormItem>
                     <FormItem :label="$t('courseManage.base.courseNotice')">
@@ -59,6 +59,7 @@
         },
         data() {
             return {
+                schoolBase: undefined,
                 isLoading: false,
                 edNoticeStatus: false,
                 noticeEditor: undefined,
@@ -143,7 +144,9 @@
                 )
             },
             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) => {
                         if (res.code == 2) {
                             alert('数据为空!')
@@ -152,27 +155,14 @@
                     (err) => {
                         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() {
             
         },
         created() {
             this.getSchoolBaseInfo()
-            this.getClassroom()
             this.getSchoolTeacher()
         },
         watch: {

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

@@ -103,7 +103,7 @@
             <Form ref="personalClassroom" :model="personalClassroom" label-position="top" label-colon>
                 <FormItem label="班级名称" prop="classroomName">
                     <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>
                 </FormItem>
                 <FormItem :label="$t('courseManage.classroom.invitationCode')" prop="classroomCode">
@@ -298,9 +298,9 @@
                         this.courseInfo.classes[this.curClassIndex].getStatus = true
                         let students = res.result.extend.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) {
-                                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].periodCode = currentSchoolInfo[0].periodCode
                                 students[index].gradeName = this.$JSONPath.query(currentSchoolInfo, "$..grades[?(@.gradeCode=='" + currentClassroomlInfo[0].gradeCode + "')]")[0].gradeName
@@ -384,7 +384,7 @@
                 handler(n, o) {
                     if (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
                             })
                             if (classroom.length > 0) {

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

@@ -613,7 +613,17 @@
         async created() {
             await this.getCourseList()
             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.classListShow = [...this.classList]
                 this.findClassPlan()
@@ -621,25 +631,7 @@
                 this.tableData = this.$store.state.schoolBaseInfo.schoolBaseInfo.timetable.filter((item, index) => {
                     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() {
@@ -659,7 +651,7 @@
             },
             semesterList() {
                 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
                 } else {

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

@@ -199,7 +199,7 @@
                 if (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
                         })
                         if (classroom.length > 0) {
@@ -291,7 +291,7 @@
                 return new Promise(async (r, j) => {
                     for (let i in this.myCusPlan) {
                         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
                             })
                             if (classroom.length > 0) {
@@ -376,14 +376,12 @@
         watch: {
             courseInfo: {
                 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,
                 immediate: true

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

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

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

@@ -24,7 +24,7 @@
                     {{index + 1}}
                 </template>
                 <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>
                 </template>
                 <template slot-scope="{ row,index }" slot="count">
@@ -59,7 +59,7 @@
                 </FormItem>
                 <FormItem label="课程学段" prop="period.id">
                     <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 }">
                             {{ item.name }}
                         </Option>
@@ -67,7 +67,7 @@
                 </FormItem>
                 <FormItem label="课程学科" prop="subject.id">
                     <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}">
                             {{ item.name }}
                         </Option>
@@ -105,6 +105,7 @@
                 }
             }
             return {
+                schoolBase: undefined,
                 tableHeight:780,
                 teacherId:[],
                 actionType:0, //0新增 1编辑
@@ -400,8 +401,13 @@
                     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 => {
             })
         }

+ 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-value">{{item.teacher.name}}</span>
                         </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 v-if="classList.length == 0">
                         <EmptyData :top="160" textContent="暂无上课班级"></EmptyData>
@@ -222,7 +222,7 @@
             <Form ref="sysClass" :model="sysClass" label-position="top" label-colon>
                 <FormItem label="班级名称" prop="name">
                     <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>
                 </FormItem>
                 <FormItem :label="$t('courseManage.classroom.invitationCode')" prop="id">
@@ -270,6 +270,7 @@
                 }
             }
             return {
+                schoolClassList:[],
                 tableHeight:100,
                 studentColumn: [
                     {
@@ -351,7 +352,7 @@
                 this.stuLoading = true
                 let params = {
                     '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
                 }
                 this.$api.schoolSetting.getClassroomStudent(params).then(
@@ -546,7 +547,9 @@
             //添加上课班级
             addClassroom(value) {
                 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
                 } else if (value == 1) {
                     let randomCode = 'P'
@@ -584,7 +587,7 @@
             },
             //确认选择系统班级
             confirmBindingClass() {
-                let curClass = this.$store.state.schoolBaseInfo.classroomList.filter((item) => {
+                let curClass = this.schoolClassList.filter((item) => {
                     return item.id == this.sysClass.id
                 })
                 if (curClass.length > 0) {

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

@@ -367,12 +367,16 @@
         async created() {
             this.isLoading = true
             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.classListShow = [...this.classList]
                 this.findClassPlan(0)
                 this.schoolInfo = this.$store.state.schoolBaseInfo.schoolBaseInfo
-            })
+            })*/
         },
         computed: {
             //动态绑定已选择教师id

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

@@ -79,10 +79,10 @@
 								</DropdownMenu>
 							</Dropdown>
 						</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" />
 							<span>查看统计数据</span>
-						</div>
+						</div> -->
 						<div class="qn-box-header-tools-tool" @click="onEditQn" v-show="currentQn.progress === 'pending' && qnList.length && !editable">
 							<Icon type="md-create" color="#209460" />
 							<span>编辑问卷</span>

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

@@ -385,3 +385,15 @@
         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);
+        }
+    }
+}

+ 27 - 17
TEAMModelOS/ClientApp/src/view/schoolmgmt/ClassroomSetting/ClassroomSetting.vue

@@ -34,7 +34,7 @@
                             <div style="margin-top:5px;margin-bottom:10px;">
                                 <span>学段:</span>
                                 <Select v-model="filterPeriod" style="width:80px" size="small" clearable @on-change="filterByPeriod">
-                                    <Option v-for="(item,index) in $store.state.schoolBaseInfo.schoolBaseInfo.period" :value="item.id" :key="index">
+                                    <Option v-for="(item,index) in $store.state.user.schoolProfile.school_base.period" :value="item.id" :key="index">
                                         {{ item.name }}
                                     </Option>
                                 </Select>
@@ -137,7 +137,7 @@
                                     <FormItem prop="periodId" :label="$t('schoolBaseInfo.setPeriod')" @click.native.stop>
                                     <span slot="label" class="class-attr-wrap-label">{{$t('schoolBaseInfo.setPeriod')}}</span>
                                     <Select @on-change="watchUpdate" :disabled="editStatus" v-model="classroomListShow[curClassIndex].periodId" clearable>
-                                        <Option v-for="(item,index) in $store.state.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 }}
                                         </Option>
                                     </Select>
@@ -145,7 +145,7 @@
                                 <FormItem prop="gradeId" :label="$t('schoolBaseInfo.setGrade')" @click.native.stop class="requird-color">
                                     <span slot="label" class="class-attr-wrap-label">{{$t('schoolBaseInfo.setGrade')}}</span>
                                     <Select @on-change="watchUpdate" :disabled="editStatus" v-model="classroomListShow[curClassIndex].gradeId" clearable>
-                                        <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 }}
                                         </Option>
                                     </Select>
@@ -153,7 +153,7 @@
                                 <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>
                                     <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 }}
                                         </Option>
                                     </Select>
@@ -196,10 +196,10 @@
                         </div>
                         <div class="hiteach-code-wrap-list">
                             <vuescroll>
-                                <div class="hiteach-collapse" style="border-bottom: 1px solid #424242;position: relative;">
+                                <div @click="stdFlag = !stdFlag" class="hiteach-collapse" style="border-bottom: 1px solid #424242;position: relative;cursor: pointer;">
                                     <div 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 :type="stdFlag ? '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;">
@@ -223,7 +223,7 @@
                                         </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;">
+                                        <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;">
                                             <Checkbox style="margin-right: 70px;" v-model="test1" disabled></Checkbox>
                                             <div style="display: flex;justify-content: space-between;align-items: center;width: 100%;">
                                                 <ul>
@@ -243,7 +243,7 @@
                                                 </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;">
+                                        <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;">
                                             <Checkbox style="margin-right: 70px;"></Checkbox>
                                             <div style="display: flex;justify-content: space-between;align-items: center;width: 100%;">
                                                 <ul>
@@ -291,7 +291,7 @@
                                         </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;">
+                                        <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;">
                                             <Checkbox style="margin-right: 70px;" v-model="test1" disabled></Checkbox>
                                             <div style="display: flex;justify-content: space-between;align-items: center;width: 100%;">
                                                 <ul>
@@ -311,7 +311,7 @@
                                                 </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;">
+                                        <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;">
                                             <Checkbox style="margin-right: 70px;"></Checkbox>
                                             <div style="display: flex;justify-content: space-between;align-items: center;width: 100%;">
                                                 <ul>
@@ -359,7 +359,7 @@
                                         </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;">
+                                        <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;">
                                             <Checkbox style="margin-right: 70px;" v-model="test1" disabled></Checkbox>
                                             <div style="display: flex;justify-content: space-between;align-items: center;width: 100%;">
                                                 <ul>
@@ -379,7 +379,7 @@
                                                 </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;">
+                                        <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;">
                                             <Checkbox style="margin-right: 70px;"></Checkbox>
                                             <div style="display: flex;justify-content: space-between;align-items: center;width: 100%;">
                                                 <ul>
@@ -996,7 +996,8 @@
                         this.isListLoading = true
                         this.$api.schoolSetting.classroomSettingSaveOrUpdate({
                             classroom: this.classroomListShow[this.curClassIndex],
-                            option: option
+                            option: option,
+                            school_code: this.$store.state.userInfo.schoolCode
                         }).then(
                             res => {
                                 if (res) {
@@ -1031,7 +1032,16 @@
             },
             getClassroom() {
                 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) => {
                         if (res.code == 1 || res.code == 3) {
                             this.classroomList = this.$store.state.schoolBaseInfo.classroomList
@@ -1052,7 +1062,7 @@
                     }
                 ).finally(() => {
                     this.isListLoading = false
-                })
+                })*/
             },
             /**显示确认删除班级对话框 */
             showConfirmDelete() {
@@ -1072,7 +1082,7 @@
                     this.$api.schoolSetting.delClassroom({
                         id: this.classroomListShow[index].id,
                         scope: this.classroomListShow[index].scope,
-                        code: this.classroomListShow[index].code
+                        school_code: this.$store.state.userInfo.schoolCode
                     }).then(
                         (res) => {
                             if (res.error == null) {
@@ -1385,7 +1395,7 @@
         
 </style>
 <style lang="less">
-.testclass{
+.gradient{
     @keyframes Itemfadein {
           0% {
             opacity: 0;

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

@@ -661,22 +661,59 @@
                 this.isLoading = true
                 this.$api.schoolSetting.schoolSettingSaveOrUpdate(this.schoolSetting).then(
                     (res) => {
-                        if (res.error == null) {
+                        if (!res.error) {
                             this.$Message.success(this.$t('schoolBaseInfo.ssTips3'))
                             this.updated = false
-                            this.isLoading = false
-                            this.editSemIndex = -1
-                            this.editTZStatsu = true
+                            this.$store.commit('user/setSchoolBase', this.schoolSetting)
                         }
                     },
                     (err) => {
-                        this.isLoading = false
+                        console.log(err)
+                        this.$Message.error('保存失败!')
                     }
-                )
+                ).finally(() => {
+                    setTimeout(() => {
+                        this.isLoading = false
+                    },400)
+                })
             },
             getSchoolBaseData() {
                 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) => {
                         if (res.code == 1 || res.code == 3) {
                             this.isInit = true
@@ -718,7 +755,7 @@
                     setTimeout(() => {
                         this.isLoading = false
                     }, 500)
-                })
+                })*/
             },
             handleData() {
                 for (let i = 0; i < this.schoolSetting.period.length; i++) {
@@ -808,13 +845,11 @@
             },
             getLocalDefaultData() {
                 let data = require('@/static/baseDataDefault.json')
-                console.log(data)
                 let lang = window.localStorage.getItem('local')
                 let result = data.filter(item => {
                     return item.lang == lang
                 })
                 this.dataDefault = result.length > 0 ? result[0] : data[0]
-                console.log(this.dataDefault)
             },
             //根据语言读取时区列表
             getTimeZoneList() {
@@ -845,7 +880,7 @@
             }
         },
         created() {
-            this.getLocalDefaultData()
+            //this.getLocalDefaultData()
             this.initData()
             this.getSchoolBaseData()
             this.getTimeZoneList()

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

@@ -19,12 +19,12 @@
                         </FormItem>
                         <FormItem label="学段" prop="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>
                         </FormItem>
                         <FormItem label="科目" prop="subjectCode">
                             <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>
                         </FormItem>
                         <FormItem label="描述" prop="introduce">

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

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

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

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

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

@@ -263,21 +263,20 @@
 		methods: {
 			/* 获取当前学校基础信息 */
 			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.areaList = filterJson.areaList
 						this.filterData.feedbackList = filterJson.feedbackList
 					}
-					console.log(res)
-				})
+				}
 			},
 			// 获取学情首页数据
 			getHomePageData() {

+ 21 - 15
TEAMModelOS/ClientApp/src/view/syllabus/newSyllabus/Index.vue

@@ -34,6 +34,9 @@
 					</div>
 				</div>
 				<vuescroll>
+					<div v-if="subjectList.length === 0">
+						<EmptyData :top="50"></EmptyData>
+					</div>
 					<div class="gl">
 						<div :class='["gl-item",index == activeSubjectIndex ? "item-active":""]' v-for="(item,index) in subjectList" :key="index"
 						 @click="hasModify ? handleConfirmSave({index},'2') : handleSubjectTap(index)">
@@ -54,9 +57,9 @@
 							<span style="margin-left:5px">册别</span>
 						</span>
 						<div>
-							<Icon type="md-add" v-if="$access.can('admin.*|Volumn_Add') || tabIndex === 1" color="#fff" size="18" style="cursor:pointer;margin-right:10px"
+							<Icon type="md-add" v-if="($access.can('admin.*|Volumn_Add') || tabIndex === 1) && subjectList.length" color="#fff" size="18" style="cursor:pointer;margin-right:10px"
 							 @click="onAddVolume" />
-							<Poptip title="筛选册别" placement="bottom-end" @on-popper-show="onPopperShow" v-if="isSchool">
+							<Poptip title="筛选册别" placement="bottom-end" @on-popper-show="onPopperShow" v-if="isSchool && subjectList.length">
 								<Icon type="ios-funnel" color="#fff" size="18" style="cursor:pointer;margin-right:10px" />
 								<div class="funnel-box" slot="content">
 									<p>年级</p>
@@ -226,20 +229,18 @@
 			// 获取当前学校学段学科等基本信息
 			initSchoolData() {
 				return new Promise((r, j) => {
-					this.$store.dispatch('schoolBaseInfo/getSchoolBaseData').then(res => {
-						console.log(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.periodId = this.originData.period[0].id
+					let schoolBaseInfo = JSON.parse(JSON.stringify(this.$store.state.user.schoolProfile.school_base))
+					if(schoolBaseInfo){
+						this.originSchoolData = schoolBaseInfo // 默认选择第一个
+						this.originData = schoolBaseInfo // 默认选择第一个
+						if(schoolBaseInfo.period.length){
+							this.periodList = schoolBaseInfo.period
+							this.currentParams.code = schoolBaseInfo.id
+							this.currentParams.periodId = schoolBaseInfo.period[0].id
 							this.currentPeriodIndex = 0 // 默认选择第一个学段
 							this.onPeriodChange(0)
-						} else {
-							this.$Message.warning('暂无学段数据')
 						}
-					})
+					}
 				})
 
 			},
@@ -362,8 +363,13 @@
 					this.originSubjectList = JSON.parse(JSON.stringify(this.periodList[index].subjects)) // 筛选学科源数据
 					this.gradeList = JSON.parse(JSON.stringify(this.periodList[index].grades)) // 切换学段后更新 年级 列表
 					this.semesterList = JSON.parse(JSON.stringify(this.periodList[index].semesters)) // 切换学段后更新 学期 列表
-					this.handleSubjectTap(0)
-					this.initSyllabusCount()
+					if(this.subjectList.length){
+						this.handleSubjectTap(0)
+						this.initSyllabusCount()
+					}else{
+						this.volumeList = []
+					}
+					
 					this.searchSubject = ''
 					setTimeout(function() {
 						that.isLoadSubject = false

+ 14 - 10
TEAMModelOS/ClientApp/src/view/syllabus/newSyllabus/operation/AddVolume.vue

@@ -49,6 +49,10 @@
         },
         created() {
 			this.isSchool = this.$route.name === 'syllabus'
+			if(this.originData){
+				this.currentPeriod = this.originData.period[this.periodIndex]
+				this.originDatas = this.originData
+			}
         },
         methods: {
             // 提交添加
@@ -130,30 +134,30 @@
             periodIndex: {
                 handler(newValue, oldValue) {
                     this.currentPeriod = this.originDatas.period[newValue]
-                    this.formTop.subject = this.currentPeriod.subjects[0].id
-                    this.formTop.grade = this.currentPeriod.grades[0].id
-                    this.formTop.semester = this.currentPeriod.semesters[0].id
+                    this.formTop.subject = this.currentPeriod.subjects.length ? this.currentPeriod.subjects[0].id : ''
+                    this.formTop.grade = this.currentPeriod.grades.length ? this.currentPeriod.grades[0].id : ''
+                    this.formTop.semester = this.currentPeriod.semesters.length ? this.currentPeriod.semesters[0].id : ''
                     this.formTop.volume = ''
                     console.log(this.currentPeriod)
                 }
             },
             subjectIndex: {
                 handler(newValue, oldValue) {
-                    this.formTop.subject = this.currentPeriod.subjects[newValue].id
+                    this.formTop.subject = this.currentPeriod.subjects ? this.currentPeriod.subjects[newValue].id : ''
                 }
             },
             editVolume: {
                 handler(newValue, oldValue) {
                     if (newValue) { // 有编辑册别传过来则为编辑状态
                         this.editItem = newValue
-                        this.formTop.subject = newValue.subjectId
-                        this.formTop.grade = newValue.gradeId
-                        this.formTop.semester = newValue.semesterId
+                        this.formTop.subject = this.formTop.subject || this.currentPeriod.subjects[0].id
+                        this.formTop.grade = this.formTop.grade || this.currentPeriod.grades[0].id
+                        this.formTop.semester = this.formTop.semester || this.currentPeriod.semesters[0].id
                         this.formTop.volume = newValue.volumeName
                     } else { // 否则为新增状态
-                        this.formTop.subject = this.currentPeriod.subjects[0].subjectId
-                        this.formTop.grade = this.currentPeriod.grades[0].gradeId
-                        this.formTop.semester = this.currentPeriod.semesters[0].semesterId
+                        this.formTop.subject = this.formTop.subject || this.currentPeriod.subjects[0].id
+                        this.formTop.grade = this.formTop.grade || this.currentPeriod.grades[0].id
+                        this.formTop.semester = this.formTop.semester || this.currentPeriod.semesters[0].id
                         this.formTop.volume = ''
                         this.editItem = newValue
                     }

+ 4 - 5
TEAMModelOS/ClientApp/src/view/teachcontent/index.less

@@ -202,14 +202,13 @@
 
         .content-type-item {
             width: 100%;
-            height: 100px;
-            line-height: 100px;
+            height: 90px;
+            line-height: 90px;
             text-align: center;
             border-bottom: 1px solid @borderColor;
             cursor: pointer;
             z-index: 1;
             position: relative;
-            font-size: inherit;
             font-family: inherit;
             color: white;
             outline: none;
@@ -229,10 +228,10 @@
 
             span {
                 color: white;
-                font-size: 22px;
+                font-size: 18px;
                 font-weight: 500;
                 /*letter-spacing: 5px;*/
-                margin-left: 20px;
+                margin-left: 18px;
             }
         }
 

+ 115 - 87
TEAMModelOS/ClientApp/src/view/teachcontent/index.vue

@@ -4,11 +4,14 @@
         <div class="teach-content-main">
             <!--文件分类列表-->
             <div class="content-type-list">
-                <div :class="item.type === activeType ? 'content-type-item content-type-item-active':'content-type-item'" 
+                <div :class="item.type === activeType ? 'content-type-item content-type-item-active':'content-type-item'"
                      v-for="(item,index) in contentTypeList" :key="index" @click="selectFileType(index)">
-                    <Icon v-if="item.icon.indexOf('iconfont') != -1" :custom="item.icon" color="white" size="28" />
-                    <Icon v-else :type="item.icon" color="white" size="28" />
+                    <Icon v-if="item.icon.indexOf('iconfont') != -1" :custom="item.icon" color="white" size="26" />
+                    <Icon v-else :type="item.icon" color="white" size="26" />
                     <span class="content-type-label">{{item.label}}</span>
+                    <Tooltip transfer theme="light" content="HiTeach生成的课件,不包含PPT等其他文件" :max-width="248" placement="bottom" offset="-20">
+                        <Icon type="ios-alert-outline" color="#1cc0f3" size="20" v-if="index == 0" style="position:absolute;top:-16px;margin-left:5px;" />
+                    </Tooltip>
                 </div>
                 <div :class="($access.can('admin.*|content-school-upd') || rangeType == 1) ? 'space-box animated fadeIn fast' : 'space-box animated fadeOut fast'">
                     <div class="percent-box">
@@ -63,7 +66,7 @@
                         </p>
                         <p class="percent-detail-text" v-if="sizeInfo.data != 0">
                             <span class="text-dot storage-data"></span>
-                            <span>试卷/题目...</span>
+                            <span>试卷/题目</span>
                             <span class="text-size">{{$jsFn.formatBytes(sizeInfo.data)}}</span>
                         </p>
                     </div>
@@ -163,9 +166,10 @@
             </div>
         </div>
         <!--上传文件-->
-        <Modal v-model="uploadStatus"
-               :title="$t('teachContent.btnUpload')" class="upload-modal" footer-hide width="660" :mask-closable="false">
-            <NewUploadFile @successData="getFileUrl" :sasString="sasString" :urlString="urlString" :path="folder" :containerName="containerName" :quality="1"></NewUploadFile>
+        <Modal v-model="uploadStatus" @on-cancel="cancelUpd()" @on-ok="confirmUpd()" ok-text="确认上传" cancel-text="取消上传"
+               :title="$t('teachContent.btnUpload')" class="upload-modal dark-iview-modal" width="660" :mask-closable="false">
+            <NewUploadFile ref="uploadFile" @successData="getFileUrl" @deleteFile="cancelUpdFile"
+                           :sasString="sasString" :urlString="urlString" :path="folder" :containerName="containerName" :quality="1"></NewUploadFile>
         </Modal>
         <!--文件预览-->
         <div v-if="previewStatus" class="image-viewer">
@@ -224,13 +228,107 @@
                     doc: 0,     //内容模块文档
                     other: 0,   //内容模块其他文件
                     data: 0      //除了内容模块之外的文件
+                },
+                preUpdFiles: [],
+                isFirst: {
+                    image: true,
+                    video: true,
+                    audio: true,
+                    doc: true,
+                    other: true
                 }
             }
         },
         computed: {
         },
         methods: {
-            
+            cancelUpdFile(file) {
+                for (let index in this.preUpdFiles) {
+                    if (this.preUpdFiles[index].blob == file.blob) {
+                        this.preUpdFiles.splice(index, 1)
+                        break
+                    }
+                }
+            },
+            getFileUrl(file) { // 获取文件地址
+                this.preUpdFiles.push(file)
+            },
+            //取消上传
+            cancelUpd() {
+                let updComp = this.$refs['uploadFile']
+                updComp.uploadedList = []
+                this.containerClient.deleteBlobBatch(this.preUpdFiles.map(item => {
+                    return item.blob
+                })).then().finally(() => {
+                    this.preUpdFiles = []
+                })
+            },
+            //确认上传
+            async confirmUpd() {
+                for (let file of this.preUpdFiles) {
+                    let filterRes = this.fileList[file.type].filter(item => {
+                        return item.blob == file.blob
+                    })
+                    if (filterRes.length == 0) {
+                        file.url = file.url + this.sasString
+                        if (!this.fileList[file.type]) {
+                            this.fileList[file.type] = []
+                        }
+                        if (file.type == 'image') {
+                            await this.$jsFn.compressImgByUrl(file.url, file.name, 0.1).then(
+                                (res) => {
+                                    file['compress'] = res
+                                },
+                                (err) => {
+                                    file['compress'] = undefined
+                                }
+                            )
+                        } else if (file.type == 'video') {
+                            await this.$jsFn.createVideoPoster(file.url, file.name, 0.1).then(
+                                (res) => {
+                                    file['compress'] = res
+                                },
+                                (err) => {
+                                    file['compress'] = undefined
+                                }
+                            )
+                        }
+                        if (this.activeType == file.type) {
+                            this.fileListShow.unshift(file)
+                            this.fileList[file.type].unshift(file)
+                        } else {
+                            this.fileList[file.type].unshift(file)
+                        }
+                        //更新空间
+                        this.sizeInfo.total += file.size
+                        switch (file.type) {
+                            case 'res':
+                                this.sizeInfo.res += file.size
+                                break
+                            case 'image':
+                                this.sizeInfo.image += file.size
+                                break
+                            case 'video':
+                                this.sizeInfo.video += file.size
+                                break
+                            case 'audio':
+                                this.sizeInfo.audio += file.size
+                                break
+                            case 'doc':
+                                this.sizeInfo.doc += file.size
+                                break
+                            case 'other':
+                                this.sizeInfo.other += file.size
+                                break
+                            default:
+                                break
+                        }
+                    }
+                    
+                }
+                let updComp = this.$refs['uploadFile']
+                updComp.uploadedList = []
+            },
             //计算空间占比
             getPercent(size) {
                 if (this.sizeInfo.total > this.storageSpace) {
@@ -399,7 +497,6 @@
                     this.containerClient.getSize().then(
                         res => {
                             this.sizeInfo = res
-                            console.log(res)
                         },
                         err => {
                             this.$Message.error('空间计算异常')
@@ -460,7 +557,7 @@
              */
             delFile(file,index) {
                 let filePath = file.url
-                filePath = filePath.substring((this.urlString + this.containerName).length + 2)
+                filePath = filePath.substring((this.urlString + this.containerName).length + 1)
                 filePath = filePath.substring(0, filePath.lastIndexOf('?'))
                 this.$Modal.confirm({
                     title: this.$t('teachContent.props1'),
@@ -592,61 +689,7 @@
                     }, 500)
                 }
             },
-            async getFileUrl(file) { // 获取文件地址
-                file.url = file.url + this.sasString
-                if (!this.fileList[this.activeType]) {
-                    this.fileList[this.activeType] = []
-                }
-                if (file.type == 'image') {
-                    await this.$jsFn.compressImgByUrl(file.url, file.name, 0.1).then(
-                        (res) => {
-                            file['compress'] = res
-                        },
-                        (err) => {
-                            file['compress'] = undefined
-                        }
-                    )
-                } else if (file.type == 'video') {
-                    await this.$jsFn.createVideoPoster(file.url, file.name, 0.1).then(
-                        (res) => {
-                            file['compress'] = res
-                        },
-                        (err) => {
-                            file['compress'] = undefined
-                        }
-                    )
-                } 
-                if (this.activeType == file.type) {
-                    this.fileListShow.unshift(file)
-                    this.fileList[this.activeType].unshift(file)
-                } else {
-                    this.fileList[this.activeType].unshift(file)
-                }
-                //更新空间
-                this.sizeInfo.total += file.size
-                switch (file.type) {
-                    case 'res':
-                        this.sizeInfo.res += file.size
-                        break
-                    case 'image':
-                        this.sizeInfo.image += file.size
-                        break
-                    case 'video':
-                        this.sizeInfo.video += file.size
-                        break
-                    case 'audio':
-                        this.sizeInfo.audio += file.size
-                        break
-                    case 'doc':
-                        this.sizeInfo.doc += file.size
-                        break
-                    case 'other':
-                        this.sizeInfo.other += file.size
-                        break
-                    default:
-                        break
-                }
-            },
+            
             /**
              * 关键词搜索
              * */
@@ -685,16 +728,17 @@
                 this.extFilter = []
                 this.selections.length = 0
                 this.activeType = this.contentTypeList[index].type
-                if (this.fileList[this.activeType]) {
+                if (this.isFirst[this.activeType]) {
+                    this.fileListShow.length = 0
+                    this.findFileList()
+                    this.isFirst[this.activeType] = false
+                } else {
                     let files = []
                     files = this.fileList[this.activeType] ? this.fileList[this.activeType] : []
                     this.fileListShow = this._.cloneDeep(files)
                     this.getFilesExtension()
                     this.searchBefore = this.fileListShow
                     this.keyWord = ''
-                } else {
-                    this.fileListShow.length = 0
-                    this.findFileList()
                 }
             },
             /**
@@ -776,25 +820,9 @@
         margin-top: 12px;
     }
 
-    .upload-modal .ivu-modal-content {
-        background-color: #303030;
-    }
-
-    .upload-modal .ivu-modal-header {
-        border-color: #424242;
-    }
-
-        .upload-modal .ivu-modal-header p, .upload-modal .ivu-modal-header-inner {
-            color: #DDDDDD;
-        }
-
-    .upload-modal .ivu-modal-footer {
-        border-color: #424242;
-    }
-
     .upload-modal .ivu-upload-drag {
-        background: #383838;
-        border-color: #424242;
+        background: #404040;
+        border-color: #606060;
         color: #DDDDDD;
     }
 

+ 2 - 2
TEAMModelOS/ClientApp/src/view/teachermgmt/components/personnel/Index.vue

@@ -113,7 +113,7 @@
                         </div>
                         <div class="detail-ctr">
                             <div class="time">
-                                {{ item.createDate | converTime }}
+                                {{ item.createTime | converTime }}
                             </div>
                             <div class="btns">
                                 <template v-if="item.status == 'invite'">
@@ -318,7 +318,7 @@ export default {
             switch (this.sortCode) {
                 case 'time': 
                     this.dataList.sort(function(a, b){
-                        return b.createDate - a.createDate;
+                        return b.createTime - a.createTime;
                     })
                     return this.dataList
                 break;

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

@@ -132,13 +132,14 @@
 					name: '预设投票名称',
 					code: this.tabIndex === 0 ? this.$store.state.userInfo.schoolCode : this.$store.state.userInfo.TEAMModelId,
 					targetClassIds: [],
-					options: [],
+					options: [{code:'A',value:''},{code:'B',value:''}],
 					endTime: '',
 					publishModel: '0',
 					selectMax:1,
 					startTime: '',
 					description: '',
-					secret: []
+					secret: false,
+					progress:'pending'
 				}
 
 				this.voteList.unshift(defaultVote);
@@ -146,8 +147,8 @@
 				this.editable = true
 				this.hasNewAdd = true
 				this.$refs.voteForm.voteFormEdit = true
-				this.$refs.voteForm.voteOptions = [...new Array(2).keys()]
-				this.$refs.voteForm.initEditors()
+				// this.$refs.voteForm.voteOptions = [...new Array(2).keys()]
+				// this.$refs.voteForm.initEditors()
 			},
 
 

+ 4 - 4
TEAMModelOS/Controllers/Client/HiTeachController.cs

@@ -336,7 +336,7 @@ namespace TEAMModelOS.Controllers.Client
                         page = page_json.GetInt32() - 1;
                     }
                 }
-                string order = "createDate"; //排序項目
+                string order = "createTime"; //排序項目
                 if (request.TryGetProperty("order", out JsonElement order_json))
                 {
                     if(order_json.ToString() == "useCount")
@@ -351,7 +351,7 @@ namespace TEAMModelOS.Controllers.Client
                 }
 
                 //資料取得
-                await foreach (var item in client.GetContainer("TEAMModelOS", container).GetItemQueryStreamIterator(queryText: $"SELECT c.periodId, c.gradeIds, c.subjectId, c.subjectName, c.name, REPLACE(c.blob, 'index.json', '') AS blob, c.score, c.useCount, ARRAY_LENGTH(c.scoring) AS itemCount, c.createDate From c {queryWhere + queryOption}", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Paper-{partitionid}") }))
+                await foreach (var item in client.GetContainer("TEAMModelOS", container).GetItemQueryStreamIterator(queryText: $"SELECT c.periodId, c.gradeIds, c.subjectId, c.subjectName, c.name, REPLACE(c.blob, 'index.json', '') AS blob, c.score, c.useCount, ARRAY_LENGTH(c.scoring) AS itemCount, c.createTime From c {queryWhere + queryOption}", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Paper-{partitionid}") }))
                 {
                     using var json = await JsonDocument.ParseAsync(item.ContentStream);
                     if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
@@ -480,7 +480,7 @@ namespace TEAMModelOS.Controllers.Client
                         page = page_json.GetInt32() - 1;
                     }
                 }
-                string order = "createDate"; //排序項目
+                string order = "createTime"; //排序項目
                 if (request.TryGetProperty("order", out JsonElement order_json))
                 {
                     if (order_json.ToString() == "useCount")
@@ -495,7 +495,7 @@ namespace TEAMModelOS.Controllers.Client
                 }
 
                 //資料取得
-                await foreach (var item in client.GetContainer("TEAMModelOS", container).GetItemQueryStreamIterator(queryText: $"SELECT c.id, c.periodId, c.gradeIds, c.subjectId, c.subjectName, c.blob, c.field, c.level, c.type, c.useCount, c.createDate From c {queryWhere + queryOption}", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Item-{partitionid}") }))
+                await foreach (var item in client.GetContainer("TEAMModelOS", container).GetItemQueryStreamIterator(queryText: $"SELECT c.id, c.periodId, c.gradeIds, c.subjectId, c.subjectName, c.blob, c.field, c.level, c.type, c.useCount, c.createTime From c {queryWhere + queryOption}", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Item-{partitionid}") }))
                 {
                     using var json = await JsonDocument.ParseAsync(item.ContentStream);
                     if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)

+ 47 - 21
TEAMModelOS/Controllers/Exam/ExamController.cs

@@ -61,12 +61,13 @@ namespace TEAMModelOS.Controllers
         public async Task<IActionResult> Save(ExamInfo request)
         {
             //新增
-            string code = request.code;
+            //string code = request.code;
             var client = _azureCosmos.GetCosmosClient();
             ExamInfo exam;
             request.ttl = -1;
             request.pk = "Exam";
-            request.createDate = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
+            request.code = "Exam-" + request.code;
+            request.createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
             /*            if (request.publish.Equals("0"))
                         {
                             request.progress = "going";
@@ -84,10 +85,9 @@ namespace TEAMModelOS.Controllers
             {
                 request.id = Guid.NewGuid().ToString();
                 request.progress = "pending";
-                request.code = "Exam-" + request.code;
                 int count = 0;
                 for (int i =0; i < request.targetClassIds.Count;i++) {
-                    var sresponse = await client.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(request.targetClassIds[i], new PartitionKey($"Class-{code}"));
+                    var sresponse = await client.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(request.targetClassIds[i], new PartitionKey($"{request.code}"));
                     if (sresponse.Status == 200) {
                         using var json = await JsonDocument.ParseAsync(sresponse.ContentStream);
                         Classroom classroom = json.ToObject<Classroom>();
@@ -95,7 +95,7 @@ namespace TEAMModelOS.Controllers
                     }
                 }
                 request.stuCount = count;
-                exam = await client.GetContainer("TEAMModelOS", "Common").CreateItemAsync(request, new PartitionKey($"Exam-{code}"));
+                exam = await client.GetContainer("TEAMModelOS", "Common").CreateItemAsync(request, new PartitionKey($"{request.code}"));
                 await _serviceBus.GetServiceBusClient().SendLeamMessage<ExamInfo>(Constants.TopicName, request.id, request.code, request.startTime);
                 //request.sequenceNumber = SequenceNumber;
             }
@@ -106,12 +106,17 @@ namespace TEAMModelOS.Controllers
                 {
                     return Ok(new { v = "活动正在进行中" });
                 }
+                request.progress = info.progress;
+                await _serviceBus.GetServiceBusClient().cancelMessage(Constants.TopicName, info.sequenceNumber);
+                long SequenceNumber = await _serviceBus.GetServiceBusClient().SendLeamMessage<ExamInfo>(Constants.TopicName, request.id, request.code, request.startTime);
+                request.sequenceNumber = SequenceNumber;
                 exam = await client.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync(request, request.id, new PartitionKey($"{request.code}"));
+                //await _serviceBus.GetServiceBusClient().SendLeamMessage<ExamInfo>(Constants.TopicName, request.id, request.code, request.startTime);
             }
             //Survey homeWork = await _azureCosmos.SaveOrUpdate<Survey>(request.survey);
 
             //设定结束时间
-            string msgEndId = _snowflakeId.NextId() + "";
+            //string msgEndId = _snowflakeId.NextId() + "";
             await _serviceBus.GetServiceBusClient().SendLeamMessage<ExamInfo>(Constants.TopicName, request.id, request.code, request.endTime);
             return Ok(new{ exam });
         }
@@ -307,18 +312,19 @@ namespace TEAMModelOS.Controllers
         public async Task<IActionResult> upsertRecord(JsonElement request)
         {
             if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
-            if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
+            //if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
             if (!request.TryGetProperty("answer", out JsonElement answer)) return BadRequest();
             if (!request.TryGetProperty("studentId", out JsonElement studentId)) return BadRequest();
+            if (!request.TryGetProperty("subjectId", out JsonElement subjectId)) return BadRequest();
             if (!request.TryGetProperty("classId", out JsonElement classId)) return BadRequest();
             if (!request.TryGetProperty("multipleRule", out JsonElement multipleRule)) return BadRequest();
-            if (!request.TryGetProperty("answers ", out JsonElement tandardAnswer)) return BadRequest();
-            if (!request.TryGetProperty("point", out JsonElement point)) return BadRequest();
+            //if (!request.TryGetProperty("answers ", out JsonElement tandardAnswer)) return BadRequest();
+            if (!request.TryGetProperty("paperId", out JsonElement paperId)) return BadRequest();
             if (!request.TryGetProperty("school", out JsonElement school)) return BadRequest();
             var client = _azureCosmos.GetCosmosClient();         
             List<ExamClassResult> examClassResults = new List<ExamClassResult>();
             await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIterator(
-                queryText: $"select value(c) from c where c.examId = '{id}' and c.subjectId = {studentId} and c.info.id = '{classId}'" ,
+                queryText: $"select value(c) from c where c.examId = '{id}' and c.subjectId = '{subjectId}' and c.info.id = '{classId}'" ,
                 requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"ExamClassResult-{school}") }))
             {
                 using var json = await JsonDocument.ParseAsync(item.ContentStream);
@@ -331,10 +337,23 @@ namespace TEAMModelOS.Controllers
                 }
             }
             ExamClassResult classResult;
-            //ExamClassResult classResult = await client.GetContainer("TEAMModelOS", "Common").ReadItemAsync<ExamClassResult>(id.ToString(), new PartitionKey($"{code}"));
+            List<PaperSimple> standerAnswers = new List<PaperSimple>();
+            await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIterator(
+                queryText: $"select A0.point,A0.answers from c join A0 in c.papers where c.id = '{id}'and A0.id = '{paperId}'",
+                requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Exam-{school}") }))
+            {
+                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())
+                    {
+                        standerAnswers.Add(obj.ToObject<PaperSimple>());
+                    }
+                }
+            }
             List<List<string>> ans = answer.ToObject<List<List<string>>>();
-            List<List<string>> standard = tandardAnswer.ToObject<List<List<string>>>();
-            List<double> points = point.ToObject<List<double>>();
+            List<List<string>> standard = standerAnswers[0].answers;
+            List<double> points = standerAnswers[0].point;
             int index = examClassResults[0].studentIds.IndexOf(studentId.ToString());
             int rule = int.Parse(multipleRule.ToString());
             //classResult.studentAnswers[index] = ans;
@@ -344,19 +363,22 @@ namespace TEAMModelOS.Controllers
                 examClassResults[0].studentAnswers.Add(new List<List<string>>());
             }
             for (int i = 0;i < ans.Count;i++) {
-                examClassResults[0].studentAnswers[index].Add(ans[i]);
+                examClassResults[0].studentAnswers[index][i] = ans[i];
                 //算分处理
                 if (standard[i].Count > 0) {
                     if (ans[i].Count == standard[i].Count && standard[i].Count == 1)
                     {
-                        if (ans[i].Equals(standard[i]))
-                        {
-                            examClassResults[0].studentScores[index][i] = points[i];
-                        }
-                        else
-                        {
-                            examClassResults[0].studentScores[index][i] = 0;
+                        foreach (string right in standard[i]) {
+                            if (standard[i].Contains(right))
+                            {
+                                examClassResults[0].studentScores[index][i] = points[i];
+                            }
+                            else
+                            {
+                                examClassResults[0].studentScores[index][i] = 0;
+                            }
                         }
+                        
                     }
                     else {
                         if (rule > 0) {
@@ -728,6 +750,10 @@ namespace TEAMModelOS.Controllers
             }
 
         }
+        private  class StanderAnswers {
+            List<List<string>> standard { get; set; }
+            List<double> points { get; set; }
+        }
         /// <summary>
         /// 查询单个作答信息  试卷id ,
         /// </summary>

+ 19 - 17
TEAMModelOS/Controllers/School/ClassRoomController.cs

@@ -43,17 +43,18 @@ namespace TEAMModelOS.Controllers
             Classroom classroom;
             if (!requert.TryGetProperty("classroom", out JsonElement room)) return BadRequest();
             if (!requert.TryGetProperty("option", out JsonElement option)) return BadRequest();
+            if (!requert.TryGetProperty("school_code", out JsonElement school_code)) return BadRequest();
             classroom = room.ToObject<Classroom>();
             var client = _azureCosmos.GetCosmosClient();
             classroom.ttl = -1;
             classroom.pk = typeof(Classroom).Name;
-
+            classroom.code = "Class-" + school_code.ToString();
             //students = await _azureCosmos.FindByDict<Student>(new Dictionary<string, object>() { { "classroomCode", classroom.id } });
             if (option.ToString().Equals("insert"))
             {
                 if (classroom.scope.Equals("private"))
                 {
-                    var response = await client.GetContainer("TEAMModelOS", "Teacher").ReadItemStreamAsync(classroom.id, new PartitionKey($"Class-{classroom.code}"));
+                    var response = await client.GetContainer("TEAMModelOS", "Teacher").ReadItemStreamAsync(classroom.id, new PartitionKey($"Class-{school_code}"));
                     if (response.Status == 200)
                     {
                         //classroom = await _azureCosmos.GetCosmosClient().GetContainer("TEAMModelOS", "School").UpsertItemAsync(requert, new PartitionKey($"Classroom-{classroom.code}"));
@@ -61,14 +62,14 @@ namespace TEAMModelOS.Controllers
                     }
                     else
                     {
-                        string code = classroom.code;
-                        classroom.code = "Class-" + classroom.code;
-                        classroom = await _azureCosmos.GetCosmosClient().GetContainer("TEAMModelOS", "Teacher").CreateItemAsync(classroom, new PartitionKey($"Class-{code}"));
+                        //string code = classroom.code;
+                        //classroom.code = "Class-" + school_code;
+                        classroom = await _azureCosmos.GetCosmosClient().GetContainer("TEAMModelOS", "Teacher").CreateItemAsync(classroom, new PartitionKey($"Class-{school_code}"));
 
                     }
                 }
                 else {
-                    var response = await client.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(classroom.id, new PartitionKey($"Class-{classroom.code}"));
+                    var response = await client.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(classroom.id, new PartitionKey($"Class-{school_code}"));
                     if (response.Status == 200)
                     {
                         //classroom = await _azureCosmos.GetCosmosClient().GetContainer("TEAMModelOS", "School").UpsertItemAsync(requert, new PartitionKey($"Classroom-{classroom.code}"));
@@ -76,9 +77,9 @@ namespace TEAMModelOS.Controllers
                     }
                     else
                     {
-                        string code = classroom.code;
-                        classroom.code = "Class-" + classroom.code;
-                        classroom = await _azureCosmos.GetCosmosClient().GetContainer("TEAMModelOS", "School").CreateItemAsync(classroom, new PartitionKey($"Class-{code}"));
+                        //string code = classroom.code;
+                        //classroom.code = "Class-" + school_code;
+                        classroom = await _azureCosmos.GetCosmosClient().GetContainer("TEAMModelOS", "School").CreateItemAsync(classroom, new PartitionKey($"Class-{school_code}"));
 
                     }
                 }                
@@ -91,7 +92,7 @@ namespace TEAMModelOS.Controllers
                 dict.Add("scope", classroom.scope);
                 dict.Add("id", classroom.id);
                 AzureCosmosQuery cosmosDbQuery = SQLHelper.GetSQL(dict, sql);
-                await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIterator(queryDefinition: cosmosDbQuery.CosmosQueryDefinition, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"{classroom.code}") }))
+                await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIterator(queryDefinition: cosmosDbQuery.CosmosQueryDefinition, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Class-{school_code}") }))
                 {
                     using var json = await JsonDocument.ParseAsync(item.ContentStream);
                     if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
@@ -105,7 +106,7 @@ namespace TEAMModelOS.Controllers
                 classroom.students = studentSimples;
                 if (classroom.scope.Equals("private"))
                 {
-                    classroom = await _azureCosmos.GetCosmosClient().GetContainer("TEAMModelOS", "Teacher").ReplaceItemAsync(classroom,classroom.id, new PartitionKey($"{classroom.code}"));
+                    classroom = await _azureCosmos.GetCosmosClient().GetContainer("TEAMModelOS", "Teacher").ReplaceItemAsync(classroom,classroom.id, new PartitionKey($"Class-{school_code}"));
                 }
                 else {
                     List<TeacherCourse> course = new List<TeacherCourse>();
@@ -134,8 +135,8 @@ namespace TEAMModelOS.Controllers
                             await client.GetContainer("TEAMModelOS", "Teacher").ReplaceItemAsync(course[i], course[i].id, new PartitionKey($"{course[i].code}"));
                         }
                     }
-                    string code = classroom.code.Substring(classroom.pk.Length + 1);
-                    var sresponse = await client.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(classroom.id, new PartitionKey($"CourseManagement-{code}"));
+                    //string code = classroom.code.Substring(classroom.pk.Length + 1);
+                    var sresponse = await client.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(classroom.id, new PartitionKey($"CourseManagement-{school_code}"));
                     if (sresponse.Status == 200)
                     {
                         using var json = await JsonDocument.ParseAsync(sresponse.ContentStream);
@@ -148,7 +149,7 @@ namespace TEAMModelOS.Controllers
                         }
 
                     }
-                    classroom = await _azureCosmos.GetCosmosClient().GetContainer("TEAMModelOS", "School").ReplaceItemAsync(classroom, classroom.id, new PartitionKey($"{classroom.code}"));
+                    classroom = await _azureCosmos.GetCosmosClient().GetContainer("TEAMModelOS", "School").ReplaceItemAsync(classroom, classroom.id, new PartitionKey($"Class-{school_code}"));
                 }
                     
             }
@@ -284,13 +285,14 @@ namespace TEAMModelOS.Controllers
         [HttpPost("delete")]
         public async Task<IActionResult> Delete(JsonElement request)
         {
-            if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
+            if (!request.TryGetProperty("school_code", out JsonElement code)) return BadRequest();
             if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
             if (!request.TryGetProperty("scope", out JsonElement scope)) return BadRequest();
             try
             {
-                string school_code = code.ToString().Substring(6);
-                Classroom classroom = new Classroom();
+				//string school_code = code.ToString().Substring(6);
+				string school_code = code.ToString();
+				Classroom classroom = new Classroom();
                 var client = _azureCosmos.GetCosmosClient();
                 if (scope.ToString().Equals("school"))
                 {

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

@@ -57,7 +57,7 @@ namespace TEAMModelOS.Controllers
             //string status_str = (request.TryGetProperty("join_status", out JsonElement status_json)) ? status_json.ToString() : "join";
             //資料取得
             List<object> teachers = new List<object>();
-            await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIterator(queryText: $"SELECT c.id, c.name, c.classes, c.picture ,c.status, c.job, c.createDate, ARRAY_LENGTH(c.permissions) as permissionCount FROM c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Teacher-{school_code}") }))
+            await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIterator(queryText: $"SELECT c.id, c.name, c.classes, c.picture ,c.status, c.job, c.createTime, ARRAY_LENGTH(c.permissions) as permissionCount FROM c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Teacher-{school_code}") }))
             {
                 using var json = await JsonDocument.ParseAsync(item.ContentStream);
                 if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
@@ -287,7 +287,7 @@ namespace TEAMModelOS.Controllers
                         writer.WriteStartArray("permissions");
                         writer.WriteEndArray();
                         writer.WriteString("status", grant_type.ToString());
-                        writer.WriteNumber("createDate", DateTimeOffset.UtcNow.ToUnixTimeSeconds());
+                        writer.WriteNumber("createTime", DateTimeOffset.UtcNow.ToUnixTimeSeconds());
                         writer.WriteEndObject();
                         writer.Flush();
                         await client.GetContainer("TEAMModelOS", "School").CreateItemStreamAsync(stream, new PartitionKey($"Teacher-{school_code}"));
@@ -357,7 +357,7 @@ namespace TEAMModelOS.Controllers
                     {
                         pk = "Teacher",
                         code = $"Teacher-{school_code}",
-                        createDate = DateTimeOffset.UtcNow.ToUnixTimeSeconds(),
+                        createTime = DateTimeOffset.UtcNow.ToUnixTimeSeconds(),
                         id = teacher.id,
                         name = teacher.name,
                         picture = teacher.picture,

+ 15 - 5
TEAMModelOS/Controllers/Task/SurveyController.cs

@@ -51,11 +51,12 @@ namespace TEAMModelOS.Controllers
         {
             //ResponseBuilder builder = ResponseBuilder.custom();
             //新增
-            string code = request.survey.code;
+            //string code = request.survey.code;
             var client = _azureCosmos.GetCosmosClient();
-            Survey survey = new Survey();
+            Survey survey;
             request.survey.ttl = -1;
             request.survey.pk = typeof(Survey).Name;
+            request.survey.code = typeof(Survey).Name + "-" + request.survey.code;
             request.survey.createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
             /*if (request.survey.publishModel.Equals("0"))
             {
@@ -75,8 +76,7 @@ namespace TEAMModelOS.Controllers
                 request.survey.id = Guid.NewGuid().ToString();
                 //request.survey.status = 100;
                 request.survey.progress = "pending";
-                request.survey.code = typeof(Survey).Name + "-" + request.survey.code;
-                survey = await client.GetContainer("TEAMModelOS", "Common").CreateItemAsync(request.survey, new PartitionKey($"Survey-{code}"));
+                survey = await client.GetContainer("TEAMModelOS", "Common").CreateItemAsync(request.survey, new PartitionKey($"{request.survey.code}"));
                 /*if (request.survey.scope.Equals("school"))
                 {
                     survey = await client.GetContainer("TEAMModelOS", "School").CreateItemAsync(request.survey, new PartitionKey($"Survey-{code}"));
@@ -89,7 +89,17 @@ namespace TEAMModelOS.Controllers
 
             }
             else {
-                survey = await client.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync(request.survey, request.survey.id, new PartitionKey($"{request.survey.code}"));
+                Survey info = await client.GetContainer("TEAMModelOS", "Common").ReadItemAsync<Survey>(request.survey.id, new PartitionKey($"{request.survey.code}"));
+                if (info.progress.Equals("going"))
+                {
+                    return Ok(new { v = "活动正在进行中" });
+                }
+                //request.survey.code = info.code;
+                request.survey.progress = info.progress;
+                await _serviceBus.GetServiceBusClient().cancelMessage(Constants.TopicName, info.sequenceNumber);
+                long SequenceNumber = await _serviceBus.GetServiceBusClient().SendLeamMessage<Survey>(Constants.TopicName, request.survey.id, request.survey.code, request.survey.startTime);
+                request.survey.sequenceNumber = SequenceNumber;
+                survey = await client.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync(request.survey, info.id, new PartitionKey($"{info.code}"));
                 //request.survey.createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
                 /*if (request.survey.scope.Equals("school"))
                 {

+ 18 - 9
TEAMModelOS/Controllers/Task/VoteController.cs

@@ -74,12 +74,13 @@ namespace TEAMModelOS.Controllers.Learn
 
 
             //新增ote
-            string code = request.vote.code;
+            //string code = request.vote.code;
             var client = _azureCosmos.GetCosmosClient();
             Vote vote = new Vote();
             request.vote.ttl = -1;
             request.vote.pk = typeof(Vote).Name;
-            request.vote.createDate = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
+            request.vote.code = typeof(Vote).Name + "-" + request.vote.code;
+            request.vote.createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
             /*if (request.vote.publishModel.Equals("0"))
             {
                 //request.vote.startTime = new DateTimeOffset(DateTime.UtcNow).ToUnixTimeMilliseconds();
@@ -98,8 +99,9 @@ namespace TEAMModelOS.Controllers.Learn
                 request.vote.id = Guid.NewGuid().ToString();
                 //request.survey.status = 100;
                 request.vote.progress = "pending";
-                request.vote.code = typeof(Vote).Name + "-" + request.vote.code;
-                vote = await client.GetContainer("TEAMModelOS", "Common").CreateItemAsync(request.vote, new PartitionKey($"Vote-{code}"));
+                long SequenceNumber = await _serviceBus.GetServiceBusClient().SendLeamMessage<Vote>(Constants.TopicName, request.vote.id, request.vote.code, request.vote.startTime);
+                request.vote.sequenceNumber = SequenceNumber;
+                vote = await client.GetContainer("TEAMModelOS", "Common").CreateItemAsync(request.vote, new PartitionKey($"{request.vote.code}"));
                 /*if (request.vote.scope.Equals("school"))
                 {
                     vote = await client.GetContainer("TEAMModelOS", "School").CreateItemAsync(request.vote, new PartitionKey($"Vote-{code}"));
@@ -107,14 +109,21 @@ namespace TEAMModelOS.Controllers.Learn
                 else
                 {
                     vote = await client.GetContainer("TEAMModelOS", "Teacher").CreateItemAsync(request.vote, new PartitionKey($"Vote-{code}"));
-                }*/
-                await _serviceBus.GetServiceBusClient().SendLeamMessage<Survey>(Constants.TopicName, request.vote.id, request.vote.code, request.vote.startTime);
-                //request.vote.sequenceNumber = SequenceNumber;
-
+                }*/               
             }
             else
             {
-                vote = await client.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync(request.vote, request.vote.id, new PartitionKey($"{request.vote.code}"));
+                Vote info = await client.GetContainer("TEAMModelOS", "Common").ReadItemAsync<Vote>(request.vote.id, new PartitionKey($"{request.vote.code}"));
+                if (info.progress.Equals("going"))
+                {
+                    return Ok(new { v = "活动正在进行中" });
+                }
+                //request.vote.code = info.code;
+                request.vote.progress = info.progress;
+                await _serviceBus.GetServiceBusClient().cancelMessage(Constants.TopicName,info.sequenceNumber);
+                long SequenceNumber = await _serviceBus.GetServiceBusClient().SendLeamMessage<Vote>(Constants.TopicName, request.vote.id, request.vote.code, request.vote.startTime);
+                request.vote.sequenceNumber = SequenceNumber;
+                vote = await client.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync(request.vote, info.id, new PartitionKey($"{info.code}"));
                 /*if (request.vote.scope.Equals("school"))
                 {
                     vote = await client.GetContainer("TEAMModelOS", "School").ReplaceItemAsync(request.vote, request.vote.id, new PartitionKey($"{request.vote.code}"));

+ 14 - 7
TEAMModelOS/Controllers/Teacher/InitController.cs

@@ -195,13 +195,20 @@ namespace TEAMModelOS.Controllers
             if (response.Status == 200)
             {
                 using var json = await JsonDocument.ParseAsync(response.ContentStream);
-                foreach (var obj in json.RootElement.GetProperty("roles").EnumerateArray())
+
+                if (json.RootElement.TryGetProperty("roles", out JsonElement _roles) && _roles.ValueKind != JsonValueKind.Null)
                 {
-                    roles.Add(obj.GetString());
+                    foreach (var obj in _roles.EnumerateArray())
+                    {
+                        roles.Add(obj.GetString());
+                    }
                 }
-                foreach (var obj in json.RootElement.GetProperty("permissions").EnumerateArray())
+                if (json.RootElement.TryGetProperty("permissions", out JsonElement _permissions) && _permissions.ValueKind != JsonValueKind.Null)
                 {
-                    permissions.Add(obj.GetString());
+                    foreach (var obj in _permissions.EnumerateArray())
+                    {
+                        permissions.Add(obj.GetString());
+                    }
                 }
             }
             if (roles.Count == 0)
@@ -412,12 +419,12 @@ namespace TEAMModelOS.Controllers
                     {
                         pk = "Teacher",
                         code = $"Teacher-{school_code}",
-                        createDate = DateTimeOffset.UtcNow.ToUnixTimeSeconds(),
+                        createTime = DateTimeOffset.UtcNow.ToUnixTimeSeconds(),
                         id = id,
                         name = name.ToString(),
                         picture = picture?.ToString(), //TODO JJ,原本的判断会出现报错,没检查null却又去ToString
-                        permissions = null,
-                        roles = new List<string>(new string[] { "teacher" }),
+                        permissions = new List<string>(),
+                        roles = new List<string>(){ "teacher" },
                         status = grant_type.GetString()
                     };
                     var response = await client.GetContainer("TEAMModelOS", "School").CreateItemAsync(st, new PartitionKey($"Teacher-{school_code}"));

+ 1 - 1
TEAMModelOS/Models/SchoolInfo/ExamInfo.cs

@@ -42,7 +42,7 @@ namespace TEAMModelOS.Models.SchoolInfo
         public double piont { get; set; }*/
         //指标
         //public double index { get; set; }
-        public long createDate { get; set; }
+        public long createTime { get; set; }
         //public string examCode { get; set; }
         
         /// <summary>

+ 1 - 1
TEAMModelOS/Models/SchoolInfo/SchoolTeacher.cs

@@ -11,6 +11,6 @@ namespace TEAMModelOS.Models.SchoolInfo
         public List<string> roles { get; set; }
         public List<string> permissions { get; set; }
         public string status { get; set; }
-        public long createDate { get; set; }
+        public long createTime { get; set; }
     }
 }

+ 1 - 1
TEAMModelOS/Models/SchoolInfo/Vote.cs

@@ -55,7 +55,7 @@ namespace TEAMModelOS.Models.SchoolInfo
         /// </summary>
         [ProtoMember(6)]
         public long startTime { get; set; }
-        public long createDate { get; set; }
+        public long createTime { get; set; }
 
         /// <summary>
         /// 结束时间