eoss-ui 0.5.79 → 0.5.81-beta
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 +279 -265
- package/lib/button.js +71 -69
- package/lib/calendar.js +2 -2
- package/lib/card.js +2 -2
- package/lib/cascader.js +2 -2
- package/lib/checkbox-group.js +71 -70
- package/lib/clients.js +11 -11
- package/lib/config/api.js +1 -0
- package/lib/data-table-form.js +69 -67
- package/lib/data-table.js +87 -80
- package/lib/date-picker.js +71 -69
- package/lib/dialog.js +71 -70
- package/lib/enterprise.js +2 -2
- package/lib/eoss-ui.common.js +5966 -986
- package/lib/error-page.js +2 -2
- package/lib/flow-group.js +71 -69
- package/lib/flow-list.js +74 -72
- package/lib/flow.js +95 -93
- package/lib/form.js +179 -98
- package/lib/handle-user.js +72 -70
- package/lib/handler.js +75 -73
- package/lib/icon.js +3731 -12
- package/lib/icons.js +3 -3
- package/lib/index.js +1 -1
- package/lib/input-number.js +71 -69
- package/lib/input.js +71 -73
- package/lib/label.js +2 -2
- package/lib/layout.js +2 -2
- package/lib/login.js +146 -106
- package/lib/main.js +5663 -844
- package/lib/menu.js +2 -2
- package/lib/nav.js +71 -69
- package/lib/notify.js +72 -70
- package/lib/page.js +71 -69
- package/lib/pagination.js +2 -2
- package/lib/player.js +75 -73
- package/lib/qr-code.js +73 -71
- package/lib/radio-group.js +71 -69
- package/lib/retrial-auth.js +73 -71
- package/lib/select-ganged.js +71 -69
- package/lib/select.js +71 -69
- package/lib/selector-panel.js +74 -73
- package/lib/selector.js +80 -78
- package/lib/sizer.js +71 -69
- package/lib/steps.js +71 -69
- package/lib/switch.js +78 -76
- package/lib/table-form.js +71 -69
- package/lib/tabs-panel.js +2 -2
- package/lib/tabs.js +71 -69
- package/lib/theme-chalk/base.css +1 -1
- package/lib/theme-chalk/clients.css +1 -1
- package/lib/theme-chalk/data-table.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/form.css +1 -1
- 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.css +1 -0
- package/lib/theme-chalk/sizer.css +1 -1
- package/lib/theme-chalk/upload.css +1 -1
- package/lib/tips.js +72 -70
- package/lib/toolbar.js +2 -2
- package/lib/tree-group.js +71 -69
- package/lib/tree.js +71 -69
- package/lib/upload.js +146 -118
- package/lib/utils/util.js +2 -2
- package/lib/wujie.js +71 -69
- package/lib/wxlogin.js +214 -212
- package/package.json +3 -3
- package/packages/clients/src/main.vue +7 -7
- package/packages/data-table/src/main.vue +17 -5
- package/packages/form/src/main.vue +27 -13
- package/packages/handler/src/main.vue +3 -1
- package/packages/icon/src/main.vue +31 -10
- package/packages/icons/src/icon.json +1 -1
- package/packages/input/src/main.vue +0 -4
- package/packages/login/src/main.vue +13 -7
- package/packages/main/src/default/index.vue +2199 -0
- package/packages/main/src/main.vue +30 -2209
- package/packages/main/src/simplicity/apps.vue +301 -0
- package/packages/main/src/simplicity/avatar.vue +68 -0
- package/packages/main/src/simplicity/handler.vue +148 -0
- package/packages/main/src/simplicity/index.vue +1515 -0
- package/packages/main/src/simplicity/lists.vue +84 -0
- package/packages/main/src/simplicity/menu-list.vue +74 -0
- package/packages/main/src/simplicity/message.vue +237 -0
- package/packages/main/src/simplicity/notice.vue +145 -0
- package/packages/main/src/simplicity/settings.vue +119 -0
- package/packages/main/src/simplicity/sub-menu.vue +120 -0
- package/packages/main/src/simplicity/user.vue +243 -0
- package/packages/main/src/simplicity/userinfo.vue +302 -0
- package/packages/theme-chalk/lib/base.css +1 -1
- package/packages/theme-chalk/lib/clients.css +1 -1
- package/packages/theme-chalk/lib/data-table.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/form.css +1 -1
- 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.css +1 -0
- 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 +1 -0
- package/packages/theme-chalk/src/clients.scss +1 -1
- package/packages/theme-chalk/src/common/var.scss +4 -0
- package/packages/theme-chalk/src/data-table.scss +3 -0
- 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/form.scss +2 -2
- package/packages/theme-chalk/src/icon.scss +4 -4
- package/packages/theme-chalk/src/login.scss +644 -632
- package/packages/theme-chalk/src/main.scss +6 -2
- package/packages/theme-chalk/src/simplicity.scss +545 -0
- package/packages/upload/src/main.vue +132 -80
- package/src/config/api.js +1 -0
- package/src/index.js +1 -1
- package/src/utils/util.js +2 -2
- package/lib/theme-chalk/mainComp.css +0 -0
- package/packages/main/src/async-component/index.vue +0 -87
- package/packages/theme-chalk/lib/mainComp.css +0 -0
- package/packages/theme-chalk/src/mainComp.scss +0 -0
- /package/packages/main/src/{message.vue → default/message.vue} +0 -0
- /package/packages/main/src/{notice.vue → default/notice.vue} +0 -0
- /package/packages/main/src/{settings.vue → default/settings.vue} +0 -0
- /package/packages/main/src/{userinfo.vue → default/userinfo.vue} +0 -0
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="es-simplicity-menus">
|
|
3
|
+
<div class="es-simplicity-menus-box">
|
|
4
|
+
<div class="es-simplicity-menus-title">{{ text }}</div>
|
|
5
|
+
<menu-list
|
|
6
|
+
:data="menus"
|
|
7
|
+
:menuIcon="menuIcon"
|
|
8
|
+
:color="color"
|
|
9
|
+
:backgroundColor="backgroundColor"
|
|
10
|
+
@command="handleCommand"
|
|
11
|
+
></menu-list>
|
|
12
|
+
</div>
|
|
13
|
+
<div
|
|
14
|
+
class="es-simplicity-menus-box"
|
|
15
|
+
v-if="subMenus.length"
|
|
16
|
+
v-for="(item, index) in subMenus"
|
|
17
|
+
:key="item.id"
|
|
18
|
+
>
|
|
19
|
+
<div class="es-simplicity-menus-title">{{ item.text || item.name }}</div>
|
|
20
|
+
<menu-list
|
|
21
|
+
:index="index"
|
|
22
|
+
:data="item.data"
|
|
23
|
+
:menuIcon="menuIcon"
|
|
24
|
+
@command="handleCommand"
|
|
25
|
+
></menu-list>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
</template>
|
|
29
|
+
|
|
30
|
+
<script>
|
|
31
|
+
import MenuList from './menu-list.vue';
|
|
32
|
+
export default {
|
|
33
|
+
name: 'SubMenu',
|
|
34
|
+
components: { MenuList },
|
|
35
|
+
props: {
|
|
36
|
+
color: {
|
|
37
|
+
type: [String, Array],
|
|
38
|
+
default: '#fff'
|
|
39
|
+
},
|
|
40
|
+
backgroundColor: {
|
|
41
|
+
type: [String, Array],
|
|
42
|
+
default() {
|
|
43
|
+
return [
|
|
44
|
+
'#FF9C52',
|
|
45
|
+
'#2591F7',
|
|
46
|
+
'#17C27B',
|
|
47
|
+
'#1265D7',
|
|
48
|
+
'#FFC724',
|
|
49
|
+
'#E34D59'
|
|
50
|
+
];
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
text: String,
|
|
54
|
+
menuIcon: String,
|
|
55
|
+
children: {
|
|
56
|
+
type: Array,
|
|
57
|
+
default() {
|
|
58
|
+
return [];
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
fourthTabs: {
|
|
62
|
+
type: Array,
|
|
63
|
+
default() {
|
|
64
|
+
return [];
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
data() {
|
|
69
|
+
return {
|
|
70
|
+
active: '',
|
|
71
|
+
subMenus: []
|
|
72
|
+
};
|
|
73
|
+
},
|
|
74
|
+
computed: {
|
|
75
|
+
menus() {
|
|
76
|
+
return [...this.children, ...this.fourthTabs];
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
watch: {},
|
|
80
|
+
created() {},
|
|
81
|
+
mounted() {},
|
|
82
|
+
methods: {
|
|
83
|
+
handleCommand(res, num) {
|
|
84
|
+
if (res.url) {
|
|
85
|
+
if (res.urlopenmode == 1) {
|
|
86
|
+
util.win.open(res.url);
|
|
87
|
+
} else if (res.urlopenmode == 2) {
|
|
88
|
+
util.win.location.href = res.url;
|
|
89
|
+
} else {
|
|
90
|
+
this.$emit('command', res);
|
|
91
|
+
}
|
|
92
|
+
} else if (this.active !== res.id) {
|
|
93
|
+
this.active = res.id;
|
|
94
|
+
this.subMenus = [];
|
|
95
|
+
}
|
|
96
|
+
let data = [...(res.children || []), ...(res.fourthTabs || [])];
|
|
97
|
+
if (data.length) {
|
|
98
|
+
if (num === undefined) {
|
|
99
|
+
this.subMenus = [{ ...res, data: data }];
|
|
100
|
+
} else {
|
|
101
|
+
this.subMenus.push({ ...res, data: data });
|
|
102
|
+
}
|
|
103
|
+
this.$emit(
|
|
104
|
+
'command',
|
|
105
|
+
num === undefined ? 2 : 2 + parseInt(num, 10) + 1
|
|
106
|
+
);
|
|
107
|
+
} else {
|
|
108
|
+
if (num === undefined) {
|
|
109
|
+
this.$emit('command', 1);
|
|
110
|
+
} else {
|
|
111
|
+
this.subMenus.splice(parseInt(num, 10) + 1, 1);
|
|
112
|
+
this.$emit('command', 2 + parseInt(num, 10));
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
</script>
|
|
119
|
+
|
|
120
|
+
<style lang="scss" scoped></style>
|
|
@@ -0,0 +1,243 @@
|
|
|
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"
|
|
8
|
+
trigger="click"
|
|
9
|
+
placement="bottom-start"
|
|
10
|
+
@command="handleSelect"
|
|
11
|
+
>
|
|
12
|
+
<span class="el-dropdown-link">
|
|
13
|
+
<i class="es-icon-renyuanqiehuan"></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
|
+
|<span class="es-simplicity-post-name">{{ user.postName }}</span>
|
|
31
|
+
</template>
|
|
32
|
+
</div>
|
|
33
|
+
|
|
34
|
+
<avatar
|
|
35
|
+
slot="reference"
|
|
36
|
+
upload
|
|
37
|
+
:user="user"
|
|
38
|
+
:code="headImgCode"
|
|
39
|
+
@change="handleChange"
|
|
40
|
+
>
|
|
41
|
+
</avatar>
|
|
42
|
+
</div>
|
|
43
|
+
<div class="es-simplicity-notice-type" v-if="userScanBindImgUrl">
|
|
44
|
+
<div class="es-simplicity-notice-title">微信公众号:</div>
|
|
45
|
+
<img class="es-simplicity-qrcode" @click="getQrcode" :src="qrcode" />
|
|
46
|
+
</div>
|
|
47
|
+
<div class="es-simplicity-notice-type">
|
|
48
|
+
<div class="es-simplicity-notice-title">接收消息类型:</div>
|
|
49
|
+
<es-checkbox-group
|
|
50
|
+
class="es-simplicity-notice-list"
|
|
51
|
+
v-model="checked"
|
|
52
|
+
:min="1"
|
|
53
|
+
:data="notifyList"
|
|
54
|
+
@change="handleCheckboxChange"
|
|
55
|
+
></es-checkbox-group>
|
|
56
|
+
</div>
|
|
57
|
+
<div class="es-simplicity-password" @click="handleOpen">
|
|
58
|
+
修改密码 <i class="es-icon-arrow-right"></i>
|
|
59
|
+
</div>
|
|
60
|
+
<es-dialog title="修改密码" :visible.sync="visible">
|
|
61
|
+
<userinfo v-if="visible" :contents="contents" :value="userInfo">
|
|
62
|
+
</userinfo>
|
|
63
|
+
</es-dialog>
|
|
64
|
+
</div>
|
|
65
|
+
</template>
|
|
66
|
+
|
|
67
|
+
<script>
|
|
68
|
+
import avatar from './avatar.vue';
|
|
69
|
+
import userinfo from './userinfo.vue';
|
|
70
|
+
import util from 'eoss-ui/src/utils/util';
|
|
71
|
+
import { debounce } from 'throttle-debounce';
|
|
72
|
+
import {
|
|
73
|
+
initUserSet,
|
|
74
|
+
switchUserTo,
|
|
75
|
+
updateUserCustomInfo
|
|
76
|
+
} from 'eoss-ui/src/config/api.js';
|
|
77
|
+
export default {
|
|
78
|
+
name: 'User',
|
|
79
|
+
components: { avatar, userinfo },
|
|
80
|
+
props: {
|
|
81
|
+
notify: String,
|
|
82
|
+
notifyList: Array,
|
|
83
|
+
user: Object,
|
|
84
|
+
contents: Array
|
|
85
|
+
},
|
|
86
|
+
data() {
|
|
87
|
+
return {
|
|
88
|
+
userScanBindImgUrl: null,
|
|
89
|
+
qrcode: null,
|
|
90
|
+
checked: [],
|
|
91
|
+
visible: false,
|
|
92
|
+
checkPassword: null,
|
|
93
|
+
checkPasswordMsg: null,
|
|
94
|
+
headImgCode: undefined
|
|
95
|
+
};
|
|
96
|
+
},
|
|
97
|
+
computed: {},
|
|
98
|
+
watch: {
|
|
99
|
+
notify: {
|
|
100
|
+
immediate: true,
|
|
101
|
+
userInfo: {},
|
|
102
|
+
handler(val) {
|
|
103
|
+
if (val) {
|
|
104
|
+
this.checked = val.split(',');
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
beforeCreate() {
|
|
110
|
+
this.setNoticeType = debounce(1000, () => {
|
|
111
|
+
this.setNotice();
|
|
112
|
+
});
|
|
113
|
+
},
|
|
114
|
+
created() {},
|
|
115
|
+
mounted() {
|
|
116
|
+
this.getData();
|
|
117
|
+
},
|
|
118
|
+
methods: {
|
|
119
|
+
//获取用户详细信息
|
|
120
|
+
getData() {
|
|
121
|
+
util
|
|
122
|
+
.ajax({
|
|
123
|
+
url: initUserSet
|
|
124
|
+
})
|
|
125
|
+
.then((res) => {
|
|
126
|
+
if (res.rCode === 0) {
|
|
127
|
+
const results = JSON.parse(JSON.stringify(res.results));
|
|
128
|
+
this.userInfo = results.simpleUserInfo;
|
|
129
|
+
if (results.userScanBindImgUrl) {
|
|
130
|
+
this.userScanBindImgUrl = results.userScanBindImgUrl;
|
|
131
|
+
this.qrcode = this.userScanBindImgUrl;
|
|
132
|
+
}
|
|
133
|
+
this.checkPassword = results.checkPassword;
|
|
134
|
+
this.checkPasswordMsg = results.checkPasswordMsg;
|
|
135
|
+
this.headImgCode = results.headImgCode || undefined;
|
|
136
|
+
} else {
|
|
137
|
+
let msg = res.msg || '系统错误,请联系管理员!';
|
|
138
|
+
this.$message.error(msg);
|
|
139
|
+
}
|
|
140
|
+
})
|
|
141
|
+
.catch((err) => {
|
|
142
|
+
if (err.message && err.message !== 'canceled') {
|
|
143
|
+
this.$message.error(err.message);
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
},
|
|
147
|
+
//刷新公众号二维码图片
|
|
148
|
+
getQrcode() {
|
|
149
|
+
this.qrcode =
|
|
150
|
+
this.userScanBindImgUrl +
|
|
151
|
+
'&_tt=' +
|
|
152
|
+
Math.random().toString().split('.')[1];
|
|
153
|
+
},
|
|
154
|
+
//修改头像
|
|
155
|
+
handleChange(res) {
|
|
156
|
+
this.$emit('change', 'userHeadUrl', res);
|
|
157
|
+
},
|
|
158
|
+
//设置通知类型
|
|
159
|
+
setNotice() {
|
|
160
|
+
let notify = this.checked.join(',');
|
|
161
|
+
util
|
|
162
|
+
.ajax({
|
|
163
|
+
method: 'post',
|
|
164
|
+
url: updateUserCustomInfo,
|
|
165
|
+
data: {
|
|
166
|
+
notify: notify
|
|
167
|
+
}
|
|
168
|
+
})
|
|
169
|
+
.then((results) => {
|
|
170
|
+
if (results.rCode === 0) {
|
|
171
|
+
this.$message.success(results.msg);
|
|
172
|
+
this.$emit('change', 'notify', notify);
|
|
173
|
+
} else {
|
|
174
|
+
this.$message.error(results.msg || '系统错误,请联系管理员!');
|
|
175
|
+
}
|
|
176
|
+
})
|
|
177
|
+
.catch((err) => {
|
|
178
|
+
if (err.message && err.message !== 'canceled') {
|
|
179
|
+
this.$message.error(err.message);
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
},
|
|
183
|
+
//改变通知类型回调
|
|
184
|
+
handleCheckboxChange() {
|
|
185
|
+
this.setNoticeType(this.checked);
|
|
186
|
+
},
|
|
187
|
+
//切换职务
|
|
188
|
+
handleSelect(res) {
|
|
189
|
+
if (this.user.identityId !== res.id) {
|
|
190
|
+
util
|
|
191
|
+
.ajax({
|
|
192
|
+
method: 'post',
|
|
193
|
+
url: switchUserTo,
|
|
194
|
+
data: { userId: res.value }
|
|
195
|
+
})
|
|
196
|
+
.then((res) => {
|
|
197
|
+
if (res.rCode == 0) {
|
|
198
|
+
this.$emit('close');
|
|
199
|
+
util.setStorage({
|
|
200
|
+
type: this.storage,
|
|
201
|
+
key: 'userId',
|
|
202
|
+
value: res.value
|
|
203
|
+
});
|
|
204
|
+
util.removeStorage(['mainConfig', 'jump']);
|
|
205
|
+
this.$message({
|
|
206
|
+
message: res.msg,
|
|
207
|
+
type: 'success',
|
|
208
|
+
duration: 500,
|
|
209
|
+
onClose: () => {
|
|
210
|
+
if (
|
|
211
|
+
util.win.location.href.indexOf('#/main') > -1 ||
|
|
212
|
+
util.win.location.href.indexOf('/main.html') > -1
|
|
213
|
+
) {
|
|
214
|
+
location.reload();
|
|
215
|
+
} else {
|
|
216
|
+
this.$router.replace('/main');
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
} else {
|
|
221
|
+
this.$message({
|
|
222
|
+
message: res.msg || '系统错误,请联系管理员!',
|
|
223
|
+
type: 'error',
|
|
224
|
+
duration: 1500
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
})
|
|
228
|
+
.catch((err) => {
|
|
229
|
+
if (err.message && err.message !== 'canceled') {
|
|
230
|
+
this.$message.error(err.message);
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
//打开修改密码弹窗
|
|
236
|
+
handleOpen() {
|
|
237
|
+
this.visible = true;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
};
|
|
241
|
+
</script>
|
|
242
|
+
|
|
243
|
+
<style lang="scss" scoped></style>
|
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<es-form
|
|
3
|
+
ref="form"
|
|
4
|
+
:model="model"
|
|
5
|
+
:contents="forms"
|
|
6
|
+
class="es-user-info"
|
|
7
|
+
@submit="handleFormSubmit"
|
|
8
|
+
>
|
|
9
|
+
<template slot="other">
|
|
10
|
+
<slot></slot>
|
|
11
|
+
</template>
|
|
12
|
+
</es-form>
|
|
13
|
+
</template>
|
|
14
|
+
<script>
|
|
15
|
+
import { updateUserInfo } from 'eoss-ui/src/config/api.js';
|
|
16
|
+
import util from 'eoss-ui/src/utils/util';
|
|
17
|
+
|
|
18
|
+
export default {
|
|
19
|
+
props: {
|
|
20
|
+
showNotify: {
|
|
21
|
+
type: Boolean,
|
|
22
|
+
default: true
|
|
23
|
+
},
|
|
24
|
+
secret: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
default: true
|
|
27
|
+
},
|
|
28
|
+
contents: Array,
|
|
29
|
+
value: {
|
|
30
|
+
type: Object,
|
|
31
|
+
default() {
|
|
32
|
+
return {};
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
data() {
|
|
37
|
+
return {
|
|
38
|
+
model: this.value
|
|
39
|
+
};
|
|
40
|
+
},
|
|
41
|
+
computed: {
|
|
42
|
+
forms() {
|
|
43
|
+
return this.contents
|
|
44
|
+
? this.contents
|
|
45
|
+
: [
|
|
46
|
+
{
|
|
47
|
+
name: 'orgName',
|
|
48
|
+
label: '所属机构',
|
|
49
|
+
type: 'text',
|
|
50
|
+
disabled: true,
|
|
51
|
+
col: 6
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: 'depName',
|
|
55
|
+
label: '所属部门',
|
|
56
|
+
type: 'text',
|
|
57
|
+
disabled: true,
|
|
58
|
+
col: 6
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: 'idCard',
|
|
62
|
+
label: '身份证号',
|
|
63
|
+
type: 'text',
|
|
64
|
+
disabled: true,
|
|
65
|
+
col: 6
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
name: 'outCode',
|
|
69
|
+
label: '工号',
|
|
70
|
+
type: 'text',
|
|
71
|
+
disabled: true,
|
|
72
|
+
col: 6
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
name: 'phone',
|
|
76
|
+
placeholder: '联系电话',
|
|
77
|
+
label: '联系电话',
|
|
78
|
+
type: 'text',
|
|
79
|
+
col: 6
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
name: 'email',
|
|
83
|
+
placeholder: '电子邮箱',
|
|
84
|
+
label: '电子邮箱',
|
|
85
|
+
type: 'text',
|
|
86
|
+
rules: {
|
|
87
|
+
type: 'email',
|
|
88
|
+
message: '请输入正确的邮箱地址',
|
|
89
|
+
trigger: 'blur'
|
|
90
|
+
},
|
|
91
|
+
col: 6
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
name: 'officetel',
|
|
95
|
+
placeholder: '座机号',
|
|
96
|
+
label: '座机号',
|
|
97
|
+
type: 'text',
|
|
98
|
+
rules: {
|
|
99
|
+
type: 'telephone'
|
|
100
|
+
//message: '请输入正确的邮箱地址',
|
|
101
|
+
//trigger: 'blur'
|
|
102
|
+
},
|
|
103
|
+
col: 6
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
name: 'oldpassword',
|
|
107
|
+
placeholder: '旧密码',
|
|
108
|
+
label: '旧密码',
|
|
109
|
+
type: 'text',
|
|
110
|
+
col: 6,
|
|
111
|
+
rules:
|
|
112
|
+
this.model.password || this.model.repassword
|
|
113
|
+
? {
|
|
114
|
+
required: true,
|
|
115
|
+
message: '请输入旧密码'
|
|
116
|
+
}
|
|
117
|
+
: {},
|
|
118
|
+
events: {
|
|
119
|
+
change: () => {
|
|
120
|
+
if (
|
|
121
|
+
!this.model.repassword &&
|
|
122
|
+
!this.model.oldpassword &&
|
|
123
|
+
!this.model.repassword
|
|
124
|
+
) {
|
|
125
|
+
this.$refs.form.clearValidate();
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
name: 'password',
|
|
132
|
+
placeholder: '新密码',
|
|
133
|
+
label: '新密码',
|
|
134
|
+
type: 'text',
|
|
135
|
+
col: 6,
|
|
136
|
+
rules: [
|
|
137
|
+
this.model.repassword || this.model.oldpassword
|
|
138
|
+
? {
|
|
139
|
+
required: true,
|
|
140
|
+
message: '请输入新密码'
|
|
141
|
+
}
|
|
142
|
+
: {},
|
|
143
|
+
{
|
|
144
|
+
pattern: this.checkPassword,
|
|
145
|
+
message: this.checkPasswordMsg
|
|
146
|
+
? this.checkPasswordMsg
|
|
147
|
+
: '密码格式不合法',
|
|
148
|
+
trigger: 'blur'
|
|
149
|
+
}
|
|
150
|
+
],
|
|
151
|
+
events: {
|
|
152
|
+
change: () => {
|
|
153
|
+
if (
|
|
154
|
+
!this.model.repassword &&
|
|
155
|
+
!this.model.oldpassword &&
|
|
156
|
+
!this.model.repassword
|
|
157
|
+
) {
|
|
158
|
+
this.$refs.form.clearValidate();
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
name: 'repassword',
|
|
165
|
+
placeholder: '确认新密码',
|
|
166
|
+
label: '确认新密码',
|
|
167
|
+
type: 'text',
|
|
168
|
+
col: 6,
|
|
169
|
+
rules: [
|
|
170
|
+
this.model.password || this.model.oldpassword
|
|
171
|
+
? {
|
|
172
|
+
required: true,
|
|
173
|
+
message: '请再次输入新密码'
|
|
174
|
+
}
|
|
175
|
+
: {},
|
|
176
|
+
{ validator: this.repassword, trigger: 'blur' },
|
|
177
|
+
this.checkPassword
|
|
178
|
+
? {
|
|
179
|
+
pattern: this.checkPassword,
|
|
180
|
+
message: this.checkPasswordMsg
|
|
181
|
+
? this.checkPasswordMsg
|
|
182
|
+
: '密码格式不合法',
|
|
183
|
+
trigger: 'blur'
|
|
184
|
+
}
|
|
185
|
+
: {}
|
|
186
|
+
],
|
|
187
|
+
events: {
|
|
188
|
+
change: () => {
|
|
189
|
+
if (
|
|
190
|
+
!this.model.repassword &&
|
|
191
|
+
!this.model.oldpassword &&
|
|
192
|
+
!this.model.repassword
|
|
193
|
+
) {
|
|
194
|
+
this.$refs.form.clearValidate();
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
];
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
created() {},
|
|
203
|
+
mounted() {},
|
|
204
|
+
methods: {
|
|
205
|
+
handleFormSubmit() {
|
|
206
|
+
let initLogin = util.getStorage('initLogin');
|
|
207
|
+
initLogin && (initLogin = JSON.parse(initLogin));
|
|
208
|
+
util
|
|
209
|
+
.ajax({
|
|
210
|
+
url: updateUserInfo,
|
|
211
|
+
params: {
|
|
212
|
+
email: this.model.email,
|
|
213
|
+
officeTel: this.model.officeTel,
|
|
214
|
+
phone: this.model.phone,
|
|
215
|
+
oldPassword:
|
|
216
|
+
this.secret &&
|
|
217
|
+
initLogin &&
|
|
218
|
+
initLogin.secret &&
|
|
219
|
+
this.model.oldpassword
|
|
220
|
+
? util.esmEncrypt({
|
|
221
|
+
data: this.model.oldpassword,
|
|
222
|
+
key: initLogin.secret
|
|
223
|
+
})
|
|
224
|
+
: this.model.oldpassword,
|
|
225
|
+
password:
|
|
226
|
+
this.secret &&
|
|
227
|
+
initLogin &&
|
|
228
|
+
initLogin.secret &&
|
|
229
|
+
this.model.password
|
|
230
|
+
? util.esmEncrypt({
|
|
231
|
+
data: this.model.password,
|
|
232
|
+
key: initLogin.secret
|
|
233
|
+
})
|
|
234
|
+
: this.model.password
|
|
235
|
+
}
|
|
236
|
+
})
|
|
237
|
+
.then((res) => {
|
|
238
|
+
if (res.rCode === 0) {
|
|
239
|
+
if (this.model.oldpassword && this.model.password) {
|
|
240
|
+
this.$confirm('密码修改成功,请重新登录!', '提示', {
|
|
241
|
+
confirmButtonText: '确定',
|
|
242
|
+
cancelButtonText: '取消',
|
|
243
|
+
closeOnClickModal: false,
|
|
244
|
+
type: 'warning'
|
|
245
|
+
})
|
|
246
|
+
.then(() => {
|
|
247
|
+
const loginPage =
|
|
248
|
+
util.getStorage('login') || util.getStorage('loginPage');
|
|
249
|
+
try {
|
|
250
|
+
if (loginPage) {
|
|
251
|
+
let src;
|
|
252
|
+
if (!util.startWith(loginPage, ['http', '/'], true)) {
|
|
253
|
+
let pathname = util.win.top.location.pathname;
|
|
254
|
+
if (pathname !== '/') {
|
|
255
|
+
pathname = pathname.split('/');
|
|
256
|
+
pathname.splice(pathname.length - 1);
|
|
257
|
+
pathname = pathname.join('/');
|
|
258
|
+
src = pathname + '/' + loginPage.replace('./', '');
|
|
259
|
+
} else {
|
|
260
|
+
src = pathname + loginPage.replace('./', '');
|
|
261
|
+
}
|
|
262
|
+
} else {
|
|
263
|
+
src = loginPage;
|
|
264
|
+
}
|
|
265
|
+
util.win.top.location.href = src;
|
|
266
|
+
} else if (
|
|
267
|
+
util.win.top.location.href.indexOf('main.html') > -1
|
|
268
|
+
) {
|
|
269
|
+
util.win.top.location.href = './login.html';
|
|
270
|
+
} else {
|
|
271
|
+
const hash = util.win.top.location.hash;
|
|
272
|
+
if (hash) {
|
|
273
|
+
const len = util.win.top.location.href.indexOf(hash);
|
|
274
|
+
util.win.top.location.href =
|
|
275
|
+
util.win.location.href.slice(0, len) + '#/login';
|
|
276
|
+
} else {
|
|
277
|
+
util.win.top.location.href = '/login.html';
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
} catch (error) {
|
|
281
|
+
util.win.postMessage({ type: 1 }, '*');
|
|
282
|
+
}
|
|
283
|
+
})
|
|
284
|
+
.catch((e) => {});
|
|
285
|
+
}
|
|
286
|
+
} else {
|
|
287
|
+
let msg = res.msg || '系统错误,请联系管理员!';
|
|
288
|
+
this.$message.error(msg);
|
|
289
|
+
}
|
|
290
|
+
});
|
|
291
|
+
},
|
|
292
|
+
repassword(rule, value, callback) {
|
|
293
|
+
if (this.model.oldpassword && this.model.password && value) {
|
|
294
|
+
util.identical({ value: [value, this.model.password], callback });
|
|
295
|
+
} else {
|
|
296
|
+
callback();
|
|
297
|
+
return true;
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
};
|
|
302
|
+
</script>
|