|
|
|
|
|
|
|
|
<template> |
|
|
<template> |
|
|
<div class="control__container" :class="[isCollpase ? 'open': 'closed']"> |
|
|
|
|
|
<n-icon class="control__close" size="20" color="#fff" @click="isCollpase = true"> |
|
|
|
|
|
|
|
|
<div v-if="getMode.includes('camera')" class="control__container camera__panel" :class="[cameraShow ? 'open': 'closed']"> |
|
|
|
|
|
<n-icon class="control__close" size="20" color="#fff" @click="cameraShow = true"> |
|
|
<DoubleLeftOutlined /> |
|
|
<DoubleLeftOutlined /> |
|
|
</n-icon> |
|
|
</n-icon> |
|
|
<n-icon class="control__open" size="20" color="#fff" @click="isCollpase = false"> |
|
|
|
|
|
|
|
|
<n-icon class="control__open" size="20" color="#fff" @click="cameraShow = false"> |
|
|
<DoubleRightOutlined /> |
|
|
<DoubleRightOutlined /> |
|
|
</n-icon> |
|
|
</n-icon> |
|
|
<div class="crcle__panel"> |
|
|
<div class="crcle__panel"> |
|
|
<div class="pannel__item item-1" /> |
|
|
|
|
|
<div class="pannel__item item-2" /> |
|
|
|
|
|
<div class="pannel__item item-3" /> |
|
|
|
|
|
<div class="pannel__item item-4" /> |
|
|
|
|
|
|
|
|
<div class="pannel__item item-1" @click="handleClick(1)" /> |
|
|
|
|
|
<div class="pannel__item item-2" @click="handleClick(2)" /> |
|
|
|
|
|
<div class="pannel__item item-3" @click="handleClick(3)" /> |
|
|
|
|
|
<div class="pannel__item item-4" @click="handleClick(4)" /> |
|
|
<n-icon class="top" size="24" color="#fff"> |
|
|
<n-icon class="top" size="24" color="#fff"> |
|
|
<CaretUpFilled /> |
|
|
<CaretUpFilled /> |
|
|
</n-icon> |
|
|
</n-icon> |
|
|
|
|
|
|
|
|
<LineOutlined /> |
|
|
<LineOutlined /> |
|
|
</n-icon> |
|
|
</n-icon> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
<div class="panel__title">云台控制</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<div v-if="getMode.includes('locus')" class="control__container locus__panel" :class="[locusShow ? 'open': 'closed']"> |
|
|
|
|
|
<n-icon class="control__close" size="20" color="#fff" @click="locusShow = true"> |
|
|
|
|
|
<DoubleLeftOutlined /> |
|
|
|
|
|
</n-icon> |
|
|
|
|
|
<n-icon class="control__open" size="20" color="#fff" @click="locusShow = false"> |
|
|
|
|
|
<DoubleRightOutlined /> |
|
|
|
|
|
</n-icon> |
|
|
|
|
|
<div class="crcle__panel"> |
|
|
|
|
|
<div class="pannel__item item-1" /> |
|
|
|
|
|
<div class="pannel__item item-2" /> |
|
|
|
|
|
<div class="pannel__item item-3" /> |
|
|
|
|
|
<div class="pannel__item item-4" /> |
|
|
|
|
|
<n-icon class="top" size="24" color="#fff"> |
|
|
|
|
|
<UpOutlined /> |
|
|
|
|
|
</n-icon> |
|
|
|
|
|
<n-icon class="right" size="24" color="#fff"> |
|
|
|
|
|
<RedoOutlined /> |
|
|
|
|
|
</n-icon> |
|
|
|
|
|
<n-icon class="bottom" size="24" color="#fff"> |
|
|
|
|
|
<DownOutlined /> |
|
|
|
|
|
</n-icon> |
|
|
|
|
|
<n-icon class="left" size="24" color="#fff"> |
|
|
|
|
|
<UndoOutlined /> |
|
|
|
|
|
</n-icon> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="crcle__panel"> |
|
|
|
|
|
<div class="pannel__item item-1" /> |
|
|
|
|
|
<div class="pannel__item item-2" /> |
|
|
|
|
|
<div class="pannel__item item-3" /> |
|
|
|
|
|
<div class="pannel__item item-4" /> |
|
|
|
|
|
<n-icon class="top" size="24" color="#fff"> |
|
|
|
|
|
<UpOutlined /> |
|
|
|
|
|
</n-icon> |
|
|
|
|
|
<n-icon class="right" size="24" color="#fff"> |
|
|
|
|
|
<RightOutlined /> |
|
|
|
|
|
</n-icon> |
|
|
|
|
|
<n-icon class="bottom" size="24" color="#fff"> |
|
|
|
|
|
<DownOutlined /> |
|
|
|
|
|
</n-icon> |
|
|
|
|
|
<n-icon class="left" size="24" color="#fff"> |
|
|
|
|
|
<LeftOutlined /> |
|
|
|
|
|
</n-icon> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="config__panel"> |
|
|
|
|
|
<div v-for="(item,index) in configList" :key="index" class="config__item"> |
|
|
|
|
|
<span>{{ item.label }}</span> |
|
|
|
|
|
<n-input-number v-model:value="config[item.key]" :show-button="false" /> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="panel__title">飞行控制</div> |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CaretDownFilled, |
|
|
CaretDownFilled, |
|
|
CaretLeftFilled, |
|
|
CaretLeftFilled, |
|
|
PlusOutlined, |
|
|
PlusOutlined, |
|
|
LineOutlined |
|
|
|
|
|
|
|
|
LineOutlined, |
|
|
|
|
|
UpOutlined, |
|
|
|
|
|
RightOutlined, |
|
|
|
|
|
DownOutlined, |
|
|
|
|
|
LeftOutlined, |
|
|
|
|
|
RedoOutlined, |
|
|
|
|
|
UndoOutlined |
|
|
} from '@vicons/antd' |
|
|
} from '@vicons/antd' |
|
|
import { defineComponent, reactive, toRefs } from 'vue' |
|
|
|
|
|
|
|
|
import { defineComponent, reactive, toRefs, computed } from 'vue' |
|
|
|
|
|
import { isArray } from '@/utils/is.js' |
|
|
export default defineComponent({ |
|
|
export default defineComponent({ |
|
|
name: 'ControlPanel', |
|
|
name: 'ControlPanel', |
|
|
components: { DoubleLeftOutlined, DoubleRightOutlined, CaretUpFilled, CaretRightFilled, CaretDownFilled, CaretLeftFilled, PlusOutlined, LineOutlined }, |
|
|
|
|
|
|
|
|
components: { DoubleLeftOutlined, DoubleRightOutlined, CaretUpFilled, CaretRightFilled, CaretDownFilled, CaretLeftFilled, PlusOutlined, LineOutlined, UpOutlined, RightOutlined, DownOutlined, LeftOutlined, RedoOutlined, UndoOutlined }, |
|
|
props: { |
|
|
props: { |
|
|
mode: { |
|
|
mode: { |
|
|
type: [Array, String], |
|
|
type: [Array, String], |
|
|
default: () => ['camera', 'locus'] |
|
|
default: () => ['camera', 'locus'] |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
setup() { |
|
|
|
|
|
|
|
|
setup(props, { emit }) { |
|
|
const camera = reactive({ |
|
|
const camera = reactive({ |
|
|
isCollpase: false |
|
|
|
|
|
|
|
|
cameraShow: true, |
|
|
|
|
|
locusShow: true, |
|
|
|
|
|
config: { |
|
|
|
|
|
up: 100, |
|
|
|
|
|
down: 20, |
|
|
|
|
|
move: 180, |
|
|
|
|
|
redo: 65 |
|
|
|
|
|
}, |
|
|
|
|
|
configList: [ |
|
|
|
|
|
{ label: '上升', key: 'up' }, |
|
|
|
|
|
{ label: '下降', key: 'down' }, |
|
|
|
|
|
{ label: '平移', key: 'move' }, |
|
|
|
|
|
{ label: '自旋', key: 'redo' } |
|
|
|
|
|
] |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
const getMode = computed(() => { |
|
|
|
|
|
return isArray(props.mode) ? props.mode : [props.mode] |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
const handleClick = (num) => { |
|
|
|
|
|
console.log(num) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
return { |
|
|
return { |
|
|
...toRefs(camera) |
|
|
|
|
|
|
|
|
...toRefs(camera), |
|
|
|
|
|
getMode, |
|
|
|
|
|
handleClick |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
.control__container{ |
|
|
.control__container{ |
|
|
position: relative; |
|
|
position: relative; |
|
|
z-index: 99; |
|
|
z-index: 99; |
|
|
width: 300px; |
|
|
|
|
|
height: 220px; |
|
|
height: 220px; |
|
|
background: rgba(0, 0, 0, 1); |
|
|
background: rgba(0, 0, 0, 1); |
|
|
padding: 10px; |
|
|
|
|
|
|
|
|
padding: 10px 15px 10px 10px; |
|
|
display: flex; |
|
|
display: flex; |
|
|
align-items: center; |
|
|
align-items: center; |
|
|
justify-content: space-around; |
|
|
justify-content: space-around; |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
@for $i from 1 through 4{ |
|
|
@for $i from 1 through 4{ |
|
|
.item-#{$i}{ |
|
|
.item-#{$i}{ |
|
|
|
|
|
cursor: pointer; |
|
|
transform: rotate(90deg * ($i) - 45deg); |
|
|
transform: rotate(90deg * ($i) - 45deg); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
&.open{ |
|
|
&.open{ |
|
|
transition: width 1s; |
|
|
transition: width 1s; |
|
|
.control__close{ |
|
|
|
|
|
|
|
|
.control__close,.panel__title{ |
|
|
display: none; |
|
|
display: none; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
&.closed{ |
|
|
&.closed{ |
|
|
width: 70px; |
|
|
width: 70px; |
|
|
transition: width 1s; |
|
|
transition: width 1s; |
|
|
.square__panel,.crcle__panel,.control__open{ |
|
|
|
|
|
|
|
|
.square__panel,.crcle__panel,.control__open,.config__panel{ |
|
|
display: none; |
|
|
display: none; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
.panel__title{ |
|
|
|
|
|
width: 16px; |
|
|
|
|
|
color: rgba(255, 255, 255, 1); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
.camera__panel{ |
|
|
|
|
|
width: 300px; |
|
|
|
|
|
} |
|
|
|
|
|
.locus__panel{ |
|
|
|
|
|
width: 600px; |
|
|
|
|
|
} |
|
|
|
|
|
.config__panel{ |
|
|
|
|
|
height: 160px; |
|
|
|
|
|
display: flex; |
|
|
|
|
|
flex-direction: column; |
|
|
|
|
|
justify-content: space-between; |
|
|
|
|
|
.config__item{ |
|
|
|
|
|
display: flex; |
|
|
|
|
|
align-items: center; |
|
|
|
|
|
span{ |
|
|
|
|
|
margin-right: 10px; |
|
|
|
|
|
color: rgba(255, 255, 255, 1); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
.n-input-number{ |
|
|
|
|
|
width: 100px; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.n-icon{ |
|
|
.n-icon{ |