mooho-base-admin-plus 0.1.0
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/.env +5 -0
- package/.env.development +0 -0
- package/.env.production +0 -0
- package/.eslintignore +11 -0
- package/.eslintrc.js +47 -0
- package/.prettierrc +15 -0
- package/README.md +18 -0
- package/dist/favicon.ico +0 -0
- package/dist/mooho-base-admin-plus.min.esm.js +131746 -0
- package/dist/mooho-base-admin-plus.min.js +279 -0
- package/dist/setting.js +31 -0
- package/dist/static/images/app-barcode.png +0 -0
- package/dist/static/images/login/bg.png +0 -0
- package/dist/static/images/login/logo.png +0 -0
- package/dist/static/images/login/password-active.png +0 -0
- package/dist/static/images/login/password-default.png +0 -0
- package/dist/static/images/login/signIn-img.png +0 -0
- package/dist/static/images/login/user-active.png +0 -0
- package/dist/static/images/login/user-default.png +0 -0
- package/dist/static/images/logo-dark.png +0 -0
- package/dist/static/images/logo-small.png +0 -0
- package/dist/static/images/logo.png +0 -0
- package/dist/static/images/logo.svg +510 -0
- package/dist/static/images/no-image.png +0 -0
- package/dist/style.css +4 -0
- package/index.html +18 -0
- package/other/pda.vue +28 -0
- package/package.json +59 -0
- package/public/favicon.ico +0 -0
- package/public/setting.js +31 -0
- package/public/static/images/app-barcode.png +0 -0
- package/public/static/images/login/bg.png +0 -0
- package/public/static/images/login/logo.png +0 -0
- package/public/static/images/login/password-active.png +0 -0
- package/public/static/images/login/password-default.png +0 -0
- package/public/static/images/login/signIn-img.png +0 -0
- package/public/static/images/login/user-active.png +0 -0
- package/public/static/images/login/user-default.png +0 -0
- package/public/static/images/logo-dark.png +0 -0
- package/public/static/images/logo-small.png +0 -0
- package/public/static/images/logo.png +0 -0
- package/public/static/images/logo.svg +510 -0
- package/public/static/images/no-image.png +0 -0
- package/src/App.vue +60 -0
- package/src/api/application.js +35 -0
- package/src/api/customModel.js +187 -0
- package/src/api/customPage.js +15 -0
- package/src/api/customTable.js +24 -0
- package/src/api/dataSource.js +93 -0
- package/src/api/dataView.js +199 -0
- package/src/api/dictType.js +23 -0
- package/src/api/entityView.js +13 -0
- package/src/api/enum.js +15 -0
- package/src/api/filterColumn.js +16 -0
- package/src/api/model.js +244 -0
- package/src/api/movePlan.js +29 -0
- package/src/api/notification.js +28 -0
- package/src/api/openApiPermission.js +25 -0
- package/src/api/permission.js +51 -0
- package/src/api/planJob.js +15 -0
- package/src/api/process.js +23 -0
- package/src/api/processDef.js +36 -0
- package/src/api/processInst.js +16 -0
- package/src/api/rolePermission.js +17 -0
- package/src/api/roleProperty.js +36 -0
- package/src/api/shortcut.js +20 -0
- package/src/api/system.js +23 -0
- package/src/api/task.js +56 -0
- package/src/api/taskQueue.js +24 -0
- package/src/api/user.js +45 -0
- package/src/api/viewColumn.js +16 -0
- package/src/assets/svg/body.svg +17 -0
- package/src/assets/svg/header-theme-dark.svg +40 -0
- package/src/assets/svg/header-theme-primary.svg +40 -0
- package/src/assets/svg/header-top.svg +40 -0
- package/src/assets/svg/icon-happy.svg +1 -0
- package/src/assets/svg/icon-sad.svg +1 -0
- package/src/assets/svg/icon-social-bilibili.svg +1 -0
- package/src/assets/svg/icon-social-dingding.svg +1 -0
- package/src/assets/svg/icon-social-facebook.svg +1 -0
- package/src/assets/svg/icon-social-juejin.svg +1 -0
- package/src/assets/svg/icon-social-qq.svg +1 -0
- package/src/assets/svg/icon-social-twitter.svg +1 -0
- package/src/assets/svg/icon-social-wechat.svg +1 -0
- package/src/assets/svg/icon-social-weibo.svg +1 -0
- package/src/assets/svg/icon-social-zhihu.svg +1 -0
- package/src/assets/svg/nav-theme-dark.svg +40 -0
- package/src/assets/svg/nav-theme-light.svg +40 -0
- package/src/components/copyright/index.vue +28 -0
- package/src/components/home/notice-list.vue +62 -0
- package/src/components/home/shortcut.vue +125 -0
- package/src/components/input/dialog-select.vue +301 -0
- package/src/components/input/item-select.vue +195 -0
- package/src/components/link/index.vue +54 -0
- package/src/components/richEditor/index.vue +86 -0
- package/src/components/upload/file-upload.vue +84 -0
- package/src/components/upload/upload-attachment.vue +119 -0
- package/src/components/upload/upload-image.vue +212 -0
- package/src/components/view/column-check.vue +223 -0
- package/src/components/view/column-edit.vue +850 -0
- package/src/components/view/column-select.vue +206 -0
- package/src/components/view/condition-edit.vue +164 -0
- package/src/components/view/filter-edit.vue +633 -0
- package/src/components/view/filter-setting.vue +126 -0
- package/src/components/view/form-setting-layout.vue +375 -0
- package/src/components/view/form-setting.vue +247 -0
- package/src/components/view/group-column.vue +104 -0
- package/src/components/view/group-method.vue +104 -0
- package/src/components/view/mixin.js +72 -0
- package/src/components/view/modal-form-filter.vue +319 -0
- package/src/components/view/modal-form-sort.vue +248 -0
- package/src/components/view/modal-form.vue +453 -0
- package/src/components/view/modal-table.vue +471 -0
- package/src/components/view/table-filter.vue +702 -0
- package/src/components/view/table-setting.vue +533 -0
- package/src/components/view/view-chart.vue +423 -0
- package/src/components/view/view-form-draggable.vue +837 -0
- package/src/components/view/view-form.vue +1444 -0
- package/src/components/view/view-table.vue +2261 -0
- package/src/components/workflow/flow-chart.vue +846 -0
- package/src/directive/focus.js +10 -0
- package/src/directive/tabHide.js +9 -0
- package/src/i18n/index.js +15 -0
- package/src/i18n/locale/en-US.js +1 -0
- package/src/i18n/locale/lang.js +1 -0
- package/src/i18n/locale/zh-CN.js +1 -0
- package/src/i18n/locale.js +102 -0
- package/src/index.js +222 -0
- package/src/layouts/basic-layout/header-breadcrumb/index.vue +122 -0
- package/src/layouts/basic-layout/header-collapse/index.vue +44 -0
- package/src/layouts/basic-layout/header-fullscreen/index.vue +19 -0
- package/src/layouts/basic-layout/header-i18n/index.vue +45 -0
- package/src/layouts/basic-layout/header-log/index.vue +41 -0
- package/src/layouts/basic-layout/header-logo/index.vue +23 -0
- package/src/layouts/basic-layout/header-notice/index.vue +218 -0
- package/src/layouts/basic-layout/header-reload/index.vue +21 -0
- package/src/layouts/basic-layout/header-search/index.vue +37 -0
- package/src/layouts/basic-layout/header-setting/index.vue +219 -0
- package/src/layouts/basic-layout/header-user/index.vue +175 -0
- package/src/layouts/basic-layout/i18n.js +50 -0
- package/src/layouts/basic-layout/index.vue +280 -0
- package/src/layouts/basic-layout/menu-head/index.vue +120 -0
- package/src/layouts/basic-layout/menu-head/title.vue +48 -0
- package/src/layouts/basic-layout/menu-side/index.vue +113 -0
- package/src/layouts/basic-layout/menu-side/menu-collapse.vue +76 -0
- package/src/layouts/basic-layout/menu-side/menu-item.vue +31 -0
- package/src/layouts/basic-layout/menu-side/menu-title.vue +56 -0
- package/src/layouts/basic-layout/menu-side/submenu.vue +31 -0
- package/src/layouts/basic-layout/mixins/click-item.js +21 -0
- package/src/layouts/basic-layout/mixins/sider-menu-badge.js +13 -0
- package/src/layouts/basic-layout/mixins/translate-title.js +11 -0
- package/src/layouts/basic-layout/tabs/index.vue +192 -0
- package/src/layouts/basic-layout/water-mark/index.vue +29 -0
- package/src/libs/lodop/index.js +145 -0
- package/src/libs/random_str.js +10 -0
- package/src/libs/request/index.js +158 -0
- package/src/libs/system/index.js +234 -0
- package/src/libs/util.cookies.js +44 -0
- package/src/libs/util.db.js +13 -0
- package/src/libs/util.js +55 -0
- package/src/libs/util.log.js +88 -0
- package/src/libs/water-mark.js +44 -0
- package/src/menu/header.js +20 -0
- package/src/menu/modules/dashboard.js +23 -0
- package/src/menu/sider.js +12 -0
- package/src/mixins/app.js +9 -0
- package/src/mixins/page.js +643 -0
- package/src/pages/account/login.vue +101 -0
- package/src/pages/common/home.vue +169 -0
- package/src/pages/common/task-form.vue +350 -0
- package/src/pages/common/todo.vue +31 -0
- package/src/pages/system/apiLog.vue +79 -0
- package/src/pages/system/applicationType.vue +182 -0
- package/src/pages/system/customPage.vue +62 -0
- package/src/pages/system/customTable.vue +98 -0
- package/src/pages/system/dict.vue +36 -0
- package/src/pages/system/dictType.vue +58 -0
- package/src/pages/system/entityView.vue +38 -0
- package/src/pages/system/error/404.vue +6 -0
- package/src/pages/system/extendColumn.vue +99 -0
- package/src/pages/system/formView.vue +136 -0
- package/src/pages/system/log.vue +55 -0
- package/src/pages/system/notice.vue +26 -0
- package/src/pages/system/openApi.vue +26 -0
- package/src/pages/system/openUser.vue +66 -0
- package/src/pages/system/organization.vue +98 -0
- package/src/pages/system/organizationType.vue +26 -0
- package/src/pages/system/permission.vue +175 -0
- package/src/pages/system/planJob.vue +40 -0
- package/src/pages/system/printTemplate.vue +48 -0
- package/src/pages/system/process.vue +79 -0
- package/src/pages/system/processType.vue +26 -0
- package/src/pages/system/role.vue +395 -0
- package/src/pages/system/rolePropertyEdit.vue +480 -0
- package/src/pages/system/sequenceSetting.vue +26 -0
- package/src/pages/system/systemData.vue +52 -0
- package/src/pages/system/tableView.vue +386 -0
- package/src/pages/system/taskQueue.vue +48 -0
- package/src/pages/system/user.vue +250 -0
- package/src/pages/template/processPage.vue +243 -0
- package/src/pages/template/reportPage.vue +66 -0
- package/src/pages/template/viewPage.vue +139 -0
- package/src/plugins/auth/index.js +21 -0
- package/src/plugins/error/index.js +31 -0
- package/src/plugins/index.js +24 -0
- package/src/plugins/sweetalert2/index.js +20 -0
- package/src/router/dynamic.js +183 -0
- package/src/router/index.js +84 -0
- package/src/setting.js +202 -0
- package/src/store/index.js +9 -0
- package/src/store/modules/admin/index.js +16 -0
- package/src/store/modules/admin/modules/account.js +103 -0
- package/src/store/modules/admin/modules/cache.js +119 -0
- package/src/store/modules/admin/modules/dataView.js +112 -0
- package/src/store/modules/admin/modules/db.js +231 -0
- package/src/store/modules/admin/modules/i18n.js +87 -0
- package/src/store/modules/admin/modules/layout.js +115 -0
- package/src/store/modules/admin/modules/loader.js +44 -0
- package/src/store/modules/admin/modules/log.js +77 -0
- package/src/store/modules/admin/modules/menu.js +338 -0
- package/src/store/modules/admin/modules/page.js +466 -0
- package/src/store/modules/admin/modules/user.js +96 -0
- package/src/store/modules/admin/modules/viewPage.js +34 -0
- package/src/styles/common.less +47 -0
- package/src/styles/css/default.css +510 -0
- package/src/styles/css/login.css +1217 -0
- package/src/styles/default/index.less +6 -0
- package/src/styles/font/demo.css +539 -0
- package/src/styles/font/demo_index.html +372 -0
- package/src/styles/font/icon-demo/demo.css +539 -0
- package/src/styles/font/icon-demo/demo_index.html +423 -0
- package/src/styles/font/icon-demo/iconfont.css +61 -0
- package/src/styles/font/icon-demo/iconfont.eot +0 -0
- package/src/styles/font/icon-demo/iconfont.js +1 -0
- package/src/styles/font/icon-demo/iconfont.svg +59 -0
- package/src/styles/font/icon-demo/iconfont.ttf +0 -0
- package/src/styles/font/icon-demo/iconfont.woff +0 -0
- package/src/styles/font/icon-demo/iconfont.woff2 +0 -0
- package/src/styles/font/iconfont.css +47 -0
- package/src/styles/font/iconfont.js +1 -0
- package/src/styles/font/iconfont.json +65 -0
- package/src/styles/font/iconfont.ttf +0 -0
- package/src/styles/font/iconfont.woff +0 -0
- package/src/styles/font/iconfont.woff2 +0 -0
- package/src/styles/font/ionicons.svg +870 -0
- package/src/styles/font/ionicons.ttf +0 -0
- package/src/styles/font/ionicons.woff +0 -0
- package/src/styles/font/ionicons.woff2 +0 -0
- package/src/styles/index.less +7 -0
- package/src/styles/layout/basic-layout/layout.less +527 -0
- package/src/styles/layout/basic-layout/menu.less +274 -0
- package/src/styles/layout/index.less +2 -0
- package/src/styles/setting.less +6 -0
- package/styleguide.config.js +22 -0
- package/test/api/barcode.js +50 -0
- package/test/api/inbound.js +47 -0
- package/test/api/interfaceLog.js +15 -0
- package/test/api/interfaceQueue.js +15 -0
- package/test/api/interfaceServer.js +29 -0
- package/test/api/movePlan.js +50 -0
- package/test/api/movePlanItem.js +13 -0
- package/test/api/moveType.js +22 -0
- package/test/api/openApiPermission.js +25 -0
- package/test/api/outbound.js +40 -0
- package/test/api/permission.js +34 -0
- package/test/api/rolePermission.js +17 -0
- package/test/api/user.js +40 -0
- package/test/api/viewColumn.js +16 -0
- package/test/api/warehouse.js +13 -0
- package/test/api/warehouseMoveType.js +18 -0
- package/test/main.js +55 -0
- package/test/package.js +33 -0
- package/test/pages/home/index.vue +22 -0
- package/test/pages/task/test.vue +28 -0
- package/test/pages/test/dataViewTest.vue +28 -0
- package/test/pages/test/logReport.vue +25 -0
- package/test/pages/test/testPage.vue +38 -0
- package/test/router/routes.js +88 -0
- package/test/setting.env.js +22 -0
- package/test/styles/css/custom.css +0 -0
- package/test/styles/css/login.css +1217 -0
- package/vite.config.js +72 -0
- package/vue.config.js +20 -0
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div style="display: inline-flex">
|
|
3
|
+
<span class="i-layout-header-trigger i-layout-header-trigger-min i-layout-header-trigger-in">
|
|
4
|
+
<Notification
|
|
5
|
+
:wide="isMobile"
|
|
6
|
+
:badge-props="badgeProps"
|
|
7
|
+
class="i-layout-header-notice"
|
|
8
|
+
:class="{ 'i-layout-header-notice-mobile': isMobile }"
|
|
9
|
+
auto-count
|
|
10
|
+
@on-load-more="handleLoadMore"
|
|
11
|
+
@on-clear="handleClear"
|
|
12
|
+
>
|
|
13
|
+
<template #icon>
|
|
14
|
+
<Icon custom="i-icon i-icon-notification" />
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<NotificationTab
|
|
18
|
+
title="待办"
|
|
19
|
+
name="task"
|
|
20
|
+
:count="taskCount"
|
|
21
|
+
:loaded-all="taskFilter.page * taskFilter.per >= taskCount"
|
|
22
|
+
:loading="taskLoading"
|
|
23
|
+
:scroll-to-load="false"
|
|
24
|
+
:show-clear="false"
|
|
25
|
+
>
|
|
26
|
+
<NotificationItem
|
|
27
|
+
v-for="(item, index) in taskList"
|
|
28
|
+
:key="index"
|
|
29
|
+
:title="item.title"
|
|
30
|
+
:icon="item.icon"
|
|
31
|
+
:icon-color="item.iconColor"
|
|
32
|
+
:content="item.content"
|
|
33
|
+
:read="item.read"
|
|
34
|
+
@on-item-click="$refs.taskForm.open(item.task)"
|
|
35
|
+
/>
|
|
36
|
+
</NotificationTab>
|
|
37
|
+
<NotificationTab
|
|
38
|
+
title="通知"
|
|
39
|
+
name="notification"
|
|
40
|
+
:count="unreadCount"
|
|
41
|
+
:loaded-all="notificationFilter.page * notificationFilter.per >= notificationCount"
|
|
42
|
+
:loading="notificationLoading"
|
|
43
|
+
:scroll-to-load="false"
|
|
44
|
+
>
|
|
45
|
+
<NotificationItem
|
|
46
|
+
v-for="(item, index) in notificationList"
|
|
47
|
+
:key="index"
|
|
48
|
+
:title="item.notification.title"
|
|
49
|
+
:icon="item.icon"
|
|
50
|
+
:icon-color="item.iconColor"
|
|
51
|
+
:time="item.notification.sendTime"
|
|
52
|
+
:read="item.notification.isRead ? 1 : 0"
|
|
53
|
+
@on-item-click="openNotification(item.notification)"
|
|
54
|
+
/>
|
|
55
|
+
</NotificationTab>
|
|
56
|
+
</Notification>
|
|
57
|
+
</span>
|
|
58
|
+
<task-form ref="taskForm"></task-form>
|
|
59
|
+
<modal-form ref="notificationForm" view-code="NotificationView" :save-enable="false"></modal-form>
|
|
60
|
+
</div>
|
|
61
|
+
</template>
|
|
62
|
+
<script>
|
|
63
|
+
import { mapState } from 'vuex';
|
|
64
|
+
import taskApi from '../../../api/task';
|
|
65
|
+
import notificationApi from '../../../api/notification';
|
|
66
|
+
import mixinPage from '../../../mixins/page';
|
|
67
|
+
import taskForm from '../../../pages/common/task-form';
|
|
68
|
+
|
|
69
|
+
export default {
|
|
70
|
+
name: 'iHeaderNotice',
|
|
71
|
+
mixins: [mixinPage],
|
|
72
|
+
components: { taskForm },
|
|
73
|
+
data() {
|
|
74
|
+
return {
|
|
75
|
+
badgeProps: {
|
|
76
|
+
offset: [20, 0]
|
|
77
|
+
},
|
|
78
|
+
taskList: [],
|
|
79
|
+
taskLoading: false,
|
|
80
|
+
taskFilter: {},
|
|
81
|
+
taskCount: 0,
|
|
82
|
+
notificationList: [],
|
|
83
|
+
notificationLoading: false,
|
|
84
|
+
notificationFilter: {},
|
|
85
|
+
notificationCount: 0,
|
|
86
|
+
unreadCount: 0
|
|
87
|
+
};
|
|
88
|
+
},
|
|
89
|
+
computed: {
|
|
90
|
+
...mapState('admin/layout', ['isMobile']),
|
|
91
|
+
unreadMessage() {
|
|
92
|
+
let unread = 0;
|
|
93
|
+
this.notificationList.forEach(item => {
|
|
94
|
+
if (!item.read) unread++;
|
|
95
|
+
});
|
|
96
|
+
return unread;
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
async mounted() {
|
|
100
|
+
this.init();
|
|
101
|
+
},
|
|
102
|
+
methods: {
|
|
103
|
+
// 初始化
|
|
104
|
+
init() {
|
|
105
|
+
this.taskList = [];
|
|
106
|
+
this.taskLoading = false;
|
|
107
|
+
this.taskFilter.page = 0;
|
|
108
|
+
this.taskFilter.per = 5;
|
|
109
|
+
this.taskFilter.orderBy = '-createTime';
|
|
110
|
+
this.taskCount = 0;
|
|
111
|
+
|
|
112
|
+
this.notificationList = [];
|
|
113
|
+
this.notificationLoading = false;
|
|
114
|
+
this.notificationFilter.page = 0;
|
|
115
|
+
this.notificationFilter.per = 5;
|
|
116
|
+
this.notificationFilter.orderBy = '-createTime';
|
|
117
|
+
this.notificationCount = 0;
|
|
118
|
+
this.unreadCount = 0;
|
|
119
|
+
|
|
120
|
+
this.loadMore('notification');
|
|
121
|
+
this.loadMore('task');
|
|
122
|
+
},
|
|
123
|
+
handleLoadMore(tab) {
|
|
124
|
+
this.loadMore(tab.name);
|
|
125
|
+
},
|
|
126
|
+
async loadMore(type) {
|
|
127
|
+
if (this[`${type}Loading`]) return;
|
|
128
|
+
this[`${type}Loading`] = true;
|
|
129
|
+
|
|
130
|
+
if (type == 'notification') {
|
|
131
|
+
this.notificationFilter.page++;
|
|
132
|
+
const res = await notificationApi.queryMy(this.notificationFilter);
|
|
133
|
+
this.unreadCount = res.unreadCount;
|
|
134
|
+
this.notificationCount = res.totalCount;
|
|
135
|
+
|
|
136
|
+
this.notificationList = this.notificationList.concat(
|
|
137
|
+
res.data.map(item => {
|
|
138
|
+
let icon = '';
|
|
139
|
+
let iconColor = '';
|
|
140
|
+
if (item.notificationType == 'Notification') {
|
|
141
|
+
icon = 'md-mail';
|
|
142
|
+
iconColor = '#3391e5';
|
|
143
|
+
} else if (item.notificationType == 'Notice') {
|
|
144
|
+
icon = 'md-home';
|
|
145
|
+
iconColor = '#87d068';
|
|
146
|
+
} else if (item.notificationType == 'Alert') {
|
|
147
|
+
icon = 'md-warning';
|
|
148
|
+
iconColor = '#fe5c57';
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
return {
|
|
152
|
+
icon: icon,
|
|
153
|
+
iconColor: iconColor,
|
|
154
|
+
notification: item
|
|
155
|
+
};
|
|
156
|
+
})
|
|
157
|
+
);
|
|
158
|
+
} else {
|
|
159
|
+
this.taskFilter.page++;
|
|
160
|
+
const res = await taskApi.queryMy(this.taskFilter);
|
|
161
|
+
this.taskCount = res.totalCount;
|
|
162
|
+
|
|
163
|
+
this.taskList = this.taskList.concat(
|
|
164
|
+
res.data.map(item => {
|
|
165
|
+
let icon = 'ios-create';
|
|
166
|
+
let iconColor = '#ff9900';
|
|
167
|
+
return {
|
|
168
|
+
icon: icon,
|
|
169
|
+
iconColor: iconColor,
|
|
170
|
+
title: item.processInst.applicationType.name + ' - ' + item.activityInst.activity.name,
|
|
171
|
+
content: item.processInst.title,
|
|
172
|
+
read: 1,
|
|
173
|
+
task: item
|
|
174
|
+
};
|
|
175
|
+
})
|
|
176
|
+
);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
this[`${type}Loading`] = false;
|
|
180
|
+
},
|
|
181
|
+
handleClear(tab) {
|
|
182
|
+
this.clearUnread(tab.name);
|
|
183
|
+
},
|
|
184
|
+
clearUnread(type) {
|
|
185
|
+
if (type == 'notification') {
|
|
186
|
+
this.confirm('确定要清空收件箱吗?', async () => {
|
|
187
|
+
await notificationApi.clear();
|
|
188
|
+
|
|
189
|
+
this.notificationFilter.page = 1;
|
|
190
|
+
this.notificationCount = 0;
|
|
191
|
+
this.unreadCount = 0;
|
|
192
|
+
this.notificationList = [];
|
|
193
|
+
//this.$forceUpdate();
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
this[`${type}List`] = this[`${type}List`].map(item => {
|
|
198
|
+
item.read = 1;
|
|
199
|
+
return item;
|
|
200
|
+
});
|
|
201
|
+
},
|
|
202
|
+
loadTask() {
|
|
203
|
+
this.taskList = [];
|
|
204
|
+
this.taskFilter.page = 0;
|
|
205
|
+
this.loadMore('task');
|
|
206
|
+
},
|
|
207
|
+
openNotification(item) {
|
|
208
|
+
if (!item.isRead) {
|
|
209
|
+
this.unreadCount--;
|
|
210
|
+
item.isRead = true;
|
|
211
|
+
notificationApi.read(item.id);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
this.$refs.notificationForm.open(item);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
</script>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<span class="i-layout-header-trigger" :class="{ 'i-layout-header-trigger-min': showSiderCollapse }" @click="handleReload">
|
|
3
|
+
<Icon custom="i-icon i-icon-refresh" />
|
|
4
|
+
</span>
|
|
5
|
+
</template>
|
|
6
|
+
<script>
|
|
7
|
+
import { mapState } from 'vuex';
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
name: 'iHeaderReload',
|
|
11
|
+
emits: ['on-reload'],
|
|
12
|
+
computed: {
|
|
13
|
+
...mapState('admin/layout', ['isMobile', 'showSiderCollapse'])
|
|
14
|
+
},
|
|
15
|
+
methods: {
|
|
16
|
+
handleReload() {
|
|
17
|
+
this.$emit('on-reload');
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
</script>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<span v-if="isDesktop" class="i-layout-header-trigger i-layout-header-trigger-min i-layout-header-trigger-in i-layout-header-trigger-nohover">
|
|
3
|
+
<input class="i-layout-header-search" type="text" :placeholder="$t('basicLayout.search.placeholder')" />
|
|
4
|
+
</span>
|
|
5
|
+
<Dropdown v-else trigger="click" class="i-layout-header-search-drop" ref="dropdown">
|
|
6
|
+
<span class="i-layout-header-trigger i-layout-header-trigger-min">
|
|
7
|
+
<Icon type="ios-search" />
|
|
8
|
+
</span>
|
|
9
|
+
<template #list>
|
|
10
|
+
<DropdownMenu>
|
|
11
|
+
<Row align="middle">
|
|
12
|
+
<Col flex="auto" class="ivu-pl-4">
|
|
13
|
+
<Input size="large" prefix="ios-search" :placeholder="$t('basicLayout.search.placeholder')" />
|
|
14
|
+
</Col>
|
|
15
|
+
<Col flex="80px" class="ivu-text-center">
|
|
16
|
+
<span @click="handleCloseSearch">{{ $t('basicLayout.search.cancel') }}</span>
|
|
17
|
+
</Col>
|
|
18
|
+
</Row>
|
|
19
|
+
</DropdownMenu>
|
|
20
|
+
</template>
|
|
21
|
+
</Dropdown>
|
|
22
|
+
</template>
|
|
23
|
+
<script>
|
|
24
|
+
import { mapState } from 'vuex';
|
|
25
|
+
|
|
26
|
+
export default {
|
|
27
|
+
name: 'iHeaderSearch',
|
|
28
|
+
computed: {
|
|
29
|
+
...mapState('admin/layout', ['isDesktop', 'headerMenu'])
|
|
30
|
+
},
|
|
31
|
+
methods: {
|
|
32
|
+
handleCloseSearch() {
|
|
33
|
+
this.$refs.dropdown.handleClick();
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
</script>
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<span class="i-layout-header-trigger i-layout-header-trigger-min" @click="showSetting">
|
|
3
|
+
<Icon type="md-more" />
|
|
4
|
+
|
|
5
|
+
<Drawer v-model="visible" width="280">
|
|
6
|
+
<Divider size="small">主题风格设置</Divider>
|
|
7
|
+
|
|
8
|
+
<div class="i-layout-header-setting-item">
|
|
9
|
+
<div class="i-layout-header-setting-item-radio" :class="{ on: siderTheme === 'dark' }" @click="handleChangeSetting('siderTheme', 'dark')">
|
|
10
|
+
<Tooltip content="暗色侧边栏" placement="top" transfer>
|
|
11
|
+
<img src="../../../assets/svg/nav-theme-dark.svg" />
|
|
12
|
+
</Tooltip>
|
|
13
|
+
</div>
|
|
14
|
+
<div class="i-layout-header-setting-item-radio" :class="{ on: siderTheme === 'light' }" @click="handleChangeSetting('siderTheme', 'light')">
|
|
15
|
+
<Tooltip content="亮色侧边栏" placement="top" transfer>
|
|
16
|
+
<img src="../../../assets/svg/nav-theme-light.svg" />
|
|
17
|
+
</Tooltip>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
<div class="i-layout-header-setting-item">
|
|
21
|
+
<div class="i-layout-header-setting-item-radio" :class="{ on: headerTheme === 'light' }" @click="handleChangeSetting('headerTheme', 'light')">
|
|
22
|
+
<Tooltip content="亮色顶栏" placement="top" transfer>
|
|
23
|
+
<img src="../../../assets/svg/nav-theme-dark.svg" />
|
|
24
|
+
</Tooltip>
|
|
25
|
+
</div>
|
|
26
|
+
<div class="i-layout-header-setting-item-radio" :class="{ on: headerTheme === 'dark' }" @click="handleChangeSetting('headerTheme', 'dark')">
|
|
27
|
+
<Tooltip content="暗色顶栏" placement="top" transfer>
|
|
28
|
+
<img src="../../../assets/svg/header-theme-dark.svg" />
|
|
29
|
+
</Tooltip>
|
|
30
|
+
</div>
|
|
31
|
+
<div class="i-layout-header-setting-item-radio" :class="{ on: headerTheme === 'primary' }" @click="handleChangeSetting('headerTheme', 'primary')">
|
|
32
|
+
<Tooltip content="主色顶栏" placement="top" transfer>
|
|
33
|
+
<img src="../../../assets/svg/header-theme-primary.svg" />
|
|
34
|
+
</Tooltip>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
<Divider size="small">导航设置</Divider>
|
|
39
|
+
|
|
40
|
+
<div class="i-layout-header-setting-item">
|
|
41
|
+
<span class="i-layout-header-setting-item-desc">显示顶栏菜单</span>
|
|
42
|
+
<span class="i-layout-header-setting-item-action">
|
|
43
|
+
<Switch size="small" :model-value="headerMenu" @on-change="val => handleChangeSetting('headerMenu', val)" />
|
|
44
|
+
</span>
|
|
45
|
+
</div>
|
|
46
|
+
<div class="i-layout-header-setting-item">
|
|
47
|
+
<span class="i-layout-header-setting-item-desc">固定侧边栏</span>
|
|
48
|
+
<span class="i-layout-header-setting-item-action">
|
|
49
|
+
<Switch size="small" :model-value="siderFix" @on-change="val => handleChangeSetting('siderFix', val)" />
|
|
50
|
+
</span>
|
|
51
|
+
</div>
|
|
52
|
+
<div class="i-layout-header-setting-item">
|
|
53
|
+
<span class="i-layout-header-setting-item-desc">固定顶栏</span>
|
|
54
|
+
<span class="i-layout-header-setting-item-action">
|
|
55
|
+
<Switch size="small" :model-value="headerFix" @on-change="val => handleChangeSetting('headerFix', val)" />
|
|
56
|
+
</span>
|
|
57
|
+
</div>
|
|
58
|
+
<div class="i-layout-header-setting-item" :class="{ 'i-layout-header-setting-item-disabled': !headerFix }">
|
|
59
|
+
<span class="i-layout-header-setting-item-desc">
|
|
60
|
+
下滑时隐藏顶栏
|
|
61
|
+
<Tooltip placement="top" content="需开启固定顶栏" transfer>
|
|
62
|
+
<Icon type="ios-help-circle-outline" />
|
|
63
|
+
</Tooltip>
|
|
64
|
+
</span>
|
|
65
|
+
<span class="i-layout-header-setting-item-action">
|
|
66
|
+
<Switch size="small" :model-value="headerHide" :disabled="!headerFix" @on-change="val => handleChangeSetting('headerHide', val)" />
|
|
67
|
+
</span>
|
|
68
|
+
</div>
|
|
69
|
+
<div class="i-layout-header-setting-item" :class="{ 'i-layout-header-setting-item-disabled': !headerFix }">
|
|
70
|
+
<span class="i-layout-header-setting-item-desc">
|
|
71
|
+
置顶顶栏
|
|
72
|
+
<Tooltip placement="top" content="需开启固定顶栏" transfer>
|
|
73
|
+
<Icon type="ios-help-circle-outline" />
|
|
74
|
+
</Tooltip>
|
|
75
|
+
</span>
|
|
76
|
+
<span class="i-layout-header-setting-item-action">
|
|
77
|
+
<Switch size="small" :model-value="headerStick" :disabled="!headerFix" @on-change="val => handleChangeSetting('headerStick', val)" />
|
|
78
|
+
</span>
|
|
79
|
+
</div>
|
|
80
|
+
<div class="i-layout-header-setting-item">
|
|
81
|
+
<span class="i-layout-header-setting-item-desc">侧边栏开启手风琴模式</span>
|
|
82
|
+
<span class="i-layout-header-setting-item-action">
|
|
83
|
+
<Switch size="small" :model-value="menuAccordion" @on-change="val => handleChangeSetting('menuAccordion', val)" />
|
|
84
|
+
</span>
|
|
85
|
+
</div>
|
|
86
|
+
<div class="i-layout-header-setting-item">
|
|
87
|
+
<span class="i-layout-header-setting-item-desc">显示折叠侧边栏按钮</span>
|
|
88
|
+
<span class="i-layout-header-setting-item-action">
|
|
89
|
+
<Switch size="small" :model-value="showSiderCollapse" @on-change="val => handleChangeSetting('showSiderCollapse', val)" />
|
|
90
|
+
</span>
|
|
91
|
+
</div>
|
|
92
|
+
<div class="i-layout-header-setting-item">
|
|
93
|
+
<span class="i-layout-header-setting-item-desc">侧边栏折叠时显示父级菜单名</span>
|
|
94
|
+
<span class="i-layout-header-setting-item-action">
|
|
95
|
+
<Switch size="small" :model-value="showCollapseMenuTitle" @on-change="val => handleChangeSetting('showCollapseMenuTitle', val)" />
|
|
96
|
+
</span>
|
|
97
|
+
</div>
|
|
98
|
+
<div class="i-layout-header-setting-item">
|
|
99
|
+
<span class="i-layout-header-setting-item-desc">
|
|
100
|
+
显示全局面包屑导航
|
|
101
|
+
<Tooltip placement="top" content="headerMenu 开启时无效" transfer>
|
|
102
|
+
<Icon type="ios-help-circle-outline" />
|
|
103
|
+
</Tooltip>
|
|
104
|
+
</span>
|
|
105
|
+
<span class="i-layout-header-setting-item-action">
|
|
106
|
+
<Switch size="small" :model-value="showBreadcrumb" @on-change="val => handleChangeSetting('showBreadcrumb', val)" />
|
|
107
|
+
</span>
|
|
108
|
+
</div>
|
|
109
|
+
<div class="i-layout-header-setting-item" :class="{ 'i-layout-header-setting-item-disabled': !showBreadcrumb }">
|
|
110
|
+
<span class="i-layout-header-setting-item-desc">
|
|
111
|
+
全局面包屑显示图标
|
|
112
|
+
<Tooltip placement="top" content="需开启全局面包屑导航" transfer>
|
|
113
|
+
<Icon type="ios-help-circle-outline" />
|
|
114
|
+
</Tooltip>
|
|
115
|
+
</span>
|
|
116
|
+
<span class="i-layout-header-setting-item-action">
|
|
117
|
+
<Switch size="small" :model-value="showBreadcrumbIcon" :disabled="!showBreadcrumb" @on-change="val => handleChangeSetting('showBreadcrumbIcon', val)" />
|
|
118
|
+
</span>
|
|
119
|
+
</div>
|
|
120
|
+
<div class="i-layout-header-setting-item">
|
|
121
|
+
<span class="i-layout-header-setting-item-desc">显示重载页面按钮</span>
|
|
122
|
+
<span class="i-layout-header-setting-item-action">
|
|
123
|
+
<Switch size="small" :model-value="showReload" @on-change="val => handleChangeSetting('showReload', val)" />
|
|
124
|
+
</span>
|
|
125
|
+
</div>
|
|
126
|
+
<div class="i-layout-header-setting-item">
|
|
127
|
+
<span class="i-layout-header-setting-item-desc">显示多语言选择</span>
|
|
128
|
+
<span class="i-layout-header-setting-item-action">
|
|
129
|
+
<Switch size="small" :model-value="showI18n" @on-change="val => handleChangeSetting('showI18n', val)" />
|
|
130
|
+
</span>
|
|
131
|
+
</div>
|
|
132
|
+
|
|
133
|
+
<Divider size="small">其它设置</Divider>
|
|
134
|
+
|
|
135
|
+
<div class="i-layout-header-setting-item">
|
|
136
|
+
<span class="i-layout-header-setting-item-desc">开启多页签</span>
|
|
137
|
+
<span class="i-layout-header-setting-item-action">
|
|
138
|
+
<Switch size="small" :model-value="tabs" @on-change="val => handleChangeSetting('tabs', val)" />
|
|
139
|
+
</span>
|
|
140
|
+
</div>
|
|
141
|
+
<div class="i-layout-header-setting-item" :class="{ 'i-layout-header-setting-item-disabled': !tabs }">
|
|
142
|
+
<span class="i-layout-header-setting-item-desc">
|
|
143
|
+
多页签显示图标
|
|
144
|
+
<Tooltip placement="top" content="需开启多页签" transfer>
|
|
145
|
+
<Icon type="ios-help-circle-outline" />
|
|
146
|
+
</Tooltip>
|
|
147
|
+
</span>
|
|
148
|
+
<span class="i-layout-header-setting-item-action">
|
|
149
|
+
<Switch size="small" :model-value="showTabsIcon" :disabled="!tabs" @on-change="val => handleChangeSetting('showTabsIcon', val)" />
|
|
150
|
+
</span>
|
|
151
|
+
</div>
|
|
152
|
+
<div class="i-layout-header-setting-item" :class="{ 'i-layout-header-setting-item-disabled': !tabs }">
|
|
153
|
+
<span class="i-layout-header-setting-item-desc">
|
|
154
|
+
固定多页签
|
|
155
|
+
<Tooltip placement="top" content="需开启多页签" transfer>
|
|
156
|
+
<Icon type="ios-help-circle-outline" />
|
|
157
|
+
</Tooltip>
|
|
158
|
+
</span>
|
|
159
|
+
<span class="i-layout-header-setting-item-action">
|
|
160
|
+
<Switch size="small" :model-value="tabsFix" :disabled="!tabs" @on-change="val => handleChangeSetting('tabsFix', val)" />
|
|
161
|
+
</span>
|
|
162
|
+
</div>
|
|
163
|
+
<Alert type="warning">
|
|
164
|
+
<template #desc>
|
|
165
|
+
<div>
|
|
166
|
+
该功能主要实时预览各种布局效果,更多完整配置在
|
|
167
|
+
<strong>setting.js</strong>
|
|
168
|
+
中设置。建议在生产环境关闭该布局预览功能。
|
|
169
|
+
</div>
|
|
170
|
+
</template>
|
|
171
|
+
</Alert>
|
|
172
|
+
</Drawer>
|
|
173
|
+
</span>
|
|
174
|
+
</template>
|
|
175
|
+
<script>
|
|
176
|
+
import { mapState, mapMutations } from 'vuex';
|
|
177
|
+
|
|
178
|
+
export default {
|
|
179
|
+
name: 'iHeaderSetting',
|
|
180
|
+
data() {
|
|
181
|
+
return {
|
|
182
|
+
visible: false
|
|
183
|
+
};
|
|
184
|
+
},
|
|
185
|
+
computed: {
|
|
186
|
+
...mapState('admin/layout', [
|
|
187
|
+
'siderTheme',
|
|
188
|
+
'headerTheme',
|
|
189
|
+
'headerStick',
|
|
190
|
+
'headerMenu',
|
|
191
|
+
'siderFix',
|
|
192
|
+
'headerFix',
|
|
193
|
+
'headerHide',
|
|
194
|
+
'menuAccordion',
|
|
195
|
+
'showSiderCollapse',
|
|
196
|
+
'tabs',
|
|
197
|
+
'showTabsIcon',
|
|
198
|
+
'tabsFix',
|
|
199
|
+
'showBreadcrumb',
|
|
200
|
+
'showBreadcrumbIcon',
|
|
201
|
+
'showReload',
|
|
202
|
+
'showI18n',
|
|
203
|
+
'showCollapseMenuTitle'
|
|
204
|
+
])
|
|
205
|
+
},
|
|
206
|
+
methods: {
|
|
207
|
+
...mapMutations('admin/layout', ['updateLayoutSetting']),
|
|
208
|
+
showSetting() {
|
|
209
|
+
this.visible = true;
|
|
210
|
+
},
|
|
211
|
+
handleChangeSetting(key, value) {
|
|
212
|
+
this.updateLayoutSetting({
|
|
213
|
+
key,
|
|
214
|
+
value
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
</script>
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<span class="i-layout-header-trigger i-layout-header-trigger-min">
|
|
3
|
+
<Dropdown :trigger="isMobile ? 'click' : 'hover'" class="i-layout-header-user" :class="{ 'i-layout-header-user-mobile': isMobile }" @on-click="handleClick">
|
|
4
|
+
<Avatar size="small" :src="info.avatar" v-if="info.avatar" />
|
|
5
|
+
<Icon type="md-person" v-if="!info.avatar" />
|
|
6
|
+
<span class="i-layout-header-user-name" v-if="!isMobile">{{ info.name }}</span>
|
|
7
|
+
<template #list>
|
|
8
|
+
<DropdownMenu>
|
|
9
|
+
<DropdownItem>
|
|
10
|
+
<label @click="resetPwdOpen">
|
|
11
|
+
<Icon type="ios-lock" />
|
|
12
|
+
<span>修改密码</span>
|
|
13
|
+
</label>
|
|
14
|
+
</DropdownItem>
|
|
15
|
+
<DropdownItem>
|
|
16
|
+
<label @click="$refs.form.open(info)">
|
|
17
|
+
<Icon type="ios-contact" />
|
|
18
|
+
<span>个人信息</span>
|
|
19
|
+
</label>
|
|
20
|
+
</DropdownItem>
|
|
21
|
+
<!-- <i-link to="/setting/user">
|
|
22
|
+
<DropdownItem>
|
|
23
|
+
<Icon type="ios-contact-outline" />
|
|
24
|
+
<span>{{ $t('basicLayout.user.center') }}</span>
|
|
25
|
+
</DropdownItem>
|
|
26
|
+
</i-link>
|
|
27
|
+
<i-link to="/setting/account">
|
|
28
|
+
<DropdownItem>
|
|
29
|
+
<Icon type="ios-settings-outline" />
|
|
30
|
+
<span>{{ $t('basicLayout.user.setting') }}</span>
|
|
31
|
+
</DropdownItem>
|
|
32
|
+
</i-link> -->
|
|
33
|
+
<DropdownItem divided name="logout">
|
|
34
|
+
<Icon type="ios-log-out" />
|
|
35
|
+
<span>{{ $t('basicLayout.user.logOut') }}</span>
|
|
36
|
+
</DropdownItem>
|
|
37
|
+
</DropdownMenu>
|
|
38
|
+
</template>
|
|
39
|
+
</Dropdown>
|
|
40
|
+
<template>
|
|
41
|
+
<Modal v-model="resetPwdOpened" scrollable>
|
|
42
|
+
<template #header>
|
|
43
|
+
<div>
|
|
44
|
+
<span class="title">修改密码</span>
|
|
45
|
+
<span class="description">Change Password</span>
|
|
46
|
+
</div>
|
|
47
|
+
</template>
|
|
48
|
+
<div class="ivu-ml-8 ivu-mr-8">
|
|
49
|
+
<Form ref="resetPwdForm" :model="resetPwdData" :rules="resetPwdRule" label-position="top" label-colon=":" class="ivu-mt" @submit.prevent>
|
|
50
|
+
<Row :gutter="24" type="flex">
|
|
51
|
+
<Col v-bind="grid24">
|
|
52
|
+
<FormItem label="旧密码" key="oldPwd" prop="oldPwd">
|
|
53
|
+
<Input type="password" v-model="resetPwdData.oldPwd" />
|
|
54
|
+
</FormItem>
|
|
55
|
+
</Col>
|
|
56
|
+
<Col v-bind="grid24">
|
|
57
|
+
<FormItem label="新密码" key="newPwd" prop="newPwd">
|
|
58
|
+
<Input type="password" v-model="resetPwdData.newPwd" />
|
|
59
|
+
</FormItem>
|
|
60
|
+
</Col>
|
|
61
|
+
<Col v-bind="grid24">
|
|
62
|
+
<FormItem label="确认新密码" key="checkPwd" prop="checkPwd">
|
|
63
|
+
<Input type="password" v-model="resetPwdData.checkPwd" />
|
|
64
|
+
</FormItem>
|
|
65
|
+
</Col>
|
|
66
|
+
</Row>
|
|
67
|
+
</Form>
|
|
68
|
+
</div>
|
|
69
|
+
<template #footer>
|
|
70
|
+
<Button type="primary" custom-icon="fa fa-check" @click="submitChangePwd">保存</Button>
|
|
71
|
+
</template>
|
|
72
|
+
</Modal>
|
|
73
|
+
</template>
|
|
74
|
+
<modal-form ref="form" view-code="UserInfoEdit">
|
|
75
|
+
<template #footer>
|
|
76
|
+
<Button type="primary" custom-icon="fa fa-save" @click="submitUserInfo">保存</Button>
|
|
77
|
+
</template>
|
|
78
|
+
</modal-form>
|
|
79
|
+
</span>
|
|
80
|
+
</template>
|
|
81
|
+
<script>
|
|
82
|
+
import { mapState, mapActions } from 'vuex';
|
|
83
|
+
import userlApi from '../../../api/user';
|
|
84
|
+
import mixinPage from '../../../mixins/page';
|
|
85
|
+
|
|
86
|
+
export default {
|
|
87
|
+
components: {},
|
|
88
|
+
mixins: [mixinPage],
|
|
89
|
+
name: 'iHeaderUser',
|
|
90
|
+
data() {
|
|
91
|
+
return {
|
|
92
|
+
resetPwdOpened: false,
|
|
93
|
+
resetPwdData: {},
|
|
94
|
+
resetPwdRule: {
|
|
95
|
+
oldPwd: {
|
|
96
|
+
type: 'string',
|
|
97
|
+
required: true,
|
|
98
|
+
message: '请输入旧密码',
|
|
99
|
+
trigger: 'blur,change'
|
|
100
|
+
},
|
|
101
|
+
newPwd: {
|
|
102
|
+
type: 'string',
|
|
103
|
+
required: true,
|
|
104
|
+
message: '请输入新密码',
|
|
105
|
+
trigger: 'blur,change'
|
|
106
|
+
},
|
|
107
|
+
checkPwd: {
|
|
108
|
+
type: 'string',
|
|
109
|
+
required: true,
|
|
110
|
+
message: '请重复新密码',
|
|
111
|
+
trigger: 'blur,change'
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
},
|
|
116
|
+
computed: {
|
|
117
|
+
...mapState('admin/user', ['info']),
|
|
118
|
+
...mapState('admin/layout', ['isMobile', 'logoutConfirm'])
|
|
119
|
+
},
|
|
120
|
+
methods: {
|
|
121
|
+
...mapActions('admin/account', ['logout']),
|
|
122
|
+
...mapActions('admin/user', ['set']),
|
|
123
|
+
handleClick(name) {
|
|
124
|
+
if (name === 'logout') {
|
|
125
|
+
this.logout({
|
|
126
|
+
confirm: this.logoutConfirm,
|
|
127
|
+
vm: this
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
// 打开密码修改对话框
|
|
132
|
+
resetPwdOpen() {
|
|
133
|
+
this.resetPwdData = {
|
|
134
|
+
oldPwd: null,
|
|
135
|
+
newPwd: null,
|
|
136
|
+
checkPwd: null
|
|
137
|
+
};
|
|
138
|
+
this.$refs.resetPwdForm.resetFields();
|
|
139
|
+
this.resetPwdOpened = true;
|
|
140
|
+
},
|
|
141
|
+
// 修改密码提交保存
|
|
142
|
+
async submitChangePwd() {
|
|
143
|
+
let isOK = await this.$refs.resetPwdForm.validate();
|
|
144
|
+
|
|
145
|
+
if (!isOK) {
|
|
146
|
+
this.error('有内容不符合要求,请正确填写!');
|
|
147
|
+
} else {
|
|
148
|
+
if (this.resetPwdData.newPwd != this.resetPwdData.checkPwd) {
|
|
149
|
+
this.error('两次新密码输入不一致!');
|
|
150
|
+
} else {
|
|
151
|
+
await userlApi.updatePassword({
|
|
152
|
+
oldPassword: this.resetPwdData.oldPwd,
|
|
153
|
+
newPassword: this.resetPwdData.newPwd
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
this.success('修改成功!', () => {
|
|
157
|
+
this.resetPwdOpened = false;
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
// 保存用户信息
|
|
163
|
+
submitUserInfo() {
|
|
164
|
+
this.confirm('确定要保存吗?', async () => {
|
|
165
|
+
await userlApi.updateUser(this.$refs.form.data);
|
|
166
|
+
|
|
167
|
+
this.success('修改成功!', () => {
|
|
168
|
+
this.set(this.$refs.form.data);
|
|
169
|
+
this.$refs.form.opened = false;
|
|
170
|
+
});
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
};
|
|
175
|
+
</script>
|