<template>
    <div class="default-main">
        <el-tabs v-model="activeName" type="border-card">
            <el-tab-pane  :label="VITE_FLAG ? '在线监测评估' : '在线监测问题'"   name="1" v-if="tabList.includes('1')">
                <online v-if="activeName == '1'" />
            </el-tab-pane>
            <el-tab-pane label="用户投诉问题" name="2" v-if="tabList.includes('2')">
                <complaints v-if="activeName == '2'" />
            </el-tab-pane>
            <el-tab-pane :label="VITE_FLAG ? '现场测试' : '计划实施问题'"  name="3" v-if="tabList.includes('3')">
                <testQuestions v-if="activeName == '3'" />
            </el-tab-pane>
            <el-tab-pane label="试运行评估问题" name="4" v-if="tabList.includes('4')">
                <testRun v-if="activeName == '4'" />
            </el-tab-pane>
            <!-- <el-tabs v-model="activeName" type="border-card">
            <el-tab-pane label="电能质量问题查询维护" name="1">
                <maintenance />
            </el-tab-pane>
            <el-tab-pane label="电能质量问题审核" name="2">
                <audit />
            </el-tab-pane> -->
        </el-tabs>
    </div>
</template>

<script setup lang="ts">
import { onMounted, reactive, ref, provide } from 'vue'
import online from './components1/online.vue'
import complaints from './components1/complaints.vue'
import testQuestions from './components1/testQuestions.vue'
import testRun from './components1/testRun.vue'
const VITE_FLAG = import.meta.env.VITE_NAME == 'jibei'
// import maintenance from './components/maintenance.vue'
// import audit from './components/audit.vue'

import { mainHeight } from '@/utils/layout'
defineOptions({
    name: 'supervision/electricitymanagement1'
})
const tabList = ref(['1', '2', '3', '4'])
const activeName = ref('1')
onMounted(() => {
    let key = window.location.href.split('?')[0].slice(-1)
    const isNumber = /^\d$/.test(key)
    if (isNumber) {
        tabList.value = [key]
        activeName.value = key
    }
})
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>
