zy1125 1 gadu atpakaļ
vecāks
revīzija
dd6baa0796

+ 5 - 5
package-lock.json

@@ -679,9 +679,9 @@
679 679
       }
680 680
     },
681 681
     "hls.js": {
682
-      "version": "1.4.10",
683
-      "resolved": "https://registry.npmmirror.com/hls.js/-/hls.js-1.4.10.tgz",
684
-      "integrity": "sha512-wAVSj4Fm2MqOHy5+BlYnlKxXvJlv5IuZHjlzHu18QmjRzSDFQiUDWdHs5+NsFMQrgKEBwuWDcyvaMC9dUzJ5Uw=="
682
+      "version": "1.4.12",
683
+      "resolved": "https://registry.npmjs.org/hls.js/-/hls.js-1.4.12.tgz",
684
+      "integrity": "sha512-1RBpx2VihibzE3WE9kGoVCtrhhDWTzydzElk/kyRbEOLnb1WIE+3ZabM/L8BqKFTCL3pUy4QzhXgD1Q6Igr1JA=="
685 685
     },
686 686
     "immutable": {
687 687
       "version": "4.3.2",
@@ -1033,7 +1033,7 @@
1033 1033
     },
1034 1034
     "throttle-debounce": {
1035 1035
       "version": "3.0.1",
1036
-      "resolved": "https://registry.npmmirror.com/throttle-debounce/-/throttle-debounce-3.0.1.tgz",
1036
+      "resolved": "https://registry.npmjs.org/throttle-debounce/-/throttle-debounce-3.0.1.tgz",
1037 1037
       "integrity": "sha512-dTEWWNu6JmeVXY0ZYoPuH5cRIwc0MeGbJwah9KUNYSJwommQpCzTySTpEe8Gs1J23aeWEuAobe4Ag7EHVt/LOg=="
1038 1038
     },
1039 1039
     "to-regex-range": {
@@ -1220,7 +1220,7 @@
1220 1220
     },
