IonicIndex.vue
4.3 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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<template>
<div class="bg-color" style="height:100%;">
<el-container>
<div class="aside-body">
<el-aside width="120PX">
<div class="aside">
<div class="homeImg" @click="toHome" :class="{curActive: 'home'==isShaw}">
<img class="home-size" src="../assets/img/home.png" alt="">
</div>
<div style="widht:120px;height:15px;background:#242424;"></div>
<div style="margin-top:15px;">
<div class="aside-menu"
:class="{curActive:v.id==isShaw}"
v-for="(v,i) in asideList"
:key ="i"
draggable="true"
@dragstart="start(v,i)"
@dragover="over($event)"
@drop="drop(i)"
@click="toMenu(v,i)">
<img class="aside-img" :src="v.imgURL" alt="">
<div class="aside-text">{{changeMenu(v.id)}}</div>
</div>
</div>
</div>
</el-aside>
</div>
<el-container>
<el-header>
<Header ref="header" @logoOut ="signOut"> </Header>
</el-header>
<el-main>
<router-view/>
</el-main>
</el-container>
</el-container>
</div>
</template>
<script>
import Header from '@/components/IonicsoilHeader'
export default {
name: 'Index',
data() {
return {
index:false,
htmlHeight:'',
asideList:[
{id:'test',path:'/IonicTest',imgURL:require('../assets/img/test.png'),name:'KANBAN'},
{id:'system',path:'/IonicSystem',imgURL:require('../assets/img/system.png'),name:'KANBAN'},
{id:'help',path:'/IonicHelp',imgURL:require('../assets/img/help.png'),name:'KANBAN'},
// {id:'rinse',path:'/IonicRinse',imgURL:require('../../assets/img/help.png'),name:'KANBAN'},
]
}
},
components: {
Header
},
computed:{
changeMenu(){
return function(id){
return this.$t('IonicHome["'+id+'"]');
}
},
isShaw(){
return this.$store.state.menuPath;
},
isShow(){
return this.$store.state.asideFlag
}
},
created(){
},
methods:{
toHome(){
localStorage.setItem("asideId",'home');
this.$store.dispatch("changePath")
this.$router.push('/IonicHome');
},
start(item,index){
this.currMoveItem = item; // 当前移动元素
this.currMoveIndex = index; // 当前移动数组下标
console.log('开始移动',item,index);
},
over(ev){
ev.preventDefault();
},
drop(index){
console.log('放下',index);
if(index == this.currMoveIndex) return false; // 不是原地移动
console.log('从'+this.currMoveIndex+'移动到'+index);
this.asideList.splice(this.currMoveIndex,1); // 删除元素之前所在位置
this.asideList.splice(index,0,this.currMoveItem); // 在需要放下元素的位置前插入移动元素
// 下面有无都无所谓
this.currMoveIndex = false;
this.currMoveItem = false;
},
toMenu(v,i){
localStorage.setItem("asideId",v.id);
this.$store.dispatch("changePath")
// this.index = i;
if(v.id=='tmviewer'){
location.href="teamviewer8://remotecontrol";
}else{
// this.$router.push('/Kanban');
this.$router.push(v.path);
}
},
signOut(){
// this.$router.push('/Kanban')
this.$infoBox(this.$t('backTips.content'), {
status: 'default',
title: this.$t('backTips.title'),
confirmTitle: this.$t('backTips.confirm'),
cancelTitle: this.$t('backTips.cancel'),
confirm: () => { this.$router.push('/Login') },
cancel: () => { this.asidebox; }
});
}
},
mounted() {
}
}
</script>
<style lang="less">
@import url('../styles/ionicindex.less');
.el-main{
padding: 0 !important;
background-color: #242424;
}
.el-header {
min-width: 450px;
background-color: transparent;
color: #333;
text-align: center;
height: 85px !important;
}
.curActive{
background-color: #323333 !important;
}
.bg-color{
height: 100%;
background-color:#232423 !important;
}
</style>