<template>
  <PageContainer :pageHeaderRender="false" style="padding: 0 10px 0 10px">
    <TableComponents :type="data.tab" />
  </PageContainer>
</template>

<script lang="ts" setup>
  import { useAlarmStore } from '@jdlinker/func';
  import { storeToRefs } from 'pinia';
  import { queryLevel } from '../../../../api/rule-engine/config';
  import store from 'storejs';
  import TableComponents from './TabComponent/index.vue';
  import { PageContainer } from 'linker-ui-components';

  const alarmStore = useAlarmStore();
  const { data } = storeToRefs(alarmStore);
  const getDefaulitLevel = () => {
    queryLevel().then((res) => {
      if (res.code === 200) {
        store.set('default-level', res.result?.levels || []);
        data.value.defaultLevel = res.result?.levels || [];
      }
    });
  };
  getDefaulitLevel();
  const onTabChange = (key: string) => {
    data.value.tab = key;
  };
</script>
<style lang="less" scoped>
  :deep(.jtable-body-spin .jtable-body .jtable-content) {
    padding: 24px 0;
  }
  :deep(.card .card-warp .card-content) {
    padding: 30px 12px 10px 30px;
  }
</style>
