Pārlūkot izejas kodu

完成第三方天气接口对接
完成黄淮学院教室统计数据定时刷新
完成黄淮学院物联网设备统计数据定时刷新
根据新ui界面调整首页UI界面(80%)
制作教室搜索功能静态
制作教室搜索下拉框

mifei 1 mēnesi atpakaļ
vecāks
revīzija
43a5e74198

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 955 - 330
package-lock.json


BIN
public/img/bg-shadow.png


BIN
public/img/frame.png


BIN
public/img/head.png


BIN
public/img/logo.png


BIN
public/img/sun.png


BIN
public/img/test_bg.png


+ 35 - 13
src/assets/css/home.scss

@@ -3,21 +3,43 @@
3 3
     padding: 0;
4 4
     overflow: hidden;
5 5
     width: 100%;
6
-    height: 100%;
6
+    height: 100vh;
7
+    background-position: center !important;
8
+    background-size: cover !important;
9
+    position: relative;
10
+    
7 11
 
8
-    .header {
9
-        position: absolute;
10
-        z-index: 555;
11
-        margin-bottom: 20px;
12
-        height: 70px;
13
-        width: 100%;
14
-        top: 10px;
12
+    // .header {
13
+    //     position: absolute;
14
+    //     z-index: 555;
15
+    //     margin-bottom: 20px;
16
+    //     height: 70px;
17
+    //     width: 100%;
18
+    //     top: 10px;
15 19
 
16
-        img {
17
-            width: 100%;
18
-            height: 100%;
19
-        }
20
-    }
20
+    //     img {
21
+    //         width: 100%;
22
+    //         height: 100%;
23
+    //     }
24
+    //     .weather{
25
+    //         position: absolute;
26
+    //         right: 10px;
27
+    //         top: 50%;
28
+    //         transform: translateY(-50%);
29
+    //         display: flex;
30
+    //         align-items: center;
31
+    //         .right-weatherInfo{
32
+    //             display: flex;
33
+    //             align-items: center;
34
+    //             .info{
35
+    //                 flex: 1;
36
+    //                 .temp{
37
+                       
38
+    //                 }
39
+    //             }
40
+    //         }
41
+    //     }
42
+    // }
21 43
 }
22 44
 
