Переглянути джерело

本周课程统计替换成教室统计

mifei 2 місяців тому
батько
коміт
7acd60a4b2
89 змінених файлів з 213 додано та 60 видалено
  1. 2 1
      public/config.js
  2. BIN
      public/img/duomeiti-left-icon.png
  3. BIN
      public/img/duomeiti-total-bg.png
  4. BIN
      public/img/weather/0@1x.png
  5. BIN
      public/img/weather/0@2x.png
  6. BIN
      public/img/weather/10@1x.png
  7. BIN
      public/img/weather/10@2x.png
  8. BIN
      public/img/weather/11@1x.png
  9. BIN
      public/img/weather/11@2x.png
  10. BIN
      public/img/weather/12@1x.png
  11. BIN
      public/img/weather/12@2x.png
  12. BIN
      public/img/weather/13@1x.png
  13. BIN
      public/img/weather/13@2x.png
  14. BIN
      public/img/weather/14@1x.png
  15. BIN
      public/img/weather/14@2x.png
  16. BIN
      public/img/weather/15@1x.png
  17. BIN
      public/img/weather/15@2x.png
  18. BIN
      public/img/weather/16@1x.png
  19. BIN
      public/img/weather/16@2x.png
  20. BIN
      public/img/weather/17@1x.png
  21. BIN
      public/img/weather/17@2x.png
  22. BIN
      public/img/weather/18@1x.png
  23. BIN
      public/img/weather/18@2x.png
  24. BIN
      public/img/weather/19@1x.png
  25. BIN
      public/img/weather/19@2x.png
  26. BIN
      public/img/weather/1@1x.png
  27. BIN
      public/img/weather/1@2x.png
  28. BIN
      public/img/weather/20@1x.png
  29. BIN
      public/img/weather/20@2x.png
  30. BIN
      public/img/weather/21@1x.png
  31. BIN
      public/img/weather/21@2x.png
  32. BIN
      public/img/weather/22@1x.png
  33. BIN
      public/img/weather/22@2x.png
  34. BIN
      public/img/weather/23@1x.png
  35. BIN
      public/img/weather/23@2x.png
  36. BIN
      public/img/weather/24@1x.png
  37. BIN
      public/img/weather/24@2x.png
  38. BIN
      public/img/weather/25@1x.png
  39. BIN
      public/img/weather/25@2x.png
  40. BIN
      public/img/weather/26@1x.png
  41. BIN
      public/img/weather/26@2x.png
  42. BIN
      public/img/weather/27@1x.png
  43. BIN
      public/img/weather/27@2x.png
  44. BIN
      public/img/weather/28@1x.png
  45. BIN
      public/img/weather/28@2x.png
  46. BIN
      public/img/weather/29@1x.png
  47. BIN
      public/img/weather/29@2x.png
  48. BIN
      public/img/weather/2@1x.png
  49. BIN
      public/img/weather/2@2x.png
  50. BIN
      public/img/weather/30@1x.png
  51. BIN
      public/img/weather/30@2x.png
  52. BIN
      public/img/weather/31@1x.png
  53. BIN
      public/img/weather/31@2x.png
  54. BIN
      public/img/weather/32@1x.png
  55. BIN
      public/img/weather/32@2x.png
  56. BIN
      public/img/weather/33@1x.png
  57. BIN
      public/img/weather/33@2x.png
  58. BIN
      public/img/weather/34@1x.png
  59. BIN
      public/img/weather/34@2x.png
  60. BIN
      public/img/weather/35@1x.png
  61. BIN
      public/img/weather/35@2x.png
  62. BIN
      public/img/weather/36@1x.png
  63. BIN
      public/img/weather/36@2x.png
  64. BIN
      public/img/weather/37@1x.png
  65. BIN
      public/img/weather/37@2x.png
  66. BIN
      public/img/weather/38@1x.png
  67. BIN
      public/img/weather/38@2x.png
  68. BIN
      public/img/weather/3@1x.png
  69. BIN
      public/img/weather/3@2x.png
  70. BIN
      public/img/weather/4@1x.png
  71. BIN
      public/img/weather/4@2x.png
  72. BIN
      public/img/weather/5@1x.png
  73. BIN
      public/img/weather/5@2x.png
  74. BIN
      public/img/weather/6@1x.png
  75. BIN
      public/img/weather/6@2x.png
  76. BIN
      public/img/weather/7@1x.png
  77. BIN
      public/img/weather/7@2x.png
  78. BIN
      public/img/weather/8@1x.png
  79. BIN
      public/img/weather/8@2x.png
  80. BIN
      public/img/weather/99@1x.png
  81. BIN
      public/img/weather/99@2x.png
  82. BIN
      public/img/weather/9@1x.png
  83. BIN
      public/img/weather/9@2x.png
  84. BIN
      public/img/zhihuijiaoshi-left-icon.png
  85. BIN
      public/img/zhihuijiaoshi-total-bg.png
  86. 107 9
      src/assets/css/left.scss
  87. 4 3
      src/components/Header.vue
  88. 96 47
      src/components/left.vue
  89. 4 0
      src/request/api.js

