eoss-ui 0.3.97 → 0.4.14

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 (102) hide show
  1. package/lib/button-group.js +98 -15
  2. package/lib/button.js +100 -17
  3. package/lib/ca-login.js +326 -0
  4. package/lib/card.js +2 -2
  5. package/lib/cascader.js +2 -2
  6. package/lib/checkbox-group.js +104 -18
  7. package/lib/clients.js +2 -2
  8. package/lib/data-table-form.js +104 -21
  9. package/lib/data-table.js +228 -35
  10. package/lib/date-picker.js +100 -17
  11. package/lib/dialog.js +101 -17
  12. package/lib/enterprise.js +2 -2
  13. package/lib/eoss-ui.common.js +480 -122
  14. package/lib/error-page.js +2 -2
  15. package/lib/flow-group.js +100 -17
  16. package/lib/flow-list.js +98 -15
  17. package/lib/flow.js +98 -15
  18. package/lib/form.js +112 -26
  19. package/lib/handle-user.js +100 -17
  20. package/lib/handler.js +100 -17
  21. package/lib/index.js +1 -1
  22. package/lib/input-number.js +100 -17
  23. package/lib/input.js +100 -17
  24. package/lib/label.js +2 -2
  25. package/lib/login.js +126 -27
  26. package/lib/main.js +98 -15
  27. package/lib/mainComp.js +98 -15
  28. package/lib/menu.js +2 -2
  29. package/lib/nav.js +100 -17
  30. package/lib/notify.js +2 -2
  31. package/lib/page.js +100 -17
  32. package/lib/pagination.js +2 -2
  33. package/lib/player.js +100 -17
  34. package/lib/qr-code.js +107 -24
  35. package/lib/radio-group.js +106 -20
  36. package/lib/select-ganged.js +104 -18
  37. package/lib/select.js +114 -25
  38. package/lib/selector-panel.js +109 -23
  39. package/lib/selector.js +106 -20
  40. package/lib/sizer.js +100 -17
  41. package/lib/steps.js +100 -17
  42. package/lib/switch.js +100 -17
  43. package/lib/table-form.js +107 -24
  44. package/lib/tabs-panel.js +2 -2
  45. package/lib/tabs.js +100 -17
  46. package/lib/theme-chalk/base.css +1 -1
  47. package/lib/theme-chalk/ca-login.css +1 -0
  48. package/lib/theme-chalk/fonts/iconfont.ttf +0 -0
  49. package/lib/theme-chalk/fonts/iconfont.woff +0 -0
  50. package/lib/theme-chalk/icon.css +1 -1
  51. package/lib/theme-chalk/index.css +1 -1
  52. package/lib/theme-chalk/main.css +1 -1
  53. package/lib/theme-chalk/menu.css +1 -1
  54. package/lib/theme-chalk/sizer.css +1 -1
  55. package/lib/theme-chalk/upload.css +1 -1
  56. package/lib/tips.js +110 -22
  57. package/lib/toolbar.js +2 -2
  58. package/lib/tree-group.js +100 -17
  59. package/lib/tree.js +100 -17
  60. package/lib/upload.js +98 -15
  61. package/lib/utils/util.js +98 -15
  62. package/lib/wujie.js +100 -17
  63. package/lib/wxlogin.js +100 -17
  64. package/package.json +2 -2
  65. package/packages/ca-login/index.js +5 -0
  66. package/packages/ca-login/src/main.vue +62 -0
  67. package/packages/checkbox-group/index.js +3 -3
  68. package/packages/checkbox-group/src/main.vue +4 -1
  69. package/packages/data-table/src/column.vue +110 -28
  70. package/packages/data-table/src/main.vue +2 -1
  71. package/packages/data-table-form/src/table.vue +1 -1
  72. package/packages/form/src/main.vue +17 -7
  73. package/packages/login/src/main.vue +40 -13
  74. package/packages/radio-group/index.js +3 -3
  75. package/packages/radio-group/src/main.vue +4 -1
  76. package/packages/select/src/main.vue +7 -1
  77. package/packages/select-ganged/src/main.vue +4 -1
  78. package/packages/selector/src/main.vue +4 -1
  79. package/packages/selector-panel/src/selection.vue +4 -1
  80. package/packages/theme-chalk/lib/base.css +1 -1
  81. package/packages/theme-chalk/lib/ca-login.css +1 -0
  82. package/packages/theme-chalk/lib/fonts/iconfont.ttf +0 -0
  83. package/packages/theme-chalk/lib/fonts/iconfont.woff +0 -0
  84. package/packages/theme-chalk/lib/icon.css +1 -1
  85. package/packages/theme-chalk/lib/index.css +1 -1
  86. package/packages/theme-chalk/lib/main.css +1 -1
  87. package/packages/theme-chalk/lib/menu.css +1 -1
  88. package/packages/theme-chalk/lib/sizer.css +1 -1
  89. package/packages/theme-chalk/lib/upload.css +1 -1
  90. package/packages/theme-chalk/src/ca-login.scss +4 -0
  91. package/packages/theme-chalk/src/fonts/iconfont.ttf +0 -0
  92. package/packages/theme-chalk/src/fonts/iconfont.woff +0 -0
  93. package/packages/theme-chalk/src/icon.scss +8 -0
  94. package/packages/theme-chalk/src/index.scss +1 -0
  95. package/packages/tips/src/main.vue +5 -2
  96. package/src/index.js +4 -1
  97. package/src/utils/util.js +108 -36
  98. package/lib/theme-chalk/radio.css +0 -1
  99. package/packages/radio/index.js +0 -5
  100. package/packages/radio/src/main.vue +0 -259
  101. package/packages/theme-chalk/lib/radio.css +0 -1
  102. package/packages/theme-chalk/src/radio.scss +0 -3
