Browse Source

新增截图功能

master
chendingwei 2 years ago
parent
commit
c35663d16f
  1. 9
      src/store/index.ts
  2. 16
      src/views/page/Aside/cameraRightMenu.vue
  3. 3
      src/views/page/aside/cameraLeftMenu.vue
  4. 24
      src/views/page/cameraCenter.vue

9
src/store/index.ts

@ -17,7 +17,9 @@ export const useStore = defineStore('Index', {
//当前选中的树节点 //当前选中的树节点
curTreeKey: "", curTreeKey: "",
//标签组类 //标签组类
labelGroupList: [] labelGroupList: [],
//是否截图
screenshot:<boolean>false,
} }
}, },
@ -52,6 +54,9 @@ export const useStore = defineStore('Index', {
}, },
updateLabelGroupList(arr: any) { updateLabelGroupList(arr: any) {
this.labelGroupList = arr this.labelGroupList = arr
} },
updateScreenshot(screenshot: any) {
this.screenshot = screenshot
},
}, },
}) })

16
src/views/page/Aside/cameraRightMenu.vue

@ -9,23 +9,23 @@
<!-- <p></p> --> <!-- <p></p> -->
</ul> </ul>
</template> </template>
<div class="buttomItem"> <div class="buttomItem" title="标签标志">
<div class="buttomName">标签标志</div> <div class="buttomName">标签标志</div>
</div> </div>
</Popover> </Popover>
<div class="buttomItem"> <div class="buttomItem" title="截图" @click="clickScreenshot">
<div class="buttomName">截图</div> <div class="buttomName">截图</div>
</div> </div>
<div class="buttomItem"> <div class="buttomItem" title="录像">
<div class="buttomName">录像</div> <div class="buttomName">录像</div>
</div> </div>
<div class="buttomItem"> <div class="buttomItem" title="3D缩放">
<div class="buttomName">3D缩放</div> <div class="buttomName">3D缩放</div>
</div> </div>
<div class="buttomItem"> <div class="buttomItem" title="设备标记">
<div class="buttomName">设备标记</div> <div class="buttomName">设备标记</div>
</div> </div>
<div class="buttomItem"> <div class="buttomItem" title="工具箱">
<div class="buttomName">工具箱</div> <div class="buttomName">工具箱</div>
</div> </div>
<!-- <div class="buttomItem" @click="openUserEdit"> <!-- <div class="buttomItem" @click="openUserEdit">
@ -65,7 +65,6 @@ import { useStore } from '@/store/index';
import * as markGroupApi from '@/axios/cameraMark/markGroupApi'; import * as markGroupApi from '@/axios/cameraMark/markGroupApi';
import CameraEdit from './rightMenuItem/cameraEdit.vue'; import CameraEdit from './rightMenuItem/cameraEdit.vue';
const visible = ref(false) const visible = ref(false)
const labelList :any=ref([]) const labelList :any=ref([])
const type = ref('') // const type = ref('') //
@ -77,6 +76,9 @@ let piniaStore = useStore();
function addLabelFn(str: string,id:number) { function addLabelFn(str: string,id:number) {
piniaStore.updateIsAddLabel({ cmMarkGroupId:id,labelType: str, isAddLabel: true }) piniaStore.updateIsAddLabel({ cmMarkGroupId:id,labelType: str, isAddLabel: true })
} }
function clickScreenshot(){
piniaStore.updateScreenshot(true)
}
function init() { function init() {
markGroupApi.GetList().then((res: any) => { markGroupApi.GetList().then((res: any) => {
console.log(res, 'markGroupApi'); console.log(res, 'markGroupApi');

3
src/views/page/aside/cameraLeftMenu.vue

@ -29,7 +29,7 @@
</a-tree> </a-tree>
</div> </div>
</div> </div>
<a-modal v-model:visible="visible" title="设置表单" width="40%" @ok="handleOk" @cancel="handelCancel" <a-modal v-model:visible="visible" title="新增节点" width="40%" @ok="handleOk" okText="确定" cancelText="取消" @cancel="handelCancel"
:maskClosable="false" destroyOnClose> :maskClosable="false" destroyOnClose>
<cameraNodeModal ref="childRef" :editData="NodeTreeItem"></cameraNodeModal> <cameraNodeModal ref="childRef" :editData="NodeTreeItem"></cameraNodeModal>
</a-modal> </a-modal>
@ -97,7 +97,6 @@ function handleOk() {
function handelCancel() { visible.value = false } function handelCancel() { visible.value = false }
// //
function onRightClick({ node }: any) { function onRightClick({ node }: any) {
NodeTreeItem.value = { NodeTreeItem.value = {
cbCameraId: node.cbCameraId, cbCameraId: node.cbCameraId,
isGroup: node.isGroup, isGroup: node.isGroup,

24
src/views/page/cameraCenter.vue

@ -7,11 +7,9 @@
</video> --> </video> -->
<div id="videoPlayer" @mousedown="mouseDownVideo"></div> <div id="videoPlayer" @mousedown="mouseDownVideo"></div>
<div v-for="item in labelList" :class="`labels ${item.groupName == '视频标签' ? 'lavels-video' : 'lavels-build'}`" <div v-for="item in labelList" :class="`labels ${item.groupName == '视频标签' ? 'lavels-video' : 'lavels-build'}`"
:key="item.id" :key="item.id" :id="item.id"
:id="item.id"
:style="`top:${canvasHeight * item.canvasTopRatio}px;left:${canvasWidth * item.canvasLeftRatio}px`" :style="`top:${canvasHeight * item.canvasTopRatio}px;left:${canvasWidth * item.canvasLeftRatio}px`"
@click="itemClick(item)" @click="itemClick(item)">
>
<a-dropdown :trigger="['contextmenu']"> <a-dropdown :trigger="['contextmenu']">
<div class="labels-item" v-if="item.groupName == '视频标签'"> <div class="labels-item" v-if="item.groupName == '视频标签'">
<!-- <div class="labels-item" v-if="item.inFlag"> --> <!-- <div class="labels-item" v-if="item.inFlag"> -->
@ -104,6 +102,7 @@ let cameraMap = storeToRefs(piniaStore).cameraMap
let isActiveChoose = ref(false) let isActiveChoose = ref(false)
let labelList = ref<any[]>([]) let labelList = ref<any[]>([])
let addLabel = storeToRefs(piniaStore).addLabel let addLabel = storeToRefs(piniaStore).addLabel
let screenshot = storeToRefs(piniaStore).screenshot
let addLabelLeft = ref(0); let addLabelLeft = ref(0);
let addLabelTop = ref(0); let addLabelTop = ref(0);
var jessibuca = ref(); 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) => { watch(curSelectKey, (newVal, oldVal) => {
switchCamera(newVal) switchCamera(newVal)
}) })
@ -199,7 +212,7 @@ function deleteLabel(id: number) {
} }
// //
function itemClick(item:any){ function itemClick(item: any) {
// console.log("",item); // console.log("",item);
// popup("", [h(cameraWindow, { windowData: item })], "cameraWindow"); // popup("", [h(cameraWindow, { windowData: item })], "cameraWindow");
// //
@ -268,6 +281,7 @@ function changeVideoCanvasSize() {
function mouseDownVideo(e: MouseEvent) { function mouseDownVideo(e: MouseEvent) {
if (!isActiveChoose.value) return; if (!isActiveChoose.value) return;
// e.buttons == 1 // e.buttons == 1
if (e.buttons == 1) { if (e.buttons == 1) {

Loading…
Cancel
Save