1221 1221
     "vue3-video-play": {
1222 1222
       "version": "1.3.1-beta.6",
1223
-      "resolved": "https://registry.npmmirror.com/vue3-video-play/-/vue3-video-play-1.3.1-beta.6.tgz",
1223
+      "resolved": "https://registry.npmjs.org/vue3-video-play/-/vue3-video-play-1.3.1-beta.6.tgz",
1224 1224
       "integrity": "sha512-Olrx2/LNAds7fuor/yX9ZKT9sOcwcfTt2g2YbbCrEaAmZ5Tb0hwBr5z+/CoLwELzzRzXCHPmWWoT0Wm5W/Nwpw==",
1225 1225
       "requires": {
1226 1226
         "hls.js": "^1.0.10",

+ 7 - 7
src/assets/css/left.scss

@@ -2,8 +2,8 @@
2 2
 .left {
3 3
      position: absolute;
4 4
      width: 412px;
5
-     height: 88vh;
6
-     top: 10vh;
5
+     height: 86vh;
6
+     top: 11.5vh;
7 7
      z-index: 300;
8 8
      flex-shrink: 0;
9 9
      border-radius: 2px;
@@ -12,7 +12,7 @@
12 12
      color: #FFF;
13 13
      font-size: 14px;
14 14
      overflow: hidden;
15
-     left: 30px;
15
+     left: 25px;
16 16
      display: flex;
17 17
      flex-direction: column;
18 18
      padding: 11px 10px 15px 10px; //教室分类统计
@@ -20,7 +20,7 @@
20 20
      .left_top {
21 21
          box-sizing: border-box;
22 22
          width: 392px;
23
-         height: 261px;
23
+         height: 250px;
24 24
          //  border: 2px solid darkcyan;
25 25
 
26 26
          .list {
@@ -65,7 +65,7 @@
65 65
          box-sizing: border-box;
66 66
          height: 219px;
67 67
          width: 392px;
68
-         height: 219px;
68
+         height: 208px;
69 69
          //  border: 2px solid #5F7BDC;
70 70
 
71 71
          .count {
@@ -73,7 +73,7 @@
73 73
              flex-direction: column;
74 74
              align-items: center;
75 75
              justify-content: space-around;
76
-             height: 108px;
76
+             height: 100%;
77 77
              // border: 1px solid sandybrown;
78 78
              //  width: 93px;
79 79
              box-sizing: border-box;
@@ -147,7 +147,7 @@
147 147
          }
148 148
 
149 149
          .title {
150
-             margin-bottom: 20px;
150
+             margin-bottom: 5px;
151 151
          }
152 152
 
153 153
 

+ 54 - 23
src/assets/css/right.scss

@@ -8,11 +8,29 @@
8 8
     // transform: translateY(10%);
9 9
 
10 10
 }
11
+.vue3VideoPlay {
12
+    pointer-events: none;
13
+}
11 14
 ::v-deep .el-carousel__arrow{
12 15
     // display: none;
13 16
     display: block;
14 17
 }
15 18
 
19
+::v-deep  .el-carousel__arrow--left{
20
+
21
+    left: -7px;
22
+    top: 54%;
23
+}
24
+::v-deep  .el-carousel__arrow--right{
25
+
26
+    right: -7px;
27
+    top: 54%;
28
+}
29
+::v-deep .el-carousel {
30
+
31
+    --el-carousel-arrow-size:0.1375rem
32
+}
33
+
16 34
 // 通用标题
17 35
 .title {
18 36
     width: 380px;
@@ -37,14 +55,15 @@
37 55
     width: 100%;
38 56
     overflow: hidden;
39 57
     justify-content: space-evenly;
58
+    margin-top: 2.5vh;
40 59
 
41 60
 }
42 61
 
43 62
 .right {
44 63
     position: absolute;
45 64
     width: 412px;
46
-    height: 80vh;
47
-    top: 10vh;
65
+
66
+    top: 11.5vh;
48 67
     z-index: 300;
49 68
     flex-shrink: 0;
50 69
     border-radius: 2px;
@@ -53,12 +72,12 @@
53 72
     color: #FFF;
54 73
     font-size: 14px;
55 74
     // overflow: hidden;
56
-    right: 20px;
75
+    right: 25px;
57 76
     // border: 2px solid salmon;
58 77
     box-sizing: border-box;
59 78
     display: flex;
60 79
     flex-direction: column;
61
-    height: 88vh;
80
+    height: 86vh;
62 81
     overflow: hidden;
63 82
     padding: 11px 10px 15px 10px;
64 83
 
@@ -67,7 +86,7 @@
67 86
 // 物联设备统计
68 87
 .right_top {
69 88
     // border: 3px solid darkcyan;
70
-    height: 267px;
89
+    height: 30%;
71 90
     // border: 2px solid darkcyan;
72 91
     box-sizing: border-box;
73 92
 
@@ -78,7 +97,7 @@
78 97
         align-items: center;
79 98
         width: 134px;
80 99
         height: 175px;
81
-        margin: 30px 0 20px 10px;
100
+        align-content: center;
82 101
 
83 102
         img {
84 103
             width: 87px;
@@ -171,17 +190,18 @@
171 190
 
172 191
 // 物联设备类型统计
173 192
 .right_center {
174
-    height: 314px;
193
+    height: 33%;
175 194
     // border: 3px solid darkcyan;
176 195
     box-sizing: border-box;
177
-    overflow: hidden;
196
+    // overflow: hidden;
178 197
 
179 198
     .contentwrap {
180 199
         display: flex;
181 200
         flex-wrap: wrap;
182
-        margin: 10px 0;
183
-        height: 222px;
201
+
202
+        height: 90%;
184 203
         overflow: hidden;
204
+        align-content: center;
185 205
         // border: 2px solid sandybrown;
186 206
 
187 207
         .count {
@@ -202,45 +222,56 @@
202 222
     flex: 1;
203 223
     box-sizing: border-box;
204 224
     // border: 3px solid darkcyan;
205
-    // height: 332px;
225
+    height: 33%;
206 226
 
207 227
     .monitorContent {
228
+        margin-top: -6px;
208 229
 
209 230
         .monitor {
210 231
             box-sizing: border-box;
211 232
             display: flex;
212 233
             flex-direction: column;
234
+            
213 235
             background: rgba(0, 0, 0, 0.2);
214 236
             padding: 10px;
215 237
             width: 364px;
216
-            height: 268px;
217
-            margin: 0 auto;
218
-            margin-top: 10px;
219
-            // padding-bottom: 0;
238
+            height: 25vh;
239
+            margin: 2vh auto;
240
+    
241
+
220 242
 
221 243
             // border: 1px solid red;
222 244
 
223 245
             .interactclass {
224 246
                 display: flex;
225
-                justify-content: space-around;
247
+                justify-content: space-evenly;
226 248
 
227 249
                 .room {
250
+
251
+           
228 252
                     position: relative;
229
-                    width: 170px;
230
-                    height: 94px;
253
+                    width: 155px;
254
+                    height: 8vh;
255
+                    padding: 0;
256
+                    margin: 0;
231 257
                     // background: saddlebrown;
232
-                    margin-top: 10px;
258
+                    // margin-top: 10px;
233 259
                     cursor: pointer;
234 260
 
235
-                    &:first-child {
236
-                        margin-right: 10px;
237
-                    }
261
+                    // &:first-child {
262
+                    //     margin-right: 10px;
263
+                    // }
238 264
 
239 265
                     span {
240 266
                         position: absolute;
241 267
                         top: 0;
242
-                        left: 10px;
268
+                
269
+                        font-size: 11px;
270
+                    
271
+                        text-indent: 5px;
243 272
                         width: 80px;
273
+                        height: 18px;
274
+                        line-height: 17px;
244 275
                         background-color: rgba(0, 0, 0, 0.38);
245 276
                     }
246 277
                 }

+ 1 - 1
src/components/UeVideo.vue

@@ -1,7 +1,7 @@
1 1
 
2 2
 <template>
3 3
   <!-- <div  ref="video" id="player"></div> -->
4
-  <div style="background-color: rgba(36, 97, 72, 0.667); width: 100vw;height: 100vh;position: absolute;" ></div>
4
+  <div style="background-color: rgba(156, 167, 84, 0.667); width: 100vw;height: 100vh;position: absolute;" ></div>
5 5
   <Login :class="loginShow ? '' : 'hidden'"></Login>
6 6
   <home></home>
7 7
   <!-- <div @click="toUE" style="position: absolute;top: 5%; left: 50%;background-color: darkcyan;z-index: 200">向UE发信息</div> -->

+ 4 - 3
src/components/left.vue

@@ -48,12 +48,13 @@
48 48
                         <li>到课率</li>
49 49
                         <li>操作</li>
50 50
                     </ul>
51
-                    <div ref="testMain" style="height: 310px;overflow: scroll;" class="scroll">
51
+                    <div ref="testMain" style="height: 342px;overflow: scroll;" class="scroll">
52 52
                         <ul v-for="item in classRoom" @mouseenter="testMove" @mouseleave="testMend">
53 53
                             <li class="jiaos"> {{ item.class }} </li>
54 54
                             <li>{{ item.status }}</li>
55
-                            <li>{{ item.people }}</li>
56
-                            <li>{{ item.percentage }}</li>
55
+                            <li >{{ item.people || '—'}}</li>
56
+                            <li >{{ item.percentage ?item.percentage: '—' }}</li>
57
+                      
57 58
                             <li>
58 59
                                 <el-button size="small" class="look" @click.prevent="handleRoom(item)">查看</el-button>
59 60
                             </li>

+ 95 - 23
src/components/right.vue

@@ -62,24 +62,53 @@
62 62
             <div class="monitorContent">
63 63
                 <el-carousel class="monitor">
64 64
                     <el-carousel-item v-for="(item, index) in carouselData" :key="index">
65
-                        <p>{{ item.activeMonitor.title }}</p>
65
+                        <p style="margin-left: 12px; margin-bottom: 3px; font-size: 14px;">{{ item.activeMonitor.title }}</p>
66 66
                         <div class="interactclass">
67 67
 
68 68
                             <div class="room" v-for="(item, index) in item.activeMonitor.array" :key="index">
69 69
                                 <span style="z-index: 99;">{{ item.title }}</span>
70 70
                                 <!-- <img :src="deviceImg + 'rb2.png'" alt="" @click="lookVideo(item)"> -->
71
-                                <div @click="lookVideo(item.src)">
72
-                                    <videoPlay  v-bind="videoData" />
71
+                                <div  style="background-color: aquamarine;width: 100%;height: 100%;" @click="lookVideo(item)">
72
+                                    <div  class="vue3VideoPlay ">
73
+                                        <vue3VideoPlay 
74
+                                    
75
+                                    width="100%"
76
+                                    height="9vh"
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>
73 86
                                 </div>
74 87
                             </div>
75 88
                         </div>
76 89
 
77
-                        <p style="margin-top: 5px;">{{ item.activeMonitor.title1 }}</p>
90
+                        <p style="margin-top: 18px;margin-left: 12px;  margin-bottom: 3px; font-size: 14px; " >{{ item.activeMonitor.title1 }}</p>
78 91
                         <div class="interactclass">
79 92
                             <div class="room" v-for="(item, index) in item.activeMonitor.array1" :key="index">
80
-                                <span>{{ item.title }}</span>
81
-                                <div @click="lookVideo(item.src)">
82
-                                    <videoPlay  v-bind="videoData" />
93
+                                <span  style="z-index: 99;">{{ item.title }}</span>
94
+                                <!-- <br>
95
+                                <div>
96
+                                    {{ item.src }}
97
+                                </div> -->
98
+                                <div style="background-color: aquamarine;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
+                                   />
110
+                                    </div>
111
+                            
83 112
                                 </div>
84 113
                             </div>
85 114
                         </div>
@@ -91,7 +120,7 @@
91 120
     </el-aside>
92 121
 
93 122
     <!-- 视频播放弹框 -->
94
-    <el-dialog class="videoDialog" v-model="videoDialog" :title="dialogTitle" width="60%" align="center" top="4%">
123
+    <el-dialog class="videoDialog" v-model="videoDialog" :title="dialogTitle" width="54.5%" align="center" top="10%">
95 124
         <videoPlay v-bind="videoData" />
96 125
 
97 126
         <!-- {{ videoData.src }} -->
@@ -99,17 +128,17 @@
99 128
 </template>
100 129
 
101 130
 <script >
102
-import { reactive, onMounted, ref, } from 'vue';
131
+import { reactive, onMounted, ref, nextTick } from 'vue';
103 132
 import { ElCarousel, ElCarouselItem } from "element-plus";
104 133
 import "vue3-video-play/dist/style.css";
105 134
 import { videoPlay } from "vue3-video-play";
106
-import CircleProgress from './CircleProgress.vue';
135
+// import CircleProgress from './CircleProgress.vue';
107 136
 import { getDevice, getVideoUrl,getvideo } from '../request/api';
108 137
 
109 138
 
110 139
 export default ({
111 140
     name: 'Histogram',
112
-    components: { videoPlay, ElCarousel, ElCarouselItem, CircleProgress },
141
+    components: { videoPlay, ElCarousel, ElCarouselItem,  },
113 142
     setup() {
114 143
         // 视频数据
115 144
         const videoData = reactive({
@@ -143,18 +172,21 @@ export default ({
143 172
         });
144 173
         //视频播放弹框
145 174
         const videoDialog = ref(false)
175
+
176
+        // const  videoshow = ref(true)
146 177
         const dialogTitle = ref("")
147 178
         // 播放视频
148 179
         const lookVideo = function (item) {
149 180
             videoDialog.value = true;
150 181
             dialogTitle.value = item.title
182
+            videoData.src = item.scr
151 183
             console.log("点击了播放视频", 12312312, "播放路径", item)
152
-            getVideoUrl({ "rtsp": item.src }).then((res) => {
153
-                console.log("视频处理", res);
154
-                console.log("视频处理2", res.data.httpFlv);
184
+            // getVideoUrl({ "rtsp": item.src }).then((res) => {
185
+            //     console.log("视频处理", res);
186
+            //     console.log("视频处理2", res.data.httpFlv);
155 187
 
156
-                videoData.src = res.data.httpFlv
157
-            })
188
+            //     videoData.src = res.data.httpFlv
189
+            // })
158 190
             // videoData.src = src
159 191
 
160 192
         }
@@ -174,11 +206,11 @@ export default ({
174 206
 
175 207
 
176 208
             //视频转码
177
-            getvideo({
178
-             "rtsp": "rtsp://admin:admin@10.116.255.67:554",
179
-            }).then((res)=>{
180
-                console.log('sadnuq21',res);
181
-            })
209
+            // getvideo({
210
+            //  "rtsp": "rtsp://admin:admin@10.116.255.67:554",
211
+            // }).then((res)=>{
212
+            //     console.log('sadnuq21',res);
213
+            // })
182 214
 
183 215
             let res = await getDevice()
184 216
             console.log('s12312123',res);
@@ -191,9 +223,49 @@ export default ({
191 223
             //截取数组前6项
192 224
             interDevice.value = category.slice(0,6);
193 225
             // 互动教室
194
-            carouselData.value = monitor.slice(0,5)
226
+            carouselData.value = monitor
227
+
228
+            console.log('处理监控视频数据===',monitor);
229
+
230
+            monitor.map((res)=>{
231
+                console.log('sadhi2',res.activeMonitor);
232
+
233
+                res.activeMonitor.array.map(array =>{
234
+              
235
+                    //视频转码
236
+                    getvideo({
237
+                    "rtsp": array.src,
238
+                    }).then((res)=>{
239
+                        console.log('sadnuq21',res.data);
240
+                        console.log('sadnuq21',res.data.httpFlv);
241
+                        array.src='http://kbs-dokdo.gscdn.com/dokdo_300/_definst_/dokdo_300.stream/playlist.m3u8'
242
+                    })
243
+
244
+                    
245
+                })
246
+                res.activeMonitor.array1.map(array1 =>{
247
+                    console.log('asdui1231',array1);
248
+                       //视频转码
249
+                       getvideo({
250
+                    "rtsp": array1.src,
251
+                    }).then((res)=>{
252
+                        console.log('sadnuq212123s2',res.data);
253
+                        array1.src='http://kbs-dokdo.gscdn.com/dokdo_300/_definst_/dokdo_300.stream/playlist.m3u8'
254
+                    })
255
+                })
256
+
257
+
258
+            })
259
+
260
+            setTimeout(() => {
261
+                console.log('sado2');
262
+                // videoshow=true
263
+                // console.log('sadhui21',videoshow);
264
+            }, 3000);
195 265
 
196
-            console.log('处理监控视频数据===',monitor).slice(0,1);
266
+                setTimeout(() => {
267
+                    console.log('处理后监控视频数据===',monitor);
268
+                }, 2000);
197 269
 
198 270
             //物联设备统计
199 271
             equipmentTotal.value = status

+ 6 - 0
src/main.js

@@ -5,8 +5,14 @@ import 'amfe-flexible'
5 5
 // import { ElMessage } from 'element-plus'
6 6
 import 'element-plus/dist/index.css'
7 7
 
8
+import vue3videoPlay from 'vue3-video-play' // 引入组件
9
+import 'vue3-video-play/dist/style.css' // 引入css
10
+
11
+
12
+
8 13
 const app = createApp(App)
9 14
 console.log("全局的app", app)
15
+app.use(vue3videoPlay)
10 16
 // app.config.globalProperties.$message = ElMessage;
11 17
 // app.use(ElMessage)
12 18
 app.mount("#app")