|
@@ -1,333 +0,0 @@
|
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>
|