cloud-web-corejs 1.0.15 → 1.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/layout/defaultLayout.vue +150 -0
- package/src/layout/index.vue +4 -138
package/package.json
CHANGED
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="app-wrapper openSidebar">
|
|
3
|
+
<sidebar class="sidebar-container" :class="{ hoverold: hoverSidebar }" @selfClose="hoverSidebar = false"
|
|
4
|
+
@selfEnter="hoverSidebar = true"/>
|
|
5
|
+
<div class="main-container">
|
|
6
|
+
<div class="fixed-header">
|
|
7
|
+
<tags-view v-if="needTagsView"/>
|
|
8
|
+
</div>
|
|
9
|
+
<app-main v-if="showAppMain" ref="appMain"/>
|
|
10
|
+
</div>
|
|
11
|
+
<modifyPasswordDialog ref="modifyPasswordDialog"></modifyPasswordDialog>
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script>
|
|
16
|
+
import {mapState} from 'vuex';
|
|
17
|
+
import modifyPasswordDialog from "@base/views/user/user/modifyPasswordDialog";
|
|
18
|
+
|
|
19
|
+
export default {
|
|
20
|
+
components: {
|
|
21
|
+
AppMain: () => import('./components/AppMain'),
|
|
22
|
+
Sidebar: () => import('./components/Sidebar'),
|
|
23
|
+
TagsView: () => import('./components/TagsView'),
|
|
24
|
+
modifyPasswordDialog
|
|
25
|
+
},
|
|
26
|
+
computed: {
|
|
27
|
+
...mapState({
|
|
28
|
+
sidebar: state => state.app.sidebar,
|
|
29
|
+
device: state => state.app.device,
|
|
30
|
+
showSettings: state => state.settings.showSettings,
|
|
31
|
+
needTagsView: state => state.settings.tagsView,
|
|
32
|
+
fixedHeader: state => state.settings.fixedHeader
|
|
33
|
+
}),
|
|
34
|
+
classObj() {
|
|
35
|
+
return {
|
|
36
|
+
hideSidebar: !this.sidebar.opened,
|
|
37
|
+
openSidebar: this.sidebar.opened,
|
|
38
|
+
withoutAnimation: this.sidebar.withoutAnimation,
|
|
39
|
+
mobile: this.device === 'mobile'
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
data() {
|
|
44
|
+
return {
|
|
45
|
+
hoverSidebar: false,
|
|
46
|
+
showAppMain: false,
|
|
47
|
+
showModifyPasswordDialog: true,
|
|
48
|
+
passwordStatus: 2
|
|
49
|
+
};
|
|
50
|
+
},
|
|
51
|
+
created() {
|
|
52
|
+
this.$http({
|
|
53
|
+
url: USER_PREFIX + `/auth/resetPrincipal`,
|
|
54
|
+
method: `post`,
|
|
55
|
+
data: {},
|
|
56
|
+
isLoading: true,
|
|
57
|
+
success: res => {
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
},
|
|
61
|
+
async mounted() {
|
|
62
|
+
if (sessionStorage.getItem('toHome') == '1') {
|
|
63
|
+
sessionStorage.removeItem('toHome');
|
|
64
|
+
await this.closeAllTags();
|
|
65
|
+
this.$nextTick(() => {
|
|
66
|
+
this.showAppMain = true;
|
|
67
|
+
});
|
|
68
|
+
} else {
|
|
69
|
+
this.showAppMain = true;
|
|
70
|
+
}
|
|
71
|
+
this.$refs.modifyPasswordDialog.init();//校验是否需要修改密码
|
|
72
|
+
},
|
|
73
|
+
methods: {
|
|
74
|
+
handleClickOutside() {
|
|
75
|
+
this.$store.dispatch('app/closeSideBar', {withoutAnimation: false});
|
|
76
|
+
},
|
|
77
|
+
async closeAllTags() {
|
|
78
|
+
return this.$store.dispatch('tagsView/delAllViews').then(({visitedViews}) => {
|
|
79
|
+
this.$router.replace({path: '/redirect/home'});
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
</script>
|
|
85
|
+
|
|
86
|
+
<style lang="scss" scoped>
|
|
87
|
+
@import '~@/styles/mixin.scss';
|
|
88
|
+
@import '~@/styles/variables.scss';
|
|
89
|
+
|
|
90
|
+
.app-wrapper {
|
|
91
|
+
@include clearfix;
|
|
92
|
+
position: relative;
|
|
93
|
+
height: 100%;
|
|
94
|
+
width: 100%;
|
|
95
|
+
|
|
96
|
+
&.mobile.openSidebar {
|
|
97
|
+
position: fixed;
|
|
98
|
+
top: 0;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.drawer-bg {
|
|
103
|
+
background: #000;
|
|
104
|
+
opacity: 0.3;
|
|
105
|
+
width: 100%;
|
|
106
|
+
top: 0;
|
|
107
|
+
height: 100%;
|
|
108
|
+
position: absolute;
|
|
109
|
+
z-index: 999;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.fixed-header {
|
|
113
|
+
position: fixed;
|
|
114
|
+
top: 0;
|
|
115
|
+
right: 10px;
|
|
116
|
+
z-index: 9;
|
|
117
|
+
width: calc(100% - #{$sideBarWidth} - 20px);
|
|
118
|
+
transition: width 0.28s;
|
|
119
|
+
height: 33px;
|
|
120
|
+
padding-top: 2px;
|
|
121
|
+
//box-shadow:0 2px 6px rgba(0,0,0,0.04);
|
|
122
|
+
//background:#FFF;
|
|
123
|
+
border-bottom: solid 2px $baseColor;
|
|
124
|
+
display: -moz-box;
|
|
125
|
+
display: -webkit-box;
|
|
126
|
+
display: box;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.hideSidebar .fixed-header {
|
|
130
|
+
width: calc(100% - 54px);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.mobile .fixed-header {
|
|
134
|
+
width: 100%;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.info-box {
|
|
138
|
+
text-align: right;
|
|
139
|
+
padding-right: 16px;
|
|
140
|
+
line-height: 50px;
|
|
141
|
+
margin-left: 18px;
|
|
142
|
+
cursor: pointer;
|
|
143
|
+
font-size: 12px;
|
|
144
|
+
}
|
|
145
|
+
</style>
|
|
146
|
+
<style>
|
|
147
|
+
.vxe-custom--body > li[title=' '] {
|
|
148
|
+
display: none;
|
|
149
|
+
}
|
|
150
|
+
</style>
|
package/src/layout/index.vue
CHANGED
|
@@ -1,151 +1,17 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
<sidebar class="sidebar-container" :class="{ hoverold: hoverSidebar }" @selfClose="hoverSidebar = false"
|
|
4
|
-
@selfEnter="hoverSidebar = true"/>
|
|
5
|
-
<div class="main-container">
|
|
6
|
-
<div class="fixed-header">
|
|
7
|
-
<tags-view v-if="needTagsView"/>
|
|
8
|
-
</div>
|
|
9
|
-
<app-main v-if="showAppMain" ref="appMain"/>
|
|
10
|
-
</div>
|
|
11
|
-
<modifyPasswordDialog ref="modifyPasswordDialog"></modifyPasswordDialog>
|
|
12
|
-
</div>
|
|
2
|
+
<defaultLayout></defaultLayout>
|
|
13
3
|
</template>
|
|
14
4
|
|
|
15
5
|
<script>
|
|
16
|
-
import
|
|
17
|
-
import modifyPasswordDialog from "@base/views/user/user/modifyPasswordDialog";
|
|
6
|
+
import defaultLayout from "@base/layout/defaultLayout.vue";
|
|
18
7
|
|
|
19
8
|
export default {
|
|
20
9
|
name: 'Layout',
|
|
21
10
|
components: {
|
|
22
|
-
|
|
23
|
-
Sidebar: () => import('./components/Sidebar'),
|
|
24
|
-
TagsView: () => import('./components/TagsView'),
|
|
25
|
-
modifyPasswordDialog
|
|
11
|
+
defaultLayout
|
|
26
12
|
},
|
|
27
|
-
computed: {
|
|
28
|
-
...mapState({
|
|
29
|
-
sidebar: state => state.app.sidebar,
|
|
30
|
-
device: state => state.app.device,
|
|
31
|
-
showSettings: state => state.settings.showSettings,
|
|
32
|
-
needTagsView: state => state.settings.tagsView,
|
|
33
|
-
fixedHeader: state => state.settings.fixedHeader
|
|
34
|
-
}),
|
|
35
|
-
classObj() {
|
|
36
|
-
return {
|
|
37
|
-
hideSidebar: !this.sidebar.opened,
|
|
38
|
-
openSidebar: this.sidebar.opened,
|
|
39
|
-
withoutAnimation: this.sidebar.withoutAnimation,
|
|
40
|
-
mobile: this.device === 'mobile'
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
data() {
|
|
45
|
-
return {
|
|
46
|
-
hoverSidebar: false,
|
|
47
|
-
showAppMain: false,
|
|
48
|
-
showModifyPasswordDialog: true,
|
|
49
|
-
passwordStatus: 2
|
|
50
|
-
};
|
|
51
|
-
},
|
|
52
|
-
created() {
|
|
53
|
-
this.$http({
|
|
54
|
-
url: USER_PREFIX + `/auth/resetPrincipal`,
|
|
55
|
-
method: `post`,
|
|
56
|
-
data: {},
|
|
57
|
-
isLoading: true,
|
|
58
|
-
success: res => {
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
},
|
|
62
|
-
async mounted() {
|
|
63
|
-
if (sessionStorage.getItem('toHome') == '1') {
|
|
64
|
-
sessionStorage.removeItem('toHome');
|
|
65
|
-
await this.closeAllTags();
|
|
66
|
-
this.$nextTick(() => {
|
|
67
|
-
this.showAppMain = true;
|
|
68
|
-
});
|
|
69
|
-
} else {
|
|
70
|
-
this.showAppMain = true;
|
|
71
|
-
}
|
|
72
|
-
this.$refs.modifyPasswordDialog.init();//校验是否需要修改密码
|
|
73
|
-
},
|
|
74
|
-
methods: {
|
|
75
|
-
handleClickOutside() {
|
|
76
|
-
this.$store.dispatch('app/closeSideBar', {withoutAnimation: false});
|
|
77
|
-
},
|
|
78
|
-
async closeAllTags() {
|
|
79
|
-
return this.$store.dispatch('tagsView/delAllViews').then(({visitedViews}) => {
|
|
80
|
-
this.$router.replace({path: '/redirect/home'});
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
13
|
};
|
|
85
14
|
</script>
|
|
86
|
-
|
|
87
15
|
<style lang="scss" scoped>
|
|
88
|
-
@import '~@/styles/mixin.scss';
|
|
89
|
-
@import '~@/styles/variables.scss';
|
|
90
|
-
|
|
91
|
-
.app-wrapper {
|
|
92
|
-
@include clearfix;
|
|
93
|
-
position: relative;
|
|
94
|
-
height: 100%;
|
|
95
|
-
width: 100%;
|
|
96
|
-
|
|
97
|
-
&.mobile.openSidebar {
|
|
98
|
-
position: fixed;
|
|
99
|
-
top: 0;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
.drawer-bg {
|
|
104
|
-
background: #000;
|
|
105
|
-
opacity: 0.3;
|
|
106
|
-
width: 100%;
|
|
107
|
-
top: 0;
|
|
108
|
-
height: 100%;
|
|
109
|
-
position: absolute;
|
|
110
|
-
z-index: 999;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
.fixed-header {
|
|
114
|
-
position: fixed;
|
|
115
|
-
top: 0;
|
|
116
|
-
right: 10px;
|
|
117
|
-
z-index: 9;
|
|
118
|
-
width: calc(100% - #{$sideBarWidth} - 20px);
|
|
119
|
-
transition: width 0.28s;
|
|
120
|
-
height: 33px;
|
|
121
|
-
padding-top: 2px;
|
|
122
|
-
//box-shadow:0 2px 6px rgba(0,0,0,0.04);
|
|
123
|
-
//background:#FFF;
|
|
124
|
-
border-bottom: solid 2px $baseColor;
|
|
125
|
-
display: -moz-box;
|
|
126
|
-
display: -webkit-box;
|
|
127
|
-
display: box;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
.hideSidebar .fixed-header {
|
|
131
|
-
width: calc(100% - 54px);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
.mobile .fixed-header {
|
|
135
|
-
width: 100%;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
.info-box {
|
|
139
|
-
text-align: right;
|
|
140
|
-
padding-right: 16px;
|
|
141
|
-
line-height: 50px;
|
|
142
|
-
margin-left: 18px;
|
|
143
|
-
cursor: pointer;
|
|
144
|
-
font-size: 12px;
|
|
145
|
-
}
|
|
146
|
-
</style>
|
|
147
|
-
<style>
|
|
148
|
-
.vxe-custom--body > li[title=' '] {
|
|
149
|
-
display: none;
|
|
150
|
-
}
|
|
151
16
|
</style>
|
|
17
|
+
|