@@ -4,6 +4,8 @@
4
4
  v-show="!item.hide"
5
5
  :filter-icon="filterIcon"
6
6
  :label="item.title || item.label"
7
+ :label-key="item.labelKey"
8
+ :value-key="item.valueKey"
7
9
  :prop="item.field || item.prop"
8
10
  :fixed="item.fixed"
9
11
  :sortable="item.sortable || item.sort"
@@ -80,12 +82,22 @@
80
82
  "
81
83
  @blur="
82
84
  event => {
83
- handleBlur({ item: item, event: event, data: scope.row });
85
+ handleBlur({
86
+ item: item,
87
+ event: event,
88
+ data: scope.row,
89
+ scope: scope
90
+ });
84
91
  }
85
92
  "
86
93
  @focus="
87
94
  event => {
88
- handleFocus({ item: item, event: event, data: scope.row });
95
+ handleFocus({
96
+ item: item,
97
+ event: event,
98
+ data: scope.row,
99
+ scope: scope
100
+ });
89
101
  }
90
102
  "
91
103
  @change="
@@ -94,7 +106,8 @@
94
106
  item: item,
95
107
  name: item.field || item.prop,
96
108
  value: value,
97
- data: scope.row
109
+ data: scope.row,
110
+ scope: scope
98
111
  });
99
112
  }
100
113
  "
@@ -112,12 +125,22 @@
112
125
  "
113
126
  @blur="
114
127
  event => {
115
- handleBlur({ item: item, event: event, data: scope.row });
128
+ handleBlur({
129
+ item: item,
130
+ event: event,
131
+ data: scope.row,
132
+ scope: scope
133
+ });
116
134
  }
117
135
  "
118
136
  @focus="
119
137
  event => {
120
- handleFocus({ item: item, event: event, data: scope.row });
138
+ handleFocus({
139
+ item: item,
140
+ event: event,
141
+ data: scope.row,
142
+ scope: scope
143
+ });
121
144
  }
122
145
  "
123
146
  @change="
@@ -126,7 +149,8 @@
126
149
  item: item,
127
150
  name: item.field || item.prop,
128
151
  value: value,
129
- data: scope.row
152
+ data: scope.row,
153
+ scope: scope
130
154
  });
131
155
  }
132
156
  "
@@ -251,12 +275,22 @@
251
275
  v-model="scope.row[item.field]"
252
276
  @blur="
253
277
  event => {
254
- handleBlur({ item: item, event: event, data: scope.row });
278
+ handleBlur({
279
+ item: item,
280
+ event: event,
281
+ data: scope.row,
282
+ scope: scope
283
+ });
255
284
  }
