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/main.js CHANGED
@@ -620,6 +620,35 @@ var calculateNetworkDays = function calculateNetworkDays(start_date, end_date) {
620
620
  return workdays;
621
621
  };
622
622
 
623
+ /**
624
+ * chunkToChinese
625
+ * @desc 将四位数的整数转换为中文大写
626
+ * @param {number} chunk - 数字
627
+ **/
628
+ function chunkToChinese(chunk) {
629
+ var numberToChinese = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
630
+ var capitalDigits = ['', '拾', '佰', '仟'];
631
+
632
+ var result = '';
633
+ var digitIndex = 0;
634
+
635
+ while (chunk > 0) {
636
+ var digit = chunk % 10;
637
+ if (digit > 0) {
638
+ result = numberToChinese[digit] + capitalDigits[digitIndex] + result;
639
+ } else {
640
+ // 当前数字是零,需要判断是否需要添加零
641
+ if (result.charAt(0) !== '零') {
642
+ result = '零' + result;
643
+ }
644
+ }
645
+ chunk = Math.floor(chunk / 10);
646
+ digitIndex++;
647
+ }
648
+
649
+ return result;
650
+ }
651
+
623
652
  /**
624
653
  * concatenate
625
654
  * @desc 指定连接符合并文本
@@ -1815,6 +1844,31 @@ var getWeekday = function getWeekday(date) {
1815
1844
  return adjustedDay === 0 ? 7 : adjustedDay;
1816
1845
  };
1817
1846
 
1847
+ /**
1848
+ * getZoom
1849
+ * @desc 获取缩放比
1850
+ * @param {number} n - 可选参数,表示星期的起始日,0 表示星期天,1 表示星期一,以此类推,默认为 0
1851
+ **/
1852
+ var getZoom = function getZoom() {
1853
+ var ratio = 0;
1854
+ var screen = window.screen;
1855
+ var ua = navigator.userAgent.toLowerCase();
1856
+ if (window.devicePixelRatio !== undefined) {
1857
+ ratio = window.devicePixelRatio;
1858
+ } else if (~ua.indexOf('msie')) {
1859
+ if (screen.deviceXDPI && screen.logicalXDPI) {
1860
+ ratio = screen.deviceXDPI / screen.logicalXDPI;
1861
+ }
1862
+ } else if (window.outerWidth !== undefined && window.innerWidth !== undefined) {
1863
+ ratio = window.outerWidth / window.innerWidth;
1864
+ }
1865
+
1866
+ if (ratio) {
1867
+ ratio = Math.round(ratio * 100);
1868
+ }
1869
+
1870
+ return ratio / 100;
1871
+ };
1818
1872
  /**
1819
1873
  * handlerUrl
1820
1874
  * @desc:更新url参数中的时间戳
@@ -2557,32 +2611,53 @@ var rmbToCapital = function rmbToCapital(number) {
2557
2611
 
2558
2612
  return result;
2559
2613
  };
2560
-
2561
- // 辅助函数,将四位数的整数转换为中文大写
2562
- function chunkToChinese(chunk) {
2563
- var numberToChinese = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
2564
- var capitalDigits = ['', '拾', '佰', '仟'];
2565
-
2566
- var result = '';
2567
- var digitIndex = 0;
2568
-
2569
- while (chunk > 0) {
2570
- var digit = chunk % 10;
2571
- if (digit > 0) {
2572
- result = numberToChinese[digit] + capitalDigits[digitIndex] + result;
2614
+ /**
2615
+ * setScale
2616
+ * @desc 设置缩放
2617
+ * @param {number} width - 分辨率宽度
2618
+ * @param {number} height - 分辨率高度
2619
+ **/
2620
+ var setScale = function setScale() {
2621
+ var width = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1920;
2622
+ var height = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1080;
2623
+
2624
+ var n = 1;
2625
+ var isMac = /macintosh|mac os x/i.test(navigator.userAgent);
2626
+ var zoom = getZoom();
2627
+ if (isMac) {
2628
+ n = 2;
2629
+ } else {
2630
+ n = 1;
2631
+ }
2632
+ if (zoom === 1) {
2633
+ document.body.style.removeProperty('transform');
2634
+ document.body.style.removeProperty('width');
2635
+ document.body.style.removeProperty('height');
2636
+ document.body.style.removeProperty('transform-origin');
2637
+ return;
2638
+ }
2639
+ if (Math.abs(parseInt(width - window.innerWidth * zoom / n, 10)) > 15 && window.innerWidth * zoom / n !== width) {
2640
+ var scale = 'scale(' + window.innerWidth * zoom / width / zoom + ',' + window.innerHeight * zoom / height / zoom + ')';
2641
+ document.body.style.transform = scale;
2642
+ document.body.style.width = width + 'px';
2643
+ document.body.style.height = height + 'px';
2644
+ document.body.style.transformOrigin = '0 0';
2645
+ } else {
2646
+ if (isMac) {
2647
+ var _scale = 'scale(' + 1 * n / zoom + ')';
2648
+ document.body.style.transform = _scale;
2649
+ document.body.style.width = parseInt(window.innerWidth * zoom / n, 10) + 'px';
2650
+ document.body.style.height = parseInt(window.innerHeight * zoom / n, 10) + 'px';
2651
+ document.body.style.transformOrigin = '0 0';
2573
2652
  } else {
2574
- // 当前数字是零,需要判断是否需要添加零
2575
- if (result.charAt(0) !== '零') {
2576
- result = '零' + result;
2577
- }
2653
+ var _scale2 = 'scale(' + 1 * n / zoom + ')';
2654
+ document.body.style.transform = _scale2;
2655
+ document.body.style.width = parseInt(window.innerWidth * zoom / n, 10) + 'px';
2656
+ document.body.style.height = parseInt(window.innerHeight * zoom / n, 10) + 'px';
2657
+ document.body.style.transformOrigin = '0 0';
2578
2658
  }
2579
- chunk = Math.floor(chunk / 10);
2580
- digitIndex++;
2581
2659
  }
2582
-
2583
- return result;
2584
- }
2585
-
2660
+ };
2586
2661
  /**
2587
2662
  * sendMessage
2588
2663
  * @desc:向iframe发送信息
@@ -3118,6 +3193,7 @@ var watermark = function watermark(option) {
3118
3193
  rmbToCapital: rmbToCapital,
3119
3194
  sendMessage: sendMessage,
3120
3195
  setFavicon: setFavicon,
3196
+ setScale: setScale,
3121
3197
  setStorage: setStorage,
3122
3198
  socket: socket,
3123
3199
  startWith: startWith,
@@ -3643,6 +3719,8 @@ var WebSocket = function () {
3643
3719
  this.connects = 1;
3644
3720
  this.recon = false;
3645
3721
  this.sendTimeout = null;
3722
+ this.socket = null;
3723
+ this.subscription = null;
3646
3724
  }
3647
3725
 
3648
3726
  /** socket连接 */
