eoss-ui 0.5.44 → 0.5.46

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 (86) hide show
  1. package/lib/button-group.js +16 -0
  2. package/lib/button.js +157 -144
  3. package/lib/calendar.js +769 -0
  4. package/lib/cascader.js +2 -2
  5. package/lib/checkbox-group.js +20 -2
  6. package/lib/clients.js +2 -2
  7. package/lib/data-table-form.js +52 -13
  8. package/lib/data-table.js +33 -7
  9. package/lib/date-picker.js +18 -2
  10. package/lib/dialog.js +30 -13
  11. package/lib/enterprise.js +2 -2
  12. package/lib/eoss-ui.common.js +1324 -730
  13. package/lib/error-page.js +2 -2
  14. package/lib/flow-group.js +32 -19
  15. package/lib/flow-list.js +18 -2
  16. package/lib/flow.js +16 -0
  17. package/lib/form.js +231 -231
  18. package/lib/handle-user.js +25 -10
  19. package/lib/handler.js +24 -5
  20. package/lib/icons.js +2 -2
  21. package/lib/index.js +1 -1
  22. package/lib/input-number.js +18 -2
  23. package/lib/input.js +18 -2
  24. package/lib/label.js +2 -2
  25. package/lib/login.js +16 -0
  26. package/lib/main.js +27 -4
  27. package/lib/menu.js +2 -2
  28. package/lib/nav.js +21 -5
  29. package/lib/notify.js +2 -2
  30. package/lib/page.js +18 -2
  31. package/lib/pagination.js +2 -2
  32. package/lib/player.js +18 -2
  33. package/lib/qr-code.js +18 -2
  34. package/lib/radio-group.js +18 -2
  35. package/lib/retrial-auth.js +22 -8
  36. package/lib/select-ganged.js +18 -2
  37. package/lib/select.js +18 -2
  38. package/lib/selector-panel.js +16 -0
  39. package/lib/selector.js +18 -2
  40. package/lib/sizer.js +25 -9
  41. package/lib/steps.js +18 -2
  42. package/lib/switch.js +18 -2
  43. package/lib/table-form.js +18 -2
  44. package/lib/tabs-panel.js +2 -2
  45. package/lib/tabs.js +18 -2
  46. package/lib/theme-chalk/calendar.css +0 -0
  47. package/lib/theme-chalk/cascader.css +1 -0
  48. package/lib/theme-chalk/data-table-form.css +1 -1
  49. package/lib/theme-chalk/index.css +1 -1
  50. package/lib/theme-chalk/toolbar.css +1 -1
  51. package/lib/tips.js +18 -2
  52. package/lib/toolbar.js +24 -34
  53. package/lib/tree-group.js +18 -2
  54. package/lib/tree.js +18 -2
  55. package/lib/upload.js +22 -15
  56. package/lib/utils/util.js +16 -0
  57. package/lib/wujie.js +18 -2
  58. package/lib/wxlogin.js +18 -2
  59. package/package.json +2 -2
  60. package/packages/button/src/main.vue +6 -9
  61. package/packages/calendar/index.js +5 -0
  62. package/packages/calendar/src/main.vue +386 -0
  63. package/packages/data-table/src/main.vue +12 -2
  64. package/packages/data-table-form/src/main.vue +30 -23
  65. package/packages/data-table-form/src/table.vue +16 -3
  66. package/packages/dialog/src/main.vue +9 -9
  67. package/packages/flow-group/src/main.vue +12 -15
  68. package/packages/handle-user/src/main.vue +5 -6
  69. package/packages/handler/src/main.vue +4 -1
  70. package/packages/main/src/main.vue +9 -2
  71. package/packages/nav/src/main.vue +1 -1
  72. package/packages/retrial-auth/src/main.vue +2 -4
  73. package/packages/theme-chalk/lib/calendar.css +0 -0
  74. package/packages/theme-chalk/lib/cascader.css +1 -0
  75. package/packages/theme-chalk/lib/data-table-form.css +1 -1
  76. package/packages/theme-chalk/lib/index.css +1 -1
  77. package/packages/theme-chalk/lib/toolbar.css +1 -1
  78. package/packages/theme-chalk/src/calendar.scss +0 -0
  79. package/packages/theme-chalk/src/cascader.scss +93 -0
  80. package/packages/theme-chalk/src/data-table-form.scss +11 -0
  81. package/packages/theme-chalk/src/index.scss +2 -1
  82. package/packages/theme-chalk/src/toolbar.scss +16 -11
  83. package/packages/toolbar/src/main.vue +44 -49
  84. package/packages/upload/src/main.vue +1 -10
  85. package/src/index.js +7 -4
  86. package/src/utils/util.js +16 -0
