<template>
    <div class="default-main">
        <el-tabs v-model="activeName" type="border-card">
            <el-tab-pane label="总览" name="1" v-if="tabList.includes('1')">
                <overview v-if="activeName == '1'" @algorithm="algorithm" />
            </el-tab-pane>
            <el-tab-pane label="算法库" name="2" v-if="tabList.includes('2')">
                <list v-if="activeName == '2'" ref="listRef" />
            </el-tab-pane>
        </el-tabs>
    </div>
</template>

<script setup lang="ts">
import { nextTick, ref, provide, onMounted } from 'vue'
import { mainHeight } from '@/utils/layout'
import overview from './overview.vue'
import list from './list.vue'
import { useRoute } from 'vue-router'
const VITE_FLAG = import.meta.env.VITE_NAME == 'jibei'
const route = useRoute()
const Undocumented = ref()
const InterferenceUserTable = ref()
defineOptions({
    name: 'supervision/interferencemanagement  '
})
const activeName = ref('1')
const id = ref('')
const key = ref('')
const listRef = ref()
const tabList = ref(['1', '2'])
onMounted(() => {
    let key = window.location.href.split('?')[0].slice(-1)
    const isNumber = /^\d$/.test(key)
    if (isNumber) {
        tabList.value = [key]
        activeName.value = key
    }
})
const algorithm = (val: any) => {
    activeName.value = '2'
    setTimeout(() => {
        listRef.value.getList(val)
    }, 100)
}
const layout = mainHeight(63) as any
</script>

<style lang="scss" scoped>
.bars_w {
    width: 100%;
    height: 500px;
}

:deep(.el-tabs__content) {
    height: v-bind('layout.height');
    overflow-y: auto;
}
</style>
