Bladeren bron

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

zhouj1203@hotmail.com 1 jaar geleden
bovenliggende
commit
8ff306e39f

+ 27 - 0
TEAMModelBI/ClientApp/src/until/common.js

@@ -173,5 +173,32 @@ export default {
             noWan = '0' + noWan
         }
         return overWan ? getWan(overWan) + '万' + getWan(noWan) : getWan(num)
+    },
+    //处理数字  以数字+文字单位
+    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
+        console.log(spanValue,'进入方法了')
+        if (isNaN(number)) {
+            console.log("请输入有效数字")
+            return;
+        }
+        if (number < spanValue) {
+            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
+        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];
     }
 }

+ 14 - 10
TEAMModelBI/ClientApp/src/view/product/details.vue

@@ -36,7 +36,7 @@
               </div>
             </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}}<span class="timetag">Min</span><br /><span>{{Math.round(item.value/60)}}<span class="timetag">H</span></span></p>
+              <p v-if="item.key === 'classtime' || item.key === 'participationnum'">{{item.valueText}}<span class="timetag">Min</span><br /><span>{{item.valueHText}}<span class="timetag">H</span></span></p>
               <p v-else>{{item.value}}</p>
             </div>
           </div>
@@ -287,6 +287,7 @@ console.log(props.detailsData, '子组件')
 let value1 = ref('')
 let value = ref()
 let $myemit = defineEmits(['myback'])
