eoss-ui 0.6.20 → 0.6.21

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.
Files changed (100) hide show
  1. package/lib/eoss-ui.common.js +362 -355
  2. package/lib/flow.js +118 -118
  3. package/lib/form.js +3 -3
  4. package/lib/index.js +1 -1
  5. package/lib/login.js +2 -3
  6. package/lib/main.js +210 -202
  7. package/lib/qr-code.js +13 -13
  8. package/lib/theme-chalk/index.css +1 -1
  9. package/lib/theme-chalk/login.css +1 -1
  10. package/lib/theme-chalk/selector.css +1 -1
  11. package/package.json +157 -157
  12. package/packages/.DS_Store +0 -0
  13. package/packages/button/src/main.vue +418 -418
  14. package/packages/button-group/src/main.vue +298 -298
  15. package/packages/checkbox-group/.DS_Store +0 -0
  16. package/packages/checkbox-group/src/main.vue +333 -333
  17. package/packages/clients/src/main.vue +144 -144
  18. package/packages/data-table/.DS_Store +0 -0
  19. package/packages/data-table/src/children.vue +39 -39
  20. package/packages/data-table/src/column.vue +983 -983
  21. package/packages/data-table/src/main.vue +1812 -1812
  22. package/packages/data-table/src/sizer.vue +195 -195
  23. package/packages/date-picker/src/main.vue +236 -236
  24. package/packages/dialog/.DS_Store +0 -0
  25. package/packages/flow/src/main.vue +2731 -2731
  26. package/packages/flow-group/src/main.vue +684 -684
  27. package/packages/form/src/main.vue +3582 -3582
  28. package/packages/form/src/table.vue +1420 -1420
  29. package/packages/handle-user/src/main.vue +134 -134
  30. package/packages/handler/.DS_Store +0 -0
  31. package/packages/handler/src/main.vue +374 -374
  32. package/packages/icon/src/main.vue +101 -101
  33. package/packages/input/src/main.vue +356 -356
  34. package/packages/login/.DS_Store +0 -0
  35. package/packages/login/src/main.vue +1850 -1851
  36. package/packages/login/src/resetPassword.vue +557 -557
  37. package/packages/main/.DS_Store +0 -0
  38. package/packages/main/src/.DS_Store +0 -0
  39. package/packages/main/src/default/message.vue +249 -249
  40. package/packages/main/src/default/notice.vue +157 -157
  41. package/packages/main/src/default/userinfo.vue +494 -494
  42. package/packages/main/src/main.vue +65 -57
  43. package/packages/main/src/public/online.vue +89 -89
  44. package/packages/main/src/public/search.vue +454 -454
  45. package/packages/main/src/public/settings.vue +221 -221
  46. package/packages/main/src/simplicity/apps.vue +388 -388
  47. package/packages/main/src/simplicity/avatar.vue +82 -82
  48. package/packages/main/src/simplicity/handler.vue +183 -183
  49. package/packages/main/src/simplicity/index.vue +1931 -1930
  50. package/packages/main/src/simplicity/lists.vue +84 -84
  51. package/packages/main/src/simplicity/menu-list.vue +128 -128
  52. package/packages/main/src/simplicity/message.vue +259 -259
  53. package/packages/main/src/simplicity/notice.vue +190 -190
  54. package/packages/main/src/simplicity/router-page.vue +45 -45
  55. package/packages/main/src/simplicity/sub-menu.vue +241 -241
  56. package/packages/main/src/simplicity/user.vue +248 -248
  57. package/packages/main/src/simplicity/userinfo.vue +304 -304
  58. package/packages/menu/src/main.vue +536 -536
  59. package/packages/pagination/src/main.vue +96 -96
  60. package/packages/qr-code/src/main.vue +170 -170
  61. package/packages/radio-group/src/main.vue +319 -319
  62. package/packages/select/src/main.vue +761 -761
  63. package/packages/selector/src/main.vue +677 -677
  64. package/packages/selector-panel/src/main.vue +1020 -1020
  65. package/packages/selector-panel/src/selection.vue +160 -160
  66. package/packages/tabs/src/main.vue +788 -788
  67. package/packages/theme-chalk/lib/index.css +1 -1
  68. package/packages/theme-chalk/lib/login.css +1 -1
  69. package/packages/theme-chalk/lib/selector.css +1 -1
  70. package/packages/theme-chalk/src/.DS_Store +0 -0
  71. package/packages/theme-chalk/src/base.scss +260 -260
  72. package/packages/theme-chalk/src/button-group.scss +175 -175
  73. package/packages/theme-chalk/src/calendar.scss +113 -113
  74. package/packages/theme-chalk/src/clients.scss +87 -87
  75. package/packages/theme-chalk/src/common/var.scss +4 -1
  76. package/packages/theme-chalk/src/data-table.scss +276 -276
  77. package/packages/theme-chalk/src/dialog.scss +77 -77
  78. package/packages/theme-chalk/src/flow-group.scss +110 -110
  79. package/packages/theme-chalk/src/form.scss +496 -496
  80. package/packages/theme-chalk/src/handler.scss +133 -133
  81. package/packages/theme-chalk/src/icon.scss +1745 -1745
  82. package/packages/theme-chalk/src/icons.scss +99 -99
  83. package/packages/theme-chalk/src/login.scss +926 -917
  84. package/packages/theme-chalk/src/main.scss +632 -632
  85. package/packages/theme-chalk/src/menu.scss +222 -222
  86. package/packages/theme-chalk/src/nav.scss +125 -125
  87. package/packages/theme-chalk/src/pagination.scss +29 -29
  88. package/packages/theme-chalk/src/selector-panel.scss +204 -204
  89. package/packages/theme-chalk/src/selector.scss +1 -1
  90. package/packages/theme-chalk/src/simplicity.scss +1246 -1246
  91. package/packages/theme-chalk/src/tabs.scss +87 -87
  92. package/packages/theme-chalk/src/toolbar.scss +179 -179
  93. package/packages/theme-chalk/src/tree-group.scss +72 -72
  94. package/packages/theme-chalk/src/tree.scss +165 -165
  95. package/packages/upload/src/main.vue +1313 -1313
  96. package/packages/wujie/src/main.vue +145 -145
  97. package/src/.DS_Store +0 -0
  98. package/src/config/api.js +236 -236
  99. package/src/config/image.js +2 -2
  100. package/src/index.js +157 -157
