Bladeren bron

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

liqk 3 jaren geleden
bovenliggende
commit
9cec7cb5a1

+ 21 - 34
TEAMModelFunction/ActivityHttpTrigger.cs

@@ -17,6 +17,7 @@ using TEAMModelOS.SDK.Models.Cosmos;
 using TEAMModelOS.SDK.Models.Cosmos.Common;
 using System.Linq;
 using TEAMModelOS.Services.Common;
+using TEAMModelOS.SDK.Models.Service;
 
 namespace TEAMModelFunction
 {
@@ -522,42 +523,12 @@ namespace TEAMModelFunction
             ILogger log)
         {
             try
-            {   
+            {
+                var client = _azureCosmos.GetCosmosClient();
                 string requestBody = await new StreamReader(req.Body).ReadToEndAsync();
                 var data = System.Text.Json.JsonSerializer.Deserialize<JsonElement>(requestBody);
-                if (data.TryGetProperty("name", out JsonElement _name) ) {
-                    List<string> names = _name.ToObject<List<string>>();
-                    foreach (string name in names) {
-                        var client = _azureCosmos.GetCosmosClient();
-                        List<string> prefixs = new List<string>() { "audio", "doc", "image", "other", "res", "video", "thum" };
-                        var ContainerClient = _azureStorage.GetBlobContainerClient($"{name}");
-                        string scope = "private";
-                        if (data.TryGetProperty("scope", out JsonElement _scope))
-                        {
-                            scope = $"{_scope}";
-                        }
-                        var tb = "Teacher";
-                        if (scope != "private")
-                        {
-                            tb = "School";
-                        }
-                        long now = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
-                        // List<Task<ItemResponse<Bloblog>>> responses = new List<Task<ItemResponse<Bloblog>>>();
-                        foreach (var prefix in prefixs)
-                        {
-                            List<string> items = await ContainerClient.List(prefix);
-                            foreach (var item in items)
-                            {
-                                var urlsSize = await ContainerClient.GetBlobsSize(item);
-                                Bloblog bloblog = new Bloblog { id = Guid.NewGuid().ToString(), code = $"Bloblog-{name}", pk = "Bloblog", time = now, url = item, size = urlsSize != null && urlsSize.HasValue ? urlsSize.Value : 0, type = prefix };
-                                await client.GetContainer("TEAMModelOS", tb).UpsertItemAsync(bloblog, new Azure.Cosmos.PartitionKey(bloblog.code));
-                            }
-                        }
-                    }
-                  //  await Task.WhenAll(responses);
-                }
+                await FixDataService.FixBlobContent(client, _dingDing, _azureStorage, data);
                 return new OkObjectResult(new { });
-
             }
             catch (Exception ex)
             {
@@ -565,6 +536,22 @@ namespace TEAMModelFunction
                 return new BadRequestResult();
             }
         }
-
+        /// <summary>
+        /// 修复容器的内容显示
+        /// </summary>
+        /// <param name="req"></param>
+        /// <param name="log"></param>
+        /// <returns></returns>
+        [FunctionName("fix-student-info")]
+        public async Task<IActionResult> FixStudentInfo(
+            [HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)] HttpRequest req,
+            ILogger log)
+        {
+            var client = _azureCosmos.GetCosmosClient();
+            string requestBody = await new StreamReader(req.Body).ReadToEndAsync();
+            var data = System.Text.Json.JsonSerializer.Deserialize<JsonElement>(requestBody);
+            await FixDataService.FixStudentInfo(client, _dingDing, _azureStorage, data);
+            return new OkObjectResult(new { });
+        }
     }
 }

+ 2 - 2
TEAMModelOS.SDK/Models/Cosmos/Common/SheetConfig.cs

@@ -12,7 +12,7 @@ namespace TEAMModelOS.SDK.Models.Cosmos.Common
         /// <summary>
         /// 关联id,如果没有关联则为null
         /// </summary>
-        public string sid { get; set; } = null;
+        //public string sid { get; set; } = null;
 
         /// <summary>
         ///  //列数
