Procházet zdrojové kódy

Merge branch 'develop' into TPE/develop

jeff před 1 rokem
rodič
revize
4816c40a9a

+ 1 - 1
TEAMModelBI/Controllers/BITmid/TmidController.cs

@@ -201,7 +201,7 @@ namespace TEAMModelBI.Controllers.BITmid
                             if (!string.IsNullOrWhiteSpace(country) && country.Equals("TW"))
                                 tmidStics.city = (regionData.city.ContainsKey(country) && !string.IsNullOrWhiteSpace(city) && regionData.city[country]["tw"].ContainsKey(city)) ? regionData.city[country]["tw"][city].name : city;
                             else if (!string.IsNullOrWhiteSpace(country) && country.Equals("CN"))
-                                tmidStics.city = (regionData.city.ContainsKey(country) && regionData.city[country].ContainsKey(province) && regionData.city[country][province].ContainsKey(city)) ? regionData.city[country][province][city].name : city;
+                                tmidStics.city = (regionData.city.ContainsKey(country) && !string.IsNullOrWhiteSpace(province) && !string.IsNullOrWhiteSpace(city) && regionData.city[country].ContainsKey(province) && regionData.city[country][province].ContainsKey(city)) ? regionData.city[country][province][city].name : city;
                             tmidStics.dist = (!string.IsNullOrWhiteSpace(district) && country.Equals("TW") && regionData.city[country]["tw"].ContainsKey(city) && regionData.dist[country]["tw"][city].ContainsKey(district)) ? regionData.dist[country]["tw"][city][district].name : district;
                             tmidStics.schoolCode = (doc.TryGetProperty("schoolCode", out JsonElement schCode)) ? schCode.GetString() : string.Empty;
                             tmidStics.schoolCodeW = (doc.TryGetProperty("schoolCodeW", out JsonElement schCodeW)) ? schCodeW.GetString() : string.Empty;

+ 2 - 1
TEAMModelOS/ClientApp/src/view/dashboard/fiveEdu/FiveEdu.vue