+ 2 - 1
public/config.js

@@ -9,7 +9,8 @@
9 9
 window.g = {
10 10
     // 获取数据请求地址
11 11
     // BASE_API: "https://weizhi.huanghuai.edu.cn/yyzioc-server/",//prod
12
-    BASE_API: "https://weizhi.huanghuai.edu.cn/jsioc-server/",//dev
12
+    BASE_API: "https://weizhi.huanghuai.edu.cn/yyzioc-server/",//prod
13
+    // BASE_API: "https://782y5867q3.vicp.fun/ioc-server/",//dev
13 14
     // BASE_API: "https://test.lqkj.top//cmioc3-server",
14 15
 
15 16
     // BASE_API: "http://192.168.4.219:12397/ioc-server",

BIN
public/img/duomeiti-left-icon.png


BIN
public/img/duomeiti-total-bg.png


BIN
public/img/weather/0@1x.png


BIN
public/img/weather/0@2x.png


BIN
public/img/weather/10@1x.png


BIN
public/img/weather/10@2x.png


BIN
public/img/weather/11@1x.png


BIN
public/img/weather/11@2x.png


BIN
public/img/weather/12@1x.png


BIN
public/img/weather/12@2x.png


BIN
public/img/weather/13@1x.png


BIN
public/img/weather/13@2x.png


BIN
public/img/weather/14@1x.png


BIN
public/img/weather/14@2x.png


BIN
public/img/weather/15@1x.png


BIN
public/img/weather/15@2x.png


BIN
public/img/weather/16@1x.png


BIN
public/img/weather/16@2x.png


BIN
public/img/weather/17@1x.png


BIN
public/img/weather/17@2x.png


BIN
public/img/weather/18@1x.png


BIN
public/img/weather/18@2x.png


BIN
public/img/weather/19@1x.png


BIN
public/img/weather/19@2x.png


BIN
public/img/weather/1@1x.png


BIN
public/img/weather/1@2x.png


BIN
public/img/weather/20@1x.png


BIN
public/img/weather/20@2x.png


BIN
public/img/weather/21@1x.png


BIN
public/img/weather/21@2x.png


BIN
public/img/weather/22@1x.png


BIN
public/img/weather/22@2x.png


BIN
public/img/weather/23@1x.png


BIN
public/img/weather/23@2x.png


BIN
public/img/weather/24@1x.png


BIN
public/img/weather/24@2x.png


BIN
public/img/weather/25@1x.png


BIN
public/img/weather/25@2x.png


BIN
public/img/weather/26@1x.png


BIN
public/img/weather/26@2x.png


BIN
public/img/weather/27@1x.png


BIN
public/img/weather/27@2x.png


BIN
public/img/weather/28@1x.png


BIN
public/img/weather/28@2x.png


BIN
public/img/weather/29@1x.png


BIN
public/img/weather/29@2x.png


BIN
public/img/weather/2@1x.png


BIN
public/img/weather/2@2x.png


BIN
public/img/weather/30@1x.png


BIN
public/img/weather/30@2x.png


BIN
public/img/weather/31@1x.png


BIN
public/img/weather/31@2x.png


BIN
public/img/weather/32@1x.png


BIN
public/img/weather/32@2x.png


BIN
public/img/weather/33@1x.png


BIN
public/img/weather/33@2x.png


BIN
public/img/weather/34@1x.png


BIN
public/img/weather/34@2x.png


BIN
public/img/weather/35@1x.png


BIN
public/img/weather/35@2x.png


BIN
public/img/weather/36@1x.png


BIN
public/img/weather/36@2x.png


BIN
public/img/weather/37@1x.png


BIN
public/img/weather/37@2x.png


BIN
public/img/weather/38@1x.png


BIN
public/img/weather/38@2x.png


BIN
public/img/weather/3@1x.png


BIN
public/img/weather/3@2x.png


BIN
public/img/weather/4@1x.png


BIN
public/img/weather/4@2x.png


BIN
public/img/weather/5@1x.png


BIN
public/img/weather/5@2x.png


BIN
public/img/weather/6@1x.png


BIN
public/img/weather/6@2x.png


BIN
public/img/weather/7@1x.png


BIN
public/img/weather/7@2x.png


BIN
public/img/weather/8@1x.png


BIN
public/img/weather/8@2x.png


BIN
public/img/weather/99@1x.png


BIN
public/img/weather/99@2x.png


BIN
public/img/weather/9@1x.png


BIN
public/img/weather/9@2x.png


BIN
public/img/zhihuijiaoshi-left-icon.png


BIN
public/img/zhihuijiaoshi-total-bg.png


+ 107 - 9
src/assets/css/left.scss

@@ -17,6 +17,7 @@
17 17
     flex-direction: column;
18 18
     padding: 11px 10px 15px 10px; //教室分类统计
19 19
     pointer-events: auto;
20
+
20 21
     .left_top {
21 22
         box-sizing: border-box;
22 23
         width: 392px;
@@ -73,12 +74,12 @@
73 74
         box-sizing: border-box;
74 75
         height: 219px;
75 76
         width: 392px;
76
-        height: 188px;
77
+        height: 178px;
77 78
 
78 79
         //  border: 2px solid #5F7BDC;
79 80
         .content {
80 81
             display: flex;
81
-            
82
+            padding: 19px 0px;
82 83
             .count {
83 84
                 display: flex;
84 85
                 flex-direction: column;
@@ -138,6 +139,98 @@
138 139
                 //     width: 60px;
139 140
                 // }
140 141
             }
142
+
143
+            .content-item {
144
+                flex: 1;
145
+                margin: 8px;
146
+                background-size: 100% 100%;
147
+                background-repeat: no-repeat;
148
+                padding: 10px 8px;
149
+
150
+                &:nth-child(1) {
151
+                    background-image: url('/public/img/duomeiti-total-bg.png');
152
+
153
+                }
154
+
155
+                &:nth-child(2) {
156
+                    background-image: url('/public/img/zhihuijiaoshi-total-bg.png');
157
+                    background-size: 100% 100%;
158
+                }
159
+
160
+                .content-item-header {
161
+                    display: flex;
162
+                    align-items: center;
163
+                    justify-content: space-between;
164
+                    // width: 100%;
165
+                    // margin-bottom: 10px;
166
+                    .item-header-title {
167
+                        color: #FFF;
168
+                        font-size: 13px;
169
+                        font-weight: 400;
170
+                        line-height: 20px;
171
+                    }
172
+
173
+                    .item-header-total-num {
174
+                        color: #FFF;
175
+                        font-size: 18px;
176
+                        font-style: normal;
177
+                        font-weight: 600;
178
+                        line-height: 20px;
179
+
180
+                        span {
181
+                            font-size: 12px;
182
+                            
183
+                        }
184
+                    }
185
+                }
186
+
187
+                .content-item-body {
188
+                    display: flex;
189
+
190
+                    .body-left-icon {
191
+                        width: 44px;
192
+                        height: 44px;
193
+                        margin-right: 4px;
194
+                    }
195
+
196
+                    .body-right-text {
197
+                        flex: 1;
198
+                        height: 44px;
199
+                        display: flex;
200
+                        flex-direction: column;
201
+                        justify-content: space-between;
202
+                        .total-box,
203
+                        .online-box {
204
+                            display: flex;
205
+                            align-items: center;
206
+                            justify-content: space-between;
207
+                            width: 100%;
208
+                            font-size: 10px;
209
+                            color: #fff;
210
+                            
211
+                            .num1,
212
+                            .num2 {
213
+                                font-family: D-DIN;
214
+                                font-size: 14px;
215
+                                font-weight: 700;
216
+                                line-height: normal;
217
+                                font-weight: 700;
218
+                                span{
219
+                                    font-size: 10px;
220
+                                    font-family: "Alibaba PuHuiTi 2.0";
221
+                                }
222
+                            }
223
+                            .num1{
224
+                                color: #28FFCD;
225
+                            }
226
+                            .num2{
227
+                                color: #FF9B28;
228
+
229
+                            }
230
+                        }
231
+                    }
232
+                }
233
+            }
141 234
         }
142 235
 
143 236
     }
@@ -167,6 +260,7 @@
167 260
             height: 100%;
168 261
             display: flex;
169 262
             flex-direction: column;
263
+
170 264
             .th {
171 265
                 font-weight: 700;
172 266
                 display: flex;
@@ -333,7 +427,8 @@
333 427
                     cursor: pointer;
334 428
                     display: flex;
335 429
                     align-items: center;
336
-                    .cureet-text{
430
+
431
+                    .cureet-text {
337 432
                         max-width: 100px;
338 433
                         overflow: hidden;
339 434
                         white-space: nowrap;
@@ -343,9 +438,11 @@
343 438
                 }
344 439
 
345 440
             }
346
-            .scroll-container{
441
+
442
+            .scroll-container {
347 443
                 flex: 1;
348
-                .empty-container{
444
+
445
+                .empty-container {
349 446
                     margin-top: 10px;
350 447
                     display: flex;
351 448
                     justify-content: center;
@@ -412,11 +509,12 @@
412 509
 
413 510
                     .item-content-left {
414 511
                         flex: 1;
512
+
415 513
                         .position {
416
-                           width: 150px;
417
-                           white-space: nowrap;
418
-                           text-overflow: ellipsis;
419
-                           overflow: hidden;
514
+                            width: 150px;
515
+                            white-space: nowrap;
516
+                            text-overflow: ellipsis;
517
+                            overflow: hidden;
420 518
                         }
421 519
                     }
422 520
 

+ 4 - 3
src/components/Header.vue

@@ -15,7 +15,7 @@
15 15
       </div>
16 16
       <el-divider direction="vertical" />
17 17
       <div class="right-weatherInfo">
18
-        <img class="weather-icon" :src="sun" alt="" />
18
+        <img class="weather-icon" :src="wether+ + weatherInfo.code + '@2x.png'" alt="" />
19 19
         <div class="info">
20 20
           <div class="text">{{ weatherInfo.text }}</div>
21 21
           <div class="temp">{{ weatherInfo.temperature }} <span>°C</span></div>
@@ -80,6 +80,7 @@ onUnmounted(() => {
80 80
 const headImg = ref("./img/head.png");
81 81
 const headLogo = ref("./img/logo.png");
82 82
 const sun = ref("./img/sun.png");
83
+const wether = ref("./img/weather/");
83 84
 </script>
84 85
 <style scoped lang="scss">
85 86
 .header {
@@ -153,8 +154,8 @@ const sun = ref("./img/sun.png");
153 154
       align-items: center;
154 155
       // height: 100%;
155 156
       .weather-icon {
156
-        width: 30px;
157
-        height: 30px;
157
+        width: 28px;
158
+        height: 28px;
158 159
       }
159 160
       .info {
160 161
         flex: 1;

+ 96 - 47
src/components/left.vue

@@ -46,16 +46,79 @@
46 46
     </div>
47 47
     <div class="left-center">
48 48
       <div class="title" :style="{ background: `url(${frame})` }">
49
-        <div class="text">本周课程统计</div>
49
+        <div class="text">教室统计</div>
50 50
       </div>
51 51
       <div class="content">
52
-        <div class="count" v-for="(item, index) in classCount" :key="index">
52
+        <div class="content-item">
53
+          <div class="content-item-header">
54
+            <div class="item-header-title">多媒体教室总数</div>
55
+            <div class="item-header-total-num">
56
+              <countTo :startVal="0" :endVal="summaryStatistic.mdeiaClassroomCount" :decimals="0" :duration="3000">
57
+              </countTo>
58
+              <span>间</span>
59
+            </div>
60
+          </div>
61
+          <div class="content-item-body">
62
+            <img class="body-left-icon" src="/public/img/duomeiti-left-icon.png" alt="" srcset="" />
63
+            <div class="body-right-text">
64
+              <div class="total-box">
65
+                <div>总物联数量</div>
66
+                <div class="num1">
67
+                  <countTo :startVal="0" :endVal="summaryStatistic.mediaClassroomDeviceCount" :decimals="0"
68
+                    :duration="3000">
69
+                  </countTo><span>个</span>
70
+                </div>
71
+              </div>
72
+              <div class="online-box">
73
+                <div>在线物联数量</div>
74
+                <div class="num2">
75
+                  <countTo :startVal="0" :endVal="summaryStatistic.mediaClassroomOnlineDeviceCount" :decimals="0"
76
+                    :duration="3000">
77
+                  </countTo><span>个</span>
78
+                </div>
79
+              </div>
80
+            </div>
81
+
82
+          </div>
83
+        </div>
84
+        <div class="content-item">
85
+          <div class="content-item-header">
86
+            <div class="item-header-title">智慧教室总数</div>
87
+            <div class="item-header-total-num">
88
+              <countTo :startVal="0" :endVal="summaryStatistic.wiseClassroomCount" :decimals="0" :duration="3000">
89
+              </countTo><span>间</span>
90
+            </div>
91
+          </div>
92
+          <div class="content-item-body">
93
+            <img class="body-left-icon" src="/public/img/zhihuijiaoshi-left-icon.png" alt="" srcset="" />
94
+            <div class="body-right-text">
95
+              <div class="total-box">
96
+                <div>总物联数量</div>
97
+                <div class="num1">
98
+                  <countTo :startVal="0" :endVal="summaryStatistic.wiseClassroomDeviceCount" :decimals="0"
99
+                    :duration="3000">
100
+                  </countTo><span>个</span>
101
+                </div>
102
+              </div>
103
+              <div class="online-box">
104
+                <div>在线物联数量</div>
105
+                <div class="num2">
106
+                  <countTo :startVal="0" :endVal="summaryStatistic.wiseClassroomOnlineDeviceCount" :decimals="0"
107
+                    :duration="3000">
108
+                  </countTo><span>个</span>
109
+                </div>
110
+              </div>
111
+            </div>
112
+
113
+          </div>
114
+        </div>
115
+        <!-- <div class="count" v-for="(item, index) in classCount" :key="index">
53 116
           <CircleProgress :target-value="item.number" :color="item.color" :text="item.text" :index="index"
54 117
             text-position="bottom">
55 118
             <img :src="leftimg + item.imgnumber + '.png'" alt="" />
56 119
           </CircleProgress>
57 120
           <div class="text">{{ item.text }}</div>
58
-        </div>
121
+        </div> -->
59 122
       </div>
60 123
     </div>
61 124
 
@@ -275,7 +338,7 @@ import {
275 338
   ElIcon,
276 339
 } from "element-plus";
277 340
 import { Search, ArrowDown } from "@element-plus/icons-vue";
278
-import { getClass, classSelections, queryClassroom } from "../request/api";
341
+import { getClass, classSelections, queryClassroom, summaryStatisticV3Api } from "../request/api";
279 342
 import CircleProgress from "./CircleProgress.vue";
280 343
 
281 344
 import {
@@ -288,6 +351,9 @@ import Scroll from "./ScrollView.vue";
288 351
 // import { callUIInteraction } from "../webrtcVideo";
289 352
 import Tag from "./Tag.vue";
290 353
 
354
+import axios from 'axios'
355
+import { CountTo } from "vue3-count-to";
356
+
291 357
 
292 358
 export default {
293 359
   name: "Histogram",
@@ -299,7 +365,7 @@ export default {
299 365
     ElCarouselItem,
300 366
     CircleProgress,
301 367
     Tag,
302
-
368
+    CountTo,
303 369
     Vue3SeamlessScroll,
304 370
     VerticalScroll,
305 371
     Scroll,
@@ -632,6 +698,8 @@ export default {
632 698
         getClassSelections();
633 699
         //获取教室列表数据
634 700
         getClassRoomList();
701
+        getSummaryStatisticV3()
702
+
635 703
       }, 30000);
636 704
     };
637 705
     onMounted(() => {
@@ -640,6 +708,9 @@ export default {
640 708
       getClassSelections();
641 709
       //获取教室列表数据
642 710
       getClassRoomList();
711
+      // 获取教师统计数据
712
+      getSummaryStatisticV3()
713
+      summaryStatisticV3Api
643 714
       scrollContainerHeight.value = scrollContainerRef.value.clientHeight;
644 715
 
645 716
       clearTimeoutTimer();//清除定时器
@@ -648,6 +719,22 @@ export default {
648 719
 
649 720
 
650 721
     });
722
+    let summaryStatistic = ref({
723
+      mdeiaClassroomCount: 0,
724
+      mediaClassroomOnlineDeviceCount: 0,
725
+      mediaClassroomDeviceCount: 0,
726
+      wiseClassroomCount: 0,
727
+      wiseClassroomDeviceCount: 0,
728
+      wiseClassroomOnlineDeviceCount: 0
729
+    });
730
+    const getSummaryStatisticV3 = () => {
731
+      axios.get("https://weizhi.huanghuai.edu.cn/ioc-server/summaryStatisticV3/1").then(res => {
732
+        console.log("教室统计数据s", res)
733
+        if (res.data.code == 200) {
734
+          summaryStatistic.value = res.data.data.wiseClassroom
735
+        }
736
+      })
737
+    }
651 738
 
652 739
     onBeforeUnmount(() => {
653 740
       clearTimeout(timer.value);
@@ -656,46 +743,8 @@ export default {
656 743
       clearTimeout(timer.value);
657 744
     });
658 745
 
659
-    function testMove() {
660
-      clearTimeout(timer.value);
661
-    }
662
-    function MarqueeTest() {
663
-      return;
664
-      let test1 = testMain.value;
665
-
666
-      //判断组件是否渲染完成
667
-      if (test1.offsetHeight == 0) {
668
-        test1 = testMain.value;
669
-      } else {
670
-        //如果列表数量过少不进行滚动
671
-        // console.log("test1", test1.childNodes)
672
-        if (test1.childNodes.length < 6) {
673
-          clearTimeout(timer.value);
674
-          return;
675
-        }
676
-        //组件进行滚动
677
-        test1.scrollTop += 1;
678
-
679
-        //判断滚动条是否滚动到底部
680
-        if (test1.scrollTop == test1.scrollHeight - test1.clientHeight) {
681
-          //获取组件第一个节点
682
-          let a = test1.childNodes[0];
683
-          //删除节点
684
-          test1.removeChild(a);
685
-          //将该节点拼接到组件最后
686
-          test1.append(a);
687
-        }
688
-      }
689
-    }
690 746
 
691
-    // 定时刷新教师统计数据
692
-    let classRoomInterval = ref(null);
693
-    const starttimeInterval = () => {
694
-      clearTimeout(classRoomInterval.value);
695
-      classRoomInterval.value = setInterval(() => {
696
-        getClassData();
697
-      }, 5000);
698
-    };
747
+
699 748
 
700 749
     // 占用教室数量
701 750
     const occupiedClassroomsCount = computed(() => {
@@ -710,7 +759,7 @@ export default {
710 759
       return (((occupied / total) * 100).toFixed(2)) == 'NaN' ? 0 : (((occupied / total) * 100).toFixed(2));
711 760
     });
712 761
 
713
-    // 获取教下拉选择
762
+    // 获取教下拉选择
714 763
     let buildings = ref({});
715 764
     let categoryType = ref({});
716 765
     let leafs = ref({});
@@ -806,7 +855,6 @@ export default {
806 855
       classRoom,
807 856
       interDevice,
808 857
       handleRoom,
809
-      testMove,
810 858
       testMain,
811 859
       popoverRef,
812 860
       classRoomCount,
@@ -848,7 +896,8 @@ export default {
848 896
       scrollContainerHeight,
849 897
       scrollContainerRef,
850 898
       noData,
851
-      isShhow
899
+      isShhow,
900
+      summaryStatistic
852 901
     };
853 902
   },
854 903
 };

+ 4 - 0
src/request/api.js

@@ -41,4 +41,8 @@ export const queryClassroom = (data) => service.post(`/wisdomClass/queryClassroo
41 41
 
42 42
 export const equipmentDetailsApi = (data) => service.get(`/wisdomClass/equipmentDetails?classroomCode=${data}`)
43 43
 
44
+export const summaryStatisticV3Api = (zoneId) => service.get(`/summaryStatisticV3/${zoneId}`)
45
+
46
+
47
+
44 48