+let { proxy } = getCurrentInstance()
 const activeName = ref('areas')
 let appearState = ref('area')
 const options = [
@@ -614,10 +615,9 @@ let basicaList = ref([
   { title: '教室总数', icon: '#icon-shouhuifangzi', value: '65', key: 'roomnum' },
   { title: '教师总数', icon: '#icon-jiaoshijie', value: '158', key: 'teachnum' },
   { title: '学生人次', icon: '#icon-zongrenshu', value: '7603', key: 'studentnum' },
-  { title: '学生参与总时数', icon: '#icon-_shijian_xiaoshuai', value: '8小时', key: 'participationnum' },
+  { title: '学生参与总时数', icon: '#icon-_shijian_xiaoshuai', value: '8小时', key: 'participationnum',valueText:'',valueHText:'', },
   { title: '课堂总数', icon: '#icon-ketang', value: '45', key: 'classnum' },
-  { title: '课堂总时数', icon: '#icon--shijian ', value: '648', key: 'classtime' },
-  { title: '授权类型', icon: '#icon-guanfangshouquan', value: '已授权', key: 'power' },
+  { title: '课堂总时数', icon: '#icon--shijian ', value: '648', key: 'classtime',valueText:'',valueHText:'',},
 ])
 let powerList = ref({
   facility: [
@@ -814,11 +814,15 @@ function init (againvalue) {
   basicaList.value[0].value = schoolId
   basicaList.value[1].value = 0
   // basicaList.value[2].value = 0
-  basicaList.value[3].value = tmidCnt
-  basicaList.value[4].value = stuShow
+  basicaList.value[3].value = proxy.$common.numberToTextWithUnit(tmidCnt)
+  basicaList.value[4].value = proxy.$common.numberToTextWithUnit(stuShow)
   basicaList.value[5].value = stuLessonLengMin
+  basicaList.value[5].valueText=proxy.$common.numberToTextWithUnit(stuLessonLengMin)
+  basicaList.value[5].valueHText=proxy.$common.numberToTextWithUnit(Math.round(stuLessonLengMin/60))
   basicaList.value[6].value = lessonRecord
   basicaList.value[7].value = lessonLengMin
+  basicaList.value[7].valueText = proxy.$common.numberToTextWithUnit(lessonLengMin)
+  basicaList.value[7].valueHText=proxy.$common.numberToTextWithUnit(Math.round(lessonLengMin/60))
 
   //处理课中使用数据
   let { useIES, useWebIrs, useDeviceIrs, useHita, useHaboard, useIES5Resource, tGreen } = propsbox.detailsData
@@ -842,10 +846,10 @@ function init (againvalue) {
   powerList.value.class[3].value = lessonCntIdDevice
   //处理任务数、作品完成、题目等。。。。
   let { mission, missionFin, item, interact } = propsbox.detailsData
-  inuseList.value[0].value = mission
-  inuseList.value[1].value = missionFin
-  inuseList.value[2].value = item
-  inuseList.value[3].value = interact
+  inuseList.value[0].value = proxy.$common.numberToTextWithUnit(mission)
+  inuseList.value[1].value = proxy.$common.numberToTextWithUnit(missionFin)
+  inuseList.value[2].value = proxy.$common.numberToTextWithUnit(item)
+  inuseList.value[3].value = proxy.$common.numberToTextWithUnit(interact)
 
   //处理多形态课堂
   let { lTypeCoop, lTypeIact, lTypeMis, lTypeTst, lTypeDif, lTypeNone,lessonLeng0} = propsbox.detailsData

+ 4 - 0
TEAMModelBI/ClientApp/src/view/product/index.vue

@@ -732,6 +732,10 @@ function dataInit () {
   }).catch((err) => {
     ElMessage.error('API异常,基础数据获取异常')
   })
+  let a=proxy.$common.numberToTextWithUnit(123456); 
+  let b=proxy.$common.numberToTextWithUnit(1234567890);
+  let c=proxy.$common.numberToTextWithUnit(12345678901234);
+   console.log(a,b,c,'查看文字反应')
 }
  function serachToresult (startTime, endTime, product, schools, unit) {
   // let data = { "dateFrom": "2023-04-12", "dateTo": "2023-04-19", "prod": "HiTeach", "schoolIds": ["tbslgb", "habook"], "dateUnit": "Day" }

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

@@ -714,30 +714,30 @@
 					? isZhiYinVersion
 						? this.zySchoolMenu
 						: [
-								// 教学看板(国际站单独)
-								{
-									icon: "iconfont icon-data-count",
-									name: this.$t("system.menu.techDash"),
-									router: "/researchDashboard",
+								//iot (10.20 应台湾要求 调整 顺序 1.iot 2.教学看板)
+									{
+									icon: "iconfont icon-wulianwang",
+									name: this.$t("system.menu.iotBoard"),
+									router: "/schooliot",
 									tag: "",
 									role: "admin",
 									permission: "dashboard-read",
 									menuName: "TeacherDashboard",
 									child: [],
-									isShow: this.isGlobalSite
+                                    isShow: this.isGlobalSite && this.isAdmin
+									//isShow:true,
 								},
-								//iot
+								// 教学看板(国际站单独)
 								{
-									icon: "iconfont icon-wulianwang",
-									name: this.$t("system.menu.iotBoard"),
-									router: "/schooliot",
+									icon: "iconfont icon-data-count",
+									name: this.$t("system.menu.techDash"),
+									router: "/researchDashboard",
 									tag: "",
 									role: "admin",
 									permission: "dashboard-read",
 									menuName: "TeacherDashboard",
 									child: [],
-                                    isShow: this.isGlobalSite && this.isAdmin
-									//isShow:true,
+									isShow: this.isGlobalSite,
 								},
 								// 学校管理
 								{

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

@@ -298,14 +298,16 @@
 			stemEditor.create()
 			this.stemEditor = stemEditor
 
-			if(JSON.stringify(this.editInfo) === '{}'){
-				this.initEditors()
-			}
-
 			if (this.editInfo && this.isEdit) { 
 				console.log('进入多选题Mounted编辑')
 				this.doRender(this.editInfo)
 			}
+
+			setTimeout(() => {
+				if(JSON.stringify(this.editInfo) === '{}'){
+					this.initEditors()
+				}
+			}, 100);
 		},
 		computed: {
 		    // 选项顺序转化成字母

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

@@ -248,11 +248,7 @@
 
 			stemEditor.create()
 			this.stemEditor = stemEditor
-
-			if(JSON.stringify(this.editInfo) === '{}'){
-				this.initEditors()
-			}
-
+			
 			if (this.editInfo && this.isEdit) {
 				console.log('进入单选题Mounted编辑',this.editInfo)
 				this.editSingleInfo = this.editInfo
@@ -267,10 +263,15 @@
 					this.stemEditor.txt.html(this.editSingleInfo.question)
 				})
 			}
+			setTimeout(() => {
+				if(JSON.stringify(this.editInfo) === '{}'){
+					this.initEditors()
+				}
+			}, 100);
 		},
 		watch: {
 			editInfo: {
-				handler(newValue, oldValue) {
+				handler(newValue, oldValue) {	
 					if (newValue) {
 						console.log('单选接收到的数据')
 						console.log(newValue)