Selaa lähdekoodia

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

zhouj1203@hotmail.com 1 vuosi sitten
vanhempi
commit
5d02cc1cb5

+ 2 - 2
TEAMModelBI/ClientApp/src/until/common.js

@@ -178,7 +178,7 @@ export default {
     numberToTextWithUnit(number) {
         console.log('进入方法了123')
         let nowLanguage=localStorage.getItem('local') ? (localStorage.getItem('local')).toLowerCase():(navigator.language).toLowerCase();
-        let spanValue=nowLanguage.indexOf('cn') !== 0 || nowLanguage.indexOf('tw') !==0 ? 10000:1000
+        let spanValue=nowLanguage.indexOf('cn') !== -1 || nowLanguage.indexOf('tw') !==-1 ? 10000:1000
         console.log(spanValue,'进入方法了')
         if (isNaN(number)) {
             console.log("请输入有效数字")
@@ -188,7 +188,7 @@ export default {
             return number.toString();
         }
         const unitCN=["万", "亿", "兆"];let unitTW=["萬","億","兆"];let unitEN=["k","M","B"]
-        const units = nowLanguage.indexOf('cn') !== 0 ? unitCN:nowLanguage.indexOf('tw') !==0 ?unitTW:unitEN
+        const units = nowLanguage.indexOf('cn') !== -1 ? unitCN:nowLanguage.indexOf('tw') !==-1 ?unitTW:unitEN
         let unitIndex = 0;
     
         while (number >= spanValue && unitIndex < units.length) {

+ 8 - 0
TEAMModelOS.SDK/Models/Cosmos/Common/Activity.cs

@@ -297,6 +297,10 @@ namespace TEAMModelOS.SDK.Models
         /// ["file"], 提交作品的格式
         /// </summary>
         public List<string> fileType { get; set; } = new List<string>();
+        /// <summary>
+        /// 是否由队长上传 0个人上传,1 队长上传
+        /// </summary>
+        public int captainUpload { get; set; }
         public string desc { get; set;}
     }
     public class ContestSign
@@ -305,6 +309,10 @@ namespace TEAMModelOS.SDK.Models
         ///  "name",   "phone",   "period",   "subject",  "school", "contestType",  "job"
         /// </summary>
         public List<string> field { get; set; } = new List<string>();
+        /// <summary>
+        /// 报名类型,0个人,1团队
+        /// </summary>
+        public int type { get; set; }
         public long stime { get; set; }
         public long etime { get; set; }
         /// <summary>

+ 27 - 2
TEAMModelOS/ClientApp/src/utils/public.js

@@ -1874,6 +1874,31 @@ export default {
 			return CorrectArr.join("");
 		}
 		return convert(number)
-	}
-
+	},
+	/*多位数字 转换为 数字+文字单位 呈现   目前iot页面使用*/
+	numberToTextWithUnit(number) {
+        let nowLanguage=localStorage.getItem('local') ? (localStorage.getItem('local')).toLowerCase():(navigator.language).toLowerCase();
+		console.log(nowLanguage,'语系')
+        let spanValue=nowLanguage.indexOf('cn') !== -1 || nowLanguage.indexOf('tw') !==-1 ? 10000:1000
+        if (isNaN(number)) {
+            return;
+        }
+        if (number < spanValue) {
+            return number.toString();
+        }
+        const unitCN=["万", "亿", "兆"];
+		const unitTW=["萬","億","兆"];
+		const unitEN=["K","M","B"]
+        const units = nowLanguage.indexOf('cn') !== -1 ? unitCN:nowLanguage.indexOf('tw') !==-1 ?unitTW:unitEN
+		console.log(units,'具体内容')
+        let unitIndex = 0;
+        while (number >= spanValue && unitIndex < units.length) {
+            number /= spanValue;
+            unitIndex++;
+        }
+        const roundedNumber =number.toFixed(1);
+        const numberText = roundedNumber.toString();
+    
+        return numberText + units[unitIndex - 1];
+    }
 }

+ 2 - 2
TEAMModelOS/ClientApp/src/view/areaMgmt/AreaLayout.vue

