dataasis.vue
3.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<template>
<div class="analysis-wrapper dataasis-wrapper">
<el-container>
<!-- <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> -->
<el-container>
<router-view></router-view>
</el-container>
</el-container>
</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);
}
},
refreshSelect(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>
.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;
}
@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;
}
}
</style>