Browse Source

动态生成线

huliu 1 year ago
parent
commit
19c9df4001

+ 1 - 0
index.html

@@ -5,6 +5,7 @@
5 5
   <meta charset="UTF-8" />
6 6
   <link rel="icon" href="/favicon.ico" />
7 7
   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
8
+  <script src="/src/assets/js/leaderline.js"></script>
8 9
   <title>元宇宙 App</title>
9 10
   <style>
10 11
     * {

+ 52 - 0
package-lock.json

@@ -295,6 +295,12 @@
295 295
       "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
296 296
       "dev": true
297 297
     },
298
+    "big.js": {
299
+      "version": "5.2.2",
300
+      "resolved": "https://registry.npmmirror.com/big.js/-/big.js-5.2.2.tgz",
301
+      "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==",
302
+      "dev": true
303
+    },
298 304
     "binary-extensions": {
299 305
       "version": "2.2.0",
300 306
       "resolved": "https://registry.npmmirror.com/binary-extensions/-/binary-extensions-2.2.0.tgz",
@@ -398,6 +404,12 @@
398 404
         "normalize-wheel-es": "^1.2.0"
399 405
       }
400 406
     },
407
+    "emojis-list": {
408
+      "version": "3.0.0",
409
+      "resolved": "https://registry.npmmirror.com/emojis-list/-/emojis-list-3.0.0.tgz",
410
+      "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==",
411
+      "dev": true
412
+    },
401 413
     "esbuild": {
402 414
       "version": "0.14.47",
403 415
       "resolved": "https://registry.npmmirror.com/esbuild/-/esbuild-0.14.47.tgz",
@@ -709,12 +721,37 @@
709 721
       "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
710 722
       "dev": true
711 723
     },
724
+    "json5": {
725
+      "version": "1.0.2",
726
+      "resolved": "https://registry.npmmirror.com/json5/-/json5-1.0.2.tgz",
727
+      "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==",
728
+      "dev": true,
729
+      "requires": {
730
+        "minimist": "^1.2.0"
731
+      }
732
+    },
712 733
     "jsonc-parser": {
713 734
       "version": "3.2.0",
714 735
       "resolved": "https://registry.npmmirror.com/jsonc-parser/-/jsonc-parser-3.2.0.tgz",
715 736
       "integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==",
716 737
       "dev": true
717 738
     },
739
+    "leader-line": {
740
+      "version": "1.0.7",
741
+      "resolved": "https://registry.npmmirror.com/leader-line/-/leader-line-1.0.7.tgz",
742
+      "integrity": "sha512-PhJpQLV7XychSIuGPD0TEqR9PgRYBbrhReaOcmHFOVtTw4dWKfUMAtOb7UP7xTsoib6sFzq2giQeOUHy7LCuJQ=="
743
+    },
744
+    "loader-utils": {
745
+      "version": "1.4.2",
746
+      "resolved": "https://registry.npmmirror.com/loader-utils/-/loader-utils-1.4.2.tgz",
747
+      "integrity": "sha512-I5d00Pd/jwMD2QCduo657+YM/6L3KZu++pmX9VFncxaxvHcru9jx1lBaFft+r4Mt2jK0Yhp41XlRAihzPxHNCg==",
748
+      "dev": true,
749
+      "requires": {
750
+        "big.js": "^5.2.2",
751
+        "emojis-list": "^3.0.0",
752
+        "json5": "^1.0.1"
753
+      }
754
+    },
718 755
     "local-pkg": {
719 756
       "version": "0.4.3",
720 757
       "resolved": "https://registry.npmmirror.com/local-pkg/-/local-pkg-0.4.3.tgz",
@@ -787,6 +824,12 @@
787 824
         "brace-expansion": "^2.0.1"
788 825
       }
789 826
     },
827
+    "minimist": {
828
+      "version": "1.2.8",
829
+      "resolved": "https://registry.npmmirror.com/minimist/-/minimist-1.2.8.tgz",
830
+      "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==",
831
+      "dev": true
832
+    },
790 833
     "mlly": {
791 834
       "version": "1.4.0",
792 835
       "resolved": "https://registry.npmmirror.com/mlly/-/mlly-1.4.0.tgz",
@@ -942,6 +985,15 @@
942 985
       "integrity": "sha512-4AsO/FrViE/iDNEPaAQlb77tf0csuq27EsVpy6ett584EcRTp6pTDLoGWVxCD77y5iU5FauOvhsI4o1APwPoSQ==",
943 986
       "dev": true
944 987
     },
