Browse Source

样式调整

huliu 1 year ago
parent
commit
993589c759
3 changed files with 48 additions and 113 deletions
  1. 33 2
      src/components/UeVideo.vue
  2. 15 40
      src/components/home.vue
  3. 0 71
      src/components/right.vue

+ 33 - 2
src/components/UeVideo.vue

@@ -1,6 +1,7 @@
1 1
 
2 2
 <template>
3 3
   <div ref="video" id="player"></div>
4
+  <Login :class="loginShow ? '' : 'hidden'"></Login>
4 5
   <home></home>
5 6
   <!-- <div @click="toUE" style="position: absolute;top: 5%; left: 50%;background-color: darkcyan;z-index: 200">向UE发信息</div> -->
6 7
 </template>
@@ -17,13 +18,26 @@ export default {
17 18
   setup(props, context) {
18 19
     let video = ref(null);
19 20
     let videoInstance = ref(null);
21
+    const loginShow = ref(true);
22
+    // 获取用户信息
23
+    const getUserInfo = (url) => {
24
+      let userurl = "   https://weizhi.huanghuai.edu.cn/cmccr-server/center/cas/v1/getUser?casLoginUrl=https://cas.huanghuai.edu.cn/cas/serviceValidate?"
25
+        + url + "&service=https://weizhi.huanghuai.edu.cn/cmips/"
26
+      // axios.get(userurl).then(res => {
20 27
 
28
+      // })
29
+      console.log("是否有url", url)
30
+      if (url) {
31
+        loginShow.value = false
32
+      }
33
+
34
+    }
21 35
     onMounted(() => {
22 36
 
23 37
       videoInstance = initLoad({
24 38
         context,
25 39
         serverUrl: window.g.UE_IP,
26
-        autoConnection: false,
40
+        autoConnection: true,
27 41
         showPlayOverlay: true,
28 42
         qualityControl: true,
29 43
         inputOptions: {
@@ -33,6 +47,19 @@ export default {
33 47
       });
34 48
       console.log("video.videoInstance", videoInstance);
35 49
 
50
+      let search = window.location.href.split("?")[1];
51
+      getUserInfo(search)
52
+      // console.log(search, "编码")
53
+      // let code = result.split("?")[0]; //去掉&之后的冗余部分
54
+
55
+      // console.log(result);
56
+      // // window.addEventListener('hashchange', pathChange);
57
+      // const searchParams = currentUrl.searchParams;
58
+      // let ticket = searchParams.get("ticket"); // 'devpoint'
59
+      // console.log("ticket", ticket);
60
+      // searchParams.get("page"); // '1'
61
+
62
+
36 63
     });
37 64
     // function handleResponseFunction(data) {
38 65
     //   console.log("从UE返回过来的值", data)
@@ -47,7 +74,7 @@ export default {
47 74
 
48 75
     return {
49 76
       video,
50
-      toUE
77
+      loginShow
51 78
     };
52 79
   },
53 80
 };
@@ -59,4 +86,8 @@ export default {
59 86
   position: absolute;
60 87
   overflow: hidden;
61 88
 }
89
+
90
+.hidden {
91
+  display: none;
92
+}
62 93
 </style>

+ 15 - 40
src/components/home.vue

@@ -1,5 +1,4 @@
1 1
 <template>
2
-    <!-- <Login></Login> -->
3 2
     <div class="container">
4 3
         <div class="header">
5 4
             <img :src="headImg" alt="" />
@@ -7,20 +6,14 @@
7 6
         <el-container>
8 7
             <left></left>
9 8
             <right></right>
10
-            <div ref="linedomRef"
11
-                style="width:1px;height:1px;position: absolute;z-index: 228;border-radius:15px;background:#ccc;border: 1px solid darkcyan;">
9
+            <div ref="linedomRef" style="width:1px;height:1px;position: absolute;z-index: 228;background:#ccc;">
12 10
             </div>
13 11
 
14 12
         </el-container>
15
-
16
-
17
-
18 13
         <div ref="popoverRef" id="popoverRef" class="modelInfo">
19 14
             <div class="model-detail">
20
-
21 15
                 <span v-for="item in classDeviceInfo">
22
-                    <!-- {{ item }} -->
23
-                    <!-- {{ item.value === "在线" }} -->
16
+
24 17
                     <span class="title">{{ item && item.name }}: </span>
25 18
                     <span :class="item.online ? 'green' : item.online == 'false' ? 'red' : ''">{{ item && item.value }}
26 19
                     </span>
@@ -31,7 +24,7 @@
31 24
 
32 25
 
33 26
         <!-- 视频播放弹框 -->
34
-        <el-dialog class="videoDialog" v-model="videoDialog" title="互动教师1" width="60%" align="center" top="4%">
27
+        <el-dialog class="videoDialog" v-model="videoDialog" :title="titleDialog" width="60%" align="center" top="4%">
35 28
             <videoPlay v-bind="videoData" @play="onPlay" />
36 29
         </el-dialog>
37 30
     </div>
@@ -58,13 +51,15 @@ export default ({
58 51
     name: 'Histogram',
59 52
     components: { Login, Left, Right, ElScrollbar, ElPagination, ElDialog, videoPlay, ElCarousel, ElCarouselItem, CircleProgress },
60 53
     setup() {
54
+        const titleDialog = ref("")
61 55
         // 视频数据
62 56
         const videoData = reactive({
63 57
             width: "100%", //播放器高度
64 58
             height: "100%", //播放器高度
65 59
             color: "red", //主题色
66 60
             title: "互动教室", //视频名称
67
-            src: "https://cdn.jsdelivr.net/gh/xdlumia/files/video-play/IronMan.mp4", //视频源
61
+            // src: "https://cdn.jsdelivr.net/gh/xdlumia/files/video-play/IronMan.mp4", //视频源
62
+            src: '',
68 63
             muted: false, //静音
69 64
             webFullScreen: false,
70 65
             // speedRate: ["0.75", "1.0", "1.25", "1.5", "2.0"], //播放倍速
@@ -119,7 +114,6 @@ export default ({
119 114
         const videoDialog = ref(false)
120 115
         // 播放视频
121 116
         const lookVideo = function () {
122
-
123 117
             videoDialog.value = true;
124 118
             console.log("点击了播放视频", 12312312)
125 119
         }
@@ -167,26 +161,25 @@ export default ({
167 161
         }
168 162
         const handleResponseFunction = (data) => {
169 163
             // console.log("从UE返回过来的值", data)
170
-            console.log("重新变了坐标", 2423423423);
171 164
             let json = eval("(" + data + ")");//转对象
172
-            clickData.value = json;
165
+            // clickData.value = json;
173 166
             console.log("clickData---点击的数据", json)
167
+            if (json.videoUrl) {
168
+                videoDialog.value = true;
169
+                videoData.src = json.videoUrl
170
+                titleDialog.value = "互动教室"
171
+                return
172
+            }
174 173
             if (json.deviceCode) {
175 174
                 getClassDetail(json.deviceCode).then(res => {
176 175
                     classDeviceInfo.value = res.data;
177 176
                     classDeviceInfo.value.map(i => {
178
-                        // if (i.name === "设备状态") {
179
-                        //     i.online = true
180
-                        // } else {
181
-                        //     i.online = "no"
182
-                        // }
183 177
                         if (i.value == "在线") {
184 178
                             i.online = true
185 179
                         }
186 180
                         if (i.value == "离线") {
187 181
                             i.online = false
188 182
                         }
189
-                        // i.online = i.name === "设备状态" ? true : false
190 183
                     })
191 184
                     console.log("json.y ", json,);
192 185
                     linedomRef.value.style.top = (clickData.value.y) + "px";
@@ -245,33 +238,14 @@ export default ({
245 238
             // console.log("监听一下窗口是不是改了--click", lineContainer);
246 239
             callUIInteraction("windowSizeChange")
247 240
         }
248
-        const getUserInfo = (url) => {
249
-            let userurl = "   https://weizhi.huanghuai.edu.cn/cmccr-server/center/cas/v1/getUser?casLoginUrl=https://cas.huanghuai.edu.cn/cas/serviceValidate?"
250
-                + url + "&service=https://weizhi.huanghuai.edu.cn/cmips/"
251
-            // axios.get(userurl).then(res => {
252
-
253
-            // })
254
-
255 241
 
256 242
 
257
-        }
258 243
         onMounted(() => {
259 244
             addResponseEventListener("444", handleResponseFunction);
260 245
             window.addEventListener('resize', windowSize);
261 246
             // window.addEventListener('click', windowSize);
262 247
             // addResponseEventListener("widowSizeChange", windoChangeFunction);
263 248
 
264
-            let search = window.location.hash.split("?")[1];
265
-            getUserInfo(search)
266
-            // console.log(search, "编码")
267
-            // let code = result.split("?")[0]; //去掉&之后的冗余部分
268
-
269
-            // console.log(result);
270
-            // // window.addEventListener('hashchange', pathChange);
271
-            // const searchParams = currentUrl.searchParams;
272
-            // let ticket = searchParams.get("ticket"); // 'devpoint'
273
-            // console.log("ticket", ticket);
274
-            // searchParams.get("page"); // '1'
275 249
 
276 250
 
277 251
         })
@@ -291,7 +265,8 @@ export default ({
291 265
             lineContainer,
292 266
             classDeviceInfo,
293 267
             mouseClick,
294
-            headImg
268
+            headImg,
269
+            titleDialog
295 270
         }
296 271
     },
297 272
 })

+ 0 - 71
src/components/right.vue

@@ -141,77 +141,6 @@ export default ({
141 141
         }
142 142
         // 物联设备
143 143
         let equipmentTotal = ref({})
144
-        //智慧教室实时监控---数据
145
-        // const carouselData = ref([
146
-        //     {
147
-        //         activeMonitor: {
148
-        //             title: "多屏互动教室",
149
-        //             array: [
150
-        //                 {
151
-        //                     title: "互动教室22",
152
-        //                     poster: 'rb1',
153
-        //                     src: '',
154
-        //                 },
155
-        //                 {
156
-        //                     title: "互动教室22",
157
-        //                     poster: 'rb2',
158
-        //                     src: '',
159
-        //                 }
160
-        //             ]
161
-        //         },
162
-        //         wisdomMonitor:
163
-        //         {
164
-        //             title: "多屏智慧教室",
165
-        //             array: [
166
-        //                 {
167
-        //                     title: "智慧教室11",
168
-        //                     poster: 'rb1',
169
-        //                     src: '',
170
-        //                 },
171
-        //                 {
172
-        //                     title: "智慧教室11",
173
-        //                     poster: 'rb2',
174
-        //                     src: '',
175
-        //                 }
176
-        //             ]
177
-        //         }
178
-        //     },
179
-        //     {
180
-        //         activeMonitor: {
181
-        //             title: "多屏互动教室",
182
-        //             array: [
183
-        //                 {
184
-        //                     title: "互动教室33",
185
-        //                     poster: 'rb1',
186
-        //                     src: '',
187
-        //                 },
188
-        //                 {
189
-        //                     title: "互动教室33",
190
-        //                     poster: 'rb2',
191
-        //                     src: '',
192
-        //                 }
193
-        //             ]
194
-        //         },
195
-
196
-        //         wisdomMonitor:
197
-        //         {
198
-        //             title: "多屏智慧教室",
199
-        //             array: [
200
-        //                 {
201
-        //                     title: "智慧教室22",
202
-        //                     poster: 'rb1',
203
-        //                     src: '',
204
-        //                 },
205
-        //                 {
206
-        //                     title: "智慧教室22",
207
-        //                     poster: 'rb2',
208
-        //                     src: '',
209
-        //                 }
210
-        //             ]
211
-        //         }
212
-        //     }
213
-
214
-        // ]);
215 144
         // 物联设备类型统计
216 145
         let interDevice = ref([])
217 146
         // 智慧教室