|
@@ -6,33 +6,24 @@
|
6
|
6
|
<el-container>
|
7
|
7
|
<left></left>
|
8
|
8
|
<right></right>
|
9
|
|
- <div ref="linedomRef" style="width: 2px;height:2px;background-color: green;position: absolute;z-index: 228;">
|
|
9
|
+ <div ref="linedomRef" style="width:10px;height:1px;position: absolute;z-index: 228;">
|
10
|
10
|
</div>
|
11
|
11
|
|
12
|
12
|
</el-container>
|
13
|
13
|
|
14
|
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">
|
|
15
|
+
|
|
16
|
+ <div ref="popoverRef" id="popoverRef" class="modelInfo">
|
|
17
|
+ <div class="model-detail">
|
18
|
18
|
<span v-for="item in classDeviceInfo">
|
19
|
19
|
<span class="title">{{ item && item.name }}: </span>
|
20
|
20
|
{{ item && item.value }}
|
21
|
21
|
{{ classDeviceInfo.value &&
|
22
|
22
|
classDeviceInfo.value.status }}
|
23
|
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> -->
|
34
|
24
|
</div>
|
35
|
|
- </el-popover>
|
|
25
|
+ </div>
|
|
26
|
+
|
36
|
27
|
|
37
|
28
|
<!-- 视频播放弹框 -->
|
38
|
29
|
<el-dialog class="videoDialog" v-model="videoDialog" title="互动教师1" width="60%" align="center" top="4%">
|
|
@@ -129,7 +120,6 @@ export default ({
|
129
|
120
|
let centerDialogVisible = ref(false)
|
130
|
121
|
// 获取点击点数据
|
131
|
122
|
let clickData = reactive({})
|
132
|
|
- const visible = ref(false)
|
133
|
123
|
const triggerRef = ref({
|
134
|
124
|
getBoundingClientRect() {
|
135
|
125
|
// console.log("positon----方法返回元素的大小及其相对于视口的位置", position.value)
|
|
@@ -180,15 +170,18 @@ export default ({
|
180
|
170
|
endPlugOutlineColor: '#2AC367',
|
181
|
171
|
size: 3,
|
182
|
172
|
startPlugSize: 1.5,
|
183
|
|
- startPlugOutlineSize: 1,
|
184
|
|
- endPlugSize: 3,
|
185
|
|
- endPlugOutlineSize: 3
|
|
173
|
+ startPlugOutlineSize: 2,
|
|
174
|
+ endPlugSize: 1.5,
|
|
175
|
+ endPlugOutlineSize: 2
|
186
|
176
|
})
|
187
|
177
|
const classDeviceInfo = ref([])
|
|
178
|
+ const classDataLoaded = ref(false)
|
188
|
179
|
const classDevice = async function (deviceCode) {
|
189
|
180
|
let res = await getClassDetail(deviceCode)
|
190
|
|
- // console.log("获取到了当前点击物体得详情", res)
|
191
|
|
- classDeviceInfo.value = res.data
|
|
181
|
+ console.log("获取到了当前点击物体得详情", res)
|
|
182
|
+ classDeviceInfo.value = res.data;
|
|
183
|
+ classDataLoaded.value = true
|
|
184
|
+
|
192
|
185
|
}
|
193
|
186
|
const clickData1 = ref({})
|
194
|
187
|
const mouseClick = function (e) {
|
|
@@ -197,75 +190,204 @@ export default ({
|
197
|
190
|
clickData1.value.y = e.clientY;
|
198
|
191
|
|
199
|
192
|
}
|
200
|
|
- onMounted(() => {
|
201
|
|
- // window.addEventListener('mousedown', mouseClick);
|
202
|
|
-
|
203
|
|
- // 监听一下页面点击情况
|
204
|
|
- addResponseEventListener("open", (data) => {
|
205
|
|
- if (data) {
|
206
|
|
- let json = eval("(" + data + ")");//转对象
|
207
|
|
- clickData.value = json;
|
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
|
|
- }
|
|
193
|
+ const handleResponseFunction = (data) => {
|
|
194
|
+ // console.log("从UE返回过来的值", data)
|
|
195
|
+ let json = eval("(" + data + ")");//转对象
|
|
196
|
+ clickData.value = json;
|
|
197
|
+ console.log("clickData---点击的数据", json)
|
|
198
|
+ if (json.deviceCode) {
|
|
199
|
+ getClassDetail(json.deviceCode).then(res => {
|
|
200
|
+ classDeviceInfo.value = res.data;
|
|
201
|
+ console.log("json.y ", json,);
|
|
202
|
+ linedomRef.value.style.top = clickData.value.y + "px";
|
|
203
|
+ linedomRef.value.style.left = clickData.value.x + "px";
|
|
204
|
+ console.log("可以开始移动")
|
218
|
205
|
console.log("看一下---小圆点的值--top", linedomRef.value.style.top)
|
219
|
206
|
console.log("看一下---小圆点的值--left", linedomRef.value.style.left)
|
220
|
|
- // alert(json.x, json.y)
|
|
207
|
+
|
|
208
|
+ // // 弹出框位置
|
|
209
|
+ popoverRef.value.style.display = "block"
|
221
|
210
|
switch (json.direction) {
|
222
|
211
|
case "Left":
|
223
|
|
- mousemoveHandler(json.x - 380, dot.y)
|
|
212
|
+ popoverRef.value.style.top = json.y - 30 + 'px'
|
|
213
|
+ popoverRef.value.style.left = json.x - 320 + 'px'
|
224
|
214
|
break;
|
225
|
215
|
case "Up":
|
226
|
|
- console.log("在最上面", json.x, json.x - 100);
|
227
|
|
- mousemoveHandler(dot.x - 80, dot.y - 200);
|
|
216
|
+ popoverRef.value.style.top = (json.y - 300) + 'px'
|
|
217
|
+ popoverRef.value.style.left = (json.x - 120) + 'px'
|
228
|
218
|
break;
|
229
|
219
|
case "Right":
|
230
|
|
- console.log("没有走到这里来吗", 12312);
|
231
|
|
- mousemoveHandler(Number(json.x) + 30, Number(json.y) - 80)
|
|
220
|
+ popoverRef.value.style.top = (Number(json.y)) + 'px'
|
|
221
|
+ popoverRef.value.style.left = Number(json.x) + 100 + 'px'
|
|
222
|
+
|
232
|
223
|
break;
|
233
|
224
|
case "Down":
|
234
|
|
- // console.log("xxxx没有走到这里来吗--down", json.y,);
|
235
|
|
- mousemoveHandler(Number(json.y), Number(json.x) - 260);
|
|
225
|
+ popoverRef.value.style.top = (Number(json.y) + 100) + 'px'
|
|
226
|
+ popoverRef.value.style.left = Number(json.x) + 'px'
|
236
|
227
|
break;
|
237
|
228
|
default:
|
238
|
|
- mousemoveHandler(json.x, json.y);
|
|
229
|
+ popoverRef.value.style.top = json.y - 60 + 'px'
|
|
230
|
+ popoverRef.value.style.left = json.x + 'px'
|
|
231
|
+
|
239
|
232
|
break;
|
240
|
233
|
}
|
241
|
|
- // mousemoveHandler(Number(json.x) + 30, Number(json.y) - 80)
|
|
234
|
+
|
242
|
235
|
if (lineContainer.value) {
|
243
|
236
|
lineContainer.value.remove()
|
244
|
237
|
}
|
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);
|
255
|
238
|
|
|
239
|
+ lineContainer.value = new LeaderLine(linedomRef.value, popoverRef.value, lineStyleOption.value)
|
|
240
|
+ lineContainer.value.show('draw', {
|
|
241
|
+ duration: 1000, //持续时长
|
|
242
|
+ timing: 'ease-in' // 动画函数
|
|
243
|
+ })
|
|
244
|
+ lineContainer.value.endPlugOutline = true;
|
|
245
|
+ lineContainer.value.startPlugOutline = true;
|
|
246
|
+ lineContainer.value.position();
|
256
|
247
|
|
257
|
248
|
|
258
|
|
- }
|
259
|
|
- })
|
|
249
|
+ })
|
260
|
250
|
|
261
|
|
- addResponseEventListener("End", data => {
|
262
|
|
- let json = eval("(" + data + ")");
|
263
|
|
- clickData.value = json;
|
264
|
|
- classDevice()
|
265
|
|
- // // classDevice()
|
266
|
|
- // console.log("移动结束", 123123, data)
|
|
251
|
+ }
|
267
|
252
|
|
268
|
|
- })
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+ // linedomRef.value.style.top = json.y + "px";
|
|
256
|
+ // linedomRef.value.style.left = json.x + "px";
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+ // console.log("看一下---小圆点的值--top", linedomRef.value.style.top)
|
|
260
|
+ // console.log("看一下---小圆点的值--left", linedomRef.value.style.left)
|
|
261
|
+
|
|
262
|
+ // // 弹出框位置
|
|
263
|
+
|
|
264
|
+ // popoverRef.value.style.display = "block"
|
|
265
|
+ // switch (json.direction) {
|
|
266
|
+ // case "Left":
|
|
267
|
+ // popoverRef.value.style.top = json.y - 30 + 'px'
|
|
268
|
+ // popoverRef.value.style.left = json.x - 320 + 'px'
|
|
269
|
+ // break;
|
|
270
|
+ // case "Up":
|
|
271
|
+ // popoverRef.value.style.top = (json.y - 350) + 'px'
|
|
272
|
+ // popoverRef.value.style.left = (json.x - 120) + 'px'
|
|
273
|
+ // break;
|
|
274
|
+ // case "Right":
|
|
275
|
+ // popoverRef.value.style.top = (Number(json.y)) + 'px'
|
|
276
|
+ // popoverRef.value.style.left = Number(json.x) + 100 + 'px'
|
|
277
|
+
|
|
278
|
+ // break;
|
|
279
|
+ // case "Down":
|
|
280
|
+ // popoverRef.value.style.top = (Number(json.y) + 100) + 'px'
|
|
281
|
+ // popoverRef.value.style.left = Number(json.x) + 'px'
|
|
282
|
+ // break;
|
|
283
|
+ // default:
|
|
284
|
+ // popoverRef.value.style.top = json.y - 60 + 'px'
|
|
285
|
+ // popoverRef.value.style.left = json.x + 'px'
|
|
286
|
+
|
|
287
|
+ // break;
|
|
288
|
+ // }
|
|
289
|
+ // if (lineContainer.value) {
|
|
290
|
+ // lineContainer.value.remove()
|
|
291
|
+ // }
|
|
292
|
+ // setTimeout(() => {
|
|
293
|
+ // lineContainer.value = new LeaderLine(linedomRef.value, popoverRef.value, lineStyleOption.value)
|
|
294
|
+ // lineContainer.value.show('draw', {
|
|
295
|
+ // duration: 1000, //持续时长
|
|
296
|
+ // timing: 'ease-in' // 动画函数
|
|
297
|
+ // })
|
|
298
|
+ // lineContainer.value.endPlugOutline = true;
|
|
299
|
+ // lineContainer.value.startPlugOutline = true;
|
|
300
|
+ // lineContainer.value.position();
|
|
301
|
+ // }, 3000);
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+ }
|
|
305
|
+ onMounted(() => {
|
|
306
|
+ // window.addEventListener('mousedown', mouseClick);
|
|
307
|
+
|
|
308
|
+ // 监听一下页面点击情况
|
|
309
|
+ // addResponseEventListener("open", (data) => {
|
|
310
|
+ // if (data) {
|
|
311
|
+ // let json = eval("(" + data + ")");//转对象
|
|
312
|
+ // clickData.value = json;
|
|
313
|
+ // console.log("clickData---点击的数据", json)
|
|
314
|
+ // // console.log("看一下", linedomRef.value.style.top, json, "json")
|
|
315
|
+ // visible.value = true
|
|
316
|
+ // linedomRef.value.style.top = json.y + "px";
|
|
317
|
+ // linedomRef.value.style.left = json.x + "px";
|
|
318
|
+
|
|
319
|
+ // // let dot = {
|
|
320
|
+ // // x: json.x,
|
|
321
|
+ // // y: json.y - 80
|
|
322
|
+ // // }
|
|
323
|
+ // console.log("看一下---小圆点的值--top", linedomRef.value.style.top)
|
|
324
|
+ // console.log("看一下---小圆点的值--left", linedomRef.value.style.left)
|
|
325
|
+
|
|
326
|
+ // // 弹出框位置
|
|
327
|
+ // // popoverRef.value.style.display = "block"
|
|
328
|
+ // // popoverRef.value.style.top = json.y - 60 + 'px'
|
|
329
|
+ // // popoverRef.value.style.left = json.x + 'px'
|
|
330
|
+ // popoverRef.value.style.display = "block"
|
|
331
|
+ // // alert(json.x, json.y)
|
|
332
|
+ // switch (json.direction) {
|
|
333
|
+ // case "Left":
|
|
334
|
+ // // mousemoveHandler(json.x - 380, dot.y)
|
|
335
|
+ // popoverRef.value.style.top = json.y - 60 + 'px'
|
|
336
|
+ // popoverRef.value.style.left = json.x - 380 + 'px'
|
|
337
|
+
|
|
338
|
+ // break;
|
|
339
|
+ // case "Up":
|
|
340
|
+ // // console.log("在最上面", json.x, json.x - 100);
|
|
341
|
+ // // mousemoveHandler(dot.x - 80, dot.y - 200);
|
|
342
|
+ // popoverRef.value.style.top = (json.y - 350) + 'px'
|
|
343
|
+ // popoverRef.value.style.left = (json.x - 120) + 'px'
|
|
344
|
+
|
|
345
|
+ // break;
|
|
346
|
+ // case "Right":
|
|
347
|
+ // console.log("没有走到这里来吗", 12312);
|
|
348
|
+ // popoverRef.value.style.top = (Number(json.y)) + 'px'
|
|
349
|
+ // popoverRef.value.style.left = Number(json.x) + 100 + 'px'
|
|
350
|
+
|
|
351
|
+ // // mousemoveHandler(Number(json.x) + 30, Number(json.y) - 80)
|
|
352
|
+ // break;
|
|
353
|
+ // case "Down":
|
|
354
|
+ // popoverRef.value.style.top = (Number(json.y) + 100) + 'px'
|
|
355
|
+ // popoverRef.value.style.left = Number(json.x) + 'px'
|
|
356
|
+ // break;
|
|
357
|
+ // default:
|
|
358
|
+ // popoverRef.value.style.top = json.y - 60 + 'px'
|
|
359
|
+ // popoverRef.value.style.left = json.x + 'px'
|
|
360
|
+
|
|
361
|
+ // break;
|
|
362
|
+ // }
|
|
363
|
+ // if (lineContainer.value) {
|
|
364
|
+ // lineContainer.value.remove()
|
|
365
|
+ // }
|
|
366
|
+ // setTimeout(() => {
|
|
367
|
+ // lineContainer.value = new LeaderLine(linedomRef.value, popoverRef.value, lineStyleOption.value)
|
|
368
|
+ // lineContainer.value.show('draw', {
|
|
369
|
+ // duration: 1000, //持续时长
|
|
370
|
+ // timing: 'ease-in' // 动画函数
|
|
371
|
+ // })
|
|
372
|
+ // lineContainer.value.endPlugOutline = true;
|
|
373
|
+ // lineContainer.value.startPlugOutline = true;
|
|
374
|
+ // lineContainer.value.position();
|
|
375
|
+ // }, 0);
|
|
376
|
+
|
|
377
|
+
|
|
378
|
+
|
|
379
|
+ // }
|
|
380
|
+ // })
|
|
381
|
+
|
|
382
|
+ addResponseEventListener("End", handleResponseFunction)
|
|
383
|
+ // addResponseEventListener("End", (data) => {
|
|
384
|
+ // let json = eval("(" + data + ")");
|
|
385
|
+ // // clickData.value = json;
|
|
386
|
+ // // classDevice()
|
|
387
|
+ // // // classDevice()
|
|
388
|
+ // console.log("移动结束", 123123, data)
|
|
389
|
+
|
|
390
|
+ // })
|
269
|
391
|
|
270
|
392
|
})
|
271
|
393
|
|
|
@@ -273,7 +395,7 @@ export default ({
|
273
|
395
|
centerDialogVisible,
|
274
|
396
|
interDevice,
|
275
|
397
|
clickData,
|
276
|
|
- visible,
|
|
398
|
+
|
277
|
399
|
triggerRef,
|
278
|
400
|
videoData,
|
279
|
401
|
onPlay,
|