eoss-ui 0.5.67 → 0.5.69

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 (70) hide show
  1. package/CHANGELOG.md +929 -0
  2. package/lib/button-group.js +172 -25
  3. package/lib/button.js +5 -1
  4. package/lib/calendar.js +8 -4
  5. package/lib/data-table.js +31 -22
  6. package/lib/eoss-ui.common.js +1070 -741
  7. package/lib/form.js +22 -7
  8. package/lib/icon.js +12 -3593
  9. package/lib/icons.js +1 -1
  10. package/lib/index.js +1 -1
  11. package/lib/login.js +123 -110
  12. package/lib/main.js +41 -9
  13. package/lib/menu.js +90 -55
  14. package/lib/nav.js +32 -5
  15. package/lib/player.js +2 -2
  16. package/lib/selector.js +469 -429
  17. package/lib/theme-chalk/base.css +1 -1
  18. package/lib/theme-chalk/button-group.css +1 -1
  19. package/lib/theme-chalk/fonts/iconfont.ttf +0 -0
  20. package/lib/theme-chalk/fonts/iconfont.woff +0 -0
  21. package/lib/theme-chalk/icon.css +1 -1
  22. package/lib/theme-chalk/index.css +1 -1
  23. package/lib/theme-chalk/login.css +1 -1
  24. package/lib/theme-chalk/main.css +1 -1
  25. package/lib/theme-chalk/menu.css +1 -1
  26. package/lib/theme-chalk/sizer.css +1 -1
  27. package/lib/theme-chalk/tree.css +1 -1
  28. package/lib/theme-chalk/upload.css +1 -1
  29. package/lib/toolbar.js +6 -0
  30. package/lib/upload.js +6 -6
  31. package/package.json +2 -2
  32. package/packages/button/src/main.vue +5 -1
  33. package/packages/button-group/src/main.vue +62 -7
  34. package/packages/calendar/src/main.vue +6 -2
  35. package/packages/data-table/src/column.vue +1 -1
  36. package/packages/data-table/src/main.vue +10 -5
  37. package/packages/form/src/main.vue +19 -5
  38. package/packages/icon/src/main.vue +10 -3
  39. package/packages/icons/src/icon.json +1 -1
  40. package/packages/login/src/main.vue +67 -66
  41. package/packages/main/src/main.vue +28 -6
  42. package/packages/menu/src/main.vue +75 -65
  43. package/packages/nav/src/main.vue +23 -4
  44. package/packages/selector/src/main.vue +31 -5
  45. package/packages/theme-chalk/lib/base.css +1 -1
  46. package/packages/theme-chalk/lib/button-group.css +1 -1
  47. package/packages/theme-chalk/lib/fonts/iconfont.ttf +0 -0
  48. package/packages/theme-chalk/lib/fonts/iconfont.woff +0 -0
  49. package/packages/theme-chalk/lib/icon.css +1 -1
  50. package/packages/theme-chalk/lib/index.css +1 -1
  51. package/packages/theme-chalk/lib/login.css +1 -1
  52. package/packages/theme-chalk/lib/main.css +1 -1
  53. package/packages/theme-chalk/lib/menu.css +1 -1
  54. package/packages/theme-chalk/lib/sizer.css +1 -1
  55. package/packages/theme-chalk/lib/tree.css +1 -1
  56. package/packages/theme-chalk/lib/upload.css +1 -1
  57. package/packages/theme-chalk/package.json +35 -0
  58. package/packages/theme-chalk/src/button-group.scss +39 -0
  59. package/packages/theme-chalk/src/common/var.scss +2 -0
  60. package/packages/theme-chalk/src/fonts/iconfont.ttf +0 -0
  61. package/packages/theme-chalk/src/fonts/iconfont.woff +0 -0
  62. package/packages/theme-chalk/src/icon.scss +430 -426
  63. package/packages/theme-chalk/src/login.scss +2 -3
  64. package/packages/theme-chalk/src/main.scss +14 -5
  65. package/packages/theme-chalk/src/menu.scss +1 -1
  66. package/packages/theme-chalk/src/nav.scss +2 -2
  67. package/packages/theme-chalk/src/tree.scss +1 -0
  68. package/packages/toolbar/src/main.vue +6 -0
  69. package/packages/upload/src/main.vue +1 -1
  70. package/src/index.js +1 -1
@@ -23,6 +23,8 @@
23
23
  class="es-fourth-tabs"