988
+    "skeleton-loader": {
989
+      "version": "2.0.0",
990
+      "resolved": "https://registry.npmmirror.com/skeleton-loader/-/skeleton-loader-2.0.0.tgz",
991
+      "integrity": "sha512-juKGqmMbD0MNRYm1X7vJLJIvOQWVJNpupmkYaUHltMS9oqIMuQk9upmPmYfo1n2XiYQnLm7tgDpDCjmueJH0AQ==",
992
+      "dev": true,
993
+      "requires": {
994
+        "loader-utils": "^1.1.0"
995
+      }
996
+    },
945 997
     "source-map": {
946 998
       "version": "0.6.1",
947 999
       "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz",

+ 2 - 0
package.json

@@ -12,6 +12,7 @@
12 12
     "axios": "^1.4.0",
13 13
     "echarts": "^5.4.3",
14 14
     "element-plus": "^2.3.9",
15
+    "leader-line": "^1.0.7",
15 16
     "postcss-pxtorem": "^6.0.0",
16 17
     "vue": "^3.2.25",
17 18
     "vue3-video-play": "^1.3.1-beta.6"
@@ -19,6 +20,7 @@
19 20
   "devDependencies": {
20 21
     "@vitejs/plugin-vue": "^2.3.3",
21 22
     "sass": "^1.64.2",
23
+    "skeleton-loader": "^2.0.0",
22 24
     "unplugin-auto-import": "^0.16.6",
23 25
     "unplugin-vue-components": "^0.25.1",
24 26
     "vite": "^2.9.9"

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

@@ -27,17 +27,19 @@
27 27
 .model-detail {
28 28
     display: flex;
29 29
     justify-content: space-between;
30
-    flex-wrap: wrap;
30
+    flex-direction: column;
31
+    // flex-wrap: wrap;
31 32
     padding: 10px;
32 33
 
33 34
     span {
34 35
         font-size: 16px;
35 36
 
36
-        width: 160px;
37
+        width: 100%;
37 38
         font-family: Microsoft YaHei UI;
38 39
 
39 40
         // border: 1px solid red;
40
-        margin: 6px;
41
+        // margin: 6px;
42
+        margin: 6px 0;
41 43
         font-weight: 400;
42 44
 
43 45
         .title {

+ 25 - 1
src/assets/css/left.scss

@@ -74,7 +74,7 @@
74 74
              justify-content: space-around;
75 75
              height: 108px;
76 76
              // border: 1px solid sandybrown;
77
-             width: 93px;
77
+             //  width: 93px;
78 78
              box-sizing: border-box;
79 79
              // margin-top: 42px;
80 80
              margin: 40px 16px 39px 22px;
@@ -219,4 +219,28 @@
219 219
      overflow: hidden;
220 220
      justify-content: space-evenly;
221 221
 
222
+ }
223
+
224
+ // 点击模型弹出框
225
+ .model-detail {
226
+     display: flex;
227
+     justify-content: space-between;
228
+     flex-wrap: wrap;
229
+     padding: 10px;
230
+
231
+     span {
232
+         font-size: 16px;
233
+
234
+         width: 160px;
235
+         font-family: Microsoft YaHei UI;
236
+
237
+         // border: 1px solid red;
238
+         margin: 6px;
239
+         font-weight: 400;
240
+
241
+         .title {
242
+             color: #000;
243
+             font-weight: 700;
244
+         }
245
+     }
222 246
  }

File diff suppressed because it is too large
+ 2986 - 0
src/assets/js/leaderline.js


+ 159 - 185
src/components/home.vue

@@ -3,72 +3,56 @@
3 3
         <div class="header">
4 4
             <img src="../assets/img/head.png" alt="" />
5 5
         </div>
6
-
7 6
         <el-container>
8 7
             <left></left>
9 8
             <right></right>
10
-        </el-container>
9
+            <div ref="linedomRef" style="width: 2px;height:2px;background-color: green;position: absolute;z-index: 228;">
10
+            </div>
11 11
 
12
-        <el-dialog v-model="centerDialogVisible" title="Warning" width="30%" align-center>
13
-            <span>
14
-                {{ clickData.value && clickData.value.status }}
15
-            </span>
16
-            <template #footer>
17
-                <span class="dialog-footer">
18
-                    <el-button @click="centerDialogVisible = false">Cancel</el-button>
19
-                    <el-button type="primary" @click="centerDialogVisible = false">
20
-                        Confirm
21
-                    </el-button>
22
-                </span>
23
-            </template>
24
-        </el-dialog>
12
+        </el-container>
25 13
 
26 14
 
27
-        <el-popover ref="popoverRef" v-model:visible="visible" :width="400" :virtual-ref="triggerRef" trigger="click"
15
+        <el-popover placement="right" v-model:visible="visible" :width="260" :virtual-ref="triggerRef" trigger="click"
28 16
             virtual-triggering>
29
-            <div class="model-detail">
30
-                <span><span class="title">教室状态: </span>{{ clickData.value && clickData.value.status }}</span>
31
-                <span><span class="title">班级: </span>{{ clickData.value && clickData.value.classes }}</span>
32
-                <span><span class="title">课程名称: </span>{{ clickData.value && clickData.value.course }}</span>
33
-                <span><span class="title">应到人数: </span>{{ clickData.value && clickData.value.theory }}</span>
34
-                <span><span class="title">教室: </span>{{ clickData.value && clickData.value.name }}</span>
35
-                <span><span class="title">实到人数: </span>{{ clickData.value && clickData.value.actual }}</span>
36
-                <span><span class="title">老师: </span>{{ clickData.value && clickData.value.teacher }}</span>
17
+            <div class="model-detail" ref="popoverRef" id="popoverRef">
18
+                <span v-for="item in classDeviceInfo">
19
+                    <span class="title">{{ item && item.name }}: </span>
20
+                    {{ item && item.value }}
21
+                    {{ classDeviceInfo.value &&
22
+                        classDeviceInfo.value.status }}
23
+                </span>
24
+
25
+                <!-- <span><span class="title">{{ classDeviceInfo.value && classDeviceInfo.value.name }}: </span>{{
26
+                    classDeviceInfo.value &&
27
+                    classDeviceInfo.value.status }}</span>
28
+                <span><span class="title">设备状态: </span>{{ classDeviceInfo.value && classDeviceInfo.value.classes }}</span>
29
+                <span><span class="title">位置: </span>{{ classDeviceInfo.value && classDeviceInfo.value.course }}</span>
30
+                <span><span class="title">型号: </span>{{ classDeviceInfo.value && classDeviceInfo.value.theory }}</span>
31
+                <span><span class="title">质保期: </span>{{ classDeviceInfo.value && classDeviceInfo.value.name }}</span> -->
32
+                <!-- <span><span class="title">实到人数: </span>{{ clickData.value && clickData.value.actual }}</span>
33
+                <span><span class="title">老师: </span>{{ clickData.value && clickData.value.teacher }}</span> -->
37 34
             </div>
38 35
         </el-popover>
39 36
 
40 37
         <!-- 视频播放弹框 -->
41 38
         <el-dialog class="videoDialog" v-model="videoDialog" title="互动教师1" width="60%" align="center" top="4%">
42 39
             <videoPlay v-bind="videoData" @play="onPlay" />
43
-
44
-            <!-- <template #footer>
45
-                <span class="dialog-footer">
46
-                    <el-button @click="centerDialogVisible = false">Cancel</el-button>
47
-                    <el-button type="primary" @click="centerDialogVisible = false">
48
-                        Confirm
49
-                    </el-button>
50
-                </span>
51
-            </template> -->
52 40
         </el-dialog>
53 41
     </div>
54 42
 </template>
55 43
 
56
-<script >
44
+<script>
57 45
 import { reactive, onMounted, ref, toRefs, onBeforeUnmount, getCurrentInstance, nextTick } from 'vue';
58 46
 import { ElScrollbar, ElPagination, ElDialog, ElCarousel, ElCarouselItem, ElMessage } from "element-plus";
59 47
 import "vue3-video-play/dist/style.css";
60
-import {
61
-    callUIInteraction,
62
-    addResponseEventListener
63
-} from "../webrtcVideo.js";
64
-import { testApi } from '../request/api'
48
+import { addResponseEventListener } from "../webrtcVideo.js";
65 49
 import { videoPlay } from "vue3-video-play";
66 50
 import CircleProgress from './CircleProgress.vue';
67 51
 import Left from './left.vue'
68 52
 import Right from './right.vue'
69
-
53
+import LeaderLine from "../assets/js/leaderline.js"
54
+import { getClassDetail } from '../request/api.js'
70 55
 export default ({
71
-
72 56
     name: 'Histogram',
73 57
     components: { Left, Right, ElScrollbar, ElPagination, ElDialog, videoPlay, ElCarousel, ElCarouselItem, CircleProgress },
74 58
     setup() {
@@ -100,49 +84,47 @@ export default ({
100 84
                 "fullScreen",
101 85
             ], //显示所有按钮,
102 86
         });
103
-
104
-
105
-
106 87
         // 物联设备类型统计
107
-        const interDevice = ref([
108
-            {
109
-                number: 98,
110
-                color: "#63ABFF",
111
-                icon: 'r1',
112
-                text: "显示系统"
113
-            },
114
-            {
115
-                number: 185,
116
-                color: "#63FFC7",
117
-                icon: 'r2',
118
-                text: "控制设备"
119
-            },
120
-            {
121
-                number: 58,
122
-                color: "#918EFF",
123
-                icon: 'r3',
124
-                text: "音频设备"
125
-            },
126
-            {
127
-                number: 68,
128
-                color: "#00C8E3",
129
-                icon: 'r4',
130
-                text: "录播设备"
131
-            },
132
-            {
133
-                number: 189,
134
-                color: "#FFBB54",
135
-                icon: 'r5',
136
-                text: "环境设备"
137
-            },
138
-            {
139
-                number: 98,
140
-                color: "#00CF78",
141
-                icon: 'r6',
142
-                text: "安全管理"
143
-            },
144
-
145
-        ])
88
+        const interDevice = ref(
89
+            [
90
+                // {
91
+                //     number: 98,
92
+                //     color: "#63ABFF",
93
+                //     icon: 'r1',
94
+                //     text: "显示系统"
95
+                // },
96
+                // {
97
+                //     number: 185,
98
+                //     color: "#63FFC7",
99
+                //     icon: 'r2',
100
+                //     text: "控制设备"
101
+                // },
102
+                // {
103
+                //     number: 58,
104
+                //     color: "#918EFF",
105
+                //     icon: 'r3',
106
+                //     text: "音频设备"
107
+                // },
108
+                // {
109
+                //     number: 68,
110
+                //     color: "#00C8E3",
111
+                //     icon: 'r4',
112
+                //     text: "录播设备"
113
+                // },
114
+                // {
115
+                //     number: 189,
116
+                //     color: "#FFBB54",
117
+                //     icon: 'r5',
118
+                //     text: "环境设备"
119
+                // },
120
+                // {
121
+                //     number: 98,
122
+                //     color: "#00CF78",
123
+                //     icon: 'r6',
124
+                //     text: "安全管理"
125
+                // },
126
+
127
+            ])
146 128
         // 位置弹框
147 129
         let centerDialogVisible = ref(false)
148 130
         // 获取点击点数据
@@ -170,10 +152,7 @@ export default ({
170 152
             })
171 153
         }
172 154
 
173
-        const testGetApi = async () => {
174
-            let res = await testApi("ymy")
175
-            console.log("请求到的", res);
176
-        }
155
+
177 156
         //视频播放弹框
178 157
         const videoDialog = ref(false)
179 158
         // 播放视频
@@ -186,119 +165,111 @@ export default ({
186 165
         const onPlay = function () {
187 166
             console.log("播放视频")
188 167
         }
189
-        //智慧教室实时监控---数据
190
-        const carouselData = ref([
191
-            {
192
-                activeMonitor: {
193
-                    title: "多屏互动教室",
194
-                    array: [
195
-                        {
196
-                            title: "互动教室22",
197
-                            poster: 'rb1',
198
-                            src: '',
199
-                        },
200
-                        {
201
-                            title: "互动教室22",
202
-                            poster: 'rb2',
203
-                            src: '',
204
-                        }
205
-                    ]
206
-                },
207
-                wisdomMonitor:
208
-                {
209
-                    title: "多屏智慧教室",
210
-                    array: [
211
-                        {
212
-                            title: "智慧教室11",
213
-                            poster: 'rb1',
214
-                            src: '',
215
-                        },
216
-                        {
217
-                            title: "智慧教室11",
218
-                            poster: 'rb2',
219
-                            src: '',
220
-                        }
221
-                    ]
222
-                }
223
-            },
224
-            {
225
-                activeMonitor: {
226
-                    title: "多屏互动教室",
227
-                    array: [
228
-                        {
229
-                            title: "互动教室33",
230
-                            poster: 'rb1',
231
-                            src: '',
232
-                        },
233
-                        {
234
-                            title: "互动教室33",
235
-                            poster: 'rb2',
236
-                            src: '',
237
-                        }
238
-                    ]
239
-                },
240
-
241
-                wisdomMonitor:
242
-                {
243
-                    title: "多屏智慧教室",
244
-                    array: [
245
-                        {
246
-                            title: "智慧教室22",
247
-                            poster: 'rb1',
248
-                            src: '',
249
-                        },
250
-                        {
251
-                            title: "智慧教室22",
252
-                            poster: 'rb2',
253
-                            src: '',
254
-                        }
255
-                    ]
256
-                }
257
-            }
258 168
 
259
-        ]
260
-        )
169
+        const linedomRef = ref(null)
170
+        let lineContainer = ref(null)
171
+        const popoverRef = ref(null)
172
+        const lineStyleOption = ref({
173
+            startPlug: 'disc',
174
+            endPlug: 'disc',
175
+            dash: true,
176
+            color: '#2AC367',
177
+            startPlugColor: '#fff',
178
+            startPlugOutlineColor: '#2AC367',
179
+            endPlugColor: '#fff', // translucent
180
+            endPlugOutlineColor: '#2AC367',
181
+            size: 3,
182
+            startPlugSize: 1.5,
183
+            startPlugOutlineSize: 1,
184
+            endPlugSize: 3,
185
+            endPlugOutlineSize: 3
186
+        })
187
+        const classDeviceInfo = ref([])
188
+        const classDevice = async function (deviceCode) {
189
+            let res = await getClassDetail(deviceCode)
190
+            // console.log("获取到了当前点击物体得详情", res)
191
+            classDeviceInfo.value = res.data
192
+        }
193
+        const clickData1 = ref({})
194
+        const mouseClick = function (e) {
195
+            // console.log("屏幕点击位置看", e)
196
+            clickData1.value.x = e.clientX;
197
+            clickData1.value.y = e.clientY;
261 198
 
262
-        let timer = ref(null)
263
-        let testMain = ref(null)
199
+        }
264 200
         onMounted(() => {
201
+            // window.addEventListener('mousedown', mouseClick);
265 202
 
266
-            // const { appContext } = getCurrentInstance()
267
-
268
-            // console.log("获取当前组件实例", appContext)
269
-            // const globalProxy = appContext.config.globalProperties;
270
-            // console.log("看一下 globalProxy", globalProxy, typeof globalProxy)
271
-            // globalProxy.$message({
272
-            //     type: 'success',
273
-            //     messsage: 'xxxx'
274
-            // })
275
-            // ElMessage.success("ok");
276
-            // globalProxy1 = appContext.config.globalProperties;
277
-            // console.log("xxxx", globalProxy1);
278
-            // testGetApi()
279 203
             // 监听一下页面点击情况
280 204
             addResponseEventListener("open", (data) => {
281 205
                 if (data) {
282 206
                     let json = eval("(" + data + ")");//转对象
283 207
                     clickData.value = json;
284
-                    console.log("clickData---点击的数据", clickData.value)
285
-                    visible.value = true;
286
-                    mousemoveHandler(json.x, json.y)
287
-                }
288
-            })
289
-
290
-        })
291
-
208
+                    console.log("clickData---点击的数据", json)
209
+                    // console.log("看一下", linedomRef.value.style.top, json, "json")
210
+                    visible.value = true
211
+                    linedomRef.value.style.top = (json.y - 60) + "px";
212
+                    linedomRef.value.style.left = json.x + "px";
213
+
214
+                    let dot = {
215
+                        x: json.x,
216
+                        y: json.y - 80
217
+                    }
218
+                    console.log("看一下---小圆点的值--top", linedomRef.value.style.top)
219
+                    console.log("看一下---小圆点的值--left", linedomRef.value.style.left)
220
+                    // alert(json.x, json.y)
221
+                    switch (json.direction) {
222
+                        case "Left":
223
+                            mousemoveHandler(json.x - 380, dot.y)
224
+                            break;
225
+                        case "Up":
226
+                            console.log("在最上面", json.x, json.x - 100);
227
+                            mousemoveHandler(dot.x - 80, dot.y - 200);
228
+                            break;
229
+                        case "Right":
230
+                            console.log("没有走到这里来吗", 12312);
231
+                            mousemoveHandler(Number(json.x) + 30, Number(json.y) - 80)
232
+                            break;
233
+                        case "Down":
234
+                            // console.log("xxxx没有走到这里来吗--down", json.y,);
235
+                            mousemoveHandler(Number(json.y), Number(json.x) - 260);
236
+                            break;
237
+                        default:
238
+                            mousemoveHandler(json.x, json.y);
239
+                            break;
240
+                    }
241
+                    // mousemoveHandler(Number(json.x) + 30, Number(json.y) - 80)
242
+                    if (lineContainer.value) {
243
+                        lineContainer.value.remove()
244
+                    }
245
+                    setTimeout(() => {
246
+                        lineContainer.value = new LeaderLine(linedomRef.value, popoverRef.value, lineStyleOption.value)
247
+                        lineContainer.value.show('draw', {
248
+                            duration: 1000, //持续时长
249
+                            timing: 'ease-in' // 动画函数
250
+                        })
251
+                        lineContainer.value.endPlugOutline = true;
252
+                        lineContainer.value.startPlugOutline = true;
253
+                        lineContainer.value.position();
254
+                    }, 0);
292 255
 
293 256
 
294 257
 
258
+                }
259
+            })
295 260
 
261
+            addResponseEventListener("End", data => {
262
+                let json = eval("(" + data + ")");
263
+                clickData.value = json;
264
+                classDevice()
265
+                // // classDevice()
266
+                // console.log("移动结束", 123123, data)
296 267
 
268
+            })
297 269
 
270
+        })
298 271
 
299 272
         return {
300
-
301
-
302 273
             centerDialogVisible,
303 274
             interDevice,
304 275
             clickData,
@@ -308,8 +279,11 @@ export default ({
308 279
             onPlay,
309 280
             videoDialog,
310 281
             lookVideo,
311
-            ...toRefs(carouselData),
312
-            carouselData,
282
+            linedomRef,
283
+            popoverRef,
284
+            lineContainer,
285
+            classDeviceInfo,
286
+            mouseClick,
313 287
         }
314 288
     },
315 289
 })

+ 333 - 0
src/components/left copy.vue

@@ -0,0 +1,333 @@
1
+<template>
2
+    <div class="container">
3
+        <div class="header">
4
+            <img src="../assets/img/head.png" alt="" />
5
+        </div>
6
+        <el-container>
7
+            <!-- <left></left>
8
+            <right></right> -->
9
+            <div ref="linedomRef" style="width: 50px;height: 50px;background-color: #f00;position: absolute;z-index: 228;">
10
+            </div>
11
+
12
+        </el-container>
13
+
14
+
15
+        <el-popover placement="right" v-model:visible="visible" :width="260" :virtual-ref="triggerRef" trigger="click"
16
+            virtual-triggering>
17
+            <div class="model-detail" ref="popoverRef" id="popoverRef">
18
+                <span><span class="title">设备名称: </span>{{ clickData.value && clickData.value.status }}</span>
19
+                <span><span class="title">设备状态: </span>{{ clickData.value && clickData.value.classes }}</span>
20
+                <span><span class="title">位置: </span>{{ clickData.value && clickData.value.course }}</span>
21
+                <span><span class="title">型号: </span>{{ clickData.value && clickData.value.theory }}</span>
22
+                <span><span class="title">质保期: </span>{{ clickData.value && clickData.value.name }}</span>
23
+                <!-- <span><span class="title">实到人数: </span>{{ clickData.value && clickData.value.actual }}</span>
24
+                <span><span class="title">老师: </span>{{ clickData.value && clickData.value.teacher }}</span> -->
25
+            </div>
26
+        </el-popover>
27
+
28
+        <!-- 视频播放弹框 -->
29
+        <el-dialog class="videoDialog" v-model="videoDialog" title="互动教师1" width="60%" align="center" top="4%">
30
+            <videoPlay v-bind="videoData" @play="onPlay" />
31
+        </el-dialog>
32
+    </div>
33
+</template>
34
+
35
+<script>
36
+import { reactive, onMounted, ref, toRefs, onBeforeUnmount, getCurrentInstance, nextTick } from 'vue';
37
+import { ElScrollbar, ElPagination, ElDialog, ElCarousel, ElCarouselItem, ElMessage } from "element-plus";
38
+import "vue3-video-play/dist/style.css";
39
+import { addResponseEventListener } from "../webrtcVideo.js";
40
+import { videoPlay } from "vue3-video-play";
41
+import CircleProgress from './CircleProgress.vue';
42
+import Left from './left.vue'
43
+import Right from './right.vue'
44
+import LeaderLine from "../assets/js/leaderline.js"
45
+
46
+export default ({
47
+    name: 'Histogram',
48
+    components: { Left, Right, ElScrollbar, ElPagination, ElDialog, videoPlay, ElCarousel, ElCarouselItem, CircleProgress },
49
+    setup() {
50
+        // 视频数据
51
+        const videoData = reactive({
52
+            width: "100%", //播放器高度
53
+            height: "100%", //播放器高度
54
+            color: "red", //主题色
55
+            title: "互动教室", //视频名称
56
+            src: "https://cdn.jsdelivr.net/gh/xdlumia/files/video-play/IronMan.mp4", //视频源
57
+            muted: false, //静音
58
+            webFullScreen: false,
59
+            // speedRate: ["0.75", "1.0", "1.25", "1.5", "2.0"], //播放倍速
60
+            autoPlay: false, //自动播放
61
+            loop: false, //循环播放
62
+            mirror: false, //镜像画面
63
+            ligthOff: false, //关灯模式
64
+            volume: 0.3, //默认音量大小
65
+            control: true, //是否显示控制
66
+            currentTime: 0,//跳转到固定播放时间
67
+            controlBtns: [
68
+                "audioTrack",
69
+                "quality",
70
+                "speedRate",
71
+                "volume",
72
+                "setting",
73
+                "pip",
74
+                "pageFullScreen",
75
+                "fullScreen",
76
+            ], //显示所有按钮,
77
+        });
78
+        // 物联设备类型统计
79
+        const interDevice = ref(
80
+            [
81
+                // {
82
+                //     number: 98,
83
+                //     color: "#63ABFF",
84
+                //     icon: 'r1',
85
+                //     text: "显示系统"
86
+                // },
87
+                // {
88
+                //     number: 185,
89
+                //     color: "#63FFC7",
90
+                //     icon: 'r2',
91
+                //     text: "控制设备"
92
+                // },
93
+                // {
94
+                //     number: 58,
95
+                //     color: "#918EFF",
96
+                //     icon: 'r3',
97
+                //     text: "音频设备"
98
+                // },
99
+                // {
100
+                //     number: 68,
101
+                //     color: "#00C8E3",
102
+                //     icon: 'r4',
103
+                //     text: "录播设备"
104
+                // },
105
+                // {
106
+                //     number: 189,
107
+                //     color: "#FFBB54",
108
+                //     icon: 'r5',
109
+                //     text: "环境设备"
110
+                // },
111
+                // {
112
+                //     number: 98,
113
+                //     color: "#00CF78",
114
+                //     icon: 'r6',
115
+                //     text: "安全管理"
116
+                // },
117
+
118
+            ])
119
+        // 位置弹框
120
+        let centerDialogVisible = ref(false)
121
+        // 获取点击点数据
122
+        let clickData = reactive({})
123
+        const visible = ref(false)
124
+        const triggerRef = ref({
125
+            getBoundingClientRect() {
126
+                // console.log("positon----方法返回元素的大小及其相对于视口的位置", position.value)
127
+                return position.value
128
+            },
129
+        })
130
+        const position = ref({
131
+            top: 0,
132
+            left: 0,
133
+            bottom: 0,
134
+            right: 0,
135
+        })
136
+        // 点击某个模型跟随移动
137
+        const mousemoveHandler = (x, y) => {
138
+            position.value = DOMRect.fromRect({
139
+                width: 0,
140
+                height: 0,
141
+                x: x,
142
+                y: y,
143
+            })
144
+        }
145
+
146
+
147
+        //视频播放弹框
148
+        const videoDialog = ref(false)
149
+        // 播放视频
150
+        const lookVideo = function () {
151
+
152
+            videoDialog.value = true;
153
+            console.log("点击了播放视频", 12312312)
154
+        }
155
+        // 播放视频
156
+        const onPlay = function () {
157
+            console.log("播放视频")
158
+        }
159
+        //智慧教室实时监控---数据
160
+        const carouselData = ref([
161
+            // {
162
+            //     activeMonitor: {
163
+            //         title: "多屏互动教室",
164
+            //         array: [
165
+            //             {
166
+            //                 title: "互动教室22",
167
+            //                 poster: 'rb1',
168
+            //                 src: '',
169
+            //             },
170
+            //             {
171
+            //                 title: "互动教室22",
172
+            //                 poster: 'rb2',
173
+            //                 src: '',
174
+            //             }
175
+            //         ]
176
+            //     },
177
+            //     wisdomMonitor:
178
+            //     {
179
+            //         title: "多屏智慧教室",
180
+            //         array: [
181
+            //             {
182
+            //                 title: "智慧教室11",
183
+            //                 poster: 'rb1',
184
+            //                 src: '',
185
+            //             },
186
+            //             {
187
+            //                 title: "智慧教室11",
188
+            //                 poster: 'rb2',
189
+            //                 src: '',
190
+            //             }
191
+            //         ]
192
+            //     }
193
+            // },
194
+            // {
195
+            //     activeMonitor: {
196
+            //         title: "多屏互动教室",
197
+            //         array: [
198
+            //             {
199
+            //                 title: "互动教室33",
200
+            //                 poster: 'rb1',
201
+            //                 src: '',
202
+            //             },
203
+            //             {
204
+            //                 title: "互动教室33",
205
+            //                 poster: 'rb2',
206
+            //                 src: '',
207
+            //             }
208
+            //         ]
209
+            //     },
210
+
211
+            //     wisdomMonitor:
212
+            //     {
213
+            //         title: "多屏智慧教室",
214
+            //         array: [
215
+            //             {
216
+            //                 title: "智慧教室22",
217
+            //                 poster: 'rb1',
218
+            //                 src: '',
219
+            //             },
220
+            //             {
221
+            //                 title: "智慧教室22",
222
+            //                 poster: 'rb2',
223
+            //                 src: '',
224
+            //             }
225
+            //         ]
226
+            //     }
227
+            // }
228
+
229
+        ]
230
+        )
231
+        const linedomRef = ref(null)
232
+        let lineContainer = ref(null)
233
+        const popoverRef = ref(null)
234
+        const lineStyleOption = ref({
235
+            // color: '#2AC367', // 指引线颜色
236
+            // startPlug: 'disc',
237
+            // endPlug: 'disc', // 指引线结束点的样式 hand,disc
238
+            // size: 2, // 线条尺寸
239
+            // startSocket: 'bottom', //在指引线开始的地方从元素左侧开始
240
+            // endSocket: 'top', //在指引线开始的地方从元素右侧结束
241
+            // // hide: true, // 绘制时隐藏,默认为false,在初始化时可能会出现闪烁的线条
242
+            // // startPlugColor: '#2AC367', // 渐变色开始色
243
+            // // endPlugColor: '#fff386', // 渐变色结束色
244
+            // // gradient: false, // 使用渐变色
245
+            // outLineColor: 'blue',
246
+            // path: 'magnet', // straight,arc,fluid,magnet,grid
247
+            // dash: {
248
+            //     // 虚线样式
249
+            //     animation: true // 让线条滚动起来
250
+            // },
251
+            // hide: true
252
+            startPlug: 'disc',
253
+            endPlug: 'disc',
254
+            startPlugColor: 'rgb(248, 205, 30)',
255
+            startPlugOutlineColor: 'rgb(30, 130, 250)',
256
+            endPlugColor: '#ff0000', // translucent
257
+            endPlugOutlineColor: '#2AC367',
258
+            size: 2,
259
+            startPlugSize: 1.5,
260
+            startPlugOutlineSize: 1,
261
+            endPlugSize: 3,
262
+            endPlugOutlineSize: 3
263
+        })
264
+        onMounted(() => {
265
+
266
+
267
+            // 监听一下页面点击情况
268
+            addResponseEventListener("open", (data) => {
269
+                if (data) {
270
+                    let json = eval("(" + data + ")");//转对象
271
+                    clickData.value = json;
272
+                    // console.log("clickData---点击的数据", clickData.value)
273
+                    // console.log("看一下", linedomRef.value.style.top, json, "json")
274
+                    visible.value = true
275
+                    linedomRef.value.style.top = json.x + "px";
276
+                    linedomRef.value.style.left = json.y + "px";
277
+
278
+                    let popoverRef2 = document.getElementById("popoverRef")
279
+                    // setTimeout(() => {
280
+                    //     console.log("popoverRef", popoverRef, "popoverRef.value", popoverRef.value);
281
+                    // }, 2000);
282
+                    // setTimeout(() => {
283
+                    console.log("linedomRef.value", linedomRef.value, "popoverRef.value", popoverRef.value);
284
+                    lineContainer.value = new LeaderLine(linedomRef.value, popoverRef.value)
285
+                    lineContainer.value.show('draw', {
286
+                        duration: 1000, //持续时长
287
+                        timing: 'ease-in' // 动画函数
288
+                    })
289
+                    lineContainer.value.endPlugOutline = true;
290
+                    lineContainer.value.position()
291
+                    console.log("隔几秒在连接", 1312312)
292
+                    // }, 3000);
293
+
294
+                }
295
+            })
296
+
297
+            // addResponseEventListener("End", data => {
298
+            //     console.log("移动结束", 123123, data)
299
+            // })
300
+
301
+        })
302
+
303
+
304
+
305
+
306
+
307
+
308
+
309
+
310
+        return {
311
+            centerDialogVisible,
312
+            interDevice,
313
+            clickData,
314
+            visible,
315
+            triggerRef,
316
+            videoData,
317
+            onPlay,
318
+            videoDialog,
319
+            lookVideo,
320
+            ...toRefs(carouselData),
321
+            carouselData,
322
+            linedomRef,
323
+            popoverRef,
324
+            lineContainer
325
+        }
326
+    },
327
+})
328
+
329
+</script>
330
+
331
+<style scoped lang="scss">
332
+@import '../assets/css/home.scss';
333
+</style>

+ 112 - 64
src/components/left.vue

@@ -56,7 +56,7 @@
56 56
                             <li>{{ item.people }}</li>
57 57
                             <li>{{ item.percentage }}</li>
58 58
                             <li>
59
-                                <el-button size="small" class="look" @click.prevent="handleRoom">查看</el-button>
59
+                                <el-button size="small" class="look" @click.prevent="handleRoom(item)">查看</el-button>
60 60
                             </li>
61 61
 
62 62
                         </ul>
@@ -66,28 +66,36 @@
66 66
                 </div>
67 67
             </div>
68 68
         </div>
69
-
69
+        <el-popover ref="popoverRef" v-model:visible="popoverVisible" placement="bottom" :width="400"
70
+            :virtual-ref="triggerRef" trigger="click" virtual-triggering popper-class="classpopover">
71
+            <div class="model-detail">
72
+                <span><span class="title">教室状态: </span>{{ classInfo && classInfo.status }} </span>
73
+                <span><span class="title">班级: </span>{{ classInfo && classInfo.className }}</span>
74
+                <span><span class="title">课程名称: </span>{{ classInfo && classInfo.courseName }}</span>
75
+                <span><span class="title">应到人数: </span>{{ classInfo && classInfo.expected }}</span>
76
+                <span><span class="title">教室: </span>{{ classInfo && classInfo.class }}</span>
77
+                <span><span class="title">实到人数: </span>{{ classInfo && classInfo.actual }}</span>
78
+                <span><span class="title">老师: </span>{{ classInfo && classInfo.teacher }}</span>
79
+            </div>
80
+        </el-popover>
70 81
     </el-aside>
71 82
 </template>
72 83
 
73 84
 <script >
74 85
 import * as echarts from "echarts";
75
-import { reactive, onMounted, ref, toRefs, onBeforeUnmount, onUnmounted, nextTick, getCurrentInstance } from 'vue';
76
-import { ElScrollbar, ElPagination, ElDialog, ElCarousel, ElCarouselItem, ElMessage } from "element-plus";
77
-import "vue3-video-play/dist/style.css";
78
-import {
79
-    callUIInteraction,
80
-    addResponseEventListener
81
-} from "../webrtcVideo.js";
86
+import { reactive, onMounted, ref, onBeforeUnmount, onUnmounted, nextTick, getCurrentInstance } from 'vue';
87
+import { ElScrollbar, ElPagination, ElDialog, ElCarousel, ElCarouselItem } from "element-plus";
82 88
 import { getClass } from '../request/api'
83
-import { videoPlay } from "vue3-video-play";
84 89
 import CircleProgress from './CircleProgress.vue';
85
-
90
+// import {
91
+//     callUIInteraction,
92
+//     addResponseEventListener
93
+// } from "../webRtcPlayer";
86 94
 
87 95
 export default ({
88 96
 
89 97
     name: 'Histogram',
90
-    components: { ElScrollbar, ElPagination, ElDialog, videoPlay, ElCarousel, ElCarouselItem, CircleProgress },
98
+    components: { ElScrollbar, ElPagination, ElDialog, ElCarousel, ElCarouselItem, CircleProgress },
91 99
     setup() {
92 100
 
93 101
         const pieData = reactive([{
@@ -155,61 +163,82 @@ export default ({
155 163
         }
156 164
 
157 165
 
158
-
159
-
160
-
161 166
         // 物联设备类型统计
162 167
         const interDevice = ref([
163
-            {
164
-                number: 98,
165
-                color: "#63ABFF",
166
-                icon: 'r1',
167
-                text: "显示系统"
168
-            },
169
-            {
170
-                number: 185,
171
-                color: "#63FFC7",
172
-                icon: 'r2',
173
-                text: "控制设备"
174
-            },
175
-            {
176
-                number: 58,
177
-                color: "#918EFF",
178
-                icon: 'r3',
179
-                text: "音频设备"
180
-            },
181
-            {
182
-                number: 68,
183
-                color: "#00C8E3",
184
-                icon: 'r4',
185
-                text: "录播设备"
186
-            },
187
-            {
188
-                number: 189,
189
-                color: "#FFBB54",
190
-                icon: 'r5',
191
-                text: "环境设备"
192
-            },
193
-            {
194
-                number: 98,
195
-                color: "#00CF78",
196
-                icon: 'r6',
197
-                text: "安全管理"
198
-            },
199
-
168
+            // {
169
+            //     number: 98,
170
+            //     color: "#63ABFF",
171
+            //     icon: 'r1',
172
+            //     text: "显示系统"
173
+            // },
174
+            // {
175
+            //     number: 185,
176
+            //     color: "#63FFC7",
177
+            //     icon: 'r2',
178
+            //     text: "控制设备"
179
+            // },
180
+            // {
181
+            //     number: 58,
182
+            //     color: "#918EFF",
183
+            //     icon: 'r3',
184
+            //     text: "音频设备"
185
+            // },
186
+            // {
187
+            //     number: 68,
188
+            //     color: "#00C8E3",
189
+            //     icon: 'r4',
190
+            //     text: "录播设备"
191
+            // },
192
+            // {
193
+            //     number: 189,
194
+            //     color: "#FFBB54",
195
+            //     icon: 'r5',
196
+            //     text: "环境设备"
197
+            // },
198
+            // {
199
+            //     number: 98,
200
+            //     color: "#00CF78",
201
+            //     icon: 'r6',
202
+            //     text: "安全管理"
203
+            // },   
200 204
         ])
201 205
 
202
-        const handleRoom = function () {
203
-            // 发送消息给UE
204
-            // console.log("查看当前教室使用情况", 'adsfasdfasdfa', ElMessage)
205
-            // ElMessage('this is a message.')
206
-
207
-            // ElMessage.success("xsxxx")
208
-            // callUIInteraction("open");
209
-            // addResponseEventListener("open", (data) => {
210
-            //     console.log("接收到的信息", data, typeof data,)
211
-            // })
212
-            // centerDialogVisible.value = true
206
+        const popoverVisible = ref(false)
207
+        const popoverRef = ref(null)
208
+        const triggerRef = ref({
209
+            getBoundingClientRect() {
210
+                // console.log("positon----方法返回元素的大小及其相对于视口的位置", position.value)
211
+                return position.value
212
+            },
213
+        })
214
+        // 点击某个模型跟随移动
215
+        const mousemoveHandler = (x, y) => {
216
+            position.value = DOMRect.fromRect({
217
+                width: 0,
218
+                height: 0,
219
+                x: x,
220
+                y: y,
221
+            })
222
+        }
223
+        const position = ref({
224
+            top: 0,
225
+            left: 0,
226
+            bottom: 0,
227
+            right: 0,
228
+        })
229
+        let classInfo = ref({})
230
+        const handleRoom = function (item) {
231
+
232
+            popoverVisible.value = true;
233
+            classInfo.value = item;
234
+            mousemoveHandler(1000, 60)
235
+            console.log("item", item, item.lat);
236
+
237
+            // callUIInteraction({
238
+            //     "x": item.lat,
239
+            //     "y": item.lot,
240
+            //     "level": item.leaf
241
+            // });
213 242
         }
214 243
 
215 244
 
@@ -308,6 +337,7 @@ export default ({
308 337
             }
309 338
         }
310 339
         return {
340
+            popoverVisible,
311 341
             classCount,
312 342
             classRoom,
313 343
             interDevice,
@@ -315,7 +345,10 @@ export default ({
315 345
             testMend,
316 346
             testMove,
317 347
             testMain,
318
-            classRoomCount
348
+            popoverRef,
349
+            classRoomCount,
350
+            triggerRef,
351
+            classInfo
319 352
         }
320 353
     },
321 354
 })
@@ -324,4 +357,19 @@ export default ({
324 357
 
325 358
 <style scoped lang="scss">
326 359
 @import '../assets/css/left.scss';
360
+</style>
361
+<style>
362
+.classpopover {
363
+    .el-popper__arrow {
364
+        top: 216px !important;
365
+    }
366
+
367
+    .el-popper[data-popper-placement^=bottom],
368
+    .el-popper__arrow::before {
369
+        border-left-color: transparent !important;
370
+        border-top-color: transparent !important;
371
+    }
372
+}
373
+
374
+/* el-popper__arrow {} */
327 375
 </style>

+ 196 - 0
src/components/line.vue

@@ -0,0 +1,196 @@
1
+<template>
2
+    <div class="line-block">
3
+        <span style="font-size: '40px';color: saddlebrown;">1111dsdfg</span>
4
+        <div class="one">
5
+            <div class="block-one" id="block-one">1</div>
6
+            <div class="block-two" id="block-two">2</div>
7
+        </div>
8
+        <div class="two">
9
+            <div class="block-three" id="block-three">3</div>
10
+            <div class="block-four" id="block-four">4</div>
11
+        </div>
12
+        <div id="start" class="target">start</div>
13
+        <div id="end" class="target">end</div>
14
+    </div>
15
+</template>
16
+
17
+<script>
18
+import LeaderLine from "../assets/js/leaderline"
19
+// var LeaderLine = require("../assets/js/leaderline")
20
+import { onMounted, ref } from 'vue'
21
+export default {
22
+    setup() {
23
+        onMounted(() => {
24
+            console.log("看一下", LeaderLine)
25
+            getLine()
26
+            let startEle = document.getElementById('start');
27
+            let endEle = document.getElementById('end');
28
+            let leader_line = new LeaderLine(
29
+                startEle,
30
+                endEle,
31
+                {
32
+                    dash: true,
33
+                }
34
+            );
35
+        })
36
+
37
+
38
+
39
+
40
+
41
+
42
+
43
+        let lineContainer = ref(null)
44
+        let lineContainer2 = ref(null)
45
+        let lineContainer3 = ref(null)
46
+        let lineContainer4 = ref(null)
47
+        const getLine = () => {
48
+            let dom1 = document.getElementById('block-one')
49
+            let dom2 = document.getElementById('block-two')
50
+            let dom3 = document.getElementById('block-three')
51
+            let dom4 = document.getElementById('block-four')
52
+            let styleOption = {
53
+                // color: '#2AC367', // 指引线颜色
54
+                // startPlug: 'disc',
55
+                // endPlug: 'disc', // 指引线结束点的样式 hand,disc
56
+                // size: 2, // 线条尺寸
57
+                // startSocket: 'bottom', //在指引线开始的地方从元素左侧开始
58
+                // endSocket: 'top', //在指引线开始的地方从元素右侧结束
59
+                // // hide: true, // 绘制时隐藏,默认为false,在初始化时可能会出现闪烁的线条
60
+                // // startPlugColor: '#2AC367', // 渐变色开始色
61
+                // // endPlugColor: '#fff386', // 渐变色结束色
62
+                // // gradient: false, // 使用渐变色
63
+                // outLineColor: 'blue',
64
+                // path: 'magnet', // straight,arc,fluid,magnet,grid
65
+                // dash: {
66
+                //     // 虚线样式
67
+                //     animation: true // 让线条滚动起来
68
+                // },
69
+                // hide: true
70
+                startPlug: 'disc',
71
+                endPlug: 'disc',
72
+                startPlugColor: 'rgb(248, 205, 30)',
73
+                startPlugOutlineColor: 'rgb(30, 130, 250)',
74
+                endPlugColor: '#ff0000', // translucent
75
+                endPlugOutlineColor: 'green',
76
+                size: 2,
77
+                startPlugSize: 1.5,
78
+                startPlugOutlineSize: 1,
79
+                endPlugSize: 3,
80
+                endPlugOutlineSize: 3
81
+            }
82
+            // lineContainer.value = new LeaderLine(
83
+            //     LeaderLine.mouseHoverAnchor(dom1),
84
+            //     dom3,
85
+            //     styleOption
86
+            // )
87
+            // lineContainer2.value = new LeaderLine(
88
+            //     LeaderLine.mouseHoverAnchor(dom1),
89
+            //     dom4,
90
+            //     styleOption
91
+            // )
92
+            lineContainer3.value = new LeaderLine(dom2, dom4, styleOption)
93
+
94
+            // lineContainer4.value = new LeaderLine(dom2, dom3, styleOption)
95
+            /** 显示效果
96
+             *  draw 绘制线条
97
+             *  fade 淡入
98
+             *  none 无效果,即直接显示
99
+             */
100
+            let showEffectName = 'draw'
101
+            // 动画参数
102
+            let animOptions = {
103
+                duration: 1000, //持续时长
104
+                timing: 'ease-in' // 动画函数
105
+            }
106
+            console.log("lineContainer", lineContainer)
107
+            // lineContainer.value.show(showEffectName, animOptions)
108
+            // lineContainer2.value.show(showEffectName, animOptions)
109
+            lineContainer3.value.show(showEffectName, animOptions)
110
+            lineContainer3.value.endPlugOutline = true;
111
+            // lineContainer4.value.show(showEffectName, animOptions)
112
+            // lineContainer.value.position()
113
+            // lineContainer2.value.position()
114
+            lineContainer3.value.position()
115
+            console.log("lineContainer3", lineContainer3.value);
116
+            // lineContainer4.value.position()
117
+        }
118
+
119
+        return {
120
+            lineContainer,
121
+            lineContainer2,
122
+            lineContainer3,
123
+            lineContainer4,
124
+            // leader_line
125
+        }
126
+    }
127
+}
128
+</script>
129
+
130
+<style lang="scss" scoped>
131
+.line-block {
132
+
133
+    border: 1px solid red;
134
+
135
+    position: absolute;
136
+    width: 412px;
137
+    height: 90vh;
138
+    top: 111px;
139
+    z-index: 300;
140
+
141
+    .one {
142
+        display: flex;
143
+        justify-content: space-around;
144
+        // height: 100px;
145
+    }
146
+
147
+    .two {
148
+        margin-top: 100px;
149
+        display: flex;
150
+        justify-content: space-around;
151
+    }
152
+
153
+    .iframe-block {
154
+        margin-top: 50px;
155
+    }
156
+
157
+    .target {
158
+        display: inline-block;
159
+        background-color: #9ee7ea;
160
+        padding: 12px;
161
+    }
162
+
163
+    .block-one {
164
+        border: 1px solid blue;
165
+        padding: 10px;
166
+    }
167
+
168
+    .block-two {
169
+        border: 1px solid blue;
170
+        padding: 10px;
171
+    }
172
+
173
+    .block-three {
174
+        border: 1px solid blue;
175
+        padding: 10px;
176
+    }
177
+
178
+    .block-four {
179
+        border: 1px solid blue;
180
+        padding: 10px;
181
+    }
182
+}
183
+
184
+.target {
185
+    display: inline-block;
186
+    background-color: #9ee7ea;
187
+    padding: 12px;
188
+}
189
+
190
+#start {}
191
+
192
+#end {
193
+    float: right;
194
+    margin-top: 200px;
195
+}
196
+</style>

+ 4 - 1
src/request/api.js

@@ -5,4 +5,7 @@ export const testApi = p => post(`https://test.lqkj.top/wsngt-server/system/sysu
5 5
 
6 6
 export const getClass = () => get("http://192.168.4.219:12397/ioc-server/wisdomClass/classroomStatistic")
7 7
 
8
-export const getDevice = () => get("http://192.168.4.219:12397/ioc-server/wisdomClass/deviceStatistic")
8
+export const getDevice = () => get("http://192.168.4.219:12397/ioc-server/wisdomClass/deviceStatistic")
9
+
10
+
11
+export const getClassDetail = (deviceCode) => get(`http://192.168.4.219:12397/ioc-server/wisdomClass/deviceDetail/${deviceCode}`)

+ 1 - 1
src/request/http.js

@@ -22,7 +22,7 @@ axios.interceptors.request.use(
22 22
 
23 23
 axios.interceptors.response.use(
24 24
     response => {
25
-        console.log("response", response)
25
+        // console.log("response", response)
26 26
         if (response.status === 200) {
27 27
             return Promise.resolve(response.data)
28 28
         } else {

+ 1 - 1
src/webRtcPlayer.js

@@ -132,7 +132,7 @@ function webRtcPlayer(parOptions) {
132 132
         video.style.top = 0;
133 133
         video.style.left = 0;
134 134
         video.style.position = "relative";
135
-        video.style.zIndex = 100;
135
+        // video.style.zIndex = 0;
136 136
         video.style.cursor = "pointer";
137 137
         // video.style.overflow="hidden";
138 138
 

+ 14 - 11
src/webrtcVideo.js

@@ -25,7 +25,7 @@ const WS_OPEN_STATE = 1;
25 25
 
26 26
 let qualityController = false;
27 27
 let qualityControlOwnershipCheckBox;
28
-let matchViewportResolution;
28
+let matchViewportResolution = true;
29 29
 // TODO: Remove this - workaround because of bug causing UE to crash when switching resolutions too quickly
30 30
 let lastTimeResized = new Date().getTime();
31 31
 let resizeTimeout;
@@ -1267,7 +1267,7 @@ function resizePlayerStyle(event) {
1267 1267
 
1268 1268
     if (!playerElement)
1269 1269
         return;
1270
-
1270
+    console.log("resizePlayerStyle");
1271 1271
     updateVideoStreamSize();
1272 1272
 
1273 1273
     if (playerElement.classList.contains('fixed-size')) {
@@ -1300,9 +1300,11 @@ function setupMouseAndFreezeFrame(playerElement) {
1300 1300
 }
1301 1301
 
1302 1302
 function updateVideoStreamSize() {
1303
-    if (!matchViewportResolution) {
1304
-        return;
1305
-    }
1303
+    console.log(matchViewportResolution, !matchViewportResolution);
1304
+    // if (!matchViewportResolution) {
1305
+    //     return;
1306
+    // }
1307
+    console.log("看一下走到这里美哟u");
1306 1308
 
1307 1309
     let now = new Date().getTime();
1308 1310
     if (now - lastTimeResized > 1000) {
@@ -1311,7 +1313,8 @@ function updateVideoStreamSize() {
1311 1313
             return;
1312 1314
 
1313 1315
         let descriptor = {
1314
-            ConsoleCommand: 'setres ' + playerElement.clientWidth + 'x' + playerElement.clientHeight
1316
+            // ConsoleCommand: 'setres ' + playerElement.clientWidth + 'x' + playerElement.clientHeight
1317
+            ConsoleCommand: 'setres ' + playerElement.clientWidth + 'x' + 1080
1315 1318
         };
1316 1319
         emitCommand(descriptor);
1317 1320
         console.log(descriptor);
@@ -2055,16 +2058,15 @@ function onExpandOverlay_Click( /* e */) {
2055 2058
 
2056 2059
 function showConnectOverlay() {
2057 2060
 
2058
-    let aa = null;
2059
-    aa = function () {
2060
-        return 4;
2061
-    }
2062
-    let b = aa();
2063 2061
 
2064 2062
     const startText = document.createElement('div');
2065 2063
     startText.id = 'playButton';
2066 2064
     startText.innerHTML = '点击连接';
2067 2065
     startText.style.zIndex = "999"
2066
+    startText.style.position = "absolute"
2067
+    startText.style.top = "50%"
2068
+    startText.style.left = "50%"
2069
+
2068 2070
     // fix remove html to clear click listener
2069 2071
     const videoPlayOverlay = document.getElementById('videoPlayOverlay');
2070 2072
     if (videoPlayOverlay) {
@@ -2090,6 +2092,7 @@ function start() {
2090 2092
         } else {
2091 2093
             connect();
2092 2094
         }
2095
+        console.log("start", 234242342);
2093 2096
         resizePlayerStyle();
2094 2097
     } else {
2095 2098
         connect();

+ 14 - 16
vite.config.js

@@ -5,20 +5,6 @@ import Components from 'unplugin-vue-components/vite'
5 5
 import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
6 6
 import postCssPxToRem from "postcss-pxtorem";
7 7
 
8
-// https://vitejs.dev/config/
9
-// export default defineConfig({
10
-//   plugins: [
11
-//     vue(),
12
-
13
-//     Components({
14
-//       resolvers: [ElementPlusResolver()]
15
-//     }),
16
-//     AutoImport({
17
-//       resolvers: [ElementPlusResolver()]
18
-//     })
19
-//   ]
20
-
21
-// })
22 8
 export default defineConfig({
23 9
   plugins: [
24 10
     vue(),
@@ -27,7 +13,7 @@ export default defineConfig({
27 13
     }),
28 14
     AutoImport({
29 15
       resolvers: [ElementPlusResolver()]
30
-    })
16
+    }),
31 17
   ],
32 18
   css: {
33 19
     postcss:
@@ -40,5 +26,17 @@ export default defineConfig({
40 26
           // 需要转换的属性,这里选择全部都进行转换
41 27
         })]
42 28
     }
43
-  }
29
+  },
30
+  configureWebpack: (config) => {
31
+    console.log("config");
32
+    config.module.rules.push(
33
+      {
34
+        test: path.resolve(__dirname, 'node_modules/leader-line/'),
35
+        use: [{
36
+          loader: 'skeleton-loader',
37
+          options: { procedure: content => `${content}export default LeaderLine` }
38
+        }]
39
+      }
40
+    )
41
+  },
44 42
 })