@@ -1250,6 +1250,21 @@ var getHour = function getHour(datetime) {
1250
1250
  return datetimeObj.getHours();
1251
1251
  };
1252
1252
 
1253
+ /**
1254
+ * getMyWinTop
1255
+ * @desc 获取同域的top窗口
1256
+ * @param {object} wind - window对象
1257
+ **/
1258
+ var getMyWinTop = function getMyWinTop(wind) {
1259
+ wind = wind ? wind : win;
1260
+ try {
1261
+ wind.parent.document;
1262
+ return getMyWinTop(wind.parent);
1263
+ } catch (error) {
1264
+ return wind;
1265
+ }
1266
+ };
1267
+
1253
1268
  /**
1254
1269
  * getWeekNumber
1255
1270
  * @desc 当年第几周
@@ -3003,6 +3018,7 @@ var watermark = function watermark(option) {
3003
3018
  getCurrentDate: getCurrentDate,
3004
3019
  getCurrentDateTime: getCurrentDateTime,
3005
3020
  getHour: getHour,
3021
+ getMyWinTop: getMyWinTop,
3006
3022
  getWeekNumber: getWeekNumber,
3007
3023
  getLength: getLength,
3008
3024
  getMainConfig: getMainConfig,
package/lib/button.js CHANGED
@@ -82,7 +82,7 @@ module.exports =
82
82
  /******/
83
83
  /******/
84
84
  /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 69);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 70);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -1250,6 +1250,21 @@ var getHour = function getHour(datetime) {
1250
1250
  return datetimeObj.getHours();
1251
1251
  };
1252
1252
 
1253
+ /**
1254
+ * getMyWinTop
1255
+ * @desc 获取同域的top窗口
1256
+ * @param {object} wind - window对象
1257
+ **/
1258
+ var getMyWinTop = function getMyWinTop(wind) {
1259
+ wind = wind ? wind : win;
1260
+ try {
1261
+ wind.parent.document;
1262
+ return getMyWinTop(wind.parent);
1263
+ } catch (error) {
1264
+ return wind;
1265
+ }
1266
+ };
1267
+
1253
1268
  /**
1254
1269
  * getWeekNumber
1255
1270
  * @desc 当年第几周
@@ -3003,6 +3018,7 @@ var watermark = function watermark(option) {
3003
3018
  getCurrentDate: getCurrentDate,
3004
3019
  getCurrentDateTime: getCurrentDateTime,
3005
3020
  getHour: getHour,
3021
+ getMyWinTop: getMyWinTop,
3006
3022
  getWeekNumber: getWeekNumber,
3007
3023
  getLength: getLength,
3008
3024
  getMainConfig: getMainConfig,
@@ -3549,7 +3565,140 @@ module.exports = require("json-bigint");
3549
3565
 
3550
3566
  /***/ }),
3551
3567
 
