<template>
    <div class='system-floor'>
        <van-nav-bar :title='title' left-arrow @click-left='backPage' />
        <!-- 楼层平面图列表 页面组件 -->
        <FloorFunc v-if='!fbt' class='system-floor-func' />
        <!-- 分支图 -->
        <LegendList v-else :floorsArr='fbtArr' class='system-floor-func' />
    </div>
</template>
<script>
/**
 * 设备设施中的平面图, xx系统-楼层分布
 */
import Vue from 'vue'
import { NavBar, List } from 'vant'
Vue.use(NavBar).use(List)
import FloorFunc from '@/views/FloorFunc'
import LegendList from '@/views/legendList'
export default {
    name: 'SyetemFloor',
    props: {},
    components: { FloorFunc, LegendList },
    data() {
        return {
            title: '供电系统-楼层分布',
            fbt: false,
            fbtArr: [],
        }
    },
    created() {
        const { title, fbt, fbtArr } = this.$route.query
        // 分布图使用
        this.fbt = fbt || false
        this.fbtArr = fbtArr ? JSON.parse(fbtArr) : []
        this.title = title
    },
    beforeMount() {},
    mounted() {},
    methods: {
        backPage() {
            this.$router.go(-1)
        },
    },
}
</script>
<style lang='less' scoped>
.system-floor {
    width: 100%;
    height: calc(100% - 45px);
    background-color: #aaa;
    .system-floor-func {
        width: 100%;
        height: calc(100% - 45px);
    }
    // 返回箭头修改
    /deep/ .van-nav-bar .van-icon {
        color: #000;
    }
}
</style>