Browse Source

添加标签背景图,添加标签编辑页

master
chendingwei 2 years ago
parent
commit
7fb51ba635
  1. 5
      components.d.ts
  2. BIN
      src/assets/images/buildLabelBg.png
  3. BIN
      src/assets/images/buildLabelLine.png
  4. BIN
      src/assets/images/loginBG.png
  5. 1
      src/assets/images/vite.svg
  6. 52
      src/views/page/Aside/cameraRightMenu.vue
  7. 51
      src/views/page/Model/LabelEditModel.vue
  8. 44
      src/views/page/cameraCenter.vue

5
components.d.ts

@ -8,9 +8,6 @@ export {}
declare module '@vue/runtime-core' { declare module '@vue/runtime-core' {
export interface GlobalComponents { export interface GlobalComponents {
AButton: typeof import('ant-design-vue/es')['Button'] AButton: typeof import('ant-design-vue/es')['Button']
ACheckbox: typeof import('ant-design-vue/es')['Checkbox']
ACheckboxGroup: typeof import('ant-design-vue/es')['CheckboxGroup']
ADatePicker: typeof import('ant-design-vue/es')['DatePicker']
ADropdown: typeof import('ant-design-vue/es')['Dropdown'] ADropdown: typeof import('ant-design-vue/es')['Dropdown']
AForm: typeof import('ant-design-vue/es')['Form'] AForm: typeof import('ant-design-vue/es')['Form']
AFormItem: typeof import('ant-design-vue/es')['FormItem'] AFormItem: typeof import('ant-design-vue/es')['FormItem']
@ -19,8 +16,6 @@ declare module '@vue/runtime-core' {
AMenu: typeof import('ant-design-vue/es')['Menu'] AMenu: typeof import('ant-design-vue/es')['Menu']
AMenuItem: typeof import('ant-design-vue/es')['MenuItem'] AMenuItem: typeof import('ant-design-vue/es')['MenuItem']
AModal: typeof import('ant-design-vue/es')['Modal'] AModal: typeof import('ant-design-vue/es')['Modal']
ARadio: typeof import('ant-design-vue/es')['Radio']
ARadioGroup: typeof import('ant-design-vue/es')['RadioGroup']
ARow: typeof import('ant-design-vue/es')['Row'] ARow: typeof import('ant-design-vue/es')['Row']
ASelect: typeof import('ant-design-vue/es')['Select'] ASelect: typeof import('ant-design-vue/es')['Select']
ASelectOption: typeof import('ant-design-vue/es')['SelectOption'] ASelectOption: typeof import('ant-design-vue/es')['SelectOption']

BIN
src/assets/images/buildLabelBg.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 557 B

BIN
src/assets/images/buildLabelLine.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
src/assets/images/loginBG.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 162 KiB

After

Width:  |  Height:  |  Size: 7.7 KiB

1
src/assets/images/vite.svg

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>

Before

Width:  |  Height:  |  Size: 1.5 KiB

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

@ -1,8 +1,16 @@
<template> <template>
<div class="buttomList"> <div class="buttomList">
<Popover placement="left" trigger="hover">
<template #content>
<ul>
<p @click="addLabelFn('视频标签')">视频标签</p>
<p @click="addLabelFn('建筑标签')">建筑标签</p>
<!-- <p></p> -->
</ul>
</template>
<div class="buttomItem"> <div class="buttomItem">
<div class="buttomName">标签标志</div> <div class="buttomName">标签标志</div>
</div> </div> </Popover>
<div class="buttomItem"> <div class="buttomItem">
<div class="buttomName">截图</div> <div class="buttomName">截图</div>
</div> </div>
@ -22,19 +30,6 @@
<div class="buttomName">设置</div> <div class="buttomName">设置</div>
</div> </div>
</div> </div>
<a-modal
v-model:visible="visible"
title="用户设置"
width="90%"
wrapClassName="full-modal"
:footer="null"
>
<userEdit></userEdit>
</a-modal>
</template> </template>
<script setup lang='ts'> <script setup lang='ts'>
@ -44,6 +39,11 @@ import { ref } from 'vue';
const visible = ref(false) const visible = ref(false)
function openUserEdit(){ function openUserEdit(){
visible.value = !visible.value visible.value = !visible.value
}import { Popover } from 'ant-design-vue';
import { useStore } from '@/store/index';
let piniaStore = useStore();
function addLabelFn(str: string) {
piniaStore.updateIsAddLabel({ labelType: str, isAddLabel: true })
} }
</script> </script>
@ -102,26 +102,4 @@ function openUserEdit(){
z-index: 2; z-index: 2;
font-size: 0.8em; font-size: 0.8em;
} }
</style> </style>
<style lang="less" >
.full-modal {
.ant-modal {
max-width: 100%;
top: 3vh;
padding-bottom: 0;
margin: auto;
}
.ant-modal-content {
display: flex;
flex-direction: column;
height: calc(90vh);
}
.ant-modal-body {
flex: 1;
}
}
</style>

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

@ -1,17 +1,60 @@
<template> <template>
<div class="label-edit-model"> <div class="label-edit-model">
<Draggable></Draggable> <Draggable></Draggable>
<Button>123</Button> <!-- <div class="model-head"><Button type="primary" danger>重新调整</Button></div> -->
<Row>
<Col :span="24" class="label-attribute">
<Row>
<Col :span="4">标签名称 :</Col>
<Col :span="8"><Input size="small"></Input></Col>
</Row>
</Col>
<Col :span="24" class="label-attribute">
<Row>
<Col :span="4">标签X轴 :</Col>
<Col :span="8">
<InputNumber size="small" :min="0" :max="1" :step="0.001" />
</Col>
</Row>
</Col>
<Col :span="24" class="label-attribute">
<Row>
<Col :span="4">标签Y轴 :</Col>
<Col :span="8">
<InputNumber size="small" :min="0" :max="1" :step="0.001" />
</Col>
</Row>
</Col>
<Col :span="24" class="label-attribute">
<div class="label-btn">
<Button type="primary">保存</Button>
<Button style="color:black;">取消</Button>
</div>
</Col>
</Row>
</div> </div>
</template> </template>
<script setup lang='ts'> <script setup lang='ts'>
import {Button} from 'ant-design-vue' import { Input, Row, Col, InputNumber, Button } from 'ant-design-vue'
import Draggable from '@/components/Draggable.vue' import Draggable from '@/components/Draggable.vue'
</script> </script>
<style scoped lang='less'> <style scoped lang='less'>
.label-edit-model{ .label-edit-model {
position: relative; position: relative;
.model-head {
text-align: center;
}
.label-attribute {
padding-bottom: 10px;
}
.label-btn {
text-align: right;
}
} }
</style> </style>

44
src/views/page/cameraCenter.vue

@ -12,8 +12,10 @@
<a-dropdown :trigger="['contextmenu']"> <a-dropdown :trigger="['contextmenu']">
<div class="labels-item"> <div class="labels-item">
<!-- <div class="labels-item" v-if="item.inFlag"> --> <!-- <div class="labels-item" v-if="item.inFlag"> -->
<img src="@/assets/images/dialog.png" alt=""> <div style="position: relative;">
<span>{{ item.name }}</span> <img src="@/assets/images/dialog.png" alt="">
<div class="label-content">{{ item.name }}</div>
</div>
</div> </div>
<template #overlay> <template #overlay>
<a-menu @click="({ key: menuKey }) => onContextMenuClick(item.id, menuKey)"> <a-menu @click="({ key: menuKey }) => onContextMenuClick(item.id, menuKey)">
@ -26,11 +28,20 @@
<div class="labels" v-if="addLabel.isAddLabel" <div class="labels" v-if="addLabel.isAddLabel"
:style="`position: fixed;transform: translate(-50%,-100%);top:${addLabelTop}px;left:${addLabelLeft}px`"> :style="`position: fixed;transform: translate(-50%,-100%);top:${addLabelTop}px;left:${addLabelLeft}px`">
<div class="labels-item"> <div class="labels-item" v-if="addLabel.labelType == '建筑标签'" alt="">
<img src="@/assets/images/dialog.png" width="80" height="50" alt=""> <img src="@/assets/images/buildLabelLine.png">
<span>1</span> <div style="position: relative;">
<img src="@/assets/images/buildLabelBg.png">
<div class="label-content">{{ addLabel.labelType }}</div>
</div>
</div>
<div class="labels-item" v-else-if="addLabel.labelType == '视频标签'">
<!-- <div class="labels-item" v-if="item.inFlag"> -->
<div style="position: relative;">
<img src="@/assets/images/dialog.png" alt="">
<div class="label-content">{{ addLabel.labelType }}</div>
</div>
</div> </div>
</div> </div>
<CameraLeftMenu></CameraLeftMenu> <CameraLeftMenu></CameraLeftMenu>
@ -84,7 +95,7 @@ onMounted(() => {
watch(curSelectKey, (newVal, oldVal) => { watch(curSelectKey, (newVal, oldVal) => {
labelList.value=[] labelList.value = []
switchCamera(newVal) switchCamera(newVal)
}) })
watch(addLabel, (newVal, oldVal) => { watch(addLabel, (newVal, oldVal) => {
@ -98,7 +109,7 @@ watch(addLabel, (newVal, oldVal) => {
} }
}) })
// //
function deleteLabel(id: number) { function deleteLabel(id: number) {
markLabelApi.Delete({ id }).then((res: any) => { markLabelApi.Delete({ id }).then((res: any) => {
@ -131,7 +142,7 @@ const onContextMenuClick = (labelId: string, menuKey: string) => {
console.log(`labelId: ${labelId}, menuKey: ${menuKey}`); console.log(`labelId: ${labelId}, menuKey: ${menuKey}`);
//key //key
if (menuKey == "edit") { if (menuKey == "edit") {
popup("编辑标签", [h( LabelEditModel )], "editLabel"); popup("编辑标签", [h(LabelEditModel)], "editLabel");
} else if (menuKey == "delete") { } else if (menuKey == "delete") {
Modal.confirm({ Modal.confirm({
zIndex: 10000, zIndex: 10000,
@ -230,7 +241,6 @@ function mouseDownVideo(e: MouseEvent) {
name: name, name: name,
} }
labelList.value.push(obj) labelList.value.push(obj)
console.log(obj, 'obj111111111111111');
isActiveChoose.value = false isActiveChoose.value = false
piniaStore.updateIsAddLabel({ labelType: "", isAddLabel: false }) piniaStore.updateIsAddLabel({ labelType: "", isAddLabel: false })
} }
@ -310,7 +320,7 @@ function loadMarkLabelsByLoop(cameraObj: any, ms: number = 1000) {
return; return;
} }
loadMarkLabels(cameraObj); loadMarkLabels(cameraObj);
let timer = setTimeout(() => { let timer = setTimeout(() => {
loadMarkLabelsByLoop(cameraObj, ms); loadMarkLabelsByLoop(cameraObj, ms);
clearTimeout(timer) clearTimeout(timer)
}, ms); }, ms);
@ -394,16 +404,20 @@ onUnmounted(() => {
.labels-item { .labels-item {
position: relative; position: relative;
cursor: pointer; cursor: pointer;
display: flex;
justify-content: center;
align-items: center;
span { .label-content {
position: absolute; position: absolute;
top: 50%; top: 50%;
left: 50%; left: 50%;
transform: translate(-50%, -55%); transform: translate(-50%, -55%);
} }
img{
width: 150px; img {
height: 100px; width: 120px;
height: 50px;
} }
} }
} }

Loading…
Cancel
Save