<template>
    <div class="pd10">
        <el-row>
            <el-col>
                <el-tabs v-model.trim="activeName" @tab-click="handleClick" type="border-card">
                    <el-tab-pane label="告警统计" name="first" :style="'height:' + vh + ';'">
                        <AlarmStatistics v-if="activeName == 'first'"></AlarmStatistics>
                    </el-tab-pane>
                    <el-tab-pane label="告警明细查看" name="second" :style="'height:' + vh + ';'">
                        <Alarmdetails v-if="activeName == 'second'"></Alarmdetails>
                    </el-tab-pane>
                </el-tabs>
            </el-col>
        </el-row>
    </div>
</template>
<script>
import AlarmStatistics from './components/IndicatorAlarmStatistics/AlarmStatistics.vue'
import Alarmdetails from './components/IndicatorAlarmStatistics/Alarmdetails.vue'
export default {
    name: 'pwzbgjtj',
    components: { AlarmStatistics, Alarmdetails },
    data() {
        return {
            vh: '',
            activeName: 'first',
            device: ''
        }
    },
    created() {},
    mounted() {
        this.setHeight()
        window.addEventListener('resize', this.setHeight)
    },
    beforeDestroy() {
        window.removeEventListener('resize', this.setHeight)
    },
    methods: {
        setHeight() {
            this.vh = window.sessionStorage.getItem('appheight') - 80 + 'px'
        },

        handleClick(tab, event) {
            // console.log(tab, event);
        }
    }
}
</script>
<style lang="less" scoped>
@import url('../../styles/comStyle.less');
::v-deep .el-table .cell {
    text-align: center;
}
::v-deep .el-tabs--border-card > .el-tabs__content {
    padding: 10px;
}
.block {
    position: absolute;
    right: 10px;
    bottom: 10px;
}
::v-deep .el-form-item--small .el-form-item__content,
.el-form-item--small .el-form-item__label {
    height: 32px;
}
</style>
