inl-ui 0.1.37 → 0.1.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -45,7 +45,7 @@ var ___default = /*#__PURE__*/_interopDefaultLegacy(_);
45
45
  var dayjs__default = /*#__PURE__*/_interopDefaultLegacy(dayjs);
46
46
  var EZUIKit__default = /*#__PURE__*/_interopDefaultLegacy(EZUIKit);
47
47
 
48
- var version = "0.1.36";
48
+ var version = "0.1.38";
49
49
 
50
50
  const setTheme = theme => {
51
51
  if (theme === "dark") {
@@ -9775,14 +9775,6 @@ const VideoPlayerV2 = vue.defineComponent({
9775
9775
  }
9776
9776
  });
9777
9777
  };
9778
- const stopV = id => {
9779
- const videoElement = document.getElementById(id);
9780
- if (videoElement) {
9781
- videoElement.pause();
9782
- videoElement.removeAttribute("src");
9783
- videoElement.load();
9784
- }
9785
- };
9786
9778
  const releaseUrl = vue.ref("");
9787
9779
  const release = async () => {
9788
9780
  const res = await axios__default["default"].get(releaseUrl.value);
@@ -9832,7 +9824,6 @@ const VideoPlayerV2 = vue.defineComponent({
9832
9824
  };
9833
9825
  vue.watch([() => _prop.camera, () => _prop.cameraConfig], ([camera, cameraConfig]) => {
9834
9826
  stopPlay();
9835
- stopV(`videoPlayer_${uuid}`);
9836
9827
  getVideoDetail(camera);
9837
9828
  }, {
9838
9829
  immediate: true,
@@ -9840,27 +9831,27 @@ const VideoPlayerV2 = vue.defineComponent({
9840
9831
  });
9841
9832
  vue.onBeforeUnmount(() => {
9842
9833
  stopPlay();
9843
- const videoElement = document.getElementById(`videoPlayer_${uuid}`);
9844
- if (videoElement) {
9845
- videoElement.pause();
9846
- videoElement.src = null;
9847
- videoElement.srcObject = null;
9848
- videoElement.remove();
9849
- }
9850
9834
  });
9851
- return () => videoInfo2.value.brandTypeCode !== "MP4" ? vue.createVNode("video", {
9852
- "id": `videoPlayer_${uuid}`,
9853
- "class": `videoComponent ${_prop.fill}`,
9854
- "muted": true,
9855
- "autoplay": true
9856
- }, null) : vue.createVNode("video", {
9857
- "id": `videoPlayer_${uuid}`,
9858
- "class": "videoComponent fill",
9859
- "src": videoInfo2.value.mp4ResourcesPath,
9860
- "autoplay": true,
9861
- "loop": true,
9862
- "muted": true
9863
- }, null);
9835
+ const renderVideo = () => {
9836
+ if (videoInfo2.value.brandTypeCode === "MP4") {
9837
+ return vue.createVNode("video", {
9838
+ "id": `mp4Player_${uuid}`,
9839
+ "class": "videoComponent fill",
9840
+ "src": videoInfo2.value.mp4ResourcesPath,
9841
+ "autoplay": true,
9842
+ "loop": true,
9843
+ "muted": true
9844
+ }, null);
9845
+ } else {
9846
+ return vue.createVNode("video", {
9847
+ "id": `videoPlayer_${uuid}`,
9848
+ "class": `videoComponent ${_prop.fill}`,
9849
+ "muted": true,
9850
+ "autoplay": true
9851
+ }, null);
9852
+ }
9853
+ };
9854
+ return () => vue.createVNode(vue.Fragment, null, [renderVideo()]);
9864
9855
  }
9865
9856
  });
9866
9857
  var videoPlayerV2 = installComponent(VideoPlayerV2, "video-player-v2");
@@ -10165,7 +10156,7 @@ const props$6 = {
10165
10156
  // },
10166
10157
  btns: {
10167
10158
  type: Array,
10168
- default: ["fill", "look", "stream", "direction", "fullScreen", "close"]
10159
+ default: ["fill", "look", "stream", "magnify", "direction", "fullScreen", "close"]
10169
10160
  },
10170
10161
  alarm: {
10171
10162
  default: false,
@@ -10188,6 +10179,7 @@ const VideoBoxV2 = vue.defineComponent({
10188
10179
  const streamHistory = vue.ref("");
10189
10180
  const streams = vue.ref([]);
10190
10181
  const showInfo = vue.ref(true);
10182
+ const magnifyBtn = vue.ref(false);
10191
10183
  const videoBtns = [[{
10192
10184
  text: "lup",
10193
10185
  signal: 25
@@ -10214,7 +10206,7 @@ const VideoBoxV2 = vue.defineComponent({
10214
10206
  signal: 28
10215
10207
  }]];
10216
10208
  const infos = vue.ref([]);
10217
- const uuid = UUID();
10209
+ const uuid = vue.ref(UUID());
10218
10210
  vue.onMounted(() => {
10219
10211
  showInfo.value = _prop.showInfo;
10220
10212
  });
@@ -10291,14 +10283,83 @@ const VideoBoxV2 = vue.defineComponent({
10291
10283
  }
10292
10284
  });
10293
10285
  camera.value = res.data.data;
10294
- streams.value = JSON.parse(camera.value.brandTypePo?.streamTypeDict || "[]");
10286
+ streams.value = JSON.parse(camera.value?.brandTypePo?.streamTypeDict || "[]");
10295
10287
  };
10296
10288
  let timeout;
10297
10289
  vue.ref(true);
10298
10290
  vue.onBeforeUnmount(() => {});
10291
+ const resetZoom = () => {
10292
+ const chooseFieldDom = document.getElementById("chooseField_" + uuid.value);
10293
+ chooseFieldDom?.remove();
10294
+ const dom = document.getElementById("videoPlayer_" + uuid.value);
10295
+ dom.style.left = "0px";
10296
+ dom.style.top = "0px";
10297
+ dom.style.width = "100%";
10298
+ dom.style.height = "100%";
10299
+ };
10300
+ let boxDom;
10301
+ let playerDom;
10302
+ let newDiv;
10303
+ let begin = {
10304
+ left: 0,
10305
+ top: 0
10306
+ };
10307
+ let mousedownEvent;
10308
+ const mousemoveFun = mousemoveEvent => {
10309
+ newDiv.style.width = Math.abs(mousemoveEvent.offsetX - mousedownEvent.offsetX) - 3 + "px";
10310
+ newDiv.style.height = Math.abs(mousemoveEvent.offsetY - mousedownEvent.offsetY) - 3 + "px";
10311
+ newDiv.style.left = Math.min(mousedownEvent.offsetX, mousemoveEvent.offsetX) + begin.left + "px";
10312
+ newDiv.style.top = Math.min(mousedownEvent.offsetY, mousemoveEvent.offsetY) + begin.top + "px";
10313
+ };
10314
+ const mousedownFun = e => {
10315
+ mousedownEvent = e;
10316
+ begin.left = Number(playerDom.style.left.split("px")[0]);
10317
+ begin.top = Number(playerDom.style.top.split("px")[0]);
10318
+ newDiv = document.createElement("div");
10319
+ newDiv.id = "tempDiv";
10320
+ newDiv.style.left = mousedownEvent.offsetX + begin.left + "px";
10321
+ newDiv.style.top = mousedownEvent.offsetY + begin.top + "px";
10322
+ boxDom.appendChild(newDiv);
10323
+ playerDom?.addEventListener("mousemove", mousemoveFun);
10324
+ };
10325
+ const mouseupFun = mouseupEvent => {
10326
+ playerDom?.removeEventListener("mousemove", mousemoveFun);
10327
+ newDiv.remove();
10328
+ const scaleX = Math.abs(mouseupEvent.pageX - mousedownEvent.pageX) / boxDom.offsetWidth;
10329
+ const scaleY = Math.abs(mouseupEvent.pageY - mousedownEvent.pageY) / boxDom.offsetHeight;
10330
+ const playerLeft = Math.min(mousedownEvent.offsetX, mouseupEvent.offsetX) * -1 / scaleX;
10331
+ const playerTop = Math.min(mousedownEvent.offsetY, mouseupEvent.offsetY) * -1 / scaleY;
10332
+ const playerWidth = playerDom.offsetWidth / scaleX;
10333
+ const playerHeight = playerDom.offsetHeight / scaleY;
10334
+ playerDom.style.left = playerLeft + "px";
10335
+ playerDom.style.top = playerTop + "px";
10336
+ playerDom.style.width = playerWidth + "px";
10337
+ playerDom.style.height = playerHeight + "px";
10338
+ const chooseFieldDom = document.getElementById("chooseField_" + uuid.value);
10339
+ chooseFieldDom.style.width = chooseFieldDom.offsetWidth * scaleX + "px";
10340
+ chooseFieldDom.style.height = chooseFieldDom.offsetHeight * scaleY + "px";
10341
+ const thumbnailDom = document.getElementById("thumbnail_" + uuid.value);
10342
+ chooseFieldDom.style.left = thumbnailDom.offsetWidth * -1 * playerLeft / playerWidth + "px";
10343
+ chooseFieldDom.style.top = thumbnailDom.offsetHeight * -1 * playerTop / playerHeight + "px";
10344
+ };
10345
+ const setZoom = async () => {
10346
+ boxDom = document.getElementById("videoBox_" + uuid.value);
10347
+ playerDom = document.getElementById("videoPlayer_" + uuid.value);
10348
+ if (magnifyBtn.value) {
10349
+ magnifyBtn.value = !magnifyBtn.value;
10350
+ playerDom?.removeEventListener("mousedown", mousedownFun);
10351
+ playerDom?.removeEventListener("mouseup", mouseupFun);
10352
+ resetZoom();
10353
+ return;
10354
+ }
10355
+ magnifyBtn.value = !magnifyBtn.value;
10356
+ playerDom?.addEventListener("mousedown", mousedownFun);
10357
+ playerDom?.addEventListener("mouseup", mouseupFun);
10358
+ };
10299
10359
  const fill = vue.ref("fill");
10300
10360
  vue.watch(() => _prop.camera, val => {
10301
10361
  if (val && Object.keys(val).length != 0) {
10362
+ camera.value = void 0;
10302
10363
  getVideoParams(val);
10303
10364
  getVideoDetail(val);
10304
10365
  const fillVal = localStorage.getItem(val);
@@ -10316,27 +10377,44 @@ const VideoBoxV2 = vue.defineComponent({
10316
10377
  token: sessionStorage.getItem("token") || ""
10317
10378
  },
10318
10379
  params: {
10319
- uuid: camera.value.uuid,
10380
+ uuid: camera.value?.uuid,
10320
10381
  chosenStreamType: code
10321
10382
  }
10322
10383
  });
10323
10384
  cameraConfig.value.webrtcTemplateMerged = res.data.data[0];
10324
10385
  };
10325
10386
  return () => vue.createVNode("div", {
10326
- "id": "videoBox_" + uuid,
10387
+ "id": "videoBox_" + uuid.value,
10327
10388
  "class": ["videoBox", _prop.alarm ? "alarm" : ""]
10389
+ }, [camera.value ? vue.createVNode(VideoPlayerV2, {
10390
+ "ref": player,
10391
+ "domId": uuid.value,
10392
+ "camera": camera.value,
10393
+ "cameraConfig": cameraConfig.value,
10394
+ "fill": fill.value,
10395
+ "onChangeStream": () => {
10396
+ cameraConfig.value = {
10397
+ streamType: streamHistory.value || camera.value?.streamType
10398
+ };
10399
+ }
10400
+ }, null) : "", magnifyBtn.value ? vue.createVNode("div", {
10401
+ "class": "thumbnail",
10402
+ "id": "thumbnail_" + uuid.value
10328
10403
  }, [vue.createVNode(VideoPlayerV2, {
10329
10404
  "ref": player,
10330
- "domId": uuid,
10405
+ "domId": UUID(),
10331
10406
  "camera": camera.value,
10332
10407
  "cameraConfig": cameraConfig.value,
10333
10408
  "fill": fill.value,
10334
10409
  "onChangeStream": () => {
10335
10410
  cameraConfig.value = {
10336
- streamType: streamHistory.value || camera.value.streamType
10411
+ streamType: streamHistory.value || camera.value?.streamType
10337
10412
  };
10338
10413
  }
10339
- }, null), showInfo.value ? vue.createVNode("div", {
10414
+ }, null), vue.createVNode("div", {
10415
+ "class": "chooseField",
10416
+ "id": "chooseField_" + uuid.value
10417
+ }, null)]) : "", showInfo.value ? vue.createVNode("div", {
10340
10418
  "class": "selectFields"
10341
10419
  }, [[0, 1, 2, 3, 4, 5].map(index => {
10342
10420
  let info = {};
@@ -10357,7 +10435,7 @@ const VideoBoxV2 = vue.defineComponent({
10357
10435
  }, [vue.createVNode("span", null, [camera.value?.name])]), vue.createVNode("div", {
10358
10436
  "class": "tool"
10359
10437
  }, [_prop.btns.map(btn => {
10360
- if (!(camera.value.brandTypeCode === "MP4" && btn !== "close" && btn !== "fullScreen" && btn !== "look")) {
10438
+ if (!(camera.value?.brandTypeCode === "MP4" && btn !== "close" && btn !== "fullScreen" && btn !== "look")) {
10361
10439
  switch (btn) {
10362
10440
  case "fill":
10363
10441
  return vue.createVNode("img", {
@@ -10365,10 +10443,10 @@ const VideoBoxV2 = vue.defineComponent({
10365
10443
  "onClick": e => {
10366
10444
  if (fill.value === "fill") {
10367
10445
  fill.value = "contain";
10368
- localStorage.setItem(camera.value.uuid, fill.value);
10446
+ localStorage.setItem(camera.value?.uuid, fill.value);
10369
10447
  } else {
10370
10448
  fill.value = "fill";
10371
- localStorage.setItem(camera.value.uuid, fill.value);
10449
+ localStorage.setItem(camera.value?.uuid, fill.value);
10372
10450
  }
10373
10451
  },
10374
10452
  "src": "/micro-assets/inl/video/controls/fill.svg"
@@ -10398,6 +10476,14 @@ const VideoBoxV2 = vue.defineComponent({
10398
10476
  "src": "/micro-assets/inl/video/stream.png"
10399
10477
  }, null)]
10400
10478
  });
10479
+ case "magnify":
10480
+ return vue.createVNode("img", {
10481
+ "title": "\u653E\u5927",
10482
+ "onClick": e => {
10483
+ setZoom();
10484
+ },
10485
+ "src": "/micro-assets/inl/video/controls/magnify.svg"
10486
+ }, null);
10401
10487
  case "direction":
10402
10488
  return vue.createVNode(vue.resolveComponent("a-popover"), {
10403
10489
  "title": "\u63A7\u5236\u5668",
@@ -10506,13 +10592,13 @@ const PollingPlay = vue.defineComponent({
10506
10592
  fullScreen: false,
10507
10593
  name: ""
10508
10594
  });
10509
- const setCurrentVideos = team => {
10595
+ const setCurrentVideos = async team => {
10510
10596
  data.name = team.pollingGroupName;
10511
10597
  data.showType = `type${team.amount}`;
10512
- data.pointList.length = 0;
10598
+ data.pointList = [];
10513
10599
  for (let i = 0; i < parseInt(team.amount, 10); i++) {
10514
10600
  const video = team.monitorPointPoList[i];
10515
- data.pointList.push(video?.cameraUuid || {});
10601
+ data.pointList.push(video?.cameraUuid || "");
10516
10602
  }
10517
10603
  };
10518
10604
  const findShouldPlay = () => {
@@ -10598,16 +10684,18 @@ const PollingPlay = vue.defineComponent({
10598
10684
  }, null), "\u5168\u5C4F\u663E\u793A"])]) : "", vue.createVNode("div", {
10599
10685
  "id": "grid",
10600
10686
  "class": ["grid", data.showType, data.fullScreen ? "full" : ""]
10601
- }, [data.pointList.map((item, index) => vue.createVNode("div", {
10602
- "class": "video"
10603
- }, [_props.version === "V2" ? vue.createVNode(VideoBoxV2, {
10604
- "camera": item,
10605
- "btns": _props.btns,
10606
- "alarm": alarmList.value[index]
10607
- }, null) : vue.createVNode(VideoBox, {
10608
- "camera": item,
10609
- "btns": _props.btns
10610
- }, null)]))])]);
10687
+ }, [data.pointList.map((item, index) => {
10688
+ return vue.createVNode("div", {
10689
+ "class": "video"
10690
+ }, [_props.version === "V2" ? vue.createVNode(VideoBoxV2, {
10691
+ "camera": item,
10692
+ "btns": _props.btns,
10693
+ "alarm": alarmList.value[index]
10694
+ }, null) : vue.createVNode(VideoBox, {
10695
+ "camera": item,
10696
+ "btns": _props.btns
10697
+ }, null)]);
10698
+ })])]);
10611
10699
  }
10612
10700
  });
10613
10701
  var pollingPlay = installComponent(PollingPlay, "polling-play");
package/dist/index.d.ts CHANGED
@@ -11,7 +11,7 @@ import { Key } from 'ant-design-vue/lib/table/interface';
11
11
  import * as vue_jsx_runtime from 'vue/jsx-runtime';
12
12
  import * as _ant_design_icons_vue_lib_components_IconFont from '@ant-design/icons-vue/lib/components/IconFont';
13
13
 
14
- var version = "0.1.36";
14
+ var version = "0.1.38";
15
15
 
16
16
  declare const _default$p: {
17
17
  set(theme: string): void;
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ import { XPopup, CommentBlock, setAxiosOption } from '@sszj-temp/mobile';
14
14
  import { marked } from 'marked';
15
15
  import '@sszj-temp/mobile/style.css';
16
16
 
17
- var version = "0.1.36";
17
+ var version = "0.1.38";
18
18
 
19
19
  const setTheme = theme => {
20
20
  if (theme === "dark") {
@@ -9744,14 +9744,6 @@ const VideoPlayerV2 = defineComponent({
9744
9744
  }
9745
9745
  });
9746
9746
  };
9747
- const stopV = id => {
9748
- const videoElement = document.getElementById(id);
9749
- if (videoElement) {
9750
- videoElement.pause();
9751
- videoElement.removeAttribute("src");
9752
- videoElement.load();
9753
- }
9754
- };
9755
9747
  const releaseUrl = ref("");
9756
9748
  const release = async () => {
9757
9749
  const res = await axios$2.get(releaseUrl.value);
@@ -9801,7 +9793,6 @@ const VideoPlayerV2 = defineComponent({
9801
9793
  };
9802
9794
  watch([() => _prop.camera, () => _prop.cameraConfig], ([camera, cameraConfig]) => {
9803
9795
  stopPlay();
9804
- stopV(`videoPlayer_${uuid}`);
9805
9796
  getVideoDetail(camera);
9806
9797
  }, {
9807
9798
  immediate: true,
@@ -9809,27 +9800,27 @@ const VideoPlayerV2 = defineComponent({
9809
9800
  });
9810
9801
  onBeforeUnmount(() => {
9811
9802
  stopPlay();
9812
- const videoElement = document.getElementById(`videoPlayer_${uuid}`);
9813
- if (videoElement) {
9814
- videoElement.pause();
9815
- videoElement.src = null;
9816
- videoElement.srcObject = null;
9817
- videoElement.remove();
9818
- }
9819
9803
  });
9820
- return () => videoInfo2.value.brandTypeCode !== "MP4" ? createVNode("video", {
9821
- "id": `videoPlayer_${uuid}`,
9822
- "class": `videoComponent ${_prop.fill}`,
9823
- "muted": true,
9824
- "autoplay": true
9825
- }, null) : createVNode("video", {
9826
- "id": `videoPlayer_${uuid}`,
9827
- "class": "videoComponent fill",
9828
- "src": videoInfo2.value.mp4ResourcesPath,
9829
- "autoplay": true,
9830
- "loop": true,
9831
- "muted": true
9832
- }, null);
9804
+ const renderVideo = () => {
9805
+ if (videoInfo2.value.brandTypeCode === "MP4") {
9806
+ return createVNode("video", {
9807
+ "id": `mp4Player_${uuid}`,
9808
+ "class": "videoComponent fill",
9809
+ "src": videoInfo2.value.mp4ResourcesPath,
9810
+ "autoplay": true,
9811
+ "loop": true,
9812
+ "muted": true
9813
+ }, null);
9814
+ } else {
9815
+ return createVNode("video", {
9816
+ "id": `videoPlayer_${uuid}`,
9817
+ "class": `videoComponent ${_prop.fill}`,
9818
+ "muted": true,
9819
+ "autoplay": true
9820
+ }, null);
9821
+ }
9822
+ };
9823
+ return () => createVNode(Fragment, null, [renderVideo()]);
9833
9824
  }
9834
9825
  });
9835
9826
  var videoPlayerV2 = installComponent(VideoPlayerV2, "video-player-v2");
@@ -10134,7 +10125,7 @@ const props$6 = {
10134
10125
  // },
10135
10126
  btns: {
10136
10127
  type: Array,
10137
- default: ["fill", "look", "stream", "direction", "fullScreen", "close"]
10128
+ default: ["fill", "look", "stream", "magnify", "direction", "fullScreen", "close"]
10138
10129
  },
10139
10130
  alarm: {
10140
10131
  default: false,
@@ -10157,6 +10148,7 @@ const VideoBoxV2 = defineComponent({
10157
10148
  const streamHistory = ref("");
10158
10149
  const streams = ref([]);
10159
10150
  const showInfo = ref(true);
10151
+ const magnifyBtn = ref(false);
10160
10152
  const videoBtns = [[{
10161
10153
  text: "lup",
10162
10154
  signal: 25
@@ -10183,7 +10175,7 @@ const VideoBoxV2 = defineComponent({
10183
10175
  signal: 28
10184
10176
  }]];
10185
10177
  const infos = ref([]);
10186
- const uuid = UUID();
10178
+ const uuid = ref(UUID());
10187
10179
  onMounted(() => {
10188
10180
  showInfo.value = _prop.showInfo;
10189
10181
  });
@@ -10260,14 +10252,83 @@ const VideoBoxV2 = defineComponent({
10260
10252
  }
10261
10253
  });
10262
10254
  camera.value = res.data.data;
10263
- streams.value = JSON.parse(camera.value.brandTypePo?.streamTypeDict || "[]");
10255
+ streams.value = JSON.parse(camera.value?.brandTypePo?.streamTypeDict || "[]");
10264
10256
  };
10265
10257
  let timeout;
10266
10258
  ref(true);
10267
10259
  onBeforeUnmount(() => {});
10260
+ const resetZoom = () => {
10261
+ const chooseFieldDom = document.getElementById("chooseField_" + uuid.value);
10262
+ chooseFieldDom?.remove();
10263
+ const dom = document.getElementById("videoPlayer_" + uuid.value);
10264
+ dom.style.left = "0px";
10265
+ dom.style.top = "0px";
10266
+ dom.style.width = "100%";
10267
+ dom.style.height = "100%";
10268
+ };
10269
+ let boxDom;
10270
+ let playerDom;
10271
+ let newDiv;
10272
+ let begin = {
10273
+ left: 0,
10274
+ top: 0
10275
+ };
10276
+ let mousedownEvent;
10277
+ const mousemoveFun = mousemoveEvent => {
10278
+ newDiv.style.width = Math.abs(mousemoveEvent.offsetX - mousedownEvent.offsetX) - 3 + "px";
10279
+ newDiv.style.height = Math.abs(mousemoveEvent.offsetY - mousedownEvent.offsetY) - 3 + "px";
10280
+ newDiv.style.left = Math.min(mousedownEvent.offsetX, mousemoveEvent.offsetX) + begin.left + "px";
10281
+ newDiv.style.top = Math.min(mousedownEvent.offsetY, mousemoveEvent.offsetY) + begin.top + "px";
10282
+ };
10283
+ const mousedownFun = e => {
10284
+ mousedownEvent = e;
10285
+ begin.left = Number(playerDom.style.left.split("px")[0]);
10286
+ begin.top = Number(playerDom.style.top.split("px")[0]);
10287
+ newDiv = document.createElement("div");
10288
+ newDiv.id = "tempDiv";
10289
+ newDiv.style.left = mousedownEvent.offsetX + begin.left + "px";
10290
+ newDiv.style.top = mousedownEvent.offsetY + begin.top + "px";
10291
+ boxDom.appendChild(newDiv);
10292
+ playerDom?.addEventListener("mousemove", mousemoveFun);
10293
+ };
10294
+ const mouseupFun = mouseupEvent => {
10295
+ playerDom?.removeEventListener("mousemove", mousemoveFun);
10296
+ newDiv.remove();
10297
+ const scaleX = Math.abs(mouseupEvent.pageX - mousedownEvent.pageX) / boxDom.offsetWidth;
10298
+ const scaleY = Math.abs(mouseupEvent.pageY - mousedownEvent.pageY) / boxDom.offsetHeight;
10299
+ const playerLeft = Math.min(mousedownEvent.offsetX, mouseupEvent.offsetX) * -1 / scaleX;
10300
+ const playerTop = Math.min(mousedownEvent.offsetY, mouseupEvent.offsetY) * -1 / scaleY;
10301
+ const playerWidth = playerDom.offsetWidth / scaleX;
10302
+ const playerHeight = playerDom.offsetHeight / scaleY;
10303
+ playerDom.style.left = playerLeft + "px";
10304
+ playerDom.style.top = playerTop + "px";
10305
+ playerDom.style.width = playerWidth + "px";
10306
+ playerDom.style.height = playerHeight + "px";
10307
+ const chooseFieldDom = document.getElementById("chooseField_" + uuid.value);
10308
+ chooseFieldDom.style.width = chooseFieldDom.offsetWidth * scaleX + "px";
10309
+ chooseFieldDom.style.height = chooseFieldDom.offsetHeight * scaleY + "px";
10310
+ const thumbnailDom = document.getElementById("thumbnail_" + uuid.value);
10311
+ chooseFieldDom.style.left = thumbnailDom.offsetWidth * -1 * playerLeft / playerWidth + "px";
10312
+ chooseFieldDom.style.top = thumbnailDom.offsetHeight * -1 * playerTop / playerHeight + "px";
10313
+ };
10314
+ const setZoom = async () => {
10315
+ boxDom = document.getElementById("videoBox_" + uuid.value);
10316
+ playerDom = document.getElementById("videoPlayer_" + uuid.value);
10317
+ if (magnifyBtn.value) {
10318
+ magnifyBtn.value = !magnifyBtn.value;
10319
+ playerDom?.removeEventListener("mousedown", mousedownFun);
10320
+ playerDom?.removeEventListener("mouseup", mouseupFun);
10321
+ resetZoom();
10322
+ return;
10323
+ }
10324
+ magnifyBtn.value = !magnifyBtn.value;
10325
+ playerDom?.addEventListener("mousedown", mousedownFun);
10326
+ playerDom?.addEventListener("mouseup", mouseupFun);
10327
+ };
10268
10328
  const fill = ref("fill");
10269
10329
  watch(() => _prop.camera, val => {
10270
10330
  if (val && Object.keys(val).length != 0) {
10331
+ camera.value = void 0;
10271
10332
  getVideoParams(val);
10272
10333
  getVideoDetail(val);
10273
10334
  const fillVal = localStorage.getItem(val);
@@ -10285,27 +10346,44 @@ const VideoBoxV2 = defineComponent({
10285
10346
  token: sessionStorage.getItem("token") || ""
10286
10347
  },
10287
10348
  params: {
10288
- uuid: camera.value.uuid,
10349
+ uuid: camera.value?.uuid,
10289
10350
  chosenStreamType: code
10290
10351
  }
10291
10352
  });
10292
10353
  cameraConfig.value.webrtcTemplateMerged = res.data.data[0];
10293
10354
  };
10294
10355
  return () => createVNode("div", {
10295
- "id": "videoBox_" + uuid,
10356
+ "id": "videoBox_" + uuid.value,
10296
10357
  "class": ["videoBox", _prop.alarm ? "alarm" : ""]
10358
+ }, [camera.value ? createVNode(VideoPlayerV2, {
10359
+ "ref": player,
10360
+ "domId": uuid.value,
10361
+ "camera": camera.value,
10362
+ "cameraConfig": cameraConfig.value,
10363
+ "fill": fill.value,
10364
+ "onChangeStream": () => {
10365
+ cameraConfig.value = {
10366
+ streamType: streamHistory.value || camera.value?.streamType
10367
+ };
10368
+ }
10369
+ }, null) : "", magnifyBtn.value ? createVNode("div", {
10370
+ "class": "thumbnail",
10371
+ "id": "thumbnail_" + uuid.value
10297
10372
  }, [createVNode(VideoPlayerV2, {
10298
10373
  "ref": player,
10299
- "domId": uuid,
10374
+ "domId": UUID(),
10300
10375
  "camera": camera.value,
10301
10376
  "cameraConfig": cameraConfig.value,
10302
10377
  "fill": fill.value,
10303
10378
  "onChangeStream": () => {
10304
10379
  cameraConfig.value = {
10305
- streamType: streamHistory.value || camera.value.streamType
10380
+ streamType: streamHistory.value || camera.value?.streamType
10306
10381
  };
10307
10382
  }
10308
- }, null), showInfo.value ? createVNode("div", {
10383
+ }, null), createVNode("div", {
10384
+ "class": "chooseField",
10385
+ "id": "chooseField_" + uuid.value
10386
+ }, null)]) : "", showInfo.value ? createVNode("div", {
10309
10387
  "class": "selectFields"
10310
10388
  }, [[0, 1, 2, 3, 4, 5].map(index => {
10311
10389
  let info = {};
@@ -10326,7 +10404,7 @@ const VideoBoxV2 = defineComponent({
10326
10404
  }, [createVNode("span", null, [camera.value?.name])]), createVNode("div", {
10327
10405
  "class": "tool"
10328
10406
  }, [_prop.btns.map(btn => {
10329
- if (!(camera.value.brandTypeCode === "MP4" && btn !== "close" && btn !== "fullScreen" && btn !== "look")) {
10407
+ if (!(camera.value?.brandTypeCode === "MP4" && btn !== "close" && btn !== "fullScreen" && btn !== "look")) {
10330
10408
  switch (btn) {
10331
10409
  case "fill":
10332
10410
  return createVNode("img", {
@@ -10334,10 +10412,10 @@ const VideoBoxV2 = defineComponent({
10334
10412
  "onClick": e => {
10335
10413
  if (fill.value === "fill") {
10336
10414
  fill.value = "contain";
10337
- localStorage.setItem(camera.value.uuid, fill.value);
10415
+ localStorage.setItem(camera.value?.uuid, fill.value);
10338
10416
  } else {
10339
10417
  fill.value = "fill";
10340
- localStorage.setItem(camera.value.uuid, fill.value);
10418
+ localStorage.setItem(camera.value?.uuid, fill.value);
10341
10419
  }
10342
10420
  },
10343
10421
  "src": "/micro-assets/inl/video/controls/fill.svg"
@@ -10367,6 +10445,14 @@ const VideoBoxV2 = defineComponent({
10367
10445
  "src": "/micro-assets/inl/video/stream.png"
10368
10446
  }, null)]
10369
10447
  });
10448
+ case "magnify":
10449
+ return createVNode("img", {
10450
+ "title": "\u653E\u5927",
10451
+ "onClick": e => {
10452
+ setZoom();
10453
+ },
10454
+ "src": "/micro-assets/inl/video/controls/magnify.svg"
10455
+ }, null);
10370
10456
  case "direction":
10371
10457
  return createVNode(resolveComponent("a-popover"), {
10372
10458
  "title": "\u63A7\u5236\u5668",
@@ -10475,13 +10561,13 @@ const PollingPlay = defineComponent({
10475
10561
  fullScreen: false,
10476
10562
  name: ""
10477
10563
  });
10478
- const setCurrentVideos = team => {
10564
+ const setCurrentVideos = async team => {
10479
10565
  data.name = team.pollingGroupName;
10480
10566
  data.showType = `type${team.amount}`;
10481
- data.pointList.length = 0;
10567
+ data.pointList = [];
10482
10568
  for (let i = 0; i < parseInt(team.amount, 10); i++) {
10483
10569
  const video = team.monitorPointPoList[i];
10484
- data.pointList.push(video?.cameraUuid || {});
10570
+ data.pointList.push(video?.cameraUuid || "");
10485
10571
  }
10486
10572
  };
10487
10573
  const findShouldPlay = () => {
@@ -10567,16 +10653,18 @@ const PollingPlay = defineComponent({
10567
10653
  }, null), "\u5168\u5C4F\u663E\u793A"])]) : "", createVNode("div", {
10568
10654
  "id": "grid",
10569
10655
  "class": ["grid", data.showType, data.fullScreen ? "full" : ""]
10570
- }, [data.pointList.map((item, index) => createVNode("div", {
10571
- "class": "video"
10572
- }, [_props.version === "V2" ? createVNode(VideoBoxV2, {
10573
- "camera": item,
10574
- "btns": _props.btns,
10575
- "alarm": alarmList.value[index]
10576
- }, null) : createVNode(VideoBox, {
10577
- "camera": item,
10578
- "btns": _props.btns
10579
- }, null)]))])]);
10656
+ }, [data.pointList.map((item, index) => {
10657
+ return createVNode("div", {
10658
+ "class": "video"
10659
+ }, [_props.version === "V2" ? createVNode(VideoBoxV2, {
10660
+ "camera": item,
10661
+ "btns": _props.btns,
10662
+ "alarm": alarmList.value[index]
10663
+ }, null) : createVNode(VideoBox, {
10664
+ "camera": item,
10665
+ "btns": _props.btns
10666
+ }, null)]);
10667
+ })])]);
10580
10668
  }
10581
10669
  });
10582
10670
  var pollingPlay = installComponent(PollingPlay, "polling-play");