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.
@@ -1,135 +0,0 @@
1
- <!-- 顶栏右侧区域按钮 -->
2
- <template>
3
- <div class="ele-admin-header-tool">
4
- <!-- 全屏切换 -->
5
- <div
6
- class="ele-admin-header-tool-item hidden-xs-only"
7
- @click="changeFullscreen"
8
- >
9
- <i
10
- :class="fullscreen ? 'el-icon-_screen-restore' : 'el-icon-_screen-full'"
11
- ></i>
12
- </div>
13
- <!-- 语言切换 -->
14
- <div class="ele-admin-header-tool-item">
15
- <el-dropdown placement="bottom" @command="changeLanguage">
16
- <i class="el-icon-_language"></i>
17
- <el-dropdown-menu slot="dropdown">
18
- <el-dropdown-item command="en">
19
- <span :class="{ 'ele-text-primary': language === 'en' }">
20
- English
21
- </span>
22
- </el-dropdown-item>
23
- <el-dropdown-item command="zh_CN">
24
- <span :class="{ 'ele-text-primary': language === 'zh_CN' }">
25
- 简体中文
26
- </span>
27
- </el-dropdown-item>
28
- <el-dropdown-item command="zh_TW">
29
- <span :class="{ 'ele-text-primary': language === 'zh_TW' }">
30
- 繁體中文
31
- </span>
32
- </el-dropdown-item>
33
- </el-dropdown-menu>
34
- </el-dropdown>
35
- </div>
36
- <!-- 消息通知 -->
37
- <div class="ele-admin-header-tool-item">
38
- <ele-notice />
39
- </div>
40
- <!-- 用户信息 -->
41
- <div class="ele-admin-header-tool-item">
42
- <el-dropdown @command="onUserDropClick">
43
- <div class="ele-admin-header-avatar">
44
- <el-avatar :src="loginUser.avatar" />
45
- <span class="hidden-xs-only">{{ loginUser.nickname }}</span>
46
- <i class="el-icon-arrow-down hidden-xs-only"></i>
47
- </div>
48
- <el-dropdown-menu slot="dropdown">
49
- <el-dropdown-item command="profile" icon="el-icon-user">
50
- {{ $t('layout.header.profile') }}
51
- </el-dropdown-item>
52
- <el-dropdown-item command="password" icon="el-icon-key">
53
- {{ $t('layout.header.password') }}
54
- </el-dropdown-item>
55
- <el-dropdown-item
56
- command="logout"
57
- icon="el-icon-switch-button"
58
- divided
59
- >
60
- {{ $t('layout.header.logout') }}
61
- </el-dropdown-item>
62
- </el-dropdown-menu>
63
- </el-dropdown>
64
- </div>
65
- <!-- 主题设置 -->
66
- <div v-if="setting" class="ele-admin-header-tool-item" @click="openSetting">
67
- <i class="el-icon-_more"></i>
68
- </div>
69
- </div>
70
- </template>
71
-
72
- <script>
73
- import EleNotice from './notice';
74
- import { removeToken } from '@/utils/token-util';
75
-
76
- export default {
77
- name: 'EleHeaderRight',
78
- components: { EleNotice },
79
- emits: ['item-click', 'change-language', 'change-fullscreen'],
80
- props: {
81
- // 是否显示设置按钮
82
- setting: Boolean,
83
- // 是否是全屏状态
84
- fullscreen: Boolean
85
- },
86
- computed: {
87
- // 当前用户信息
88
- loginUser() {
89
- return this.$store.state.user.info;
90
- },
91
- // 当前显示语言
92
- language() {
93
- return this.$i18n.locale;
94
- }
95
- },
96
- methods: {
97
- /* 用户信息下拉点击事件 */
98
- onUserDropClick(command) {
99
- if (command === 'password') {
100
- this.$emit('item-click', 'password');
101
- } else if (command === 'profile') {
102
- if (this.$route.fullPath !== '/user/profile') {
103
- this.$router.push('/user/profile');
104
- }
105
- } else if (command === 'logout') {
106
- // 退出登录
107
- this.$confirm(
108
- this.$t('layout.logout.message'),
109
- this.$t('layout.logout.title'),
110
- {
111
- type: 'warning'
112
- }
113
- )
114
- .then(() => {
115
- removeToken();
116
- location.replace('/login'); // 这样跳转避免再次登录重复注册动态路由
117
- })
118
- .catch(() => {});
119
- }
120
- },
121
- /* 打开设置抽屉 */
122
- openSetting() {
123
- this.$emit('item-click', 'setting');
124
- },
125
- /* 全屏切换 */
126
- changeFullscreen() {
127
- this.$emit('change-fullscreen');
128
- },
129
- /* 切换语言 */
130
- changeLanguage(lang) {
131
- this.$emit('change-language', lang);
132
- }
133
- }
134
- };
135
- </script>
@@ -1,418 +0,0 @@
1
- <!-- 顶栏消息图标 -->
2
- <template>
3
- <el-popover
4
- :width="330"
5
- trigger="click"
6
- v-model="visible"
7
- class="ele-notice-group"
8
- transition="el-zoom-in-top"
9
- popper-class="ele-notice-pop"
10
- >
11
- <div slot="reference" class="ele-notice-group">
12
- <el-badge :value="unreadNum" :hidden="!unreadNum">
13
- <i class="el-icon-bell"></i>
14
- </el-badge>
15
- </div>
16
- <el-tabs v-model="active">
17
- <el-tab-pane name="notice" :label="noticeLabel">
18
- <div class="ele-notice-list ele-scrollbar-mini">
19
- <div
20
- v-for="(item, index) in notice"
21
- :key="index"
22
- class="ele-notice-item"
23
- >
24
- <div class="ele-cell ele-notice-item-wrapper">
25
- <i :class="[item.icon, 'ele-notice-item-icon']"></i>
26
- <div class="ele-cell-content">
27
- <div class="ele-elip">{{ item.title }}</div>
28
- <div class="ele-text-secondary ele-elip">{{ item.time }}</div>
29
- </div>
30
- </div>
31
- <el-divider />
32
- </div>
33
- </div>
34
- <div v-if="notice.length" class="ele-cell ele-notice-actions">
35
- <div class="ele-cell-content" @click="clear('notice')">清空通知</div>
36
- <el-divider direction="vertical" class="line-color-light" />
37
- <router-link to="/user/message?type=notice" class="ele-cell-content">
38
- 查看更多
39
- </router-link>
40
- </div>
41
- <ele-empty v-if="!notice.length" text="已查看所有通知" />
42
- </el-tab-pane>
43
- <el-tab-pane name="message" :label="messageLabel">
44
- <div class="ele-notice-list ele-scrollbar-mini">
45
- <div
46
- v-for="(item, index) in message"
47
- :key="index"
48
- class="ele-notice-item"
49
- >
50
- <div class="ele-cell ele-notice-item-wrapper ele-cell-align-top">
51
- <el-avatar :src="item.avatar" size="medium" />
52
- <div class="ele-cell-content">
53
- <div class="ele-elip">{{ item.title }}</div>
54
- <div class="ele-text-secondary ele-elip">{{
55
- item.content
56
- }}</div>
57
- <div class="ele-cell-desc ele-elip">{{ item.time }}</div>
58
- </div>
59
- </div>
60
- <el-divider />
61
- </div>
62
- </div>
63
- <div v-if="message.length" class="ele-cell ele-notice-actions">
64
- <div class="ele-cell-content" @click="clear('message')">清空消息</div>
65
- <el-divider direction="vertical" class="line-color-light" />
66
- <router-link to="/user/message?type=message" class="ele-cell-content">
67
- 查看更多
68
- </router-link>
69
- </div>
70
- <ele-empty v-if="!message.length" text="已读完所有私信" />
71
- </el-tab-pane>
72
- <el-tab-pane :label="todoLabel" name="todo">
73
- <div class="ele-notice-list ele-scrollbar-mini">
74
- <div
75
- v-for="(item, index) in todo"
76
- :key="index"
77
- class="ele-notice-item"
78
- >
79
- <div class="ele-notice-item-wrapper">
80
- <div class="ele-cell ele-cell-align-top">
81
- <div class="ele-cell-content ele-elip">{{ item.title }}</div>
82
- <el-tag size="mini" :type="['info', 'danger', ''][item.state]">
83
- {{ ['未开始', '即将到期', '进行中'][item.state] }}
84
- </el-tag>
85
- </div>
86
- <div class="ele-text-secondary ele-elip">{{ item.desc }}</div>
87
- </div>
88
- <el-divider />
89
- </div>
90
- </div>
91
- <div v-if="todo.length" class="ele-cell ele-notice-actions">
92
- <div class="ele-cell-content" @click="clear('todo')">清空待办</div>
93
- <el-divider direction="vertical" class="line-color-light" />
94
- <router-link to="/user/message?type=todo" class="ele-cell-content">
95
- 查看更多
96
- </router-link>
97
- </div>
98
- <ele-empty v-if="!todo.length" text="已完成所有任务" />
99
- </el-tab-pane>
100
- </el-tabs>
101
- </el-popover>
102
- </template>
103
-
104
- <script>
105
- export default {
106
- name: 'EleNotice',
107
- data() {
108
- return {
109
- // 是否显示
110
- visible: false,
111
- // 选项卡选中
112
- active: 'notice',
113
- // 通知数据
114
- notice: [
115
- {
116
- icon: 'el-icon-s-comment',
117
- title: '你收到了一封14份新周报',
118
- time: '2020-07-27 18:30:18'
119
- },
120
- {
121
- icon: 'el-icon-s-check',
122
- title: '许经理同意了你的请假申请',
123
- time: '2020-07-27 09:08:36'
124
- },
125
- {
126
- icon: 'el-icon-video-camera',
127
- title: '陈总邀请你参加视频会议',
128
- time: '2020-07-26 18:30:01'
129
- },
130
- {
131
- icon: 'el-icon-s-claim',
132
- title: '你推荐的刘诗雨已通过第三轮面试',
133
- time: '2020-07-25 16:38:46'
134
- },
135
- {
136
- icon: 'el-icon-message-solid',
137
- title: '你的6月加班奖金已发放',
138
- time: '2020-07-25 11:03:31'
139
- }
140
- ],
141
- // 私信数据
142
- message: [
143
- {
144
- avatar:
145
- 'https://cdn.eleadmin.com/20200609/c184eef391ae48dba87e3057e70238fb.jpg',
146
- title: 'SunSmile 评论了你的日志',
147
- content: '写的不错, 以后多多向你学习~',
148
- time: '2020-07-27 18:30:18'
149
- },
150
- {
151
- avatar:
152
- 'https://cdn.eleadmin.com/20200609/948344a2a77c47a7a7b332fe12ff749a.jpg',
153
- title: '刘诗雨 点赞了你的日志',
154
- content: '写的不错, 以后多多向你学习~',
155
- time: '2020-07-27 09:08:36'
156
- },
157
- {
158
- avatar:
159
- 'https://cdn.eleadmin.com/20200609/2d98970a51b34b6b859339c96b240dcd.jpg',
160
- title: '酷酷的大叔 评论了你的周报',
161
- content: '写的不错, 以后多多向你学习~',
162
- time: '2020-07-26 18:30:01'
163
- },
164
- {
165
- avatar:
166
- 'https://cdn.eleadmin.com/20200609/f6bc05af944a4f738b54128717952107.jpg',
167
- title: 'Jasmine 点赞了你的周报',
168
- content: '写的不错, 以后多多向你学习~',
169
- time: '2020-07-25 11:03:31'
170
- }
171
- ],
172
- // 待办数据
173
- todo: [
174
- {
175
- state: 0,
176
- title: '刘诗雨的请假审批',
177
- desc: '刘诗雨在 07-27 18:30 提交的请假申请'
178
- },
179
- {
180
- state: 1,
181
- title: '第三方代码紧急变更',
182
- desc: '需要在 2020-07-27 之前完成'
183
- },
184
- {
185
- state: 2,
186
- title: '信息安全考试',
187
- desc: '需要在 2020-07-26 18:30 前完成'
188
- },
189
- {
190
- state: 2,
191
- title: 'EleAdmin发布新版本',
192
- desc: '需要在 2020-07-25 11:03 前完成'
193
- }
194
- ]
195
- };
196
- },
197
- computed: {
198
- // 通知标题
199
- noticeLabel() {
200
- return '通知' + (this.notice.length ? `(${this.notice.length})` : '');
201
- },
202
- // 私信标题
203
- messageLabel() {
204
- return '私信' + (this.message.length ? `(${this.message.length})` : '');
205
- },
206
- // 待办标题
207
- todoLabel() {
208
- return '待办' + (this.todo.length ? `(${this.todo.length})` : '');
209
- },
210
- // 未读数量
211
- unreadNum() {
212
- return this.notice.length + this.message.length + this.todo.length;
213
- }
214
- },
215
- mounted() {
216
- this.query();
217
- },
218
- methods: {
219
- /* 清空消息 */
220
- clear(type) {
221
- if (type === 'notice') {
222
- this.notice = [];
223
- } else if (type === 'message') {
224
- this.message = [];
225
- } else if (type === 'todo') {
226
- this.todo = [];
227
- }
228
- },
229
- /* 查询 */
230
- query() {
231
- this.notice = [
232
- {
233
- icon: 'el-icon-s-comment',
234
- title: '你收到了一封14份新周报',
235
- time: '2020-07-27 18:30:18'
236
- },
237
- {
238
- icon: 'el-icon-s-check',
239
- title: '许经理同意了你的请假申请',
240
- time: '2020-07-27 09:08:36'
241
- },
242
- {
243
- icon: 'el-icon-video-camera',
244
- title: '陈总邀请你参加视频会议',
245
- time: '2020-07-26 18:30:01'
246
- },
247
- {
248
- icon: 'el-icon-s-claim',
249
- title: '你推荐的刘诗雨已通过第三轮面试',
250
- time: '2020-07-25 16:38:46'
251
- },
252
- {
253
- icon: 'el-icon-message-solid',
254
- title: '你的6月加班奖金已发放',
255
- time: '2020-07-25 11:03:31'
256
- }
257
- ];
258
- this.message = [
259
- {
260
- avatar:
261
- 'https://cdn.eleadmin.com/20200609/c184eef391ae48dba87e3057e70238fb.jpg',
262
- title: 'SunSmile 评论了你的日志',
263
- content: '写的不错, 以后多多向你学习~',
264
- time: '2020-07-27 18:30:18'
265
- },
266
- {
267
- avatar:
268
- 'https://cdn.eleadmin.com/20200609/948344a2a77c47a7a7b332fe12ff749a.jpg',
269
- title: '刘诗雨 点赞了你的日志',
270
- content: '写的不错, 以后多多向你学习~',
271
- time: '2020-07-27 09:08:36'
272
- },
273
- {
274
- avatar:
275
- 'https://cdn.eleadmin.com/20200609/2d98970a51b34b6b859339c96b240dcd.jpg',
276
- title: '酷酷的大叔 评论了你的周报',
277
- content: '写的不错, 以后多多向你学习~',
278
- time: '2020-07-26 18:30:01'
279
- },
280
- {
281
- avatar:
282
- 'https://cdn.eleadmin.com/20200609/f6bc05af944a4f738b54128717952107.jpg',
283
- title: 'Jasmine 点赞了你的周报',
284
- content: '写的不错, 以后多多向你学习~',
285
- time: '2020-07-25 11:03:31'
286
- }
287
- ];
288
- this.todo = [
289
- {
290
- state: 0,
291
- title: '刘诗雨的请假审批',
292
- desc: '刘诗雨在 07-27 18:30 提交的请假申请'
293
- },
294
- {
295
- state: 1,
296
- title: '第三方代码紧急变更',
297
- desc: '需要在 2020-07-27 之前完成'
298
- },
299
- {
300
- state: 2,
301
- title: '信息安全考试',
302
- desc: '需要在 2020-07-26 18:30 前完成'
303
- },
304
- {
305
- state: 2,
306
- title: 'EleAdmin发布新版本',
307
- desc: '需要在 2020-07-25 11:03 前完成'
308
- }
309
- ];
310
- }
311
- }
312
- };
313
- </script>
314
-
315
- <style lang="scss">
316
- .ele-notice-group {
317
- display: block;
318
-
319
- .el-badge {
320
- line-height: 1;
321
- display: block;
322
- }
323
- }
324
-
325
- /* 消息通知pop */
326
- .ele-notice-pop {
327
- padding: 0 !important;
328
-
329
- /* tab */
330
- .el-tabs__nav-scroll {
331
- text-align: center;
332
- }
333
-
334
- .el-tabs__nav {
335
- float: none;
336
- display: inline-block;
337
- }
338
-
339
- .el-tabs__item {
340
- height: 44px;
341
- line-height: 44px;
342
- padding: 0 20px !important;
343
- }
344
-
345
- /* 空视图 */
346
- .ele-empty {
347
- padding: 100px 0;
348
- }
349
- }
350
-
351
- /* 列表 */
352
- .ele-notice-list {
353
- padding-top: 8px;
354
- max-height: 360px;
355
- overflow: auto;
356
- }
357
-
358
- .ele-notice-item {
359
- .ele-notice-item-wrapper {
360
- padding: 12px 15px;
361
- transition: background-color 0.2s;
362
- cursor: pointer;
363
-
364
- &:hover {
365
- background-color: hsla(0, 0%, 60%, 0.05);
366
- }
367
- }
368
-
369
- .ele-text-secondary {
370
- margin-top: 5px;
371
- font-size: 13px;
372
- }
373
-
374
- .ele-cell-desc {
375
- margin-top: 3px !important;
376
- font-size: 12px !important;
377
- }
378
- }
379
-
380
- .ele-notice-item-icon {
381
- width: 32px;
382
- height: 32px;
383
- line-height: 32px !important;
384
- color: #fff;
385
- font-size: 16px;
386
- background-color: #60b2fc;
387
- border-radius: 50%;
388
- text-align: center;
389
-
390
- &.el-icon-s-check {
391
- background-color: #f5686f;
392
- }
393
-
394
- &.el-icon-video-camera {
395
- background-color: #7cd734;
396
- }
397
-
398
- &.el-icon-s-claim {
399
- background-color: #faad14;
400
- }
401
-
402
- &.el-icon-message-solid {
403
- background-color: #2bcacd;
404
- }
405
- }
406
-
407
- /* 操作按钮 */
408
- .ele-notice-actions > .ele-cell-content {
409
- line-height: 42px;
410
- text-align: center;
411
- cursor: pointer;
412
- color: inherit;
413
-
414
- &:hover {
415
- background-color: hsla(0, 0%, 60%, 0.05);
416
- }
417
- }
418
- </style>
@@ -1,133 +0,0 @@
1
- <!-- 修改密码弹窗 -->
2
- <template>
3
- <el-dialog
4
- width="420px"
5
- title="修改密码"
6
- :visible="visible"
7
- :lock-scroll="false"
8
- :append-to-body="true"
9
- :close-on-click-modal="false"
10
- @update:visible="updateVisible"
11
- @closed="onClose"
12
- >
13
- <el-form
14
- ref="form"
15
- :model="form"
16
- :rules="rules"
17
- label-width="82px"
18
- @keyup.enter.native="save"
19
- >
20
- <el-form-item label="旧密码:" prop="oldPassword">
21
- <el-input
22
- show-password
23
- v-model="form.oldPassword"
24
- placeholder="请输入旧密码"
25
- />
26
- </el-form-item>
27
- <el-form-item label="新密码:" prop="password">
28
- <el-input
29
- show-password
30
- v-model="form.password"
31
- placeholder="请输入新密码"
32
- />
33
- </el-form-item>
34
- <el-form-item label="确认密码:" prop="password2">
35
- <el-input
36
- show-password
37
- v-model="form.password2"
38
- placeholder="请再次输入新密码"
39
- />
40
- </el-form-item>
41
- </el-form>
42
- <div slot="footer">
43
- <el-button @click="updateVisible(false)">取消</el-button>
44
- <el-button type="primary" @click="save">确定</el-button>
45
- </div>
46
- </el-dialog>
47
- </template>
48
-
49
- <script>
50
- export default {
51
- name: 'ElePassword',
52
- props: {
53
- // 是否显示
54
- visible: Boolean
55
- },
56
- data() {
57
- return {
58
- // 表单数据
59
- form: {
60
- oldPassword: '',
61
- password: '',
62
- password2: ''
63
- },
64
- // 表单验证
65
- rules: {
66
- oldPassword: [
67
- {
68
- required: true,
69
- message: '请输入旧密码',
70
- trigger: 'blur'
71
- }
72
- ],
73
- password: [
74
- {
75
- required: true,
76
- message: '请输入新密码',
77
- trigger: 'blur'
78
- }
79
- ],
80
- password2: [
81
- {
82
- required: true,
83
- trigger: 'blur',
84
- validator: (rule, value, callback) => {
85
- if (!value) {
86
- return callback(new Error('请再次输入新密码'));
87
- }
88
- if (value !== this.form.password) {
89
- return callback(new Error('两次输入密码不一致'));
90
- }
91
- callback();
92
- }
93
- }
94
- ]
95
- },
96
- // 按钮loading
97
- loading: false
98
- };
99
- },
100
- methods: {
101
- /* 保存修改 */
102
- save() {
103
- // this.$refs['form'].validate((valid) => {
104
- // if (valid) {
105
- // this.loading = true;
106
- // updatePassword(this.form)
107
- // .then((msg) => {
108
- // this.loading = false;
109
- // this.$message.success(msg);
110
- // this.updateVisible(false);
111
- // })
112
- // .catch((e) => {
113
- // this.loading = false;
114
- // this.$message.error(e.message);
115
- // });
116
- // } else {
117
- // return false;
118
- // }
119
- // });
120
- },
121
- /* 关闭回调 */
122
- onClose() {
123
- this.form = {};
124
- this.$refs['form'].resetFields();
125
- this.loading = false;
126
- },
127
- /* 修改visible */
128
- updateVisible(value) {
129
- this.$emit('update:visible', value);
130
- }
131
- }
132
- };
133
- </script>