23 45
 .el-container {

+ 501 - 273
src/assets/css/left.scss

@@ -1,277 +1,484 @@
1
-
2 1
 .left {
3
-     position: absolute;
4
-     width: 412px;
5
-     height: 86vh;
6
-     top: 11.5vh;
7
-     z-index: 9;
8
-     flex-shrink: 0;
9
-     border-radius: 2px;
10
-     background: rgba(125, 125, 125, 0.17);
11
-     backdrop-filter: blur(30.5px);
12
-     color: #FFF;
13
-     font-size: 14px;
14
-     overflow: hidden;
15
-     left: 25px;
16
-     display: flex;
17
-     flex-direction: column;
18
-     padding: 11px 10px 15px 10px; //教室分类统计
19
-
20
-     .left_top {
21
-         box-sizing: border-box;
22
-         width: 392px;
23
-         height: 250px;
24
-         //  border: 2px solid darkcyan;
25
-
26
-         .list {
27
-             display: flex;
28
-             flex-direction: column;
29
-             justify-content: center;
30
-             width: 180px;
31
-             margin-left: 23.2px;
32
-             margin-right: 28px;
33
-
34
-             .item {
35
-                 width: 100%;
36
-                 display: flex;
37
-                 align-items: center;
38
-                 padding-top: 16px;
39
-                 padding-bottom: 11px;
40
-                 border-bottom: 1px dotted rgba(255, 255, 255, 0.33);
41
-                 font-size: 12px;
42
-                 font-family: Microsoft YaHei;
43
-
44
-                 i {
45
-                     display: inline-block;
46
-                     width: 8px;
47
-                     height: 8px;
48
-                     border-radius: 4px;
49
-                     margin-right: 6px;
50
-                 }
51
-
52
-                 .descr {
53
-                     display: flex;
54
-                     justify-content: space-between;
55
-                     width: 100%;
56
-                 }
57
-
58
-             }
59
-         }
60
-     }
61
-
62
-     // 本周课程统计
63
-     .left-center {
64
-         // border: 1px solid sienna;
65
-         box-sizing: border-box;
66
-         height: 219px;
67
-         width: 392px;
68
-         height: 208px;
69
-         //  border: 2px solid #5F7BDC;
70
-
71
-         .count {
72
-             display: flex;
73
-             flex-direction: column;
74
-             align-items: center;
75
-             justify-content: space-around;
76
-             height: 100%;
77
-             // border: 1px solid sandybrown;
78
-             //  width: 93px;
79
-             box-sizing: border-box;
80
-             // margin-top: 42px;
81
-             margin: 33px 16px 39px 22px;
82
-
83
-             img {
84
-                 width: 22px;
85
-                 height: 22px;
86
-             }
87
-
88
-             .text {
89
-                 font-size: 12px;
90
-                 line-height: 20px;
91
-             }
92
-
93
-             // width: 70px;
94
-
95
-             // text-align: center;
96
-             // justify-content: space-around;
97
-             // margin: 24px 0;
98
-             // padding: 20px;
99
-
100
-             // .el-progress-circle {
101
-             //     width: 56px !important;
102
-             //     height: 56px !important;
103
-
104
-             //     .el-progress-circle__track {
105
-             //         stroke: rgba(255, 255, 255, 0.2);
106
-             //     }
107
-
108
-             //     .el-progress__text {
109
-             //         margin-top: 5px;
110
-             //     }
111
-             // }
112
-
113
-             // .number {
114
-             //     margin-top: 10px;
115
-             //     margin-bottom: 5px;
116
-             //     font-size: 12px;
117
-
118
-             //     span {
119
-             //         font-size: 14px;
120
-             //         font-weight: bold;
121
-             //     }
122
-             // }
123
-
124
-             // .text {
125
-             //     font-size: 12px;
126
-             //     line-height: 20px;
127
-             //     width: 60px;
128
-             // }
129
-         }
130
-     }
131
-
132
-     // 智慧教室使用明细
133
-     .left-bottom {
134
-         flex: 1;
135
-         overflow: hidden;
136
-         box-sizing: border-box;
137
-         width: 392px;
138
-         //  height: 219px;
139
-         //  border: 2px solid #5F7BDC;
140
-
141
-         .content {
142
-             box-sizing: border-box;
143
-             padding: 10px;
144
-             padding-top: 0;
145
-             height: 100%;
146
-             overflow: hidden;
147
-         }
148
-
149
-         .title {
150
-             margin-bottom: 5px;
151
-         }
152
-
153
-
154
-         .table {
155
-             width: 100%;
156
-
157
-             .th {
158
-                 font-weight: 700;
159
-                 display: flex;
160
-                 width: 100%;
161
-
162
-                 .long {
163
-                     width: 500px;
164
-                 }
165
-             }
166
-
167
-             ul {
168
-                 display: flex;
169
-                 list-style: none;
170
-                 height: 48px;
171
-                 line-height: 40px;
172
-                 font-size: 12px;
173
-                 border-bottom: 1px dotted #fff;
174
-                 padding: 0;
175
-
176
-                 &:last-child {
177
-                     margin-bottom: 10px;
178
-                 }
179
-
180
-                 li {
181
-                     display: flex;
182
-                     width: 100%;
183
-                     align-items: center;
184
-                     justify-content: space-around;
185
-                     word-wrap: break-word;
186
-                 }
187
-             }
188
-
189
-             .el-button {
190
-                 background-color: #5F7BDC;
191
-                 color: #fff;
192
-                 border: none;
193
-             }
194
-
195
-
196
-         }
197
-     }
198
-
199
- }
200
-
201
- // 通用标题
202
- .title {
203
-     width: 380px;
204
-     height: 32px;
205
-     flex-shrink: 0;
206
-     background: linear-gradient(90deg, rgba(255, 255, 255, 0.17) 2.49%, rgba(255, 255, 255, 0.00) 98.69%);
207
-     ;
208
-     line-height: 32px;
209
-     margin: 11px 22px 0 10px;
210
-
211
-     .text {
212
-         color: #FFF;
213
-         font-family: PingFang SC;
214
-         font-size: 14px;
215
-         padding-left: 18px;
216
-         letter-spacing: 1px;
217
-     }
218
- }
219
-
220
- // 通用content
221
- .content {
222
-     display: flex;
223
-     width: 100%;
2
+    position: absolute;
3
+    width: 412px;
4
+    height: 86vh;
5
+    top: 8vh;
6
+    z-index: 9;
7
+    flex-shrink: 0;
8
+    border-radius: 2px;
9
+    // background: rgba(125, 125, 125, 0.17);
10
+    //  backdrop-filter: blur(30.5px);
11
+    color: #FFF;
12
+    font-size: 14px;
13
+    overflow: hidden;
14
+    left: 25px;
15
+    display: flex;
16
+    flex-direction: column;
17
+    padding: 11px 10px 15px 10px; //教室分类统计
18
+
19
+    .left_top {
20
+        box-sizing: border-box;
21
+        width: 392px;
22
+        height: 250px;
23
+        //  border: 2px solid darkcyan;
24
+
25
+        .list {
26
+            display: flex;
27
+            flex-direction: column;
28
+            justify-content: center;
29
+            width: 180px;
30
+            margin-left: 23.2px;
31
+            margin-right: 28px;
32
+            height: 140px;
33
+
34
+            .item {
35
+                width: 100%;
36
+                display: flex;
37
+                align-items: center;
38
+                padding-top: 16px;
39
+                padding-bottom: 11px;
40
+                // border-bottom: 1px dotted rgba(255, 255, 255, 0.33);
41
+                font-size: 12px;
42
+                font-family: Microsoft YaHei;
43
+                border-right: 2px solid #00EB7D;
44
+
45
+                background: rgba(69, 110, 172, 0.31);
46
+                margin-bottom: 10px;
47
+                padding: 6px 12px;
48
+
49
+                i {
50
+                    display: inline-block;
51
+                    width: 8px;
52
+                    height: 8px;
53
+                    border-radius: 4px;
54
+                    margin-right: 6px;
55
+                }
56
+
57
+
58
+                .descr {
59
+                    margin-left: 4px;
60
+                    display: flex;
61
+                    justify-content: space-between;
62
+                    width: 100%;
63
+                }
64
+
65
+            }
66
+        }
67
+    }
68
+
69
+    // 本周课程统计
70
+    .left-center {
71
+        // border: 1px solid sienna;
72
+        box-sizing: border-box;
73
+        height: 219px;
74
+        width: 392px;
75
+        height: 208px;
76
+
77
+        //  border: 2px solid #5F7BDC;
78
+        .content {
79
+            display: flex;
80
+
81
+            .count {
82
+                display: flex;
83
+                flex-direction: column;
84
+                align-items: center;
85
+                justify-content: space-around;
86
+                height: 100%;
87
+                // border: 1px solid sandybrown;
88
+                //  width: 93px;
89
+                box-sizing: border-box;
90
+                // margin-top: 42px;
91
+                // margin: 33px 16px 39px 22px;
92
+
93
+                img {
94
+                    width: 22px;
95
+                    height: 22px;
96
+                }
97
+
98
+                .text {
99
+                    font-size: 12px;
100
+                    line-height: 20px;
101
+                }
102
+
103
+                // width: 70px;
104
+
105
+                // text-align: center;
106
+                // justify-content: space-around;
107
+                // margin: 24px 0;
108
+                // padding: 20px;
109
+
110
+                // .el-progress-circle {
111
+                //     width: 56px !important;
112
+                //     height: 56px !important;
113
+
114
+                //     .el-progress-circle__track {
115
+                //         stroke: rgba(255, 255, 255, 0.2);
116
+                //     }
117
+
118
+                //     .el-progress__text {
119
+                //         margin-top: 5px;
120
+                //     }
121
+                // }
122
+
123
+                // .number {
124
+                //     margin-top: 10px;
125
+                //     margin-bottom: 5px;
126
+                //     font-size: 12px;
127
+
128
+                //     span {
129
+                //         font-size: 14px;
130
+                //         font-weight: bold;
131
+                //     }
132
+                // }
133
+
134
+                // .text {
135
+                //     font-size: 12px;
136
+                //     line-height: 20px;
137
+                //     width: 60px;
138
+                // }
139
+            }
140
+        }
141
+
142
+    }
143
+
144
+    // 智慧教室使用明细
145
+    .left-bottom {
146
+        flex: 1;
147
+        overflow: hidden;
148
+        box-sizing: border-box;
149
+        width: 392px;
150
+        //  height: 219px;
151
+        //  border: 2px solid #5F7BDC;
152
+
153
+        .content {
154
+            box-sizing: border-box;
155
+            padding: 10px;
156
+            padding-top: 0;
157
+            height: 100%;
158
+            overflow: hidden;
159
+            padding-left: 20px;
160
+            padding-right: 20px;
161
+        }
162
+
163
+        .title {
164
+            margin-bottom: 5px;
165
+        }
166
+
167
+        .usering-free-container {
168
+            padding-left: 20px;
169
+            padding-right: 20px;
170
+            margin-top: 16px;
171
+
172
+            .usering-free {
173
+                display: flex;
174
+                justify-content: space-between;
175
+                margin-bottom: 6px;
176
+
177
+                .usering-box {
178
+                    position: relative;
179
+                    padding-left: 10px;
180
+
181
+                    &::before {
182
+                        position: absolute;
183
+                        left: 0px;
184
+                        top: 50%;
185
+                        transform: translateY(-50%);
186
+                        display: block;
187
+                        content: "";
188
+                        width: 2px;
189
+                        height: 8px;
190
+                        border-radius: 1px;
191
+                        background: #1BCDFF;
192
+
193
+                    }
194
+
195
+                    .text {
196
+                        color: #fff;
197
+
198
+                        /* text/pc/03-55-Regular */
199
+                        font-family: "Alibaba PuHuiTi 2.0";
200
+                        font-size: 12px;
201
+                        font-style: normal;
202
+                        font-weight: 400;
203
+                        line-height: normal;
204
+
205
+                        .num {
206
+                            color: #1BCDFF;
207
+                            /* text/pc/03-55-Regular */
208
+                            font-family: "Alibaba PuHuiTi 2.0";
209
+                            font-size: 12px;
210
+                            font-style: normal;
211
+                            font-weight: 400;
212
+                            line-height: normal;
213
+                        }
214
+                    }
215
+                }
216
+
217
+                .free-box {
218
+                    position: relative;
219
+                    padding-right: 10px;
220
+
221
+                    &::after {
222
+                        position: absolute;
223
+                        right: 0px;
224
+                        top: 50%;
225
+                        transform: translateY(-50%);
226
+                        display: block;
227
+                        content: "";
228
+                        width: 2px;
229
+                        height: 8px;
230
+                        border-radius: 1px;
231
+                        background: #20E5B7;
232
+
233
+                    }
234
+
235
+                    .text {
236
+                        color: #fff;
237
+
238
+                        /* text/pc/03-55-Regular */
239
+                        font-family: "Alibaba PuHuiTi 2.0";
240
+                        font-size: 12px;
241
+                        font-style: normal;
242
+                        font-weight: 400;
243
+                        line-height: normal;
244
+
245
+                        .num {
246
+                            color: #20E5B7;
247
+                            /* text/pc/03-55-Regular */
248
+                            font-family: "Alibaba PuHuiTi 2.0";
249
+                            font-size: 12px;
250
+                            font-style: normal;
251
+                            font-weight: 400;
252
+                            line-height: normal;
253
+                        }
254
+                    }
255
+                }
256
+            }
257
+        }
258
+
259
+        .search-container {
260
+            display: flex;
261
+            margin-top: 16px;
262
+            padding-left: 20px;
263
+            padding-right: 20px;
264
+        }
265
+
266
+
267
+        .table {
268
+            width: 100%;
269
+           
270
+            .dropdown-container {
271
+                display: flex;
272
+                justify-content: space-between;
273
+                padding: 6px 8px;
274
+                border-bottom: 1px solid #234F6A;
275
+
276
+                .dropdown-name {
277
+                    color: rgba(255, 255, 255, 0.80);
278
+
279
+                    /* text/pc/03-55-Regular */
280
+                    font-family: "Alibaba PuHuiTi 2.0";
281
+                    font-size: 12px;
282
+                    font-style: normal;
283
+                    font-weight: 400;
284
+                    line-height: normal;
285
+                    cursor: pointer;
286
+
287
+                }
288
+
289
+            }
290
+
291
+            .th {
292
+                font-weight: 700;
293
+                display: flex;
294
+                width: 100%;
295
+
296
+                .long {
297
+                    width: 500px;
298
+                }
299
+            }
300
+
301
+            .list-item {
302
+
303
+
304
+                font-size: 12px;
305
+                // border-bottom: 1px dotted #fff;
306
+                padding: 8px;
307
+                border-radius: 6px;
308
+                border: 1px solid #164B7C;
309
+                background: rgba(26, 86, 154, 0.28);
310
+                margin-bottom: 15px;
311
+
312
+                .class-status-btn-container {
313
+                    display: flex;
314
+                    justify-content: space-between;
315
+                    width: 100%;
316
+                    align-items: center;
317
+
318
+                    .left-class-status {
319
+                        display: flex;
320
+                    }
321
+
322
+                    .right-btn {
323
+                        display: flex;
324
+                        padding: 4px 16px;
325
+                        justify-content: center;
326
+                        align-items: center;
327
+                        gap: 10px;
328
+                        border-radius: 2px;
329
+                        background: #0082D3;
330
+
331
+
332
+
333
+
334
+                        color: #FFF;
335
+
336
+                        /* text/pc/02-55-Regular */
337
+                        font-family: "Alibaba PuHuiTi 2.0";
338
+                        font-size: 14px;
339
+                        font-style: normal;
340
+                        font-weight: 400;
341
+                        line-height: normal;
342
+                    }
343
+                }
344
+
345
+                .position-type-container {
346
+                    display: flex;
347
+                    justify-content: space-between;
348
+                    margin-top: 20px;
349
+
350
+                    div {
351
+                        flex: 1;
352
+                    }
353
+                }
354
+
355
+                .course-person-rate-container {
356
+                    display: flex;
357
+                    margin-top: 8px;
358
+
359
+                    .course {
360
+                        flex: 1;
361
+                    }
362
+
363
+                    .person-rate-container {
364
+                        flex: 2;
365
+                    }
366
+
367
+                    .person-rate-container {
368
+                        display: flex;
369
+                    }
370
+                }
371
+
372
+                // &:last-child {
373
+                //     margin-bottom: 10px;
374
+                // }
375
+
376
+                // li {
377
+                //     display: flex;
378
+                //     width: 100%;
379
+                //     align-items: center;
380
+                //     justify-content: space-around;
381
+                //     word-wrap: break-word;
382
+                // }
383
+            }
384
+
385
+            .el-button {
386
+                background-color: #5F7BDC;
387
+                color: #fff;
388
+                border: none;
389
+            }
390
+
391
+
392
+        }
393
+    }
394
+
395
+}
396
+
397
+// 通用标题
398
+.title {
399
+    //  width: 380px;
400
+    //  height: 32px;
401
+    //  flex-shrink: 0;
402
+    //  background: linear-gradient(90deg, rgba(255, 255, 255, 0.17) 2.49%, rgba(255, 255, 255, 0.00) 98.69%);
403
+    //  ;
404
+    //  line-height: 32px;
405
+    //  margin: 11px 22px 0 10px;
406
+    //    max-width: 100%;
407
+    //    height: auto;
408
+    width: 439px;
409
+    height: 40px;
410
+    flex-shrink: 0;
411
+    background-size: cover !important;
412
+    padding-left: 78px;
413
+
414
+    .text {
415
+        color: #FFF;
416
+
417
+        font-family: FZCuHeiSongS-B-GB;
418
+        font-size: 18px;
419
+        font-style: normal;
420
+        font-weight: 400;
421
+        line-height: 40px;
422
+        height: 40px;
423
+
424
+    }
425
+}
426
+
427
+// 通用content
428
+.content {
429
+    display: flex;
430
+    width: 100%;
224 431
     //  overflow: hidden;
225
-     justify-content: space-evenly;
226
-
227
- }
228
-
229
- // 点击模型弹出框
230
- .model-detail {
231
-     display: flex;
232
-     justify-content: space-between;
233
-     flex-wrap: wrap;
234
-     //  padding: 10px;
235
-     //  border: 2px solid firebrick;
236
-     border-radius: 10px;
237
-
238
-     span {
239
-         font-size: 15.5px;
240
-         width: 175px;
241
-         font-family: Microsoft YaHei UI;
242
-         // border: 1px solid red;
243
-         margin:  6px 0 6px 4px;
244
-         font-weight: 400;
245
-         //  padding: 0;
246
-
247
-         .title {
248
-             color: #000;
249
-             font-weight: 700;
250
-         }
251
-
252
-         .green {
253
-             color: #00C767;
254
-         }
255
-
256
-         .red {
257
-             color: #DB4A36;
258
-         }
259
-     }
260
- }
261
-
262
- .scroll::-webkit-scrollbar {
263
-     width: 5px;
264
-     height: 5px;
265
-     background-color: transparent;
266
-     border-radius: 3px;
267
- }
268
-
269
- .scroll::-webkit-scrollbar-thumb {
270
-     background-color: #999;
271
-     border-radius: 3px;
272
- }
273
-
274
- .jiaos{
432
+    justify-content: space-evenly;
433
+
434
+}
435
+
436
+// 点击模型弹出框
437
+.model-detail {
438
+    display: flex;
439
+    justify-content: space-between;
440
+    flex-wrap: wrap;
441
+    //  padding: 10px;
442
+    //  border: 2px solid firebrick;
443
+    border-radius: 10px;
444
+
445
+    span {
446
+        font-size: 15.5px;
447
+        width: 175px;
448
+        font-family: Microsoft YaHei UI;
449
+        // border: 1px solid red;
450
+        margin: 6px 0 6px 4px;
451
+        font-weight: 400;
452
+        //  padding: 0;
453
+
454
+        .title {
455
+            color: #000;
456
+            font-weight: 700;
457
+        }
458
+
459
+        .green {
460
+            color: #00C767;
461
+        }
462
+
463
+        .red {
464
+            color: #DB4A36;
465
+        }
466
+    }
467
+}
468
+
469
+.scroll::-webkit-scrollbar {
470
+    width: 5px;
471
+    height: 5px;
472
+    background-color: transparent;
473
+    border-radius: 3px;
474
+}
475
+
476
+.scroll::-webkit-scrollbar-thumb {
477
+    background-color: #999;
478
+    border-radius: 3px;
479
+}
480
+
481
+.jiaos {
275 482
     // background-color: antiquewhite;
276 483
     // color: #000;
277 484
     // overflow-wrap: break-word; 
@@ -281,5 +488,26 @@
281 488
     text-align: center;
282 489
     flex-wrap: wrap;
283 490
     line-height: 16px;
284
-    
491
+
492
+}
493
+
494
+:deep(.el-progress-bar__outer) {
495
+    background-color: #E5BE20;
496
+}
497
+
498
+:deep(.el-button) {
499
+    width: 36px;
500
+    height: 36px;
501
+}
502
+
503
+:deep(.el-input__wrapper) {
504
+    background: rgba(5, 67, 117, 0.34);
505
+    margin-right: 8px;
506
+    border-radius: 2px;
507
+
508
+}
509
+
510
+:deep(.el-tooltip__trigger:focus-visible) {
511
+    outline: unset;
512
+
285 513
 }

+ 27 - 12
src/assets/css/right.scss

@@ -33,21 +33,36 @@
33 33
 
34 34
 // 通用标题
35 35
 .title {
36
-    width: 380px;
37
-    height: 32px;
36
+    //  width: 380px;
37
+    //  height: 32px;
38
+    //  flex-shrink: 0;
39
+    //  background: linear-gradient(90deg, rgba(255, 255, 255, 0.17) 2.49%, rgba(255, 255, 255, 0.00) 98.69%);
40
+    //  ;
41
+    //  line-height: 32px;
42
+    //  margin: 11px 22px 0 10px;
43
+    //    max-width: 100%;
44
+    //    height: auto;
45
+    width: 439px;
46
+    height: 40px;
38 47
     flex-shrink: 0;
39
-    background: linear-gradient(90deg, rgba(255, 255, 255, 0.17) 2.49%, rgba(255, 255, 255, 0.00) 98.69%);
40
-    ;
41
-    line-height: 32px;
42
-    margin: 11px 22px 0 10px;
48
+    background-size: cover !important;
49
+    padding-left: 78px;
43 50
 
44 51
     .text {
45 52
         color: #FFF;
46
-        font-family: PingFang SC;
47
-        padding-left: 18px;
48
-        letter-spacing: 1px;
53
+
54
+        font-family: FZCuHeiSongS-B-GB;
55
+        font-size: 18px;
56
+        font-style: normal;
57
+        font-weight: 400;
58
+        line-height: 40px;
59
+        height: 40px;
60
+
49 61
     }
50 62
 }
63
+.title-mt{
64
+    margin-top: 42px;
65
+}
51 66
 
52 67
 // 通用content
53 68
 .content {
@@ -63,12 +78,12 @@
63 78
     position: absolute;
64 79
     width: 412px;
65 80
 
66
-    top: 11.5vh;
81
+    top: 8vh;
67 82
     z-index: 9;
68 83
     flex-shrink: 0;
69 84
     border-radius: 2px;
70
-    background: rgba(125, 125, 125, 0.17);
71
-    backdrop-filter: blur(30.5px);
85
+    // background: rgba(125, 125, 125, 0.17);
86
+    // backdrop-filter: blur(30.5px);
72 87
     color: #FFF;
73 88
     font-size: 14px;
74 89
     // overflow: hidden;

+ 198 - 0
src/components/Header.vue

@@ -0,0 +1,198 @@
1
+<template>
2
+  <div
3
+    class="header"
4
+    :style="{ background: `url(${headImg}) no-repeat center` }"
5
+  >
6
+    <img class="logo" :src="headLogo" alt="" />
7
+    <div class="title">智慧教室IOC平台</div>
8
+    <!-- <img :src="headImg" alt="" /> -->
9
+    <!-- <div></div> -->
10
+
11
+    <div class="weather">
12
+      <div class="left-time">
13
+        <div class="time">{{ currentTime }}</div>
14
+        <div class="year">{{ getCurrentYMD }}</div>
15
+      </div>
16
+      <el-divider direction="vertical" />
17
+      <div class="right-weatherInfo">
18
+        <img class="weather-icon" :src="sun" alt="" />
19
+        <div class="info">
20
+          <div class="text">{{ weatherInfo.text }}</div>
21
+          <div class="temp">{{ weatherInfo.temp }} <span>°C</span></div>
22
+        </div>
23
+      </div>
24
+    </div>
25
+  </div>
26
+</template>
27
+
28
+
29
+<script setup>
30
+import { ref, computed, onBeforeUnmount, onUnmounted, onMounted } from "vue";
31
+import axios from "axios";
32
+
33
+onMounted(() => {
34
+  // 开启时间定时器获取当前时间
35
+  starttimeInterval();
36
+
37
+  // 获取天气信息
38
+  getWeatherInfo();
39
+});
40
+
41
+// 获取当前年月日计算属性
42
+const getCurrentYMD = computed(() => {
43
+  const now = new Date();
44
+  const year = now.getFullYear();
45
+  const month = String(now.getMonth() + 1).padStart(2, "0");
46
+  const day = String(now.getDate()).padStart(2, "0");
47
+  return `${year}-${month}-${day}`;
48
+});
49
+
50
+// 获取当前时间   umbRQyjXTsyAsbzT4zLI3GNgnPrTBYGD
51
+let currentTime = ref(new Date().toLocaleTimeString());
52
+let timeInterval = ref(null);
53
+const starttimeInterval = () => {
54
+  clearTimeout(timeInterval.value);
55
+  timeInterval.value = setInterval(() => {
56
+    currentTime.value = new Date().toLocaleTimeString();
57
+  }, 1000);
58
+};
59
+
60
+let weatherInfo = ref({});
61
+
62
+const getWeatherInfo = (latitude, Longitude) => {
63
+  const key = "UFwchof57SfCeYaiWXj1F2XBx0w8hKtB";
64
+  //https://api.map.baidu.com/weather/v1/?location=${latitude},${Longitude}&data_type=all&ak=${key}
65
+  axios
66
+    .get(
67
+      `https://api.map.baidu.com/weather/v1/?district_id=222405&data_type=all&ak=${key}`
68
+    )
69
+    .then((res) => {
70
+      weatherInfo.value = res.data.result.now;
71
+      console.log("天气信息", res.data.result.now);
72
+    });
73
+};
74
+
75
+onBeforeUnmount(() => {
76
+  clearTimeout(timeInterval.value);
77
+});
78
+onUnmounted(() => {
79
+  clearTimeout(timeInterval.value);
80
+});
81
+
82
+const headImg = ref("./img/head.png");
83
+const headLogo = ref("./img/logo.png");
84
+const sun = ref("./img/sun.png");
85
+</script>
86
+<style scoped lang="scss">
87
+.header {
88
+  position: absolute;
89
+  z-index: 555;
90
+  margin-bottom: 20px;
91
+  height: 70px;
92
+  width: 100%;
93
+  display: flex;
94
+  background-size: cover !important;
95
+  background-position: center !important;
96
+  background-repeat: no-repeat !important;
97
+  .logo {
98
+    width: 162px;
99
+    height: 50px;
100
+    position: absolute;
101
+    left: 28px;
102
+    top: 50%;
103
+    transform: translateY(-50%);
104
+    
105
+  }
106
+  .title {
107
+    flex: 1;
108
+    text-align: center;
109
+
110
+    color: #fff;
111
+
112
+    font-family: FZCuHeiSongS-B-GB;
113
+    font-size: 40px;
114
+    font-weight: 400;
115
+    line-height: 70px;
116
+    letter-spacing: 8px;
117
+  }
118
+
119
+  .weather {
120
+    position: absolute;
121
+    right: 10px;
122
+    top: 50%;
123
+    transform: translateY(-50%);
124
+    display: flex;
125
+    align-items: center;
126
+    height: 38px;
127
+    .left-time {
128
+        margin-right: 12px;
129
+        height: 38px;
130
+      .time {
131
+        color: #bfdfff;
132
+        text-shadow: 0px 1px 3px rgba(5, 12, 25, 0.54);
133
+        font-family: PangMenZhengDao;
134
+        font-size: 24px;
135
+        font-style: normal;
136
+        font-weight: 600;
137
+      }
138
+      .year {
139
+        color: #bfdfff;
140
+
141
+        text-align: right;
142
+        text-shadow: 0px 1px 3px rgba(5, 12, 25, 0.54);
143
+        font-family: PangMenZhengDao;
144
+        font-size: 12px;
145
+        font-style: normal;
146
+        font-weight: 400;
147
+        line-height: normal;
148
+      }
149
+    }
150
+    .right-weatherInfo {
151
+      display: flex;
152
+      align-items: center;
153
+      height: 38px;
154
+      .weather-icon {
155
+        width: 30px;
156
+        height: 30px;
157
+      }
158
+      .info {
159
+        flex: 1;
160
+        margin-left: 12px;
161
+        height: 38px;
162
+        .text {
163
+          color: #bfdfff;
164
+
165
+          text-shadow: 0px 1px 3px rgba(5, 12, 25, 0.54);
166
+          /* text/pc/03-55-Regular */
167
+          font-family: "Alibaba PuHuiTi 2.0";
168
+          font-size: 12px;
169
+          font-style: normal;
170
+          font-weight: 400;
171
+          line-height: normal;
172
+        }
173
+        .temp {
174
+          color: #bfdfff;
175
+
176
+          text-shadow: 0px 1px 3px rgba(5, 12, 25, 0.54);
177
+          font-family: PangMenZhengDao;
178
+          font-size: 16px;
179
+          font-style: normal;
180
+          font-weight: 400;
181
+          line-height: normal;
182
+          span {
183
+            color: #bfdfff;
184
+            font-family: "Alibaba PuHuiTi 2.0";
185
+            font-size: 16px;
186
+            font-style: normal;
187
+            font-weight: 400;
188
+            line-height: normal;
189
+          }
190
+        }
191
+      }
192
+    }
193
+  }
194
+}
195
+:deep(.el-divider--vertical){
196
+    height: 34px;
197
+}
198
+</style>

+ 68 - 12
src/components/home.vue

@@ -1,12 +1,12 @@
1 1
 <template>
2
-    <div class="container">
3
-        <div class="header">
4
-            <img :src="headImg" alt="" />
5
-        </div>
2
+    <div class="container" :style="{background: `url(${backgroundImg})` }">
3
+        <img src="bgShadow" alt="" style="position: absolute;top: 0px;left: 0px;width: 100%;height: 100%;">
4
+        
5
+        <Header />
6 6
         <el-container>
7 7
             <Left ref="childRef" @childMethod="childMethod"></Left>
8 8
             <right></right>
9
-            <div ref="linedomRef" style="width:1px;height:1px;position: absolute;z-index: 228;background:#ccc;">
9
+            <div ref="linedomRef" style="width:1px;height:1px;position: absolute;top:0px;left:0px;z-index: 228;background:#ccc;">
10 10
             </div>
11 11
 
12 12
         </el-container>
@@ -63,7 +63,7 @@
63 63
 </template>
64 64
 
65 65
 <script>
66
-import { reactive, onMounted, ref, toRefs, onBeforeUnmount, getCurrentInstance, nextTick } from 'vue';
66
+import { reactive, onMounted, ref, toRefs, onBeforeUnmount, getCurrentInstance, nextTick,computed,onUnmounted } from 'vue';
67 67
 import { ElScrollbar, ElPagination, ElDialog, ElCarousel, ElCarouselItem, ElMessage } from "element-plus";
68 68
 import "vue3-video-play/dist/style.css";
69 69
 import { addResponseEventListener } from "../webrtcVideo.js";
@@ -80,9 +80,12 @@ import {
80 80
 
81 81
 import { getVideoUrl } from '../request/api';
82 82
 
83
+import Header from './Header.vue';
84
+
85
+
83 86
 export default ({
84 87
     name: 'Histogram',
85
-    components: { Login, Left, Right, ElScrollbar, ElPagination, ElDialog, videoPlay, ElCarousel, ElCarouselItem, CircleProgress },
88
+    components: { Login, Left, Right, ElScrollbar, ElPagination, ElDialog, videoPlay, ElCarousel, ElCarouselItem, CircleProgress,Header },
86 89
   
87 90
     setup() {
88 91
         const titleDialog = ref("")
@@ -354,13 +357,63 @@ export default ({
354 357
             window.addEventListener('resize', windowSize);
355 358
             // window.addEventListener('click', windowSize);
356 359
             // addResponseEventListener("widowSizeChange", windoChangeFunction);
360
+        })
361
+        // // 获取当前年月日计算属性
362
+
363
+        // const getCurrentYMD =  computed(()=>{
364
+        //     const now = new Date();
365
+        //     const year = now.getFullYear();
366
+        //     const month = String(now.getMonth() + 1).padStart(2, '0');
367
+        //     const day = String(now.getDate()).padStart(2, '0');
368
+        //     return `${year}-${month}-${day}`;
369
+        // })
370
+
371
+        // // 获取当前时间   umbRQyjXTsyAsbzT4zLI3GNgnPrTBYGD
372
+        // let currentTime = ref(new Date().toLocaleTimeString());
373
+        // let timeInterval =ref(null)
374
+        // const starttimeInterval =()=>{
375
+        //     clearTimeout(timeInterval.value)
376
+        //     timeInterval.value = setInterval(() => {
377
+        //     currentTime.value = new Date().toLocaleTimeString();
378
+        // }, 1000);
379
+        // }
380
+
381
+        // let weatherInfo =ref({});
382
+        
383
+        // const getWeatherInfo =(latitude,Longitude)=>{
384
+        //     const key ="UFwchof57SfCeYaiWXj1F2XBx0w8hKtB";
385
+        //     //https://api.map.baidu.com/weather/v1/?location=${latitude},${Longitude}&data_type=all&ak=${key}
386
+        //     axios.get(`https://api.map.baidu.com/weather/v1/?district_id=222405&data_type=all&ak=${key}`).then(res=>{
387
+        //         weatherInfo.value = res.data.result.now;
388
+        //         console.log("天气信息",res.data.result.now)
389
+        //     })
390
+        // }
391
+        
392
+        
393
+
357 394
 
358 395
 
359 396
 
360
-        })
397
+
398
+
399
+        // onBeforeUnmount(() => {
400
+        //     clearTimeout(timeInterval.value)
401
+        // })
402
+        // onUnmounted(() => {
403
+        //     clearTimeout(timeInterval.value)
404
+        // })
405
+
406
+
407
+
408
+
409
+        
410
+
411
+        
361 412
 
362 413
     
363
-        const headImg = ref('./img/head.png')
414
+        // const headImg = ref('./img/head.png')
415
+        const backgroundImg = ref('./img/test_bg.png')
416
+        const bgShadow = ref('./img/bg-shadow.png')
364 417
         return {
365 418
             centerDialogVisible,
366 419
             interDevice,
@@ -376,12 +429,15 @@ export default ({
376 429
             lineContainer,
377 430
             classDeviceInfo,
378 431
             mouseClick,
379
-            headImg,
380 432
             titleDialog,
381 433
             orientation,
382 434
             childMethod,
383
-            childRef
384
-    
435
+            childRef,
436
+            // getCurrentYMD,
437
+            // currentTime,
438
+            // weatherInfo,
439
+            backgroundImg,
440
+            bgShadow
385 441
         }
386 442
     },
387 443
 })

+ 554 - 335
src/components/left.vue

@@ -1,370 +1,589 @@
1 1
 <template>
2
-    <el-aside class="left">
3
-
4
-        <div class="left_top">
5
-            <div class="title">
2
+  <el-aside class="left">
3
+    <div class="left_top">
4
+      <!-- <div class="title">
6 5
                 <div class="text">教室分类统计</div>
6
+            </div> -->
7
+      <div class="title" :style="{ background: `url(${frame})` }">
8
+        <div class="text">教室分类统计</div>
9
+      </div>
10
+
11
+      <div class="content">
12
+        <div
13
+          id="myChart"
14
+          style="width: 140px; height: 140px; margin: 0px 0 30px 18px"
15
+        ></div>
16
+        <div class="list">
17
+          <div class="item" v-for="(item, index) in classRoomCount">
18
+            <!-- <i :style="{ backgroundColor: item.color }"></i> -->
19
+            <svg
20
+              xmlns="http://www.w3.org/2000/svg"
21
+              width="14"
22
+              height="14"
23
+              viewBox="0 0 14 14"
24
+              fill="none"
25
+              v-if="index === 0"
26
+            >
27
+              <path
28
+                d="M14 7C14 10.866 10.866 14 7 14C3.13401 14 0 10.866 0 7C0 3.13401 3.13401 0 7 0C10.866 0 14 3.13401 14 7ZM4.55 7C4.55 8.3531 5.6469 9.45 7 9.45C8.3531 9.45 9.45 8.3531 9.45 7C9.45 5.6469 8.3531 4.55 7 4.55C5.6469 4.55 4.55 5.6469 4.55 7Z"
29
+                fill="#00BBFF"
30
+              />
31
+            </svg>
32
+            <svg
33
+              v-if="index === 1"
34
+              xmlns="http://www.w3.org/2000/svg"
35
+              width="14"
36
+              height="14"
37
+              viewBox="0 0 14 14"
38
+              fill="none"
39
+            >
40
+              <path
41
+                d="M14 7C14 10.866 10.866 14 7 14C3.13401 14 0 10.866 0 7C0 3.13401 3.13401 0 7 0C10.866 0 14 3.13401 14 7ZM4.55 7C4.55 8.3531 5.6469 9.45 7 9.45C8.3531 9.45 9.45 8.3531 9.45 7C9.45 5.6469 8.3531 4.55 7 4.55C5.6469 4.55 4.55 5.6469 4.55 7Z"
42
+                fill="#00EB7D"
43
+              />
44
+            </svg>
45
+            <svg
46
+              v-if="index === 2"
47
+              xmlns="http://www.w3.org/2000/svg"
48
+              width="14"
49
+              height="14"
50
+              viewBox="0 0 14 14"
51
+              fill="none"
52
+            >
53
+              <path
54
+                d="M14 7C14 10.866 10.866 14 7 14C3.13401 14 0 10.866 0 7C0 3.13401 3.13401 0 7 0C10.866 0 14 3.13401 14 7ZM4.55 7C4.55 8.3531 5.6469 9.45 7 9.45C8.3531 9.45 9.45 8.3531 9.45 7C9.45 5.6469 8.3531 4.55 7 4.55C5.6469 4.55 4.55 5.6469 4.55 7Z"
55
+                fill="#FFBB00"
56
+              />
57
+            </svg>
58
+            <div class="descr">
59
+              <span>{{ item.name }}</span>
60
+              <span>{{ item.value }}</span>
7 61
             </div>
8
-            <div class="content">
9
-                <div id="myChart" style="width:140px; height: 140px;margin:48px 0 30px 18px">
10
-                </div>
11
-                <div class="list">
12
-                    <div class="item" v-for="(item, index) in classRoomCount">
13
-                        <i :style="{ backgroundColor: item.color }"></i>
14
-                        <div class="descr">
15
-                            <span>{{ item.name }}</span>
16
-                            <span>{{ item.value }}</span>
17
-                        </div>
18
-                    </div>
19
-                </div>
20
-            </div>
62
+          </div>
21 63
         </div>
22
-        <div class="left-center">
23
-            <div class="title">
24
-                <div class="text">本周课程统计</div>
25
-            </div>
26
-            <div class="content">
27
-                <div class="count" v-for="(item, index) in classCount" :key="index">
28
-                    <CircleProgress :target-value="item.number" :color="item.color" :text="item.text" text-position="bottom">
29
-                        <img :src="leftimg + item.imgnumber + '.png'" alt="">
30
-                    </CircleProgress>
31
-                    <div class="text">{{ item.text }}</div>
32
-
33
-                </div>
34
-            </div>
64
+      </div>
65
+    </div>
66
+    <div class="left-center">
67
+      <div class="title" :style="{ background: `url(${frame})` }">
68
+        <div class="text">本周课程统计</div>
69
+      </div>
70
+      <div class="content">
71
+        <div class="count" v-for="(item, index) in classCount" :key="index">
72
+          <CircleProgress
73
+            :target-value="item.number"
74
+            :color="item.color"
75
+            :text="item.text"
76
+            text-position="bottom"
77
+          >
78
+            <img :src="leftimg + item.imgnumber + '.png'" alt="" />
79
+          </CircleProgress>
80
+          <div class="text">{{ item.text }}</div>
35 81
         </div>
82
+      </div>
83
+    </div>
36 84
 
37
-        <div class="left-bottom">
38
-            <div class="title">
39
-                <div class="text">智慧教室使用明细</div>
85
+    <div class="left-bottom">
86
+      <div class="title" :style="{ background: `url(${frame})` }">
87
+        <div class="text">教室使用明细</div>
88
+      </div>
89
+      <div class="usering-free-container">
90
+        <div class="usering-free">
91
+          <div class="usering-box">
92
+            <div class="text">使用中72.56% <span class="num">657间</span></div>
93
+          </div>
94
+          <div class="free-box">
95
+            <div class="text">
96
+              空闲中:28.44% <span class="num">657间</span>
40 97
             </div>
41
-
42
-            <div class="content" style="height: 100%;overflow: hidden;">
43
-                <div class="table">
44
-                    <ul class="th">
45
-                        <li>教室</li>
46
-                        <li>使用状态</li>
47
-                        <li class="long">实到/应到人数</li>
48
-                        <li>到课率</li>
49
-                        <li>操作</li>
50
-                    </ul>
51
-                    <div ref="testMain" style="height: 342px;overflow: scroll;" class="scroll">
52
-                        <ul v-for="item in classRoom" @mouseenter="testMove" @mouseleave="testMend">
53
-                            <li class="jiaos"> {{ item.class }} </li>
54
-                            <li>{{ item.status }}</li>
55
-                            <li >{{ item.people || '—'}}</li>
56
-                            <li >{{ item.percentage ?item.percentage: '—' }}</li>
57
-                      
58
-                            <li>
59
-                                <el-button size="small" v-if="item.leaf" class="look" @click.prevent="handleRoom(item)">查看</el-button>
60
-                            </li>
61
-
62
-                        </ul>
63
-
64
-                    </div>
65
-
98
+          </div>
99
+        </div>
100
+        <el-progress :percentage="72.56" :show-text="false" color="#1BCEFF" />
101
+      </div>
102
+      <div class="search-container">
103
+        <el-input v-model="searchData" placeholder="请输入大楼名称、教室名称" />
104
+        <el-button type="primary" :icon="Search" @click="searchHandel" />
105
+      </div>
106
+
107
+      <div class="content" style="height: 100%; overflow: hidden">
108
+        <div class="table">
109
+          <div class="dropdown-container">
110
+            <el-dropdown trigger="click" @click="clickdropdown">
111
+              <span class="dropdown-name">
112
+                全部大楼
113
+                <Edit style="width: 1em; height: 1em; margin-right: 8px" />
114
+              </span>
115
+              <template #dropdown>
116
+                <el-dropdown-menu>
117
+                  <el-dropdown-item>一号大楼</el-dropdown-item>
118
+                  <el-dropdown-item>二号大楼</el-dropdown-item>
119
+                  <el-dropdown-item>三号大楼</el-dropdown-item>
120
+                </el-dropdown-menu>
121
+              </template>
122
+            </el-dropdown>
123
+            <el-dropdown trigger="click">
124
+              <span class="dropdown-name">
125
+                全部类型
126
+                <el-icon>
127
+                  <arrow-down />
128
+                </el-icon>
129
+              </span>
130
+              <template #dropdown>
131
+                <el-dropdown-menu>
132
+                  <el-dropdown-item>一号大楼</el-dropdown-item>
133
+                  <el-dropdown-item>二号大楼</el-dropdown-item>
134
+                  <el-dropdown-item>三号大楼</el-dropdown-item>
135
+                </el-dropdown-menu>
136
+              </template>
137
+            </el-dropdown>
138
+            <el-dropdown trigger="click">
139
+              <span class="dropdown-name">
140
+                全部楼层
141
+                <el-icon>
142
+                  <arrow-down />
143
+                </el-icon>
144
+              </span>
145
+              <template #dropdown>
146
+                <el-dropdown-menu>
147
+                  <el-dropdown-item>一号大楼</el-dropdown-item>
148
+                  <el-dropdown-item>二号大楼</el-dropdown-item>
149
+                  <el-dropdown-item>三号大楼</el-dropdown-item>
150
+                </el-dropdown-menu>
151
+              </template>
152
+            </el-dropdown>
153
+            <el-dropdown trigger="click">
154
+              <span class="dropdown-name">
155
+                全部状态
156
+                <el-icon>
157
+                  <arrow-down />
158
+                </el-icon>
159
+              </span>
160
+              <template #dropdown>
161
+                <el-dropdown-menu>
162
+                  <el-dropdown-item>一号大楼</el-dropdown-item>
163
+                  <el-dropdown-item>二号大楼</el-dropdown-item>
164
+                  <el-dropdown-item>三号大楼</el-dropdown-item>
165
+                </el-dropdown-menu>
166
+              </template>
167
+            </el-dropdown>
168
+          </div>
169
+
170
+          <!-- <ul class="th">
171
+            <li>教室</li>
172
+            <li>使用状态</li>
173
+            <li class="long">实到/应到人数</li>
174
+            <li>到课率</li>
175
+            <li>操作</li>
176
+          </ul> -->
177
+          <div
178
+            ref="testMain"
179
+            style="height: 342px; overflow: scroll; margin-top: 8px"
180
+            class="scroll"
181
+          >
182
+            <div
183
+              v-for="item in classRoom"
184
+              @mouseenter="testMove"
185
+              @mouseleave="testMend"
186
+              class="list-item"
187
+            >
188
+              <div class="class-status-btn-container">
189
+                <div class="left-class-status">
190
+                  <div>{{ item.class }}</div>
191
+                  <!-- <div>{{ item?.status }}</div> -->
192
+                  <!-- <el-tag effect="Plain">Tag 1</el-tag> -->
193
+                </div>
194
+                <div class="right-btn" @click.prevent="handleRoom(item)">
195
+                  查看
196
+                </div>
197
+              </div>
198
+              <div class="position-type-container">
199
+                <div>位置:1号教学楼A201</div>
200
+                <div>类型:智慧教室</div>
201
+              </div>
202
+              <div class="course-person-rate-container">
203
+                <div class="course">课程:软件测试</div>
204
+                <div class="person-rate-container">
205
+                  <div>实到/应到:40/48</div>
206
+                  <div>到课率:90%</div>
66 207
                 </div>
208
+              </div>
209
+              <!-- <div class="jiaos">{{ item.class }}</div>
210
+              <div>{{ item?.status }}</div>
211
+              <div>{{ item.people || "—" }}</div>
212
+              <div>{{ item.percentage ? item.percentage : "—" }}</div>
213
+
214
+              <div>
215
+                <el-button
216
+                  size="small"
217
+                  v-if="item.leaf"
218
+                  class="look"
219
+                  @click.prevent="handleRoom(item)"
220
+                  >查看</el-button
221
+                >
222
+              </div> -->
67 223
             </div>
224
+          </div>
68 225
         </div>
69
-
70
-
71
-         
72
-     
73
-    </el-aside>
74
-
75
-
76
-
77
-        <div  ref="popoverRef" v-if="roomVisible" style="background-color: rgba(245, 246, 248, 0.9); border-radius: 10px;position: absolute; top: 10vh; left: 50%; width: 366px;z-index: 999; transform: translateX(-50%);">
78
-
79
-         
226
+      </div>
227
+    </div>
228
+  </el-aside>
229
+
230
+  <div
231
+    ref="popoverRef"
232
+    v-if="roomVisible"
233
+    style="
234
+      background-color: rgba(245, 246, 248, 0.9);
235
+      border-radius: 10px;
236
+      position: absolute;
237
+      top: 10vh;
238
+      left: 50%;
239
+      width: 366px;
240
+      z-index: 999;
241
+      transform: translateX(-50%);
242
+    "
243
+  >
80 244
     <div class="model-detail">
81
-        <span><span class="title">教室状态: </span>
82
-            <span :class="classInfo.online ? 'green' : 'red'">{{ classInfo &&
83
-                classInfo.status }}</span>
245
+      <span
246
+        ><span class="title">教室状态: </span>
247
+        <span :class="classInfo.online ? 'green' : 'red'">{{
248
+          classInfo && classInfo?.status
249
+        }}</span>
250
+      </span>
251
+
252
+      <span
253
+        ><span class="title">班级: </span>
254
+        <span style="width: 105px; display: inline-flex">{{
255
+          classInfo && classInfo.className
256
+        }}</span>
257
+      </span>
258
+      <span
259
+        ><span class="title">课程名称: </span>
260
+        <span style="width: 94px; display: inline-flex">{{
261
+          classInfo && classInfo.courseName
262
+        }}</span>
263
+      </span>
264
+      <span
265
+        ><span class="title">应到人数: </span
266
+        >{{ classInfo && classInfo.expected }}</span
267
+      >
268
+      <span
269
+        ><span class="title">教室: </span>
270
+        <span style="width: 120px; display: inline-flex">
271
+          {{ classInfo && classInfo.class }}
84 272
         </span>
85
-
86
-
87
-
88
-        <span><span class="title">班级: </span>  <span style="width: 105px; display: inline-flex;">{{ classInfo && classInfo.className }}</span> </span>
89
-        <span><span class="title">课程名称: </span>   <span style="width: 94px; display: inline-flex;">{{ classInfo && classInfo.courseName }}</span>    </span>
90
-        <span><span class="title">应到人数: </span>{{ classInfo && classInfo.expected }}</span>
91
-        <span><span class="title">教室: </span>  <span style=";width: 120px; display: inline-flex;"> {{ classInfo && classInfo.class }} </span>     </span>
92
-        <span><span class="title">实到人数: </span>{{ classInfo && classInfo.actual }}</span>
93
-        <span><span class="title">老师: </span>{{ classInfo && classInfo.teacher }}</span>
273
+      </span>
274
+      <span
275
+        ><span class="title">实到人数: </span
276
+        >{{ classInfo && classInfo.actual }}</span
277
+      >
278
+      <span
279
+        ><span class="title">老师: </span
280
+        >{{ classInfo && classInfo.teacher }}</span
281
+      >
94 282
     </div>
95
-
96
-    </div>
97
-
98
-
99
-
283
+  </div>
100 284
 </template>
101 285
 
102 286
 <script >
103
-
104
-
105
-
106 287
 import * as echarts from "echarts";
107
-import { reactive, onMounted, ref, onBeforeUnmount, onUnmounted, nextTick, getCurrentInstance } from 'vue';
108
-import { ElScrollbar, ElPagination, ElDialog, ElCarousel, ElCarouselItem } from "element-plus";
109
-import { getClass } from '../request/api'
110
-import CircleProgress from './CircleProgress.vue';
111
-import { callUIInteraction }
112
-    from "../webrtcVideo";
113
-
114
-export default ({
115
-
116
-    name: 'Histogram',
117
-    components: { ElScrollbar, ElPagination, ElDialog, ElCarousel, ElCarouselItem, CircleProgress },
118
-    setup(_, { emit }) {
119
-        // 教室分类统计
120
-        const classRoomCount = ref([])
121
-
122
-        const classPie = reactive({
123
-            option: {
124
-                color: ['#4ED2E4', '#5E91F6', '#67F0A8'],
125
-                tooltip: {
126
-                    trigger: 'item',
127
-                    position: 'right'
128
-                },
129
-
130
-                series: [{
131
-                    type: 'pie',
132
-                    radius: ['60%', '90%'],
133
-                    avoidLabelOverlap: false,
134
-                    label: {
135
-                        show: true,
136
-                        position: 'center',
137
-                        color: '#fff',
138
-                        formatter: () => { // 格式化要展示的文本
139
-                            return `总计\n\n${roomtotle.value}间`
140
-                        },
141
-
142
-                        // formatter: '{total|' + 200 + '}' + '\n\r' + '{active|共发布活动}',
143
-                        // 等着获取了数据在给样式
144
-                        // rich: {
145
-                        //     total: {
146
-                        //         fontSize: 35,
147
-                        //         fontFamily: "微软雅黑",
148
-                        //         color: '#454c5c'
149
-                        //     },
150
-                        //     active: {
151
-                        //         fontFamily: "微软雅黑",
152
-                        //         fontSize: 16,
153
-                        //         color: '#6c7a89',
154
-                        //         lineHeight: 30,
155
-                        //     },
156
-                        // }
157
-
158
-                    },
159
-                    labelLine: {
160
-                        show: false
161
-                    },
162
-                    data: classRoomCount
163
-
164
-                }]
288
+import {
289
+  reactive,
290
+  onMounted,
291
+  ref,
292
+  onBeforeUnmount,
293
+  onUnmounted,
294
+  nextTick,
295
+  getCurrentInstance,
296
+} from "vue";
297
+import {
298
+  ElScrollbar,
299
+  ElPagination,
300
+  ElDialog,
301
+  ElCarousel,
302
+  ElCarouselItem,
303
+  ElIcon,
304
+} from "element-plus";
305
+import { Search, ArrowDown } from "@element-plus/icons-vue";
306
+
307
+import { getClass } from "../request/api";
308
+import CircleProgress from "./CircleProgress.vue";
309
+import { callUIInteraction } from "../webrtcVideo";
310
+
311
+export default {
312
+  name: "Histogram",
313
+  components: {
314
+    ElScrollbar,
315
+    ElPagination,
316
+    ElDialog,
317
+    ElCarousel,
318
+    ElCarouselItem,
319
+    CircleProgress,
320
+  },
321
+  setup(_, { emit }) {
322
+    // 教室分类统计
323
+    const classRoomCount = ref([]);
324
+
325
+    const classPie = reactive({
326
+      option: {
327
+        color: ["#4ED2E4", "#5E91F6", "#67F0A8"],
328
+        tooltip: {
329
+          trigger: "item",
330
+          position: "right",
331
+        },
332
+
333
+        series: [
334
+          {
335
+            type: "pie",
336
+            radius: ["60%", "90%"],
337
+            avoidLabelOverlap: false,
338
+            label: {
339
+              show: true,
340
+              position: "center",
341
+              color: "#fff",
342
+              formatter: () => {
343
+                // 格式化要展示的文本
344
+                return `总计\n\n${roomtotle.value}间`;
345
+              },
346
+
347
+              // formatter: '{total|' + 200 + '}' + '\n\r' + '{active|共发布活动}',
348
+              // 等着获取了数据在给样式
349
+              // rich: {
350
+              //     total: {
351
+              //         fontSize: 35,
352
+              //         fontFamily: "微软雅黑",
353
+              //         color: '#454c5c'
354
+              //     },
355
+              //     active: {
356
+              //         fontFamily: "微软雅黑",
357
+              //         fontSize: 16,
358
+              //         color: '#6c7a89',
359
+              //         lineHeight: 30,
360
+              //     },
361
+              // }
165 362
             },
166
-        })
167
-        const initeCharts = () => {
168
-            let myChart = echarts.init(document.getElementById('myChart'))
169
-            // 绘制图表
170
-            console.log("绘制图表", classPie.option)
171
-            myChart.setOption(classPie.option)
172
-        }
173
-
174
-
175
-        // 物联设备类型统计
176
-        const interDevice = ref([])
177
-
178
-        const roomVisible = ref(false)
179
-
180
-        //消失面板
181
-        const clearPanel=()=>{
182
-            roomVisible.value = false;
183
-        }
184
-
185
-        const popoverRef = ref(null)
186
-        const triggerRef = ref({
187
-            getBoundingClientRect() {
188
-                // console.log("positon----方法返回元素的大小及其相对于视口的位置", position.value)
189
-                return position.value
363
+            labelLine: {
364
+              show: false,
190 365
             },
191
-        })
192
-        // 点击某个模型跟随移动
193
-        const mousemoveHandler = (x, y) => {
194
-            position.value = DOMRect.fromRect({
195
-                width: 0,
196
-                height: 0,
197
-                x: x,
198
-                y: y,
199
-            })
200
-        }
201
-        const position = ref({
202
-            top: 0,
203
-            left: 0,
204
-            bottom: 0,
205
-            right: 0,
206
-        })
207
-        let classInfo = ref({})
208
-        const handleRoom = function (item) {
209
-
210
-
211
-            //查看前隐藏
212
-            let a1=document.getElementById('popoverRef')
213
-            a1.style.display = "none"
214
-
215
-            emit('childMethod');
216
-
217
-        console.log('kankanitem',item);
218
-       setTimeout(() => {
366
+            data: classRoomCount,
367
+          },
368
+        ],
369
+      },
370
+    });
371
+    const initeCharts = () => {
372
+      let myChart = echarts.init(document.getElementById("myChart"));
373
+      // 绘制图表
374
+      console.log("绘制图表", classPie.option);
375
+      myChart.setOption(classPie.option);
376
+    };
377
+
378
+    // 物联设备类型统计
379
+    const interDevice = ref([]);
380
+
381
+    const roomVisible = ref(false);
382
+
383
+    //消失面板
384
+    const clearPanel = () => {
385
+      roomVisible.value = false;
386
+    };
387
+
388
+    const popoverRef = ref(null);
389
+    const triggerRef = ref({
390
+      getBoundingClientRect() {
391
+        // console.log("positon----方法返回元素的大小及其相对于视口的位置", position.value)
392
+        return position.value;
393
+      },
394
+    });
395
+    // 点击某个模型跟随移动
396
+    const mousemoveHandler = (x, y) => {
397
+      position.value = DOMRect.fromRect({
398
+        width: 0,
399
+        height: 0,
400
+        x: x,
401
+        y: y,
402
+      });
403
+    };
404
+    const position = ref({
405
+      top: 0,
406
+      left: 0,
407
+      bottom: 0,
408
+      right: 0,
409
+    });
410
+    let classInfo = ref({});
411
+    const handleRoom = function (item) {
412
+      //查看前隐藏
413
+      let a1 = document.getElementById("popoverRef");
414
+      a1.style.display = "none";
415
+
416
+      emit("childMethod");
417
+
418
+      console.log("kankanitem", item);
419
+      setTimeout(() => {
219 420
         roomVisible.value = true;
220
-            classInfo.value = item;
221
-         
222
-            classInfo.value.online = classInfo.value.status == "在用" ? true : false
223
-       }, 2400);
224
-    
225
-            mousemoveHandler(1000, 60)
226
-
227
-            let meg =item
228
-
229
-
230
-            // let a2 =`roomName=${item.class}`
231
-           
232
-            console.log("meg是多少",meg);
233
-
234
-
235
-            callUIInteraction(meg)
236
-   
237
-        }
238
-
239
-
240
-
241
-
242
-        // 本周课程统计数据
243
-        const classCount = ref([])
244
-        // 智慧教室使用数据
245
-        const classRoom = ref([])
246
-        const roomtotle = ref([])
247
-
248
-
249
-
250
-
251
-        const getClassData = async () => {
252
-            let res = await getClass()
253
-            console.log("res----教室分类统计", res)
254
-            let { course, classroomDetail, category } = res.data;
255
-            classRoomCount.value = category;
256
-
257
-            //获取教室总数
258
-            roomtotle.value= category.reduce((accumulator, currentValue) => accumulator + currentValue.value, 0);
259
-            console.log('categorycategory',roomtotle);
260
-
261
-            if (classRoomCount.value) {
262
-                initeCharts()
263
-            }
264
-            classCount.value = course;
265
-            console.log("看一下颜色", classCount.value)
266
-            classRoom.value = classroomDetail
267
-
268
-        }
269
-
270
-        let timer = ref(null)
271
-        let testMain = ref(null)
272
-        onMounted(() => {
273
-
274
-            getClassData()
275
-            start()
276
-        })
277
-
278
-
279
-        onBeforeUnmount(() => {
280
-            clearTimeout(timer.value)
281
-        })
282
-        onUnmounted(() => {
283
-            clearTimeout(timer.value)
284
-        })
285
-
286
-
287
-        function testMove() {
288
-            clearTimeout(timer.value)
289
-        }
421
+        classInfo.value = item;
422
+
423
+        classInfo.value.online =
424
+          classInfo.value?.status == "在用" ? true : false;
425
+      }, 2400);
426
+
427
+      mousemoveHandler(1000, 60);
428
+
429
+      let meg = item;
430
+
431
+      // let a2 =`roomName=${item.class}`
432
+
433
+      console.log("meg是多少", meg);
434
+
435
+      callUIInteraction(meg);
436
+    };
437
+
438
+    // 本周课程统计数据
439
+    const classCount = ref([]);
440
+    // 智慧教室使用数据
441
+    const classRoom = ref([]);
442
+    const roomtotle = ref([]);
443
+
444
+    const getClassData = async () => {
445
+      let res = await getClass();
446
+
447
+      let { course, classroomDetail, category } = res.data;
448
+      classRoomCount.value = category;
449
+
450
+      //获取教室总数
451
+      roomtotle.value = category.reduce(
452
+        (accumulator, currentValue) => accumulator + currentValue.value,
453
+        0
454
+      );
455
+
456
+      if (classRoomCount.value) {
457
+        initeCharts();
458
+      }
459
+      classCount.value = course;
460
+
461
+      classRoom.value = classroomDetail;
462
+      // 开启教师统计数据刷新
463
+      starttimeInterval();
464
+    };
465
+
466
+    let timer = ref(null);
467
+    let testMain = ref(null);
468
+    onMounted(() => {
469
+      getClassData();
470
+      start();
471
+    });
472
+
473
+    onBeforeUnmount(() => {
474
+      clearTimeout(timer.value);
475
+      //清除教师统计数据刷新定时器
476
+      clearTimeout(classRoomInterval.value);
477
+    });
478
+    onUnmounted(() => {
479
+      clearTimeout(timer.value);
480
+      //清除教师统计数据刷新定时器
481
+      clearTimeout(classRoomInterval.value);
482
+    });
483
+
484
+    function testMove() {
485
+      clearTimeout(timer.value);
486
+    }
290 487
 
291
-        function testMend() {
292
-            start()
293
-        }
294
-        //开启定时器方法
295
-        function start() {
296
-            //清除定时器
297
-            clearTimeout(timer.value)
298
-            //定时器触发周期
299
-            let speed = ref(75)
300
-            timer.value = setInterval(MarqueeTest, speed.value)
301
-        }
302
-        function MarqueeTest() {
303
-            let test1 = testMain.value
304
-
305
-            //判断组件是否渲染完成
306
-            if (test1.offsetHeight == 0) {
307
-                test1 = testMain.value
308
-            } else {
309
-                //如果列表数量过少不进行滚动
310
-                // console.log("test1", test1.scrollTop)
311
-                if (test1.childNodes.length < 6) {
312
-                    clearTimeout(timer.value)
313
-                    return;
314
-                }
315
-                //组件进行滚动
316
-                test1.scrollTop += 1
317
-
318
-                //判断滚动条是否滚动到底部
319
-                if (test1.scrollTop == (test1.scrollHeight - test1.clientHeight)) {
320
-                    //获取组件第一个节点
321
-                    let a = test1.childNodes[0]
322
-                    //删除节点
323
-                    test1.removeChild(a)
324
-                    //将该节点拼接到组件最后
325
-                    test1.append(a)
326
-                }
327
-            }
488
+    function testMend() {
489
+      start();
490
+    }
491
+    //开启定时器方法
492
+    function start() {
493
+      //清除定时器
494
+      clearTimeout(timer.value);
495
+      //定时器触发周期
496
+      let speed = ref(75);
497
+      timer.value = setInterval(MarqueeTest, speed.value);
498
+    }
499
+    function MarqueeTest() {
500
+      let test1 = testMain.value;
501
+
502
+      //判断组件是否渲染完成
503
+      if (test1.offsetHeight == 0) {
504
+        test1 = testMain.value;
505
+      } else {
506
+        //如果列表数量过少不进行滚动
507
+        // console.log("test1", test1.scrollTop)
508
+        if (test1.childNodes.length < 6) {
509
+          clearTimeout(timer.value);
510
+          return;
328 511
         }
329
-        const leftimg = ref("./img/")
330
-        return {
331
-            roomVisible,
332
-            classCount,
333
-            classRoom,
334
-            interDevice,
335
-            handleRoom,
336
-            testMend,
337
-            testMove,
338
-            testMain,
339
-            popoverRef,
340
-            classRoomCount,
341
-            triggerRef,
342
-            classInfo,
343
-            leftimg,
344
-            clearPanel
512
+        //组件进行滚动
513
+        test1.scrollTop += 1;
514
+
515
+        //判断滚动条是否滚动到底部
516
+        if (test1.scrollTop == test1.scrollHeight - test1.clientHeight) {
517
+          //获取组件第一个节点
518
+          let a = test1.childNodes[0];
519
+          //删除节点
520
+          test1.removeChild(a);
521
+          //将该节点拼接到组件最后
522
+          test1.append(a);
345 523
         }
346
-    },
347
-})
524
+      }
525
+    }
348 526
 
527
+    // 定时刷新教师统计数据
528
+    let classRoomInterval = ref(null);
529
+    const starttimeInterval = () => {
530
+      clearTimeout(classRoomInterval.value);
531
+      classRoomInterval.value = setInterval(() => {
532
+        getClassData();
533
+      }, 5000);
534
+    };
535
+
536
+    // 搜索
537
+    let searchData = ref("");
538
+    const searchHandel = () => {
539
+      console.log("搜索", searchData.value);
540
+    };
541
+
542
+    const leftimg = ref("./img/");
543
+    const frame = ref("./img/frame.png");
544
+    return {
545
+      roomVisible,
546
+      classCount,
547
+      classRoom,
548
+      interDevice,
549
+      handleRoom,
550
+      testMend,
551
+      testMove,
552
+      testMain,
553
+      popoverRef,
554
+      classRoomCount,
555
+      triggerRef,
556
+      classInfo,
557
+      leftimg,
558
+      clearPanel,
559
+      frame,
560
+      Search,
561
+      ArrowDown,
562
+      ElIcon,
563
+      searchData,
564
+      searchHandel,
565
+    };
566
+  },
567
+};
349 568
 </script>
350 569
 
351 570
 <style scoped lang="scss">
352
-@import '../assets/css/left.scss';
571
+@import "../assets/css/left.scss";
353 572
 </style>
354 573
 <style>
355 574
 .classpopover {
356
-    .el-popper__arrow {
357
-        top: 196px !important;
358
-    }
359
-
360
-    .el-popper[data-popper-placement^=bottom],
361
-    .el-popper__arrow::before {
362
-        border-left-color: transparent !important;
363
-        border-top-color: transparent !important;
364
-    }
575
+  .el-popper__arrow {
576
+    top: 196px !important;
577
+  }
578
+
579
+  .el-popper[data-popper-placement^="bottom"],
580
+  .el-popper__arrow::before {
581
+    border-left-color: transparent !important;
582
+    border-top-color: transparent !important;
583
+  }
365 584
 }
366 585
 
367 586
 .el-popper.is-light {
368
-    border-radius: 10px;
587
+  border-radius: 10px;
369 588
 }
370 589
 </style>

+ 345 - 313
src/components/right.vue

@@ -1,349 +1,381 @@
1 1
 <template>
2
-    <el-aside class="right">
3
-        <div class="right_top">
4
-            <div class="title">
5
-                <div class="text">物联设备统计</div>
2
+  <el-aside class="right">
3
+    <div class="right_top">
4
+
5
+      <div class="title" :style="{ background: `url(${frame})` }">
6
+        <div class="text">物联设备统计</div>
7
+      </div>
8
+      <div class="content">
9
+        <div class="logo">
10
+          <span>{{ equipmentTotal.total }}</span>
11
+          <img class="animate" :src="d1img" alt="" />
12
+          <img :src="d12img" alt="" />
13
+          <span><b>总数</b>(个)</span>
14
+        </div>
15
+        <div class="list">
16
+          <div class="item_r">
17
+            <img :src="d2img" alt="" />
18
+            <div
19
+              class="percent"
20
+              style="display: flex; justify-content: space-between"
21
+            >
22
+              <a>在线</a> <a>{{ equipmentTotal.online }} <span>(个)</span> </a>
6 23
             </div>
7
-            <div class="content">
8
-                <div class="logo">
9
-                    <span>{{ equipmentTotal.total }}</span>
10
-                    <img class="animate" :src="d1img" alt="">
11
-                    <img :src="d12img" alt="">
12
-                    <span><b>总数</b>(个)</span>
13
-                </div>
14
-                <div class="list">
15
-                    <div class="item_r">
16
-                        <img :src="d2img" alt="">
17
-                        <div class="percent" style="display: flex;justify-content: space-between;">
18
-                            <a>在线</a> <a>{{ equipmentTotal.online }} <span>(个)</span> </a>
19
-                            
20
-                        </div>
21
-                    </div>
22
-                    <div class="item_r">
23
-                        <img :src="d3img" alt="">
24
-                        <div class="percent" style="display: flex;justify-content: space-between;">
25
-                            <a>离线</a> <a>{{ equipmentTotal.underline }} <span>(个)</span> </a>
26
-                             
27
-                    
28
-                        </div>
29
-                    </div>
30
-                </div>
24
+          </div>
25
+          <div class="item_r">
26
+            <img :src="d3img" alt="" />
27
+            <div
28
+              class="percent"
29
+              style="display: flex; justify-content: space-between"
30
+            >
31
+              <a>离线</a>
32
+              <a>{{ equipmentTotal.underline }} <span>(个)</span> </a>
31 33
             </div>
34
+          </div>
32 35
         </div>
33
-
34
-        <div class="right_center">
35
-            <div class="title">
36
-                <div class="text">物联设备类型统计</div>
37
-            </div>
38
-            <div class="contentwrap">
39
-                <div class="count" v-for="(item, index) in interDevice" :key="index">
40
-                    <CircleProgress :target-value="item.number" :color="item.color" text-position="top">
41
-                        <img :src="deviceImg + item.icon + '.png'" alt="">
42
-                        <!-- <img :src="'src/assets/img/' + item.icon + '.png'" alt=""> -->
43
-                    </CircleProgress>
44
-
45
-                    <div  class="text">{{ item.text }}</div>
46
-
47
-                    <!-- <el-tooltip placement="bottom">
36
+      </div>
37
+    </div>
38
+
39
+    <div class="right_center">
40
+      <div class="title title-mt " :style="{ background: `url(${frame})` }">
41
+        <div class="text">物联设备类型统计</div>
42
+      </div>
43
+      <div class="contentwrap">
44
+        <div class="count" v-for="(item, index) in interDevice" :key="index">
45
+          <CircleProgress
46
+            :target-value="item.number"
47
+            :color="item.color"
48
+            text-position="top"
49
+          >
50
+            <img :src="deviceImg + item.icon + '.png'" alt="" />
51
+            <!-- <img :src="'src/assets/img/' + item.icon + '.png'" alt=""> -->
52
+          </CircleProgress>
53
+
54
+          <div class="text">{{ item.text }}</div>
55
+
56
+          <!-- <el-tooltip placement="bottom">
48 57
                         <template    #content> multiple lines<br />second line </template>
49 58
                         <el-text style="width: 100px;" class="w-100px mb-2" truncated>
50 59
                             测试测试测试
51 60
                         </el-text>
52 61
                     </el-tooltip> -->
53
-            
54
-                </div>
55
-            </div>
56 62
         </div>
57
-
58
-        <div class="right_bottom">
59
-            <div class="title">
60
-                <div class="text">智慧教室实时监控</div>
63
+      </div>
64
+    </div>
65
+
66
+    <div class="right_bottom">
67
+      <div class="title title-mt" :style="{ background: `url(${frame})` }">
68
+        <div class="text">教室实时监控</div>
69
+      </div>
70
+
71
+      <div class="monitorContent">
72
+        <el-carousel class="monitor">
73
+          <el-carousel-item v-for="(item, index) in carouselData" :key="index">
74
+            <p style="margin-left: 12px; margin-bottom: 3px; font-size: 14px">
75
+              {{ item.activeMonitor?.title }}
76
+            </p>
77
+            <div class="interactclass">
78
+              <div
79
+                class="room"
80
+                v-for="(item, index) in item.activeMonitor?.array"
81
+                :key="index"
82
+              >
83
+                <span style="z-index: 99">{{ item?.title }}</span>
84
+                <!-- <img :src="deviceImg + 'rb2.png'" alt="" @click="lookVideo(item)"> -->
85
+                <div
86
+                  v-if="item.src"
87
+                  style="width: 100%; height: 100%"
88
+                  @click="lookVideo(item)"
89
+                >
90
+                  <div class="vue3VideoPlay">
91
+                    <vue3VideoPlay
92
+                      width="100%"
93
+                      height="8.8vh"
94
+                      style="object-fit: fill"
95
+                      :src="item.src"
96
+                      :type="videoData.type"
97
+                      :autoPlay="true"
98
+                      :control="false"
99
+                      :preload="meta"
100
+                    />
101
+                  </div>
102
+                </div>
103
+              </div>
61 104
             </div>
62 105
 
63
-            <div class="monitorContent">
64
-                <el-carousel class="monitor">
65
-                    <el-carousel-item v-for="(item, index) in carouselData" :key="index">
66
-                        <p style="margin-left: 12px; margin-bottom: 3px; font-size: 14px;">{{ item.activeMonitor.title }}</p>
67
-                        <div class="interactclass">
68
-                            <div class="room" v-for="(item, index) in item.activeMonitor.array" :key="index">
69
-                                <span style="z-index: 99;">{{ item.title }}</span>
70
-                                <!-- <img :src="deviceImg + 'rb2.png'" alt="" @click="lookVideo(item)"> -->
71
-                                <div v-if="item.src"  style="width: 100%;height: 100%;" @click="lookVideo(item)">
72
-                                    <div  class="vue3VideoPlay ">
73
-                                        <vue3VideoPlay 
74
-                                    
75
-                                    width="100%"
76
-                                    height="8.8vh"
77
-                                    style=" object-fit: fill"
78
-                                    :src="item.src"
79
-                                    :type="videoData.type"
80
-                                    :autoPlay="true"
81
-                                    :control="false"
82
-                                    :preload="meta"
83
-                                   />
84
-
85
-                                    </div>
86
-                                </div>
87
-                            </div>
88
-                        </div>
89
-
90
-                        <p style="margin-top: 18px;margin-left: 12px;  margin-bottom: 3px; font-size: 14px; " >{{ item.activeMonitor.title1 }}</p>
91
-                        <div class="interactclass">
92
-                            <div class="room" v-for="(item, index) in item.activeMonitor.array1" :key="index">
93
-                                <span  style="z-index: 99;">{{ item.title }}</span>
94
-                                <!-- <br>
106
+            <p
107
+              style="
108
+                margin-top: 18px;
109
+                margin-left: 12px;
110
+                margin-bottom: 3px;
111
+                font-size: 14px;
112
+              "
113
+            >
114
+              {{ item.activeMonitor?.title1 }}
115
+            </p>
116
+            <div class="interactclass">
117
+              <div
118
+                class="room"
119
+                v-for="(item, index) in item.activeMonitor?.array1"
120
+                :key="index"
121
+              >
122
+                <span style="z-index: 99">{{ item?.title }}</span>
123
+                <!-- <br>
95 124
                                 <div>
96 125
                                     {{ item.src }}
97 126
                                 </div> -->
98
-                                <div style="width: 100%;height: 100%;" @click="lookVideo(item)">
99
-                                    <div  class="vue3VideoPlay ">
100
-                                        <vue3VideoPlay 
101
-                                    
102
-                                    width="100%"
103
-                                    height="9vh"
104
-                                    style="object-fit: fill"
105
-                                    :src="item.src"
106
-                                    :type="videoData.type"
107
-                                    :autoPlay="true"
108
-                                    :control="false"
109
-                                    :preload="meta"
110
-                                   />
111
-                                    </div>
112
-                            
113
-                                </div>
114
-                            </div>
115
-                        </div>
116
-                    </el-carousel-item>
117
-                </el-carousel>
127
+                <div style="width: 100%; height: 100%" @click="lookVideo(item)">
128
+                  <div class="vue3VideoPlay">
129
+                    <vue3VideoPlay
130
+                      width="100%"
131
+                      height="9vh"
132
+                      style="object-fit: fill"
133
+                      :src="item.src"
134
+                      :type="videoData.type"
135
+                      :autoPlay="true"
136
+                      :control="false"
137
+                      :preload="meta"
138
+                    />
139
+                  </div>
140
+                </div>
141
+              </div>
118 142
             </div>
119
-
120
-        </div>
121
-    </el-aside>
122
-
123
-    <!-- 视频播放弹框 -->
124
-    <el-dialog class="videoDialog" v-model="videoDialog" :title="dialogTitle" width="62%" align="center" top="8%" style="z-index: 2015;">
125
-        <videoPlay v-bind="videoData" />
126
-
127
-        <!-- {{ videoData.src }} -->
128
-    </el-dialog>
143
+          </el-carousel-item>
144
+        </el-carousel>
145
+      </div>
146
+    </div>
147
+  </el-aside>
148
+
149
+  <!-- 视频播放弹框 -->
150
+  <el-dialog
151
+    class="videoDialog"
152
+    v-model="videoDialog"
153
+    :title="dialogTitle"
154
+    width="62%"
155
+    align="center"
156
+    top="8%"
157
+    style="z-index: 2015"
158
+  >
159
+    <videoPlay v-bind="videoData" />
160
+
161
+    <!-- {{ videoData.src }} -->
162
+  </el-dialog>
129 163
 </template>
130 164
 
131 165
 <script >
132
-import { reactive, onMounted, ref, nextTick } from 'vue';
166
+import { reactive, onMounted, ref, nextTick, onBeforeUnmount } from "vue";
133 167
 import { ElCarousel, ElCarouselItem } from "element-plus";
134 168
 import "vue3-video-play/dist/style.css";
135 169
 import { videoPlay } from "vue3-video-play";
136 170
 // import CircleProgress from './CircleProgress.vue';
137
-import { getDevice, getVideoUrl,getvideo } from '../request/api';
138
-
139
-
140
-export default ({
141
-    name: 'Histogram',
142
-    components: { videoPlay, ElCarousel, ElCarouselItem,  },
143
-    setup() {
144
-        // 视频数据
145
-        const videoData = reactive({
146
-            width: "100%", //播放器高度
147
-            height: "66.5vh", //播放器高度
148
-            color: "red", //主题色
149
-            // title: "互动教室", //视频名称
150
-            // src: "https://cdn.jsdelivr.net/gh/xdlumia/files/video-play/IronMan.mp4", //视频源
151
-            src: "",
152
-            type: "m3u8",
153
-            muted: true, //静音
154
-            webFullScreen: false,
155
-            // speedRate: ["0.75", "1.0", "1.25", "1.5", "2.0"], //播放倍速
156
-            autoPlay: true, //自动播放
157
-            loop: false, //循环播放
158
-            mirror: false, //镜像画面
159
-            ligthOff: false, //关灯模式
160
-            volume: 0.3, //默认音量大小
161
-            control: true, //是否显示控制
162
-            currentTime: 0,//跳转到固定播放时间
163
-            controlBtns: [
164
-                "audioTrack",
165
-                "quality",
166
-                "speedRate",
167
-                "volume",
168
-                "setting",
169
-                "pip",
170
-                "pageFullScreen",
171
-                "fullScreen",
172
-            ], //显示所有按钮,
171
+import { getDevice, getVideoUrl, getvideo } from "../request/api";
172
+
173
+export default {
174
+  name: "Histogram",
175
+  components: { videoPlay, ElCarousel, ElCarouselItem },
176
+  setup() {
177
+    // 视频数据
178
+    const videoData = reactive({
179
+      width: "100%", //播放器高度
180
+      height: "66.5vh", //播放器高度
181
+      color: "red", //主题色
182
+      // title: "互动教室", //视频名称
183
+      // src: "https://cdn.jsdelivr.net/gh/xdlumia/files/video-play/IronMan.mp4", //视频源
184
+      src: "",
185
+      type: "m3u8",
186
+      muted: true, //静音
187
+      webFullScreen: false,
188
+      // speedRate: ["0.75", "1.0", "1.25", "1.5", "2.0"], //播放倍速
189
+      autoPlay: true, //自动播放
190
+      loop: false, //循环播放
191
+      mirror: false, //镜像画面
192
+      ligthOff: false, //关灯模式
193
+      volume: 0.3, //默认音量大小
194
+      control: true, //是否显示控制
195
+      currentTime: 0, //跳转到固定播放时间
196
+      controlBtns: [
197
+        "audioTrack",
198
+        "quality",
199
+        "speedRate",
200
+        "volume",
201
+        "setting",
202
+        "pip",
203
+        "pageFullScreen",
204
+        "fullScreen",
205
+      ], //显示所有按钮,
206
+    });
207
+    //视频播放弹框
208
+    const videoDialog = ref(false);
209
+
210
+    // const  videoshow = ref(true)
211
+    const dialogTitle = ref("");
212
+    // 播放视频
213
+    const lookVideo = function (item) {
214
+      videoDialog.value = true;
215
+      dialogTitle.value = item.title;
216
+      let copysrc = JSON.parse(JSON.stringify(item));
217
+      console.log("sadi2", copysrc);
218
+      // videoData.src = item.scr
219
+      videoData.src = copysrc.src;
220
+      console.log("kankna222", videoData.src);
221
+
222
+      // getVideoUrl({ "rtsp": item.src }).then((res) => {
223
+      //     console.log("视频处理", res);
224
+      //     console.log("视频处理2", res.data.httpFlv);
225
+
226
+      //     videoData.src = res.data.httpFlv
227
+      // })
228
+      // videoData.src = src
229
+    };
230
+    // 播放视频
231
+    const onPlay = function () {
232
+      console.log("播放视频");
233
+    };
234
+    // 物联设备
235
+    let equipmentTotal = ref({});
236
+    // 物联设备类型统计
237
+    let interDevice = ref([]);
238
+    // 智慧教室
239
+    let carouselData = ref([]);
240
+
241
+    //获取页面数据
242
+    const getDeviceData = async () => {
243
+      //视频转码
244
+      // getvideo({
245
+      //  "rtsp": "rtsp://admin:admin@10.116.255.67:554",
246
+      // }).then((res)=>{
247
+      //     console.log('sadnuq21',res);
248
+      // })
249
+
250
+      let res = await getDevice();
251
+      console.log("s12312123", res);
252
+      if (res.code !== 200) {
253
+        ElMessage.error("数据请求出错");
254
+      }
255
+      let { category, monitor, status } = res.data;
256
+      //物联设备统计
257
+      equipmentTotal.value = status;
258
+      // 物联设备类型数据
259
+      console.log("sadui12u31", category);
260
+      //截取数组前6项
261
+      interDevice.value = category;
262
+
263
+      // 互动教室
264
+      carouselData.value = monitor;
265
+
266
+      carouselData.value.map((res) => {
267
+        console.log("sadhi2", res.activeMonitor);
268
+
269
+        res.activeMonitor?.array.map((array) => {
270
+          //视频转码
271
+          getvideo({
272
+            rtsp: array.src,
273
+          }).then((res) => {
274
+            console.log("sadnuq21", res.data);
275
+            console.log("sadnuq2121", res.data.httpFlv);
276
+            // array.src='http://kbs-dokdo.gscdn.com/dokdo_300/_definst_/dokdo_300.stream/playlist.m3u8'
277
+            array.src = res.data.httpFlv;
278
+          });
173 279
         });
174
-        //视频播放弹框
175
-        const videoDialog = ref(false)
176
-
177
-        // const  videoshow = ref(true)
178
-        const dialogTitle = ref("")
179
-        // 播放视频
180
-        const lookVideo = function (item) {
181
-            videoDialog.value = true;
182
-            dialogTitle.value = item.title
183
-            let copysrc=JSON.parse(JSON.stringify(item))
184
-            console.log('sadi2',copysrc);
185
-            // videoData.src = item.scr
186
-            videoData.src = copysrc.src
187
-            console.log('kankna222', videoData.src);
188
-
189
-            
190
-         
191
-            // getVideoUrl({ "rtsp": item.src }).then((res) => {
192
-            //     console.log("视频处理", res);
193
-            //     console.log("视频处理2", res.data.httpFlv);
194
-
195
-            //     videoData.src = res.data.httpFlv
196
-            // })
197
-            // videoData.src = src
198
-
199
-        }
200
-        // 播放视频
201
-        const onPlay = function () {
202
-            console.log("播放视频")
203
-        }
204
-        // 物联设备
205
-        let equipmentTotal = ref({})
206
-        // 物联设备类型统计
207
-        let interDevice = ref([])
208
-        // 智慧教室
209
-        let carouselData = ref([
210
-           
211
-        ])
212
-
213
-        //获取页面数据
214
-        const getDeviceData = async () => {
215
-
216
-
217
-            //视频转码
218
-            // getvideo({
219
-            //  "rtsp": "rtsp://admin:admin@10.116.255.67:554",
220
-            // }).then((res)=>{
221
-            //     console.log('sadnuq21',res);
222
-            // })
223
-
224
-            let res = await getDevice()
225
-            console.log('s12312123',res);
226
-            if (res.code !== 200) {
227
-                ElMessage.error("数据请求出错");
228
-            }
229
-            let { category, monitor, status } = res.data
230
-                  //物联设备统计
231
-                  equipmentTotal.value = status
232
-            // 物联设备类型数据
233
-            console.log('sadui12u31',category);
234
-            //截取数组前6项
235
-            interDevice.value = category;
236
-      
237
-             // 互动教室
238
-             carouselData.value = monitor;
239
-      
240
-             carouselData.value.map((res)=>{
241
-                console.log('sadhi2',res.activeMonitor);
242
-
243
-                res.activeMonitor.array.map(array =>{
244
-              
245
-                    //视频转码
246
-                    getvideo({
247
-                    "rtsp": array.src,
248
-                    }).then((res)=>{
249
-                        console.log('sadnuq21',res.data);
250
-                        console.log('sadnuq2121',res.data.httpFlv);
251
-                        // array.src='http://kbs-dokdo.gscdn.com/dokdo_300/_definst_/dokdo_300.stream/playlist.m3u8'
252
-                       array.src=res.data.httpFlv
253
-                    })
254
-
255
-                    
256
-                })
257
-                res.activeMonitor.array1.map(array1 =>{
258
-                    console.log('asdui1231',array1);
259
-                       //视频转码
260
-                       getvideo({
261
-                    "rtsp": array1.src,
262
-                    }).then((res)=>{
263
-                        console.log('sadnuq212123s2',res.data);
264
-                        // array1.src='http://kbs-dokdo.gscdn.com/dokdo_300/_definst_/dokdo_300.stream/playlist.m3u8'
265
-                       array1.src=res.data.httpFlv
266
-                    })
267
-                })
268
-
269
-
270
-            })
271
-
272
-                 
273
-
274
-
275
-
276
-                // setTimeout(() => {
277
-                //     console.log('处理后监控视频数据===',carouselData.value);
278
-                // }, 2000);
279
-
280
-      
281
-
282
-        }
283
-
284
-        onMounted(() => {
285
-            getDeviceData()
286
-        })
287
-        const d1img = ref('./img/d1_1.png');
288
-        const d12img = ref('./img/d1_2.png');
289
-        const d2img = ref('./img/d2.png');
290
-        const d3img = ref('./img/d3.png')
291
-        const deviceImg = ref('./img/')
292
-
293
-        return {
294
-            interDevice,
295
-            videoData,
296
-            onPlay,
297
-            videoDialog,
298
-            lookVideo,
299
-            carouselData,
300
-            equipmentTotal,
301
-            d1img,
302
-            d12img,
303
-            d2img,
304
-            d3img,
305
-            deviceImg,
306
-            dialogTitle
307
-        }
308
-    },
309
-})
310
-
280
+        res.activeMonitor?.array1.map((array1) => {
281
+          console.log("asdui1231", array1);
282
+          //视频转码
283
+          getvideo({
284
+            rtsp: array1.src,
285
+          }).then((res) => {
286
+            console.log("sadnuq212123s2", res.data);
287
+            // array1.src='http://kbs-dokdo.gscdn.com/dokdo_300/_definst_/dokdo_300.stream/playlist.m3u8'
288
+            array1.src = res.data.httpFlv;
289
+          });
290
+        });
291
+      });
292
+
293
+      //开启物联网统计数据定时刷新
294
+      startdeviceInterval();
295
+
296
+      // setTimeout(() => {
297
+      //     console.log('处理后监控视频数据===',carouselData.value);
298
+      // }, 2000);
299
+    };
300
+
301
+    // 定时刷新物联网统计数据
302
+
303
+    let deviceInterval = ref(null);
304
+    const startdeviceInterval = () => {
305
+      //清除物联网统计数据刷新定时器
306
+      clearTimeout(deviceInterval.value);
307
+      deviceInterval.value = setInterval(() => {
308
+        getDeviceData();
309
+      }, 5000);
310
+    };
311
+
312
+    onMounted(() => {
313
+      getDeviceData();
314
+    });
315
+
316
+    onBeforeUnmount(() => {
317
+      //清除物联网统计数据刷新定时器
318
+      clearTimeout(deviceInterval.value);
319
+    });
320
+
321
+    const d1img = ref("./img/d1_1.png");
322
+    const d12img = ref("./img/d1_2.png");
323
+    const d2img = ref("./img/d2.png");
324
+    const d3img = ref("./img/d3.png");
325
+    const deviceImg = ref("./img/");
326
+    const frame = ref("./img/frame.png");
327
+
328
+    return {
329
+      interDevice,
330
+      videoData,
331
+      onPlay,
332
+      videoDialog,
333
+      lookVideo,
334
+      carouselData,
335
+      equipmentTotal,
336
+      d1img,
337
+      d12img,
338
+      d2img,
339
+      d3img,
340
+      deviceImg,
341
+      dialogTitle,
342
+      startdeviceInterval,
343
+      frame
344
+    };
345
+  },
346
+};
311 347
 </script>
312 348
 
313 349
 <style scoped lang="scss">
314
-@import '../assets/css/right.scss';
350
+@import "../assets/css/right.scss";
315 351
 </style>
316 352
 <style lang="scss">
317 353
 .videoDialog {
318
-    .el-dialog__header {
319
-        height: 49px;
320
-        line-height: 49px;
321
-        padding: 0;
322
-        background-color: #1B67D9;
323
-        margin-right: 0;
324
-
325
-        .el-dialog__title {
326
-            color: #FFF;
327
-            font-family: Inter;
328
-        }
329
-
330
-        .el-dialog__headerbtn {
331
-            top: 0px;
332
-
333
-            i {
334
-                color: #fff;
335
-                font-size: 20px;
336
-                font-weight: bold;
337
-            }
338
-
339
-        }
340
-
354
+  .el-dialog__header {
355
+    height: 49px;
356
+    line-height: 49px;
357
+    padding: 0;
358
+    background-color: #1b67d9;
359
+    margin-right: 0;
360
+
361
+    .el-dialog__title {
362
+      color: #fff;
363
+      font-family: Inter;
341 364
     }
342 365
 
343
-    .el-dialog__body {
344
-        padding: 0 !important;
345
-    }
366
+    .el-dialog__headerbtn {
367
+      top: 0px;
346 368
 
369
+      i {
370
+        color: #fff;
371
+        font-size: 20px;
372
+        font-weight: bold;
373
+      }
374
+    }
375
+  }
347 376
 
377
+  .el-dialog__body {
378
+    padding: 0 !important;
379
+  }
348 380
 }
349 381
 </style>

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 910 - 186
yarn.lock