From 37558d3f266dc2c7e420f4274b6395c391c3d179 Mon Sep 17 00:00:00 2001 From: chendingwei <1170506816@qq.com> Date: Thu, 5 Jan 2023 18:46:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=BD=95=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components.d.ts | 1 + src/store/index.ts | 5 + src/views/page/Aside/cameraRightMenu.vue | 66 +++++---- src/views/page/cameraCenter.vue | 168 ++++++++++++----------- 4 files changed, 133 insertions(+), 107 deletions(-) diff --git a/components.d.ts b/components.d.ts index 94eb12f..f0d1243 100644 --- a/components.d.ts +++ b/components.d.ts @@ -17,6 +17,7 @@ declare module '@vue/runtime-core' { AMenu: typeof import('ant-design-vue/es')['Menu'] AMenuItem: typeof import('ant-design-vue/es')['MenuItem'] AModal: typeof import('ant-design-vue/es')['Modal'] + APopconfirm: typeof import('ant-design-vue/es')['Popconfirm'] ARow: typeof import('ant-design-vue/es')['Row'] ASelect: typeof import('ant-design-vue/es')['Select'] ATree: typeof import('ant-design-vue/es')['Tree'] diff --git a/src/store/index.ts b/src/store/index.ts index f1dd991..e2e8a97 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -20,6 +20,8 @@ export const useStore = defineStore('Index', { labelGroupList: [], //是否截图 screenshot:false, + //是否录制 + record:false, } }, @@ -58,5 +60,8 @@ export const useStore = defineStore('Index', { updateScreenshot(screenshot: any) { this.screenshot = screenshot }, + updateRecord(record: any) { + this.record = record + }, }, }) \ No newline at end of file diff --git a/src/views/page/Aside/cameraRightMenu.vue b/src/views/page/Aside/cameraRightMenu.vue index c903369..79677bf 100644 --- a/src/views/page/Aside/cameraRightMenu.vue +++ b/src/views/page/Aside/cameraRightMenu.vue @@ -5,7 +5,8 @@ @@ -16,8 +17,8 @@
截图
-
-
录像
+
+
{{ recordText }}
3D缩放
@@ -35,8 +36,8 @@
@@ -44,16 +45,11 @@
- - - - + + + + @@ -64,27 +60,40 @@ import { Popover } from 'ant-design-vue'; import { useStore } from '@/store/index'; import * as markGroupApi from '@/axios/cameraMark/markGroupApi'; import CameraEdit from './rightMenuItem/cameraEdit.vue'; - +import { storeToRefs } from 'pinia'; +let piniaStore = useStore(); const visible = ref(false) -const labelList :any=ref([]) +const labelList: any = ref([]) const type = ref('') //设置类型 -function openSetting(editType:string) { +const recordText = ref('录制')//录制文本 +const record = storeToRefs(piniaStore).record +function openSetting(editType: string) { visible.value = !visible.value type.value = editType } -let piniaStore = useStore(); -function addLabelFn(str: string,id:number) { - piniaStore.updateIsAddLabel({ cmMarkGroupId:id,labelType: str, isAddLabel: true }) + +function addLabelFn(str: string, id: number) { + piniaStore.updateIsAddLabel({ cmMarkGroupId: id, labelType: str, isAddLabel: true }) } -function clickScreenshot(){ +//截图 +function clickScreenshot() { piniaStore.updateScreenshot(true) } +//录像 +function clickRecord() { + piniaStore.updateRecord(!record.value) + if (record.value) { + recordText.value = "停止录制" + } else { + recordText.value = "录制" + } +} function init() { markGroupApi.GetList().then((res: any) => { console.log(res, 'markGroupApi'); let result = res.data if (result.code == 200) { - labelList.value=result.data + labelList.value = result.data piniaStore.updateLabelGroupList(result.data) } }) @@ -148,14 +157,15 @@ onMounted(() => { z-index: 2; font-size: 0.8em; } -ul{ + +ul { padding: 0; margin: 0; - p:last-child{ - margin: 0; -} -} + p:last-child { + margin: 0; + } +}