index.vue 1.62 KB
<script lang="ts" setup>
  import { Tabs } from 'ant-design-vue';
  import { ref } from 'vue';
  import { EdgeMonitoring } from '../EdgeMonitoring';
  import { EdgeEvents } from '../EdgeEvents';
  import { EdgeDevice } from '../EdgeDevice';
  import { EdgeInstanceItemType } from '/@/api/edgeManage/model/edgeInstance';
  import type { PropType } from 'vue';

  defineProps({
    recordData: {
      type: Object as PropType<EdgeInstanceItemType>,
      default: () => {},
    },
  });

  enum ActiveKey {
    EDGE_DEVICE = 'EdgeDevice',
    EDGEMONITORING = 'EdgeMonitoring',
    EDGEEVENTS = 'EdgeEvents',
  }

  const activeKey = ref(ActiveKey.EDGE_DEVICE);
</script>

<template>
  <section class="w-full h-full p-1">
    <main>
      <Tabs
        v-model:activeKey="activeKey"
        type="card"
        class="w-full h-full bg-light-50 !p-4 dark:bg-dark-900"
      >
        <Tabs.TabPane tab="边缘设备" :key="ActiveKey.EDGE_DEVICE">
          <EdgeDevice
            v-if="recordData"
            :recordData="recordData"
            class="p-4 bg-neutral-100 dark:bg-dark-700"
          />
        </Tabs.TabPane>
        <Tabs.TabPane tab="边缘监控" :key="ActiveKey.EDGEMONITORING">
          <EdgeMonitoring
            v-if="recordData"
            :recordData="recordData"
            class="p-4 bg-fff dark:bg-dark-700"
          />
        </Tabs.TabPane>
        <Tabs.TabPane tab="边缘事件" :key="ActiveKey.EDGEEVENTS">
          <EdgeEvents :recordData="recordData" class="p-4 bg-neutral-100 dark:bg-dark-700" />
        </Tabs.TabPane>
      </Tabs>
    </main>
  </section>
</template>

<style lang="less" scoped></style>