소스 검색

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

黄贺彬 2 년 전
부모
커밋
8b28e94ce8

+ 5 - 29
TEAMModelOS.FunctionV4/CosmosDB/TriggerArt.cs

@@ -243,7 +243,7 @@ namespace TEAMModelOS.FunctionV4.CosmosDB
                             {
                                 if (art.owner.Equals("area") && string.IsNullOrEmpty(art.pId))
                                 {
-                                    List<(string id, string code, List<Tasks> settings)> artSchools = new();
+                                   /* List<(string id, string code, List<Tasks> settings)> artSchools = new();
                                     string ql = $"select c.id,c.school,c.settings,c.classes from c where  c.pk = 'Art' and c.pId = '{art.id}'";
                                     await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIterator(queryText: ql))
                                     {
@@ -291,13 +291,13 @@ namespace TEAMModelOS.FunctionV4.CosmosDB
 
                                     }
                                     art.pass = 1;
-                                    await client.GetContainer(Constant.TEAMModelOS, "Common").ReplaceItemAsync<ArtEvaluation>(art, art.id, new PartitionKey(art.code));
+                                    await client.GetContainer(Constant.TEAMModelOS, "Common").ReplaceItemAsync<ArtEvaluation>(art, art.id, new PartitionKey(art.code));*/
                                 }
                                 else
                                 {
                                     //获取当前艺术评价相关评测ID目前暂时排除区级发布的评测信息
 
-                                    List<(string eId, string sId)> ids = new();
+                                    /*List<(string eId, string sId)> ids = new();
                                     var examId = art.settings.SelectMany(x => x.task).Where(c => c.type == 1).Select(z => new { z.acId, z.subject }).ToList();
                                     examId.ForEach(x =>
                                     {
@@ -326,7 +326,7 @@ namespace TEAMModelOS.FunctionV4.CosmosDB
                                     art.miss.Add(stus.Count);
                                     //art.miss = stus.Count;
                                     art.pass = 1;
-                                    await client.GetContainer(Constant.TEAMModelOS, "Common").ReplaceItemAsync<ArtEvaluation>(art, art.id, new PartitionKey(art.code));
+                                    await client.GetContainer(Constant.TEAMModelOS, "Common").ReplaceItemAsync<ArtEvaluation>(art, art.id, new PartitionKey(art.code));*/
                                 }
                             }
                             List<StudentArtResult> studentArtResults = new();
@@ -362,30 +362,6 @@ namespace TEAMModelOS.FunctionV4.CosmosDB
             }
 
         }
-        public static async Task<List<(string code, string subject, List<string> stus)>> getLostAsync(List<(string eId, string sId)> examIds, CosmosClient client, string code)
-        {
-            List<(string code, string sub, List<string> stu)> stuInfo = new();
-            if (examIds.Any())
-            {
-                string examSql = $"select c.id,c.school,c.lostStu from c where c.id in ({string.Join(",", examIds.Select(o => $"'{o.eId}'"))})";
-                await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIterator(queryText: examSql, requestOptions: new QueryRequestOptions { PartitionKey = new PartitionKey($"Exam-{code}") }))
-                {
-                    using var json = await JsonDocument.ParseAsync(item.ContentStream);
-                    if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
-                    {
-                        var accounts = json.RootElement.GetProperty("Documents").EnumerateArray();
-                        while (accounts.MoveNext())
-                        {
-                            JsonElement account = accounts.Current;
-                            List<string> lostStu = account.GetProperty("lostStu").ToObject<List<string>>();
-                            string id = account.GetProperty("id").GetString();
-                            string sub = examIds.Where(c => c.eId.Equals(id)).FirstOrDefault().sId;
-                            stuInfo.Add((account.GetProperty("school").GetString(), sub, lostStu));
-                        }
-                    }
-                }
-            }
-            return stuInfo;
-        }
+        
     }
 }

+ 29 - 29
TEAMModelOS/ClientApp/src/common/BaseLayout.vue

@@ -41,7 +41,7 @@
                   <Icon v-show="!isCollapsed" class="sub-menu-icon" :custom="menuItem.icon" size="16" />
                   <span>
                     {{menuItem.name}}
-                    <Tooltip v-if="menuItem.info" :content="menuItem.info" transfer theme="light" max-width="180">
+                    <Tooltip v-if="menuItem.info" transfer-class-name="menu-tooltips" :content="menuItem.info" transfer theme="light" max-width="180">
                       <Icon type="ios-information-circle-outline" color="#1cc0f3" />
                     </Tooltip>
                     <span style="margin-left: 2px;font-size: 12px;vertical-align: text-top;color:#ff7c00">
