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

10
src/views/page/cameraCenter.vue

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

Loading…
Cancel
Save