256
285
  "
257
286
  @focus="
258
287
  event => {
259
- handleFocus({ item: item, event: event, data: scope.row });
288
+ handleFocus({
289
+ item: item,
290
+ event: event,
291
+ data: scope.row,
292
+ scope: scope
293
+ });
260
294
  }
261
295
  "
262
296
  @change="
@@ -265,7 +299,8 @@
265
299
  item: item,
266
300
  name: item.field || item.prop,
267
301
  value: value,
268
- data: scope.row
302
+ data: scope.row,
303
+ scope: scope
269
304
  });
270
305
  }
271
306
  "
@@ -276,12 +311,22 @@
276
311
  v-model="scope.row[item.field]"
277
312
  @blur="
278
313
  event => {
279
- handleBlur({ item: item, event: event, data: scope.row });
314
+ handleBlur({
315
+ item: item,
316
+ event: event,
317
+ data: scope.row,
318
+ scope: scope
319
+ });
280
320
  }
281
321
  "
282
322
  @focus="
283
323
  event => {
284
- handleFocus({ item: item, event: event, data: scope.row });
324
+ handleFocus({
325
+ item: item,
326
+ event: event,
327
+ data: scope.row,
328
+ scope: scope
329
+ });
285
330
  }
286
331
  "
287
332
  @change="
@@ -290,7 +335,8 @@
290
335
  item: item,
291
336
  name: item.field || item.prop,
292
337
  value: value,
293
- data: scope.row
338
+ data: scope.row,
339
+ scope: scope
294
340
  });
295
341
  }
296
342
  "
@@ -321,7 +367,12 @@
321
367
  v-model.lazy="scope.row[item.field]"
322
368
  @blur="
323
369
  event => {
324
- handleBlur({ item: item, event: event, data: scope.row });
370
+ handleBlur({
371
+ item: item,
372
+ event: event,
373
+ data: scope.row,
374
+ scope: scope
375
+ });
325
376
  }
326
377
  "
327
378
  @focus="
@@ -329,7 +380,8 @@
329
380
  handleFocus({
330
381
  item: item,
331
382
  event: event,
332
- data: scope.row
383
+ data: scope.row,
384
+ scope: scope
333
385
  });
334
386
  }
335
387
  "
@@ -339,7 +391,8 @@
339
391
  item: item,
340
392
  name: item.field || item.prop,
341
393
  value: value,
342
- data: scope.row
394
+ data: scope.row,
395
+ scope: scope
343
396
  });
344
397
  }
345
398
  "
@@ -351,7 +404,12 @@
351
404
  v-model.lazy="scope.row[item.field]"
352
405
  @blur="
353
406
  event => {
354
- handleBlur({ item: item, event: event, data: scope.row });
407
+ handleBlur({
408
+ item: item,
409
+ event: event,
410
+ data: scope.row,
411
+ scope: scope
412
+ });
355
413
  }
356
414
  "
357
415
  @focus="
@@ -359,7 +417,8 @@
359
417
  handleFocus({
360
418
  item: item,
361
419
  event: event,
362
- data: scope.row
420
+ data: scope.row,
421
+ scope: scope
363
422
  });
364
423
  }
365
424
  "
@@ -369,7 +428,8 @@
369
428
  item: item,
370
429
  name: item.field || item.prop,
371
430
  value: value,
372
- data: scope.row
431
+ data: scope.row,
432
+ scope: scope
373
433
  });
374
434
  }
375
435
  "
@@ -381,12 +441,22 @@
381
441
  v-model="scope.row[item.field]"
382
442
  @blur="
383
443
  event => {
384
- handleBlur({ item: item, event: event, data: scope.row });
444
+ handleBlur({
445
+ item: item,
446
+ event: event,
447
+ data: scope.row,
448
+ scope: scope
449
+ });
385
450
  }
386
451
  "
387
452
  @focus="
388
453
  event => {
389
- handleFocus({ item: item, event: event, data: scope.row });
454
+ handleFocus({
455
+ item: item,
456
+ event: event,
457
+ data: scope.row,
458
+ scope: scope
459
+ });
390
460
  }
391
461
  "
392
462
  @change="