3552
- /***/ 69:
3568
+ /***/ 7:
3569
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
3570
+
3571
+ "use strict";
3572
+ /* harmony import */ var sockjs_client__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8);
3573
+ /* harmony import */ var sockjs_client__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(sockjs_client__WEBPACK_IMPORTED_MODULE_0__);
3574
+ /* harmony import */ var stompjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9);
3575
+ /* harmony import */ var stompjs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(stompjs__WEBPACK_IMPORTED_MODULE_1__);
3576
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
3577
+
3578
+
3579
+
3580
+
3581
+ var WebSocket = function () {
3582
+ // 构造函数
3583
+ function WebSocket() {
3584
+ _classCallCheck(this, WebSocket);
3585
+
3586
+ this.host = sessionStorage.getItem('wshost') || '';
3587
+ this.tryTimes = 1; // 重连次数
3588
+ this.callback = null; // 回调函数
3589
+ this.client = null; // stomp对象
3590
+ this.reconTimeout = null; // 重连延时器
3591
+ this.debug = true; // 调试
3592
+ this.interval = 20; // 重连间隔时间
3593
+ this.vm = null;
3594
+ this.nextDate = 0;
3595
+ this.connects = 1;
3596
+ this.recon = false;
3597
+ this.sendTimeout = null;
3598
+ }
3599
+
3600
+ /** socket连接 */
3601
+
3602
+
3603
+ WebSocket.prototype.connect = function connect() {
3604
+ var _this = this;
3605
+
3606
+ if (!this.client) {
3607
+ // 连接SockJS
3608
+ var socket = new sockjs_client__WEBPACK_IMPORTED_MODULE_0___default.a(this.host + this.url);
3609
+ // 获取STOMP子协议的客户端对象
3610
+ this.client = stompjs__WEBPACK_IMPORTED_MODULE_1___default.a.over(socket);
3611
+ }
3612
+
3613
+ // 日志不打印
3614
+ if (!this.debug) {
3615
+ console.log(111);
3616
+ this.client.debug = function () {};
3617
+ }
3618
+
3619
+ // 向服务器发起websocket连接
3620
+ this.client.connect({}, function () {
3621
+ _this.recon = true;
3622
+ // tryTimes定义重置
3623
+ _this.connects = 1;
3624
+ // 订阅消息
3625
+ _this.subscribe();
3626
+ }, function (error) {
3627
+ var diffSecond = parseInt((new Date() - _this.nextDate) / 1000, 10);
3628
+ if (_this.connects > 5 && diffSecond < _this.interval) {
3629
+ _this.client.disconnect();
3630
+ _this.error && _this.error(error);
3631
+ } else {
3632
+ _this.reconTimeout = setTimeout(function () {
3633
+ _this.connect();
3634
+ _this.connects++;
3635
+ }, 5000);
3636
+ }
3637
+ });
3638
+ };
3639
+ /** 订阅服务端 */
3640
+
3641
+
3642
+ WebSocket.prototype.subscribe = function subscribe() {
3643
+ var _this2 = this;
3644
+
3645
+ // 订阅服务端提供的某个topic
3646
+ this.client.subscribe(this.take, function (response) {
3647
+ if (response && (_this2.callback || _this2.success)) {
3648
+ var callback = _this2.callback || _this2.success;
3649
+ callback(JSON.parse(response.body));
3650
+ }
3651
+ });
3652
+ };
3653
+
3654
+ /** 赋值、初始化socket */
3655
+
3656
+
3657
+ WebSocket.prototype.init = function init(option, vm) {
3658
+ for (var i in option) {
3659
+ this[i] = option[i];
3660
+ }
3661
+ this.vm = vm;
3662
+ // 初始化连接
3663
+ this.connect();
3664
+ };
3665
+
3666
+ /** 发送消息 */
3667
+
3668
+
3669
+ WebSocket.prototype.send = function send(data) {
3670
+ var _this3 = this;
3671
+
3672
+ if (this.recon) {
3673
+ clearTimeout(this.sendTimeout);
3674
+ this.client.send(this.take, {}, typeof data === 'string' ? data : JSON.stringify(data));
3675
+ } else {
3676
+ this.sendTimeout = setTimeout(function () {
3677
+ _this3.send(data);
3678
+ }, 1000);
3679
+ }
3680
+ };
3681
+
3682
+ /** 销毁 */
3683
+
3684
+
3685
+ WebSocket.prototype.destroy = function destroy() {
3686
+ // 断开连接,清除定时器
3687
+ if (this.client) {
3688
+ this.client.disconnect();
3689
+ };
3690
+ this.reconTimeout && clearTimeout(this.reconTimeout);
3691
+ this.sendTimeout && clearTimeout(this.sendTimeout);
3692
+ };
3693
+
3694
+ return WebSocket;
3695
+ }();
3696
+
3697
+ /* harmony default export */ __webpack_exports__["a"] = (WebSocket);
3698
+
3699
+ /***/ }),
3700
+
3701
+ /***/ 70:
3553
3702
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
3554
3703
 
3555
3704
  "use strict";
@@ -3638,18 +3787,15 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
3638
3787
  evt.preventDefault();
3639
3788
  var width = 0;
3640
3789
  var height = 0;
3790
+ var win = void 0;
3641
3791
  try {
3642
- width = util["a" /* default */].win.top.screen.availWidth - 10;
3643
- height = util["a" /* default */].win.top.screen.availHeight - 60;
3792
+ util["a" /* default */].win.top.document;
3793
+ win = util["a" /* default */].win.top;
3644
3794
  } catch (error) {
3645
- try {
3646
- width = util["a" /* default */].win.parent.screen.availWidth - 10;
3647
- height = util["a" /* default */].win.parent.screen.availHeight - 60;
3648
- } catch (error) {
3649
- width = util["a" /* default */].win.screen.availWidth - 10;
3650
- height = util["a" /* default */].win.screen.availHeight - 60;
3651
- }
3795
+ win = util["a" /* default */].getMyWinTop();
3652
3796
  }
3797
+ width = win.screen.availWidth - 10;
3798
+ height = win.screen.availHeight - 60;
3653
3799
  var flag = true;
3654
3800
  if (this.esForm) {
3655
3801
  var params = util["a" /* default */].getParams({ url: this.link });
@@ -3892,139 +4038,6 @@ main.install = function (Vue) {
3892
4038
 
3893
4039
  /***/ }),
3894
4040
 
