zy1125 hace 1 año
padre
commit
f9c8dac5ab
Se han modificado 3 ficheros con 134 adiciones y 27 borrados
  1. 81 3
      src/assets/css/home.scss
  2. 32 8
      src/components/home.vue
  3. 21 16
      src/components/right.vue

+ 81 - 3
src/assets/css/home.scss

@@ -25,6 +25,10 @@
25 25
     overflow: hidden;
26 26
 }
27 27
 
28
+
29
+
30
+
31
+
28 32
 // 点击模型弹出框
29 33
 .modelInfo {
30 34
     position: absolute;
@@ -34,12 +38,70 @@
34 38
     backdrop-filter: blur(30.5px);
35 39
     z-index: 8;
36 40
 
37
-   
41
+    .model-detail2{
42
+            border-top-left-radius: 10px;
43
+    border-top-right-radius: 10px;
44
+    height: 155px;
45
+    overflow: hidden;
46
+
47
+            .listbox2 {
48
+            width: 180px;
49
+            text-align: center;
50
+            height: 30px;
51
+            line-height: 30px;
52
+            font-size: 12px;
53
+            color: #fff;
54
+            background-color: rgba(255, 255, 255, 0.31);
55
+            font-size: 12px;
56
+            font-family: Microsoft YaHei UI;
57
+            font-weight: 700;
58
+       
59
+            .listtitlebox{
60
+             
61
+                
62
+                background-color: rgba(255, 255, 255, 0.18);
63
+                padding-bottom: 20px;
64
+            }
65
+
66
+        }
67
+  
68
+        .listtitle{
69
+           
70
+            width: 100%;
71
+            height: 30px;
72
+            display: flex;
73
+            align-items: center;
74
+
75
+            .name {
76
+                color: #fff;
77
+                margin-left: 5px;
78
+                font-weight: 700;
79
+                padding-left: 8px;
80
+                font-size: 12px;
81
+            }
82
+
83
+            .value {
84
+                font-size: 12px;
85
+                font-family: 400;
86
+                margin-left: 5px;
87
+                color: #ffffffeb;
88
+            }
89
+
90
+        }
91
+    }
92
+
93
+
38 94
     .model-detail {
39 95
         // background-color: #fff;
40 96
         border-top-left-radius: 10px;
41 97
         border-top-right-radius: 10px;
42 98
         overflow: hidden;
99
+
100
+        .listbox {
101
+            background-color: rgba(142, 142, 142, 0.18);
102
+            padding-bottom: 8px;
103
+        }
104
+
43 105
         .list {
44 106
             width: 202px;
45 107
             text-align: center;
@@ -51,15 +113,31 @@
51 113
             font-size: 12px;
52 114
             font-family: Microsoft YaHei UI;
53 115
             font-weight: 700;
54
-    
116
+
55 117
 
56 118
         }
119
+
57 120
         .listtitle {
58 121
             width: 100%;
59 122
             height: 30px;
60 123
             display: flex;
61 124
             align-items: center;
62
-            background-color: rgba(142, 142, 142, 0.18);
125
+
126
+            .name {
127
+                color: #fff;
128
+                margin-left: 5px;
129
+                font-weight: 700;
130
+                padding-left: 8px;
131
+                font-size: 12px;
132
+            }
133
+
134
+            .value {
135
+                font-size: 12px;
136
+                font-family: 400;
137
+                margin-left: 5px;
138
+                color: #ffffffeb;
139
+            }
140
+
63 141
         }
64 142
 
65 143
     }

+ 32 - 8
src/components/home.vue

@@ -11,21 +11,38 @@
11 11
 
12 12
         </el-container>
13 13
         <div ref="popoverRef" id="popoverRef" class="modelInfo" >
14
-            <div class="model-detail"  >
15
-                <div v-for="item in classDeviceInfo" >
14
+            <div v-if="orientation=='Left' ||orientation=='Right'" class="model-detail"  >
15
+                <div v-for="item in classDeviceInfo" class="listbox" >
16 16
                     
17 17
                     <div class="list">
18 18
                     {{ item[0].value }}
19 19
                     </div>
20 20
                     <div   v-for="item2 in item" class="listtitle">
21 21
                         
22
-                       <span style="color: #fff;margin-left: 5px; font-weight: 700;padding-left: 8px; "> {{ item2.name }} :</span>
23
-                       <span v-if="item2.value!='在线'" style=" font-family: 100; margin-left: 5px;color: #ffffffeb;">{{ item2.value }}</span>
22
+                       <span class="name"> {{ item2.name }} :</span>
23
+                       <span v-if="item2.value!='在线'" class="value">{{ item2.value }}</span>
24 24
                        <span v-else style=" font-family: 100; margin-left: 5px;color: #10C383;">{{ item2.value }}</span>
25 25
                     </div>
26
-                   
27
-      
26
+                </div>
27
+            </div>
28
+            <div v-else class="model-detail2"  >
29
+                <div style="display: flex;">
30
+                    <div v-for="item in classDeviceInfo" class="listbox2"  >
31
+                        
32
+                        <div class="list" style="text-align: center;width: 100%;">
33
+                        {{ item[0].value }}
34
+                        </div>
28 35
 
36
+                        <div class="listtitlebox">
37
+                            <div   v-for="item2 in item" class="listtitle">
38
+                        
39
+                        <span class="name"> {{ item2.name }} :</span>
40
+                        <span v-if="item2.value!='在线'" class="value">{{ item2.value }}</span>
41
+                        <span v-else style=" font-family: 100; margin-left: 5px;color: #10C383;">{{ item2.value }}</span>
42
+                     </div>
43
+                        </div>
44
+                        
45
+                    </div>
29 46
                 </div>
30 47
             </div>
31 48
         </div>
@@ -61,6 +78,7 @@ export default ({
61 78
     components: { Login, Left, Right, ElScrollbar, ElPagination, ElDialog, videoPlay, ElCarousel, ElCarouselItem, CircleProgress },
62 79
     setup() {
63 80
         const titleDialog = ref("")
81
+        const orientation = ref("")
64 82
         // 视频数据
65 83
         const videoData = reactive({
66 84
             width: "100%", //播放器高度
@@ -190,6 +208,11 @@ export default ({
190 208
                 return
191 209
             }
192 210
             clickData.value = json;
211
+
212
+
213
+            orientation.value=clickData.value.direction
214
+
215
+            console.log('看看这个',clickData.value.direction);
193 216
             if (json.deviceCode) {
194 217
                 console.log('sadasd',json.deviceCode);
195 218
                 let replacedStr = json.deviceCode.replace("/", "A");
@@ -225,7 +248,7 @@ export default ({
225 248
                             popoverRef.value.style.left = (json.x - 120) + 'px'
226 249
                             break;
227 250
                         case "Right":
228
-                            popoverRef.value.style.top = (Number(json.y)) -100+ 'px'
251
+                            popoverRef.value.style.top = (Number(json.y)) -150+ 'px'
229 252
                             popoverRef.value.style.left = Number(json.x) + 100 + 'px'
230 253
 
231 254
                             break;
@@ -295,7 +318,8 @@ export default ({
295 318
             classDeviceInfo,
296 319
             mouseClick,
297 320
             headImg,
298
-            titleDialog
321
+            titleDialog,
322
+            orientation
299 323
         }
300 324
     },
301 325
 })

+ 21 - 16
src/components/right.vue

@@ -64,17 +64,16 @@
64 64
                     <el-carousel-item v-for="(item, index) in carouselData" :key="index">
65 65
                         <p style="margin-left: 12px; margin-bottom: 3px; font-size: 14px;">{{ item.activeMonitor.title }}</p>
66 66
                         <div class="interactclass">
67
-
68 67
                             <div class="room" v-for="(item, index) in item.activeMonitor.array" :key="index">
69 68
                                 <span style="z-index: 99;">{{ item.title }}</span>
70 69
                                 <!-- <img :src="deviceImg + 'rb2.png'" alt="" @click="lookVideo(item)"> -->
71
-                                <div  style="background-color: aquamarine;width: 100%;height: 100%;" @click="lookVideo(item)">
70
+                                <div v-if="item.src"  style="background-color: aquamarine;width: 100%;height: 100%;" @click="lookVideo(item)">
72 71
                                     <div  class="vue3VideoPlay ">
73 72
                                         <vue3VideoPlay 
74 73
                                     
75 74
                                     width="100%"
76 75
                                     height="9vh"
77
-                                    style="  object-fit: fill"
76
+                                    style=" object-fit: fill"
78 77
                                     :src="item.src"
79 78
                                     :type="videoData.type"
80 79
                                     :autoPlay="true"
@@ -152,7 +151,7 @@ export default ({
152 151
             muted: false, //静音
153 152
             webFullScreen: false,
154 153
             // speedRate: ["0.75", "1.0", "1.25", "1.5", "2.0"], //播放倍速
155
-            autoPlay: false, //自动播放
154
+            autoPlay: true, //自动播放
156 155
             loop: false, //循环播放
157 156
             mirror: false, //镜像画面
158 157
             ligthOff: false, //关灯模式
@@ -179,7 +178,16 @@ export default ({
179 178
         const lookVideo = function (item) {
180 179
             videoDialog.value = true;
181 180
             dialogTitle.value = item.title
182
-            videoData.src = item.scr
181
+            let copysrc=JSON.parse(JSON.stringify(item))
182
+            console.log('sadi2',copysrc);
183
+            // videoData.src = item.scr
184
+            videoData.src = copysrc.src
185
+            console.log('kankna222', videoData.src);
186
+
187
+            
188
+         
189
+            console.log('kankna1',item[src]);
190
+            console.log('看看src===========',videoData.src);
183 191
             console.log("点击了播放视频", 12312312, "播放路径", item)
184 192
             // getVideoUrl({ "rtsp": item.src }).then((res) => {
185 193
             //     console.log("视频处理", res);
@@ -222,12 +230,11 @@ export default ({
222 230
             console.log('sadui12u31',category);
223 231
             //截取数组前6项
224 232
             interDevice.value = category.slice(0,6);
225
-            // 互动教室
226
-            carouselData.value = monitor
227
-
228
-            console.log('处理监控视频数据===',monitor);
229
-
230
-            monitor.map((res)=>{
233
+      
234
+             // 互动教室
235
+             carouselData.value = monitor.slice(0,1);
236
+      
237
+             carouselData.value.map((res)=>{
231 238
                 console.log('sadhi2',res.activeMonitor);
232 239
 
233 240
                 res.activeMonitor.array.map(array =>{
@@ -257,11 +264,9 @@ export default ({
257 264
 
258 265
             })
259 266
 
260
-            setTimeout(() => {
261
-                console.log('sado2');
262
-                // videoshow=true
263
-                // console.log('sadhui21',videoshow);
264
-            }, 3000);
267
+                 
268
+
269
+
265 270
 
266 271
                 setTimeout(() => {
267 272
                     console.log('处理后监控视频数据===',monitor);