@@ -292,8 +292,8 @@ export default {
           permission: '',
           menuName: 'areaiot',
           child: [],
-          isShow: !this.$jsFn.checkJinNiu() && !this.$jsFn.checkTrain() && this.isGlobalSite()
-          //isShow:true,
+          //isShow: !this.$jsFn.checkJinNiu() && !this.$jsFn.checkTrain() && this.isGlobalSite()
+          isShow:true,
         },
         // 研修平台
         {

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

@@ -45,13 +45,13 @@
 			</div>
 		</div>
 
-		<BaseSingle v-if="exersicesType === 'single'" ref="single" :editInfo="editInfo"></BaseSingle>
-		<BaseMultiple v-else-if="exersicesType === 'multiple'" ref="multiple" :editInfo="editInfo"></BaseMultiple>
-		<BaseJudge v-else-if="exersicesType === 'judge'" ref="judge" :editInfo="editInfo"></BaseJudge>
-		<BaseCompletion v-else-if="exersicesType === 'complete'" ref="complete" :editInfo="editInfo"></BaseCompletion>
-		<BaseConnector v-else-if="exersicesType === 'connector'" ref="connector" :editInfo="editInfo"></BaseConnector>
-		<BaseCorrect v-else-if="exersicesType === 'correct'" ref="correct" :editInfo="editInfo"></BaseCorrect>
-		<BaseSubjective v-else-if="exersicesType === 'subjective'" ref="subjective" :editInfo="editInfo"></BaseSubjective>
+		<BaseSingle v-if="exersicesType === 'single'" ref="single" :editInfo="editInfo" :isEditM="isEdit"></BaseSingle>
+		<BaseMultiple v-else-if="exersicesType === 'multiple'" ref="multiple" :editInfo="editInfo" :isEditM="isEdit"></BaseMultiple>
+		<BaseJudge v-else-if="exersicesType === 'judge'" ref="judge" :editInfo="editInfo" ></BaseJudge>
+		<BaseCompletion v-else-if="exersicesType === 'complete'" ref="complete" :editInfo="editInfo" ></BaseCompletion>
+		<BaseConnector v-else-if="exersicesType === 'connector'" ref="connector" :editInfo="editInfo" ></BaseConnector>
+		<BaseCorrect v-else-if="exersicesType === 'correct'" ref="correct" :editInfo="editInfo" ></BaseCorrect>
+		<BaseSubjective v-else-if="exersicesType === 'subjective'" ref="subjective" :editInfo="editInfo" ></BaseSubjective>
 
 		<!-- 解析的富文本部分 -->
 		<div class="exersices-analysis child-exercise-analysis">
@@ -141,7 +141,7 @@
 				editInfo: {},
 				schoolInfo: {},
 				saveLoading: false,
-				exersicesType: "single",
+				exersicesType: "",//single
 				exerciseField: 0,
 				exercisePeriod: 0,
 				exerciseGrade: [],

+ 8 - 6
TEAMModelOS/ClientApp/src/view/evaluation/types/BaseMultiple.vue

@@ -34,6 +34,10 @@
 			isEdit:{
 				type:Boolean,
 				default:false
+			},
+			isEditM:{
+				type:Boolean,
+				default:false
 			}
 		},
 		data() {
@@ -302,12 +306,10 @@
 				console.log('进入多选题Mounted编辑')
 				this.doRender(this.editInfo)
 			}
