فهرست منبع

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

OnePsycho 4 سال پیش
والد
کامیت
c1893f2b90
21فایلهای تغییر یافته به همراه861 افزوده شده و 613 حذف شده
  1. 73 26
      TEAMModelFunction/TriggerExam.cs
  2. 49 42
      TEAMModelFunction/TriggerSurvey.cs
  3. 5 2
      TEAMModelFunction/TriggerVote.cs
  4. 1 1
      TEAMModelOS/ClientApp/src/assets/student-web/component_styles/vote.css
  5. 24 7
      TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContentTypeTemplate/Vote.vue
  6. 9 51
      TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContentTypeTemplate/VoteResultChart.vue
  7. 2 1
      TEAMModelOS/ClientApp/src/view/learnactivity/CreatePrivEva.vue
  8. 2 36
      TEAMModelOS/ClientApp/src/view/learnactivity/CreateSchoolEva.vue
  9. 4 3
      TEAMModelOS/ClientApp/src/view/newcourse/CourseClassroom.less
  10. 5 3
      TEAMModelOS/ClientApp/src/view/newcourse/MyCourse.less
  11. 187 192
      TEAMModelOS/ClientApp/src/view/newcourse/MyCourse.vue
  12. 14 0
      TEAMModelOS/ClientApp/src/view/newcourse/NewCusMgt.less
  13. 194 182
      TEAMModelOS/ClientApp/src/view/newcourse/NewCusMgt.vue
  14. 67 28
      TEAMModelOS/ClientApp/src/view/newcourse/TeaTable.vue
  15. 66 19
      TEAMModelOS/Controllers/Common/ExamController.cs
  16. 2 3
      TEAMModelOS/Controllers/Common/SurveyController.cs
  17. 2 2
      TEAMModelOS/Controllers/Common/VoteController.cs
  18. 32 12
      TEAMModelOS/Controllers/School/CourseController.cs
  19. 113 0
      TEAMModelOS/Properties/ServiceDependencies/teammodelos-test - Web Deploy/profile.arm.json
  20. 5 2
      TEAMModelOS/Services/Common/ActivityStudentService.cs
  21. 5 1
      TEAMModelOS/Services/Common/ActivityTeacherService.cs

+ 73 - 26
TEAMModelFunction/TriggerExam.cs

@@ -10,6 +10,7 @@ using TEAMModelOS.SDK.DI;
 using TEAMModelOS.SDK.Extension;
 using TEAMModelOS.SDK.Models;
 using TEAMModelOS.SDK.Models.Cosmos;
+using TEAMModelOS.SDK.Models.Cosmos.Common;
 
 namespace TEAMModelFunction
 {
@@ -154,33 +155,70 @@ namespace TEAMModelFunction
                                 result.info.id = cla;
                                 if (info.scope.Equals("private", StringComparison.OrdinalIgnoreCase))
                                 {
-                                    var sresponse = await client.GetContainer("TEAMModelOS", "Teacher").ReadItemStreamAsync(cla, new Azure.Cosmos.PartitionKey($"Class-{info.creatorId}"));
+                                    
+                                    List<string> ans = new List<string>();
+                                    List<double> ansPoint = new List<double>();
+                                    List<string> ids = new List<string>();
+                                    foreach (double p in info.papers[m].point)
+                                    {
+                                        //ans.Add(new List<string>());
+                                        ansPoint.Add(-1);
+                                    }
+                                    var sresponse = await client.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(cla, new Azure.Cosmos.PartitionKey($"Class-{info.school}"));
                                     if (sresponse.Status == 200)
                                     {
                                         using var json = await JsonDocument.ParseAsync(sresponse.ContentStream);
                                         Class classroom = json.ToObject<Class>();
                                         result.info.name = classroom.name;
                                         result.gradeId = classroom.gradeId;
-                                        List<string> ans = new List<string>();
-                                        List<double> ansPoint = new List<double>();
-                                        foreach (double p in info.papers[m].point)
-                                        {
-                                            //ans.Add(new List<string>());
-                                            ansPoint.Add(-1);
-                                        }
-                                        //处理班级学生名单
-                                        List<Student> students = new List<Student>();
-                                        await foreach (var item in client.GetContainer("TEAMModelOS", "Student").GetItemQueryIterator<Student>(queryText: $"select c.id from c where c.classId = '{classroom.id}'", requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.PartitionKey($"Base-{code}") }))
-                                        {
-                                            students.Add(item);
-                                        }
-                                        foreach (Student stu in students)
+                                        //处理班级人数
+                                        await foreach (var item in client.GetContainer("TEAMModelOS", "Student").GetItemQueryStreamIterator(queryText: $"select c.id from c where c.classId = '{classroom.id}'", requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.PartitionKey($"Base-{info.school}") }))
                                         {
-                                            result.studentIds.Add(stu.id);
-                                            result.studentAnswers.Add(ans);
-                                            result.studentScores.Add(ansPoint);
-                                            result.sum.Add(0);
-                                        }
+                                            using var json_stu = await JsonDocument.ParseAsync(item.ContentStream);
+                                            if (json_stu.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
+                                            {
+                                                var accounts = json_stu.RootElement.GetProperty("Documents").EnumerateArray();
+                                                while (accounts.MoveNext())
+                                                {
+                                                    JsonElement account = accounts.Current;
+                                                    ids.Add(account.GetProperty("id").GetString());
+                                                }
+                                            }
+                                        }                                                                               
+                                    }
+                                    var stuResponse = await client.GetContainer("TEAMModelOS", "Teacher").ReadItemStreamAsync(cla, new Azure.Cosmos.PartitionKey($"StuList"));
+                                    if (sresponse.Status == 200) {
+                                        using var json = await JsonDocument.ParseAsync(sresponse.ContentStream);
+                                        StuList stuList = json.ToObject<StuList>();
+                                        result.info.name = stuList.name;
+                                        //处理发布对象为自选名单(个人)
+
+                                        foreach (Students students in stuList.students)
+                                                {
+                                                    if (students.code.Contains(code) && !ids.Contains(students.id))
+                                                    {
+                                                        ids.Add(students.id);
+                                                    }
+                                                    else
+                                                    {
+                                                        ids.Add(students.id);
+                                                    }
+                                                }
+                                                if (stuList.tmids.Count > 0)
+                                                {
+                                                    foreach (string tid in stuList.tmids)
+                                                    {
+                                                        ids.Add(tid);
+                                                    }
+                                                }
+
+                                    }
+                                    foreach (string stu in ids)
+                                    {
+                                        result.studentIds.Add(stu);
+                                        result.studentAnswers.Add(ans);
+                                        result.studentScores.Add(ansPoint);
+                                        result.sum.Add(0);
                                     }
                                 }
                                 else {
@@ -198,15 +236,24 @@ namespace TEAMModelFunction
                                             //ans.Add(new List<string>());
                                             ansPoint.Add(-1);
                                         }
-                                        //处理班级学生名单
-                                        List<Student> students = new List<Student>();
-                                        await foreach (var item in client.GetContainer("TEAMModelOS", "Student").GetItemQueryIterator<Student>(queryText: $"select c.id from c where c.classId = '{classroom.id}'", requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.PartitionKey($"Base-{code}") }))
+                                        List<string> ids = new List<string>();
+                                        //处理班级人数
+                                        await foreach (var item in client.GetContainer("TEAMModelOS", "Student").GetItemQueryStreamIterator(queryText: $"select c.id from c where c.classId = '{classroom.id}'", requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.PartitionKey($"Base-{info.school}") }))
                                         {
-                                            students.Add(item);
+                                            using var json_stu = await JsonDocument.ParseAsync(item.ContentStream);
+                                            if (json_stu.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
+                                            {
+                                                var accounts = json_stu.RootElement.GetProperty("Documents").EnumerateArray();
+                                                while (accounts.MoveNext())
+                                                {
+                                                    JsonElement account = accounts.Current;
+                                                    ids.Add(account.GetProperty("id").GetString());
+                                                }
+                                            }
                                         }
-                                        foreach (Student stu in students)
+                                        foreach (string stu in ids)
                                         {
-                                            result.studentIds.Add(stu.id);
+                                            result.studentIds.Add(stu);
                                             result.studentAnswers.Add(ans);
                                             result.studentScores.Add(ansPoint);
                                             result.sum.Add(0);

+ 49 - 42
TEAMModelFunction/TriggerSurvey.cs

@@ -39,7 +39,7 @@ namespace TEAMModelFunction
                         data = await client.GetContainer("TEAMModelOS", "Teacher").ReadItemAsync<ActivityData>(adid, new Azure.Cosmos.PartitionKey($"{adcode}"));
                     }
                 } catch { data = null; }
-                await _dingDing.SendBotMsg($"问卷调查【{survey.name}-{survey.id}---{survey.ttl}】正在操作", GroupNames.成都开发測試群組);
+                await _dingDing.SendBotMsg($"问卷调查【{survey.name}-{survey.id}-ttl={survey.ttl}】正在操作", GroupNames.成都开发測試群組);
                 if (survey.ttl >= 1)
                 {
                   
@@ -163,61 +163,66 @@ namespace TEAMModelFunction
                             await _azureStorage.UploadFileByContainer(survey.owner, cods.ToJsonString(), "survey", $"{survey.id}/record.json");
                             //结算每道题的答题情况
 
-                            var ContainerClient = _azureStorage.GetBlobContainerClient(survey.owner);
+                            var ContainerClient =  _azureStorage.GetBlobContainerClient(survey.owner);
                             var route = ContainerClient.Uri.ToString();
-                            List<BlobItem> items = await ContainerClient.List($"survey/{survey.id}/urecord");
-                            List<SurveyRecord> surveyRecords = new List<SurveyRecord>();
+                           
                             //获取
 
-                            foreach (BlobItem item in items)
-                            {
-                                BlobAuth blobAuth = _azureStorage.GetBlobSasUriRead(survey.owner, $"{item.Name}");
-                                var url = $"{route}/{item.Name}?{blobAuth.sas}";
-                                var response = await _clientFactory.CreateClient().GetAsync(new Uri(url));
-                                var json = await JsonDocument.ParseAsync(await response.Content.ReadAsStreamAsync());
-                                var Record = json.RootElement.ToObject<SurveyRecord>();
-                                surveyRecords.Add(Record);
-                            }
-                            List<Task<string>> tasks = new List<Task<string>>();
-                            for (int index = 0; index < survey.ans.Count; index++)
-                            {
-                                string url = $"{survey.id}/qrecord/{index}.json";
-                                QuestionRecord question = new QuestionRecord() { index = index };
-                                foreach (SurveyRecord record in surveyRecords)
+                            try {
+                                List<BlobItem> items = await ContainerClient.List($"survey/{survey.id}/urecord");
+                                List<SurveyRecord> surveyRecords = new List<SurveyRecord>();
+                                foreach (BlobItem item in items)
                                 {
-                                    if (record.ans.Count == survey.ans.Count)
+                                    BlobAuth blobAuth = _azureStorage.GetBlobSasUriRead(survey.owner, $"{item.Name}");
+                                    var url = $"{route}/{item.Name}?{blobAuth.sas}";
+                                    var response = await _clientFactory.CreateClient().GetAsync(new Uri(url));
+                                    var json = await JsonDocument.ParseAsync(await response.Content.ReadAsStreamAsync());
+                                    var Record = json.RootElement.ToObject<SurveyRecord>();
+                                    surveyRecords.Add(Record);
+                                }
+                                await _dingDing.SendBotMsg($"问卷调查问题结算数据{surveyRecords.ToJsonString()}", GroupNames.成都开发測試群組);
+                                for (int index = 0; index < survey.ans.Count; index++)
+                                {
+                                    string url = $"{survey.id}/qrecord/{index}.json";
+                                    QuestionRecord question = new QuestionRecord() { index = index };
+                                    foreach (SurveyRecord record in surveyRecords)
                                     {
-                                        foreach (var an in record.ans[index])
+                                        if (record.ans.Count == survey.ans.Count)
                                         {
-                                            //
-                                            if (question.opt.ContainsKey(an))
-                                            {
-                                                if (question.opt[an] != null)
-                                                {
-                                                    question.opt[an].Add(record.userid);
-                                                }
-                                                else
-                                                {
-                                                    question.opt[an] = new HashSet<string>() { record.userid };
-                                                }
-                                            }
-                                            else
+                                            foreach (var an in record.ans[index])
                                             {
-                                                if (survey.ans[index].Contains(an))
+                                                //
+                                                if (question.opt.ContainsKey(an))
                                                 {
-                                                    //如果是客观题code
-                                                    question.opt.Add(an, new HashSet<string> { record.userid });
+                                                    if (question.opt[an] != null)
+                                                    {
+                                                        question.opt[an].Add(record.userid);
+                                                    }
+                                                    else
+                                                    {
+                                                        question.opt[an] = new HashSet<string>() { record.userid };
+                                                    }
                                                 }
                                                 else
                                                 {
-                                                    //如果不是客观code
-                                                    question.other[record.userid] = an;
+                                                    if (survey.ans[index].Contains(an))
+                                                    {
+                                                        //如果是客观题code
+                                                        question.opt.Add(an, new HashSet<string> { record.userid });
+                                                    }
+                                                    else
+                                                    {
+                                                        //如果不是客观code
+                                                        question.other[record.userid] = an;
+                                                    }
                                                 }
                                             }
                                         }
                                     }
+                                    await _azureStorage.UploadFileByContainer(survey.owner, question.ToJsonString(), "survey", url);
                                 }
-                                tasks.Add(_azureStorage.UploadFileByContainer(survey.owner, question.ToJsonString(), "survey", url, false));
+                            } catch (Exception ex) {
+                                await _dingDing.SendBotMsg($"问卷调查问题结算异常{ex.Message}\n{ex.StackTrace}", GroupNames.成都开发測試群組);
                             }
                             if (string.IsNullOrEmpty(survey.recordUrl))
                             {
@@ -227,9 +232,9 @@ namespace TEAMModelFunction
                             else
                             {
                                 //异动,且已经有结算记录则不必再继续。
-                                break;
+                                //break;
                             }
-                            await Task.WhenAll(tasks);
+                            // await Task.WhenAll(tasks);
                             //更新结束状态
                             data.progress = "finish";
                             if (survey.scope == "school")
@@ -240,6 +245,8 @@ namespace TEAMModelFunction
                             {
                                 await client.GetContainer("TEAMModelOS", "Teacher").ReplaceItemAsync<ActivityData>(data, data.id, new Azure.Cosmos.PartitionKey(data.code));
                             }
+                            _azureRedis.GetRedisClient(8).KeyDelete($"Survey:Record:{survey.id}");
+                            _azureRedis.GetRedisClient(8).KeyDelete($"Survey:Submit:{survey.id}");
                             break;
                     }
                 }

+ 5 - 2
TEAMModelFunction/TriggerVote.cs

@@ -40,6 +40,7 @@ namespace TEAMModelFunction
                 } catch {
                     data = null;
                 }