3895
- /***/ 7:
3896
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
3897
-
3898
- "use strict";
3899
- /* harmony import */ var sockjs_client__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8);
3900
- /* harmony import */ var sockjs_client__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(sockjs_client__WEBPACK_IMPORTED_MODULE_0__);
3901
- /* harmony import */ var stompjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9);
3902
- /* harmony import */ var stompjs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(stompjs__WEBPACK_IMPORTED_MODULE_1__);
3903
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
3904
-
3905
-
3906
-
3907
-
3908
- var WebSocket = function () {
3909
- // 构造函数
3910
- function WebSocket() {
3911
- _classCallCheck(this, WebSocket);
3912
-
3913
- this.host = sessionStorage.getItem('wshost') || '';
3914
- this.tryTimes = 1; // 重连次数
3915
- this.callback = null; // 回调函数
3916
- this.client = null; // stomp对象
3917
- this.reconTimeout = null; // 重连延时器
3918
- this.debug = true; // 调试
3919
- this.interval = 20; // 重连间隔时间
3920
- this.vm = null;
3921
- this.nextDate = 0;
3922
- this.connects = 1;
3923
- this.recon = false;
3924
- this.sendTimeout = null;
3925
- }
3926
-
3927
- /** socket连接 */
3928
-
3929
-
3930
- WebSocket.prototype.connect = function connect() {
3931
- var _this = this;
3932
-
3933
- if (!this.client) {
3934
- // 连接SockJS
3935
- var socket = new sockjs_client__WEBPACK_IMPORTED_MODULE_0___default.a(this.host + this.url);
3936
- // 获取STOMP子协议的客户端对象
3937
- this.client = stompjs__WEBPACK_IMPORTED_MODULE_1___default.a.over(socket);
3938
- }
3939
-
3940
- // 日志不打印
3941
- if (!this.debug) {
3942
- console.log(111);
3943
- this.client.debug = function () {};
3944
- }
3945
-
3946
- // 向服务器发起websocket连接
3947
- this.client.connect({}, function () {
3948
- _this.recon = true;
3949
- // tryTimes定义重置
3950
- _this.connects = 1;
3951
- // 订阅消息
3952
- _this.subscribe();
3953
- }, function (error) {
3954
- var diffSecond = parseInt((new Date() - _this.nextDate) / 1000, 10);
3955
- if (_this.connects > 5 && diffSecond < _this.interval) {
3956
- _this.client.disconnect();
3957
- _this.error && _this.error(error);
3958
- } else {
3959
- _this.reconTimeout = setTimeout(function () {
3960
- _this.connect();
3961
- _this.connects++;
3962
- }, 5000);
3963
- }
3964
- });
3965
- };
3966
- /** 订阅服务端 */
3967
-
3968
-
3969
- WebSocket.prototype.subscribe = function subscribe() {
3970
- var _this2 = this;
3971
-
3972
- // 订阅服务端提供的某个topic
3973
- this.client.subscribe(this.take, function (response) {
3974
- if (response && (_this2.callback || _this2.success)) {
3975
- var callback = _this2.callback || _this2.success;
3976
- callback(JSON.parse(response.body));
3977
- }
3978
- });
3979
- };
3980
-
3981
- /** 赋值、初始化socket */
3982
-
3983
-
3984
- WebSocket.prototype.init = function init(option, vm) {
3985
- for (var i in option) {
3986
- this[i] = option[i];
3987
- }
3988
- this.vm = vm;
3989
- // 初始化连接
3990
- this.connect();
3991
- };
3992
-
3993
- /** 发送消息 */
3994
-
3995
-
3996
- WebSocket.prototype.send = function send(data) {
3997
- var _this3 = this;
3998
-
3999
- if (this.recon) {
4000
- clearTimeout(this.sendTimeout);
4001
- this.client.send(this.take, {}, typeof data === 'string' ? data : JSON.stringify(data));
4002
- } else {
4003
- this.sendTimeout = setTimeout(function () {
4004
- _this3.send(data);
4005
- }, 1000);
4006
- }
4007
- };
4008
-
4009
- /** 销毁 */
4010
-
4011
-
4012
- WebSocket.prototype.destroy = function destroy() {
4013
- // 断开连接,清除定时器
4014
- if (this.client) {
4015
- this.client.disconnect();
4016
- };
4017
- this.reconTimeout && clearTimeout(this.reconTimeout);
4018
- this.sendTimeout && clearTimeout(this.sendTimeout);
4019
- };
4020
-
4021
- return WebSocket;
4022
- }();
4023
-
4024
- /* harmony default export */ __webpack_exports__["a"] = (WebSocket);
4025
-
4026
- /***/ }),
4027
-
4028
4041
  /***/ 8:
4029
4042
  /***/ (function(module, exports) {
4030
4043