@@ -126,7 +126,7 @@
 <script>
 import { mapGetters } from 'vuex'
 export default {
-  data () {
+  data() {
     return {
       edition: '',
       isPro: false,// 是否为专业版
@@ -153,22 +153,22 @@ export default {
     }
   },
   methods: {
-    mouseOver () {
+    mouseOver() {
       if (!this.isLock) this.isCollapsed = false
     },
-    mouseLeave () {
+    mouseLeave() {
       if (!this.isLock) this.isCollapsed = true
     },
-    initMenu () {
+    initMenu() {
       //判断当前学校是否购买服务 暂未提供字段
       // this.schoolMenu = 
       // this.teacherMenu = 
     },
-    changeMenuStatus () {
+    changeMenuStatus() {
       this.$refs.side1.toggleCollapse()
       this.$EventBus.$emit('onCollapseChange', this.isCollapsed)
     },
-    getSystemLevel () {
+    getSystemLevel() {
       if (this.$store.state.userInfo.hasSchool) {
         // let prodInfo = this.$store.state.user?.schoolProfile?.svcStatus || {}
         // console.log(this.$store.state.user, '版本')
@@ -232,19 +232,19 @@ export default {
         this.hasAnalysisAuth = this.getAnalysisAuth()
       }
     },
-    getAnalysisAuth () {
+    getAnalysisAuth() {
       const proInfo = this.$store.state.user?.schoolProfile?.svcStatus || null
       console.log(proInfo)
       return proInfo && proInfo.YMPCVCIM
     },
     //获取快速登录的code
-    getLoginCode () {
+    getLoginCode() {
       this.isLoading = true
       let idToken = localStorage.getItem('id_token')
       return this.$api.login.getCode(idToken)
     },
     //教师个人跳转苏格拉底
-    toPrivSokrate () {
+    toPrivSokrate() {
       this.getLoginCode().then(
         res => {
           this.loginCode = res.code
@@ -256,7 +256,7 @@ export default {
       })
     },
     //教师个人跳转苏格拉底
-    toSchoolSokrate () {
+    toSchoolSokrate() {
       this.getLoginCode().then(
         res => {
           this.loginCode = res.code
@@ -267,7 +267,7 @@ export default {
         this.isLoading = false
       })
     },
-    menuClick (menu) {
+    menuClick(menu) {
       if (menu.router == '#') {
         if (menu.to === 'privSokrate') {
           this.toPrivSokrate()
@@ -277,7 +277,7 @@ export default {
       }
     },
     /* 刷新艺术评测授权 */
-    refreshArtAuth () {
+    refreshArtAuth() {
       let schoolCode = this.$store.state.userInfo.schoolCode
       let schoolProfile = JSON.parse(decodeURIComponent(localStorage.school_profile || '{}', "utf-8"))
       let schoolArt = schoolProfile.schoolShows?.find(item => item.code == schoolCode && item.status === 1 && item.type === 'art')
@@ -285,12 +285,12 @@ export default {
       //this.schoolVersion()
     },
     /* 切换学校回调 */
-    onSchoolChange (val) {
+    onSchoolChange(val) {
       this.refreshArtAuth()
       this.getSystemLevel()
     },
     //判断学校版本是否过期
-    schoolVersion () {
+    schoolVersion() {
       // let nowEdition = this.$store.state.user?.schoolProfile?.school_base
       // this.versionsPast = nowEdition.edition.record !== nowEdition.edition.current ? false : true
     }
@@ -300,10 +300,10 @@ export default {
       isHeadmaster: 'isHeadmaster',
       curSiteConfig: 'config/getCurSiteConfig',
     }),
-    rotateIcon () {
+    rotateIcon() {
       return ["collapse-icon", this.isCollapsed ? "rotate-icon" : ""]
     },
-    schoolStatusInfo () {
+    schoolStatusInfo() {
       if (this.isCollapsed) {
         return ''
       } else {
@@ -323,7 +323,7 @@ export default {
         }
       }
     },
-    IES5Menu () {
+    IES5Menu() {
       return !this.$jsFn.checkJinNiu() && !this.$jsFn.checkTrain()
     },
     // isShowArtMenu() {
@@ -334,24 +334,24 @@ export default {
     //   return (!!schoolArt && this.IES5Menu && this.$store.state.config.srvAdr == 'China') || this.$store.state.config.srvAdrType === 'test'
     // },
     // 是否有查看学生看板权限
-    hasDashAuth () {
+    hasDashAuth() {
       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 () {
+    isGlobalSite() {
       return this.$store.state.config.srvAdr !== 'China'
     },
     /* 是否开启课堂记录管理开关 */
-    isOpenLessonRecord () {
+    isOpenLessonRecord() {
       return this.$store.state.user.schoolProfile.school_base?.openLessonRecord
     },
-    jinniuMenu () {
+    jinniuMenu() {
       return this.$jsFn.checkJinNiu()
     },
-    trainMenu () {
+    trainMenu() {
       return this.$jsFn.checkTrain()
     },
-    schoolMenu () {
+    schoolMenu() {
       let data = !this.$store.state.userInfo.schoolPay ? [
         //数据看板
         {
@@ -807,7 +807,7 @@ export default {
       ] : []
       return data
     },
-    teacherMenu () {
+    teacherMenu() {
       let data = [
 
         // 我的课程
@@ -1078,7 +1078,7 @@ export default {
     }
 
   },
-  created () {
+  created() {
     let cloudSetting = localStorage.getItem('cloudSetting')
     if (cloudSetting) {
       cloudSetting = JSON.parse(cloudSetting)
@@ -1089,7 +1089,7 @@ export default {
       this.isShowLogo = cloudSetting.logoStatus === 'open'
     }
   },
-  mounted () {
+  mounted() {
     this.refreshArtAuth()
     this.$EventBus.$off('onLogoStatusChange')
     this.$EventBus.$on('onLogoStatusChange', val => {
@@ -1099,7 +1099,7 @@ export default {
   },
   watch: {
     $route: {
-      handler (val, oldval) {
+      handler(val, oldval) {
         this.getSystemLevel()
         let metaName = val.meta.activeName
         this.activeName = metaName
@@ -1134,7 +1134,7 @@ export default {
     },
     '$i18n.locale': {
       immediate: true,
-      handler (n, o) {
+      handler(n, o) {
         this.getSystemLevel()
       }
     }

+ 6 - 0
TEAMModelOS/ClientApp/src/components/evaluation/AnalysisItemTable.vue

@@ -138,3 +138,9 @@ export default {
 
 }
 </script>
+
+<style lang="less">
+.ivu-table-cell {
+  word-break: break-word;
+}
+</style>

+ 98 - 95
TEAMModelOS/ClientApp/src/components/evaluation/OptionsTable.vue

@@ -1,106 +1,109 @@
 <template>
-	<div class="analysis-table">
-		<!-- 表格组件 -->
-		<Table border ref="table" :data="optionsData" :columns="optionColumns"></Table>
+  <div class="analysis-table">
+    <!-- 表格组件 -->
+    <Table border ref="table" :data="optionsData" :columns="optionColumns"></Table>
 
-
-
-	</div>
+  </div>
 </template>
 <script>
-	export default {
-		props: {
-			optionRate: {
-				type: Object,
-				default: () => {}
-			},
-			options: {
-				type: Array,
-				default: () => []
-			},
-			answer:{
-				type: Array,
-				default: () => []
-			}
+export default {
+  props: {
+    optionRate: {
+      type: Object,
+      default: () => { }
+    },
+    options: {
+      type: Array,
+      default: () => []
+    },
+    answer: {
+      type: Array,
+      default: () => []
+    }
 
-		},
-		data(vm) {
-			return {
-				optionsData: [],
-				optionColumns: [{
-						title: vm.$t('totalAnalysis.myTable.option'),
-						key: 'option',
-						align: 'center',
-						width: 70
-					},
-					{
-						title: vm.$t('totalAnalysis.myTable.answerCount'),
-						key: 'num',
-						align: 'center',
-						width: 200
-					},
-					{
-						title: vm.$t('totalAnalysis.myTable.answerRate'),
-						key: 'rate',
-						align: 'center',
-						render: (h, params) => {
-							return h('div', [
-								h('Progress', {
-									props: {
-										percent: +params.row.rate.replace('%',''),
-										strokeColor: params.row.isTrue ? '#14db14' : '#b5bcbe'
-									}
-								})
-							])
-						}
-					},
-					{
-						title: vm.$t('totalAnalysis.myTable.RHRate'),
-						align: 'center',
-						key: 'PH',
-						width:180
-					},
-					{
-						title: vm.$t('totalAnalysis.myTable.RLRate'),
-						align: 'center',
-						key: 'PL',
-						width:180
-					}
-				],
-			}
-		},
-		created() {
+  },
+  data(vm) {
+    return {
+      optionsData: [],
+      optionColumns: [{
+        title: vm.$t('totalAnalysis.myTable.option'),
+        key: 'option',
+        align: 'center',
+        width: 100
+      },
+      {
+        title: vm.$t('totalAnalysis.myTable.answerCount'),
+        key: 'num',
+        align: 'center',
+        width: 200
+      },
+      {
+        title: vm.$t('totalAnalysis.myTable.answerRate'),
+        key: 'rate',
+        align: 'center',
+        render: (h, params) => {
+          return h('div', [
+            h('Progress', {
+              props: {
+                percent: +params.row.rate.replace('%', ''),
+                strokeColor: params.row.isTrue ? '#14db14' : '#b5bcbe'
+              }
+            })
+          ])
+        }
+      },
+      {
+        title: vm.$t('totalAnalysis.myTable.RHRate'),
+        align: 'center',
+        key: 'PH',
+        width: 180
+      },
+      {
+        title: vm.$t('totalAnalysis.myTable.RLRate'),
+        align: 'center',
+        key: 'PL',
+        width: 180
+      }
+      ],
+    }
+  },
+  created() {
 
-		},
-		methods: {
+  },
+  methods: {
 
 
-		},
-		watch: {
-			optionRate: {
-				handler(n, o) {
-					if (Object.keys(n).length) {
-						let total = this.$store.state.totalAnalysis.analysisJson.all.total // 取总人数
-						let phCount = Math.floor(total * 0.27) //取高分组人数
-						this.options.forEach(key => {
-							this.optionsData.push({
-								option: key,
-								isTrue: this.answer[0].includes(key) ,
-								num: n.record[key] || 0,
-								rate: n.record[key] ? Number((n.record[key] / total) * 100).toFixed(1) +
-									'%' : '0',
-								PH: n.ph[key] ? Number((n.ph[key] / phCount) * 100).toFixed(1) + '%' : 0,
-								PL: n.pl[key] ? Number((n.pl[key] / phCount) * 100).toFixed(1) + '%' : 0,
-							})
-						})
-						console.log(this.optionsData)
-					}
-				},
-				immediate: true,
-				deep: true
-			},
+  },
+  watch: {
+    optionRate: {
+      handler(n, o) {
+        if (Object.keys(n).length) {
+          let total = this.$store.state.totalAnalysis.analysisJson.all.total // 取总人数
+          let phCount = Math.floor(total * 0.27) //取高分组人数
+          this.options.forEach(key => {
+            this.optionsData.push({
+              option: key,
+              isTrue: this.answer[0].includes(key),
+              num: n.record[key] || 0,
+              rate: n.record[key] ? Number((n.record[key] / total) * 100).toFixed(1) +
+                '%' : '0',
+              PH: n.ph[key] ? Number((n.ph[key] / phCount) * 100).toFixed(1) + '%' : 0,
+              PL: n.pl[key] ? Number((n.pl[key] / phCount) * 100).toFixed(1) + '%' : 0,
+            })
+          })
+          console.log(this.optionsData)
+        }
+      },
+      immediate: true,
+      deep: true
+    },
 
-		}
+  }
 
-	}
+}
 </script>
+<style lang="less">
+.ivu-table-cell {
+  word-break: break-word;
+}
+</style>

+ 1 - 13
TEAMModelOS/ClientApp/src/view/student-analysis/total-analysis/index.vue

@@ -146,25 +146,13 @@ export default {
     if (!this.$store.state.totalAnalysis.analysisJson) {
       this.$router.push('/totalIndex')
     }
-    // if (!this.$store.state.totalAnalysis.analysisJson && !localStorage.getItem('curExam')) {
-    // 	this.$store.dispatch('getAnalysisJson', {
-    // 		code: this.$route.query.code,
-    // 		id: this.$route.query.id
-    // 	}).then(res => {
-    // 		console.log('index页面获取JSON')
-    // 	})
-    // }
-
   },
 
   methods: {
     /* 获取当前评测的平均分 */
     getTotalAverage(data) {
       let analysisJson = this.$store.state.totalAnalysis.analysisJson
-      let totalScore = analysisJson.students.reduce(function (total, currentValue, currentIndex, arr) {
-        return total + currentValue.total;
-      }, 0);
-      this.totalAverage = (totalScore / analysisJson.students.length).toFixed(1)
+      this.totalAverage = analysisJson.all.average
     },
 
     onClassSelect(val) {

+ 63 - 0
TEAMModelOS/Controllers/Common/ArtController.cs

@@ -712,6 +712,43 @@ namespace TEAMModelOS.Controllers.Common
                 if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 ArtEvaluation art = await client.GetContainer(Constant.TEAMModelOS, "Common").ReadItemAsync<ArtEvaluation>(id.GetString(), new PartitionKey($"Art-{code}"));
+
+                if (art.owner.Equals("area") && string.IsNullOrEmpty(art.pId))
+                {
+
+                }
+                else {
+                    List<(string eId, string sId)> ids = new();
+                    var examId = art.settings.SelectMany(x => x.task).Where(c => c.type == 1).Select(z => new { z.acId, z.subject }).ToList();
+                    examId.ForEach(x =>
+                    {
+                        ids.Add((x.acId, x.subject));
+                    });
+                    List<(string scode, string sub, List<string> stu)> stuInfo = await getLostAsync(ids, client, art.school);
+                    List<string> stus = new();
+                    foreach (var (scode, sub, stu) in stuInfo)
+                    {
+                        if (stus.Count == 0)
+                        {
+                            stus = stus.Union(stu).ToList();
+                        }
+                        else
+                        {
+                            stus = stus.Intersect(stu).ToList();
+                        }
+                        LostStudent lostStudent = new()
+                        {
+                            code = scode,
+                            subject = sub,
+                            stu = stu.Count
+                        };
+                        art.lost.Add(lostStudent);
+                    }
+                    art.miss.Add(stus.Count);
+                }
+                //art.miss = stus.Count;
+                //art.pass = 1;
+                //await client.GetContainer(Constant.TEAMModelOS, "Common").ReplaceItemAsync<ArtEvaluation>(art, art.id, new PartitionKey(art.code));
                 ArtMusic music = new();
                 ArtExam ae = new();
                 if (art != null)
@@ -850,6 +887,32 @@ namespace TEAMModelOS.Controllers.Common
 
         }
 
+        public static async Task<List<(string code, string subject, List<string> stus)>> getLostAsync(List<(string eId, string sId)> examIds, CosmosClient client, string code)
+        {
+            List<(string code, string sub, List<string> stu)> stuInfo = new();
+            if (examIds.Any())
+            {
+                string examSql = $"select c.id,c.school,c.lostStu from c where c.id in ({string.Join(",", examIds.Select(o => $"'{o.eId}'"))})";
+                await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIterator(queryText: examSql, requestOptions: new QueryRequestOptions { PartitionKey = new PartitionKey($"Exam-{code}") }))
+                {
+                    using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                    if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
+                    {
+                        var accounts = json.RootElement.GetProperty("Documents").EnumerateArray();
+                        while (accounts.MoveNext())
+                        {
+                            JsonElement account = accounts.Current;
+                            List<string> lostStu = account.GetProperty("lostStu").ToObject<List<string>>();
+                            string id = account.GetProperty("id").GetString();
+                            string sub = examIds.Where(c => c.eId.Equals(id)).FirstOrDefault().sId;
+                            stuInfo.Add((account.GetProperty("school").GetString(), sub, lostStu));
+                        }
+                    }
+                }
+            }
+            return stuInfo;
+        }
+
         [ProducesDefaultResponseType]
         [Authorize(Roles = "IES")]
         [AuthToken(Roles = "teacher,admin,student")]

+ 4 - 4
TEAMModelOS/TEAMModelOS.csproj

@@ -69,11 +69,11 @@
     <SpaRoot>ClientApp\</SpaRoot>
     <DefaultItemExcludes>$(DefaultItemExcludes);$(SpaRoot)node_modules\**</DefaultItemExcludes>
     <UserSecretsId>078b5d89-7d90-4f6a-88fc-7d96025990a8</UserSecretsId>
-    <Version>5.2304.12</Version>
-    <AssemblyVersion>5.2304.12.1</AssemblyVersion>
-    <FileVersion>5.2304.12.1</FileVersion>
+    <Version>5.2304.19</Version>
+    <AssemblyVersion>5.2304.19.1</AssemblyVersion>
+    <FileVersion>5.2304.19.1</FileVersion>
     <Description>TEAMModelOS(IES5)</Description>
-    <PackageReleaseNotes>IES版本说明版本切换标记5.2304.12.1</PackageReleaseNotes>
+    <PackageReleaseNotes>IES版本说明版本切换标记5.2304.19.1</PackageReleaseNotes>
     <PackageId>TEAMModelOS</PackageId>
     <Authors>teammodel</Authors>
     <Company>醍摩豆(成都)信息技术有限公司</Company>