controller.vue
966 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<template>
<div class="controller-container">
<van-action-bar>
<van-action-bar-icon icon="video-o" text="场景" @click="onClickIcon('scene')" />
<van-action-bar-icon v-if="props.ptzEnable" icon="aim" text="云台" @click="onClickIcon('ptz')" />
<van-action-bar-button type="danger" color="#387CF5" style="height: 44px" text="截图巡检" @click="onClickButton" />
</van-action-bar>
</div>
</template>
<script setup>
const props = defineProps(['ptzEnable'])
const emit = defineEmits(['screenshot'])
function onClickIcon(type) {
console.log('onClickIcon', type)
if (type === 'scene') {
emit('showMonitor')
} else {
emit('showPTZ')
}
}
function onClickButton() {
console.log('onClickButton')
emit('screenshot')
}
</script>
<style lang="less">
.controller-container {
.van-action-bar-icon {
width: 60px;
.van-icon {
font-size: 32px;
}
}
.van-button {
border-radius: 16px;
}
}
</style>