@@ -3653,14 +3731,12 @@ var WebSocket = function () {
3653
3731
 
3654
3732
  if (!this.client) {
3655
3733
  // 连接SockJS
3656
- var socket = new sockjs_client__WEBPACK_IMPORTED_MODULE_0___default.a(this.host + this.url);
3657
- // 获取STOMP子协议的客户端对象
3658
- this.client = stompjs__WEBPACK_IMPORTED_MODULE_1___default.a.over(socket);
3734
+ this.socket = new sockjs_client__WEBPACK_IMPORTED_MODULE_0___default.a(this.host + this.url, { timeout: 60000 });
3735
+ this.client = stompjs__WEBPACK_IMPORTED_MODULE_1___default.a.over(this.socket);
3659
3736
  }
3660
3737
 
3661
3738
  // 日志不打印
3662
3739
  if (!this.debug) {
3663
- console.log(111);
3664
3740
  this.client.debug = function () {};
3665
3741
  }
3666
3742
 
@@ -3672,9 +3748,10 @@ var WebSocket = function () {
3672
3748
  // 订阅消息
3673
3749
  _this.subscribe();
3674
3750
  }, function (error) {
3751
+ _this.unsubscribe();
3752
+ _this.client = null;
3675
3753
  var diffSecond = parseInt((new Date() - _this.nextDate) / 1000, 10);
3676
3754
  if (_this.connects > 5 && diffSecond < _this.interval) {
3677
- _this.client.disconnect();
3678
3755
  _this.error && _this.error(error);
3679
3756
  } else {
3680
3757
  _this.reconTimeout = setTimeout(function () {
@@ -3683,6 +3760,14 @@ var WebSocket = function () {
3683
3760
  }, 5000);
3684
3761
  }
3685
3762
  });
3763
+ }; // 清除订阅
3764
+
3765
+
3766
+ WebSocket.prototype.unsubscribe = function unsubscribe() {
3767
+ if (this.subscription) {
3768
+ this.subscription.unsubscribe();
3769
+ this.subscription = null;
3770
+ }
3686
3771
  };
3687
3772
  /** 订阅服务端 */
3688
3773
 
