Browse Source

Merge branch 'develop' of http://52.130.252.100:10000/TEAMMODEL/TEAMModelOS into develop

Li 2 years ago
parent
commit
922f2992ae

+ 1 - 1
TEAMModelOS.FunctionV4/CosmosDB/TriggerExam.cs

@@ -1389,7 +1389,7 @@ namespace TEAMModelOS.FunctionV4
                 }
                 tasks.Add(_azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "Common").ReplaceItemAsync(classResult, classResult.id, new PartitionKey($"{classResult.code}")));
             }
-            await Task.WhenAll(tasks);
+            await tasks.TaskPage(10);
             result.standard = sco > 0 ? Math.Round(stand / sco, 2) : 0;
             result.csRate = csRate;
             result.lostStus = lostStu;

+ 1 - 1
TEAMModelOS/ClientApp/public/lang/en-US.js

@@ -6888,7 +6888,7 @@ const LANG_EN_US = {
         text9: ' unit(s)',
         text10: ' question(s)',
         text11: 'point(s)',
-        text12: 'total ',
+        text12: 'Total ',
         text13: 'No. Of People',
         text14: '',
         gradeYear: '',

+ 4 - 2
TEAMModelOS/ClientApp/src/common/BaseLayout.vue

@@ -13,7 +13,7 @@
     </Header>
     <!-- 侧边菜单栏 -->
     <Sider class="biz-menu" @mouseover.native="mouseOver" @mouseleave.native="mouseLeave" ref="side1" hide-trigger collapsible width="190" :collapsed-width="78" v-model="isCollapsed">
-      <div class="system-level-wrap" v-show="$store.state.userInfo.hasSchool">
+      <div class="system-level-wrap" v-show="$store.state.userInfo.hasSchool && !isGlobalSite">
         <p class="system-level">{{systemLevel}}</p>
       </div>
       <Menu style="margin-top:0px" width="auto" :class="['menu-item', isCollapsed ? 'collapsed-menu' : '']" accordion :active-name="activeName" :open-names="openNames">
@@ -291,8 +291,10 @@ export default {
     //   console.error('isShowArtMenu', schoolProfile.schoolShows)
     //   return (!!schoolArt && this.IES5Menu && this.$store.state.config.srvAdr == 'China') || this.$store.state.config.srvAdrType === 'test'
     // },
+    // 是否有查看学生看板权限
     hasDashAuth() {
-      return window.location.host.includes('test.teammodel') || ['habook', 'ydzt', 'cdydzt', 'hbcn'].includes(this.$store.state.userInfo.schoolCode)
+      let authSchArr = ['habook', 'ydzt', 'cdydzt', 'hbcn', 'xajkbx', 'xcfx', 'pclxxx', 'xcsyxx']
+      return window.location.host.includes('test.teammodel') || authSchArr.includes(this.$store.state.userInfo.schoolCode)
     },
     isGlobalSite() {
       return this.$store.state.config.srvAdr !== 'China'

+ 7 - 6
TEAMModelOS/ClientApp/src/view/evaluation/bank/index.vue

@@ -247,12 +247,13 @@ export default {
       return localStorage.getItem('location') === 'Global'
     },
     hasXkwAuth() {
-      if (localStorage.school_profile) {
-        let schoolProfile = JSON.parse(decodeURIComponent(localStorage.school_profile, "utf-8"))
-        return schoolProfile.schoolShows && schoolProfile.schoolShows.find(i => i.type === 'xkw')
-      } else {
-        return false
-      }
+      // if (localStorage.school_profile) {
+      //   let schoolProfile = JSON.parse(decodeURIComponent(localStorage.school_profile, "utf-8"))
+      //   return schoolProfile.schoolShows && schoolProfile.schoolShows.find(i => i.type === 'xkw')
+      // } else {
+      //   return false
+      // }
+      return true
     },
     isTestSite() {
       return window.location.host.includes('test.teammodel.cn')

+ 9 - 6
TEAMModelOS/ClientApp/src/view/homepage/HomePage.vue

@@ -498,7 +498,7 @@ export default {
     },
     //查询近期课堂记录
     getRecordList() {
-      let listType = 'school'
+      // let listType = 'school'
       let params = {
         "tmdid": this.$store.state.userInfo.TEAMModelId,
         "school": this.$store.state.userInfo.schoolCode,
@@ -512,17 +512,20 @@ export default {
           let schoolSasInfo = {}
           let sBlobInfo = this.$store.state.user.schoolProfile
           schoolSasInfo.sas = '?' + sBlobInfo.blob_sas
-          schoolSasInfo.name = listType === 'school' ? this.$store.state.userInfo.schoolCode : this.$store.state.userInfo.TEAMModelId
-          schoolSasInfo.url = sBlobInfo.blob_uri.slice(0, sBlobInfo.blob_uri.lastIndexOf(schoolSasInfo.name) - 1)
+          // schoolSasInfo.name = listType === 'school' ? this.$store.state.userInfo.schoolCode : this.$store.state.userInfo.TEAMModelId
+          // schoolSasInfo.url = sBlobInfo.blob_uri.slice(0, sBlobInfo.blob_uri.lastIndexOf(schoolSasInfo.name) - 1)
+          schoolSasInfo.url = sBlobInfo.blob_uri
 
           let privateSasInfo = {}
           let pBlobInfo = this.$store.state.user.userProfile
           privateSasInfo.sas = '?' + pBlobInfo.blob_sas
-          privateSasInfo.name = listType === 'school' ? this.$store.state.userInfo.schoolCode : this.$store.state.userInfo.TEAMModelId
-          privateSasInfo.url = pBlobInfo.blob_uri.slice(0, pBlobInfo.blob_uri.lastIndexOf(privateSasInfo.name) - 1)
+          // privateSasInfo.name = listType === 'school' ? this.$store.state.userInfo.schoolCode : this.$store.state.userInfo.TEAMModelId
+          // privateSasInfo.url = pBlobInfo.blob_uri.slice(0, pBlobInfo.blob_uri.lastIndexOf(privateSasInfo.name) - 1)
+          privateSasInfo.url = pBlobInfo.blob_uri
           this.recentRcdList.forEach(item => {
             let sasInfo = item.scope == 'school' ? schoolSasInfo : privateSasInfo
-            item.poster = `${sasInfo.url}/${sasInfo.name}/records/${item.id}/Record/CoverImage.jpg${sasInfo.sas}`
+            // item.poster = `${sasInfo.url}/${sasInfo.name}/records/${item.id}/Record/CoverImage.jpg${sasInfo.sas}`
+            item.poster = `${sasInfo.url}/records/${item.id}/Record/CoverImage.jpg${sasInfo.sas}`
           })
           this.recentRcdList.sort((a, b) => {
             return b.startTime - a.startTime

+ 2 - 2
TEAMModelOS/ClientApp/src/view/student-account/stuMgt/StuMgt.vue

@@ -883,9 +883,9 @@ export default {
 
             // 帳號資訊搜尋
             if (this.searchText) {
-                let text = this.searchText
+                let text = this.searchText.toLowerCase()
                 data = data.filter((item) => {
-                    return (item.name.indexOf(text) >= 0 || item.id.indexOf(text) >= 0) && item.periodId == this.searchPeriod
+                    return (item.name?.toLowerCase().indexOf(text) >= 0 || item.id.indexOf(text) >= 0) && item.periodId == this.searchPeriod
                 })
             }
 

+ 14 - 11
TEAMModelOS/ClientApp/src/view/student-account/stulist/MgtStuList.vue

@@ -161,8 +161,8 @@ export default {
             callback()
         }
         return {
-            expList:[], //当前过期状态的列表
-            isExpired:false,
+            expList: [], //当前过期状态的列表
+            isExpired: false,
             curTimestamp: 0,
             echoDate: undefined,
             setType: '',
@@ -259,16 +259,16 @@ export default {
         }
     },
     methods: {
-        closeSearch(){
+        closeSearch() {
             this.isSearch = false
             this.keyWord = ''
             this.filterStuLilst()
         },
-        hanldeFilterExp(){
-            if(this.isExpired){
-                this.expList = this.stuList.filter(item=>item.expire && this.curTimestamp > item.expire)
-            }else{
-                this.expList = this.stuList.filter(item=>!(item.expire && this.curTimestamp > item.expire))
+        hanldeFilterExp() {
+            if (this.isExpired) {
+                this.expList = this.stuList.filter(item => item.expire && this.curTimestamp > item.expire)
+            } else {
+                this.expList = this.stuList.filter(item => !(item.expire && this.curTimestamp > item.expire))
             }
             this.filterStuLilst()
         },
@@ -455,7 +455,7 @@ export default {
                 }).then(
                     res => {
                         if (res.groupList) {
-                            let orgIndex = this.stuList.findIndex(item=>item.id === this.stuListShow[this.curIndex].id)
+                            let orgIndex = this.stuList.findIndex(item => item.id === this.stuListShow[this.curIndex].id)
                             this.stuList.splice(orgIndex, 1, res.groupList)
                             this.stuListShow.splice(this.curIndex, 1, res.groupList)
                             if (res.groupList.members) {
@@ -631,13 +631,16 @@ export default {
                             expire: 0
                         }
                         this.setType = ''
-                        this.selectList(0)
+                        // this.selectList(0)
                     } else {
-                        this.stuList.splice(this.curIndex, 1, params)
+                        let listid = this.stuListShow[this.curIndex].id
+                        let orgIndex = this.stuList.findIndex(item => item.id === listid)
+                        this.stuList.splice(orgIndex, 1, params)
                     }
                     this.hanldeFilterExp()
                     this.rmSelctions = []
                     this.$refs['studentList'].clearTable()
+                    if (isPush) this.selectList(0)
                 },
                 err => {
                     this.modalLoading = false

+ 2 - 2
TEAMModelOS/ClientApp/src/view/teachermgmt/components/mgt/TeacherMgt.vue

@@ -712,8 +712,8 @@ export default {
             }
             // 关键字搜索
             if (this.filters.keyword) {
-                let k = this.filters.keyword
-                filterData = filterData.filter(item => item.name?.includes(k) || item.id?.includes(k) || item.iname?.includes(k))
+                let k = this.filters.keyword.toLowerCase()
+                filterData = filterData.filter(item => item.name?.toLowerCase().includes(k) || item.id?.includes(k) || item.iname?.toLowerCase().includes(k))
             }
             return filterData
         },

+ 12 - 1
TEAMModelOS/Controllers/Client/HiTeachController.cs

@@ -81,6 +81,7 @@ namespace TEAMModelOS.Controllers.Client
         /// </summary>
         /// <param name="request"></param>
         /// <returns></returns>
+        [Authorize(Roles = "HiTeach")]
         [ProducesDefaultResponseType]
         [HttpPost("update-lesson-record")]
         public async Task<IActionResult> UpdateLessonRecord(JsonElement request)
@@ -151,7 +152,7 @@ namespace TEAMModelOS.Controllers.Client
         /// </summary>
         /// <param name="request"></param>
         /// <returns></returns>
-        //[Authorize(Roles = "HiTeach")]
+        [Authorize(Roles = "HiTeach")]
         [ProducesDefaultResponseType]
         [HttpPost("create-lesson")]
         public async Task<IActionResult> CreateLesson(CreateLessondRequest request)
@@ -286,6 +287,7 @@ namespace TEAMModelOS.Controllers.Client
         /// </summary>
         /// <param name="request"></param>
         /// <returns></returns>
+        [Authorize(Roles = "HiTeach")]
         [ProducesDefaultResponseType]
         [HttpPost("create-lesson-record")]
         public async Task<IActionResult> CreateLessonRecord(JsonElement request)
@@ -380,6 +382,7 @@ namespace TEAMModelOS.Controllers.Client
             }
         }
 
+        [Authorize(Roles = "HiTeach")]
         [ProducesDefaultResponseType]
         [HttpPost("get-teacher-info")]
         public async Task<IActionResult> GetTeacherInfo()
@@ -624,6 +627,7 @@ namespace TEAMModelOS.Controllers.Client
             }
         }
 
+        [Authorize(Roles = "HiTeach")]
         [ProducesDefaultResponseType]
         [HttpPost("get-school-info")]
         public async Task<IActionResult> GetSchoolInfo(JsonElement request)
@@ -938,6 +942,7 @@ namespace TEAMModelOS.Controllers.Client
         }
 
         //取得試卷
+        [Authorize(Roles = "HiTeach")]
         [ProducesDefaultResponseType]
         [HttpPost("get-paper")]
         public async Task<IActionResult> GetPaperList(JsonElement request)
@@ -1070,6 +1075,7 @@ namespace TEAMModelOS.Controllers.Client
         }
 
         //取得試題
+        [Authorize(Roles = "HiTeach")]
         [ProducesDefaultResponseType]
         [HttpPost("get-item")]
         public async Task<IActionResult> GetItemList(JsonElement request)
@@ -1214,6 +1220,7 @@ namespace TEAMModelOS.Controllers.Client
         }
 
         //取得知識點
+        [Authorize(Roles = "HiTeach")]
         [ProducesDefaultResponseType]
         [HttpPost("get-knowledge")]
         public async Task<IActionResult> GetKnowledgePointList(JsonElement request)
@@ -1238,6 +1245,7 @@ namespace TEAMModelOS.Controllers.Client
         }
 
         //取得課綱
+        [Authorize(Roles = "HiTeach")]
         [ProducesDefaultResponseType]
         [HttpPost("get-syllabus")]
         public async Task<IActionResult> GetSyllabusList(JsonElement request)
@@ -1445,6 +1453,7 @@ namespace TEAMModelOS.Controllers.Client
         }
 
         //取得某班級的學生成員
+        [Authorize(Roles = "HiTeach")]
         [ProducesDefaultResponseType]
         [HttpPost("get-students-list")]
         public async Task<IActionResult> GetStudentsList(JsonElement request)
@@ -1486,6 +1495,7 @@ namespace TEAMModelOS.Controllers.Client
         /// </summary>
         /// <param name="request"></param>
         /// <returns></returns>
+        [Authorize(Roles = "HiTeach")]
         [ProducesDefaultResponseType]
         [HttpPost("start-lesson")]
         public async Task<IActionResult> StartLesson(JsonElement request)
@@ -1510,6 +1520,7 @@ namespace TEAMModelOS.Controllers.Client
         //上傳評測結果
         //錯誤代碼:error = 1001 message = "Paper blob copy failure."
         //          error = 1002 message = "Student answers blob upload failure."
+        [Authorize(Roles = "HiTeach")]
         [ProducesDefaultResponseType]
         [HttpPost("upd-exam-result")]
         public async Task<IActionResult> UploadExamResult(JsonElement request)

+ 4 - 0
TEAMModelOS/Controllers/Client/HiTeachccControlller.cs

@@ -74,6 +74,7 @@ namespace TEAMModelOS.Controllers.Client
         /// </summary>
         /// <param name="request"></param>
         /// <returns></returns>
+        [Authorize(Roles = "HiTeachCC")]
         [HttpPost("create-lesson")]
         [ProducesResponseType(StatusCodes.Status200OK)]
         [ProducesResponseType(StatusCodes.Status400BadRequest)]
@@ -276,6 +277,7 @@ namespace TEAMModelOS.Controllers.Client
         /// </summary>
         /// <param name="request"></param>
         /// <returns></returns>
+        [Authorize(Roles = "HiTeachCC")]
         [ProducesDefaultResponseType]
         [HttpPost("update-lesson-record")]
         public async Task<IActionResult> UpdateLessonRecord(JsonElement request)
@@ -342,6 +344,7 @@ namespace TEAMModelOS.Controllers.Client
         }
 
         //取得老師資訊
+        [Authorize(Roles = "HiTeachCC")]
         [ProducesResponseType(StatusCodes.Status200OK)]
         [ProducesResponseType(StatusCodes.Status400BadRequest)]
         [ProducesDefaultResponseType]
@@ -371,6 +374,7 @@ namespace TEAMModelOS.Controllers.Client
         }
 
         //刪除Blob下Temp資料夾
+        [Authorize(Roles = "HiTeachCC")]
         [ProducesResponseType(StatusCodes.Status200OK)]
         [ProducesResponseType(StatusCodes.Status400BadRequest)]
         [ProducesDefaultResponseType]

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

@@ -754,7 +754,7 @@ namespace TEAMModelOS.Controllers.Common
             }
             catch (Exception e)
             {
-                await _dingDing.SendBotMsg($"OS,{_option.Location},art/FindSummary()\n{e.Message}\n{e.StackTrace}\n", GroupNames.醍摩豆服務運維群組);
+                await _dingDing.SendBotMsg($"OS,{_option.Location},art/find-summary-by-student()\n{e.Message}\n{e.StackTrace}\n", GroupNames.醍摩豆服務運維群組);
                 return Ok(new { code = 500 });
             }
 
@@ -796,7 +796,7 @@ namespace TEAMModelOS.Controllers.Common
             }
             catch (Exception e)
             {
-                await _dingDing.SendBotMsg($"OS,{_option.Location},art/FindSummary()\n{e.Message}\n{e.StackTrace}\n", GroupNames.醍摩豆服務運維群組);
+                await _dingDing.SendBotMsg($"OS,{_option.Location},art/find-summary-by-work()\n{e.Message}\n{e.StackTrace}\n", GroupNames.醍摩豆服務運維群組);
                 return Ok(new { code = 500 });
             }
 

+ 1 - 1
TEAMModelOS/Controllers/Common/StudyController.cs

@@ -862,7 +862,7 @@ namespace TEAMModelOS.Controllers.Common
                                                         <td> 扫码签到、作业提交、问卷反馈、评测活动 </td>
                                                         <td> 已完成 </td >
                                                     </tr> ");
-                GlobalSettings globalSettings = new GlobalSettings();
+                GlobalSettings globalSettings = new();
                 globalSettings.ColorMode = ColorMode.Color;
                 globalSettings.Orientation = Orientation.Portrait;
                 globalSettings.PaperSize = PaperKind.A4;