eoss-ui 0.5.73 → 0.5.75

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 (75) hide show
  1. package/lib/button-group.js +115 -29
  2. package/lib/button.js +115 -29
  3. package/lib/checkbox-group.js +115 -29
  4. package/lib/clients.js +16 -7
  5. package/lib/data-table-form.js +115 -29
  6. package/lib/data-table.js +130 -35
  7. package/lib/date-picker.js +115 -29
  8. package/lib/dialog.js +115 -29
  9. package/lib/eoss-ui.common.js +345 -133
  10. package/lib/flow-group.js +115 -29
  11. package/lib/flow-list.js +115 -29
  12. package/lib/flow.js +115 -29
  13. package/lib/form.js +115 -29
  14. package/lib/handle-user.js +115 -29
  15. package/lib/handler.js +115 -29
  16. package/lib/index.js +1 -1
  17. package/lib/input-number.js +114 -28
  18. package/lib/input.js +131 -35
  19. package/lib/login.js +147 -40
  20. package/lib/main.js +197 -51
  21. package/lib/nav.js +163 -52
  22. package/lib/page.js +115 -29
  23. package/lib/player.js +115 -29
  24. package/lib/qr-code.js +115 -29
  25. package/lib/radio-group.js +115 -29
  26. package/lib/retrial-auth.js +115 -29
  27. package/lib/select-ganged.js +115 -29
  28. package/lib/select.js +130 -34
  29. package/lib/selector-panel.js +115 -29
  30. package/lib/selector.js +115 -29
  31. package/lib/sizer.js +115 -29
  32. package/lib/steps.js +115 -29
  33. package/lib/switch.js +114 -28
  34. package/lib/table-form.js +115 -29
  35. package/lib/tabs.js +115 -29
  36. package/lib/theme-chalk/base.css +1 -1
  37. package/lib/theme-chalk/index.css +1 -1
  38. package/lib/theme-chalk/login.css +1 -1
  39. package/lib/theme-chalk/main.css +1 -1
  40. package/lib/theme-chalk/menu.css +1 -1
  41. package/lib/theme-chalk/nav.css +1 -1
  42. package/lib/theme-chalk/sizer.css +1 -1
  43. package/lib/theme-chalk/upload.css +1 -1
  44. package/lib/tips.js +115 -29
  45. package/lib/tree-group.js +115 -29
  46. package/lib/tree.js +115 -29
  47. package/lib/upload.js +115 -29
  48. package/lib/utils/util.js +98 -22
  49. package/lib/utils/webSocket.js +16 -6
  50. package/lib/wujie.js +115 -29
  51. package/lib/wxlogin.js +114 -28
  52. package/package.json +2 -2
  53. package/packages/clients/src/main.vue +3 -1
  54. package/packages/data-table/src/main.vue +10 -1
  55. package/packages/input/src/main.vue +7 -6
  56. package/packages/login/src/main.vue +13 -0
  57. package/packages/login/src/resetPassword.vue +1 -1
  58. package/packages/main/src/main.vue +44 -10
  59. package/packages/nav/src/main.vue +25 -8
  60. package/packages/select/src/main.vue +6 -5
  61. package/packages/theme-chalk/lib/base.css +1 -1
  62. package/packages/theme-chalk/lib/index.css +1 -1
  63. package/packages/theme-chalk/lib/login.css +1 -1
  64. package/packages/theme-chalk/lib/main.css +1 -1
  65. package/packages/theme-chalk/lib/menu.css +1 -1
  66. package/packages/theme-chalk/lib/nav.css +1 -1
  67. package/packages/theme-chalk/lib/sizer.css +1 -1
  68. package/packages/theme-chalk/lib/upload.css +1 -1
  69. package/packages/theme-chalk/src/base.scss +3 -0
  70. package/packages/theme-chalk/src/login.scss +175 -171
  71. package/packages/theme-chalk/src/main.scss +5 -2
  72. package/packages/theme-chalk/src/nav.scss +4 -1
  73. package/src/index.js +1 -1
  74. package/src/utils/util.js +112 -23
  75. package/src/utils/webSocket.js +14 -7
package/lib/wxlogin.js CHANGED
@@ -621,6 +621,35 @@ var calculateNetworkDays = function calculateNetworkDays(start_date, end_date) {
621
621
  return workdays;
622
622
  };
