ry-vue-map 0.0.1 → 0.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.
- package/README.MD +2 -186
- package/lib/ryui.common.js +7 -7
- package/lib/ryui.common.js.gz +0 -0
- package/lib/ryui.umd.js +7 -7
- package/lib/ryui.umd.js.gz +0 -0
- package/package.json +3 -5
- package/src/main.js +5 -9
- package/src/router/index.js +1 -37
- package/src/store/index.js +1 -6
- package/src/styles/index.scss +1 -2
- package/vue.config.js +1 -1
- package/src/config/setting.js +0 -40
- package/src/layout/components/footer.vue +0 -35
- package/src/layout/components/header-right.vue +0 -135
- package/src/layout/components/notice.vue +0 -418
- package/src/layout/components/password.vue +0 -133
- package/src/layout/index.vue +0 -252
- package/src/store/getters.js +0 -7
- package/src/store/modules/theme.js +0 -544
- package/src/store/modules/user.js +0 -74
- package/src/utils/index.js +0 -4
- package/src/utils/page-tab-util.js +0 -106
- package/src/utils/permission.js +0 -118
- package/src/utils/request.js +0 -68
- package/src/utils/token-util.js +0 -40
- package/src/views/exception/403.vue +0 -31
- package/src/views/exception/404.vue +0 -31
- package/src/views/exception/500.vue +0 -31
package/src/layout/index.vue
DELETED
|
@@ -1,252 +0,0 @@
|
|
|
1
|
-
<!-- 框架布局 -->
|
|
2
|
-
<template>
|
|
3
|
-
<ele-pro-layout
|
|
4
|
-
:menus="menus"
|
|
5
|
-
:home-title="homeTitle"
|
|
6
|
-
:project-name="projectName"
|
|
7
|
-
:show-setting.sync="showSetting"
|
|
8
|
-
:need-setting="enableSetting"
|
|
9
|
-
:hide-footers="hideFooters"
|
|
10
|
-
:hide-sidebars="hideSidebars"
|
|
11
|
-
:repeatable-tabs="repeatableTabs"
|
|
12
|
-
:tabs="theme.tabs"
|
|
13
|
-
:color="theme.color"
|
|
14
|
-
:collapse="theme.collapse"
|
|
15
|
-
:head-style="theme.headStyle"
|
|
16
|
-
:side-style="theme.sideStyle"
|
|
17
|
-
:layout-style="theme.layoutStyle"
|
|
18
|
-
:side-menu-style="theme.sideMenuStyle"
|
|
19
|
-
:fixed-body="theme.fixedBody"
|
|
20
|
-
:fixed-header="theme.fixedHeader"
|
|
21
|
-
:fixed-sidebar="theme.fixedSidebar"
|
|
22
|
-
:body-full="theme.bodyFull"
|
|
23
|
-
:show-footer="theme.showFooter"
|
|
24
|
-
:colorful-icon="theme.colorfulIcon"
|
|
25
|
-
:logo-auto-size="theme.logoAutoSize"
|
|
26
|
-
:side-unique-open="theme.sideUniqueOpen"
|
|
27
|
-
:show-tabs="theme.showTabs"
|
|
28
|
-
:tab-style="theme.tabStyle"
|
|
29
|
-
:dark-mode="theme.darkMode"
|
|
30
|
-
:weak-mode="theme.weakMode"
|
|
31
|
-
:i18n="i18n"
|
|
32
|
-
:locale="locale"
|
|
33
|
-
@logo-click="onLogoClick"
|
|
34
|
-
@reload-page="reloadPage"
|
|
35
|
-
@update-screen="updateScreen"
|
|
36
|
-
@update-collapse="updateCollapse"
|
|
37
|
-
@tab-add="tabAdd"
|
|
38
|
-
@tab-remove="tabRemove"
|
|
39
|
-
@tab-remove-all="tabRemoveAll"
|
|
40
|
-
@tab-remove-left="tabRemoveLeft"
|
|
41
|
-
@tab-remove-right="tabRemoveRight"
|
|
42
|
-
@tab-remove-other="tabRemoveOther"
|
|
43
|
-
@change-style="changeStyle"
|
|
44
|
-
@change-color="changeColor"
|
|
45
|
-
@change-dark-mode="changeDarkMode"
|
|
46
|
-
@change-weak-mode="changeWeakMode"
|
|
47
|
-
@set-home-components="setHomeComponents"
|
|
48
|
-
@reset-setting="resetSetting"
|
|
49
|
-
>
|
|
50
|
-
<!-- logo图标 -->
|
|
51
|
-
<template slot="logo">
|
|
52
|
-
<img src="@/assets/logo.svg" alt="logo" />
|
|
53
|
-
</template>
|
|
54
|
-
<!-- 顶栏右侧区域 -->
|
|
55
|
-
<template slot="right">
|
|
56
|
-
<ele-header-right
|
|
57
|
-
:setting="enableSetting"
|
|
58
|
-
:fullscreen="fullscreen"
|
|
59
|
-
@item-click="onItemClick"
|
|
60
|
-
@change-language="changeLanguage"
|
|
61
|
-
@change-fullscreen="changeFullscreen"
|
|
62
|
-
/>
|
|
63
|
-
</template>
|
|
64
|
-
<!-- 全局页脚 -->
|
|
65
|
-
<template slot="footer">
|
|
66
|
-
<ele-footer />
|
|
67
|
-
</template>
|
|
68
|
-
<!-- 修改密码弹窗 -->
|
|
69
|
-
<ele-password :visible.sync="showPassword" />
|
|
70
|
-
</ele-pro-layout>
|
|
71
|
-
</template>
|
|
72
|
-
|
|
73
|
-
<script>
|
|
74
|
-
import { mapGetters } from 'vuex';
|
|
75
|
-
import EleHeaderRight from './components/header-right';
|
|
76
|
-
import ElePassword from './components/password';
|
|
77
|
-
import EleFooter from './components/footer';
|
|
78
|
-
import {
|
|
79
|
-
HIDE_SIDEBARS,
|
|
80
|
-
HIDE_FOOTERS,
|
|
81
|
-
REPEATABLE_TABS,
|
|
82
|
-
HOME_TITLE,
|
|
83
|
-
ENABLE_SETTING
|
|
84
|
-
} from '@/config/setting';
|
|
85
|
-
import {
|
|
86
|
-
addPageTab,
|
|
87
|
-
removePageTab,
|
|
88
|
-
removeAllPageTab,
|
|
89
|
-
removeLeftPageTab,
|
|
90
|
-
removeRightPageTab,
|
|
91
|
-
removeOtherPageTab,
|
|
92
|
-
reloadPageTab
|
|
93
|
-
} from '@/utils/page-tab-util';
|
|
94
|
-
|
|
95
|
-
export default {
|
|
96
|
-
name: 'EleLayout',
|
|
97
|
-
components: {
|
|
98
|
-
EleHeaderRight,
|
|
99
|
-
ElePassword,
|
|
100
|
-
EleFooter
|
|
101
|
-
},
|
|
102
|
-
data() {
|
|
103
|
-
return {
|
|
104
|
-
// 是否显示修改密码弹窗
|
|
105
|
-
showPassword: false,
|
|
106
|
-
// 是否显示主题设置抽屉
|
|
107
|
-
showSetting: false,
|
|
108
|
-
// 是否是全屏状态
|
|
109
|
-
fullscreen: false,
|
|
110
|
-
// 项目名
|
|
111
|
-
projectName: process.env.VUE_APP_NAME,
|
|
112
|
-
// 顶栏是否显示主题设置按钮
|
|
113
|
-
enableSetting: ENABLE_SETTING,
|
|
114
|
-
// 不显示页脚的路由
|
|
115
|
-
hideFooters: HIDE_FOOTERS,
|
|
116
|
-
// 不显示侧栏的路由
|
|
117
|
-
hideSidebars: HIDE_SIDEBARS,
|
|
118
|
-
// 页签同路由不同参数可重复打开的路由
|
|
119
|
-
repeatableTabs: REPEATABLE_TABS
|
|
120
|
-
};
|
|
121
|
-
},
|
|
122
|
-
computed: {
|
|
123
|
-
// 当前语言
|
|
124
|
-
locale() {
|
|
125
|
-
return this.$i18n.locale;
|
|
126
|
-
},
|
|
127
|
-
// 主页标题
|
|
128
|
-
homeTitle() {
|
|
129
|
-
// 去掉国际化后直接return HOME_TITLE
|
|
130
|
-
return this.$t('layout.home') ?? HOME_TITLE;
|
|
131
|
-
},
|
|
132
|
-
// 菜单数据
|
|
133
|
-
menus() {
|
|
134
|
-
return this.$store.state.user.menus;
|
|
135
|
-
},
|
|
136
|
-
// 主题状态
|
|
137
|
-
...mapGetters(['theme'])
|
|
138
|
-
},
|
|
139
|
-
methods: {
|
|
140
|
-
/* 顶栏右侧点击 */
|
|
141
|
-
onItemClick(key) {
|
|
142
|
-
if (key === 'password') {
|
|
143
|
-
this.showPassword = true;
|
|
144
|
-
} else if (key === 'setting') {
|
|
145
|
-
this.showSetting = true;
|
|
146
|
-
}
|
|
147
|
-
},
|
|
148
|
-
/* 全屏切换 */
|
|
149
|
-
changeFullscreen() {
|
|
150
|
-
try {
|
|
151
|
-
this.fullscreen = this.$util.toggleFullscreen();
|
|
152
|
-
} catch (e) {
|
|
153
|
-
this.$message.error('您的浏览器不支持全屏模式');
|
|
154
|
-
}
|
|
155
|
-
},
|
|
156
|
-
/* logo点击事件 */
|
|
157
|
-
onLogoClick(isHome) {
|
|
158
|
-
if (!isHome) {
|
|
159
|
-
this.$router.push('/');
|
|
160
|
-
}
|
|
161
|
-
},
|
|
162
|
-
/* 刷新页签 */
|
|
163
|
-
reloadPage() {
|
|
164
|
-
reloadPageTab();
|
|
165
|
-
},
|
|
166
|
-
/* 添加tab */
|
|
167
|
-
tabAdd(value) {
|
|
168
|
-
addPageTab(value);
|
|
169
|
-
},
|
|
170
|
-
/* 移除tab */
|
|
171
|
-
tabRemove(obj) {
|
|
172
|
-
removePageTab(obj.name, obj.active);
|
|
173
|
-
},
|
|
174
|
-
/* 移除全部tab */
|
|
175
|
-
tabRemoveAll(active) {
|
|
176
|
-
removeAllPageTab(active);
|
|
177
|
-
},
|
|
178
|
-
/* 移除左边tab */
|
|
179
|
-
tabRemoveLeft(value) {
|
|
180
|
-
removeLeftPageTab(value);
|
|
181
|
-
},
|
|
182
|
-
/* 移除右边tab */
|
|
183
|
-
tabRemoveRight(value) {
|
|
184
|
-
removeRightPageTab(value);
|
|
185
|
-
},
|
|
186
|
-
/* 移除其它tab */
|
|
187
|
-
tabRemoveOther(value) {
|
|
188
|
-
removeOtherPageTab(value);
|
|
189
|
-
},
|
|
190
|
-
/* 更新collapse */
|
|
191
|
-
updateCollapse(value) {
|
|
192
|
-
this.$store.dispatch('theme/set', { key: 'collapse', value: value });
|
|
193
|
-
},
|
|
194
|
-
/* 更新屏幕尺寸 */
|
|
195
|
-
updateScreen() {
|
|
196
|
-
this.$store.dispatch('theme/updateScreen');
|
|
197
|
-
this.fullscreen = this.$util.isFullscreen();
|
|
198
|
-
},
|
|
199
|
-
/* 重置设置 */
|
|
200
|
-
resetSetting() {
|
|
201
|
-
this.$store.dispatch('theme/resetSetting');
|
|
202
|
-
},
|
|
203
|
-
/* 切换主题风格 */
|
|
204
|
-
changeStyle(value) {
|
|
205
|
-
this.$store.dispatch('theme/set', value);
|
|
206
|
-
},
|
|
207
|
-
/* 切换主题色 */
|
|
208
|
-
changeColor(value) {
|
|
209
|
-
const loading = this.$loading({
|
|
210
|
-
lock: true,
|
|
211
|
-
background: 'transparent'
|
|
212
|
-
});
|
|
213
|
-
this.$store
|
|
214
|
-
.dispatch('theme/setColor', value)
|
|
215
|
-
.then(() => {
|
|
216
|
-
loading.close();
|
|
217
|
-
})
|
|
218
|
-
.catch((e) => {
|
|
219
|
-
console.error(e);
|
|
220
|
-
loading.close();
|
|
221
|
-
this.$message.error('主题加载失败');
|
|
222
|
-
});
|
|
223
|
-
},
|
|
224
|
-
/* 切换暗黑模式 */
|
|
225
|
-
changeDarkMode(value) {
|
|
226
|
-
this.$store.dispatch('theme/setDarkMode', value);
|
|
227
|
-
},
|
|
228
|
-
/* 切换色弱模式 */
|
|
229
|
-
changeWeakMode(value) {
|
|
230
|
-
this.$store.dispatch('theme/setWeakMode', value);
|
|
231
|
-
},
|
|
232
|
-
/* 设置主页包含的组件名称 */
|
|
233
|
-
setHomeComponents(components) {
|
|
234
|
-
this.$store.dispatch('theme/setHomeComponents', components);
|
|
235
|
-
},
|
|
236
|
-
/* 菜单路由国际化对应的名称 */
|
|
237
|
-
i18n(path, key /*, menu*/) {
|
|
238
|
-
// 参数三menu即原始菜单数据, 如果需要菜单标题多语言数据从接口返回可用此参数获取对应的多语言标题
|
|
239
|
-
// 例如下面这样写, 接口的菜单数据为{path: '/system/user', titles: {zh: '用户管理', en: 'User'}}
|
|
240
|
-
// return menu ? menu.titles[this.$i18n.locale] : null;
|
|
241
|
-
const k = 'route.' + key + '._name';
|
|
242
|
-
const title = this.$t(k);
|
|
243
|
-
return title === k ? null : title;
|
|
244
|
-
},
|
|
245
|
-
/* 切换语言 */
|
|
246
|
-
changeLanguage(lang) {
|
|
247
|
-
this.$i18n.locale = lang;
|
|
248
|
-
localStorage.setItem('i18n-lang', lang);
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
};
|
|
252
|
-
</script>
|