-
-			setTimeout(() => {
-				if(JSON.stringify(this.editInfo) === '{}'){
-					this.initEditors()
-				}
-			}, 100);
+			
+			if(!this.isEditM){
+				this.initEditors()
+			}
 		},
 		computed: {
 		    // 选项顺序转化成字母

+ 10 - 7
TEAMModelOS/ClientApp/src/view/evaluation/types/BaseSingle.vue

@@ -36,7 +36,11 @@
 			isEdit:{
 				type:Boolean,
 				default:false
-			}
+			},
+			isEditM:{
+				type:Boolean,
+				default:false
+			},
 		},
 		data() {
 			return {
@@ -259,15 +263,14 @@
 				this.options = this.editSingleInfo.option.map((item, index) => index)
 				this.existOptions = this.editSingleInfo.option.map((item, index) => index)
 				this.$nextTick(() => {
-					this.initEditors()
+					//this.initEditors()
 					this.stemEditor.txt.html(this.editSingleInfo.question)
 				})
 			}
-			setTimeout(() => {
-				if(JSON.stringify(this.editInfo) === '{}'){
-					this.initEditors()
-				}
-			}, 100);
+			console.log("1單選this.isEditM="+this.isEditM);
+			if(!this.isEditM){
+				this.initEditors()
+			}
 		},
 		watch: {
 			editInfo: {

+ 9 - 5
TEAMModelOS/ClientApp/src/view/iot/areaiot.vue

@@ -71,12 +71,12 @@
                             <div :class="[item.key ==='participationnum' && locals==='en-us' ? 'common-title':'','item-title']">{{item.title}}</div>
                             <div :class="[item.key === 'classtime' || item.key === 'participationnum' ? 'item-nums-special':'item-nums']">
                                     <p v-if="item.key === 'classtime' || item.key === 'participationnum'">
-                                        {{item.value}}
+                                        {{item.valueText}}
                                         <span class="timetag">Min</span>
                                         <br/>
                                         <span>
                                             <span class="total-text">{{$t('schoolIot.basics.totals')}}</span>
-                                            {{Math.round(item.value/60)}}
+                                            {{item.valueHText}}
                                             <span class="timetag">H</span>
                                         </span>
                                     </p>
@@ -244,9 +244,9 @@ export default {
         { title: this.$t('schoolIot.basics.classnums'), icon: '#icon-shouhuifangzi', value: 0, key: 'roomnum',total:0 },
         { title: this.$t('schoolIot.basics.teachnums'), icon: '#icon-jiaoshijie', value: 0, key: 'teachnum' ,total:0 },
         { title: this.$t('schoolIot.basics.studentnums'), icon: '#icon-zongrenshu', value: 0, key: 'studentnum' ,total:0 },
-        { title: this.$t('schoolIot.basics.studentTime'), icon: '#icon-_shijian_xiaoshuai', value: 0, key: 'participationnum' },
+        { title: this.$t('schoolIot.basics.studentTime'), icon: '#icon-_shijian_xiaoshuai', value: 0, key: 'participationnum',valueText:'',valueHText:'',   },
         { title: this.$t('schoolIot.basics.classroomTotal'), icon: '#icon-ketang', value: 0, key: 'classnum' },
-        { title: this.$t('schoolIot.basics.classroomTime'), icon: '#icon--shijian ', value:0, key: 'classtime' },
+        { title: this.$t('schoolIot.basics.classroomTime'), icon: '#icon--shijian ', value:0, key: 'classtime',valueText:'',valueHText:'',},
         ],
         inuseList:[
         { title: this.$t('schoolIot.classrooming.taskNums'), value: 0, icon: 'iconfont icon-renwu',src:require("@/assets/image/iot/task.png"),class: 'task', textClass: 'task-text' },
@@ -379,10 +379,14 @@ export default {
           this.basicaList[1].value= [...new Set(areaDatateach)].length
           this.basicaList[1].total = teacherCnt
           this.basicaList[2].value = stuShow
-          this.basicaList[2].total = studentCnt
+          this.basicaList[2].total = this.$tools.numberToTextWithUnit(studentCnt)
           this.basicaList[3].value = stuLessonLengMin
+          this.basicaList[3].valueText=this.$tools.numberToTextWithUnit(stuLessonLengMin)
+          this.basicaList[3].valueHText=this.$tools.numberToTextWithUnit(Math.round(stuLessonLengMin/60))
           this.basicaList[4].value = lessonRecord
           this.basicaList[5].value = lessonLengMin
+          this.basicaList[5].valueText = this.$tools.numberToTextWithUnit(lessonLengMin)
+          this.basicaList[5].valueHText=this.$tools.numberToTextWithUnit(Math.round(lessonLengMin/60))
           //课中统计 和 设备统计
           let { mission, missionFin, item, interact, htcDevTotalCnt, htcDevCnt, htaDevTotalCnt, htaDevCnt, htccDevCnt } = res.area
           this.inuseList[0].value = mission

+ 10 - 6
TEAMModelOS/ClientApp/src/view/iot/schooliot.vue

@@ -42,12 +42,12 @@
                             <div :class="[item.key ==='participationnum' && locals==='en-us' ? 'common-title':'','item-title']">{{item.title}}</div>
                             <div :class="[item.key === 'classtime' || item.key === 'participationnum' ? 'item-nums-special':'item-nums']">
                                     <p v-if="item.key === 'classtime' || item.key === 'participationnum'">
-                                        {{item.value}}
+                                        {{item.valueText}}
                                         <span class="timetag">Min</span>
                                         <br/>
                                         <span>
                                             <span class="total-text">{{$t('schoolIot.basics.totals')}}</span>
-                                            {{Math.round(item.value/60)}}
+                                            {{item.valueHText}}
                                             <span class="timetag">H</span>
                                         </span>
                                     </p>
@@ -198,9 +198,9 @@ export default {
         { title: this.$t('schoolIot.basics.classnums'), icon: '#icon-shouhuifangzi', value: 65, key: 'roomnum',total:77, },
         { title: this.$t('schoolIot.basics.teachnums'), icon: '#icon-jiaoshijie', value: 158, key: 'teachnum',total:77, },
         { title: this.$t('schoolIot.basics.studentnums'), icon: '#icon-zongrenshu', value: 7603, key: 'studentnum',total:77,},
-        { title: this.$t('schoolIot.basics.studentTime'), icon: '#icon-_shijian_xiaoshuai', value: 450, key: 'participationnum' },
+        { title: this.$t('schoolIot.basics.studentTime'), icon: '#icon-_shijian_xiaoshuai', value: 450, key: 'participationnum',valueText:'',valueHText:'',  },
         { title: this.$t('schoolIot.basics.classroomTotal'), icon: '#icon-ketang', value: 45, key: 'classnum' },
-        { title: this.$t('schoolIot.basics.classroomTime'), icon: '#icon--shijian ', value: 648, key: 'classtime' },
+        { title: this.$t('schoolIot.basics.classroomTime'), icon: '#icon--shijian ', value: 648, key: 'classtime',valueText:'',valueHText:'',  },
         ],
         inuseList:[
         { title: this.$t('schoolIot.classrooming.taskNums'), value: 15, icon: 'iconfont icon-renwu',src:require("@/assets/image/iot/task.png"),class: 'task', textClass: 'task-text' },
@@ -322,11 +322,15 @@ export default {
           this.basicaList[0].total = deviceAuthCnt
           this.basicaList[1].value= [...new Set(uesDatateach)].length
           this.basicaList[1].total = teacherCnt
-          this.basicaList[2].value = stuShow
-          this.basicaList[2].total = studentCnt
+          this.basicaList[2].value = this.$tools.numberToTextWithUnit(stuShow)
+          this.basicaList[2].total = this.$tools.numberToTextWithUnit(studentCnt)
           this.basicaList[3].value = stuLessonLengMin
+          this.basicaList[3].valueText=this.$tools.numberToTextWithUnit(stuLessonLengMin)
+          this.basicaList[3].valueHText=this.$tools.numberToTextWithUnit(Math.round(stuLessonLengMin/60))
           this.basicaList[4].value = lessonRecord
           this.basicaList[5].value = lessonLengMin
+          this.basicaList[5].valueText=this.$tools.numberToTextWithUnit(lessonLengMin)
+          this.basicaList[5].valueHText=this.$tools.numberToTextWithUnit(Math.round(lessonLengMin/60))
           //课中统计 和 设备统计
           let { mission, missionFin, item, interact, htcDevTotalCnt, htcDevCnt, htaDevTotalCnt, htaDevCnt, htccDevCnt } = res
           this.inuseList[0].value = mission

+ 21 - 0
TEAMModelOS/Controllers/Common/ActivityController.cs

@@ -588,6 +588,27 @@ namespace TEAMModelOS.Controllers
                             }
                             return Ok(new { code = 200, contest, reviewRule });
                         }
+                        //获取评审的模板列表
+                    case bool when $"{grant_type}".Equals("rule-list", StringComparison.OrdinalIgnoreCase): 
+                        {
+                            if (!request.TryGetProperty("owner", out JsonElement _owner)) return BadRequest();
+                            var  result = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.Normal).GetList<ReviewRule>($"select value c from c where c.owner='{_owner}'", "ReviewRule-template");
+                            List<ReviewRuleTree> reviewRules = new List<ReviewRuleTree>();
+                            foreach (var item in result.list)
+                            {
+                                var tree = ActivityService.ListToTree(item.configs);
+                                ReviewRuleTree reviewRule=new ReviewRuleTree
+                                {
+                                    name= item.name,
+                                    owner= item.owner,
+                                    sourceName= item.sourceName,
+                                    trees=tree,
+                                    upsertAsTemplate=1
+                                };
+                                reviewRules.Add(reviewRule);
+                            }
+                            return Ok(new { reviewRules });
+                        }
                 }
             } catch (Exception ex)
             {