Browse Source

close #1482 首页调整

liqk 3 years ago
parent
commit
00cd2c63af

+ 16 - 3
TEAMModelOS/ClientApp/src/view/homepage/HomePage.less

@@ -360,8 +360,9 @@
     .cus-count-item{
         padding: 10px 15px;
         // width: 120px;
-        flex:0.2;
+        // flex:0.2;
         min-width: 60px;
+        width: calc(25% - 22px);
         height: 80px;
         border-radius: 5px;
         background: #54aded;
@@ -370,14 +371,26 @@
         border: 1px solid #f0f0f0;
     }
     .tag-label{
-        color: #fff;
+        color: #4b4646;
     }
     .count-num{
         font-size: 30px;
         font-weight: 600;
-        color: white;
+        color: #4b4646;
     }
 }
+.cus-count-item-bg3{
+    background: #87c1fd !important;
+    // background-image: linear-gradient(120deg, #5ab7bf 0%, #95c6f2 100%) !important;
+}
+.cus-count-item-bg1{
+    background: #96c3d7 !important;
+    // background-image: linear-gradient(120deg, #5cadff 0%, #2db7f5 100%) !important;
+}
+.cus-count-item-bg2{
+    background: #b8ced7 !important;
+    // background-image: linear-gradient(120deg, #54adff 0%, #00b2c1 100%) !important;
+}
 .cus-chart-wrap{
     padding: 0px;
     display: flex;

+ 77 - 39
TEAMModelOS/ClientApp/src/view/homepage/HomePage.vue

@@ -4,10 +4,17 @@
         <vuescroll>
             <div class="chart-box">
                 <div class="chart-box-column1">
-                    <!-- 我的课表 -->
-                    <div class="cus-table-box">
+                    <!-- TODO 我的课表 此部分暂时去掉-->
+                    <div class="cus-table-box" v-if="!checkHost()">
                         <MinTable @tmwCus="getTmwCus"></MinTable>
                     </div>
+                    <!-- 活动统计 -->
+                    <div class="ac-count-box" v-else style="width:100%;height:360px;margin-bottom:15px">
+                        <p class="chart-title">
+                            {{$t('home.acCount')}}
+                        </p>
+                        <AcCountPie style="margin-top:-20px;" :count="acCount"></AcCountPie>
+                    </div>
                     <!-- 第三方平台连接 -->
                     <div class="recent-box" style="height:389px" v-if="checkHost()">
                         <p class="text-title">{{$t('platform.ptText')}}</p>
@@ -21,38 +28,72 @@
                             </vuescroll>
                         </div>
                     </div>
-                    <!-- 活动统计 -->
-                    <div class="ac-count-box" v-else style="width:100%">
-                        <p class="chart-title">
-                            {{$t('home.acCount')}}
-                        </p>
-                        <AcCountPie style="margin-top:-20px;" :count="acCount"></AcCountPie>
-                    </div>
+
                 </div>
                 <div class="chart-box-column2">
-                    <!-- 课堂数据 -->
-                    <div class="class-chart-box" v-if="checkHost()">
+                    <!-- 数据统计 -->
+                    <div class="class-chart-box" v-if="checkHost()" style="padding:35px 30px">
+                        <!-- 课堂记录统计 -->
                         <div class="cus-count-wrap">
-                            <div class="cus-count-item">
+                            <div class="cus-count-item cus-count-item-bg3">
                                 <p class="tag-label">{{$t('home.cusTotal')}}</p>
                                 <countTo :startVal='0' :endVal='recordCount.total || 0' :duration='1500' class="count-num"></countTo>
                             </div>
 
-                            <div class="cus-count-item">
+                            <div class="cus-count-item cus-count-item-bg3">
                                 <p class="tag-label">{{$t('home.semesterCount')}}</p>
                                 <countTo :startVal='0' :endVal='recordCount.semester || 0' :duration='1500' class="count-num"></countTo>
                             </div>
-                            <div class="cus-count-item">
+                            <div class="cus-count-item cus-count-item-bg3">
                                 <p class="tag-label">{{$t('home.weekCount')}}</p>
                                 <countTo :startVal='0' :endVal='recordCount.week || 0' :duration='1500' class="count-num"></countTo>
                             </div>
-                            <div class="cus-count-item">
+                            <div class="cus-count-item cus-count-item-bg3">
                                 <p class="tag-label">{{$t('home.dayCount')}}</p>
                                 <countTo :startVal='0' :endVal='recordCount.today || 0' :duration='1500' class="count-num"></countTo>
                             </div>
                         </div>
-                        <Divider dashed />
-                        <div class="cus-chart-wrap">
+                        <!-- 课程班级名单统计 -->
+                        <div class="cus-count-wrap" style="margin-top:25px">
+                            <div class="cus-count-item cus-count-item-bg1">
+                                <p class="tag-label">学校课程</p>
+                                <countTo :startVal='0' :endVal='countData.schoolCourseCount  || 0' :duration='1500' class="count-num"></countTo>
+                            </div>
+                            <div class="cus-count-item cus-count-item-bg1">
+                                <p class="tag-label">任教班级</p>
+                                <countTo :startVal='0' :endVal='countData.classIdsCount   || 0' :duration='1500' class="count-num"></countTo>
+                            </div>
+                            <div class="cus-count-item cus-count-item-bg1">
+                                <p class="tag-label">个人课程</p>
+                                <countTo :startVal='0' :endVal='countData.privateCourseCount   || 0' :duration='1500' class="count-num"></countTo>
+                            </div>
+                            <div class="cus-count-item cus-count-item-bg1">
+                                <p class="tag-label">个人名单</p>
+                                <countTo :startVal='0' :endVal='countData.stulistsCount   || 0' :duration='1500' class="count-num"></countTo>
+                            </div>
+                        </div>
+                        <!-- 资源统计 -->
+                        <div class="cus-count-wrap" style="margin-top:25px">
+                            <div class="cus-count-item cus-count-item-bg2">
+                                <p class="tag-label">课纲数量</p>
+                                <countTo :startVal='0' :endVal='countData.privateSyllabusCount  || 0' :duration='1500' class="count-num"></countTo>
+                            </div>
+                            <div class="cus-count-item cus-count-item-bg2">
+                                <p class="tag-label">试卷数量</p>
+                                <countTo :startVal='0' :endVal='countData.privatePaperCount   || 0' :duration='1500' class="count-num"></countTo>
+                            </div>
+                            <div class="cus-count-item cus-count-item-bg2">
+                                <p class="tag-label">题目数量</p>
+                                <countTo :startVal='0' :endVal='countData.privateItemCount  || 0' :duration='1500' class="count-num"></countTo>
+                            </div>
+                            <div class="cus-count-item cus-count-item-bg2">
+                                <p class="tag-label">资源数量</p>
+                                <countTo :startVal='0' :endVal='countData.privateBloblogCount  || 0' :duration='1500' class="count-num"></countTo>
+                            </div>
+                        </div>
+                        <!-- 暂时隐藏 -->
+                        <!-- <Divider dashed /> -->
+                        <div class="cus-chart-wrap" style="display:none">
                             <!-- 最高T分 -->
                             <TechScore class="class-chart" :tScore="recordData.max || 0"></TechScore>
                             <!-- 课例趋势图 -->
@@ -64,7 +105,8 @@
                     <!-- 研修数据 && 活动统计-->
                     <div style="display: flex;">
                         <!-- 研修数据 -->
-                        <div class="train-chart-box" :style="{width:!checkHost() ? '100%' : 'calc(70% - 15px)',marginRight:!checkHost() ? '0px' : '15px'}" v-show="$store.state.config.srvAdr == 'China'">
+                        <!-- <div class="train-chart-box" :style="{width:!checkHost() ? '100%' : 'calc(70% - 15px)',marginRight:!checkHost() ? '0px' : '15px'}" v-show="$store.state.config.srvAdr == 'China'"> -->
+                        <div class="train-chart-box" style="width:100%;margin-right:0px" v-show="$store.state.config.srvAdr == 'China'">
                             <p class="chart-title">
                                 {{$t('system.menu.trainCount')}}
                             </p>
@@ -118,12 +160,12 @@
                             </div>
                         </div>
                         <!-- 活动统计 -->
-                        <div class="ac-count-box" v-if="checkHost()">
+                        <!-- <div class="ac-count-box" v-if="checkHost()">
                             <p class="chart-title">
                                 {{$t('home.acCount')}}
                             </p>
                             <AcCountPie style="margin-top:-20px;" :count="acCount"></AcCountPie>
-                        </div>
+                        </div> -->
                     </div>
 
                 </div>
@@ -209,6 +251,7 @@ export default {
     inject: ['reload'],
     data() {
         return {
+            countData:{},
             platformList: [],
             areaSas: '',
             schoolSas: '',
@@ -319,8 +362,8 @@ export default {
     },
     methods: {
         openPlatform(index) {
-			let url = this.platformList[index].url
-			window.open(/^(http:|https:)/i.test(url) ? url : "http://" + url)
+            let url = this.platformList[index].url
+            window.open(/^(http:|https:)/i.test(url) ? url : "http://" + url)
         },
         //查看课堂记录统计数据
         getTeacherRecordData() {
@@ -356,7 +399,7 @@ export default {
         },
         //查询学时数据
         getStudyTime() {
-            if(!this.$store.state.userInfo.hasSchool) return
+            if (!this.$store.state.userInfo.hasSchool) return
             let req = {
                 tmdid: this.$store.state.userInfo.TEAMModelId,
                 school: this.$store.state.userInfo.schoolCode,
@@ -435,7 +478,7 @@ export default {
         },
         //查询学校公告
         findNotice() {
-            if(!this.$store.state.userInfo.hasSchool) return
+            if (!this.$store.state.userInfo.hasSchool) return
             let params = {
                 code: this.$store.state.userInfo.schoolCode,
                 type: "school",
@@ -496,7 +539,7 @@ export default {
         },
         // 查询学校资源平台
         getSchoolSetting() {
-            if(!this.$store.state.userInfo.hasSchool) return
+            if (!this.$store.state.userInfo.hasSchool) return
             let params = {
                 schoolId: this.$store.state.userInfo.schoolCode
             }
@@ -580,7 +623,7 @@ export default {
                     if (res.goingDatas) {
                         this.goingList = res.goingDatas
                     }
-
+                    this.countData = res
                 },
                 err => {
                     // this.$Message.error('API error!')
@@ -596,6 +639,14 @@ export default {
         },
     },
     created() {
+        // privateCourseCount  私人课程数量
+        // schoolCourseCount 所在学校教学课程数量
+        // classIdsCount  行政班教学数量
+        // teachIdsCount  教学班教学数量 
+        // stulistsCount  个人课程名单数量
+        // privateItemCount 个人题目数量
+        // privatePaperCount  个人试卷数量
+        // privateSyllabusCount 个人课纲数量
         this.areaSas = this.$store.state.user.userProfile.osblob_sas
         this.schoolSas = this.$store.state.user.schoolProfile.blob_sas
         this.getAreaSource()
@@ -612,14 +663,6 @@ export default {
         }
     },
     mounted() {
-        //      this.$EventBus.$off('onGlobalLoading')
-        //      this.$EventBus.$on('onGlobalLoading', (data) => {
-        // if(!data){
-        // 	this.getAcCount()	
-        // }else{
-        // 	this.isLoading = data
-        // }
-        //      })
     },
     computed: {
         //暂时只验证加入学校, 手机号需要对接API
@@ -635,11 +678,6 @@ export default {
         }
     },
     watch: {
-        // '$store.state.userInfo.schoolCode': {
-        //     handler(n, o) {
-        //         this.getAcCount()
-        //     }
-        // }
     }
 }
 </script>