623
623
 
624
+ /**
625
+ * chunkToChinese
626
+ * @desc 将四位数的整数转换为中文大写
627
+ * @param {number} chunk - 数字
628
+ **/
629
+ function chunkToChinese(chunk) {
630
+ var numberToChinese = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
631
+ var capitalDigits = ['', '拾', '佰', '仟'];
632
+
633
+ var result = '';
634
+ var digitIndex = 0;
635
+
636
+ while (chunk > 0) {
637
+ var digit = chunk % 10;
638
+ if (digit > 0) {
639
+ result = numberToChinese[digit] + capitalDigits[digitIndex] + result;
640
+ } else {
641
+ // 当前数字是零,需要判断是否需要添加零
642
+ if (result.charAt(0) !== '零') {
643
+ result = '零' + result;
644
+ }
645
+ }
646
+ chunk = Math.floor(chunk / 10);
647
+ digitIndex++;
648
+ }
649
+
650
+ return result;
651
+ }
652
+
624
653
  /**
625
654
  * concatenate
626
655
  * @desc 指定连接符合并文本
@@ -1816,6 +1845,31 @@ var getWeekday = function getWeekday(date) {
1816
1845
  return adjustedDay === 0 ? 7 : adjustedDay;
1817
1846
  };
1818
1847
 
1848
+ /**
1849
+ * getZoom
1850
+ * @desc 获取缩放比
1851
+ * @param {number} n - 可选参数,表示星期的起始日,0 表示星期天,1 表示星期一,以此类推,默认为 0
1852
+ **/
1853
+ var getZoom = function getZoom() {
1854
+ var ratio = 0;
1855
+ var screen = window.screen;
1856
+ var ua = navigator.userAgent.toLowerCase();
1857
+ if (window.devicePixelRatio !== undefined) {
1858
+ ratio = window.devicePixelRatio;
1859
+ } else if (~ua.indexOf('msie')) {
1860
+ if (screen.deviceXDPI && screen.logicalXDPI) {
1861
+ ratio = screen.deviceXDPI / screen.logicalXDPI;
1862
+ }
1863
+ } else if (window.outerWidth !== undefined && window.innerWidth !== undefined) {
1864
+ ratio = window.outerWidth / window.innerWidth;
1865
+ }
1866
+
1867
+ if (ratio) {
1868
+ ratio = Math.round(ratio * 100);
1869
+ }
1870
+
1871
+ return ratio / 100;
1872
+ };
1819
1873
  /**
1820
1874
  * handlerUrl
1821
1875
  * @desc:更新url参数中的时间戳
@@ -2558,32 +2612,53 @@ var rmbToCapital = function rmbToCapital(number) {
2558
2612
 
2559
2613
  return result;
2560
2614
  };
2615
+ /**
2616
+ * setScale
2617
+ * @desc 设置缩放
2618
+ * @param {number} width - 分辨率宽度
2619
+ * @param {number} height - 分辨率高度
2620
+ **/
2621
+ var setScale = function setScale() {
2622
+ var width = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1920;
2623
+ var height = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1080;
2561
2624
 
2562
- // 辅助函数,将四位数的整数转换为中文大写
2563
- function chunkToChinese(chunk) {
2564
- var numberToChinese = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
2565
- var capitalDigits = ['', '拾', '佰', '仟'];
2566
-
2567
- var result = '';
2568
- var digitIndex = 0;
2569
-
2570
- while (chunk > 0) {
2571
- var digit = chunk % 10;
2572
- if (digit > 0) {
2573
- result = numberToChinese[digit] + capitalDigits[digitIndex] + result;
2625
+ var n = 1;
2626
+ var isMac = /macintosh|mac os x/i.test(navigator.userAgent);
2627
+ var zoom = getZoom();
2628
+ if (isMac) {
2629
+ n = 2;
2630
+ } else {
2631
+ n = 1;
2632
+ }
2633
+ if (zoom === 1) {
2634
+ document.body.style.removeProperty('transform');
2635
+ document.body.style.removeProperty('width');
2636
+ document.body.style.removeProperty('height');
2637
+ document.body.style.removeProperty('transform-origin');
2638
+ return;
2639
+ }
2640
+ if (Math.abs(parseInt(width - window.innerWidth * zoom / n, 10)) > 15 && window.innerWidth * zoom / n !== width) {
2641
+ var scale = 'scale(' + window.innerWidth * zoom / width / zoom + ',' + window.innerHeight * zoom / height / zoom + ')';
2642
+ document.body.style.transform = scale;
2643
+ document.body.style.width = width + 'px';
2644
+ document.body.style.height = height + 'px';
2645
+ document.body.style.transformOrigin = '0 0';
2646
+ } else {
2647
+ if (isMac) {
2648
+ var _scale = 'scale(' + 1 * n / zoom + ')';
2649
+ document.body.style.transform = _scale;
2650
+ document.body.style.width = parseInt(window.innerWidth * zoom / n, 10) + 'px';
2651
+ document.body.style.height = parseInt(window.innerHeight * zoom / n, 10) + 'px';
2652
+ document.body.style.transformOrigin = '0 0';
2574
2653
  } else {
2575
- // 当前数字是零,需要判断是否需要添加零
2576
- if (result.charAt(0) !== '零') {
2577
- result = '零' + result;
2578
- }
2654
+ var _scale2 = 'scale(' + 1 * n / zoom + ')';
2655
+ document.body.style.transform = _scale2;
2656
+ document.body.style.width = parseInt(window.innerWidth * zoom / n, 10) + 'px';
2657
+ document.body.style.height = parseInt(window.innerHeight * zoom / n, 10) + 'px';
2658
+ document.body.style.transformOrigin = '0 0';
2579
2659
  }
2580
- chunk = Math.floor(chunk / 10);
2581
- digitIndex++;
2582
2660
  }
2583
-
2584
- return result;
2585
- }
2586
-
2661
+ };
2587
2662
  /**
2588
2663
  * sendMessage
2589
2664
  * @desc:向iframe发送信息
@@ -3119,6 +3194,7 @@ var watermark = function watermark(option) {
3119
3194
  rmbToCapital: rmbToCapital,
3120
3195
  sendMessage: sendMessage,
3121
3196
  setFavicon: setFavicon,
3197
+ setScale: setScale,
3122
3198
  setStorage: setStorage,
3123
3199
  socket: socket,
3124
3200
  startWith: startWith,
@@ -3658,6 +3734,8 @@ var WebSocket = function () {
3658
3734
  this.connects = 1;
3659
3735
  this.recon = false;
3660
3736
  this.sendTimeout = null;
3737
+ this.socket = null;
3738
+ this.subscription = null;
3661
3739
  }
3662
3740
 
3663
3741
  /** socket连接 */
@@ -3668,14 +3746,12 @@ var WebSocket = function () {
3668
3746
 
3669
3747
  if (!this.client) {
3670
3748
  // 连接SockJS
3671
- var socket = new sockjs_client__WEBPACK_IMPORTED_MODULE_0___default.a(this.host + this.url);
3672
- // 获取STOMP子协议的客户端对象
3673
- this.client = stompjs__WEBPACK_IMPORTED_MODULE_1___default.a.over(socket);
3749
+ this.socket = new sockjs_client__WEBPACK_IMPORTED_MODULE_0___default.a(this.host + this.url, { timeout: 60000 });
3750
+ this.client = stompjs__WEBPACK_IMPORTED_MODULE_1___default.a.over(this.socket);
3674
3751
  }
3675
3752
 
3676
3753
  // 日志不打印
3677
3754
  if (!this.debug) {
3678
- console.log(111);
3679
3755
  this.client.debug = function () {};
3680
3756
  }
3681
3757
 
@@ -3687,9 +3763,10 @@ var WebSocket = function () {
3687
3763
  // 订阅消息
3688
3764
  _this.subscribe();
3689
3765
  }, function (error) {
3766
+ _this.unsubscribe();
3767
+ _this.client = null;
3690
3768
  var diffSecond = parseInt((new Date() - _this.nextDate) / 1000, 10);
3691
3769
  if (_this.connects > 5 && diffSecond < _this.interval) {
3692
- _this.client.disconnect();
3693
3770
  _this.error && _this.error(error);
3694
3771
  } else {
3695
3772
  _this.reconTimeout = setTimeout(function () {
@@ -3698,6 +3775,14 @@ var WebSocket = function () {
3698
3775
  }, 5000);
3699
3776
  }
3700
3777
  });
3778
+ }; // 清除订阅
3779
+
3780
+
3781
+ WebSocket.prototype.unsubscribe = function unsubscribe() {
3782
+ if (this.subscription) {
3783
+ this.subscription.unsubscribe();
3784
+ this.subscription = null;
3785
+ }
3701
3786
  };
3702
3787
  /** 订阅服务端 */
3703
3788
 
@@ -3706,7 +3791,7 @@ var WebSocket = function () {
3706
3791
  var _this2 = this;
3707
3792
 
3708
3793
  // 订阅服务端提供的某个topic
3709
- this.client.subscribe(this.take, function (response) {
3794
+ this.subscription = this.client.subscribe(this.take, function (response) {
3710
3795
  if (response && (_this2.callback || _this2.success)) {
3711
3796
  var callback = _this2.callback || _this2.success;
3712
3797
  callback(JSON.parse(response.body));
@@ -3747,6 +3832,7 @@ var WebSocket = function () {
3747
3832
 
3748
3833
  WebSocket.prototype.destroy = function destroy() {
3749
3834
  // 断开连接,清除定时器
3835
+ this.unsubscribe();
3750
3836
  if (this.client) {
3751
3837
  this.client.disconnect();
3752
3838
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eoss-ui",
3
- "version": "0.5.73",
3
+ "version": "0.5.75",
4
4
  "description": "eoss内部业务组件",
5
5
  "main": "lib/eoss-ui.common.js",
6
6
  "files": [
@@ -97,7 +97,7 @@
97
97
  "cp-cli": "^1.0.2",
98
98
  "cross-env": "^3.1.3",
99
99
  "css-loader": "^2.1.0",
100
- "eoss-element": "^0.2.99",
100
+ "eoss-element": "^0.2.100",
101
101
  "es6-promise": "^4.0.5",
102
102
  "eslint": "4.18.2",
103
103
  "eslint-config-elemefe": "0.1.1",
@@ -2,7 +2,9 @@
2
2
  <div class="es-clients">
3
3
  <img v-if="logo" class="es-clients-logo" :src="logo" />
4
4
  <div class="es-clients-title">
5
- 请通过手机浏览器(iOS11版本以上的苹果手机使用照相功能)扫码下载安装
5
+ 请通过手机浏览器
6
+ <template v-if="ios"> (iOS11版本以上的苹果手机使用照相功能) </template>
7
+ 扫码下载安装
6
8
  </div>
7
9
  <ul class="es-clients-list">
8
10
  <li v-if="ios" class="es-clients-item">
@@ -476,6 +476,7 @@ export default {
476
476
  theads: {
477
477
  get() {
478
478
  let thead = [];
479
+ let addfilter = false;
479
480
  let types = this.theadData
480
481
  .filter((item) => {
481
482
  return (
@@ -488,6 +489,7 @@ export default {
488
489
  return item.type;
489
490
  });
490
491
  if (this.dragSort && !types.includes('sort')) {
492
+ addfilter = true;
491
493
  thead.push({
492
494
  type: 'sort',
493
495
  key: 'es-sort'
@@ -501,8 +503,12 @@ export default {
501
503
  fixed: 'left',
502
504
  selectable: this.selectable,
503
505
  reserveSelection: this.reserveSelection,
506
+ filterIcon: this.filter && !addfilter ? 'es-icon-biao' : undefined,
504
507
  key: 'es-checkbox'
505
508
  });
509
+ if (!addfilter) {
510
+ addfilter = true;
511
+ }
506
512
  }
507
513
  if (this.numbers && !types.includes('index')) {
508
514
  let index = 1;
@@ -521,9 +527,12 @@ export default {
521
527
  align: 'center',
522
528
  fixed: 'left',
523
529
  index: index,
524
- filterIcon: this.filter ? 'es-icon-biao' : undefined,
530
+ filterIcon: this.filter && !addfilter ? 'es-icon-biao' : undefined,
525
531
  key: 'es-index'
526
532
  });
533
+ if (!addfilter) {
534
+ addfilter = true;
535
+ }
527
536
  }
528
537
  if (this.theadData.length) {
529
538
  thead = [...thead, ...this.theadData];
@@ -264,26 +264,27 @@ export default {
264
264
  );
265
265
  }
266
266
  }
267
+ let { prefix, suffix, prepend, append, ...attrs } = this.$attrs;
267
268
  if (this.$slots.prefix) {
268
269
  doms.push(h('template', { slot: 'prefix' }, this.$slots.prefix));
269
- } else if (this.$attrs.prefix) {
270
+ } else if (prefix) {
270
271
  this.renderd(doms, h, 'prefix');
271
272
  cls.push('es-input-button-prefix');
272
273
  }
273
274
  if (this.$slots.suffix) {
274
275
  doms.push(h('template', { slot: 'suffix' }, this.$slots.suffix));
275
- } else if (this.$attrs.suffix) {
276
+ } else if (suffix) {
276
277
  this.renderd(doms, h, 'suffix');
277
278
  cls.push('es-input-button-suffix');
278
279
  }
279
280
  if (this.$slots.prepend) {
280
281
  doms.push(h('template', { slot: 'prepend' }, this.$slots.prepend));
281
- } else if (this.$attrs.prepend) {
282
+ } else if (prepend) {
282
283
  this.renderd(doms, h, 'prepend');
283
284
  }
284
285
  if (this.$slots.append) {
285
286
  doms.push(h('template', { slot: 'append' }, this.$slots.append));
286
- } else if (this.$attrs.append) {
287
+ } else if (append) {
287
288
  this.renderd(doms, h, 'append');
288
289
  }
289
290
  if (this.fetchSuggestions || this.url || this.data.length > 0) {
@@ -295,7 +296,7 @@ export default {
295
296
  rules: this.rule
296
297
  },
297
298
  attrs: {
298
- ...this.$attrs,
299
+ ...attrs,
299
300
  fetchSuggestions: this.fetchSuggestions
300
301
  ? this.fetchSuggestions
301
302
  : this.getData,
@@ -323,7 +324,7 @@ export default {
323
324
  domProps: {
324
325
  value: this.model
325
326
  },
326
- attrs: { ...this.$attrs },
327
+ attrs: { ...attrs },
327
328
  on: { ...this.$listeners },
328
329
  directives: [
329
330
  {
@@ -350,6 +350,7 @@
350
350
  </div>
351
351
  </template>
352
352
  <script>
353
+ import { debounce } from 'throttle-debounce';
353
354
  import resetPassword from './resetPassword.vue';
354
355
  import store from 'eoss-ui/src/utils/store';
355
356
  import util from 'eoss-ui/src/utils/util';
@@ -566,6 +567,10 @@ export default {
566
567
  scanIntervalTime: {
567
568
  type: Number,
568
569
  default: 1500
570
+ },
571
+ isScale: {
572
+ type: Boolean,
573
+ default: true
569
574
  }
570
575
  },
571
576
  computed: {
@@ -768,6 +773,9 @@ export default {
768
773
  };
769
774
  },
770
775
  beforeCreate() {
776
+ this.setScale = debounce(300, () => {
777
+ util.setScale();
778
+ });
771
779
  util.removeStorage([
772
780
  'remind',
773
781
  'ssId',
@@ -780,6 +788,10 @@ export default {
780
788
  ]);
781
789
  },
782
790
  created() {
791
+ if (this.isScale) {
792
+ util.setScale();
793
+ window.addEventListener('resize', this.setScale);
794
+ }
783
795
  this.code = util.getParams('code');
784
796
  if (this.code) {
785
797
  this.doWechatLogin(this.code);
@@ -1558,6 +1570,7 @@ export default {
1558
1570
  }
1559
1571
  },
1560
1572
  beforeDestroy() {
1573
+ window.removeEventListener('resize', this.setScale);
1561
1574
  document.removeEventListener('keyup', this.doLogin);
1562
1575
  document.removeEventListener('keydown', this.forbiddenTab);
1563
1576
  }
@@ -322,7 +322,7 @@ export default {
322
322
  : {},
323
323
  {
324
324
  required: true,
325
- message: '请输入新密码',
325
+ message: '请确认新密码',
326
326
  trigger: 'blur'
327
327
  },
328
328
  { validator: this.reregExpValidate, trigger: 'blur' }
@@ -119,6 +119,7 @@
119
119
  />
120
120
  <es-nav
121
121
  v-if="showMenu && showDefault"
122
+ :hide-sub-menu="hideSubMenu"
122
123
  :is-top="layout == 'topside'"
123
124
  :overlap="layout == 'side'"
124
125
  :data="menu"
@@ -252,6 +253,15 @@
252
253
  </slot>
253
254
  </es-dialog>
254
255
  <notice :data="sysMsg" :winopen="winopen" @opened="handleOpened"></notice>
256
+ <es-dialog :title="dialog.title" :visible.sync="dialog.show" size="md">
257
+ <iframe
258
+ v-if="dialog.show"
259
+ width="100%"
260
+ height="100%"
261
+ frameborder="0"
262
+ :src="dialog.src"
263
+ ></iframe>
264
+ </es-dialog>
255
265
  </div>
256
266
  </template>
257
267
  <script>
@@ -437,6 +447,10 @@ export default {
437
447
  showCollapse: {
438
448
  type: Boolean,
439
449
  default: true
450
+ },
451
+ onlineView: {
452
+ type: [String, Boolean],
453
+ default: true
440
454
  }
441
455
  },
442
456
  computed: {
@@ -580,6 +594,14 @@ export default {
580
594
  },
581
595
  menuCode() {
582
596
  return appCode || this.appCode;
597
+ },
598
+ onlineUrl() {
599
+ if (this.onlineView) {
600
+ return typeof this.onlineView == 'string'
601
+ ? this.onlineView
602
+ : '/main/sysuseronline/list.dhtml';
603
+ }
604
+ return false;
583
605
  }
584
606
  },
585
607
  watch: {
@@ -697,7 +719,9 @@ export default {
697
719
  timer: null,
698
720
  pid: null,
699
721
  showPage: false,
700
- webSocket: null
722
+ webSocket: null,
723
+ dialog: {},
724
+ hideSubMenu: false
701
725
  };
702
726
  },
703
727
  created() {
@@ -1062,8 +1086,14 @@ export default {
1062
1086
  * @param {Boolean} [isUrl] - res是否是url地址
1063
1087
  * @param {Object} [param] - 拼接地址后的参数
1064
1088
  */
1065
- jumpMenu(res, isUrl, path) {
1066
- let option = { url: res, isUrl: isUrl, path: path };
1089
+ jumpMenu(res, isUrl, param, hide) {
1090
+ if (this.showSide === false) {
1091
+ this.isSide = true;
1092
+ }
1093
+ if (hide !== undefined && hide !== null && hide !== '') {
1094
+ this.hideSubMenu = hide;
1095
+ }
1096
+ let option = { url: res, isUrl: isUrl, param: param };
1067
1097
  if (util.isObject(res)) {
1068
1098
  if (res.urlopenmode == 1) {
1069
1099
  util.win.open(res.url);
@@ -1611,6 +1641,7 @@ export default {
1611
1641
  }
1612
1642
  break;
1613
1643
  case 'sub':
1644
+ this.hideSubMenu = false;
1614
1645
  this.navIds = [node.id];
1615
1646
  if (node.url) {
1616
1647
  this.tabs = [];
@@ -1734,6 +1765,7 @@ export default {
1734
1765
  handleTrigger(res) {},
1735
1766
  //头部工具交互事件
1736
1767
  handleClick(res) {
1768
+ console.log(res);
1737
1769
  const { type } = res;
1738
1770
  switch (type) {
1739
1771
  //刷新
@@ -1758,13 +1790,15 @@ export default {
1758
1790
  case 'user':
1759
1791
  this.showUserInfo = true;
1760
1792
  break;
1761
- // case 'online':
1762
- // this.dialog = {
1763
- // title: '查看在线人员',
1764
- // show: true,
1765
- // url: '/main/sysuseronline/list.dhtml'
1766
- // };
1767
- // break;
1793
+ case 'online':
1794
+ if (this.onlineUrl) {
1795
+ this.dialog = {
1796
+ title: '查看在线人员',
1797
+ show: true,
1798
+ src: this.onlineUrl
1799
+ };
1800
+ }
1801
+ break;
1768
1802
  case 'notice':
1769
1803
  this.showMsg = !this.showMsg;
1770
1804
  break;
@@ -39,9 +39,9 @@
39
39
  :biserial="biserial"
40
40
  :style="{
41
41
  width: biserial ? width : boxWidth,
42
- left: show ? '15px' : navWidth
42
+ left: biserial ? (show ? '15px' : navWidth) : ''
43
43
  }"
44
- v-show="biserial ? subMenu.length : menu.length"
44
+ v-show="showMenu"
45
45
  >
46
46
  <div class="es-nav-title" v-if="showTitle" ref="navTitle">
47
47
  <span v-show="!isCollapse">{{ headline }}</span>
@@ -91,6 +91,7 @@
91
91
  </template>
92
92
  <script>
93
93
  import util from 'eoss-ui/src/utils/util';
94
+ import { debounce } from 'throttle-debounce';
94
95
  export default {
95
96
  name: 'EsNav',
96
97
  inheritAttrs: false,
@@ -131,7 +132,9 @@ export default {
131
132
  type: Boolean,
132
133
  default: true
133
134
  },
134
- overlap: Boolean
135
+ overlap: Boolean,
136
+ //隐藏菜单
137
+ hideSubMenu: Boolean
135
138
  },
136
139
  computed: {
137
140
  show() {
@@ -178,7 +181,11 @@ export default {
178
181
  return this.navWidth;
179
182
  }
180
183
  }
181
- return this.subMenu && this.subMenu.length && this.isShow && !this.overlap
184
+ return this.subMenu &&
185
+ this.subMenu.length &&
186
+ this.isShow &&
187
+ !this.overlap &&
188
+ !this.hideSubMenu
182
189
  ? parseInt(this.width, 10) + parseInt(this.navWidth, 10) + 'px'
183
190
  : this.navWidth;
184
191
  },
@@ -197,10 +204,13 @@ export default {
197
204
  this.headline = val;
198
205
  }
199
206
  },
207
+ boxWidth() {
208
+ this.getHeight();
209
+ },
200
210
  biserial: {
201
211
  handler(val) {
202
212
  this.isShow = !val;
203
- this.resetHeight();
213
+ this.getHeight();
204
214
  }
205
215
  },
206
216
  defaultActive: {
@@ -251,8 +261,10 @@ export default {
251
261
  this.subMenu = [];
252
262
  }
253
263
  },
254
- showMenu() {
255
- this.resetHeight();
264
+ showMenu(val) {
265
+ if (val) {
266
+ this.getHeight();
267
+ }
256
268
  }
257
269
  },
258
270
  data() {
@@ -267,8 +279,13 @@ export default {
267
279
  subMenu: []
268
280
  };
269
281
  },
282
+ beforeCreate() {
283
+ this.getHeight = debounce(500, () => {
284
+ this.resetHeight();
285
+ });
286
+ },
270
287
  mounted() {
271
- this.resetHeight();
288
+ this.getHeight();
272
289
  this.move();
273
290
  },
274
291
  methods: {
@@ -673,26 +673,27 @@ export default {
673
673
  });
674
674
  }
675
675
  }
676
+ let { prefix, suffix, prepend, append, ...attrs } = this.$attrs;
676
677
  if (this.$slots.prefix) {
677
678
  doms.push(h('template', { slot: 'prefix' }, this.$slots.prefix));
678
- } else if (this.$attrs.prefix) {
679
+ } else if (prefix) {
679
680
  this.renderd(doms, h, 'prefix');
680
681
  cls.push('es-select-button-prefix');
681
682
  }
682
683
  if (this.$slots.suffix) {
683
684
  doms.push(h('template', { slot: 'suffix' }, this.$slots.suffix));
684
- } else if (this.$attrs.suffix) {
685
+ } else if (suffix) {
685
686
  this.renderd(doms, h, 'suffix');
686
687
  cls.push('es-select-button-suffix');
687
688
  }
688
689
  if (this.$slots.prepend) {
689
690
  doms.push(h('template', { slot: 'prepend' }, this.$slots.prepend));
690
- } else if (this.$attrs.prepend) {
691
+ } else if (prepend) {
691
692
  this.renderd(doms, h, 'prepend');
692
693
  }
693
694
  if (this.$slots.append) {
694
695
  doms.push(h('template', { slot: 'append' }, this.$slots.append));
695
- } else if (this.$attrs.append) {
696
+ } else if (append) {
696
697
  this.renderd(doms, h, 'append');
697
698
  }
698
699
  if (!this.models && this.results.length && this.defaultValue) {
@@ -717,7 +718,7 @@ export default {
717
718
  }
718
719
  ],
719
720
  props: {
720
- ...this.$attrs,
721
+ ...attrs,
721
722
  multiple: this.multiple,
722
723
  valueType: this.valueType,
723
724
  valueKey: this.valKey,