dataasis.vue 4.04 KB
<template>
    <div class="analysis-wrapper dataasis-wrapper">
        <!-- <el-aside width="200px" height="100%">
            <el-menu
                class="aside-menu-wrapper"
                :default-active="activeIndex"
                background-color="#414755"
                text-color="#fff"
                @select="menuSelect">
                <el-menu-item :index="item.path" v-for="item in analysisMenu" :key="item.path" v-if="permissControl(item.path)">
                    <i :class="item.iconClass"></i>
                    <span slot="title">{{i18n(item.name)}}</span>
                </el-menu-item>
            </el-menu>
        </el-aside> -->
        <router-view></router-view>
    </div>
</template>

<script>
export default {
    data() {
        return {
            activeIndex: '',
            moreOptVisible: false,
            analysisMenu: [
            ],
            asisChidren:[],
            menuObj: {},
            menuArr: [],
        }
    },
    components: {},
    methods: {
        i18n(name){
			let languageLable = 'asis.' + name
			return this.$t(languageLable)
        },
        permissControl(path) {
            if(window._vionConfig.allMenu){
				return true
            }
            if(this.menuObj.hasOwnProperty(path)){
                return true
            }else{
                return false
            }
        },
        menuSelect(key, path) {
            // if((window.location.href.split('/')).indexOf(key) === -1) {
            //     this.$router.push('/dataasis/' + path);
            // }
            this.navigateTo(this,'dataasis',key);
        },
        refreshSelect(path){
              this.navigateTo(this,'dataasis',path);
              //this.$router.push('/dataasis/' + path);
        },
        refresh(){
            let name = this.$router.history.current.name;
            let path = this.$router.history.current.path;
            let newPath = path.split('/')[2];
            let obj = {
            };
            if(obj.hasOwnProperty(newPath)){
                this.activeIndex = obj[newPath]
                this.refreshSelect(obj[newPath])
            }
        },
    },
    created() {
        if(!window._vionConfig.allMenu){
            this.menuArr = JSON.parse(window.localStorage.getItem('menu'))
        }
    },
    mounted() {
        let firstPath,name;
        if(window._vionConfig.allMenu){
            firstPath = 'trafficasis'
        }else{
            // this.menuArr.forEach((item,index) => {
            //     if(item.label == 'analysis'){
            //         item.children.forEach((child,index) => {
            //                 this.menuObj[child.label] = child.label
            //         })
            //     }
            // })
            // firstPath = Object.values(this.menuObj)[0]
            firstPath = 'trafficasis'
        }
        name = this.$router.history.current.name;
        if(!name){
            this.activeIndex = firstPath;
            this.menuSelect(firstPath, [firstPath]);
        }else{
            this.refresh()
        }

    }
}
</script>
<style>
    .dataasis-wrapper {
        width: 100%;
        height: 100%;
        position: fixed;
        top: 0;
        left: 0;
        box-sizing: border-box;
        padding: 0 10px;
        overflow: auto;
    }
    .test-opt-time .time-opt .el-input__inner {
        height: 100% !important;
    }

    .weatherasis-icon {
        font-size: 12px !important;
    }
    .dataasis-wrapper .el-header,
    .dataasis-wrapper .analysis-option-wrapper,
    .dataasis-wrapper .element-main{
        /* margin-left: calc(165px) !important; */
        /* width: calc(100vw - 330px) !important; */
        width: 100% !important;
        margin-left: 0 !important;
    }
    @media (max-width: 1440px) {
        .dataasis-wrapper .el-header,
        .dataasis-wrapper .analysis-option-wrapper,
        .dataasis-wrapper .element-main{
            /* margin-left: calc(60px) !important;
            width: calc(100vw - 120px) !important; */
            width: 100% !important;
            margin-left: 0 !important;
        }
    }
</style>