@@ -434,7 +434,6 @@
 					params.classIds = [target[1]];
 				}
 				this.$api.dashboard.fiveEduBase(params).then((res) => {
-					this.$store.commit("fiveEdu/setOverbase", res);
 					sessionStorage.setItem("dash-stu-count", res.studentCount);
 					this.homeData = res;
 					// 学生排名数据
@@ -444,6 +443,8 @@
 						this.dashEnv.envChildren = res.dimensions;
 					}
 					this.$store.commit("fiveEdu/setDashEnv", this.dashEnv);
+					this.$store.commit("fiveEdu/setOverbase", res);
+
 					// 头部统计数据
 					this.staticArr[0].val = res.studentCount;
 					this.staticArr[1].val = Number(target[0]);

+ 27 - 7
TEAMModelOS/ClientApp/src/view/dashboard/school/SchoolDashboard.vue

@@ -52,12 +52,15 @@
             <!--课堂信息end-->
             <div class="school-analyse-top">
             <div class="school-analyse-top-left" >
+                <p class="classechart-titles classted">本年课例明细</p>
                 <Bar :barData="detailsEchart.bar1"></Bar>
             </div>
             <div class="school-analyse-top-center">
+                <p class="classechart-titles activityed">本年活动明细</p>
                 <Bar :barData="detailsEchart.bar2"></Bar>
             </div>
             <div class="school-analyse-top-right">
+                <p class="classechart-titles interacted">本年课堂互动明细</p>
                 <Bar :barData="detailsEchart.bar3"></Bar>
             </div>
             </div>
@@ -177,7 +180,7 @@ export default {
                     },
                     grid: {
                     top: '25%',
-                    bottom: '1.5%',
+                    bottom: '5%',
                     left: '5%',
                     right: '5%',
                     containLabel: true,
@@ -191,7 +194,7 @@ export default {
                         rotate: 0,
                         textStyle: {
                             color: '#A6D3FD',
-                            fontSize: 10,
+                            fontSize: 9,
                         },
                         },
                         axisPointer: {
@@ -268,7 +271,7 @@ export default {
                     },
                     grid: {
                     top: '25%',
-                    bottom: '1.5%',
+                    bottom: '5%',
                     left: '2%',
                     right: '5%',
                     containLabel: true,
@@ -360,7 +363,7 @@ export default {
                     },
                     grid: {
                     top: '25%',
-                    bottom: '1.5%',
+                    bottom: '5%',
                     left: '5%',
                     right: '5%',
                     containLabel: true,
@@ -710,13 +713,13 @@ export default {
                 this.detailsEchart.bar3.timeline.data = this.anSchool.times
                 this.detailsEchart.bar3.xAxis[0].data = this.anSchool.times
                 this.detailsEchart.bar3.series[0].data = this.anSchool.interacts
-
+                console.log(this.anSchool.classed,'课例')
                 //center data
                 //课例
                  this.detailsbasics[0].num=scStats.lessStats.all
                  this.detailsbasics[0].todayNum =scStats.lessStats.day
                  this.detailsbasics[0].subheadingNum =scStats.lessStats.lastDay === 0 && scStats.lessStats.day === 0 ? '0%' : scStats.lessStats.lastDay === 0 ? '100%' : ((scStats.lessStats.day - scStats.lessStats.lastDay) / scStats.lessStats.lastDay).toFixed(2) * 100 + '%'
-                 this.detailsbasics[0].subheadNum = this.anSchool.classed[this.anSchool.classed.length - 2] === 0 && this.anSchool.classed[this.anSchool.classed.length - 1] === 0 ? '0%' : this.anSchool.classed[this.anSchool.classed.length - 2] === 0 ? '100%' : ((this.anSchool.classed[this.anSchool.classed.length - 1] - this.anSchool.classed[this.anSchool.classed.length - 2]) / this.anSchool.classed[this.anSchool.classed.length - 2] * 100).toFixed(2) + '%'
+                 this.detailsbasics[0].subheadNum = this.anSchool.classed[this.anSchool.classed.length - 2] == 0 && this.anSchool.classed[this.anSchool.classed.length - 1] == 0 ? '0%' : this.anSchool.classed[this.anSchool.classed.length - 2] == 0 ? '100%' : ((this.anSchool.classed[this.anSchool.classed.length - 1] - this.anSchool.classed[this.anSchool.classed.length - 2]) / this.anSchool.classed[this.anSchool.classed.length - 2] * 100).toFixed(2) + '%'
                 //活动
                 this.detailsbasics[1].num = scStats.actStats.all
                 this.detailsbasics[1].todayNum = scStats.actStats.dayCnt
@@ -729,8 +732,11 @@ export default {
                 this.detailsbasics[2].subheadingNum = scStats.lessStats.lastDayInter === 0 && scStats.lessStats.dayInter === 0 ? '0%' : scStats.lessStats.lastDayInter === 0 ? '100%' : ((scStats.lessStats.dayInter - scStats.lessStats.lastDayInter) / scStats.lessStats.lastDayInter).toFixed(2) * 100 + '%'
                 this.detailsbasics[2].subheadNum = this.anSchool.interacts[this.anSchool.interacts.length - 2] === 0 && this.anSchool.interacts[this.anSchool.interacts.length - 1] === 0 ? '0%' : this.anSchool.interacts[this.anSchool.interacts.length - 2] === 0 ? '100%' : ((this.anSchool.interacts[this.anSchool.interacts.length - 1] - this.anSchool.interacts[this.anSchool.interacts.length - 2]) / this.anSchool.interacts[this.anSchool.interacts.length - 2] * 100).toFixed(2) + '%'
                 //总数据
-                let nowYear = scStats.lessStats.all + scStats.actStats.all
+                let nowYear = scStats.lessStats.all + scStats.actStats.all +alls
                 let lastYear = scStats.lessStats.lastYear + scStats.actStats.lastYear
+
+                this.detailsbasics[3].num = nowYear
+                this.detailsbasics[3].todayNum = Number(scStats.lessStats.day) + Number(scStats.actStats.dayCnt) + Number(scStats.lessStats.dayInter)
                 this.detailsbasics[3].subheadNum = nowYear === 0 && lastYear === 0 ? '0%' : lastYear === 0 ? '100%' : (((nowYear - lastYear) / lastYear) * 100).toFixed(2) + '%'
                 let classedDatas =  this.anSchool.classed; let activitysDatas =  this.anSchool.activitys; let interactDatas =  this.anSchool.interacts
                 let tataldata1 = classedDatas.map((index, item) => { return index + activitysDatas[item]; })
@@ -1027,6 +1033,20 @@ export default {
     height:55px;
     margin-right:1%;
 }
+.classechart-titles{
+    font-size: 16px;
+    font-weight: 700;
+    text-align: center;
+}
+.classted{
+    color: rgba(112,103,245,.6); 
+}
+.activityed{
+    color:rgba(255,117,26,.6)
+}
+.interacted{
+    color:rgba(29,227,255,.9)
+}
 .purples {
   /* background: rgba(112, 103, 245, 0.3); */
   background-image: linear-gradient(62deg, #8EC5FC 0%, #E0C3FC 100%);

+ 19 - 11
TEAMModelOS/ClientApp/src/view/dashboard/study/BaseExamLineBar.vue

@@ -12,8 +12,13 @@ export default {
   },
   methods: {
     doRender(renderJson) {
+      console.error('renderJson',renderJson)
       let myChart = this.$echarts.init(document.getElementById("BaseLineBar"));
       let that = this
+      if(!renderJson.nameArr.length){
+        myChart.clear()
+        return
+      }
       var option = {
         tooltip: {
           trigger: "item",
@@ -250,35 +255,35 @@ export default {
           },
         ],
       };
-      option.legend.data = that.examNameArr
+      let copyOption = that._.cloneDeep(option)
+      copyOption.legend.data = that.examNameArr
       if(that.examNameArr[0]){
-        option.series[0].name = that.examNameArr[0]
+        copyOption.series[0].name = that.examNameArr[0]
       }
       if(that.examNameArr[1]){
-        option.series[1].name = that.examNameArr[1]
+        copyOption.series[1].name = that.examNameArr[1]
       }else{
-        option.series = option.series.slice(0,1)
+        copyOption.series = option.series.slice(0,1)
       }
       if(that.examNameArr[2]){
-        option.series[2].name = that.examNameArr[2]
+        copyOption.series[2].name = that.examNameArr[2]
       }else{
-        option.series = option.series.slice(0,2)
+        copyOption.series = option.series.slice(0,2)
       }
-      console.log(option);
       myChart.clear();
-      myChart.setOption(option);
+      myChart.setOption(copyOption);
       window.addEventListener("resize", function () {
         myChart.resize();
       });
     },
   },
   watch: {
-    "$store.state.fiveEdu.dashEnv": {
+    "$store.state.fiveEdu.overbase": {
       immediate:true,
       deep:true,
       handler(n, o) {
         console.error('env变化',n.envName)
-        console.error('env变化',n.envChildren)
+        console.error('overbase',this.$store.state.fiveEdu.overbase)
         let overbase = this.$store.state.fiveEdu.overbase
         let examScores = overbase.examScores
         let renderJson = {
@@ -287,10 +292,11 @@ export default {
           countArr2:[],
           countArr3:[],
         }
+        console.error(examScores)
         if(examScores.length){
           this.examNameArr = examScores.map(i => i.name)
           renderJson = {
-            nameArr: examScores[0].data.map(i => i.name),
+            nameArr: examScores[0].data.map(i => i.name || '无名称'),
             countArr1: examScores[0].data.map(i => parseInt(i.value * 100)),
             countArr2: examScores[1] ? examScores[1].data.map(i => parseInt(i.value * 100)) : [],
             countArr3: examScores[2] ? examScores[2].data.map(i => parseInt(i.value * 100)) : [],
@@ -304,6 +310,8 @@ export default {
             examScores[1] ? parseInt(examScores[1].classScore * 100) : 0,
             examScores[2] ? parseInt(examScores[2].classScore * 100) : 0
           ] 
+        }else{
+          this.examNameArr = []
         }
         this.$nextTick(() => {
           this.doRender(renderJson)