cloud-web-corejs 1.0.0 → 1.0.2

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.
@@ -0,0 +1,151 @@
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
+ name: 'Layout',
21
+ components: {
22
+ AppMain: () => import('./components/AppMain'),
23
+ Sidebar: () => import('./components/Sidebar'),
24
+ TagsView: () => import('./components/TagsView'),
25
+ modifyPasswordDialog
26
+ },
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
+ };
85
+ </script>
86
+
87
+ <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
+ </style>
@@ -3,7 +3,7 @@ import {
3
3
  constantRoutes,
4
4
  sidebarRoutes
5
5
  } from '@/router';
6
- import Layout from '@/layout';
6
+ import Layout from '@base/layout';
7
7
  import {
8
8
  getRouters
9
9
  } from '../../api/menu';