@@ -3691,7 +3776,7 @@ var WebSocket = function () {
3691
3776
  var _this2 = this;
3692
3777
 
3693
3778
  // 订阅服务端提供的某个topic
3694
- this.client.subscribe(this.take, function (response) {
3779
+ this.subscription = this.client.subscribe(this.take, function (response) {
3695
3780
  if (response && (_this2.callback || _this2.success)) {
3696
3781
  var callback = _this2.callback || _this2.success;
3697
3782
  callback(JSON.parse(response.body));
@@ -3732,6 +3817,7 @@ var WebSocket = function () {
3732
3817
 
3733
3818
  WebSocket.prototype.destroy = function destroy() {
3734
3819
  // 断开连接,清除定时器
3820
+ this.unsubscribe();
3735
3821
  if (this.client) {
3736
3822
  this.client.disconnect();
3737
3823
  };
@@ -3826,7 +3912,7 @@ module.exports = require("runtime-import");
3826
3912
  // ESM COMPAT FLAG
3827
3913
  __webpack_require__.r(__webpack_exports__);
3828
3914
 
3829
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/main/src/main.vue?vue&type=template&id=a08554be&
3915
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/main/src/main.vue?vue&type=template&id=572765ea&
3830
3916
  var render = function () {
3831
3917
  var _vm = this
3832
3918
  var _h = _vm.$createElement
@@ -4032,6 +4118,7 @@ var render = function () {
4032
4118
  _vm.showMenu && _vm.showDefault
4033
4119
  ? _c("es-nav", {
4034
4120
  attrs: {
4121
+ "hide-sub-menu": _vm.hideSubMenu,
4035
4122
  "is-top": _vm.layout == "topside",
4036
4123
  overlap: _vm.layout == "side",
4037
4124
  data: _vm.menu,
@@ -4274,6 +4361,33 @@ var render = function () {
4274
4361
  attrs: { data: _vm.sysMsg, winopen: _vm.winopen },
4275
4362
  on: { opened: _vm.handleOpened },
4276
4363
  }),
4364
+ _c(
4365
+ "es-dialog",
4366
+ {
4367
+ attrs: {
4368
+ title: _vm.dialog.title,
4369
+ visible: _vm.dialog.show,
4370
+ size: "md",
4371
+ },
4372
+ on: {
4373
+ "update:visible": function ($event) {
4374
+ _vm.$set(_vm.dialog, "show", $event)
4375
+ },
4376
+ },
4377
+ },
4378
+ [
4379
+ _vm.dialog.show
4380
+ ? _c("iframe", {
4381
+ attrs: {
4382
+ width: "100%",
4383
+ height: "100%",
4384
+ frameborder: "0",
4385
+ src: _vm.dialog.src,
4386
+ },
4387
+ })
4388
+ : _vm._e(),
4389
+ ]
4390
+ ),
4277
4391
  ],
4278
4392
  1
4279
4393
  )
@@ -4282,7 +4396,7 @@ var staticRenderFns = []
4282
4396
  render._withStripped = true
4283
4397
 
4284
4398
 
4285
- // CONCATENATED MODULE: ./packages/main/src/main.vue?vue&type=template&id=a08554be&
4399
+ // CONCATENATED MODULE: ./packages/main/src/main.vue?vue&type=template&id=572765ea&
4286
4400
 
4287
4401
  // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/main/src/userinfo.vue?vue&type=template&id=75d533de&
4288
4402
  var userinfovue_type_template_id_75d533de_render = function () {
@@ -6428,6 +6542,16 @@ var mainvue_type_script_lang_js_extends = Object.assign || function (target) { f
6428
6542
  //
6429
6543
  //
6430
6544
  //
6545
+ //
6546
+ //
6547
+ //
6548
+ //
6549
+ //
6550
+ //
6551
+ //
6552
+ //
6553
+ //
6554
+ //
6431
6555
 
6432
6556
 
6433
6557
 
@@ -6603,6 +6727,10 @@ var appCode = util["a" /* default */].getParams('appCode') || util["a" /* defaul
6603
6727
  showCollapse: {
6604
6728
  type: Boolean,
6605
6729
  default: true
6730
+ },
6731
+ onlineView: {
6732
+ type: [String, Boolean],
6733
+ default: true
6606
6734
  }
6607
6735
  },
6608
6736
  computed: {
@@ -6725,6 +6853,12 @@ var appCode = util["a" /* default */].getParams('appCode') || util["a" /* defaul
6725
6853
  },
6726
6854
  menuCode: function menuCode() {
6727
6855
  return appCode || this.appCode;
6856
+ },
6857
+ onlineUrl: function onlineUrl() {
6858
+ if (this.onlineView) {
6859
+ return typeof this.onlineView == 'string' ? this.onlineView : '/main/sysuseronline/list.dhtml';
6860
+ }
6861
+ return false;
6728
6862
  }
6729
6863
  },
6730
6864
  watch: {
@@ -6842,7 +6976,9 @@ var appCode = util["a" /* default */].getParams('appCode') || util["a" /* defaul
6842
6976
  timer: null,
6843
6977
  pid: null,
6844
6978
  showPage: false,
6845
- webSocket: null
6979
+ webSocket: null,
6980
+ dialog: {},
6981
+ hideSubMenu: false
6846
6982
  };
6847
6983
  },
6848
6984
  created: function created() {
@@ -7190,10 +7326,16 @@ var appCode = util["a" /* default */].getParams('appCode') || util["a" /* defaul
7190
7326
  * @param {Boolean} [isUrl] - res是否是url地址
7191
7327
  * @param {Object} [param] - 拼接地址后的参数
7192
7328
  */
7193
- jumpMenu: function jumpMenu(res, isUrl, path) {
7329
+ jumpMenu: function jumpMenu(res, isUrl, param, hide) {
7194
7330
  var _this5 = this;
7195
7331
 
7196
- var option = { url: res, isUrl: isUrl, path: path };
7332
+ if (this.showSide === false) {
7333
+ this.isSide = true;
7334
+ }
7335
+ if (hide !== undefined && hide !== null && hide !== '') {
7336
+ this.hideSubMenu = hide;
7337
+ }
7338
+ var option = { url: res, isUrl: isUrl, param: param };
7197
7339
  if (util["a" /* default */].isObject(res)) {
7198
7340
  if (res.urlopenmode == 1) {
7199
7341
  util["a" /* default */].win.open(res.url);
@@ -7219,11 +7361,11 @@ var appCode = util["a" /* default */].getParams('appCode') || util["a" /* defaul
7219
7361
  this.method = 'router';
7220
7362
  var routes = this.$router.options.routes;
7221
7363
  if (routes) {
7222
- var _path = this.hasRouter(routes, option.url);
7223
- if (_path) {
7364
+ var path = this.hasRouter(routes, option.url);
7365
+ if (path) {
7224
7366
  var params = util["a" /* default */].getParams({ url: option.url });
7225
7367
  this.$router.push({
7226
- path: _path,
7368
+ path: path,
7227
7369
  query: params
7228
7370
  });
7229
7371
  } else {
@@ -7689,6 +7831,7 @@ var appCode = util["a" /* default */].getParams('appCode') || util["a" /* defaul
7689
7831
  }
7690
7832
  break;
7691
7833
  case 'sub':
7834
+ this.hideSubMenu = false;
7692
7835
  this.navIds = [node.id];
7693
7836
  if (node.url) {
7694
7837
  this.tabs = [];
@@ -7785,19 +7928,19 @@ var appCode = util["a" /* default */].getParams('appCode') || util["a" /* defaul
7785
7928
  }
7786
7929
  }
7787
7930
  } else {
7788
- var _path2 = res.path;
7789
- if (_path2 !== '/' && _path2 !== '/404') {
7790
- _path2 = _path2.replace(_path2[1], _path2[1].toLowerCase());
7931
+ var _path = res.path;
7932
+ if (_path !== '/' && _path !== '/404') {
7933
+ _path = _path.replace(_path[1], _path[1].toLowerCase());
7791
7934
  }
7792
7935
  var pathname = url.substring(url.indexOf('#/') + 1);
7793
7936
  pathname = pathname.replace(pathname[1], pathname[1].toLowerCase()).split('?')[0];
7794
- if (res.path !== '/' && pathname == _path2) {
7937
+ if (res.path !== '/' && pathname == _path) {
7795
7938
  return pathname;
7796
7939
  }
7797
7940
  if (res && Object.prototype.hasOwnProperty.call(res, 'children')) {
7798
- var _path3 = this.hasRouter(res.children, url);
7799
- if (_path3) {
7800
- return _path3;
7941
+ var _path2 = this.hasRouter(res.children, url);
7942
+ if (_path2) {
7943
+ return _path2;
7801
7944
  }
7802
7945
  }
7803
7946
  }
@@ -7809,6 +7952,7 @@ var appCode = util["a" /* default */].getParams('appCode') || util["a" /* defaul
7809
7952
  handleClick: function handleClick(res) {
7810
7953
  var _this8 = this;
7811
7954
 
7955
+ console.log(res);
7812
7956
  var type = res.type;
7813
7957
 
7814
7958
  switch (type) {
@@ -7834,13 +7978,15 @@ var appCode = util["a" /* default */].getParams('appCode') || util["a" /* defaul
7834
7978
  case 'user':
7835
7979
  this.showUserInfo = true;
7836
7980
  break;
7837
- // case 'online':
7838
- // this.dialog = {
7839
- // title: '查看在线人员',
7840
- // show: true,
7841
- // url: '/main/sysuseronline/list.dhtml'
7842
- // };
7843
- // break;
7981
+ case 'online':
7982
+ if (this.onlineUrl) {
7983
+ this.dialog = {
7984
+ title: '查看在线人员',
7985
+ show: true,
7986
+ src: this.onlineUrl
7987
+ };
7988
+ }
7989
+ break;
7844
7990
  case 'notice':
7845
7991
  this.showMsg = !this.showMsg;
7846
7992
  break;