Bläddra i källkod

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

CrazyIter_Bin 4 år sedan
förälder
incheckning
cee4d0c1c9
24 ändrade filer med 756 tillägg och 616 borttagningar
  1. 73 26
      TEAMModelFunction/TriggerExam.cs
  2. 5 2
      TEAMModelOS/ClientApp/src/api/studentWeb.js
  3. 1 1
      TEAMModelOS/ClientApp/src/assets/student-web/component_styles/vote.css
  4. 77 47
      TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContentTypeTemplate/Vote.vue
  5. 9 52
      TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContentTypeTemplate/VoteResultChart.vue
  6. 2 2
      TEAMModelOS/ClientApp/src/locale/lang/zh-CN/http.js
  7. 2 2
      TEAMModelOS/ClientApp/src/locale/lang/zh-TW/http.js
  8. 2 0
      TEAMModelOS/ClientApp/src/utils/evTools.js
  9. 1 1
      TEAMModelOS/ClientApp/src/utils/kityformula.js
  10. 1 0
      TEAMModelOS/ClientApp/src/view/evaluation/components/BaseCreateChild.vue
  11. 1 0
      TEAMModelOS/ClientApp/src/view/evaluation/components/BaseEditExercise.vue
  12. 1 0
      TEAMModelOS/ClientApp/src/view/evaluation/index/CreateExercises.vue
  13. 8 2
      TEAMModelOS/ClientApp/src/view/evaluation/types/BaseCompletion.vue
  14. 2 1
      TEAMModelOS/ClientApp/src/view/learnactivity/CreatePrivEva.vue
  15. 2 36
      TEAMModelOS/ClientApp/src/view/learnactivity/CreateSchoolEva.vue
  16. 4 3
      TEAMModelOS/ClientApp/src/view/newcourse/CourseClassroom.less
  17. 5 3
      TEAMModelOS/ClientApp/src/view/newcourse/MyCourse.less
  18. 187 192
      TEAMModelOS/ClientApp/src/view/newcourse/MyCourse.vue
  19. 14 0
      TEAMModelOS/ClientApp/src/view/newcourse/NewCusMgt.less
  20. 194 182
      TEAMModelOS/ClientApp/src/view/newcourse/NewCusMgt.vue
  21. 67 28
      TEAMModelOS/ClientApp/src/view/newcourse/TeaTable.vue
  22. 0 5
      TEAMModelOS/ClientApp/src/view/vote/ManageVote.vue
  23. 66 19
      TEAMModelOS/Controllers/Common/ExamController.cs
  24. 32 12
      TEAMModelOS/Controllers/School/CourseController.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);

+ 5 - 2
TEAMModelOS/ClientApp/src/api/studentWeb.js