+                await _dingDing.SendBotMsg($"投票活动【{vote.name}-{vote.id}-ttl={vote.ttl}】正在操作", GroupNames.成都开发測試群組);
                 if (vote.ttl >= 1)
                 {
                     //TODO  处理TTL删除业务
@@ -56,7 +57,7 @@ namespace TEAMModelFunction
                             data = await client.GetContainer("TEAMModelOS", "Teacher").ReplaceItemAsync<ActivityData>(data,adid, new Azure.Cosmos.PartitionKey($"{adcode}"));
                         }
                     }
-                    await _dingDing.SendBotMsg($"投票活动【{vote.name}-{vote.id}】被删除", GroupNames.醍摩豆服務運維群組);
+                    await _dingDing.SendBotMsg($"投票活动【{vote.name}-{vote.id}】被删除", GroupNames.成都开发測試群組);
                     return;
                 }
                 else
@@ -187,7 +188,7 @@ namespace TEAMModelFunction
                             }
                             else { 
                                 //异动,且已经有结算记录则不必再继续。
-                                break; 
+                                //break; 
                             }
                             await Task.WhenAll(tasks);
                             data.progress = "finish";
@@ -200,6 +201,8 @@ namespace TEAMModelFunction
                             {
                                 await client.GetContainer("TEAMModelOS", "Teacher").ReplaceItemAsync<ActivityData>(data, data.id, new Azure.Cosmos.PartitionKey(data.code));
                             }
+                            _azureRedis.GetRedisClient(8).KeyDelete($"Vote:Record:{vote.id}");
+                            _azureRedis.GetRedisClient(8).KeyDelete($"Vote:Count:{vote.id}");
                             break;
                     }
                 }

+ 1 - 1
TEAMModelOS/ClientApp/src/assets/student-web/component_styles/vote.css

@@ -76,7 +76,7 @@
 }
 .vote .voteResultsItem {
   padding: 10px 20px;
-  padding-left: 80px;
+  /*padding-left: 80px;*/
   z-index: 0 !important;
   position: relative;
 }

+ 24 - 7
TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContentTypeTemplate/Vote.vue

@@ -71,15 +71,15 @@
             </h3>
             <div class="question-box"><p>1.</p><span v-html="voteInfo.description"></span></div>
             <div v-for="(item,index) in voteInfo.options" :key="index">
-                <div class="voteResultsItem" :class="{ voteResultSelect: item.code == 'B','animate__animated animate__headShake':item == 'B' }">
-                    <svg-icon icon-class="isDone"
+                <div class="voteResultsItem">
+                    <!--<svg-icon icon-class="isDone"
                               class="voteResultsIcon"
-                              v-if="item.code == 'B'" />
+                              v-if="item.code == 'B'" />-->
                     <p style="display:flex">{{ item.code }}.<span v-html="item.value"></span></p>
                 </div>
             </div>
             <div align="center">
-                <VoteResultChart :activityData="voteInfo" :voteRes="voteResData" />
+                <VoteResultChart :voteData="voteData" :voteList="voteList" />
             </div>
         </div>
     </div>
@@ -90,6 +90,7 @@
     import BillBoardandLightBox from "../../EventView/BillBoardandLightBox";
     import VoteResultChart from "./VoteResultChart";
     import Load from "vue-loading-overlay";
+import { options } from "less";
 
     export default {
         name: "Vote",
@@ -118,7 +119,9 @@
                 voteNum: 0,
                 showResult: false,
                 chooseVoteRes: {},
-                isLoad: false
+                isLoad: false,
+                voteData: [],
+                voteList: []
             };
         },
         methods: {
@@ -158,8 +161,8 @@
                                 item.count = 0
                             }
                             if (res.vote.progress == "finish") {
-                                this.showResult = true
                                 this.getVoteRes()
+                                this.showResult = true
                             } else {
                                 this.getVoteRecord()
                             }
@@ -178,11 +181,25 @@
                     }
                     this.$api.studentWeb.getVoteRecord(params).then(res => {
                         if (res) {
-                            this.voteResData = res
+                            this.setData(res)
                         }
                     })
                 }
             },