@@ -66,7 +66,7 @@ namespace TEAMModelOS.SDK.Models.Cosmos.Common
     }
     public class ConfigContent
     {
-        public string index { get; set; }
+        public int index { get; set; }
         public int count { get; set; }
         public int type { get; set; }
         public int x { get; set; }

+ 140 - 0
TEAMModelOS.SDK/Models/Service/FixDataService.cs

@@ -0,0 +1,140 @@
+using Azure;
+using Azure.Cosmos;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Text.Json;
+using System.Threading.Tasks;
+using TEAMModelOS.SDK.DI;
+using TEAMModelOS.SDK.Extension;
+using TEAMModelOS.SDK.Helper.Common.CollectionHelper;
+
+namespace TEAMModelOS.SDK.Models.Service
+{
+    public static class FixDataService
+    {
+        /// <summary>
+        /// 修复学生数据
+        /// </summary>
+        /// <param name="client"></param>
+        /// <param name="_dingDing"></param>
+        /// <param name="_azureStorage"></param>
+        /// <param name="data"></param>
+        /// <returns></returns>
+        public static async Task FixStudentInfo(CosmosClient client, DingDing _dingDing, AzureStorageFactory _azureStorage, JsonElement data) {
+            var code = data.GetProperty("code").GetString();
+            var ids = data.GetProperty("ids").ToObject<List<string>>();
+            var dict = data.GetProperty("dict").ToObject<Dictionary<string, object>>();
+            string queryText = $"SELECT VALUE c FROM c WHERE c.id IN ({string.Join(",", ids.Select(o => $"'{o}'"))})";
+            List<Student> students = new List<Student>();
+            await foreach (var item in client.GetContainer("TEAMModelOS", "Student")
+                            .GetItemQueryIterator<Student>(
+                                queryText: queryText,
+                                requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base-{code}") })) {
+                foreach (var key in dict.Keys) {
+                    switch (key) {
+                        case "classId":
+                            item.classId =$"{ dict[key]}";
+                            break;
+                        case "periodId":
+                            item.periodId = $"{ dict[key]}";
+                            break;
+                        case "schoolId":
+                            item.schoolId = $"{ dict[key]}";
+                            break;
+                        case "year":
+                            int year = DateTime.Now.Year;
+                            int.TryParse($"dict[key]", out year);
+                            item.year = year;
+                            break;
+                        default:
+                            break;
+                    }
+                    students.Add(item);
+                }
+            }
+            List<Task<ItemResponse<Student>>> studen = new List<Task<ItemResponse<Student>>>();
+            students.ForEach(x => {
+                studen.Add(client.GetContainer("TEAMModelOS", "Student").ReplaceItemAsync<Student>(x,x.id,new PartitionKey(x.code)));
+            });
+            await Task.WhenAll(studen);
+        }
+        /// <summary>
+        /// 修复内容模块数据
+        /// </summary>
+        /// <param name="client"></param>
+        /// <param name="_dingDing"></param>
+        /// <param name="_azureStorage"></param>
+        /// <param name="data"></param>
+        /// <returns></returns>
+        public  static  async   Task FixBlobContent(CosmosClient client, DingDing _dingDing, AzureStorageFactory _azureStorage, JsonElement data)
+        {
+           
+            if (data.TryGetProperty("name", out JsonElement _name))
+            {
+                List<string> names = _name.ToObject<List<string>>();
+                foreach (string name in names)
+                {
+                    List<string> prefixs = new List<string>() { "audio", "doc", "image", "other", "res", "video", "thum" };
+                    var ContainerClient = _azureStorage.GetBlobContainerClient($"{name}");
+                    string scope = "private";
+                    if (data.TryGetProperty("scope", out JsonElement _scope))
+                    {
+                        scope = $"{_scope}";
+                    }
+                    var tb = "Teacher";
+                    if (scope != "private")
+                    {
+                        tb = "School";
+                    }
+                    List<string> ids = new List<string>();
+                    await foreach (var item in client.GetContainer("TEAMModelOS", tb).GetItemQueryIterator<Bloblog>(queryDefinition: new QueryDefinition("select c.id from c "), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Bloblog-{name}") }))
+                    {
+                        ids.Add(item.id);
+                    }
+                    await client.GetContainer("TEAMModelOS", tb).DeleteItemsStreamAsync(ids, $"Bloblog-{name}");
+                    long now = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
+                    foreach (var prefix in prefixs)
+                    {
+                        if (prefix.Equals("res"))
+                        {
+                            List<string> itemres = await ContainerClient.List(prefix);
+                            if (itemres.IsNotEmpty()) {
+                                HashSet<string> set = new HashSet<string>();
+                                itemres.ForEach(x =>
+                                {
+                                    var uri = x.Split("/");
+                                    set.Add($"res/{uri[1]}");
+                                });
+                                foreach (var item in set)
+                                {
+                                    var urlsSize = await ContainerClient.GetBlobsSize(item);
+                                    var url = item;
+                                    if (!item.EndsWith(".hte", StringComparison.OrdinalIgnoreCase) && !item.EndsWith(".HTEX", StringComparison.OrdinalIgnoreCase))
+                                    {
+                                        url += ".HTEX";
+                                    }
+                                    Bloblog bloblog = new Bloblog { id = Guid.NewGuid().ToString(), code = $"Bloblog-{name}", pk = "Bloblog", time = now, url = url, size = urlsSize != null && urlsSize.HasValue ? urlsSize.Value : 0, type = prefix };
+                                    await client.GetContainer("TEAMModelOS", tb).UpsertItemAsync(bloblog, new Azure.Cosmos.PartitionKey(bloblog.code));
+                                }
+                            }
+                        }
+                        else {
+                            List<string> items = await ContainerClient.List(prefix);
+                            if (items.IsNotEmpty()) {
+                                foreach (var item in items)
+                                {
+                                    var urlsSize = await ContainerClient.GetBlobsSize(item);
+                                    Bloblog bloblog = new Bloblog { id = Guid.NewGuid().ToString(), code = $"Bloblog-{name}", pk = "Bloblog", time = now, url = item, size = urlsSize != null && urlsSize.HasValue ? urlsSize.Value : 0, type = prefix };
+                                    await client.GetContainer("TEAMModelOS", tb).UpsertItemAsync(bloblog, new Azure.Cosmos.PartitionKey(bloblog.code));
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    }
+}

+ 2 - 2
TEAMModelOS/ClientApp/src/assets/student-web/component_styles/course-content.css

@@ -5,7 +5,7 @@
 .course-content {
   position: relative;
   float: right;
-  width: 65%;
+  width: 50%;
   padding: 2% 3%;
   height: auto;
 }
@@ -133,7 +133,7 @@
   border: 1px solid rgba(0, 0, 0, 0.1);
   display: inline-block;
   padding: 10px;
-  width: 18%;
+  width: 22%;
   position: relative;
   margin: 10px;
 }

+ 2 - 2
TEAMModelOS/ClientApp/src/assets/student-web/component_styles/course-content.less

@@ -3,7 +3,7 @@
 .course-content {
   position: relative;
   float: right;
-  width: 65%;
+  width: 50%;
   padding: 2% 3%;
   height: auto;
   @media screen and (max-width: 991px){
@@ -133,7 +133,7 @@
     border: 1px solid @border;
     display: inline-block;
     padding: 10px;
-    width: 18%;
+    width: 22%;
     position: relative;
     margin: 10px;
 

+ 3 - 0
TEAMModelOS/ClientApp/src/assets/student-web/component_styles/course-list.css

@@ -2,6 +2,9 @@
 /*回傳的狀態文字,標題段落的方框,分頁*/
 /*標題類型的標記,編序教材附件按鈕*/
 /*各類項目的懸停與選中狀態*/
+.course-list .list {
+  width: 49.1%;
+}
 .course-list .tableViewBtn,
 .course-list .listViewBtn {
   display: inline-block;

+ 3 - 0
TEAMModelOS/ClientApp/src/assets/student-web/component_styles/course-list.less

@@ -1,6 +1,9 @@
 @import "color.less";
 
 .course-list {
+  .list{
+    width: 49.1%;
+  }
   .tableViewBtn,.listViewBtn{
     display: inline-block;
    position: fixed;

+ 64 - 6
TEAMModelOS/ClientApp/src/components/student-web/HomeView/CourseContent.vue

@@ -98,7 +98,26 @@
                 <!-- 同学名单 -->
                 <TabPane :label="$t('studentWeb.courseContent.classmates')" name="tab3">
                     <div v-if="isChangeGroupView == false">
-                        <Row :gutter="50">
+                        <div>
+                            <table>
+                                <tr>
+                                    <th>{{ $t("studentWeb.courseContent.seatNo") }}</th>
+                                    <th>{{ $t("studentWeb.courseContent.name") }}</th>
+                                    <th>{{ $t("studentWeb.courseContent.group") }}</th>
+                                </tr>
+                                <tr class="mates-list-item"
+                                    v-for="(item, index) in stuList"
+                                     :class="{ 'my-name': item.id == $store.state.userInfo.sub }"
+                                    :key="index"
+                                >
+                                    <td>{{ item.no }}</td>
+                                    <td>{{ item.name }}</td>
+                                    <td v-if="item.groupName">{{ item.groupName }}</td>
+                                    <td v-else>暂未分组</td>
+                                </tr>
+                            </table>
+                        </div>
+                        <!-- <Row :gutter="50">
                             <i-col :xs="24" :sm="24" :md="12" :lg="12">
                                 <table>
                                     <tr>
@@ -113,9 +132,9 @@
                                     >
                                         <td>{{ item.no }}</td>
                                         <td>{{ item.name }}</td>
-                                        <!-- <td v-if="currentLang == 'zh-cn'">第{{ item.group }}组</td>
+                                        <td v-if="currentLang == 'zh-cn'">第{{ item.group }}组</td>
                                         <td v-else-if="currentLang == 'zh-tw'">第{{ item.group }}組</td>
-                                        <td v-else-if="currentLang == 'en-us'">{{ item.group }}</td> -->
+                                        <td v-else-if="currentLang == 'en-us'">{{ item.group }}</td>
                                     </tr>
                                 </table>
                             </i-col>
@@ -148,11 +167,32 @@
                                     </tr>
                                 </table>
                             </i-col>
-                        </Row>
+                        </Row> -->
                     </div>
                     <!--小組模式-->
                     <div v-if="isChangeGroupView == true">
                         <Card class="group-student"
+                            v-for="(group, gIndex) in stuGroup"
+                            :key="gIndex">
+                            <h3 class="group-title" v-if="group.name">
+                                {{ group.name }}
+                            </h3>
+                            <h3 class="group-title" v-else>暂未分组</h3>
+                            <table>
+                                <tr v-for="item in group.info"
+                                    :key="item.no"
+                                >
+                                    <td class="student-no" :class="{ 'my-name': item.id == $store.state.userInfo.sub }">
+                                        {{ item.no }}
+                                    </td>
+                                    <td class="student-name" :class="{ 'my-name': item.id == $store.state.userInfo.sub }">
+                                        {{ item.name }}
+                                        <span v-if="item.id == $store.state.userInfo.sub">{{  currentLang == "en-us" ? "(me)" : "(我)" }}</span>
+                                    </td>
+                                </tr>
+                            </table>
+                        </Card>
+                        <!-- <Card class="group-student"
                             v-for="groupNo in 5"
                             :key="groupNo"
                             :class="{ 'group-studentEn': currentLang == 'en-us' }"
@@ -180,7 +220,7 @@
                                     </td>
                                 </tr>
                             </table>
-                        </Card>
+                        </Card> -->
                     </div>
                 </TabPane>
             </Tabs>
@@ -215,6 +255,7 @@ export default {
                 cn: "星期五"
             }],
             stuList: [],
+            stuGroup: [],
             teacherList: []
         };
     },
@@ -239,7 +280,21 @@ export default {
                 ids: [course.classId]
             }
             this.$api.studentWeb.getClassroomStudent(req).then(res => {
-                this.stuList = res.stus[0]
+                this.stuList = this._.cloneDeep(res.stus[0])
+                for (let i = 0; i < res.stus[0].length; i++) {
+                    this.stuGroup.push({
+                        id: res.stus[0][i].groupId,
+                        name: res.stus[0][i].groupName,
+                        info: [res.stus[0][i]]
+                    })
+                    for (let j = i + 1; j < res.stus[0].length; j++) {
+                        if(res.stus[0][i].groupId == res.stus[0][j].groupId) {
+                            this.stuGroup[i].info.push(res.stus[0][j])
+                            res.stus[0].splice(j,1)
+                            j--
+                        }
+                    }
+                }
             })
         },
         // 查找学生(个人)
@@ -291,6 +346,9 @@ export default {
                             }
                         }
                     }
+                    if(n.roomName == "") {
+                        n.roomName = "暂无教室"
+                    }
                     // 获取学生名单
                     if(n.course.classId != "") {
                         this.findStuInfor(this.courseNow.course)

+ 52 - 34
TEAMModelOS/ClientApp/src/components/student-web/HomeView/CourseList.vue

@@ -76,6 +76,7 @@
 
                             <div class="list-table">
                                 <Table :columns="courseTime"
+                                        border
                                         :data="timeTable"
                                         v-show="currentView == 'table'"
                                         :disabled-hover="true"
@@ -244,29 +245,44 @@ export default {
             onlyStu: true, //是不是学生
             courseTime: [
                 {
-                    title: "time",
+                    title: this.$t("studentWeb.week.time"),
                     slot: "time",
-                    width: "150"
+                    width: "140"
                 },
                 {
-                    title: "Mon",
+                    title: this.$t("studentWeb.week.mon"),
                     slot: "Mon",
+                    width: "115"
                 },
                 {
-                    title: "Tue",
-                    slot: "Tue"
+                    title: this.$t("studentWeb.week.tue"),
+                    slot: "Tue",
+                    width: "115"
                 },
                 {
-                    title: "Wed",
-                    slot: "Wed"
+                    title: this.$t("studentWeb.week.wed"),
+                    slot: "Wed",
+                    width: "115"
                 },
                 {
-                    title: "Thu",
-                    slot: "Thu"
+                    title: this.$t("studentWeb.week.thu"),
+                    slot: "Thu",
+                    width: "115"
                 },
                 {
-                    title: "Fri",
-                    slot: "Fri"
+                    title: this.$t("studentWeb.week.fri"),
+                    slot: "Fri",
+                    width: "115"
+                },
+                {
+                    title: this.$t("studentWeb.week.sat"),
+                    // slot: "Fri",
+                    width: "100"
+                },
+                {
+                    title: this.$t("studentWeb.week.sun"),
+                    // slot: "Fri",
+                    width: "100"
                 }
             ],
             courseList: this.$api.studentWeb.courseList, //moke数据
@@ -313,31 +329,33 @@ export default {
                     var personList = []
                     var list = res.courses
                     for (let i = 0; i < list.length; i++) {
-                        for (let j = 0; j < list[i].course.schedule.length; j++) {
-                            // 有classId,表定课程
-                            if(list[i].course.schedule[j].classId == list[i].stuCourse.classId[0]) {
-                                if(list[i].course.schedule[j].time.length > 0) {
-                                    for (let m = 0; m < list[i].course.schedule[j].time.length; m++) {
-                                        var data = this._.cloneDeep(list[i].course)
-                                        delete data.schedule
-                                        data.school = list[i].stuCourse.school
-                                        data.scope = list[i].stuCourse.scope
-                                        // 拼接得到一个唯一的标识
-                                        data.unique = 'class' + list[i].course.no + list[i].course.schedule[j].time[m].week + list[i].course.schedule[j].time[m].id
-                                        fixList.push(this.getNewClass(data, list[i].course.schedule[j], m))
+                        if(list[i].course) {
+                            for (let j = 0; j < list[i].course.schedule.length; j++) {
+                                // 有classId,表定课程
+                                if(list[i].course.schedule[j].classId == list[i].stuCourse.classId[0]) {
+                                    if(list[i].course.schedule[j].time.length > 0) {
+                                        for (let m = 0; m < list[i].course.schedule[j].time.length; m++) {
+                                            var data = this._.cloneDeep(list[i].course)
+                                            delete data.schedule
+                                            data.school = list[i].stuCourse.school
+                                            data.scope = list[i].stuCourse.scope
+                                            // 拼接得到一个唯一的标识
+                                            data.unique = 'class' + list[i].course.no + list[i].course.schedule[j].time[m].week + list[i].course.schedule[j].time[m].id
+                                            fixList.push(this.getNewClass(data, list[i].course.schedule[j], m))
+                                        }
                                     }
                                 }
-                            }
-                            // 有stulist,临时课程
-                            else if (list[i].course.schedule[j].stulist) {
-                                if(list[i].course.schedule[j].time.length > 0) {
-                                    for (let m = 0; m < list[i].course.schedule[j].time.length; m++) {
-                                        var data = this._.cloneDeep(list[i].course)
-                                        delete data.schedule
-                                        data.school = list[i].stuCourse.school
-                                        data.scope = list[i].stuCourse.scope
-                                        data.unique = 'person' + list[i].course.no + list[i].course.schedule[j].time[m].week + list[i].course.schedule[j].time[m].id
-                                        personList.push(this.getNewClass(data, list[i].course.schedule[j], m))
+                                // 有stulist,临时课程
+                                else if (list[i].course.schedule[j].stulist) {
+                                    if(list[i].course.schedule[j].time.length > 0) {
+                                        for (let m = 0; m < list[i].course.schedule[j].time.length; m++) {
+                                            var data = this._.cloneDeep(list[i].course)
+                                            delete data.schedule
+                                            data.school = list[i].stuCourse.school
+                                            data.scope = list[i].stuCourse.scope
+                                            data.unique = 'person' + list[i].course.no + list[i].course.schedule[j].time[m].week + list[i].course.schedule[j].time[m].id
+                                            personList.push(this.getNewClass(data, list[i].course.schedule[j], m))
+                                        }
                                     }
                                 }
                             }

+ 16 - 1
TEAMModelOS/ClientApp/src/locale/lang/en-US/studentWeb.js

@@ -22,6 +22,19 @@ export default {
         search: 'Please enter the query content...',
         notice: '此功能暂未开放!'
     },
+    type: {
+        home: "首页",
+        activity: "活动",
+        studyview: "自主学习",
+        hiteach: "HiTeach课堂记录",
+        note: "通知",
+        all: "全部",
+        preview: "课前预习",
+        exam: "评测",
+        homework: "作业",
+        vote: "投票",
+        survey: "问卷",
+    },
     state: [
         {
             type: 'all',
@@ -449,7 +462,9 @@ export default {
         syllabus: 'Syllabus overview',
         seatNo: 'seat number',
         name: 'Name',
-        group: 'Group'
+        group: 'Group',
+        no1: "Group",
+        no2: ""
     },
     'calendar-title': 'Calendar-Second semester of 109 school year',
     today: 'Today',

+ 16 - 1
TEAMModelOS/ClientApp/src/locale/lang/zh-CN/studentWeb.js

@@ -22,6 +22,19 @@ export default {
         search: '请输入查询内容...',
         notice: '此功能暂未开放!'
     },
+    type: {
+        home: "首页",
+        activity: "活动",
+        studyview: "自主学习",
+        hiteach: "HiTeach课堂记录",
+        note: "通知",
+        all: "全部",
+        preview: "课前预习",
+        exam: "评测",
+        homework: "作业",
+        vote: "投票",
+        survey: "问卷",
+    },
     state: [
         {
             type: 'all',
@@ -449,7 +462,9 @@ export default {
         syllabus: '课纲概览',
         seatNo: '座号',
         name: '姓名',
-        group: '组别'
+        group: '组别',
+        no1: "第",
+        no2: "组"
     },
     'calendar-title': '行事历 - 109学年度第二学期',
     today: '今天',

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

@@ -22,6 +22,19 @@ export default {
         search: '請輸入查詢內容...',
         notice: '此功能暫未開放!'
     },
+    type: {
+        home: "首頁",
+        activity: "活動",
+        studyview: "自主學習",
+        hiteach: "HiTeach課堂記錄",
+        note: "通知",
+        all: "全部",
+        preview: "課前預習",
+        exam: "評測",
+        homework: "作业",
+        vote: "投票",
+        survey: "問卷",
+    },
     state: [
         {
             type: 'all',
@@ -70,7 +83,7 @@ export default {
         'Habook-smart-school': 'HABOOK智慧學校'
     },
     'homeView-title': '首頁資訊總覽',
-    calenderCardTitle: '行事',
+    calenderCardTitle: '行事',
     recentClass: '近期上課提醒',
     defaultRecentClass: '微處理機基礎與應用概論',
     defaultClassTime: '星期三 13:30 - 16:30 (第7-9節)',
@@ -449,7 +462,9 @@ export default {
         syllabus: '課程要目概覽',
         seatNo: '座號',
         name: '姓名',
-        group: '組別'
+        group: '組別',
+        no1: "第",
+        no2: "組"
     },
     'calendar-title': '行事歷 - 109學年度第二學期',
     today: '今天',

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

@@ -4,11 +4,11 @@
         <div class="myNav">
             <Menu mode="horizontal" :active-name="MyNo" class="menubar">
                 <span @click="clickSidebarToggle()"
-                      v-if="MyNo != '1' && MyNo != 'X'"
-                      class="sidebar-toggle">
+                    v-if="MyNo != '1' && MyNo != 'X'"
+                    class="sidebar-toggle">
                     <Icon class="menu-icon"
-                          type="md-menu"
-                          :class="{'menu-icon-close': this.$store.getters.getSidebarisOpen == false}" />
+                        type="md-menu"
+                        :class="{'menu-icon-close': this.$store.getters.getSidebarisOpen == false}" />
                 </span>
                 <span class="mytitle">{{ MyName }}</span>
                 <!--<span class="pixel">{{ windowWidth }} * {{ windowHeight }} px</span>-->
@@ -43,24 +43,24 @@
                 </span>
                 <!--通知彈窗區域-->
                 <!-- <span class="dropdown"> -->
-                <MenuItem name="6" @click.native="noData" title="通知">
+                <MenuItem name="6" @click.native="noData" :title="$t('studentWeb.type.note')">
                     <span class="info-badge" v-if="MyNo != 6"></span>
-                    <svg-icon icon-class="bell" class="tabIcon1" title="通知" />
+                    <svg-icon icon-class="bell" class="tabIcon1" />
                 </MenuItem>
                 <!-- </span> -->
                 <!-- hiteach课堂记录 -->
-                <MenuItem name="5" @click.native="noData" title="hiteach">
-                    <svg-icon icon-class="hiteach" class="tabIcon4" title="hiteach" />
+                <MenuItem name="5" @click.native="noData" :title="$t('studentWeb.type.hiteach')">
+                    <svg-icon icon-class="hiteach" class="tabIcon4" />
                 </MenuItem>
                 <!-- 自主学习 -->
-                <MenuItem name="3" @click.native="noData" title="自主学习">
-                    <svg-icon icon-class="note" class="tabIcon1" title="自主学习" />
+                <MenuItem name="3" @click.native="noData" :title="$t('studentWeb.type.studyview')">
+                    <svg-icon icon-class="note" class="tabIcon1" />
                 </MenuItem>
-                <MenuItem name="4" to="/studentWeb/eventView" title="活动">
-                    <svg-icon icon-class="selflearning" class="tabIcon2" title="活动" />
+                <MenuItem name="4" to="/studentWeb/eventView" :title="$t('studentWeb.type.activity')">
+                    <svg-icon icon-class="selflearning" class="tabIcon2" />
                 </MenuItem>
-                <MenuItem name="1" to="/studentWeb/homeView" title="首页">
-                    <svg-icon icon-class="home" class="tabIcon3" title="首页" />
+                <MenuItem name="1" to="/studentWeb/homeView" :title="$t('studentWeb.type.home')">
+                    <svg-icon icon-class="home" class="tabIcon3" />
                 </MenuItem>
                 <!-- 加入课程 -->
                 <!-- <button class="addcoursebtn"
@@ -69,11 +69,11 @@
                     {{$t("studentWeb.home.joinClass")}}
                 </button>
                 <input maxlength="6"
-                       class="addcourseinput"
-                       v-model="courseID"
-                       placeholder="輸入課程代碼.... ex:T10000"
-                       value="T"
-                       v-if="MyName == this.$t('studentWeb.courseList-title')" />
+                    class="addcourseinput"
+                    v-model="courseID"
+                    placeholder="輸入課程代碼.... ex:T10000"
+                    value="T"
+                    v-if="MyName == this.$t('studentWeb.courseList-title')" />
                 <div class="clearinput">
                     <Icon @click="clearInput()" v-if="isTyping == true" type="md-close" />
                 </div> -->

+ 86 - 0
TEAMModelOS/Controllers/XTest/FixDataController.cs

@@ -0,0 +1,86 @@
+using Azure.Cosmos;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using Newtonsoft.Json;
+using StackExchange.Redis;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Net;
+using System.Net.Http;
+using System.Net.Http.Json;
+using System.Text;
+using System.Text.Json;
+using System.Threading.Tasks;
+using TEAMModelOS.SDK.DI;
+using TEAMModelOS.SDK.Extension;
+using TEAMModelOS.SDK.Helper.Common.CollectionHelper;
+using TEAMModelOS.SDK.Models;
+using TEAMModelOS.SDK.Models.Cosmos.Common;
+using TEAMModelOS.SDK.Models.Service;
+using TEAMModelOS.Services.Common;
+
+
+namespace TEAMModelOS.Controllers.XTest
+{
+    [Route("fix-data")]
+    [ApiController]
+    public class FixDataController : ControllerBase
+    {
+        private readonly AzureStorageFactory _azureStorage;
+        private readonly AzureRedisFactory _azureRedis;
+        private readonly AzureCosmosFactory _azureCosmos;
+        private readonly DingDing _dingDing;
+        public FixDataController(AzureCosmosFactory azureCosmos, AzureRedisFactory azureRedis, AzureStorageFactory azureStorage, DingDing dingDing)
+        {
+            _azureCosmos = azureCosmos;
+            _azureRedis = azureRedis;
+            _azureStorage = azureStorage;
+            _dingDing = dingDing;
+        }
+        /// <summary>
+        /// 修复blob容器逻辑
+        /// </summary>
+        /// <param name="request"></param>
+        /// <returns></returns>
+        [ProducesDefaultResponseType]
+        //[AuthToken(Roles = "teacher")]
+        [HttpPost("fix-blob-content")]
+        public async Task<IActionResult> FixBlobContent(JsonElement data) {
+            try
+            {
+                var client = _azureCosmos.GetCosmosClient();
+                await FixDataService.FixBlobContent(client, _dingDing, _azureStorage, data);
+                return Ok(new { });
+            }
+            catch (Exception ex)
+            {
+                await _dingDing.SendBotMsg($"TEAMModelFunction,ActivityHttpTrigger,fix-blob-content()\n{ex.Message}{ex.StackTrace}", GroupNames.醍摩豆服務運維群組);
+                return BadRequest();
+            }
+        }
+        /// <summary>
+        /// 修复blob容器逻辑
+        /// </summary>
+        /// <param name="request"></param>
+        /// <returns></returns>
+        [ProducesDefaultResponseType]
+        //[AuthToken(Roles = "teacher")]
+        [HttpPost("fix-student-info")]
+        public async Task<IActionResult> FixStudentInfo(JsonElement data)
+        {
+            try
+            {
+                var client = _azureCosmos.GetCosmosClient();
+                await FixDataService.FixStudentInfo(client, _dingDing, _azureStorage, data);
+                return Ok(new { });
+            }
+            catch (Exception ex)
+            {
+                await _dingDing.SendBotMsg($"TEAMModelFunction,ActivityHttpTrigger,fix-blob-content()\n{ex.Message}{ex.StackTrace}", GroupNames.醍摩豆服務運維群組);
+                return BadRequest();
+            }
+        }
+    }
+}

+ 4 - 2
TEAMModelOS/TEAMModelOS.csproj

@@ -14,6 +14,7 @@
     <PackageReference Include="Caching.CSRedis" Version="3.6.50" />
     <PackageReference Include="CSRedisCore" Version="3.6.5" />
     <PackageReference Include="DotNetZip" Version="1.15.0" />
+    <PackageReference Include="HTEXLib" Version="5.2107.13" />
     <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.6" />
     <PackageReference Include="VueCliMiddleware" Version="5.0.0" />
   </ItemGroup>
@@ -22,7 +23,6 @@
   </ItemGroup>
   <ItemGroup>
     <PackageReference Include="DotNetZip" Version="1.15.0" />
-    <PackageReference Include="HTEXLib" Version="2.5.6" />
     <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="5.0.1" />
     <PackageReference Include="VueCliMiddleware" Version="5.0.0" />
   </ItemGroup>
@@ -46,7 +46,9 @@
     <Version>5.2107.13</Version>
     <AssemblyVersion>5.2107.13.1</AssemblyVersion>
     <FileVersion>5.2107.13.1</FileVersion>
-    <Description>版本号</Description>
+    <Description>1.修复Word导入题目转码失败的html代码。
+2.修复Word导入题目选项不能识别全角的A-Z字符,转为半角。
+3.学生信息增加学段信息。</Description>
     <PackageReleaseNotes>版本说明</PackageReleaseNotes>
   </PropertyGroup>
   <Target Name="DebugEnsureNodeEnv" BeforeTargets="Build">