<template>
    <!-- 设备设施的三级路由的tabs -->
    <div class='dialog-container'>
        <el-dialog :title='`${systemName}-${dialogInfo.label}`' :visible.sync='visible' :fullscreen='true'>
            <div class='top'></div>
            <div v-if='Object.keys(dialogInfo).length>0 && dialogInfo.id.slice(2,4)=="YL"' style='width:100%;height:600px;overflow:hidden'>
                <rotation :rotationImg='rotationImg'></rotation>
            </div>
            <tj-table v-else-if='Object.keys(dialogInfo).length>0 && dialogInfo.id.slice(0,4)=="TJQD"' major='土建'></tj-table>
            <GDQDTable v-else-if='Object.keys(dialogInfo).length>0 && dialogInfo.id.slice(0,4)=="GDQD"' major></GDQDTable>
            <look-page v-else-if='Object.keys(dialogInfo).length>0 && dialogInfo.id.slice(2,4)=="TZ"' param major></look-page>
            <div v-else>
                <el-tabs v-model='activeName' @tab-click='handleClick' v-if='Object.keys(dialogInfo).length>0 && dialogInfo.children.length>0'>
                    <el-tab-pane
                        v-for='(value,index) in dialogInfo.children'
                        :key='"u"+index'
                        :label='`${value.label}`'
                        :name='`${value.param.CLASSSTRUCTUREID}`'
                    >
                        <div v-if='value.id.slice(2,4)=="YL"' style='width:100%;height:600px;overflow:hidden'>
                            <rotation :rotationImg='rotationImg'></rotation>
                        </div>
                        <tableList v-else-if='value.id.slice(0,4)=="RDQD"' ref='list' :param='param' major='弱电'></tableList>
                        <tableList v-else-if='value.id.slice(0,4)=="NTQD"' ref='list' :param='param' major='暖通'></tableList>
                        <wb-table v-else-if='value.id.slice(2,4)=="WX"' param major='维修'></wb-table>
                        <zw-table v-else-if='value.id.slice(2,4)=="ZW"' param major='专维'></zw-table>
                        <wb-table v-else-if='value.id.slice(2,4)=="WB"' param major='维保'></wb-table>
                    </el-tab-pane>
                </el-tabs>
            </div>
        </el-dialog>
    </div>
</template>
<script>
import tableList from './table/eqListTable'
import tjTable from './table/tjTable'
import wbTable from './table/wbTable'
import zwTable from './table/zwTable'
import lookPage from './table/lookPageTable'
import GDQDTable from './table/GDQDTable'
export default {
    props: ['systemName'],
    data() {
        return {
            activeName: '',
            visible: false,
            dialogInfo: {},
            param: '',
            rotationImg: [require('@/assets/imgs/eq.jpg'), require('@/assets/imgs/survey_pop2.png'), require('@/assets/imgs/survey_pop1.png')]
        }
    },
    mounted() {},
    components: { tableList, tjTable, wbTable, zwTable, lookPage, GDQDTable },
    methods: {
        showModal(item) {
            this.visible = true
            this.dialogInfo = item
            if (Object.keys(this.dialogInfo).length > 0 && this.dialogInfo.children.length > 0) {
                this.activeName = this.dialogInfo.children[0].param.CLASSSTRUCTUREID
            }
        },
        handleClick(tab) {
            this.param = tab.name
            console.log(tab)
        }
    }
}
</script>
<style lang="less" scoped>
.top {
    width: 1366px;
    height: 1px;
    background: rgba(0, 0, 0, 0.06);
    margin-bottom: 20px;
}
</style>
<style lang="less">
.dialog-container {
    .el-dialog__header {
        padding: 16px 24px;
    }
    .el-dialog__title {
        font-size: 16px;
        font-family: PingFangSC-Medium, PingFang SC;
        font-weight: 500;
        color: rgba(0, 0, 0, 0.85);
        line-height: 24px;
    }
    .el-dialog__body {
        padding: 0 24px;
        height: 90%;
    }
    .el-tabs--bottom .el-tabs__item.is-bottom:nth-child(2),
    .el-tabs--bottom .el-tabs__item.is-top:nth-child(2),
    .el-tabs--top .el-tabs__item.is-bottom:nth-child(2),
    .el-tabs--top .el-tabs__item.is-top:nth-child(2) {
        padding-left: 16px;
    }
    .el-tabs--bottom .el-tabs__item.is-bottom:last-child,
    .el-tabs--bottom .el-tabs__item.is-top:last-child,
    .el-tabs--top .el-tabs__item.is-bottom:last-child,
    .el-tabs--top .el-tabs__item.is-top:last-child {
        padding-right: 16px;
    }
    .el-tabs__nav-wrap::after {
        height: 0;
    }
    .el-tabs__item {
        padding: 5px 16px;
        height: 30px;
        line-height: 22px;
        font-size: 14px;
        font-family: MicrosoftYaHei;
        color: rgba(31, 36, 41, 1);
        border: 1px solid rgba(195, 199, 203, 1);
    }
    .el-tabs,
    .el-tabs__content {
        height: 94%;
    }
    .el-tabs__active-bar {
        background-color: transparent !important;
    }
    .is-active {
        color: #025baa;
        border-color: #025baa;
    }
}
</style>