<template>
  <div class="nine-square-grid">
    <div class="leftSideBar">
      <!-- 保卫保密重点监控区域type用9 -->
      <CameraGroupListAndTree mode="default" :type="9" />
    </div>

    <div class="toolbarAndCamerasGrid">
      <VideosGridBase :cameraInPlay="cameraInPlay" />
    </div>
  </div>
</template>

<script setup lang="ts">
  import { onMounted } from 'vue';
  import { storeToRefs } from 'pinia';
  import CameraGroupListAndTree from '@/components/CameraGroupListAndTree/CameraGroupListAndTree.vue';
  import VideosGridBase from '@/components/VideosGridBase/VideosGridBase.vue';
  import { useCameraGroupList } from '@/store/modules/useCameraGroupList';
  import { useTargetTenantIdStore } from '@/store/modules/useTargetTenantIdStore';
  import { useCameraStatus } from '@/hooks/useCameraStatus';

  const { cameraInPlay } = storeToRefs(useCameraGroupList());

  const { clear } = useTargetTenantIdStore();
  useCameraStatus();

  onMounted(() => {
    clear();
  });
</script>

<style lang="scss" scoped>
  .nine-square-grid {
    height: 100%;
    padding: 14px 10px;
    display: flex;
    border-radius: 4px;
    background: #fff;

    .leftSideBar {
      height: 100%;
    }

    .toolbarAndCamerasGrid {
      width: 100%;
    }
  }
</style>