@@ -395,7 +465,8 @@
395
465
  item: item,
396
466
  name: item.field || item.prop,
397
467
  value: value,
398
- data: scope.row
468
+ data: scope.row,
469
+ scope: scope
399
470
  });
400
471
  }
401
472
  "
@@ -420,6 +491,8 @@
420
491
  :key="index"
421
492
  :filter-icon="filterIcon"
422
493
  :label="item.title || item.label"
494
+ :label-key="item.labelKey"
495
+ :value-key="item.valueKey"
423
496
  :prop="item.field || item.prop"
424
497
  :fixed="item.fixed"
425
498
  :sortable="item.sortable || item.sort"
@@ -657,8 +730,7 @@ export default {
657
730
  rows[field]['label'] ||
658
731
  rows[field]['shortName']
659
732
  );
660
- }
661
- if (Array.isArray(rows[field])) {
733
+ } else if (Array.isArray(rows[field])) {
662
734
  const vals = rows[field].map(item => {
663
735
  if (util.isObject(item)) {
664
736
  return (
@@ -675,12 +747,22 @@ export default {
675
747
  }
676
748
  });
677
749
  return vals.join(col.symbol ? col.symbol : '-');
750
+ } else {
751
+ if (col.valueToString || col['value-to-string']) {
752
+ const vals = rows[field].split(',').map(item => {
753
+ if (data && data.length && util.isObject(data[0])) {
754
+ return this.getLabel(data, item, col);
755
+ }
756
+ return item;
757
+ });
758
+ return vals.join(col.symbol ? col.symbol : '-');
759
+ } else {
760
+ if (data && data.length && util.isObject(data[0])) {
761
+ return this.getLabel(data, rows[field], col);
762
+ }
763
+ return rows[field];
764
+ }
678
765
  }
679
-
680
- if (data && data.length && util.isObject(data[0])) {
681
- return this.getLabel(data, rows[field], col);
682
- }
683
- return rows[field];
684
766
  },
685
767
  getLabel(obj, val, col) {
686
768
  for (let i = 0; i < obj.length; i++) {
@@ -1064,7 +1064,8 @@ export default {
1064
1064
  util.exportXls({
1065
1065
  thead: thead,
1066
1066
  data: this.datas,
1067
- name: this.fileName
1067
+ name: this.fileName,
1068
+ option: this.optionDatas
1068
1069
  });
1069
1070
  }
1070
1071
  this.$emit('btnClick', res, this.datas, thead, rows);
@@ -37,7 +37,7 @@
37
37
  ref="tableSelect"
38
38
  :style="style"
39
39
  :data="options[item.field || item.prop]"
40
- @hideMenu="selectShow = false"
40
+ @hide-menu="selectShow = false"
41
41
  @change="
42
42
  value => {
43
43
  handleChange('date', value);
@@ -3322,10 +3322,7 @@ export default {
3322
3322
  },
3323
3323
  props: {
3324
3324
  model: {
3325
- type: [Object, String],
3326
- default: () => {
3327
- return {};
3328
- }
3325
+ type: [Object, String]
3329
3326
  },
3330
3327
  steps: Object,
3331
3328
  param: {
@@ -3476,6 +3473,19 @@ export default {
3476
3473
  models: {
3477
3474
  get() {
3478
3475
  if (this.model && typeof this.model !== 'string') {
3476
+ if (this.autoId && !this.businessId) {
3477
+ if (
3478
+ this.model[typeof this.autoId === 'string' ? this.autoId : 'id']
3479
+ ) {
3480
+ this.$emit(
3481
+ 'update:businessId',
3482
+ this.model[typeof this.autoId === 'string' ? this.autoId : 'id']
3483
+ );
3484
+ } else {
3485
+ this.$emit('update:businessId', this.uuid);
3486
+ this.$emit('getId', this.uuid);
3487
+ }
3488
+ }
3479
3489
  return this.model;
3480
3490
  }
3481
3491
  return this.values;
@@ -3487,14 +3497,14 @@ export default {
3487
3497
  _value() {
3488
3498
  let data = {};
3489
3499
  if (this.businessId !== undefined) {
3490
- data = { id: this.businessId };
3500
+ data[
3501
+ typeof this.autoId === 'string' ? this.autoId : 'id'
3502
+ ] = this.businessId;
3491
3503
  } else if (typeof this.model !== 'string' && this.autoId) {
3492
3504
  if (typeof this.autoId === 'boolean' && !this.model.id) {
3493
3505
  data = { id: this.uuid };
3494
- this.$emit('update:businessId', this.uuid);
3495
3506
  } else if (!this.model[this.autoId]) {
3496
3507
  data[this.autoId] = this.uuid;
3497
- this.$emit('update:businessId', this.uuid);
3498
3508
  }
3499
3509
  }
3500
3510
  return util.extend({}, data, this.value);
@@ -507,7 +507,7 @@ export default {
507
507
  if (this.redirect_uri) {
508
508
  return this.redirect_uri;
509
509
  } else {
510
- return util.win.top.location.href || window.href;
510
+ return window.location.href || window.href;
511
511
  }
512
512
  },
513
513
  loginBackgroundUrl() {
@@ -550,6 +550,7 @@ export default {
550
550
  return types.length > 2
551
551
  ? {
552
552
  '0': { type: '0', icon: 'es-icon-shuru', name: '账号登录' },
553
+ '1': { type: '1', icon: 'es-icon-usb-key', name: '证书登录' },
553
554
  '3': { type: '3', icon: 'es-icon-saoma', name: '扫码登录' },
554
555
  '6': { type: '6', icon: 'es-icon-duanxin', name: '短信登录' },
555
556
  '7': { type: '7', icon: 'es-icon-dingding', name: '钉钉扫码登录' },
@@ -558,6 +559,7 @@ export default {
558
559
  }
559
560
  : {
560
561
  '0': { type: '0', icon: 'es-icon-jianpan', name: '账号登录' },
562
+ '1': { type: '1', icon: 'es-icon-ca', name: '证书登录' },
561
563
  '3': { type: '3', icon: 'es-icon-qrcode', name: '扫码登录' },
562
564
  '6': { type: '6', icon: 'es-icon-duanxin', name: '短信登录' },
563
565
  '7': { type: '7', icon: 'es-icon-dingding', name: '钉钉扫码登录' },
@@ -1009,15 +1011,19 @@ export default {
1009
1011
  }
1010
1012
  },
1011
1013
  handleUserLogin(data) {
1014
+ let extUserBindHandleId = sessionStorage.getItem('extUserBindHandleId');
1012
1015
  util
1013
1016
  .ajax({
1014
1017
  method: 'post',
1015
1018
  url: this.active == '0' ? this.actionUrl : this.doCodeLogin,
1016
- data: data
1019
+ data: extUserBindHandleId
1020
+ ? { ...data, extUserBindHandleId: extUserBindHandleId }
1021
+ : data
1017
1022
  })
1018
1023
  .then(res => {
1019
1024
  this.submit = false;
1020
1025
  if (res.rCode == 0) {
1026
+ sessionStorage.removeItem('extUserBindHandleId');
1021
1027
  this.handleRemember();
1022
1028
  const results = res.results;
1023
1029
  this.handleResults(results);
@@ -1108,12 +1114,12 @@ export default {
1108
1114
  duration: 1500,
1109
1115
  onClose: () => {
1110
1116
  if (this.toUrl) {
1111
- util.win.location.href = this.toUrl;
1117
+ window.location.href = this.toUrl;
1112
1118
  } else if (results.doorIndex && this.doorIndex) {
1113
- util.win.location.href = results.doorIndex;
1119
+ window.location.href = results.doorIndex;
1114
1120
  } else {
1115
- if (util.win.top.location.href.indexOf('login.html') > -1) {
1116
- util.win.top.location.href = './main.html';
1121
+ if (window.location.href.indexOf('login.html') > -1) {
1122
+ window.location.href = './main.html';
1117
1123
  } else {
1118
1124
  this.$router.push({ name: 'main' });
1119
1125
  }
@@ -1145,25 +1151,46 @@ export default {
1145
1151
  let url =
1146
1152
  results.doorIndex && this.doorIndex
1147
1153
  ? results.doorIndex
1148
- : util.win.top.location.href.indexOf('main.html') > -1
1154
+ : window.location.href.indexOf('main.html') > -1
1149
1155
  ? './login.html'
1150
- : util.win.location.hash
1151
- ? util.win.location.href.replace('login', 'main')
1152
- : util.win.location.href;
1156
+ : window.location.hash
1157
+ ? window.location.href.replace('login', 'main')
1158
+ : window.location.href;
1153
1159
  const href = results.authorizeUrl.replace(
1154
1160
  '{redirectUri}',
1155
1161
  encodeURIComponent(url)
1156
1162
  );
1157
- util.win.top.location.href = href;
1158
- // util.win.location.href =
1163
+ window.location.href = href;
1164
+ // window.location.href =
1159
1165
  // results.authorizeUrl.indexOf('?') > -1
1160
1166
  // ? results.authorizeUrl + '&token=' + results.token
1161
1167
  // : results.authorizeUrl + '?token=' + results.token;
1162
1168
  break;
1169
+ case 4:
1170
+ this.$alert(
1171
+ results.msg ? results.msg : '账号未绑定,账号密码登录后自动绑定!',
1172
+ '提示',
1173
+ {
1174
+ confirmButtonText: '确定',
1175
+ type: 'error'
1176
+ }
1177
+ )
1178
+ .then(() => {
1179
+ sessionStorage.setItem(
1180
+ 'extUserBindHandleId',
1181
+ results.extUserBindHandleId
1182
+ );
1183
+ window.location.href = util.delUrlParam({ key: 'code' });
1184
+ if (window.location.hash) {
1185
+ location.reload();
1186
+ }
1187
+ })
1188
+ .catch(e => {});
1189
+ break;
1163
1190
  default:
1164
1191
  if (type !== 3) {
1165
1192
  this.$message({
1166
- message: results.msg || res.msg,
1193
+ message: results.msg,
1167
1194
  type: 'error',
1168
1195
  duration: 1500,
1169
1196
  onClose: () => {
@@ -1,6 +1,6 @@
1
- import EsRadio from './src/main';
1
+ import EsRadioGroup from './src/main';
2
2
 
3
3
  /* istanbul ignore next */
4
- EsRadio.install = function(Vue) {Vue.component(EsRadio.name, EsRadio);};
4
+ EsRadioGroup.install = function(Vue) {Vue.component(EsRadioGroup.name, EsRadioGroup);};
5
5
 
6
- export default EsRadio;
6
+ export default EsRadioGroup;
@@ -97,7 +97,10 @@ export default {
97
97
  },
98
98
  valueType: {
99
99
  type: String,
100
- default: 'string'
100
+ default: 'string',
101
+ validator: function(value) {
102
+ return ['string', 'object'].includes(value);
103
+ }
101
104
  },
102
105
  valueKey: {
103
106
  type: String,
@@ -33,7 +33,13 @@ export default {
33
33
  type: Boolean,
34
34
  default: false
35
35
  },
36
- valueType: String,
36
+ valueType: {
37
+ type: String,
38
+ default: 'string',
39
+ validator: function(value) {
40
+ return ['string', 'object'].includes(value);
41
+ }
42
+ },
37
43
  // 选择项的值字段
38
44
  valueKey: {
39
45
  type: String,
@@ -37,7 +37,10 @@ export default {
37
37
  },
38
38
  valueType: {
39
39
  type: String,
40
- default: 'object'
40
+ default: 'object',
41
+ validator: function(value) {
42
+ return ['string', 'object'].includes(value);
43
+ }
41
44
  },
42
45
  data: {
43
46
  type: Array,
@@ -248,7 +248,10 @@ export default {
248
248
  },
249
249
  valueType: {
250
250
  type: String,
251
- default: 'object'
251
+ default: 'object',
252
+ validator: function(value) {
253
+ return ['string', 'object'].includes(value);
254
+ }
252
255
  },
253
256
  size: String,
254
257
  id: String,
@@ -63,7 +63,10 @@ export default {
63
63
  },
64
64
  valueType: {
65
65
  type: String,
66
- default: 'object'
66
+ default: 'object',
67
+ validator: function(value) {
68
+ return ['string', 'object'].includes(value);
69
+ }
67
70
  },
68
71
  data: {
69
72
  type: Array,