diff --git a/src/store/index.ts b/src/store/index.ts index fa9f58b..f1dd991 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -17,7 +17,9 @@ export const useStore = defineStore('Index', { //当前选中的树节点 curTreeKey: "", //标签组类 - labelGroupList: [] + labelGroupList: [], + //是否截图 + screenshot:false, } }, @@ -52,6 +54,9 @@ export const useStore = defineStore('Index', { }, updateLabelGroupList(arr: any) { this.labelGroupList = arr - } + }, + updateScreenshot(screenshot: any) { + this.screenshot = screenshot + }, }, }) \ No newline at end of file diff --git a/src/views/page/Aside/cameraRightMenu.vue b/src/views/page/Aside/cameraRightMenu.vue index d61d487..1849e53 100644 --- a/src/views/page/Aside/cameraRightMenu.vue +++ b/src/views/page/Aside/cameraRightMenu.vue @@ -9,23 +9,23 @@ -
+
标签标志
-
+
截图
-
+
录像
-
+
3D缩放
-
+
设备标记
-
+
工具箱
+ @click="itemClick(item)">
@@ -104,6 +102,7 @@ let cameraMap = storeToRefs(piniaStore).cameraMap let isActiveChoose = ref(false) let labelList = ref([]) let addLabel = storeToRefs(piniaStore).addLabel +let screenshot = storeToRefs(piniaStore).screenshot let addLabelLeft = ref(0); let addLabelTop = ref(0); var jessibuca = ref(); @@ -119,7 +118,21 @@ onMounted(() => { }) +watch(screenshot, (newVal, oldVal) => { + if (newVal) { + console.log(123); + + //jessibuca.value.player._playing 判断是否正在播放 + if (!jessibuca.value.player._playing) { + Msg.info("请先选择监控画面") + piniaStore.updateScreenshot(false) + return + } + jessibuca.value.screenshot("", "png", 1) + piniaStore.updateScreenshot(false) + } +}) watch(curSelectKey, (newVal, oldVal) => { switchCamera(newVal) }) @@ -199,7 +212,7 @@ function deleteLabel(id: number) { } //标签点击事件 -function itemClick(item:any){ +function itemClick(item: any) { // console.log("点击",item); // popup("监控画面", [h(cameraWindow, { windowData: item })], "cameraWindow"); //打开小窗 @@ -268,6 +281,7 @@ function changeVideoCanvasSize() { function mouseDownVideo(e: MouseEvent) { + if (!isActiveChoose.value) return; //鼠标左键 e.buttons == 1 if (e.buttons == 1) {