24
24
  mode="horizontal"
25
25
  :icons="icons"
26
+ :menu-icon="menuIcon"
27
+ :sub-icon="subIcon"
26
28
  :popperClass="`el-menu--popup-${layout}`"
27
29
  :data="navs"
28
30
  :deep="layout === 'topnav'"
@@ -82,6 +84,7 @@
82
84
  </div>
83
85
  <es-handle-user
84
86
  :data="{ type: 'user' }"
87
+ :userModel="userModel"
85
88
  @click="handleClick"
86
89
  ></es-handle-user>
87
90
  </div>
@@ -115,13 +118,17 @@
115
118
  :is-top="layout == 'topside'"
116
119
  :data="menu"
117
120
  :default-active="active"
118
- :width="navWidth"
121
+ :width="navsWidth"
122
+ :nav-width="navWidth"
119
123
  :icons="icons"
124
+ :menu-icon="menuIcon"
125
+ :sub-icon="subIcon"
120
126
  :biserial="biserial"
121
127
  :title="showNavTitle ? title : false"
122
128
  :showCollapse="showNavTitle"
123
129
  :menu-tips="menuTips"
124
130
  :is-default="isDefault"
131
+ :paddingLeft="navPaddingLeft"
125
132
  @open="
126
133
  (res) => {
127
134
  handleSelect(res, 'menu', true);
@@ -147,6 +154,7 @@
147
154
  :data="tabs"
148
155
  :titleIcons="false"
149
156
  :default-active="tabsId"
157
+ :menu-icon="menuIcon"
150
158
  :menu-tips="menuTips"
151
159
  @select="
152
160
  (res) => {
@@ -288,8 +296,15 @@ export default {
288
296
  maxHeight: String,
289
297
  //菜单导航地址
290
298
  menuUrl: String,
291
- //菜单展开关闭
299
+ //菜单展开关闭图标
292
300
  icons: Object,
301
+ //菜单前置默认图标
302
+ menuIcon: String,
303
+ //子菜单是否显示前置图标
304
+ subIcon: {
305
+ type: Boolean,
306
+ default: true
307
+ },
293
308
  //logo
294
309
  logo: String,
295
310
  //菜单显示类型
@@ -413,7 +428,10 @@ export default {
413
428
  type: [Boolean, String],
414
429
  default: true
415
430
  },
416
- appCode: String
431
+ appCode: String,
432
+ //菜单左边距
433
+ navPaddingLeft: Number,
434
+ navWidth: String
417
435
  },
418
436
  computed: {
419
437
  showHeader() {
@@ -444,7 +462,7 @@ export default {
444
462
  }
445
463
  return true;
446
464
  },
447
- navWidth() {
465
+ navsWidth() {
448
466
  return this.layout === 'topside' ? '230px' : undefined;
449
467
  },
450
468
  showNavTitle() {
@@ -1852,8 +1870,12 @@ export default {
1852
1870
  }
1853
1871
  }
1854
1872
  } else {
1855
- console.error('缺少路由配置');
1856
- return;
1873
+ this.method = 'iframe';
1874
+ this.refresh = false;
1875
+ this.page = util.handlerUrl(page, param);
1876
+ this.$nextTick(() => {
1877
+ this.refresh = true;
1878
+ });
1857
1879
  }
1858
1880
  }
1859
1881
  }
@@ -1,4 +1,5 @@
1
1
  <script>
2
+ import { debounce } from 'throttle-debounce';
2
3
  export default {
3
4
  name: 'EsMenu',
4
5
  inheritAttrs: false,
@@ -38,6 +39,15 @@ export default {
38
39
  paddingLeft: {
39
40
  type: Number,
40
41
  default: 14
42
+ },
43
+ menuIcon: {
44
+ type: String,
45
+ default: 'es-icon-application'
46
+ },
47
+ icons: Object,
48
+ subIcon: {
49
+ type: Boolean,
50
+ default: true
41
51
  }
42
52
  },
43
53
  computed: {
@@ -45,37 +55,18 @@ export default {
45
55
  return this.height === undefined ? this.maxH : this.height;
46
56
  },
47
57
  maxWidth() {
48
- if (this.mode === 'vertical') {
49
- return this.width;
50
- }
51
58
  return this.maxW;
52
59
  }
53
60
  },
54
61
  watch: {
55
62
  data: {
56
- immediate: true,
57
63
  deep: true,
58
64
  handler() {
59
- if (this.mode === 'vertical') {
60
- this.$nextTick(() => {
61
- this.maxH =
62
- this.$refs.esMenu.$el.getBoundingClientRect().height + 'px';
63
- });
64
- } else {
65
- this.$nextTick(() => {
66
- let w = 0;
67
- Array.from(this.$refs.menu.$el.children).forEach((item) => {
68
- w += item.getBoundingClientRect().width;
69
- });
70
- const styles = window.getComputedStyle(this.$refs.menu.$el);
71
- w +=
72
- parseFloat(styles.paddingLeft) + parseFloat(styles.paddingRight);
73
- if (w > this.$refs.esMenu.$el.getBoundingClientRect().width) {
74
- this.maxW = w + 'px';
75
- }
76
- });
77
- }
65
+ this.getMaxWidth();
78
66
  }
67
+ },
68
+ width() {
69
+ this.getMaxWidth();
79
70
  }
80
71
  },
81
72
  data() {
@@ -87,8 +78,44 @@ export default {
87
78
  isChange: false
88
79
  };
89
80
  },
90
- mounted() {},
81
+ created() {
82
+ this.getMaxWidth = debounce(300, () => {
83
+ this.getWidth();
84
+ });
85
+ },
86
+ mounted() {
87
+ this.getMaxWidth();
88
+ },
91
89
  methods: {
90
+ getWidth() {
91
+ if (this.mode === 'vertical') {
92
+ this.$nextTick(() => {
93
+ this.maxH =
94
+ this.$refs.esMenu.$el.getBoundingClientRect().height + 'px';
95
+ const styles = window.getComputedStyle(
96
+ this.$refs.menu.$el.parentNode
97
+ );
98
+ this.maxW = this.width
99
+ ? parseInt(this.width, 10) -
100
+ parseInt(styles.marginLeft, 10) -
101
+ parseInt(styles.marginRight, 10) +
102
+ 'px'
103
+ : '';
104
+ });
105
+ } else {
106
+ this.$nextTick(() => {
107
+ let w = 0;
108
+ Array.from(this.$refs.menu.$el.children).forEach((item) => {
109
+ w += item.getBoundingClientRect().width;
110
+ });
111
+ const styles = window.getComputedStyle(this.$refs.menu.$el);
112
+ w += parseFloat(styles.paddingLeft) + parseFloat(styles.paddingRight);
113
+ if (w > this.$refs.esMenu.$el.getBoundingClientRect().width) {
114
+ this.maxW = w + 'px';
115
+ }
116
+ });
117
+ }
118
+ },
92
119
  handleReady() {
93
120
  if (this.mode === 'horizontal') {
94
121
  this.$refs.esMenu.wrap.onmouseover = (e) => {
@@ -221,7 +248,7 @@ export default {
221
248
  mode: this.mode
222
249
  });
223
250
  },
224
- getSub(item, h, popper, fourthTabs) {
251
+ getSub(item, h, popper, fourthTabs, subIcon) {
225
252
  if (popper) {
226
253
  popper +=
227
254
  this.popperClass !== undefined
@@ -233,21 +260,18 @@ export default {
233
260
  ? this.popperClass
234
261
  : ` es-menu-popper-${this.mode}`;
235
262
  }
236
- const title = [
237
- h('i', {
238
- class: [
239
- item.icons
240
- ? this.unicode(item.icons)
241
- ? item.icons
242
- : 'es-icon iconfont'
243
- : 'es-icon-application',
244
- 'es-menu-item-icon'
245
- ],
246
- domProps:
247
- item.icons === '' || this.unicode(item.icons)
248
- ? {}
249
- : { innerHTML: item.icons }
250
- }),
263
+ let title = [];
264
+ if (subIcon) {
265
+ title.push(
266
+ h('es-icon', {
267
+ props: {
268
+ contents: item.icons || this.menuIcon
269
+ },
270
+ class: ['es-menu-item-icon']
271
+ })
272
+ );
273
+ }
274
+ title.push(
251
275
  h(
252
276
  'div',
253
277
  {
@@ -284,7 +308,7 @@ export default {
284
308
  )
285
309
  ]
286
310
  )
287
- ];
311
+ );
288
312
  let doms = [
289
313
  h('template', { slot: 'title' }, this.titleIcons ? title : [title[1]])
290
314
  ];
@@ -299,7 +323,7 @@ export default {
299
323
  if (!ele) {
300
324
  console.error(`对象子数据中第[${index}]条数据错误`, item);
301
325
  } else {
302
- return this.getSub(ele, h, popper);
326
+ return this.getSub(ele, h, popper, false, this.subIcon);
303
327
  }
304
328
  })
305
329
  );
@@ -337,7 +361,7 @@ export default {
337
361
  if (!ele) {
338
362
  console.error(`对象子数据中第[${index}]条数据错误`, item);
339
363
  } else {
340
- return this.getSub(ele, h, popper, true);
364
+ return this.getSub(ele, h, popper, true, this.subIcon);
341
365
  }
342
366
  })
343
367
  );
@@ -386,13 +410,6 @@ export default {
386
410
  )
387
411
  ];
388
412
  }
389
- },
390
- unicode(res) {
391
- if (!res) {
392
- return false;
393
- }
394
- var reg = new RegExp(/^es-\S+/, 'g');
395
- return res.match(reg) ? res.match(reg).length : 0;
396
413
  }
