eoss-ui 0.7.64 → 0.7.66
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/lib/button-group.js +119 -97
- package/lib/button.js +113 -97
- package/lib/calendar.js +2 -2
- package/lib/calogin.js +352 -330
- package/lib/card.js +2 -2
- package/lib/cascader.js +2 -2
- package/lib/checkbox-group.js +119 -97
- package/lib/clients.js +43 -41
- package/lib/config/api.js +12 -1
- package/lib/data-table-form.js +119 -97
- package/lib/data-table.js +119 -97
- package/lib/date-picker.js +120 -104
- package/lib/dialog.js +119 -97
- package/lib/enable-drag.js +2 -2
- package/lib/enterprise.js +2 -2
- package/lib/eoss-ui.common.js +8677 -720
- package/lib/error-page.js +2 -2
- package/lib/flow-group.js +120 -104
- package/lib/flow-list.js +287 -289
- package/lib/flow.js +175 -153
- package/lib/form.js +119 -97
- package/lib/handle-user.js +121 -105
- package/lib/handler.js +114 -98
- package/lib/icon.js +114 -98
- package/lib/icons.js +5 -5
- package/lib/index.js +1 -1
- package/lib/input-number.js +120 -104
- package/lib/input.js +120 -104
- package/lib/label.js +2 -2
- package/lib/layout.js +2 -2
- package/lib/login.js +129 -107
- package/lib/main.js +8505 -545
- package/lib/menu.js +2 -2
- package/lib/nav.js +113 -97
- package/lib/notify.js +116 -100
- package/lib/page.js +120 -104
- package/lib/pagination.js +120 -104
- package/lib/player.js +130 -114
- package/lib/qr-code.js +141 -125
- package/lib/radio-group.js +120 -104
- package/lib/retrial-auth.js +116 -100
- package/lib/select-ganged.js +113 -97
- package/lib/select.js +120 -104
- package/lib/selector-panel.js +140 -118
- package/lib/selector.js +117 -101
- package/lib/sizer.js +115 -99
- package/lib/steps.js +113 -97
- package/lib/switch.js +113 -97
- package/lib/table-form.js +120 -104
- package/lib/tabs-panel.js +2 -2
- package/lib/tabs.js +120 -104
- package/lib/theme-chalk/base.css +1 -1
- package/lib/theme-chalk/fonts/iconfont.ttf +0 -0
- package/lib/theme-chalk/fonts/iconfont.woff +0 -0
- package/lib/theme-chalk/icon.css +1 -1
- package/lib/theme-chalk/index.css +1 -1
- package/lib/theme-chalk/login.css +1 -1
- package/lib/theme-chalk/main.css +1 -1
- package/lib/theme-chalk/menu.css +1 -1
- package/lib/theme-chalk/simplicity-top.css +1 -0
- package/lib/theme-chalk/simplicity.css +1 -1
- package/lib/theme-chalk/sizer.css +1 -1
- package/lib/theme-chalk/upload.css +1 -1
- package/lib/tips.js +121 -105
- package/lib/toolbar.js +2 -2
- package/lib/tree-group.js +120 -104
- package/lib/tree.js +121 -105
- package/lib/upload.js +129 -107
- package/lib/wujie.js +113 -97
- package/lib/wxlogin.js +113 -97
- package/package.json +1 -1
- package/packages/button/index.js +5 -5
- package/packages/button/src/main.vue +418 -418
- package/packages/button-group/index.js +5 -5
- package/packages/calendar/index.js +5 -5
- package/packages/calogin/index.js +5 -5
- package/packages/calogin/src/plugin.js +915 -915
- package/packages/card/index.js +5 -5
- package/packages/card/src/main.vue +156 -156
- package/packages/cascader/index.js +5 -5
- package/packages/cascader/src/main.vue +168 -168
- package/packages/checkbox-group/index.js +5 -5
- package/packages/checkbox-group/src/main.vue +333 -333
- package/packages/clients/index.js +5 -5
- package/packages/clients/src/main.vue +1 -1
- package/packages/data-table/index.js +5 -5
- package/packages/data-table/src/children.vue +39 -39
- package/packages/data-table/src/sizer.vue +195 -195
- package/packages/data-table-form/index.js +5 -5
- package/packages/data-table-form/src/checkbox.vue +101 -101
- package/packages/data-table-form/src/colgroup.vue +17 -17
- package/packages/data-table-form/src/main.vue +181 -181
- package/packages/data-table-form/src/radio.vue +65 -65
- package/packages/data-table-form/src/table.vue +233 -233
- package/packages/data-table-form/src/tbody.vue +336 -336
- package/packages/data-table-form/src/thead.vue +68 -68
- package/packages/date-picker/index.js +5 -5
- package/packages/date-picker/src/main.vue +236 -236
- package/packages/dialog/index.js +5 -5
- package/packages/enable-drag/index.js +5 -5
- package/packages/enterprise/index.js +5 -5
- package/packages/enterprise/src/main.vue +66 -66
- package/packages/error-page/index.js +5 -5
- package/packages/error-page/src/main.vue +44 -44
- package/packages/flow/index.js +5 -5
- package/packages/flow/src/component/TimeLimit.vue +190 -190
- package/packages/flow/src/table.vue +58 -58
- package/packages/flow-group/index.js +5 -5
- package/packages/flow-list/index.js +5 -5
- package/packages/form/index.js +5 -5
- package/packages/handle-user/index.js +5 -5
- package/packages/handler/index.js +5 -5
- package/packages/icon/index.js +5 -5
- package/packages/icons/index.js +5 -5
- package/packages/icons/src/icon.json +1 -1
- package/packages/icons/src/main.vue +81 -81
- package/packages/input/index.js +5 -5
- package/packages/input/src/main.vue +356 -356
- package/packages/input-number/index.js +5 -5
- package/packages/input-number/src/main.vue +106 -106
- package/packages/label/index.js +5 -5
- package/packages/label/src/main.vue +457 -457
- package/packages/layout/index.js +5 -5
- package/packages/layout/src/item.vue +152 -152
- package/packages/layout/src/main.vue +31 -31
- package/packages/login/index.js +5 -5
- package/packages/login/src/main.vue +2 -2
- package/packages/main/index.js +5 -5
- package/packages/main/src/default/message.vue +249 -249
- package/packages/main/src/default/notice.vue +157 -157
- package/packages/main/src/main.vue +18 -0
- package/packages/main/src/public/settings.vue +121 -75
- package/packages/main/src/simplicity/index.vue +5 -5
- package/packages/main/src/simplicity/lists.vue +84 -84
- package/packages/main/src/simplicity/router-page.vue +45 -45
- package/packages/main/src/simplicityTop/apps.vue +388 -0
- package/packages/main/src/simplicityTop/avatar.vue +82 -0
- package/packages/main/src/simplicityTop/handler.vue +207 -0
- package/packages/main/src/simplicityTop/index.vue +2909 -0
- package/packages/main/src/simplicityTop/lists.vue +84 -0
- package/packages/main/src/simplicityTop/menu-list.vue +135 -0
- package/packages/main/src/simplicityTop/message.vue +293 -0
- package/packages/main/src/simplicityTop/notice.vue +222 -0
- package/packages/main/src/simplicityTop/router-page.vue +45 -0
- package/packages/main/src/simplicityTop/sub-menu.vue +274 -0
- package/packages/main/src/simplicityTop/user.vue +259 -0
- package/packages/main/src/simplicityTop/userinfo.vue +401 -0
- package/packages/menu/index.js +5 -5
- package/packages/nav/index.js +5 -5
- package/packages/notify/index.js +5 -5
- package/packages/notify/src/main.vue +538 -538
- package/packages/page/index.js +5 -5
- package/packages/page/src/main.vue +167 -167
- package/packages/pagination/index.js +5 -5
- package/packages/pagination/src/main.vue +96 -96
- package/packages/player/index.js +5 -5
- package/packages/player/src/main.vue +194 -194
- package/packages/qr-code/index.js +5 -5
- package/packages/qr-code/src/main.vue +170 -170
- package/packages/radio-group/index.js +6 -6
- package/packages/radio-group/src/main.vue +319 -319
- package/packages/retrial-auth/index.js +5 -5
- package/packages/retrial-auth/src/main.vue +280 -280
- package/packages/select/index.js +5 -5
- package/packages/select-ganged/index.js +5 -5
- package/packages/select-ganged/src/main.vue +724 -724
- package/packages/selector/index.js +5 -5
- package/packages/selector-panel/index.js +5 -5
- package/packages/selector-panel/src/tree.vue +129 -129
- package/packages/sizer/index.js +5 -5
- package/packages/sizer/src/main.vue +254 -254
- package/packages/steps/index.js +5 -5
- package/packages/steps/src/main.vue +181 -181
- package/packages/switch/index.js +5 -5
- package/packages/table-form/index.js +5 -5
- package/packages/tabs/index.js +5 -5
- package/packages/tabs/src/main.vue +788 -788
- package/packages/tabs-panel/index.js +5 -5
- package/packages/tabs-panel/src/main.vue +29 -29
- package/packages/theme-chalk/lib/base.css +1 -1
- package/packages/theme-chalk/lib/fonts/iconfont.ttf +0 -0
- package/packages/theme-chalk/lib/fonts/iconfont.woff +0 -0
- package/packages/theme-chalk/lib/icon.css +1 -1
- package/packages/theme-chalk/lib/index.css +1 -1
- package/packages/theme-chalk/lib/login.css +1 -1
- package/packages/theme-chalk/lib/main.css +1 -1
- package/packages/theme-chalk/lib/menu.css +1 -1
- package/packages/theme-chalk/lib/simplicity-top.css +1 -0
- package/packages/theme-chalk/lib/simplicity.css +1 -1
- package/packages/theme-chalk/lib/sizer.css +1 -1
- package/packages/theme-chalk/lib/upload.css +1 -1
- package/packages/theme-chalk/src/base.scss +261 -261
- package/packages/theme-chalk/src/button-group.scss +176 -176
- package/packages/theme-chalk/src/button.scss +24 -24
- package/packages/theme-chalk/src/calendar.scss +113 -113
- package/packages/theme-chalk/src/card.scss +99 -99
- package/packages/theme-chalk/src/checkbox-group.scss +8 -8
- package/packages/theme-chalk/src/clients.scss +87 -87
- package/packages/theme-chalk/src/common/var.scss +3 -0
- package/packages/theme-chalk/src/data-table-form.scss +67 -67
- package/packages/theme-chalk/src/date-picker.scss +7 -7
- package/packages/theme-chalk/src/dialog.scss +77 -77
- package/packages/theme-chalk/src/enable-drag.scss +181 -181
- package/packages/theme-chalk/src/enterprise.scss +5 -5
- package/packages/theme-chalk/src/error-page.scss +18 -18
- package/packages/theme-chalk/src/flow-group.scss +110 -110
- package/packages/theme-chalk/src/flow-list.scss +39 -39
- package/packages/theme-chalk/src/fonts/iconfont.ttf +0 -0
- package/packages/theme-chalk/src/fonts/iconfont.woff +0 -0
- package/packages/theme-chalk/src/handle-user.scss +40 -40
- package/packages/theme-chalk/src/icon.scss +4 -0
- package/packages/theme-chalk/src/icons.scss +99 -99
- package/packages/theme-chalk/src/input.scss +9 -9
- package/packages/theme-chalk/src/label.scss +24 -24
- package/packages/theme-chalk/src/layout.scss +46 -46
- package/packages/theme-chalk/src/main.scss +1 -0
- package/packages/theme-chalk/src/mixins/color.scss +117 -117
- package/packages/theme-chalk/src/nav.scss +111 -111
- package/packages/theme-chalk/src/page.scss +3 -3
- package/packages/theme-chalk/src/pagination.scss +29 -29
- package/packages/theme-chalk/src/player.scss +9 -9
- package/packages/theme-chalk/src/qr-code.scss +17 -17
- package/packages/theme-chalk/src/radio-group.scss +9 -9
- package/packages/theme-chalk/src/retrial-auth.scss +38 -38
- package/packages/theme-chalk/src/select-ganged.scss +8 -8
- package/packages/theme-chalk/src/select.scss +8 -8
- package/packages/theme-chalk/src/selector-panel.scss +204 -204
- package/packages/theme-chalk/src/simplicity-top.scss +1974 -0
- package/packages/theme-chalk/src/sizer.scss +36 -36
- package/packages/theme-chalk/src/steps.scss +88 -88
- package/packages/theme-chalk/src/switch.scss +3 -3
- package/packages/theme-chalk/src/table-form.scss +1 -1
- package/packages/theme-chalk/src/tabs.scss +87 -87
- package/packages/theme-chalk/src/tips.scss +7 -7
- package/packages/theme-chalk/src/toolbar.scss +179 -179
- package/packages/theme-chalk/src/tree-group.scss +72 -72
- package/packages/theme-chalk/src/wxlogin.scss +3 -3
- package/packages/tips/index.js +5 -5
- package/packages/toolbar/index.js +5 -5
- package/packages/tree/index.js +5 -5
- package/packages/tree-group/index.js +5 -5
- package/packages/upload/index.js +5 -5
- package/packages/upload/src/picture.js +15 -15
- package/packages/wujie/index.js +5 -5
- package/packages/wujie/src/main.vue +145 -145
- package/packages/wxlogin/index.js +5 -5
- package/packages/wxlogin/src/main.vue +128 -128
- package/src/config/api.js +15 -2
- package/src/config/image.js +2 -2
- package/src/index.js +1 -1
- package/src/utils/bus.js +3 -3
- package/src/utils/date-util.js +312 -312
- package/src/utils/http.js +50 -50
- package/src/utils/store.js +21 -21
- package/src/utils/webSocket.js +107 -107
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="es-simplicity-userinfo">
|
|
3
|
+
<div class="es-simplicity-user">
|
|
4
|
+
<div class="es-simplicity-user-name">
|
|
5
|
+
{{ user.username }}
|
|
6
|
+
<el-dropdown
|
|
7
|
+
v-if="user.identityList && user.identityList.length > 1"
|
|
8
|
+
trigger="click"
|
|
9
|
+
placement="bottom-start"
|
|
10
|
+
@command="handleSelect"
|
|
11
|
+
>
|
|
12
|
+
<span class="el-dropdown-link">
|
|
13
|
+
<i class="es-icon-qiehuangangwei"></i>
|
|
14
|
+
</span>
|
|
15
|
+
<el-dropdown-menu slot="dropdown">
|
|
16
|
+
<el-dropdown-item
|
|
17
|
+
v-for="item in user.identityList"
|
|
18
|
+
:key="item.id"
|
|
19
|
+
:command="item"
|
|
20
|
+
:class="{ 'is-active': user.identityId == item.id }"
|
|
21
|
+
>{{ item.name }}</el-dropdown-item
|
|
22
|
+
>
|
|
23
|
+
</el-dropdown-menu>
|
|
24
|
+
</el-dropdown>
|
|
25
|
+
</div>
|
|
26
|
+
<div class="es-simplicity-org-name">{{ user.orgName }}</div>
|
|
27
|
+
<div class="es-simplicity-dep-post">
|
|
28
|
+
<span class="es-simplicity-dep-name"> {{ user.depName }}</span>
|
|
29
|
+
<template v-if="user.postName">
|
|
30
|
+
|
|
|
31
|
+
<span class="es-simplicity-post-name">{{
|
|
32
|
+
user.position || user.postName
|
|
33
|
+
}}</span>
|
|
34
|
+
</template>
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
<avatar
|
|
38
|
+
slot="reference"
|
|
39
|
+
upload
|
|
40
|
+
:user="user"
|
|
41
|
+
:code="headImgCode"
|
|
42
|
+
@change="handleChange"
|
|
43
|
+
>
|
|
44
|
+
</avatar>
|
|
45
|
+
</div>
|
|
46
|
+
<div class="es-simplicity-notice-type" v-if="userScanBindImgUrl">
|
|
47
|
+
<div class="es-simplicity-notice-title">微信公众号:</div>
|
|
48
|
+
<el-image
|
|
49
|
+
class="es-simplicity-qrcode"
|
|
50
|
+
@click="getQrcode"
|
|
51
|
+
:src="qrcode"
|
|
52
|
+
></el-image>
|
|
53
|
+
</div>
|
|
54
|
+
<!-- <div class="es-simplicity-notice-type">
|
|
55
|
+
<div class="es-simplicity-notice-title">接收消息类型:</div>
|
|
56
|
+
<es-checkbox-group
|
|
57
|
+
class="es-simplicity-notice-list"
|
|
58
|
+
v-model="checked"
|
|
59
|
+
:min="1"
|
|
60
|
+
:data="notifyList"
|
|
61
|
+
@change="handleCheckboxChange"
|
|
62
|
+
></es-checkbox-group>
|
|
63
|
+
</div> -->
|
|
64
|
+
<div class="es-simplicity-password" @click="handleOpen">
|
|
65
|
+
资料修改 <i class="es-icon-you"></i>
|
|
66
|
+
</div>
|
|
67
|
+
<es-dialog title="资料修改" :visible.sync="visible">
|
|
68
|
+
<user-info
|
|
69
|
+
v-if="visible"
|
|
70
|
+
:contents="contents"
|
|
71
|
+
:value="userInfos"
|
|
72
|
+
@success="handleSuccess"
|
|
73
|
+
>
|
|
74
|
+
</user-info>
|
|
75
|
+
</es-dialog>
|
|
76
|
+
</div>
|
|
77
|
+
</template>
|
|
78
|
+
|
|
79
|
+
<script>
|
|
80
|
+
import avatar from './avatar.vue';
|
|
81
|
+
import userInfo from './userinfo.vue';
|
|
82
|
+
import util from 'eoss-ui/src/utils/util';
|
|
83
|
+
import { debounce } from 'throttle-debounce';
|
|
84
|
+
import {
|
|
85
|
+
initUserSet,
|
|
86
|
+
switchUserTo,
|
|
87
|
+
updateUserCustomInfo
|
|
88
|
+
} from 'eoss-ui/src/config/api.js';
|
|
89
|
+
export default {
|
|
90
|
+
name: 'User',
|
|
91
|
+
components: { avatar, userInfo },
|
|
92
|
+
props: {
|
|
93
|
+
notify: String,
|
|
94
|
+
notifyList: Array,
|
|
95
|
+
user: Object,
|
|
96
|
+
contents: Array
|
|
97
|
+
},
|
|
98
|
+
data() {
|
|
99
|
+
return {
|
|
100
|
+
userInfos: {},
|
|
101
|
+
userScanBindImgUrl: null,
|
|
102
|
+
qrcode: null,
|
|
103
|
+
checked: [],
|
|
104
|
+
visible: false,
|
|
105
|
+
checkPassword: null,
|
|
106
|
+
checkPasswordMsg: null,
|
|
107
|
+
headImgCode: undefined
|
|
108
|
+
};
|
|
109
|
+
},
|
|
110
|
+
computed: {},
|
|
111
|
+
watch: {
|
|
112
|
+
notify: {
|
|
113
|
+
immediate: true,
|
|
114
|
+
handler(val) {
|
|
115
|
+
if (val) {
|
|
116
|
+
this.checked = val.split(',');
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
beforeCreate() {
|
|
122
|
+
this.setNoticeType = debounce(1000, () => {
|
|
123
|
+
this.setNotice();
|
|
124
|
+
});
|
|
125
|
+
},
|
|
126
|
+
created() {},
|
|
127
|
+
mounted() {
|
|
128
|
+
this.getData();
|
|
129
|
+
},
|
|
130
|
+
methods: {
|
|
131
|
+
//获取用户详细信息
|
|
132
|
+
getData() {
|
|
133
|
+
util
|
|
134
|
+
.ajax({
|
|
135
|
+
url: initUserSet
|
|
136
|
+
})
|
|
137
|
+
.then((res) => {
|
|
138
|
+
if (res.rCode === 0) {
|
|
139
|
+
const results = JSON.parse(JSON.stringify(res.results));
|
|
140
|
+
this.userInfos = results.simpleUserInfo;
|
|
141
|
+
if (results.userScanBindImgUrl) {
|
|
142
|
+
this.userScanBindImgUrl = results.userScanBindImgUrl;
|
|
143
|
+
this.qrcode = this.userScanBindImgUrl;
|
|
144
|
+
}
|
|
145
|
+
this.checkPassword = results.checkPassword;
|
|
146
|
+
this.checkPasswordMsg = results.checkPasswordMsg;
|
|
147
|
+
this.headImgCode = results.headImgCode || undefined;
|
|
148
|
+
this.$emit('success', results);
|
|
149
|
+
} else {
|
|
150
|
+
let msg = res.msg || '系统错误,请联系管理员!';
|
|
151
|
+
this.$message.error(msg);
|
|
152
|
+
}
|
|
153
|
+
})
|
|
154
|
+
.catch((err) => {
|
|
155
|
+
if (err.message && err.message !== 'canceled') {
|
|
156
|
+
this.$message.error(err.message);
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
},
|
|
160
|
+
//刷新公众号二维码图片
|
|
161
|
+
getQrcode() {
|
|
162
|
+
this.qrcode =
|
|
163
|
+
this.userScanBindImgUrl +
|
|
164
|
+
'&_tt=' +
|
|
165
|
+
Math.random().toString().split('.')[1];
|
|
166
|
+
},
|
|
167
|
+
//修改头像
|
|
168
|
+
handleChange(res) {
|
|
169
|
+
this.$emit('change', 'userHeadUrl', res);
|
|
170
|
+
},
|
|
171
|
+
//设置通知类型
|
|
172
|
+
setNotice() {
|
|
173
|
+
let notify = this.checked.join(',');
|
|
174
|
+
util
|
|
175
|
+
.ajax({
|
|
176
|
+
method: 'post',
|
|
177
|
+
url: updateUserCustomInfo,
|
|
178
|
+
data: {
|
|
179
|
+
notify: notify
|
|
180
|
+
}
|
|
181
|
+
})
|
|
182
|
+
.then((results) => {
|
|
183
|
+
if (results.rCode === 0) {
|
|
184
|
+
this.$message.success(results.msg);
|
|
185
|
+
this.$emit('change', 'notify', notify);
|
|
186
|
+
} else {
|
|
187
|
+
this.$message.error(results.msg || '系统错误,请联系管理员!');
|
|
188
|
+
}
|
|
189
|
+
})
|
|
190
|
+
.catch((err) => {
|
|
191
|
+
if (err.message && err.message !== 'canceled') {
|
|
192
|
+
this.$message.error(err.message);
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
},
|
|
196
|
+
//改变通知类型回调
|
|
197
|
+
handleCheckboxChange() {
|
|
198
|
+
this.setNoticeType(this.checked);
|
|
199
|
+
},
|
|
200
|
+
//切换职务
|
|
201
|
+
handleSelect(res) {
|
|
202
|
+
if (this.user.identityId !== res.id) {
|
|
203
|
+
util
|
|
204
|
+
.ajax({
|
|
205
|
+
method: 'post',
|
|
206
|
+
url: switchUserTo,
|
|
207
|
+
data: { userId: res.value }
|
|
208
|
+
})
|
|
209
|
+
.then((res) => {
|
|
210
|
+
if (res.rCode == 0) {
|
|
211
|
+
this.$emit('close');
|
|
212
|
+
util.setStorage({
|
|
213
|
+
type: this.storage,
|
|
214
|
+
key: 'userId',
|
|
215
|
+
value: res.value
|
|
216
|
+
});
|
|
217
|
+
util.removeStorage(['mainConfig', 'jump']);
|
|
218
|
+
this.$message({
|
|
219
|
+
message: res.msg,
|
|
220
|
+
type: 'success',
|
|
221
|
+
duration: 500,
|
|
222
|
+
onClose: () => {
|
|
223
|
+
if (
|
|
224
|
+
util.win.location.href.indexOf('#/main') > -1 ||
|
|
225
|
+
util.win.location.href.indexOf('/main.html') > -1
|
|
226
|
+
) {
|
|
227
|
+
location.reload();
|
|
228
|
+
} else {
|
|
229
|
+
this.$router.replace('/main');
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
} else {
|
|
234
|
+
this.$message({
|
|
235
|
+
message: res.msg || '系统错误,请联系管理员!',
|
|
236
|
+
type: 'error'
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
})
|
|
240
|
+
.catch((err) => {
|
|
241
|
+
if (err.message && err.message !== 'canceled') {
|
|
242
|
+
this.$message.error(err.message);
|
|
243
|
+
}
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
},
|
|
247
|
+
//打开修改密码弹窗
|
|
248
|
+
handleOpen() {
|
|
249
|
+
this.visible = true;
|
|
250
|
+
},
|
|
251
|
+
handleSuccess() {
|
|
252
|
+
this.visible = false;
|
|
253
|
+
this.getData();
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
};
|
|
257
|
+
</script>
|
|
258
|
+
|
|
259
|
+
<style lang="scss" scoped></style>
|
|
@@ -0,0 +1,401 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<es-form
|
|
3
|
+
ref="form"
|
|
4
|
+
class="es-user-info"
|
|
5
|
+
:validate-on-rule-change="false"
|
|
6
|
+
:model="model"
|
|
7
|
+
:contents="forms"
|
|
8
|
+
:autocomplete="false"
|
|
9
|
+
:rules="formRules"
|
|
10
|
+
:events="events"
|
|
11
|
+
:resetValue="false"
|
|
12
|
+
@submit="handleFormSubmit"
|
|
13
|
+
>
|
|
14
|
+
<template slot="other">
|
|
15
|
+
<slot></slot>
|
|
16
|
+
</template>
|
|
17
|
+
</es-form>
|
|
18
|
+
</template>
|
|
19
|
+
<script>
|
|
20
|
+
import { updateUserInfo } from 'eoss-ui/src/config/api.js';
|
|
21
|
+
import util from 'eoss-ui/src/utils/util';
|
|
22
|
+
|
|
23
|
+
export default {
|
|
24
|
+
name: 'UserInfo',
|
|
25
|
+
props: {
|
|
26
|
+
secret: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: true
|
|
29
|
+
},
|
|
30
|
+
contents: Array,
|
|
31
|
+
value: {
|
|
32
|
+
type: Object,
|
|
33
|
+
default() {
|
|
34
|
+
return {};
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
rules: {
|
|
38
|
+
type: Object,
|
|
39
|
+
default() {
|
|
40
|
+
return {};
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
rules: {
|
|
44
|
+
type: Object,
|
|
45
|
+
default() {
|
|
46
|
+
return {};
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
data() {
|
|
51
|
+
return {
|
|
52
|
+
model: this.value,
|
|
53
|
+
defaultValues: JSON.parse(JSON.stringify(this.value)),
|
|
54
|
+
events: {
|
|
55
|
+
oldpassword: {
|
|
56
|
+
change: () => {
|
|
57
|
+
if (
|
|
58
|
+
!this.model.repassword &&
|
|
59
|
+
!this.model.oldpassword &&
|
|
60
|
+
!this.model.repassword
|
|
61
|
+
) {
|
|
62
|
+
this.$refs.form.clearValidate();
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
password: {
|
|
67
|
+
change: () => {
|
|
68
|
+
if (
|
|
69
|
+
!this.model.repassword &&
|
|
70
|
+
!this.model.oldpassword &&
|
|
71
|
+
!this.model.repassword
|
|
72
|
+
) {
|
|
73
|
+
this.$refs.form.clearValidate();
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
repassword: {
|
|
78
|
+
change: () => {
|
|
79
|
+
if (
|
|
80
|
+
!this.model.repassword &&
|
|
81
|
+
!this.model.oldpassword &&
|
|
82
|
+
!this.model.repassword
|
|
83
|
+
) {
|
|
84
|
+
this.$refs.form.clearValidate();
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
},
|
|
91
|
+
computed: {
|
|
92
|
+
formRules() {
|
|
93
|
+
console.log(this.value);
|
|
94
|
+
return {
|
|
95
|
+
idCard: [
|
|
96
|
+
{
|
|
97
|
+
required:
|
|
98
|
+
this.defaultValues.idCard !== null &&
|
|
99
|
+
this.defaultValues.idCard !== undefined &&
|
|
100
|
+
this.defaultValues.idCard !== '',
|
|
101
|
+
message: '请输入身份证号',
|
|
102
|
+
trigger: 'blur'
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
pattern: new RegExp('(^\\d{15}$)|(^\\d{18}$)|(^\\d{17}(\\d|X|x)$)'),
|
|
106
|
+
message: '身份证号不合法',
|
|
107
|
+
trigger: 'blur'
|
|
108
|
+
}
|
|
109
|
+
],
|
|
110
|
+
phone: [
|
|
111
|
+
{
|
|
112
|
+
required:
|
|
113
|
+
this.defaultValues.phone !== null &&
|
|
114
|
+
this.defaultValues.phone !== undefined &&
|
|
115
|
+
this.defaultValues.phone !== '',
|
|
116
|
+
message: '请输入手机号',
|
|
117
|
+
trigger: 'blur'
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
pattern: new RegExp('^[1][3, 4, 5, 6, 7, 8, 9][0-9]{9}$'),
|
|
121
|
+
message: '手机号不合法',
|
|
122
|
+
trigger: 'blur'
|
|
123
|
+
}
|
|
124
|
+
],
|
|
125
|
+
email: [
|
|
126
|
+
{
|
|
127
|
+
required:
|
|
128
|
+
this.defaultValues.email !== null &&
|
|
129
|
+
this.defaultValues.email !== undefined &&
|
|
130
|
+
this.defaultValues.email !== '',
|
|
131
|
+
message: '请输入邮箱地址',
|
|
132
|
+
trigger: 'blur'
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
type: 'email',
|
|
136
|
+
message: '请输入正确的邮箱地址',
|
|
137
|
+
trigger: 'blur'
|
|
138
|
+
}
|
|
139
|
+
],
|
|
140
|
+
officeTel: [
|
|
141
|
+
{
|
|
142
|
+
required:
|
|
143
|
+
this.defaultValues.officeTel !== null &&
|
|
144
|
+
this.defaultValues.officeTel !== undefined &&
|
|
145
|
+
this.defaultValues.officeTel !== '',
|
|
146
|
+
message: '请输入座机号',
|
|
147
|
+
trigger: 'blur'
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
pattern: new RegExp(
|
|
151
|
+
'^(?:\\(?0([1-9]\\d{1,2})\\)?[- ]?)?([2-9]\\d{6,7})$'
|
|
152
|
+
),
|
|
153
|
+
message: '座机号不合法',
|
|
154
|
+
trigger: 'blur'
|
|
155
|
+
}
|
|
156
|
+
],
|
|
157
|
+
|
|
158
|
+
oldpassword:
|
|
159
|
+
this.model.password || this.model.repassword
|
|
160
|
+
? {
|
|
161
|
+
required: true,
|
|
162
|
+
message: '请输入旧密码'
|
|
163
|
+
}
|
|
164
|
+
: {},
|
|
165
|
+
|
|
166
|
+
password: [
|
|
167
|
+
this.model.repassword || this.model.oldpassword
|
|
168
|
+
? {
|
|
169
|
+
required: true,
|
|
170
|
+
message: '请输入新密码'
|
|
171
|
+
}
|
|
172
|
+
: {},
|
|
173
|
+
,
|
|
174
|
+
{
|
|
175
|
+
pattern: this.checkPassword,
|
|
176
|
+
message: this.checkPasswordMsg
|
|
177
|
+
? this.checkPasswordMsg
|
|
178
|
+
: '密码格式不合法',
|
|
179
|
+
trigger: 'blur'
|
|
180
|
+
}
|
|
181
|
+
],
|
|
182
|
+
repassword: [
|
|
183
|
+
this.model.password || this.model.oldpassword
|
|
184
|
+
? {
|
|
185
|
+
required: true,
|
|
186
|
+
message: '请再次输入新密码'
|
|
187
|
+
}
|
|
188
|
+
: {},
|
|
189
|
+
{ validator: this.repassword, trigger: 'blur' },
|
|
190
|
+
this.checkPassword
|
|
191
|
+
? {
|
|
192
|
+
pattern: this.checkPassword,
|
|
193
|
+
message: this.checkPasswordMsg
|
|
194
|
+
? this.checkPasswordMsg
|
|
195
|
+
: '密码格式不合法',
|
|
196
|
+
trigger: 'blur'
|
|
197
|
+
}
|
|
198
|
+
: {}
|
|
199
|
+
],
|
|
200
|
+
...this.rules
|
|
201
|
+
};
|
|
202
|
+
},
|
|
203
|
+
forms() {
|
|
204
|
+
return this.contents
|
|
205
|
+
? this.contents
|
|
206
|
+
: [
|
|
207
|
+
{
|
|
208
|
+
name: 'orgName',
|
|
209
|
+
label: '所属机构',
|
|
210
|
+
type: 'text',
|
|
211
|
+
disabled: true,
|
|
212
|
+
col: 6
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
name: 'depName',
|
|
216
|
+
label: '所属部门',
|
|
217
|
+
type: 'text',
|
|
218
|
+
disabled: true,
|
|
219
|
+
col: 6
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
name: 'idCard',
|
|
223
|
+
label: '身份证号',
|
|
224
|
+
type: 'text',
|
|
225
|
+
disabled: true,
|
|
226
|
+
maxlength: 18,
|
|
227
|
+
col: 6
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
name: 'outCode',
|
|
231
|
+
label: '工号',
|
|
232
|
+
type: 'text',
|
|
233
|
+
disabled: true,
|
|
234
|
+
col: 6
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
name: 'phone',
|
|
238
|
+
placeholder: '联系电话',
|
|
239
|
+
label: '联系电话',
|
|
240
|
+
type: 'text',
|
|
241
|
+
col: 6
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
name: 'email',
|
|
245
|
+
placeholder: '电子邮箱',
|
|
246
|
+
label: '电子邮箱',
|
|
247
|
+
type: 'text',
|
|
248
|
+
col: 6
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
name: 'officeTel',
|
|
252
|
+
placeholder: '座机号',
|
|
253
|
+
label: '座机号',
|
|
254
|
+
type: 'text',
|
|
255
|
+
col: 6
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
name: 'oldpassword',
|
|
259
|
+
placeholder: '旧密码',
|
|
260
|
+
label: '旧密码',
|
|
261
|
+
type: 'text',
|
|
262
|
+
col: 6
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
name: 'password',
|
|
266
|
+
placeholder: '新密码',
|
|
267
|
+
label: '新密码',
|
|
268
|
+
type: 'text',
|
|
269
|
+
col: 6
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
name: 'repassword',
|
|
273
|
+
placeholder: '确认新密码',
|
|
274
|
+
label: '确认新密码',
|
|
275
|
+
type: 'text',
|
|
276
|
+
col: 6
|
|
277
|
+
}
|
|
278
|
+
];
|
|
279
|
+
},
|
|
280
|
+
formKey() {
|
|
281
|
+
let keys = this.forms
|
|
282
|
+
.filter((item) => {
|
|
283
|
+
return (
|
|
284
|
+
item.disabled !== true &&
|
|
285
|
+
item.readonly !== true &&
|
|
286
|
+
!['oldpassword', 'password', 'repassword'].includes(item.name)
|
|
287
|
+
);
|
|
288
|
+
})
|
|
289
|
+
.map((item) => item.name);
|
|
290
|
+
return keys;
|
|
291
|
+
}
|
|
292
|
+
},
|
|
293
|
+
created() {},
|
|
294
|
+
mounted() {},
|
|
295
|
+
methods: {
|
|
296
|
+
handleFormSubmit() {
|
|
297
|
+
let initLogin = util.getStorage('initLogin');
|
|
298
|
+
initLogin && (initLogin = JSON.parse(initLogin));
|
|
299
|
+
let { oldpassword, password } = this.model;
|
|
300
|
+
let data = {
|
|
301
|
+
...Object.fromEntries(
|
|
302
|
+
Object.entries(this.model).filter(([key]) =>
|
|
303
|
+
this.formKey.includes(key)
|
|
304
|
+
)
|
|
305
|
+
)
|
|
306
|
+
};
|
|
307
|
+
util
|
|
308
|
+
.ajax({
|
|
309
|
+
url: updateUserInfo,
|
|
310
|
+
params: {
|
|
311
|
+
...data,
|
|
312
|
+
oldPassword:
|
|
313
|
+
this.secret && initLogin && initLogin.secret && oldpassword
|
|
314
|
+
? util.esmEncrypt({
|
|
315
|
+
data: oldpassword,
|
|
316
|
+
key: initLogin.secret
|
|
317
|
+
})
|
|
318
|
+
: oldpassword,
|
|
319
|
+
password:
|
|
320
|
+
this.secret && initLogin && initLogin.secret && password
|
|
321
|
+
? util.esmEncrypt({
|
|
322
|
+
data: password,
|
|
323
|
+
key: initLogin.secret
|
|
324
|
+
})
|
|
325
|
+
: password
|
|
326
|
+
}
|
|
327
|
+
})
|
|
328
|
+
.then((res) => {
|
|
329
|
+
if (res.rCode === 0) {
|
|
330
|
+
if (oldpassword && password) {
|
|
331
|
+
this.$confirm('密码修改成功,请重新登录!', '提示', {
|
|
332
|
+
confirmButtonText: '确定',
|
|
333
|
+
cancelButtonText: '取消',
|
|
334
|
+
closeOnClickModal: false,
|
|
335
|
+
type: 'warning'
|
|
336
|
+
})
|
|
337
|
+
.then(() => {
|
|
338
|
+
const loginPage =
|
|
339
|
+
util.getStorage('login') || util.getStorage('loginPage');
|
|
340
|
+
try {
|
|
341
|
+
if (loginPage) {
|
|
342
|
+
let src;
|
|
343
|
+
if (!util.startWith(loginPage, ['http', '/'], true)) {
|
|
344
|
+
let pathname = util.win.top.location.pathname;
|
|
345
|
+
if (pathname !== '/') {
|
|
346
|
+
pathname = pathname.split('/');
|
|
347
|
+
pathname.splice(pathname.length - 1);
|
|
348
|
+
pathname = pathname.join('/');
|
|
349
|
+
src = pathname + '/' + loginPage.replace('./', '');
|
|
350
|
+
} else {
|
|
351
|
+
src = pathname + loginPage.replace('./', '');
|
|
352
|
+
}
|
|
353
|
+
} else {
|
|
354
|
+
src = loginPage;
|
|
355
|
+
}
|
|
356
|
+
util.win.top.location.href = src;
|
|
357
|
+
} else if (
|
|
358
|
+
util.win.top.location.href.indexOf('main.html') > -1
|
|
359
|
+
) {
|
|
360
|
+
util.win.top.location.href = './login.html';
|
|
361
|
+
} else {
|
|
362
|
+
const hash = util.win.top.location.hash;
|
|
363
|
+
if (hash) {
|
|
364
|
+
const len = util.win.top.location.href.indexOf(hash);
|
|
365
|
+
util.win.top.location.href =
|
|
366
|
+
util.win.location.href.slice(0, len) + '#/login';
|
|
367
|
+
} else {
|
|
368
|
+
util.win.top.location.href = '/login.html';
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
} catch (error) {
|
|
372
|
+
util.win.top.postMessage({ type: 1 }, '*');
|
|
373
|
+
}
|
|
374
|
+
})
|
|
375
|
+
.catch((e) => {});
|
|
376
|
+
} else {
|
|
377
|
+
this.$message({
|
|
378
|
+
message: res.msg,
|
|
379
|
+
type: 'success',
|
|
380
|
+
onClose: () => {
|
|
381
|
+
this.$emit('success', this.model);
|
|
382
|
+
}
|
|
383
|
+
});
|
|
384
|
+
}
|
|
385
|
+
} else {
|
|
386
|
+
let msg = res.msg || '系统错误,请联系管理员!';
|
|
387
|
+
this.$message.error(msg);
|
|
388
|
+
}
|
|
389
|
+
});
|
|
390
|
+
},
|
|
391
|
+
repassword(rule, value, callback) {
|
|
392
|
+
if (this.model.oldpassword && this.model.password && value) {
|
|
393
|
+
util.identical({ value: [value, this.model.password], callback });
|
|
394
|
+
} else {
|
|
395
|
+
callback();
|
|
396
|
+
return true;
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
};
|
|
401
|
+
</script>
|
package/packages/menu/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import EsMenu from './src/main';
|
|
2
|
-
|
|
3
|
-
EsMenu.install = Vue => Vue.component(EsMenu.name, EsMenu);
|
|
4
|
-
|
|
5
|
-
export default EsMenu;
|
|
1
|
+
import EsMenu from './src/main';
|
|
2
|
+
|
|
3
|
+
EsMenu.install = Vue => Vue.component(EsMenu.name, EsMenu);
|
|
4
|
+
|
|
5
|
+
export default EsMenu;
|
package/packages/nav/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import EsNav from './src/main';
|
|
2
|
-
|
|
3
|
-
EsNav.install = Vue => Vue.component(EsNav.name, EsNav);
|
|
4
|
-
|
|
5
|
-
export default EsNav;
|
|
1
|
+
import EsNav from './src/main';
|
|
2
|
+
|
|
3
|
+
EsNav.install = Vue => Vue.component(EsNav.name, EsNav);
|
|
4
|
+
|
|
5
|
+
export default EsNav;
|
package/packages/notify/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import EsNotify from './src/main';
|
|
2
|
-
|
|
3
|
-
EsNotify.install = Vue => Vue.component(EsNotify.name, EsNotify);
|
|
4
|
-
|
|
5
|
-
export default EsNotify;
|
|
1
|
+
import EsNotify from './src/main';
|
|
2
|
+
|
|
3
|
+
EsNotify.install = Vue => Vue.component(EsNotify.name, EsNotify);
|
|
4
|
+
|
|
5
|
+
export default EsNotify;
|