@@ -172,15 +172,18 @@ export default {
     getVoteInfo: function (data) {
         return post('/common/vote/find-id',data)
     },
-    //查詢學生端投票结果
+    //查詢學生端个人投票结果
     getVoteResult: function (data) {
         return post('/common/vote/decided',data)
     },
+    //查詢活动投票结果
+    getVoteRecord: function (data) {
+        return post('/common/vote/record',data)
+    },
     //提交投票结果数据
     sendVoteResult: function (data) {
         return post('/common/vote/decide',data)
     },
-	
 	//查詢學生端问卷活动
 	getSurveyInfo: function (data) {
 	    return post('/common/survey/find-id',data)

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

+ 77 - 47
TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContentTypeTemplate/Vote.vue

@@ -36,7 +36,7 @@
                     </div>
                 </div>
                 <!--和評測模組一樣-->
-                <div class="question-box"><p>1.</p><span v-html="voteInfo.description"></span></div>
+                <div class="question-box"><p></p><span v-html="voteInfo.description"></span></div>
                 <div class="checkAnswer">
                     <label class="testBtn"
                            v-for="(item, index) in voteInfo.options"
@@ -71,30 +71,29 @@
             </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>
-                <br />
             </div>
-            <br />
             <div align="center">
-                <VoteResultChart :activityData="voteInfo" :voteRes="voteResData" />
+                <VoteResultChart :voteData="voteData" :voteList="voteList" />
             </div>
         </div>
     </div>
 </template>
 
 <script>
-import EventBasicInfo from "../../EventBasicInfo";
-import BillBoardandLightBox from "../../EventView/BillBoardandLightBox";
-import VoteResultChart from "./VoteResultChart";
-import Load from "vue-loading-overlay";
+    import EventBasicInfo from "../../EventBasicInfo";
+    import BillBoardandLightBox from "../../EventView/BillBoardandLightBox";
+    import VoteResultChart from "./VoteResultChart";
+    import Load from "vue-loading-overlay";
+import { options } from "less";
 
-export default {
-  name: "Vote",
+    export default {
+        name: "Vote",
         components: {
             EventBasicInfo,
             VoteResultChart,
@@ -107,26 +106,27 @@ export default {
             this.voteChecked = [];
             this.clickbutnoChoose = false;
         },
-  data() {
-      return {
-          isHintNextItem: false,
-          voteChecked: [],
-          WarmMessageisOpen: false,
-          clickbutnoChoose: false,
-          voteInfo: {},
-          voteRes: {},
-          voteResData:[],
-          isVote: false,
-          voteNum: 0,
-          showResult: false,
-          chooseVoteRes: {},
-          isLoad: false
-      };
-  },
-
+        data() {
+            return {
+                isHintNextItem: false,
+                voteChecked: [],
+                WarmMessageisOpen: false,
+                clickbutnoChoose: false,
+                voteInfo: {},
+                voteRes: {},
+                voteResData: [],
+                isVote: false,
+                voteNum: 0,
+                showResult: false,
+                chooseVoteRes: {},
+                isLoad: false,
+                voteData: [],
+                voteList: []
+            };
+        },
         methods: {
             //获取个人投票结果数据
-            getVoteResult() {
+            getVoteRecord() {
                 if (this.$store.getters.getItemTitle.id) {
                     this.voteRes = {}
                     let params = {
@@ -161,16 +161,45 @@ export default {
                                 item.count = 0
                             }
                             if (res.vote.progress == "finish") {
+                                this.getVoteRes()
                                 this.showResult = true
-                                //this.setMyMap()
+                            } else {
+                                this.getVoteRecord()
                             }
                             this.voteInfo = res.vote
-                            this.getVoteResult()
                         }
+                    })
+                }
+            },
+            getVoteRes() {
+                if (this.$store.getters.getItemTitle.id) {
+                    this.voteRes = {}
+                    let params = {
+                        "id": this.$store.getters.getItemTitle.id,
+                        "code": this.$store.getters.getItemTitle.scode,
+                        "userid": this.$store.state.userInfo.sub
+                    }
+                    this.$api.studentWeb.getVoteRecord(params).then(res => {
+                        if (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) {
@@ -204,7 +233,7 @@ export default {
                 let dataTime = ''
                 if (time.records.length) {
                     time.records = time.records.sort((a, b) => {
-                        return b.time -a.time //时间正序
+                        return b.time - a.time //时间正序
                     });
                     dataTime = time.records[0].time
                 }
@@ -218,16 +247,16 @@ export default {
                         case 'day':
                             let daySart = new Date(new Date(new Date().toLocaleDateString()).getTime()).getTime()
                             let dayEnd = new Date(new Date(new Date().toLocaleDateString()).getTime() + 24 * 60 * 60 * 1000 - 1).getTime()
-                            if (dataTime <= daySart || dataTime >= dayEnd ) {
+                            if (dataTime <= daySart || dataTime >= dayEnd) {
                                 status = true
                             }
                             break;
                         //是否为本周
                         case 'week':
-                            let curWeek = date.getDay();           //获取当前星期几    
-                            let monday = this.getDates((curWeek), 1).getTime(); //计算出星期一    
+                            let curWeek = date.getDay();           //获取当前星期几
+                            let monday = this.getDates((curWeek), 1).getTime(); //计算出星期一
                             let sunday = this.getDates((7 - curWeek), 2).getTime(); //计算出星期天
-                            if (dataTime <= sunday || dataTime >= sunday ) {
+                            if (dataTime <= sunday || dataTime >= sunday) {
                                 status = true
                             }
                             break;
@@ -235,7 +264,7 @@ export default {
                         case 'month':
                             let firstDay = new Date(year, month, 1).getTime()
                             let lastDay = new Date(year, month + 1, 1).getTime() - 1
-                            if (dataTime <= firstDay || dataTime >= lastDay ) {
+                            if (dataTime <= firstDay || dataTime >= lastDay) {
                                 status = true
                             }
                             break;
@@ -243,14 +272,14 @@ export default {
                         case 'year':
                             let firstYear = new Date(year, 0, 1).getTime()
                             let lastYear = new Date(year + 1, 0, 0).getTime()
-                            if (dataTime <= firstYear || dataTime >= lastYear ) {
+                            if (dataTime <= firstYear || dataTime >= lastYear) {
                                 status = true
                             }
                             break;
                         default:
                     }
                 }
-                 //在时间范围内 未投票
+                //在时间范围内 未投票
                 else if (date <= data.endTime && date >= data.startTime && time.records.length == 0) {
                     status = true
                 } else {
@@ -259,7 +288,7 @@ export default {
                 this.isVote = status
                 return status
             },
-            
+
             setVoteNum(data) {
                 if (this.isOverCount) {
                     data.count = 0
@@ -307,6 +336,7 @@ export default {
             voteCount() {
                 if (this.voteInfo.voteNum !== undefined) {
                     let num = 0
+                    this.isVote = true
                     this.isOverCount = false
                     for (let item of this.voteInfo.options) {
                         if (item.count !== null) {
@@ -315,6 +345,7 @@ export default {
                     }
                     if (num > this.voteInfo.voteNum) {
                         this.isOverCount = true
+                        this.isVote = false
                         this.$Message.warning(this.$t('studentWeb.vote.warning2'))
                         return 0
                     }
@@ -344,13 +375,12 @@ export default {
                         this.voteChecked = [...new Set(arr)]
                     }
                 },
-                deep:true
+                deep: true
             }
-
         },
-};
+    };
 </script>
 
 <style scoped>
-@import "~@/assets/student-web/component_styles/vote.css";
+    @import "~@/assets/student-web/component_styles/vote.css";
 </style>

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

@@ -1,6 +1,5 @@
 <template>
     <div class="vote-result-chart">
-        <!--<BarChart :option="option" />-->
         <Card class="vote-chart-card">
             <div id="main" style="height:400px;width:600px"></div>
         </Card>
@@ -8,37 +7,31 @@
 </template>
 
 <script>
-    import { Random } from "mockjs";
-    //import { BarChart } from "dr-vue-echarts";
     export default {
         props: {
-            activityData: {
-                type: Object,
+            voteData: {
+                type: Array,
                 default: () => {
-                    return {}
+                    return []
                 }
             },
-            voteRes: {
+            voteList: {
                 type: Array,
                 default: () => {
                     return []
                 }
             }
-        },
-        computed: {
-
         },
         data() {
             return {
+                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: {
@@ -50,7 +43,7 @@
                             fontFamily: "Ariel",
                             fontWeight: "bolder",
                         },
-                        //formatter: localStorage.getItem('lang') == 'tw' ? '選項{b0}: <span class="studyhrs">{c0}</span> 人' : 'Option {b0}: <span class="studyhrs">{c0}</span> students'
+                        formatter: '选项{b0}: <span class="studyhrs">{c0}</span> 人'
                     },
                     grid: {
                         top: "15%",
@@ -61,7 +54,7 @@
                     },
                     xAxis: {
                         type: "category",
-                        data: ["A", "B", "C", "D"],
+                        data: this.voteList,
                         splitLine: {
                             lineStyle: {
                                 color: "transparent",
@@ -93,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 - 2
TEAMModelOS/ClientApp/src/locale/lang/zh-CN/http.js

@@ -1,6 +1,6 @@
 export default{
     error500:'服务器错误!',
     error401:'登录状态已过期!请重新登录!',
-    error404:'未访问到接口地址!',
-	error:'接口异常!'
+    error404:'未访问到API地址!',
+	error:'API异常!'
 }

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

@@ -1,6 +1,6 @@
 export default {
 	error500: '服務器錯誤!',
 	error401: '登入狀態已過期!請重新登入!',
-	error404: '未訪問到介面地址!',
-	error: '介面异常!'
+	error404: '未訪問到API地址!',
+	error: 'API异常!'
 }

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

@@ -37,6 +37,7 @@ export default {
 					children:item.children || [],
 					scope:item.scope,
 					score: item.score||0,
+					count: item.count||1,
 					repair:item.repair,
 				},
 				item:[{
@@ -68,6 +69,7 @@ export default {
 				gradeIds:item.gradeIds,
 				subjectId:item.subjectId,
 				repair:item.repair,
+				count: item.count || 1,
 				blob:item.blob
 			}
 			r(cosmosItem)

+ 1 - 1
TEAMModelOS/ClientApp/src/utils/kityformula.js

@@ -48,7 +48,7 @@ export default function(editor) {
 			  
 
 
-              editor.txt.append(`<span>\\( ${ latex } \\)</span>`)
+              editor.txt.append(`<p>\\( ${ latex } \\)</p>`)
 			  
 			  
 			 //  editor.txt.append(

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

@@ -248,6 +248,7 @@
 						exerciseItem.level = +this.exersicesDiff;
 						exerciseItem.explain = this.analysisContent;
 						exerciseItem.answer = [this.$refs.complete.answerContent];
+						exerciseItem.count = this.$refs.complete.count || 1;
 						break;
 					case "subjective":
 						exerciseItem.question = this.$refs.subjective.stemContent;

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

@@ -279,6 +279,7 @@
 						exerciseItem.level = +this.exersicesDiff;
 						exerciseItem.explain = this.analysisContent;
 						exerciseItem.answer = [this.$refs.complete.answerContent];
+						exerciseItem.count = this.$refs.complete.count || 1;
 						break;
 					case "connector":
 						exerciseItem.question = this.$refs.connector.stemContent;

+ 1 - 0
TEAMModelOS/ClientApp/src/view/evaluation/index/CreateExercises.vue

@@ -288,6 +288,7 @@
 						exerciseItem.level = +this.exersicesDiff;
 						exerciseItem.explain = this.analysisContent;
 						exerciseItem.answer = [this.$refs.complete.answerContent];
+						exerciseItem.count = this.$refs.complete.count || 1;
 						break;
 					case "subjective":
 						exerciseItem.question = this.$refs.subjective.stemContent;

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

@@ -6,6 +6,11 @@
 				<div ref="editor" style="text-align:left"></div>
 			</div>
 		</div>
+		<div class="exersices-option">
+			<IconText text="填空数量" :color="'#0e9c50'" :icon="'md-compass'"></IconText>
+			</br>
+			<InputNumber v-model="count" :min="1" :editable="false" size="large"></InputNumber>
+		</div>
 		<div class="exersices-option">
 			<IconText :text="$t('evaluation.newExercise.answerTitle')" :color="'#FF871C'" :icon="'md-reorder'"></IconText>
 			<div style="margin-top:15px;">
@@ -27,12 +32,13 @@
 				stemContent: '',
 				stemEditor: null,
 				answerContent: '',
-				answerEditor: null
-
+				answerEditor: null,
+				count:1
 			}
 		},
 		methods: {
 			doRender(){
+				this.count = this.editInfo.count || 1
 				this.stemContent = this.editInfo.question
 				this.answerContent = this.editInfo.answer
 				this.stemEditor.txt.html(this.editInfo.question)

+ 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 []

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

@@ -343,8 +343,6 @@
 								})
 							})
 						})
-						console.log('所有学生名单',list)
-						console.log('已投票学生名单',records.records)
 						
 						// 要根据作答情况 结合两张表 处理表格显示的数据 
 						if (records.options.length) {
@@ -352,7 +350,6 @@
 							this.studentsTable = list
 							records.options.forEach((item, index) => {
 								arr.push({
-									// option: this.getSimpleText(item.optionValue),
 									option: item.code ? this.$t('vote.option') + (index + 1) : this.$t('vote.noVote'),
 									key: item.code || '',
 									result: new Array(item.count).fill('1')
@@ -361,8 +358,6 @@
 							this.studentsTable.forEach(i => {
 								let matchList = records.records.filter(j => j.userid === i.id)
 								i.option = matchList.length ? Object.keys(matchList[0].opt).join(',') : null
-								// i.classroomName = matchList.length ? matchList[0].classroomName : this.$t('vote.noData')
-								// i.option = i.opt.join(',')
 							})
 							console.log(arr)
 							console.log(this.studentsTable)

+ 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();

+ 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)
             {