397
414
  },
398
415
  render(h) {
@@ -403,22 +420,14 @@ export default {
403
420
  item.children.length &&
404
421
  (!item.extendData || item.extendData.businessStatus != 0)
405
422
  ) {
406
- doms = doms.concat(this.getSub(item, h, 'es-sub-menu'));
423
+ doms = doms.concat(this.getSub(item, h, 'es-sub-menu', false, true));
407
424
  } else {
408
425
  const title = [
409
- h('i', {
410
- class: [
411
- item.icons
412
- ? this.unicode(item.icons)
413
- ? item.icons
414
- : 'es-icon iconfont'
415
- : 'es-icon-application',
416
- 'es-menu-item-icon'
417
- ],
418
- domProps:
419
- item.icons === '' || this.unicode(item.icons)
420
- ? {}
421
- : { innerHTML: item.icons }
426
+ h('es-icon', {
427
+ props: {
428
+ contents: item.icons || this.menuIcon
429
+ },
430
+ class: ['es-menu-item-icon']
422
431
  }),
423
432
  h(
424
433
  'div',
@@ -501,7 +510,8 @@ export default {
501
510
  defaultActive: this.defaultActive,
502
511
  collapse: this.collapse,
503
512
  mode: this.mode,
504
- uniqueOpened: this.uniqueOpened
513
+ uniqueOpened: this.uniqueOpened,
514
+ icons: this.icons
505
515
  },
506
516
  style: { width: this.maxWidth },
507
517
  attrs: { ...this.$attrs },
@@ -14,11 +14,15 @@
14
14
  :deep="false"
15
15
  :default-active="subActive"
16
16
  :biserial="biserial"
17
+ :menu-icons="menuIcon"
18
+ :icons="icons"
19
+ :sub-icon="subIcon"
17
20
  @select="handleTrigger"
18
21
  ></es-menu>
19
22
  </div>
20
23
  <div
21
24
  class="es-nav-main"
25
+ :biserial="biserial"
22
26
  :style="{ width: biserial ? width : boxWidth }"
23
27
  v-show="biserial ? subMenu.length : menu.length"
24
28
  >
@@ -47,6 +51,10 @@
47
51
  :style="{ height: menuHeight }"
48
52
  :is-default="isDefault"
49
53
  :biserial="biserial"
54
+ :paddingLeft="paddingLeft"
55
+ :menu-icon="menuIcon"
56
+ :icons="icons"
57
+ :sub-icon="subIcon"
50
58
  @select="handleSelect"
51
59
  @open="handleOpen"
52
60
  @close="handleClose"
@@ -73,6 +81,10 @@ export default {
73
81
  type: String,
74
82
  default: '200px'
75
83
  },
84
+ navWidth: {
85
+ type: String,
86
+ default: '70px'
87
+ },
76
88
  showCollapse: {
77
89
  type: Boolean,
78
90
  default: true
@@ -84,7 +96,14 @@ export default {
84
96
  //是否双列导航
85
97
  biserial: Boolean,
86
98
  defaultActive: [String, Array],
87
- isDefault: Boolean
99
+ isDefault: Boolean,
100
+ paddingLeft: Number,
101
+ menuIcon: String,
102
+ icons: Object,
103
+ subIcon: {
104
+ type: Boolean,
105
+ default: true
106
+ }
88
107
  },
89
108
  computed: {
90
109
  menu() {
@@ -119,12 +138,12 @@ export default {
119
138
  if (this.isShow) {
120
139
  return this.width;
121
140
  } else {
122
- return '70px';
141
+ return this.navWidth;
123
142
  }
124
143
  }
125
144
  return this.subMenu && this.subMenu.length && this.isShow
126
- ? parseInt(this.width, 10) + 70 + 'px'
127
- : '70px';
145
+ ? parseInt(this.width, 10) + parseInt(this.navWidth, 10) + 'px'
146
+ : this.navWidth;
128
147
  }
129
148
  },
130
149
  watch: {
@@ -1,11 +1,12 @@
1
1
  <template>
2
2
  <div
3
+ v-if="isRender"
3
4
  class="es-selector"
4
5
  ref="esSelector"
5
6
  :class="{ 'es-pointer': !readonly && !filterable }"
6
7
  v-clickoutside="handleClose"
7
8
  >
8
- <el-button v-if="button" v-bind="button" @click.stop="openDialog"
9
+ <el-button v-if="button" v-bind="button" @click="openDialog"
9
10
  ><slot>选择</slot></el-button
10
11
  >
11
12
  <template v-else>
@@ -105,7 +106,6 @@
105
106
  readonly
106
107
  :name="name"
107
108
  type="text"
108
- wqwq
109
109
  v-show="false"
110
110
  ></el-input>
111
111
  </template>
@@ -188,6 +188,7 @@
188
188
  class="es-selector-dialog"
189
189
  >
190
190
  <es-selector-panel
191
+ v-if="isReset"
191
192
  v-model="selected"
192
193
  v-bind="$attrs"
193
194
  :multiple="multiple"
@@ -329,6 +330,13 @@ export default {
329
330
  emptySerach: {
330
331
  type: Boolean,
331
332
  default: false
333
+ },
334
+ reset: Boolean,
335
+ useCaseCode: String,
336
+ businessData: [String, Array, Object],
337
+ inputHeight: {
338
+ type: Number,
339
+ default: 40
332
340
  }
333
341
  },
334
342
  data() {
@@ -348,6 +356,16 @@ export default {
348
356
  };
349
357
  },
350
358
  computed: {
359
+ isRender() {
360
+ let useCaseCodes = util.getStorage('useCaseCodes');
361
+ if (useCaseCodes && this.useCaseCode) {
362
+ return useCaseCodes.indexOf(this.useCaseCode) > -1;
363
+ }
364
+ return true;
365
+ },
366
+ isReset() {
367
+ return this.reset ? this.visible : true;
368
+ },
351
369
  _elFormItemSize() {
352
370
  return (this.elFormItem || {}).elFormItemSize;
353
371
  },
@@ -413,7 +431,11 @@ export default {
413
431
  selected: {
414
432
  deep: true,
415
433
  handler(val) {
416
- this.$emit('change', Array.isArray(val) ? val : [val]);
434
+ this.$emit(
435
+ 'change',
436
+ Array.isArray(val) ? val : [val],
437
+ this.businessData
438
+ );
417
439
  if (this.multiple) {
418
440
  this.resetInputHeight();
419
441
  }
@@ -551,10 +573,11 @@ export default {
551
573
  this.visible = false;
552
574
  if (util.isObject(res)) {
553
575
  this.$emit('input', [res]);
576
+ this.$emit('confirm', [res], this.businessData);
554
577
  } else {
555
578
  this.$emit('input', res);
579
+ this.$emit('confirm', res, this.businessData);
556
580
  }
557
- this.$emit('confirm', res);
558
581
  let inputChildNodes = this.$refs.reference
559
582
  ? this.$refs.reference.$el.childNodes
560
583
  : null;
@@ -565,6 +588,9 @@ export default {
565
588
  input.focus();
566
589
  input.blur();
567
590
  }
591
+ if (this.reset) {
592
+ this.selected = [];
593
+ }
568
594
  },
569
595
  handleClear() {
570
596
  this.$emit('input', []);
@@ -584,7 +610,7 @@ export default {
584
610
  if (this.collapseTags) return;
585
611
  this.$nextTick(() => {
586
612
  if (!this.$refs.reference) return;
587
- const sizeInMap = this.initialInputHeight || 40;
613
+ const sizeInMap = this.inputHeight;
588
614
  let height = '';
589
615
  if (this.selected !== undefined && this.selected.length === 0) {
590
616
  height = sizeInMap + 'px';