@@ -1,304 +1,304 @@
1
- <template>
2
- <es-form
3
- ref="form"
4
- :model="model"
5
- :contents="forms"
6
- class="es-user-info"
7
- :autocomplete="false"
8
- @submit="handleFormSubmit"
9
- >
10
- <template slot="other">
11
- <slot></slot>
12
- </template>
13
- </es-form>
14
- </template>
15
- <script>
16
- import { updateUserInfo } from 'eoss-ui/src/config/api.js';
17
- import util from 'eoss-ui/src/utils/util';
18
-
19
- export default {
20
- name: 'UserInfo',
21
- props: {
22
- showNotify: {
23
- type: Boolean,
24
- default: true
25
- },
26
- secret: {
27
- type: Boolean,
28
- default: true
29
- },
30
- contents: Array,
31
- value: {
32
- type: Object,
33
- default() {
34
- return {};
35
- }
36
- }
37
- },
38
- data() {
39
- return {
40
- model: this.value
41
- };
42
- },
43
- computed: {
44
- forms() {
45
- return this.contents
46
- ? this.contents
47
- : [
48
- {
49
- name: 'orgName',
50
- label: '所属机构',
51
- type: 'text',
52
- disabled: true,
53
- col: 6
54
- },
55
- {
56
- name: 'depName',
57
- label: '所属部门',
58
- type: 'text',
59
- disabled: true,
60
- col: 6
61
- },
62
- {
63
- name: 'idCard',
64
- label: '身份证号',
65
- type: 'text',
66
- disabled: true,
67
- col: 6
68
- },
69
- {
70
- name: 'outCode',
71
- label: '工号',
72
- type: 'text',
73
- disabled: true,
74
- col: 6
75
- },
76
- {
77
- name: 'phone',
78
- placeholder: '联系电话',
79
- label: '联系电话',
80
- type: 'text',
81
- col: 6
82
- },
83
- {
84
- name: 'email',
85
- placeholder: '电子邮箱',
86
- label: '电子邮箱',
87
- type: 'text',
88
- rules: {
89
- type: 'email',
90
- message: '请输入正确的邮箱地址',
91
- trigger: 'blur'
92
- },
93
- col: 6
94
- },
95
- {
96
- name: 'officetel',
97
- placeholder: '座机号',
98
- label: '座机号',
99
- type: 'text',
100
- rules: {
101
- type: 'telephone'
102
- //message: '请输入正确的邮箱地址',
103
- //trigger: 'blur'
104
- },
105
- col: 6
106
- },
107
- {
108
- name: 'oldpassword',
109
- placeholder: '旧密码',
110
- label: '旧密码',
111
- type: 'text',
112
- col: 6,
113
- rules:
114
- this.model.password || this.model.repassword
115
- ? {
116
- required: true,
117
- message: '请输入旧密码'
118
- }
119
- : {},
120
- events: {
121
- change: () => {
122
- if (
123
- !this.model.repassword &&
124
- !this.model.oldpassword &&
125
- !this.model.repassword
126
- ) {
127
- this.$refs.form.clearValidate();
128
- }
129
- }
130
- }
131
- },
132
- {
133
- name: 'password',
134
- placeholder: '新密码',
135
- label: '新密码',
136
- type: 'text',
137
- col: 6,
138
- rules: [
139
- this.model.repassword || this.model.oldpassword
140
- ? {
141
- required: true,
142
- message: '请输入新密码'
143
- }
144
- : {},
145
- {
146
- pattern: this.checkPassword,
147
- message: this.checkPasswordMsg
148
- ? this.checkPasswordMsg
149
- : '密码格式不合法',
150
- trigger: 'blur'
151
- }
152
- ],
153
- events: {
154
- change: () => {
155
- if (
156
- !this.model.repassword &&
157
- !this.model.oldpassword &&
158
- !this.model.repassword
159
- ) {
160
- this.$refs.form.clearValidate();
161
- }
162
- }
163
- }
164
- },
165
- {
166
- name: 'repassword',
167
- placeholder: '确认新密码',
168
- label: '确认新密码',
169
- type: 'text',
170
- col: 6,
171
- rules: [
172
- this.model.password || this.model.oldpassword
173
- ? {
174
- required: true,
175
- message: '请再次输入新密码'
176
- }
177
- : {},
178
- { validator: this.repassword, trigger: 'blur' },
179
- this.checkPassword
180
- ? {
181
- pattern: this.checkPassword,
182
- message: this.checkPasswordMsg
183
- ? this.checkPasswordMsg
184
- : '密码格式不合法',
185
- trigger: 'blur'
186
- }
187
- : {}
188
- ],
189
- events: {
190
- change: () => {
191
- if (
192
- !this.model.repassword &&
193
- !this.model.oldpassword &&
194
- !this.model.repassword
195
- ) {
196
- this.$refs.form.clearValidate();
197
- }
198
- }
199
- }
200
- }
201
- ];
202
- }
203
- },
204
- created() {},
205
- mounted() {},
206
- methods: {
207
- handleFormSubmit() {
208
- let initLogin = util.getStorage('initLogin');
209
- initLogin && (initLogin = JSON.parse(initLogin));
210
- util
211
- .ajax({
212
- url: updateUserInfo,
213
- params: {
214
- email: this.model.email,
215
- officeTel: this.model.officeTel,
216
- phone: this.model.phone,
217
- oldPassword:
218
- this.secret &&
219
- initLogin &&
220
- initLogin.secret &&
221
- this.model.oldpassword
222
- ? util.esmEncrypt({
223
- data: this.model.oldpassword,
224
- key: initLogin.secret
225
- })
226
- : this.model.oldpassword,
227
- password:
228
- this.secret &&
229
- initLogin &&
230
- initLogin.secret &&
231
- this.model.password
232
- ? util.esmEncrypt({
233
- data: this.model.password,
234
- key: initLogin.secret
235
- })
236
- : this.model.password
237
- }
238
- })
239
- .then((res) => {
240
- if (res.rCode === 0) {
241
- if (this.model.oldpassword && this.model.password) {
242
- this.$confirm('密码修改成功,请重新登录!', '提示', {
243
- confirmButtonText: '确定',
244
- cancelButtonText: '取消',
245
- closeOnClickModal: false,
246
- type: 'warning'
247
- })
248
- .then(() => {
249
- const loginPage =
250
- util.getStorage('login') || util.getStorage('loginPage');
251
- try {
252
- if (loginPage) {
253
- let src;
254
- if (!util.startWith(loginPage, ['http', '/'], true)) {
255
- let pathname = util.win.top.location.pathname;
256
- if (pathname !== '/') {
257
- pathname = pathname.split('/');
258
- pathname.splice(pathname.length - 1);
259
- pathname = pathname.join('/');
260
- src = pathname + '/' + loginPage.replace('./', '');
261
- } else {
262
- src = pathname + loginPage.replace('./', '');
263
- }
264
- } else {
265
- src = loginPage;
266
- }
267
- util.win.top.location.href = src;
268
- } else if (
269
- util.win.top.location.href.indexOf('main.html') > -1
270
- ) {
271
- util.win.top.location.href = './login.html';
272
- } else {
273
- const hash = util.win.top.location.hash;
274
- if (hash) {
275
- const len = util.win.top.location.href.indexOf(hash);
276
- util.win.top.location.href =
277
- util.win.location.href.slice(0, len) + '#/login';
278
- } else {
279
- util.win.top.location.href = '/login.html';
280
- }
281
- }
282
- } catch (error) {
283
- util.win.postMessage({ type: 1 }, '*');
284
- }
285
- })
286
- .catch((e) => {});
287
- }
288
- } else {
289
- let msg = res.msg || '系统错误,请联系管理员!';
290
- this.$message.error(msg);
291
- }
292
- });
293
- },
294
- repassword(rule, value, callback) {
295
- if (this.model.oldpassword && this.model.password && value) {
296
- util.identical({ value: [value, this.model.password], callback });
297
- } else {
298
- callback();
299
- return true;
300
- }
301
- }
302
- }
303
- };
304
- </script>
1
+ <template>
2
+ <es-form
3
+ ref="form"
4
+ :model="model"
5
+ :contents="forms"
6
+ class="es-user-info"
7
+ :autocomplete="false"
8
+ @submit="handleFormSubmit"
9
+ >
10
+ <template slot="other">
11
+ <slot></slot>
12
+ </template>
13
+ </es-form>
14
+ </template>
15
+ <script>
16
+ import { updateUserInfo } from 'eoss-ui/src/config/api.js';
17
+ import util from 'eoss-ui/src/utils/util';
18
+
19
+ export default {
20
+ name: 'UserInfo',
21
+ props: {
22
+ showNotify: {
23
+ type: Boolean,
24
+ default: true
25
+ },
26
+ secret: {
27
+ type: Boolean,
28
+ default: true
29
+ },
30
+ contents: Array,
31
+ value: {
32
+ type: Object,
33
+ default() {
34
+ return {};
35
+ }
36
+ }
37
+ },
38
+ data() {
39
+ return {
40
+ model: this.value
41
+ };
42
+ },
43
+ computed: {
44
+ forms() {
45
+ return this.contents
46
+ ? this.contents
47
+ : [
48
+ {
49
+ name: 'orgName',
50
+ label: '所属机构',
51
+ type: 'text',
52
+ disabled: true,
53
+ col: 6
54
+ },
55
+ {
56
+ name: 'depName',
57
+ label: '所属部门',
58
+ type: 'text',
59
+ disabled: true,
60
+ col: 6
61
+ },
62
+ {
63
+ name: 'idCard',
64
+ label: '身份证号',
65
+ type: 'text',
66
+ disabled: true,
67
+ col: 6
68
+ },
69
+ {
70
+ name: 'outCode',
71
+ label: '工号',
72
+ type: 'text',
73
+ disabled: true,
74
+ col: 6
75
+ },
76
+ {
77
+ name: 'phone',
78
+ placeholder: '联系电话',
79
+ label: '联系电话',
80
+ type: 'text',
81
+ col: 6
82
+ },
83
+ {
84
+ name: 'email',
85
+ placeholder: '电子邮箱',
86
+ label: '电子邮箱',
87
+ type: 'text',
88
+ rules: {
89
+ type: 'email',
90
+ message: '请输入正确的邮箱地址',
91
+ trigger: 'blur'
92
+ },
93
+ col: 6
94
+ },
95
+ {
96
+ name: 'officetel',
97
+ placeholder: '座机号',
98
+ label: '座机号',
99
+ type: 'text',
100
+ rules: {
101
+ type: 'telephone'
102
+ //message: '请输入正确的邮箱地址',
103
+ //trigger: 'blur'
104
+ },
105
+ col: 6
106
+ },
107
+ {
108
+ name: 'oldpassword',
109
+ placeholder: '旧密码',
110
+ label: '旧密码',
111
+ type: 'text',
112
+ col: 6,
113
+ rules:
114
+ this.model.password || this.model.repassword
115
+ ? {
116
+ required: true,
117
+ message: '请输入旧密码'
118
+ }
119
+ : {},
120
+ events: {
121
+ change: () => {
122
+ if (
123
+ !this.model.repassword &&
124
+ !this.model.oldpassword &&
125
+ !this.model.repassword
126
+ ) {
127
+ this.$refs.form.clearValidate();
128
+ }
129
+ }
130
+ }
131
+ },
132
+ {
133
+ name: 'password',
134
+ placeholder: '新密码',
135
+ label: '新密码',
136
+ type: 'text',
137
+ col: 6,
138
+ rules: [
139
+ this.model.repassword || this.model.oldpassword
140
+ ? {
141
+ required: true,
142
+ message: '请输入新密码'
143
+ }
144
+ : {},
145
+ {
146
+ pattern: this.checkPassword,
147
+ message: this.checkPasswordMsg
148
+ ? this.checkPasswordMsg
149
+ : '密码格式不合法',
150
+ trigger: 'blur'
151
+ }
152
+ ],
153
+ events: {
154
+ change: () => {
155
+ if (
156
+ !this.model.repassword &&
157
+ !this.model.oldpassword &&
158
+ !this.model.repassword
159
+ ) {
160
+ this.$refs.form.clearValidate();
161
+ }
162
+ }
163
+ }
164
+ },
165
+ {
166
+ name: 'repassword',
167
+ placeholder: '确认新密码',
168
+ label: '确认新密码',
169
+ type: 'text',
170
+ col: 6,
171
+ rules: [
172
+ this.model.password || this.model.oldpassword
173
+ ? {
174
+ required: true,
175
+ message: '请再次输入新密码'
176
+ }
177
+ : {},
178
+ { validator: this.repassword, trigger: 'blur' },
179
+ this.checkPassword
180
+ ? {
181
+ pattern: this.checkPassword,
182
+ message: this.checkPasswordMsg
183
+ ? this.checkPasswordMsg
184
+ : '密码格式不合法',
185
+ trigger: 'blur'
186
+ }
187
+ : {}
188
+ ],
189
+ events: {
190
+ change: () => {
191
+ if (
192
+ !this.model.repassword &&
193
+ !this.model.oldpassword &&
194
+ !this.model.repassword
195
+ ) {
196
+ this.$refs.form.clearValidate();
197
+ }
198
+ }
199
+ }
200
+ }
201
+ ];
202
+ }
203
+ },
204
+ created() {},
205
+ mounted() {},
206
+ methods: {
207
+ handleFormSubmit() {
208
+ let initLogin = util.getStorage('initLogin');
209
+ initLogin && (initLogin = JSON.parse(initLogin));
210
+ util
211
+ .ajax({
212
+ url: updateUserInfo,
213
+ params: {
214
+ email: this.model.email,
215
+ officeTel: this.model.officeTel,
216
+ phone: this.model.phone,
217
+ oldPassword:
218
+ this.secret &&
219
+ initLogin &&
220
+ initLogin.secret &&
221
+ this.model.oldpassword
222
+ ? util.esmEncrypt({
223
+ data: this.model.oldpassword,
224
+ key: initLogin.secret
225
+ })
226
+ : this.model.oldpassword,
227
+ password:
228
+ this.secret &&
229
+ initLogin &&
230
+ initLogin.secret &&
231
+ this.model.password
232
+ ? util.esmEncrypt({
233
+ data: this.model.password,
234
+ key: initLogin.secret
235
+ })
236
+ : this.model.password
237
+ }
238
+ })
239
+ .then((res) => {
240
+ if (res.rCode === 0) {
241
+ if (this.model.oldpassword && this.model.password) {
242
+ this.$confirm('密码修改成功,请重新登录!', '提示', {
243
+ confirmButtonText: '确定',
244
+ cancelButtonText: '取消',
245
+ closeOnClickModal: false,
246
+ type: 'warning'
247
+ })
248
+ .then(() => {
249
+ const loginPage =
250
+ util.getStorage('login') || util.getStorage('loginPage');
251
+ try {
252
+ if (loginPage) {
253
+ let src;
254
+ if (!util.startWith(loginPage, ['http', '/'], true)) {
255
+ let pathname = util.win.top.location.pathname;
256
+ if (pathname !== '/') {
257
+ pathname = pathname.split('/');
258
+ pathname.splice(pathname.length - 1);
259
+ pathname = pathname.join('/');
260
+ src = pathname + '/' + loginPage.replace('./', '');
261
+ } else {
262
+ src = pathname + loginPage.replace('./', '');
263
+ }
264
+ } else {
265
+ src = loginPage;
266
+ }
267
+ util.win.top.location.href = src;
268
+ } else if (
269
+ util.win.top.location.href.indexOf('main.html') > -1
270
+ ) {
271
+ util.win.top.location.href = './login.html';
272
+ } else {
273
+ const hash = util.win.top.location.hash;
274
+ if (hash) {
275
+ const len = util.win.top.location.href.indexOf(hash);
276
+ util.win.top.location.href =
277
+ util.win.location.href.slice(0, len) + '#/login';
278
+ } else {
279
+ util.win.top.location.href = '/login.html';
280
+ }
281
+ }
282
+ } catch (error) {
283
+ util.win.postMessage({ type: 1 }, '*');
284
+ }
285
+ })
286
+ .catch((e) => {});
287
+ }
288
+ } else {
289
+ let msg = res.msg || '系统错误,请联系管理员!';
290
+ this.$message.error(msg);
291
+ }
292
+ });
293
+ },
294
+ repassword(rule, value, callback) {
295
+ if (this.model.oldpassword && this.model.password && value) {
296
+ util.identical({ value: [value, this.model.password], callback });
297
+ } else {
298
+ callback();
299
+ return true;
300
+ }
301
+ }
302
+ }
303
+ };
304
+ </script>