Browse Source

优化数据

master
DIAMOND 2 years ago
parent
commit
d21c3b3bca
  1. 16
      src/views/page/Model/LabelEditModel.vue
  2. 10
      src/views/page/cameraCenter.vue

16
src/views/page/Model/LabelEditModel.vue

@ -28,7 +28,7 @@
<Col :span="24" class="label-attribute">
<div class="label-btn">
<Button type="primary">保存</Button>
<Button style="color:black;">取消</Button>
<Button style="color:black;" @click="cancel">取消</Button>
</div>
</Col>
</Row>
@ -37,8 +37,20 @@
</template>
<script setup lang='ts'>
import { Input, Row, Col, InputNumber, Button } from 'ant-design-vue'
import { Input, Row, Col, InputNumber, Button, notification } from 'ant-design-vue'
import Draggable from '@/components/Draggable.vue'
import { onMounted } from 'vue';
onMounted(()=>{
})
//
function cancel(){
notification.close("editLabel");
}
</script>
<style scoped lang='less'>

10
src/views/page/cameraCenter.vue

@ -26,7 +26,7 @@
</div>
</div>
<template #overlay>
<a-menu @click="({ key: menuKey }) => onContextMenuClick(item.id, menuKey)">
<a-menu @click="({ key: menuKey }) => onContextMenuClick(item, menuKey)">
<a-menu-item key="edit">编辑</a-menu-item>
<a-menu-item key="delete">删除</a-menu-item>
</a-menu>
@ -148,8 +148,10 @@ function loadVideoCanvas() {
changeVideoCanvasSize();
});
}
const onContextMenuClick = (labelId: string, menuKey: string) => {
console.log(`labelId: ${labelId}, menuKey: ${menuKey}`);
const onContextMenuClick = (item: any, menuKey: string,) => {
console.log(`labelId: ${item.id}, menuKey: ${menuKey}`);
// console.log(`item: ${item}`);
console.log(item);
//key
if (menuKey == "edit") {
popup("编辑标签", [h(LabelEditModel)], "editLabel");
@ -178,7 +180,7 @@ const onContextMenuClick = (labelId: string, menuKey: string) => {
danger: true,
},
onOk() {
deleteLabel(parseInt(labelId))
deleteLabel(parseInt(item.id))
},
style: "top: 250px",

Loading…
Cancel
Save