controller.vue 966 Bytes
<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>