+            setData(data) {
+                if (data.options.length) {
+                    this.voteData = []
+                    this.voteList = []
+                    for (let item of data.options) {
+                        this.voteData.push({
+                            value: item.count,
+                            itemStyle: { color: "#00AD6C" },
+                        })
+                        this.voteList.push(item.code)
+                    }
+                    this.voteList = this.voteList.sort()
+                }
+            },
             //获取投票结果
             getVote(data) {
                 if (!this.voteInfo.repeat) {

+ 9 - 51
TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContentTypeTemplate/VoteResultChart.vue

@@ -7,37 +7,31 @@
 </template>
 
 <script>
-    import { Random } from "mockjs";
     export default {
         props: {
-            activityData: {
-                type: Object,
+            voteData: {
+                type: Array,
                 default: () => {
-                    return {}
+                    return []
                 }
             },
-            voteRes: {
+            voteList: {
                 type: Array,
                 default: () => {
-                    return {}
+                    return []
                 }
             }
-        },
-        computed: {
-
         },
         data() {
             return {
-                colorList: ["#00AD6C", "#003E27", "#008352", "#FA6400", "#00AD6C"]
+                colorList: ["#00AD6C", "#003E27", "#008352", "#FA6400", "#00AD6C"],
             };
         },
         mounted() {
             this.setMyMap()
-            console.log(this.activityData)
-            console.log(this.voteRes)
         },
         methods: {
-            setMyMap() {
+           setMyMap() {
                 let myChart = this.$echarts.init(document.getElementById('main'));
                 let options = {
                     tooltip: {
@@ -60,7 +54,7 @@
                     },
                     xAxis: {
                         type: "category",
-                        data: ["A", "B", "C", "D"],
+                        data: this.voteList,
                         splitLine: {
                             lineStyle: {
                                 color: "transparent",
@@ -92,43 +86,7 @@
                     barCategoryGap: "1px",
                     series: [
                         {
-                            data: [
-                                {
-                                    value: Random.natural(10, 60),
-                                    itemStyle: { color: "#00AD6C" },
-                                },
-                                {
-                                    value: Random.natural(80, 100),
-                                    itemStyle: { color: "rgb(0, 62, 39)" },
-                                },
-                                {
-                                    value: Random.natural(60, 80),
-                                    itemStyle: { color: "#008352" },
-                                },
-                                {
-                                    //label: {
-                                    //    formatter: ["{Sunny|}", "{c}"].join("\n"),
-                                    //    rich: {
-                                    //        Sunny: {
-                                    //            height: 30,
-                                    //            width: 30,
-                                    //            align: "center",
-                                    //            //backgroundColor: {
-                                    //            //    image:
-                                    //            //        "https://images.unsplash.com/photo-1520223297779-95bbd1ea79b7?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=60",
-                                    //            //},
-                                    //        },
-                                    //    },
-                                    //},
-
-                                    value: Random.natural(60, 80),
-                                    itemStyle: { color: "#FA6400" },
-                                },
-                                {
-                                    value: Random.natural(10, 60),
-                                    itemStyle: { color: "#00AD6C" },
-                                },
-                            ],
+                            data: this.voteData,
                             type: "bar",
                             label: {
                                 show: true,

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

@@ -456,7 +456,8 @@ export default {
                 startTime: this.evaluationInfo.publish == 0 ? Math.round(new Date()) : this.evaluationInfo.startTime,
                 endTime: this.evaluationInfo.endTime,
                 scope: this.evaluationInfo.scope,
-                createDate: Math.round(new Date())
+                createDate: Math.round(new Date()),
+                owner: this.evaluationInfo.scope == 'teacher' ? this.$store.state.userInfo.schoolCode : this.$store.state.userInfo.TEAMModelId //后面新增字段
             }
 
             this.$api.learnActivity.SaveExamInfo(requestData).then(

+ 2 - 36
TEAMModelOS/ClientApp/src/view/learnactivity/CreateSchoolEva.vue

@@ -401,41 +401,6 @@ export default {
             this.curSubIndex = index
             this.activeTab = 'preview'
         },
-        handleData() {
-            this.isLoading = true
-            this.evaluationInfo.code = this.$store.state.userInfo.schoolCode
-            let requestData = {
-                name: this.evaluationInfo.name,
-                code: this.$store.state.userInfo.TEAMModelId,
-                createTime: Date.parse(new Date()) / 1000,
-                target: this.evaluationInfo.target,
-                startTime: this.evaluationInfo.startTime,
-                endTime: this.evaluationInfo.endTime,
-                publish: this.evaluationInfo.publish,
-                type: this.evaluationInfo.type,
-            }
-            if (this.examInfo.id != undefined) {
-                requestData.id = this.examInfo.id
-            } else if (this.evaluationInfo.id != undefined) {
-                requestData.id = this.evaluationInfo.id
-            }
-            this.$api.learnActivity.SaveExamInfo(requestData).then(
-                res => {
-                    if (res.error == null) {
-                        this.examInfo = res.result.data
-                        for (let index in this.evaluationInfo.paperInfo) {
-                            this.saveTestPaper(this.evaluationInfo.paperInfo[index], index)
-                        }
-                    } else {
-                        this.$Message.error('API ERROR!')
-                    }
-                    this.isLoading = false
-                },
-                err => {
-                    this.isLoading = false
-                }
-            )
-        },
         /**
          * 检查试卷数据完整性
          * @param paperInfo
@@ -536,7 +501,8 @@ export default {
                 startTime: this.evaluationInfo.publish == 0 ? Math.round(new Date()) : this.evaluationInfo.startTime,
                 endTime: this.evaluationInfo.endTime,
                 scope: this.mode,
-                createDate: Math.round(new Date())
+                createDate: Math.round(new Date()),
+                owner: this.$store.state.userInfo.schoolCode //后面新增字段
             }
 
             this.$api.learnActivity.SaveExamInfo(requestData).then(

+ 4 - 3
TEAMModelOS/ClientApp/src/view/newcourse/CourseClassroom.less

@@ -336,9 +336,9 @@
 /*111*/
 
 .course-classroom-list {
-    width: 350px;
+    width: 100%;
     height: 100%;
-    border-right: 1px solid @borderColor;
+    // border-right: 1px solid @borderColor;
 
     .course-classroom-list-header {
         width: 100%;
@@ -393,7 +393,8 @@
 }
 
 .course-classroom-info {
-    width: ~"calc(100% - 351px)";
+    // width: ~"calc(100% - 351px)";
+    width: 100%;
     height: 100%;
     padding-left: 10px;
 

+ 5 - 3
TEAMModelOS/ClientApp/src/view/newcourse/MyCourse.less

@@ -14,14 +14,15 @@
     flex-direction: row;
 
     .course-list {
-        width: 400px;
+        width: 100%;
         height: 100%;
-        border-right: 1px solid @borderColor;
+        // border-right: 1px solid @borderColor;
         padding-left: 10px;
     }
 
     .course-info-wrap {
-        width: ~"calc(100% - 400px)";
+        // width: ~"calc(100% - 400px)";
+        width: 100%;
         height: 100%;
         padding-left: 15px;
         display: flex;
@@ -56,6 +57,7 @@
     cursor: pointer;
     color:white;
     font-size:18px;
+    margin-top: 12px;
 }
 .course-list {
     /*width: 100%;*/

+ 187 - 192
TEAMModelOS/ClientApp/src/view/newcourse/MyCourse.vue

@@ -1,207 +1,200 @@
 <template>
-    <div class="my-course-container">
+    <div class="my-course-container dark-iview-split">
         <Loading v-if="listLoading" bgColor="rgba(103, 103, 103, 0.27)"></Loading>
-        <!--课程列表-->
-        <div class="course-list">
-            <!--列表内容-->
-            <vuescroll>
-                <div class="dark-iview-tabs-line cus-list-tab">
-                    <Tabs v-model="listType" @on-click="tabClick">
-                        <div slot="extra">
-                            <transition name="fade">
-                                <div style="margin-top:5px;">
-                                    <Icon type="md-create" v-show="(listType == 'school' && courseListS.length) || (listType == 'private' && courseListP.length) " class="add-icon" :title="$t('cusMgt.editCus')" @click="editCus()" />
-                                    <Icon type="md-add" v-show="listType == 'private'" class="add-icon" :title="$t('cusMgt.addCus')" @click="showAddCourse()" />
-                                    <Icon type="md-trash" v-show="listType == 'private'" class="add-icon" :title="$t('cusMgt.delCus')" @click="delCourse" />
+        <Split v-model="split1">
+            <!--课程列表-->
+            <div class="course-list" slot="left">
+                <!--列表内容-->
+                <vuescroll>
+                    <div class="dark-iview-tabs-line cus-list-tab">
+                        <Tabs v-model="listType" @on-click="tabClick">
+                            <div slot="extra">
+                                <transition name="fade">
+                                    <div style="margin-top:5px;">
+                                        <Icon type="md-create" v-show="(listType == 'school' && courseListS.length) || (listType == 'private' && courseListP.length) " class="add-icon" :title="$t('cusMgt.editCus')" @click="editCus()" />
+                                        <Icon type="md-add" v-show="listType == 'private'" class="add-icon" :title="$t('cusMgt.addCus')" @click="showAddCourse()" />
+                                        <Icon type="md-trash" v-show="listType == 'private'" class="add-icon" :title="$t('cusMgt.delCus')" @click="delCourse" />
+                                    </div>
+                                </transition>
+                            </div>
+                            <TabPane :label="$t('cusMgt.scCus')" name="school">
+                                <div v-for="(item,index) in courseListS" :key="index" @click="selectCourse(index)" :class="index === curCusIndex ? 'course-list-item block-bg block-bg-active':'course-list-item block-bg'">
+                                    <p class="course-name">
+                                        {{item[0].courseName}}
+                                        <Icon type="ios-information-circle-outline" @click="toggleCusInfo" :title="$t('cusMgt.cusInfo')" />
+                                    </p>
+                                    <p class="course-code">
+                                        <Icon type="md-pricetags" />
+                                        {{item[0].courseId}}
+                                    </p>
+                                </div>
+                                <div v-if="courseListS.length == 0">
+                                    <EmptyData :top="150" :textContent="$t('cusMgt.noScCus')"></EmptyData>
+                                </div>
+                            </TabPane>
+                            <TabPane :label="$t('cusMgt.privCus')" name="private">
+                                <div v-for="(item,index) in courseListP" :key="index" @click="selectCourse(index)" :class="index === curCusIndex ? 'course-list-item block-bg block-bg-active':'course-list-item block-bg'">
+                                    <p class="course-name">
+                                        {{item.name}}
+                                        <Icon type="ios-information-circle-outline" @click="toggleCusInfo" :title="$t('cusMgt.cusInfo')" />
+                                    </p>
+                                    <p class="course-code">
+                                        <Icon type="md-pricetags" />
+                                        {{item.id}}
+                                    </p>
                                 </div>
-                            </transition>
+                                <div v-if="courseListP.length == 0">
+                                    <EmptyData :top="150" :textContent="$t('cusMgt.noPrivCus')"></EmptyData>
+                                </div>
+                            </TabPane>
+                        </Tabs>
+                    </div>
+                </vuescroll>
+            </div>
+            <div class="course-info-wrap" slot="right">
+                <Split v-model="split2">
+                    <!--课程班级列表-->
+                    <div class="course-classroom-list" slot="left">
+                        <div class="course-classroom-list-header">
+                            <span class="course-classroom-label">{{$t('courseManage.classroom.classroomList')}}</span>
+                            <Icon custom="iconfont icon-schedule" v-show="listType == 'school'" class="add-icon" size="16" title="课表模式"/>
+                            <Icon type="md-add" v-show="listType == 'private'" class="add-icon" @click="addClassroom()" />
+                            <Icon type="md-create" v-show="listType == 'private'" class="add-icon" @click="editClassStatus = true" />
+                            <Icon type="md-trash" v-show="listType == 'private'" class="add-icon" @click="deleteClass()" />
                         </div>
-                        <TabPane :label="$t('cusMgt.scCus')" name="school">
-                            <div v-for="(item,index) in courseListS" :key="index" @click="selectCourse(index)" :class="index === curCusIndex ? 'course-list-item block-bg block-bg-active':'course-list-item block-bg'">
-                                <p class="course-name">
-                                    {{item[0].courseName}}
-                                    <Icon type="ios-information-circle-outline" @click="toggleCusInfo" :title="$t('cusMgt.cusInfo')" />
-                                </p>
-                                <p class="course-code">
-                                    <Icon type="md-pricetags" />
-                                    {{item[0].courseId}}
-                                </p>
-                            </div>
-                            <div v-if="courseListS.length == 0">
-                                <EmptyData :top="150" :textContent="$t('cusMgt.noScCus')"></EmptyData>
-                            </div>
-                        </TabPane>
-                        <TabPane :label="$t('cusMgt.privCus')" name="private">
-                            <div v-for="(item,index) in courseListP" :key="index" @click="selectCourse(index)" :class="index === curCusIndex ? 'course-list-item block-bg block-bg-active':'course-list-item block-bg'">
-                                <p class="course-name">
-                                    {{item.name}}
-                                    <Icon type="ios-information-circle-outline" @click="toggleCusInfo" :title="$t('cusMgt.cusInfo')" />
-                                </p>
-                                <p class="course-code">
-                                    <Icon type="md-pricetags" />
-                                    {{item.id}}
+                        <div class="course-classroom-list-content">
+                            <div v-for="(item,index) in classList" :key="index" @click="changeClassroom(index)" :class="curClassIndex === index ? 'course-classroom-item block-bg block-bg-active':'course-classroom-item block-bg'">
+                                <p class="classroom-code">
+                                    <span :class="listType === 'private' ? 'class-type-dym': item.openType == 1 ? 'class-type-sys':'class-type-custom'">
+                                        {{getClassType(item.scope,item.openType).text}}
+                                    </span>
+                                    <!--{{item.no}}-->
                                 </p>
+                                <p class="classroom-name">{{item.name}}</p>
+                                <Icon size="20" custom="iconfont icon-qr-code" class="qr-code-icon" @click="showQrCode" v-if="'private' == listType" />
                             </div>
-                            <div v-if="courseListP.length == 0">
-                                <EmptyData :top="150" :textContent="$t('cusMgt.noPrivCus')"></EmptyData>
+                            <div v-if="classList.length == 0">
+                                <EmptyData :top="160" :textContent="$t('cusMgt.noCusClass')"></EmptyData>
                             </div>
-                        </TabPane>
-                    </Tabs>
-                </div>
-            </vuescroll>
-        </div>
-        <div class="course-info-wrap">
-            <!--课程班级列表-->
-            <div class="course-classroom-list">
-                <div class="course-classroom-list-header">
-                    <span class="course-classroom-label">{{$t('courseManage.classroom.classroomList')}}</span>
-                    <Icon type="md-add" class="add-icon" style="margin-top:12px;" @click="addClassroom()" />
-                    <Icon type="md-create" v-show="listType == 'private'" class="add-icon" style="margin-top:12px;" @click="editClassStatus = true" />
-                    <Icon type="md-trash" v-show="listType == 'private'" class="add-icon" style="margin-top:12px;" @click="deleteClass()" />
-                </div>
-                <div class="course-classroom-list-content">
-                    <div v-for="(item,index) in classList" :key="index" @click="changeClassroom(index)" :class="curClassIndex === index ? 'course-classroom-item block-bg block-bg-active':'course-classroom-item block-bg'">
-                        <p class="classroom-code">
-                            <span :class="listType === 'private' ? 'class-type-dym': item.openType == 1 ? 'class-type-sys':'class-type-custom'">
-                                {{getClassType(item.scope,item.openType).text}}
-                            </span>
-                            <!--{{item.no}}-->
-                        </p>
-                        <p class="classroom-name">{{item.name}}</p>
-                        <!-- <p class="classroom-info" style="dispaly:none" v-if="item.openType == 1 || item.scope == 'private'">
-                            <span class="classroom-info-label">{{$t('courseManage.classroom.headmaster')}}</span>
-                            <span class="classroom-info-value">{{item.teacher.name}}</span>
-                        </p> -->
-                        <Icon size="20" custom="iconfont icon-qr-code" class="qr-code-icon" @click="showQrCode" v-if="'private' == listType" />
-                    </div>
-                    <div v-if="classList.length == 0">
-                        <EmptyData :top="160" :textContent="$t('cusMgt.noCusClass')"></EmptyData>
+                        </div>
                     </div>
-                </div>
-            </div>
-            <div class="course-classroom-info" id="table-height">
-                <div class="course-classroom-info-header" style="padding-right:30px;">
-                    <span @click="tabName = 'record'" :class="tabName == 'record' ? 'course-classroom-label line-bottom line-bottom-active':'course-classroom-label line-bottom'">课堂记录</span>
-                    <span @click="getActivityList()" :class="tabName == 'activity' ? 'course-classroom-label line-bottom line-bottom-active':'course-classroom-label line-bottom'">活动记录</span>
-                    <span @click="tabName = 'stus'" :class="tabName == 'stus' ? 'course-classroom-label line-bottom line-bottom-active':'course-classroom-label line-bottom'">{{$t('courseManage.classroom.studentList')}}</span>
+                    <div class="course-classroom-info" id="table-height" slot="right">
+                        <div class="course-classroom-info-header" style="padding-right:30px;">
+                            <span @click="tabName = 'record'" :class="tabName == 'record' ? 'course-classroom-label line-bottom line-bottom-active':'course-classroom-label line-bottom'">课堂记录</span>
+                            <span @click="getActivityList()" :class="tabName == 'activity' ? 'course-classroom-label line-bottom line-bottom-active':'course-classroom-label line-bottom'">活动记录</span>
+                            <span @click="tabName = 'stus'" :class="tabName == 'stus' ? 'course-classroom-label line-bottom line-bottom-active':'course-classroom-label line-bottom'">{{$t('courseManage.classroom.studentList')}}</span>
 
-                    <div style="float:right;color:white;" v-if="(listType == 'private' && tabName == 'stus') || (listType == 'school' && tabName == 'stus' && classList[curClassIndex].openType == 2)">
-                        <span class="action-btn-wrap" @click="delStudents">
-                            <Icon type="md-trash" size="16" />
-                            {{$t('cusMgt.delStu')}}
-                        </span>
-                        <span class="action-btn-wrap" @click="addStuStatus = true" v-if="classList[curClassIndex] && (classList[curClassIndex].openType == 2 || listType == 'private')">
-                            <Icon type="md-add" size="16" />
-                            {{$t('cusMgt.addStu')}}
-                        </span>
-                        <!--<span class="disable-text-icon action-btn-wrap">
-                            <Icon type="md-shuffle" size="16" />
-                            自动分组
-                        </span>
-                        <span class="disable-text-icon action-btn-wrap">
-                            <Icon :type="viewType ? 'md-card':'md-list'" size="16" />
-                            分组视图
-                        </span>-->
-                    </div>
-                    <div style="float:right;color:white;" v-if="tabName == 'activity'" class="dark-iview-select">
-                        <span class="action-btn-wrap" @click="delStudents">
-                            活动类型:
-                        </span>
-                        <Select v-model="curAcType" style="width:160px" size="small">
-                            <Option v-for="(item,index) in acTypeList" :disabled="index > 2" :value="item.value" :key="item.value">{{ item.label }}</Option>
-                        </Select>
-                    </div>
-                </div>
-                <!-- 学生名单 -->
-                <div class="course-classroom-info-content dark-iview-table animated fadeIn" v-show="tabName == 'stus'">
-                    <vuescroll style="height:100%;">
-                        <Table :columns="studentColumn" :data="students" @on-selection-change="(selections)=>{delSelection = selections}" :height="tableHeight" class="system-classroom-table" :loading="stuLoading" no-data-text="暂无学生">
-                            <Loading slot="loading" bgColor="rgba(103, 103, 103, 0.27)"></Loading>
-                            <template slot-scope="{ row ,index}" slot="action">
-                                <strong></strong>
-                            </template>
-                            <template slot-scope="{ row, index }" slot="groupId">
-                                <span>{{(row.groupId && listType == 'school') ? row.groupId : '- -'}}</span>
-                            </template>
-                            <template slot-scope="{ row, index }" slot="groupName">
-                                <span>{{(row.groupName && listType == 'school') ? row.groupName : $t('cusMgt.noGroup')}}</span>
-                            </template>
-                        </Table>
-                    </vuescroll>
-                </div>
-                <!-- 课堂记录 -->
-                <div v-show="tabName == 'record'" class="animated fadeIn class-record-wrap">
-                    <vuescroll>
-                        <List>
-                            <ListItem v-for="(item,index) in itemNum" :key="index" style="border-color:#505050;">
-                                <ListItemMeta @click.native="toClassRecoerd">
-                                    <p slot="title" class="record-name">力的组成</p>
-                                    <span slot="avatar" style="margin-top:4px;display: inline-block;margin-left:10px;">
-                                        <Icon custom="iconfont icon-whiteboard" size="30" color="white" />
-                                    </span>
-                                    <div slot="description" style="color:white;">
-                                        <span class="hiteacher-version">
-                                            系统版本:3.0.32
-                                        </span>
-                                        <Time class="record-time" :time="((new Date()).getTime() - 60 * 3 * 1000)" />
-                                        <div class="record-action-wrap">
-                                            <Icon class="action-icon" type="md-analytics" title="课程记录" @click="toClassRecoerd" />
-                                            <Icon class="action-icon" type="ios-stats" title="苏格拉底报告" @click="toClassRecoerd" />
-                                            <Icon class="action-icon" custom="iconfont icon-video" title="苏格拉底影片/桌面" @click="toClassRecoerd" />
-                                            <Icon class="action-icon" custom="iconfont icon-hi" title="电子笔记" @click="toClassRecoerd" />
-                                            <Icon class="action-icon" custom="iconfont icon-textbook" title="课例教材" @click="toClassRecoerd" />
-                                            <Icon class="action-icon" type="md-share" title="分享到频道" @click="toClassRecoerd" />
-                                        </div>
-                                    </div>
-                                </ListItemMeta>
-                            </ListItem>
-                        </List>
-                        <p style="width:100%;text-align:center;color:#808080;margin-top:20px;">暂未对接HiTeach上传数据</p>
-                    </vuescroll>
-                </div>
-                <!-- 活动记录 -->
-                <div v-show="tabName == 'activity'" class="animated fadeIn class-record-wrap">
-                    <vuescroll>
-                        <List>
-                            <ListItem v-for="(item,index) in evList" :key="index" style="border-color:#505050;cursor: pointer;">
-                                <ListItemMeta @click.native="toEvDetail(index)">
-                                    <p slot="title" class="record-name">
-                                        {{item.name}}
-                                        <span class="evaluation-status-tag" :style="{ borderColor: item.progress == 'pending' ? '#0BADD4' : item.progress == 'going' ? '#1CC0F3' : '#ed4014', color: (item.progress == 'pending' ? '#0BADD4' : item.progress == 'going' ? '#1CC0F3' : '#ed4014')}">
-                                            {{ item.progress == 'pending' ? $t('learnActivity.mgtScEv.pending') : item.progress == 'going' ? $t('learnActivity.mgtScEv.going') : $t('learnActivity.mgtScEv.finish') }}
-                                        </span>
-                                    </p>
-                                    <span slot="avatar" style="margin-top:12px;display: inline-block;margin-left:10px;">
-                                        <Icon custom="iconfont icon-test" size="30" color="white" />
-                                    </span>
-                                    <div slot="description">
-                                        <span class="ev-attr-wrap">
-                                            <span class="attr-label">
-                                                <Icon type="md-time" size="16" />
-                                                {{$t('learnActivity.mgtScEv.createTime')}}
-                                            </span>
-                                            <span class="attr-value">
-                                                {{dateFormat(item.startTime)}}
-                                            </span>
-                                        </span>
-                                        <span class="ev-attr-wrap">
-                                            <span class="attr-label">
-                                                <Icon type="ios-cube" size="14" />
-                                                {{$t('learnActivity.mgtScEv.evType')}}
+                            <div style="float:right;color:white;" v-if="(listType == 'private' && tabName == 'stus') || (listType == 'school' && tabName == 'stus' && classList[curClassIndex].openType == 2)">
+                                <span class="action-btn-wrap" @click="delStudents">
+                                    <Icon type="md-trash" size="16" />
+                                    {{$t('cusMgt.delStu')}}
+                                </span>
+                                <span class="action-btn-wrap" @click="addStuStatus = true" v-if="classList[curClassIndex] && (classList[curClassIndex].openType == 2 || listType == 'private')">
+                                    <Icon type="md-add" size="16" />
+                                    {{$t('cusMgt.addStu')}}
+                                </span>
+                            </div>
+                            <div style="float:right;color:white;" v-if="tabName == 'activity'" class="dark-iview-select">
+                                <span class="action-btn-wrap" @click="delStudents">
+                                    活动类型:
+                                </span>
+                                <Select v-model="curAcType" style="width:160px" size="small">
+                                    <Option v-for="(item,index) in acTypeList" :disabled="index > 2" :value="item.value" :key="item.value">{{ item.label }}</Option>
+                                </Select>
+                            </div>
+                        </div>
+                        <!-- 学生名单 -->
+                        <div class="course-classroom-info-content dark-iview-table animated fadeIn" v-show="tabName == 'stus'">
+                            <vuescroll style="height:100%;">
+                                <Table :columns="studentColumn" :data="students" @on-selection-change="(selections)=>{delSelection = selections}" :height="tableHeight" class="system-classroom-table" :loading="stuLoading" no-data-text="暂无学生">
+                                    <Loading slot="loading" bgColor="rgba(103, 103, 103, 0.27)"></Loading>
+                                    <template slot-scope="{ row ,index}" slot="action">
+                                        <strong></strong>
+                                    </template>
+                                    <template slot-scope="{ row, index }" slot="groupId">
+                                        <span>{{(row.groupId && listType == 'school') ? row.groupId : '- -'}}</span>
+                                    </template>
+                                    <template slot-scope="{ row, index }" slot="groupName">
+                                        <span>{{(row.groupName && listType == 'school') ? row.groupName : $t('cusMgt.noGroup')}}</span>
+                                    </template>
+                                </Table>
+                            </vuescroll>
+                        </div>
+                        <!-- 课堂记录 -->
+                        <div v-show="tabName == 'record'" class="animated fadeIn class-record-wrap">
+                            <vuescroll>
+                                <List>
+                                    <ListItem v-for="(item,index) in itemNum" :key="index" style="border-color:#505050;">
+                                        <ListItemMeta @click.native="toClassRecoerd">
+                                            <p slot="title" class="record-name">力的组成</p>
+                                            <span slot="avatar" style="margin-top:4px;display: inline-block;margin-left:10px;">
+                                                <Icon custom="iconfont icon-whiteboard" size="30" color="white" />
                                             </span>
-                                            <span class="attr-value">
-                                                {{getTypeLabel(item.type)}}
+                                            <div slot="description" style="color:white;">
+                                                <span class="hiteacher-version">
+                                                    系统版本:3.0.32
+                                                </span>
+                                                <Time class="record-time" :time="((new Date()).getTime() - 60 * 3 * 1000)" />
+                                                <div class="record-action-wrap">
+                                                    <Icon class="action-icon" type="md-analytics" title="课程记录" @click="toClassRecoerd" />
+                                                    <Icon class="action-icon" type="ios-stats" title="苏格拉底报告" @click="toClassRecoerd" />
+                                                    <Icon class="action-icon" custom="iconfont icon-video" title="苏格拉底影片/桌面" @click="toClassRecoerd" />
+                                                    <Icon class="action-icon" custom="iconfont icon-hi" title="电子笔记" @click="toClassRecoerd" />
+                                                    <Icon class="action-icon" custom="iconfont icon-textbook" title="课例教材" @click="toClassRecoerd" />
+                                                    <Icon class="action-icon" type="md-share" title="分享到频道" @click="toClassRecoerd" />
+                                                </div>
+                                            </div>
+                                        </ListItemMeta>
+                                    </ListItem>
+                                </List>
+                                <p style="width:100%;text-align:center;color:#808080;margin-top:20px;">暂未对接HiTeach上传数据</p>
+                            </vuescroll>
+                        </div>
+                        <!-- 活动记录 -->
+                        <div v-show="tabName == 'activity'" class="animated fadeIn class-record-wrap">
+                            <vuescroll>
+                                <List>
+                                    <ListItem v-for="(item,index) in evList" :key="index" style="border-color:#505050;cursor: pointer;">
+                                        <ListItemMeta @click.native="toEvDetail(index)">
+                                            <p slot="title" class="record-name">
+                                                {{item.name}}
+                                                <span class="evaluation-status-tag" :style="{ borderColor: item.progress == 'pending' ? '#0BADD4' : item.progress == 'going' ? '#1CC0F3' : '#ed4014', color: (item.progress == 'pending' ? '#0BADD4' : item.progress == 'going' ? '#1CC0F3' : '#ed4014')}">
+                                                    {{ item.progress == 'pending' ? $t('learnActivity.mgtScEv.pending') : item.progress == 'going' ? $t('learnActivity.mgtScEv.going') : $t('learnActivity.mgtScEv.finish') }}
+                                                </span>
+                                            </p>
+                                            <span slot="avatar" style="margin-top:12px;display: inline-block;margin-left:10px;">
+                                                <Icon custom="iconfont icon-test" size="30" color="white" />
                                             </span>
-                                        </span>
-                                    </div>
-                                </ListItemMeta>
-                            </ListItem>
-                        </List>
-                        <!-- <p style="width:100%;text-align:center;color:#808080;margin-top:20px;">暂未对接活动列表数据</p> -->
-                    </vuescroll>
-                </div>
+                                            <div slot="description">
+                                                <span class="ev-attr-wrap">
+                                                    <span class="attr-label">
+                                                        <Icon type="md-time" size="16" />
+                                                        {{$t('learnActivity.mgtScEv.createTime')}}
+                                                    </span>
+                                                    <span class="attr-value">
+                                                        {{dateFormat(item.startTime)}}
+                                                    </span>
+                                                </span>
+                                                <span class="ev-attr-wrap">
+                                                    <span class="attr-label">
+                                                        <Icon type="ios-cube" size="14" />
+                                                        {{$t('learnActivity.mgtScEv.evType')}}
+                                                    </span>
+                                                    <span class="attr-value">
+                                                        {{getTypeLabel(item.type)}}
+                                                    </span>
+                                                </span>
+                                            </div>
+                                        </ListItemMeta>
+                                    </ListItem>
+                                </List>
+                                <!-- <p style="width:100%;text-align:center;color:#808080;margin-top:20px;">暂未对接活动列表数据</p> -->
+                            </vuescroll>
+                        </div>
+                    </div>
+                </Split>
             </div>
-        </div>
+        </Split>
         <Drawer :title="$t('cusMgt.cusInfo')" class-name="dark-iview-drawer" width="450" :closable="false" v-model="showCusInfo" @on-close="baseEditStatus = true">
             <!--基础信息-->
             <div class="course-base-info-content dark-iview-form disabled-iview-select dark-wang-editor">
@@ -294,6 +287,8 @@ export default {
             }
         }
         return {
+            split1: 0.2,
+            split2: 0.2,
             acTypeList: [
                 {
                     label: '评测',

+ 14 - 0
TEAMModelOS/ClientApp/src/view/newcourse/NewCusMgt.less

@@ -247,4 +247,18 @@
     font-size: 18px;
     cursor: pointer;
     vertical-align: middle;
+}
+.add-tea-header{
+    height: 40px;
+    line-height: 40px;
+    color: white;
+    padding-left: 15px;
+    position: sticky;
+    top: 0px;
+    background: #303030;
+    z-index: 9999;
+    .add-list-label{
+        color: #a5a5a5;
+        margin-right: 5px;
+    }
 }

+ 194 - 182
TEAMModelOS/ClientApp/src/view/newcourse/NewCusMgt.vue

@@ -43,7 +43,7 @@
                 </div>
                 <div class="cus-list-content">
                     <vuescroll>
-                        <div v-for="(item,index) in courseListShow" :key="index" @click="curCusIndex = index" :class="['block-bg','cus-item',curCusIndex == index ? 'block-bg-active':'']">
+                        <div v-for="(item,index) in courseListShow" :key="index" @click="selectCus(index)" :class="['block-bg','cus-item',curCusIndex == index ? 'block-bg-active':'']">
                             <p class="cus-name">
                                 <span class="cus-id">
                                     {{item.no}}
@@ -61,67 +61,13 @@
                 </div>
             </div>
             <div slot="right" class="cus-schd-box">
-                <!-- 添加名单UI -->
-                <div slot="right" class="class-setting dark-el-cascader dark-iview-select dark-iview-table" v-show="isAddStuList">
-                    <div class="add-list-header">
-                        <span class="add-list-label">教师:</span>
-                        <Select ref="sltStuList" clearable label-in-value v-model="schedule.teacher.id" style="width:200px;margin-right:30px" size="small" @on-change="setTeaName">
-                            <Option v-for="(item,index) in $store.state.teachers.teacherList" :value="item.id" :key="index">{{ item.name }}</Option>
-                        </Select>
-                        <span class="add-list-label">教室:</span>
-                        <el-cascader size="small" placeholder="请设置上课教室" :show-all-levels="false" clearable v-model="schedule.classId" :options="csOptions" :props="props" @change="setClassName($event,'insert')" style="width:180px;">
-                        </el-cascader>
-                        <span v-show="schedule.classId" class="attr-label" style="margin-left:20px">默认名单</span>
-                        <Tooltip v-show="schedule.classId" content="默认名单为教室对应的名单,否则需要指定自定义名单。" max-width="200">
-                            <Icon type="ios-information-circle-outline" style="margin-left:2px;margin-right:5px" />
-                        </Tooltip>
-                        <span v-show="schedule.classId">
-                            <i-switch v-model="preDefault" size="small" />
-                        </span>
-                        <span class="add-list-label" v-show="!preDefault || !schedule.classId" style="margin-left:40px">名单:</span>
-                        <Select ref="sltStuList" v-show="!preDefault || !schedule.classId" clearable v-model="schedule.stulist" style="width:200px;margin-right:5px" size="small">
-                            <Option v-for="(item,index) in stuList" :value="item.id" :key="index" @click.native="getStuList(item.name)">{{ item.name }}</Option>
-                        </Select>
-                        <Icon type="md-add-circle" v-show="!preDefault || !schedule.classId" class="create-list-icon" @click="goMgtStuList" />
-                        <div class="action-btn-wrap">
-                            <span class="action-btn" style="margin-right:40px" @click="confirmAddSchd">
-                                <Icon type="md-add" size="16" />
-                                <span>确认添加</span>
-                            </span>
-                            <span class="action-btn" @click="cancelAddSchd">
-                                <Icon type="md-close" size="16" />
-                                <span>取消添加</span>
-                            </span>
-                        </div>
-                    </div>
-                    <Table :columns="schedule.stulist ? listColumn : classColumn" :data="preStus" class="stu-list-table" :loading="stuLoading" no-data-text="暂无学生">
-                        <Loading slot="loading" :top="0" bgColor="rgba(103, 103, 103, 0.27)"></Loading>
-                        <template slot-scope="{ row }" slot="picture">
-                            <PersonalPhoto :name="row.name" :picture="row.picture" />
-                        </template>
-                        <template slot-scope="{ row,index }" slot="no">
-                            <span>{{row.no}}</span>
-                        </template>
-                        <template slot-scope="{ row ,index}" slot="action">
-                            <div class="item-tools" v-if="$access.can('admin.*|student-upd')">
-                                <Icon type="md-create" size="18" color="white" @click="resetNo(index)" :title="$t('schoolBaseInfo.editSeat')" />
-                                <Icon type="md-remove-circle" size="18" color="white" style="margin-left:10px" @click="removeStudent(index)" :title="$t('schoolBaseInfo.delStuBtn')" />
-                            </div>
-                        </template>
-                        <template slot-scope="{ row, index }" slot="groupId">
-                            <span>{{row.groupId ? row.groupId : '- -'}}</span>
-                        </template>
-                        <template slot-scope="{ row, index }" slot="groupName">
-                            <span>{{row.groupName ? row.groupName : '未分组'}}</span>
-                        </template>
-                    </Table>
-                </div>
-                <Split v-model="split2" v-show="!isAddStuList">
+
+                <Split v-model="split2">
                     <!-- 授课教师列表 -->
                     <div slot="left" class="teacher-list">
                         <div class="teacher-list-header">
                             <span>教师</span>
-                            <Icon type="md-add" size="16" class="tea-action-icon" @click="isAddStuList = true" />
+                            <Icon type="md-add" size="16" class="tea-action-icon" @click="addTeaStatus = true" />
                             <Icon type="md-trash" size="16" class="tea-action-icon" @click="removeTeacher" />
                         </div>
                         <div class="tea-list-content">
@@ -138,7 +84,7 @@
                         </div>
                     </div>
                     <!-- 上课名单、上课时段设置 -->
-                    <div slot="right" class="class-setting">
+                    <div slot="right" class="class-setting" v-show="!isAddStuList && !addTeaStatus">
                         <div class="teacher-list-header">
                             <span @click="curTab = 0" :class="curTab == 0 ? 'tab-label line-bottom line-bottom-active':'tab-label line-bottom'">
                                 课程名单
@@ -159,10 +105,10 @@
                                     <Icon type="md-trash" size="16" />
                                     <span>移除名单</span>
                                 </span>
-                                <span v-show="curTab == 1">授课教室:</span>
+                                <!-- <span v-show="curTab == 1">授课教室:</span>
                                 <Select v-show="curTab == 1" v-model="setCurClass" style="width:200px;margin-right:30px" size="small">
                                     <Option v-for="(item,index) in schdClassList" :value="item.classId" :key="index">{{ item.classInfo.name }}</Option>
-                                </Select>
+                                </Select> -->
                             </div>
                         </div>
                         <!-- 教师上课时段设置 -->
@@ -228,11 +174,11 @@
                                         </Table>
                                     </div>
                                 </Split>
-                                <EmptyData v-show="schdList.length == 0" textContent="暂无课程名单,请先前往添加名单"></EmptyData>
+                                <EmptyData v-show="schdList.length == 0" textContent="暂无课程名单,请添加名单"></EmptyData>
                             </div>
                             <!-- 教师课表 -->
                             <vuescroll v-show="curTab == 1">
-                                <TeaTable v-if="hasTimeTable" :teacher="teaList[curTeaIndex] ? teaList[curTeaIndex].id : ''" :periodId="filterPeriod" :schedData="[courseListShow[this.curCusIndex]]" @selectCell="selectCell" @cancelCell="cancelCell"></TeaTable>
+                                <TeaTable v-if="hasTimeTable" :teaClassList="schdClassList" :teacher="teaList[curTeaIndex] ? teaList[curTeaIndex].id : ''" :periodId="filterPeriod" :schedData="[courseListShow[this.curCusIndex]]" @selectCell="selectCell" @cancelCell="cancelCell"></TeaTable>
                                 <div v-else>
                                     <p class="no-time-table-tips">
                                         {{filterPeriodName}}暂未设置时段,请先
@@ -243,7 +189,87 @@
                             </vuescroll>
                         </div>
                     </div>
-
+                    <!-- 添加名单UI -->
+                    <div slot="right" class="class-setting dark-el-cascader dark-iview-select dark-iview-table" v-show="isAddStuList">
+                        <div class="add-list-header">
+                            <!-- <span class="add-list-label">教师:</span>
+                            <Select ref="sltStuList" clearable label-in-value v-model="schedule.teacher.id" style="width:200px;margin-right:30px" size="small" @on-change="setTeaName">
+                                <Option v-for="(item,index) in $store.state.teachers.teacherList" :value="item.id" :key="index">{{ item.name }}</Option>
+                            </Select> -->
+                            <span class="add-list-label">教室:</span>
+                            <el-cascader size="small" placeholder="请设置上课教室" :show-all-levels="false" clearable v-model="schedule.classId" :options="csOptions" :props="props" @change="setClassName($event,'insert')" style="width:180px;">
+                            </el-cascader>
+                            <span v-show="schedule.classId" class="attr-label" style="margin-left:20px">默认名单</span>
+                            <Tooltip v-show="schedule.classId" content="默认名单为教室对应的名单,否则需要指定自定义名单。" max-width="200">
+                                <Icon type="ios-information-circle-outline" style="margin-left:2px;margin-right:5px" />
+                            </Tooltip>
+                            <span v-show="schedule.classId">
+                                <i-switch v-model="preDefault" size="small" />
+                            </span>
+                            <span class="add-list-label" v-show="!preDefault || !schedule.classId" style="margin-left:40px">名单:</span>
+                            <Select ref="sltStuList" v-show="!preDefault || !schedule.classId" clearable v-model="schedule.stulist" style="width:200px;margin-right:5px" size="small">
+                                <Option v-for="(item,index) in stuList" :value="item.id" :key="index" @click.native="getStuList(item.name)">{{ item.name }}</Option>
+                            </Select>
+                            <Icon type="md-add-circle" v-show="!preDefault || !schedule.classId" class="create-list-icon" @click="goMgtStuList" />
+                            <div class="action-btn-wrap">
+                                <span class="action-btn" style="margin-right:40px" @click="confirmAddSchd">
+                                    <Icon type="md-add" size="16" />
+                                    <span>确认添加</span>
+                                </span>
+                                <span class="action-btn" @click="cancelAddSchd">
+                                    <Icon type="md-close" size="16" />
+                                    <span>取消添加</span>
+                                </span>
+                            </div>
+                        </div>
+                        <Table :columns="schedule.stulist ? listColumn : classColumn" :data="preStus" class="stu-list-table" :loading="stuLoading" no-data-text="暂无学生">
+                            <Loading slot="loading" :top="0" bgColor="rgba(103, 103, 103, 0.27)"></Loading>
+                            <template slot-scope="{ row }" slot="picture">
+                                <PersonalPhoto :name="row.name" :picture="row.picture" />
+                            </template>
+                            <template slot-scope="{ row,index }" slot="no">
+                                <span>{{row.no}}</span>
+                            </template>
+                            <template slot-scope="{ row ,index}" slot="action">
+                                <div class="item-tools" v-if="$access.can('admin.*|student-upd')">
+                                    <Icon type="md-create" size="18" color="white" @click="resetNo(index)" :title="$t('schoolBaseInfo.editSeat')" />
+                                    <Icon type="md-remove-circle" size="18" color="white" style="margin-left:10px" @click="removeStudent(index)" :title="$t('schoolBaseInfo.delStuBtn')" />
+                                </div>
+                            </template>
+                            <template slot-scope="{ row, index }" slot="groupId">
+                                <span>{{row.groupId ? row.groupId : '- -'}}</span>
+                            </template>
+                            <template slot-scope="{ row, index }" slot="groupName">
+                                <span>{{row.groupName ? row.groupName : '未分组'}}</span>
+                            </template>
+                        </Table>
+                    </div>
+                    <!-- 添加授课教师UI -->
+                    <div slot="right" class="class-setting dark-iview-input dark-iview-table" v-show="addTeaStatus">
+                        <vuescroll>
+                            <div class="add-tea-header">
+                                <Input search placeholder="" style="width:240px;margin-top:4px" size="small" />
+                                <div class="action-btn-wrap">
+                                    <span class="action-btn" style="margin-right:40px" @click="confirmAddTea">
+                                        <Icon type="md-add" size="16" />
+                                        <span>确认添加</span>
+                                    </span>
+                                    <span class="action-btn" @click="cancelAddTea">
+                                        <Icon type="md-close" size="16" />
+                                        <span>取消添加</span>
+                                    </span>
+                                </div>
+                            </div>
+                            <Table :columns="teaCol" :data="teacherList" style="margin-top:10px" @on-selection-change="(selection)=>{sltTeachers = selection}">
+                                <template slot-scope="{ row }" slot="picture">
+                                    <PersonalPhoto :name="row.name" :picture="row.picture" />
+                                </template>
+                                <template slot-scope="{ row }" slot="job">
+                                    <span>{{row.job || '--'}}</span>
+                                </template>
+                            </Table>
+                        </vuescroll>
+                    </div>
                 </Split>
             </div>
         </Split>
@@ -270,11 +296,6 @@
                         </Option>
                     </Select>
                 </FormItem>
-                <!-- <FormItem :label="$t('cusMgt.cusTeachers')" prop="teachers">
-                    <Select label-in-value multiple v-model="teacherId" :placeholder="$t('cusMgt.teacherHolder')" :max-tag-count="3" filterable @on-change="getTeahcers">
-                        <Option v-for="(item,index) in $store.state.teachers.teacherList" :value="item.id" :key="index">{{ item.name }}</Option>
-                    </Select>
-                </FormItem> -->
             </Form>
         </Modal>
         <!-- 添加授课教师 -->
@@ -284,9 +305,9 @@
             </Select>
         </Modal> -->
         <!-- 创建名单 -->
-        <Modal v-model="addStuStatus" :title="$t('cusMgt.addStu')" width="1200" @on-ok="confirmAddStu" class-name="dark-iview-modal">
+        <!-- <Modal v-model="addStuStatus" :title="$t('cusMgt.addStu')" width="1200" @on-ok="confirmAddStu" class-name="dark-iview-modal">
             <StudentList @getSelectInfo="(selction)=>{selections = selction}"></StudentList>
-        </Modal>
+        </Modal> -->
         <!-- 时段设置 -->
         <Drawer title="时段设置" class-name="dark-iview-drawer" :closable="false" v-model="showTime" :width="450">
             <TimeSetting :periodId="filterPeriod"></TimeSetting>
@@ -332,6 +353,36 @@ export default {
             preStus: [],
             stuList: [],
             isDefault: true,
+            teacherList: [],
+            sltTeachers: [],
+            teaCol: [
+                {
+                    type: 'selection',
+                    width: 60,
+                    align: 'center'
+                },
+                {
+                    title: ' ',
+                    slot: 'picture',
+                    align: 'center ',
+                    width: '120'
+                },
+                {
+                    title: '姓名',
+                    key: 'name',
+                    align: 'center '
+                },
+                {
+                    title: 'id',
+                    key: 'id',
+                    align: 'center '
+                },
+                {
+                    title: '职位',
+                    slot: 'job',
+                    align: 'center '
+                }
+            ],
             classColumn: [
                 {
                     title: ' ',
@@ -392,7 +443,6 @@ export default {
                     align: 'center'
                 },
             ],
-            addTeachers: [],
             curClassIndex: 0,
             hasTimeTable: false,
             selections: [],
@@ -408,7 +458,6 @@ export default {
             schoolBase: {
                 period: []
             },
-            teacherId: [],
             actionType: 0, //0新增 1编辑
             delCusList: [],
             courseBaseInfo: {
@@ -454,18 +503,19 @@ export default {
                     name: ''
                 },
                 stulist: '',
-                time: [
-                    // {
-                    //     week: "Mon",
-                    //     start: "8:00",
-                    //     end: "8:40"
-                    // }
-                ],
+                time: [],
                 notice: ''
             }
         }
     },
     methods: {
+        selectCus(index) {
+            this.selectClass(0)
+            this.selectTea(0)
+            this.cancelAddTea()
+            this.cancelAddSchd()
+            this.curCusIndex = index
+        },
         selectTab(index) {
             this.curTab = index
             this.setDefClass()
@@ -477,20 +527,23 @@ export default {
                 if (!this.setCurClass && this.schdClassList[0]) {
                     this.setCurClass = this.schdClassList[0].classId
                 }
-            }else{
+            } else {
                 this.setCurClass = ''
             }
         },
         //设置课程时段
         selectCell(data) {
-            console.log('data', data)
             let teacher = this.teaList[this.curTeaIndex] ? this.teaList[this.curTeaIndex].id : ''
-            if (!this.setCurClass || !teacher) {
-                this.$Message.warning("暂无教师或授课教室信息,无法完成课程时段设置")
+            if (!teacher) {
+                this.$Message.warning("暂无教师信息,无法完成课程时段设置")
+                return
+            }
+            if (!data.setClass) {
+                this.$Message.warning("暂无教室信息,无法完成课程时段设置")
                 return
             }
             let schedule = this.courseListShow[this.curCusIndex].schedule.find(item => {
-                return item.classId == this.setCurClass && item.teacher.id == this.teaList[this.curTeaIndex].id
+                return item.classId == data.setClass && item.teacher.id == this.teaList[this.curTeaIndex].id
             })
             if (schedule) {
                 schedule.time.push({
@@ -498,14 +551,12 @@ export default {
                     id: data.row.id
                 })
                 this.isUpd = true
-                console.log('ss', schedule)
             }
         },
         //取消课程时段设置
         cancelCell(data) {
-            console.log('data', data)
             let schedule = this.courseListShow[this.curCusIndex].schedule.find(item => {
-                return item.classId == this.setCurClass && item.teacher.id == this.teaList[this.curTeaIndex].id
+                return item.classId == data.setClass && item.teacher.id == this.teaList[this.curTeaIndex].id
             })
             if (schedule) {
                 for (let index in schedule.time) {
@@ -548,7 +599,7 @@ export default {
                 }
             )
         },
-        //教室列表
+        //选择教室列表
         selectClass(index) {
             this.curClassIndex = index
             this.setIsDefault()
@@ -612,17 +663,16 @@ export default {
                 }
             })
         },
-        //下拉选择授课教师,并设置教师名称
-        setTeaName(data) {
-            console.log(data)
-            if (data) {
-                this.schedule.teacher.name = data.label
-                console.log(this.schedule)
-            }
-        },
+        //下拉选择授课教师,并设置教师名称 (废弃)
+        // setTeaName(data) {
+        //     console.log(data)
+        //     if (data) {
+        //         this.schedule.teacher.name = data.label
+        //         console.log(this.schedule)
+        //     }
+        // },
         //设置教室名称
         setClassName(data, option) {
-            console.log(data, option)
             let curClass = this.classList.find(item => {
                 return item.id == data
             })
@@ -657,8 +707,6 @@ export default {
                 this.isUpd = true
                 if (curClass) this.schdList[this.curClassIndex].classInfo.name = curClass.name
             }
-
-            console.log(this)
         },
         //确认添加名单
         confirmAddSchd() {
@@ -670,8 +718,12 @@ export default {
                 this.$Message.warning('请设置教室或者名单')
                 return
             }
+            this.courseListShow[this.curCusIndex].schedule.forEach((item, index) => {
+                if (item.teacher.id == this.schedule.teacher.id && !item.stulist && !item.classId) {
+                    this.courseListShow[this.curCusIndex].schedule.splice(index, 1)
+                }
+            })
             this.courseListShow[this.curCusIndex].schedule.push(this.schedule)
-            console.log(this.courseListShow[this.curCusIndex])
             this.isAddStuList = false
             this.updCusInfo()
             this.initSchedule()
@@ -698,32 +750,35 @@ export default {
                 notice: ''
             }
         },
-        // // (废弃)
-        // seltChange(data) {
-        //     this.addTeachers = data
-        // },
-        // //确认添加教师 (废弃)
-        // confirmAddTea() {
-        //     let teachers = this.addTeachers.map(item => {
-        //         return {
-        //             id: item.value,
-        //             name: item.label
-        //         }
-        //     })
-        //     let ids = this.courseListShow[this.curCusIndex].teachers.map(item => {
-        //         return item.id
-        //     })
-        //     let isUpd = false
-        //     teachers.forEach(item => {
-        //         if (ids.indexOf(item.id) == -1) {
-        //             this.courseListShow[this.curCusIndex].teachers.push(item)
-        //             isUpd = true
-        //         }
-        //     })
-        //     this.addTeachers = []
-        //     this.$refs['addTea'].clearSingleSelect()
-        //     if (isUpd) this.updCusInfo()
-        // },
+        //取消添加老师
+        cancelAddTea() {
+            this.addTeaStatus = false
+        },
+        //确认添加教师
+        confirmAddTea() {
+            this.addTeaStatus = false
+            if (this.sltTeachers.length > 0) {
+                let ids = this.teaList.map(item => {
+                    return item.id
+                })
+                this.sltTeachers.forEach(item => {
+                    if (ids.indexOf(item.id) == -1) {
+                        this.courseListShow[this.curCusIndex].schedule.push({
+                            classId: '',
+                            teacher: {
+                                id: item.id,
+                                name: item.name
+                            },
+                            stulist: '',
+                            time: [],
+                            notice: ''
+                        })
+                    }
+                })
+                this.updCusInfo()
+                this.sltTeachers = []
+            }
+        },
         // 更新课程数据
         updCusInfo() {
             this.courseListShow[this.curCusIndex].code = this.courseListShow[this.curCusIndex].code.replace('Course-', '')
@@ -735,7 +790,6 @@ export default {
                 res => {
                     this.$Message.success('更新成功')
                     this.isUpd = false
-                    // this.$Modal.remove()
                 }
             ).catch(() => {
                 this.$Message.error('更新失败')
@@ -746,7 +800,6 @@ export default {
             this.$Modal.confirm({
                 title: '移除名单',
                 content: `是否确认移除${this.schdList[this.curClassIndex].className || this.schdList[this.curClassIndex].listName}?`,
-                // loading:true,
                 onOk: () => {
                     for (let i in this.courseListShow[this.curCusIndex].schedule) {
                         let curSchd = this.schdList[this.curClassIndex]
@@ -756,9 +809,7 @@ export default {
                         }
                     }
                     this.updCusInfo()
-                },
-                onCancel: () => {
-                    // this.$Message.info('Clicked cancel')
+                    this.selectClass(0)
                 }
             })
         },
@@ -805,23 +856,6 @@ export default {
             })
             this.getCusInfo()
         },
-        // getTeahcers(val) {
-        //     this.courseBaseInfo.teachers.length = []
-        //     for (let item of val) {
-        //         this.courseBaseInfo.teachers.push({
-        //             id: item.value,
-        //             name: item.label
-        //         })
-        //     }
-        // },
-        //id换名字
-        //获取名字集合
-        getTeacherName(ids) {
-            let names = ids.map(item => {
-                return item.name
-            })
-            return names.join(', ')
-        },
         //关键字搜索课程
         searchCourse() {
             this.courseListShow = this.courseList.filter((item, index) => {
@@ -867,7 +901,6 @@ export default {
                 this.$api.courseMgmt.findCusInfo(requestData).then(
                     (res) => {
                         if (!res.error) {
-                            // [this.curCusIndex] = res.courses[0]
                             if (res.courses && res.courses.length > 0) {
                                 res.courses[0].schedule = res.courses[0].schedule ? res.courses[0].schedule : []
                                 res.courses[0].schedule.forEach(item => {
@@ -899,7 +932,6 @@ export default {
                                     }
 
                                 })
-                                console.log('res', res)
                             }
                             this.$set(this.courseListShow, this.curCusIndex, res.courses[0])
                             this.selectTea(0)
@@ -931,7 +963,6 @@ export default {
                 teachers: [],
                 option: 'insert'
             }
-            this.teacherId.length = 0
         },
         //显示确认删除对话框
         showConfirmDel(index) {
@@ -965,7 +996,6 @@ export default {
                 })
                 let code = this.$store.state.userInfo.schoolCode
                 this.$api.courseMgmt.deleteCourse({
-                    // ids, code
                     id: this.courseListShow[this.curCusIndex].id,
                     code: this.courseListShow[this.curCusIndex].code.replace('Course-', ''),
                     scope: this.courseListShow[this.curCusIndex].scope || 'school',
@@ -982,7 +1012,6 @@ export default {
                                 }
                             }
                             this.keyWord = ''
-                            // this.searchCourse()
                             this.filterByPeriod()
                         } else {
                             this.$Message.error(this.$t('cusMgt.delErr'))
@@ -1009,9 +1038,6 @@ export default {
                 }
             } else {
                 this.courseBaseInfo = this.courseListShow[index]
-                // this.teacherId = this.courseBaseInfo.teachers.map(item => {
-                //     return item.id
-                // })
                 this.addCourseStatus = true
             }
         },
@@ -1037,13 +1063,11 @@ export default {
                                     this.courseList.push(this.courseBaseInfo)
                                     this.$Message.success(this.$t('cusMgt.addOk'))
                                 } else {
-                                    // this.courseListShow[index].teachers = this._.cloneDeep(this.courseBaseInfo.teachers)
                                     this.$Message.success(this.$t('cusMgt.editOk'))
                                 }
                                 this.keyWord = ''
                                 this.searchCourse()
                                 this.filterByPeriod()
-                                this.teacherId = []
                             } else {
                                 this.$Message.error('API ERROR!')
                             }
@@ -1099,7 +1123,6 @@ export default {
                                 stulist.students = res.stus
                                 stulist.full = true
                                 this.students = res.stus
-                                console.log('stuinfo', this.students)
                             }
                         )
                     }
@@ -1133,12 +1156,7 @@ export default {
                 (err) => {
                     this.$Message.error('API error!')
                 }
-            ).finally(() => {
-                setTimeout(() => {
-                    // this.tableLoading = false
-                    console.log(this.courseListShow[this.curCusIndex])
-                }, 500)
-            })
+            )
         }
     },
     created() {
@@ -1157,14 +1175,14 @@ export default {
             }
         )
         this.$store.dispatch('teachers/getTeacherList').then(res => {
+            this.teacherList = this.$store.state.teachers.teacherList.filter(item => {
+                return item.status == 'join'
+            })
         })
         this.getCourseList()
         this.findStuList()
     },
     computed: {
-        // async students() {
-
-        // },
         //级联选择年级班级
         csOptions() {
             let data = []
@@ -1187,7 +1205,6 @@ export default {
                     })
                 }
             }
-            console.log('数据', data)
             return data
         },
         filterPeriodName() {
@@ -1211,7 +1228,9 @@ export default {
                 let schds = this.courseListShow[this.curCusIndex].schedule.filter(item => {
                     return item.teacher.id == this.teaList[this.curTeaIndex].id
                 })
-                return schds
+                return schds.filter(item => {
+                    return (item.classId || item.stulist)
+                })
             } else {
                 return []
             }
@@ -1230,8 +1249,6 @@ export default {
                 })
                 const res = new Map()
                 let removeRep = all.filter((a) => !res.has(a.id) && res.set(a.id, 1))
-
-                console.log(removeRep)
                 return removeRep
             } else {
                 return []
@@ -1241,15 +1258,7 @@ export default {
     watch: {
         curCusIndex() {
             this.getCusInfo()
-        },
-        // schdList:{
-        //     handler(){
-        //         console.log('watch',this.isDefault)
-        //         this.setIsDefault()
-        //         console.log('watch',this.isDefault)
-        //     },
-        //     deep:true
-        // }
+        }
     }
 }
 </script>
@@ -1260,6 +1269,9 @@ export default {
 .class-setting thead {
     background: #505050;
 }
+.class-setting .ivu-input {
+    border-radius: 16px;
+}
 .add-list-header .el-input--small .el-input__inner {
     height: 26px;
     line-height: 26px;

+ 67 - 28
TEAMModelOS/ClientApp/src/view/newcourse/TeaTable.vue

@@ -32,69 +32,79 @@
                     </p>
                 </template>
                 <!--星期一-->
-                <template slot-scope="{ row, index }" slot="MON">
+                <template slot-scope="{ row, column }" slot="MON">
                     <div :class="row.weeklies.MON.status == 1 ? 'week-day-cell':'week-day-cell vact-status'">
                         <div class="toggle-status-btn-wrap">
-                            <Icon class="cell-action-icon" custom="iconfont icon-choose" title="设置课程" @click="selectCell(row,'MON')" />
-                            <Icon v-if="row.weeklies.MON.courseName" class="cell-action-icon" type="md-close" title="取消课程" @click="cancelCell(row,'MON')" />
+                            <Icon class="cell-action-icon" v-show="!row.weeklies[column.slot].courseName" custom="iconfont icon-choose" title="设置课程" @click="selectCell(row, column.slot)" />
+                            <Icon class="cell-action-icon" v-show="row.weeklies[column.slot].courseName" type="md-create" title="修改课程" @click="selectCell(row, column.slot)" />
+                            <Icon class="cell-action-icon" v-show="row.weeklies[column.slot].courseName" type="md-close" title="取消课程" @click="cancelCell(row, column.slot)" />
+                            <Icon class="cell-action-icon" v-show="setClass" type="md-copy" title="重复操作" @click="copyCell(row, column.slot)" />
                         </div>
                         <p class="course-name" v-show="curClass == 'all' || curClass == row.weeklies.MON.classroomCode">{{row.weeklies.MON.courseName}}</p>
                         <p class="classroom-name" v-show="curClass == 'all' || curClass == row.weeklies.MON.classroomCode">{{row.weeklies.MON.classroomName}}</p>
                     </div>
                 </template>
                 <!--星期二-->
-                <template slot-scope="{ row, index }" slot="TUE">
+                <template slot-scope="{ row, column }" slot="TUE">
                     <div :class="row.weeklies.TUE.status == 1 ? 'week-day-cell':'week-day-cell vact-status'">
                         <div class="toggle-status-btn-wrap">
-                            <Icon class="cell-action-icon" custom="iconfont icon-choose" title="设置课程" @click="selectCell(row,'TUE')" />
-                            <Icon v-if="row.weeklies.TUE.courseName" class="cell-action-icon" type="md-close" title="取消课程" @click="cancelCell(row,'TUE')" />
+                            <Icon class="cell-action-icon" v-show="!row.weeklies[column.slot].courseName" custom="iconfont icon-choose" title="设置课程" @click="selectCell(row, column.slot)" />
+                            <Icon class="cell-action-icon" v-show="row.weeklies[column.slot].courseName" type="md-create" title="修改课程" @click="selectCell(row, column.slot)" />
+                            <Icon class="cell-action-icon" v-show="row.weeklies[column.slot].courseName" type="md-close" title="取消课程" @click="cancelCell(row, column.slot)" />
+                            <Icon class="cell-action-icon" v-show="setClass" type="md-copy" title="重复操作" @click="copyCell(row, column.slot)" />
                         </div>
                         <p class="course-name" v-show="curClass == 'all' || curClass == row.weeklies.TUE.classroomCode">{{row.weeklies.TUE.courseName}}</p>
                         <p class="classroom-name" v-show="curClass == 'all' || curClass == row.weeklies.TUE.classroomCode">{{row.weeklies.TUE.classroomName}}</p>
                     </div>
                 </template>
                 <!--星期三-->
-                <template slot-scope="{ row, index }" slot="WED">
+                <template slot-scope="{ row, column }" slot="WED">
                     <div :class="row.weeklies.WED.status == 1 ? 'week-day-cell':'week-day-cell vact-status'">
                         <div class="toggle-status-btn-wrap">
-                            <Icon class="cell-action-icon" custom="iconfont icon-choose" title="设置课程" @click="selectCell(row,'WED')" />
-                            <Icon v-if="row.weeklies.WED.courseName" class="cell-action-icon" type="md-close" title="取消课程" @click="cancelCell(row,'WED')" />
+                            <Icon class="cell-action-icon" v-show="!row.weeklies[column.slot].courseName" custom="iconfont icon-choose" title="设置课程" @click="selectCell(row, column.slot)" />
+                            <Icon class="cell-action-icon" v-show="row.weeklies[column.slot].courseName" type="md-create" title="修改课程" @click="selectCell(row, column.slot)" />
+                            <Icon class="cell-action-icon" v-show="row.weeklies[column.slot].courseName" type="md-close" title="取消课程" @click="cancelCell(row, column.slot)" />
+                            <Icon class="cell-action-icon" v-show="setClass" type="md-copy" title="重复操作" @click="copyCell(row, column.slot)" />
                         </div>
                         <p class="course-name" v-show="curClass == 'all' || curClass == row.weeklies.WED.classroomCode">{{row.weeklies.WED.courseName}}</p>
                         <p class="classroom-name" v-show="curClass == 'all' || curClass == row.weeklies.WED.classroomCode">{{row.weeklies.WED.classroomName}}</p>
                     </div>
                 </template>
                 <!--星期四-->
-                <template slot-scope="{ row, index }" slot="THU">
+                <template slot-scope="{ row, column }" slot="THU">
                     <div :class="row.weeklies.THU.status == 1 ? 'week-day-cell':'week-day-cell vact-status'">
                         <div class="toggle-status-btn-wrap">
-                            <Icon class="cell-action-icon" custom="iconfont icon-choose" title="设置课程" @click="selectCell(row,'THU')" />
-                            <Icon v-if="row.weeklies.THU.courseName" class="cell-action-icon" type="md-close" title="取消课程" @click="cancelCell(row,'THU')" />
+                            <Icon class="cell-action-icon" v-show="!row.weeklies[column.slot].courseName" custom="iconfont icon-choose" title="设置课程" @click="selectCell(row, column.slot)" />
+                            <Icon class="cell-action-icon" v-show="row.weeklies[column.slot].courseName" type="md-create" title="修改课程" @click="selectCell(row, column.slot)" />
+                            <Icon class="cell-action-icon" v-show="row.weeklies[column.slot].courseName" type="md-close" title="取消课程" @click="cancelCell(row, column.slot)" />
+                            <Icon class="cell-action-icon" v-show="setClass" type="md-copy" title="重复操作" @click="copyCell(row, column.slot)" />
                         </div>
                         <p class="course-name" v-show="curClass == 'all' || curClass == row.weeklies.THU.classroomCode">{{row.weeklies.THU.courseName}}</p>
                         <p class="classroom-name" v-show="curClass == 'all' || curClass == row.weeklies.THU.classroomCode">{{row.weeklies.THU.classroomName}}</p>
                     </div>
                 </template>
                 <!--星期五-->
-                <template slot-scope="{ row, index }" slot="FRI">
+                <template slot-scope="{ row, column }" slot="FRI">
                     <div :class="row.weeklies.FRI.status == 1 ? 'week-day-cell':'week-day-cell vact-status'">
                         <div class="toggle-status-btn-wrap">
-                            <Icon class="cell-action-icon" custom="iconfont icon-choose" title="设置课程" @click="selectCell(row,'FRI')" />
-                            <Icon v-if="row.weeklies.FRI.courseName" class="cell-action-icon" type="md-close" title="取消课程" @click="cancelCell(row,'FRI')" />
+                            <Icon class="cell-action-icon" v-show="!row.weeklies[column.slot].courseName" custom="iconfont icon-choose" title="设置课程" @click="selectCell(row, column.slot)" />
+                            <Icon class="cell-action-icon" v-show="row.weeklies[column.slot].courseName" type="md-create" title="修改课程" @click="selectCell(row, column.slot)" />
+                            <Icon class="cell-action-icon" v-show="row.weeklies[column.slot].courseName" type="md-close" title="取消课程" @click="cancelCell(row, column.slot)" />
+                            <Icon class="cell-action-icon" v-show="setClass" type="md-copy" title="重复操作" @click="copyCell(row, column.slot)" />
                         </div>
                         <p class="course-name" v-show="curClass == 'all' || curClass == row.weeklies.FRI.classroomCode">{{row.weeklies.FRI.courseName}}</p>
                         <p class="classroom-name" v-show="curClass == 'all' || curClass == row.weeklies.FRI.classroomCode">{{row.weeklies.FRI.classroomName}}</p>
                     </div>
                 </template>
                 <!--星期六-->
-                <template slot-scope="{ row, index }" slot="SAT">
+                <template slot-scope="{ row, column }" slot="SAT">
                     <div :class="row.weeklies.SAT.status == 1 ? 'week-day-cell':'week-day-cell vact-status'">
                         <p class="course-name" v-show="curClass == 'all' || curClass == row.weeklies.SAT.classroomCode">{{row.weeklies.SAT.courseName}}</p>
                         <p class="classroom-name" v-show="curClass == 'all' || curClass == row.weeklies.SAT.classroomCode">{{row.weeklies.SAT.classroomName}}</p>
                     </div>
                 </template>
                 <!--星期日-->
-                <template slot-scope="{ row, index }" slot="SUN">
+                <template slot-scope="{ row, column }" slot="SUN">
                     <div :class="row.weeklies.SUN.status == 1 ? 'week-day-cell':'week-day-cell vact-status'">
                         <p class="course-name" v-show="curClass == 'all' || curClass == row.weeklies.SUN.classroomCode">{{row.weeklies.SUN.courseName}}</p>
                         <p class="classroom-name" v-show="curClass == 'all' || curClass == row.weeklies.SUN.classroomCode">{{row.weeklies.SUN.classroomName}}</p>
@@ -102,6 +112,11 @@
                 </template>
             </Table>
         </vuescroll>
+        <Modal v-model="modalStatus" title="授课教室" @on-ok="modalOk" @on-cancel="modalCancel" class-name="dark-iview-modal dark-iview-select">
+            <Select v-model="setClass" style="display:inline-block;">
+                <Option v-for="(item,index) in teaClassList" :key="index" :value="item.classId">{{item.classInfo.name}}</Option>
+            </Select>
+        </Modal>
     </div>
 </template>
 <script>
@@ -118,13 +133,21 @@ export default {
                 return []
             }
         },
-        teacher:{
+        teacher: {
             type: String,
-            default:''
+            default: ''
+        },
+        teaClassList: {
+            type: Array,
+            default: () => {
+                return []
+            }
         }
     },
     data() {
         return {
+            setClass: '',
+            modalStatus: false,
             teachClassList: [],
             curClass: 'all',
             subIndex: 0,
@@ -182,16 +205,31 @@ export default {
                     align: 'center'
                 }
             ],
+            selectInfo: {}
         }
     },
     methods: {
+        copyCell(row, col) {
+            this.$emit('selectCell', { row, col, 'setClass': this.setClass })
+        },
         selectCell(row, col) {
-            console.log(row, col)
-            this.$emit('selectCell', { row, col })
+            this.modalStatus = true
+            this.selectInfo = { row, col }
+        },
+        modalOk() {
+            if (this.curClass) {
+                let data = this._.cloneDeep(this.selectInfo)
+                data.setClass = this.setClass //当前设置的教室
+                this.$emit('selectCell', data)
+            } else {
+                this.$$Message.warning('请设置授课教室')
+            }
         },
         cancelCell(row, col) {
-            console.log(row, col) 
-            this.$emit('cancelCell', { row, col })
+            this.$emit('cancelCell', { row, col, setClass: row.weeklies[col].classId })
+        },
+        modalCancel() {
+
         },
         //根据上下午合并单元格
         handleSpan({ row, column, rowIndex, columnIndex }) {
@@ -229,6 +267,9 @@ export default {
         )
     },
     watch: {
+        teacher(){
+            this.setClass = ''
+        }
     },
     computed: {
         timetable() {
@@ -263,16 +304,15 @@ export default {
                                 let classInfo = this.classList.find(classItem => {
                                     return classItem.id == schedItem.classId
                                 })
-                                if(this.teacher){
-                                    if(this.teacher != schedItem.teacher.id){
+                                if (this.teacher) {
+                                    if (this.teacher != schedItem.teacher.id) {
                                         return false
                                     }
                                 }
                                 schedItem.time.forEach(timeItem => {
                                     if (timeItem.id == item.id) {
-                                        console.log('1212', timeItem)
                                         item.weeklies[timeItem.week].courseName = cusItem.name
-
+                                        item.weeklies[timeItem.week].classId = schedItem.classId
                                         item.weeklies[timeItem.week].classroomName = classInfo ? classInfo.name : '暂无数据'
                                     }
                                 })
@@ -281,7 +321,6 @@ export default {
                         }
                     })
                 })
-                console.log('timetable', timetable)
                 return timetable
             } else {
                 return []

+ 66 - 19
TEAMModelOS/Controllers/Common/ExamController.cs

@@ -20,6 +20,7 @@ using TEAMModelOS.SDK.DI.AzureCosmos.Inner;
 using TEAMModelOS.SDK.Extension;
 using TEAMModelOS.SDK.Helper.Common.CollectionHelper;
 using TEAMModelOS.SDK.Helper.Common.StringHelper;
+using TEAMModelOS.SDK.Models.Cosmos.Common;
 
 namespace TEAMModelOS.Controllers
 {
@@ -66,37 +67,83 @@ namespace TEAMModelOS.Controllers
                 string code = request.code;
                 request.code = "Exam-" + request.code;
                 request.createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
-                int count = 0;
+                int stuCount = 0;
                 for (int i = 0; i < request.targetClassIds.Count; i++)
                 {
-                    /*if (request.scope.Equals("private"))
+                    List<string> ids = new List<string>();
+                    //处理班级人数(公共部分的校本名单)
+                    //List<Student> students = new List<Student>();
+                    await foreach (var item in client.GetContainer("TEAMModelOS", "Student").GetItemQueryStreamIterator(queryText: $"select c.id from c where c.classId = '{request.targetClassIds[i]}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base-{request.school}") }))
                     {
-                        var sresponse = await client.GetContainer("TEAMModelOS", "Teacher").ReadItemStreamAsync(request.targetClassIds[i], new PartitionKey($"Class-{request.creatorId}"));
-                        if (sresponse.Status == 200)
+                        using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                        if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
                         {
-                            using var json = await JsonDocument.ParseAsync(sresponse.ContentStream);
-                            Class classroom = json.ToObject<Class>();
-                            
+                            var accounts = json.RootElement.GetProperty("Documents").EnumerateArray();
+                            while (accounts.MoveNext())
+                            {
+                                JsonElement account = accounts.Current;
+                                ids.Add(account.GetProperty("id").GetString());
+                            }
+                        }
+                    }
+                    if (request.scope.Equals("private"))
+                    {                        
+                        //处理发布对象为自选名单(个人)
+                        List<StuList> stuLists = new List<StuList>();
+                        await foreach (var item in client.GetContainer("TEAMModelOS", "Teacher").GetItemQueryIterator<StuList>(queryText: $"select value(c) from c where c.id = '{request.targetClassIds[i]}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"StuList") }))
+                        {
+                            stuLists.Add(item);
+                        }
+                        if (stuLists.Count > 0) {
+                            foreach (StuList stuList in stuLists) {
+                                foreach (Students students in stuList.students) {
+                                    if (students.code.Contains(code) && !ids.Contains(students.id))
+                                    {
+                                        ids.Add(students.id);
+                                    }
+                                    else {
+                                        ids.Add(students.id);
+                                    }
+                                }
+                                if (stuList.tmids.Count > 0) {
+                                    foreach (string tid in stuList.tmids) {
+                                        ids.Add(tid);
+                                    }
+                                }
+                            }
+                          
                         }
                     }
                     else
                     {
-                        var sresponse = await client.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(request.targetClassIds[i], new PartitionKey($"Class-{request.school}"));
-                        if (sresponse.Status == 200)
+                        //发布对象为自选名单(校本)
+                        List<StuList> stuLists = new List<StuList>();
+                        await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<StuList>(queryText: $"select value(c) from c where c.id = '{request.targetClassIds[i]}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"StuList-{code}") }))
                         {
-                            using var json = await JsonDocument.ParseAsync(sresponse.ContentStream);
-                            Class classroom = json.ToObject<Class>();                          
+                            stuLists.Add(item);
+                        }
+                        if (stuLists.Count > 0)
+                        {
+                            foreach (StuList stuList in stuLists)
+                            {
+                                foreach (Students students in stuList.students)
+                                {
+                                    if (students.code.Contains(code) && !ids.Contains(students.id))
+                                    {
+                                        ids.Add(students.id);
+                                    }
+                                    else
+                                    {
+                                        ids.Add(students.id);
+                                    }
+                                }                               
+                            }
+
                         }
-                    }*/
-                    //处理班级人数
-                    List<Student> students = new List<Student>();
-                    await foreach (var item in client.GetContainer("TEAMModelOS", "Student").GetItemQueryIterator<Student>(queryText: $"select c.id from c where c.classId = '{request.targetClassIds[i]}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base-{code}") }))
-                    {
-                        students.Add(item);
                     }
-                    count += students.Count;
+                    stuCount += ids.Count;
                 }
-                request.stuCount = count;
+                request.stuCount = stuCount;
                 if (string.IsNullOrEmpty(request.id))
                 {
                     request.id = Guid.NewGuid().ToString();

+ 2 - 3
TEAMModelOS/Controllers/Common/SurveyController.cs

@@ -297,7 +297,7 @@ namespace TEAMModelOS.Controllers
                 if (flag)
                 {
                     //使用ttl删除,并处理相关事务逻辑
-                    survey.ttl = 2;
+                    survey.ttl = 5;
                     survey = await client.GetContainer("TEAMModelOS", "Common").UpsertItemAsync(survey, new PartitionKey($"{survey.code}"));
                     return Ok(new { flag });
                 }
@@ -478,7 +478,6 @@ namespace TEAMModelOS.Controllers
                 //活动分区
                 if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
                 Survey survey = await client.GetContainer("TEAMModelOS", "Common").ReadItemAsync<Survey>(id.GetString(), new PartitionKey($"{code}"));
-                survey.ttl = 1;
                 List<ChangeRecord> changeRecords = await _azureStorage.FindListByDict<ChangeRecord>(new Dictionary<string, object>() { { "RowKey", $"{id}" }, { "PartitionKey", survey.progress } });
                 ActivityData data = null;
                 if (survey != null)
@@ -598,7 +597,7 @@ namespace TEAMModelOS.Controllers
                                 else
                                 {
                                     //异动,且已经有结算记录则不必再继续。
-                                    break;
+                                   // break;
                                 }
                                 await Task.WhenAll(tasks);
                                 //更新结束状态

+ 2 - 2
TEAMModelOS/Controllers/Common/VoteController.cs

@@ -296,9 +296,9 @@ namespace TEAMModelOS.Controllers.Learn
                     }
                 }
                 if (flag)
-                { 
+                {
                     //使用ttl删除,并处理相关事务逻辑
-                    vote.ttl = 10;
+                    vote.ttl = 5;
                     vote = await client.GetContainer("TEAMModelOS", "Common").UpsertItemAsync(vote,  new PartitionKey($"{vote.code}"));
                     return Ok(new { flag });
                 }

+ 32 - 12
TEAMModelOS/Controllers/School/CourseController.cs

@@ -244,7 +244,7 @@ namespace TEAMModelOS.Controllers
                 }
                 else
                 {
-                    await foreach (var item in client.GetContainer("TEAMModelOS", "Teacher").GetItemQueryStreamIterator(queryText: query, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"StuList-{code}") }))
+                    await foreach (var item in client.GetContainer("TEAMModelOS", "Teacher").GetItemQueryStreamIterator(queryText: query, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"StuList") }))
                     {
                         using var json = await JsonDocument.ParseAsync(item.ContentStream);
                         if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
@@ -279,15 +279,15 @@ namespace TEAMModelOS.Controllers
         [HttpPost("find")]
         public async Task<IActionResult> Find(JsonElement requert)
         {
-            if (!requert.TryGetProperty("code", out JsonElement school_code)) return BadRequest();
+            if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
             if (!requert.TryGetProperty("scope", out JsonElement scope)) return BadRequest();
             
             try
             {
                 var client = _azureCosmos.GetCosmosClient();
                 List<object> courses = new List<object>();
-                var query = $"select c.code,c.id,c.no,c.name,c.period,c.subject,c.scope from c";
-                string continuationToken = string.Empty;
+                
+                /*string continuationToken = string.Empty;
                 string token = default;
                 //是否需要进行分页查询,默认不分页
                 //bool iscontinuation = false;
@@ -304,12 +304,14 @@ namespace TEAMModelOS.Controllers
                     {
                         topcout = data;
                     }
-                }                              
+                }*/
+                var query = $"select c.code,c.id,c.no,c.name,c.period,c.subject,c.scope from c";
                 if (scope.ToString().Equals("school", StringComparison.OrdinalIgnoreCase))
                 {
-                    await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIterator(queryText: query, continuationToken: token, requestOptions: new QueryRequestOptions() {MaxItemCount = topcout, PartitionKey = new PartitionKey($"Course-{school_code.GetString()}") }))
+                    
+                    await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIterator(queryText: query, requestOptions: new QueryRequestOptions() {PartitionKey = new PartitionKey($"Course-{code.GetString()}") }))
                     {
-                        continuationToken = item.GetContinuationToken();
+                        //continuationToken = item.GetContinuationToken();
                         using var json = await JsonDocument.ParseAsync(item.ContentStream);
                         if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
                         {
@@ -323,9 +325,10 @@ namespace TEAMModelOS.Controllers
                 }
                 else
                 {
-                    await foreach (var item in client.GetContainer("TEAMModelOS", "Teacher").GetItemQueryStreamIterator(queryText: query, continuationToken: token, requestOptions: new QueryRequestOptions() {MaxItemCount = topcout, PartitionKey = new PartitionKey($"Course-{school_code.GetString()}") }))
+                   
+                    await foreach (var item in client.GetContainer("TEAMModelOS", "Teacher").GetItemQueryStreamIterator(queryText: query, requestOptions: new QueryRequestOptions() {PartitionKey = new PartitionKey($"Course-{code.GetString()}") }))
                     {
-                        continuationToken = item.GetContinuationToken();
+                        //continuationToken = item.GetContinuationToken();
                         using var json = await JsonDocument.ParseAsync(item.ContentStream);
                         if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
                         {
@@ -334,11 +337,28 @@ namespace TEAMModelOS.Controllers
                                 courses.Add(obj.ToObject<object>());
                             }
                         }
-                        break;
+                        //break;
                     }
+                    if (requert.TryGetProperty("schoolId", out JsonElement schoolId)) {
+                        var querySchool = $"select c.code,c.id,c.no,c.name,c.period,c.subject,c.scope from c join A0 c.schedule where A0.teacher.id = {code}";
+                        await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIterator(queryText: query, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Course-{schoolId.GetString()}") }))
+                        {
+                            //continuationToken = item.GetContinuationToken();
+                            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())
+                                {
+                                    courses.Add(obj.ToObject<object>());
+                                }
+                            }
+                            //break;
+                        }
+                    };
+                   
                 }
-
-                return Ok(new { courses, courses.Count, token = continuationToken });
+                return Ok(new { courses, courses.Count});
+                //return Ok(new { courses, courses.Count, token = continuationToken });
             }
             catch (Exception ex)
             {

+ 113 - 0
TEAMModelOS/Properties/ServiceDependencies/teammodelos-test - Web Deploy/profile.arm.json

@@ -0,0 +1,113 @@
+{
+  "$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#",
+  "contentVersion": "1.0.0.0",
+  "metadata": {
+    "_dependencyType": "appService.windows"
+  },
+  "parameters": {
+    "resourceGroupName": {
+      "type": "string",
+      "defaultValue": "TEAMModelChengdu",
+      "metadata": {
+        "description": "Name of the resource group for the resource. It is recommended to put resources under same resource group for better tracking."
+      }
+    },
+    "resourceGroupLocation": {
+      "type": "string",
+      "defaultValue": "",
+      "metadata": {
+        "description": "Location of the resource group. Resource groups could have different location than resources, however by default we use API versions from latest hybrid profile which support all locations for resource types we support."
+      }
+    },
+    "resourceName": {
+      "type": "string",
+      "defaultValue": "test",
+      "metadata": {
+        "description": "Name of the main resource to be created by this template."
+      }
+    },
+    "resourceLocation": {
+      "type": "string",
+      "defaultValue": "[parameters('resourceGroupLocation')]",
+      "metadata": {
+        "description": "Location of the resource. By default use resource group's location, unless the resource provider is not supported there."
+      }
+    }
+  },
+  "variables": {
+    "appServicePlan_name": "[concat('Plan', uniqueString(concat(parameters('resourceName'), subscription().subscriptionId)))]",
+    "appServicePlan_ResourceId": "[concat('/subscriptions/', subscription().subscriptionId, '/resourceGroups/', parameters('resourceGroupName'), '/providers/Microsoft.Web/serverFarms/', variables('appServicePlan_name'))]"
+  },
+  "resources": [
+    {
+      "type": "Microsoft.Resources/resourceGroups",
+      "name": "[parameters('resourceGroupName')]",
+      "location": "[parameters('resourceGroupLocation')]",
+      "apiVersion": "2019-10-01"
+    },
+    {
+      "type": "Microsoft.Resources/deployments",
+      "name": "[concat(parameters('resourceGroupName'), 'Deployment', uniqueString(concat(parameters('resourceName'), subscription().subscriptionId)))]",
+      "resourceGroup": "[parameters('resourceGroupName')]",
+      "apiVersion": "2019-10-01",
+      "dependsOn": [
+        "[parameters('resourceGroupName')]"
+      ],
+      "properties": {
+        "mode": "Incremental",
+        "template": {
+          "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
+          "contentVersion": "1.0.0.0",
+          "resources": [
+            {
+              "location": "[parameters('resourceLocation')]",
+              "name": "[parameters('resourceName')]",
+              "type": "Microsoft.Web/sites",
+              "apiVersion": "2015-08-01",
+              "tags": {
+                "[concat('hidden-related:', variables('appServicePlan_ResourceId'))]": "empty"
+              },
+              "dependsOn": [
+                "[variables('appServicePlan_ResourceId')]"
+              ],
+              "kind": "app",
+              "properties": {
+                "name": "[parameters('resourceName')]",
+                "kind": "app",
+                "httpsOnly": true,
+                "reserved": false,
+                "serverFarmId": "[variables('appServicePlan_ResourceId')]",
+                "siteConfig": {
+                  "metadata": [
+                    {
+                      "name": "CURRENT_STACK",
+                      "value": "dotnetcore"
+                    }
+                  ]
+                }
+              },
+              "identity": {
+                "type": "SystemAssigned"
+              }
+            },
+            {
+              "location": "[parameters('resourceLocation')]",
+              "name": "[variables('appServicePlan_name')]",
+              "type": "Microsoft.Web/serverFarms",
+              "apiVersion": "2015-08-01",
+              "sku": {
+                "name": "S1",
+                "tier": "Standard",
+                "family": "S",
+                "size": "S1"
+              },
+              "properties": {
+                "name": "[variables('appServicePlan_name')]"
+              }
+            }
+          ]
+        }
+      }
+    }
+  ]
+}

+ 5 - 2
TEAMModelOS/Services/Common/ActivityStudentService.cs

@@ -285,6 +285,9 @@ namespace TEAMModelOS.Services.Common
             } 
             //是否需要进行分页查询,默认不分页
             bool iscontinuation = false;
+            if (topcout != null && topcout.Value > 0) {
+                iscontinuation = true;
+            }
             //如果指定了返回大小
             if (requert.TryGetProperty("continuationTokenSchool", out JsonElement continuationSchool))
             {
@@ -292,7 +295,7 @@ namespace TEAMModelOS.Services.Common
                 if (!continuationSchool.ValueKind.Equals(JsonValueKind.Null) && continuationSchool.ValueKind.Equals(JsonValueKind.String))
                 {
                     continuationTokenSchool = continuationSchool.GetString();
-                    iscontinuation = true;
+                    
                 }
             }
             //如果指定了返回大小
@@ -302,7 +305,7 @@ namespace TEAMModelOS.Services.Common
                 if (!continuationTeacher.ValueKind.Equals(JsonValueKind.Null) && continuationTeacher.ValueKind.Equals(JsonValueKind.String))
                 {
                     continuationTokenTeacher = continuationTeacher.GetString();
-                    iscontinuation = true;
+                    
                 }
             }
             //个人tmdid

+ 5 - 1
TEAMModelOS/Services/Common/ActivityTeacherService.cs

@@ -86,6 +86,10 @@ namespace TEAMModelOS.Services.Common
             }
             //是否需要进行分页查询,默认不分页
             bool iscontinuation = false;
+            if (topcout != null && topcout.Value > 0)
+            {
+                iscontinuation = true;
+            }
             //如果指定了返回大小
             if (!requert.TryGetProperty("continuationToken", out JsonElement continuation))
             {
@@ -93,7 +97,7 @@ namespace TEAMModelOS.Services.Common
                 if (!continuation.ValueKind.Equals(JsonValueKind.Null) && continuation.ValueKind.Equals(JsonValueKind.String))
                 {
                     continuationToken = continuation.GetString();
-                    iscontinuation = true;
+                    
                 }
             }
             //班级