eoss-ui 0.4.98 → 0.5.10

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 (56) hide show
  1. package/lib/button-group.js +117 -27
  2. package/lib/button.js +118 -28
  3. package/lib/checkbox-group.js +198 -96
  4. package/lib/data-table-form.js +117 -31
  5. package/lib/data-table.js +173 -75
  6. package/lib/date-picker.js +117 -27
  7. package/lib/dialog.js +127 -41
  8. package/lib/eoss-ui.common.js +1006 -707
  9. package/lib/flow-group.js +117 -27
  10. package/lib/flow-list.js +136 -36
  11. package/lib/flow.js +147 -41
  12. package/lib/form.js +682 -434
  13. package/lib/handle-user.js +142 -52
  14. package/lib/handler.js +117 -27
  15. package/lib/icons.js +2 -2
  16. package/lib/index.js +1 -1
  17. package/lib/input-number.js +118 -28
  18. package/lib/input.js +120 -30
  19. package/lib/layout.js +2 -2
  20. package/lib/login.js +123 -36
  21. package/lib/main.js +232 -151
  22. package/lib/nav.js +117 -27
  23. package/lib/page.js +117 -27
  24. package/lib/player.js +119 -29
  25. package/lib/qr-code.js +117 -27
  26. package/lib/radio-group.js +146 -54
  27. package/lib/retrial-auth.js +117 -27
  28. package/lib/select-ganged.js +118 -28
  29. package/lib/select.js +142 -52
  30. package/lib/selector-panel.js +171 -74
  31. package/lib/selector.js +117 -27
  32. package/lib/sizer.js +120 -30
  33. package/lib/steps.js +117 -27
  34. package/lib/switch.js +118 -28
  35. package/lib/table-form.js +182 -76
  36. package/lib/tabs.js +117 -27
  37. package/lib/tips.js +117 -27
  38. package/lib/tree-group.js +117 -27
  39. package/lib/tree.js +117 -27
  40. package/lib/upload.js +206 -109
  41. package/lib/utils/util.js +97 -19
  42. package/lib/wujie.js +117 -27
  43. package/lib/wxlogin.js +117 -27
  44. package/package.json +1 -1
  45. package/packages/button/src/main.vue +1 -10
  46. package/packages/data-table/src/column.vue +6 -0
  47. package/packages/flow/src/main.vue +20 -3
  48. package/packages/flow-list/src/main.vue +4 -3
  49. package/packages/form/src/main.vue +60 -1
  50. package/packages/form/src/table.vue +6 -0
  51. package/packages/login/src/main.vue +1 -0
  52. package/packages/main/src/main.vue +117 -97
  53. package/packages/radio-group/src/main.vue +1 -0
  54. package/packages/upload/src/main.vue +0 -1
  55. package/src/index.js +1 -1
  56. package/src/utils/util.js +94 -20
@@ -85,9 +85,8 @@ module.exports =
85
85
  /******/ return __webpack_require__(__webpack_require__.s = 36);
86
86
  /******/ })
87
87
  /************************************************************************/
88
- /******/ ({
89
-
90
- /***/ 0:
88
+ /******/ ([
89
+ /* 0 */
91
90
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
92
91
 
93
92
  "use strict";
@@ -98,8 +97,14 @@ module.exports =
98
97
  /* harmony import */ var qs__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(qs__WEBPACK_IMPORTED_MODULE_2__);
99
98
  /* harmony import */ var json_bigint__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6);
100
99
  /* harmony import */ var json_bigint__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(json_bigint__WEBPACK_IMPORTED_MODULE_3__);
101
- /* harmony import */ var eoss_element__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2);
102
- /* harmony import */ var eoss_element__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(eoss_element__WEBPACK_IMPORTED_MODULE_4__);
100
+ /* harmony import */ var sockjs_client__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7);
101
+ /* harmony import */ var sockjs_client__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(sockjs_client__WEBPACK_IMPORTED_MODULE_4__);
102
+ /* harmony import */ var stompjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(8);
103
+ /* harmony import */ var stompjs__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(stompjs__WEBPACK_IMPORTED_MODULE_5__);
104
+ /* harmony import */ var eoss_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2);
105
+ /* harmony import */ var eoss_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(eoss_element__WEBPACK_IMPORTED_MODULE_6__);
106
+ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
107
+
103
108
  var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
104
109
 
105
110
  /**
@@ -110,7 +115,9 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
110
115
  **/
111
116
 
112
117
  /* eslint-disable indent */
113
- var sm2 = __webpack_require__(7).sm2;
118
+ var sm2 = __webpack_require__(9).sm2;
119
+
120
+
114
121
 
115
122
 
116
123
 
@@ -257,7 +264,7 @@ var ajax = function ajax(_ref) {
257
264
  clearTimeout(loginMsg);
258
265
  loginMsg = setTimeout(function () {
259
266
  sessionStorage.setItem('remind', 1);
260
- eoss_element__WEBPACK_IMPORTED_MODULE_4__["MessageBox"].confirm(response.data.rCode === 69 ? '该账号在其他地方已登陆!' : '登录已过期,请重新登录!', '提示', response.data.rCode === 69 ? {
267
+ eoss_element__WEBPACK_IMPORTED_MODULE_6__["MessageBox"].confirm(response.data.rCode === 69 ? '该账号在其他地方已登陆!' : '登录已过期,请重新登录!', '提示', response.data.rCode === 69 ? {
261
268
  confirmButtonText: '确定',
262
269
  closeOnClickModal: false,
263
270
  type: 'warning'
@@ -304,7 +311,7 @@ var ajax = function ajax(_ref) {
304
311
  } else if (response.data.rCode === 61) {
305
312
  clearTimeout(initAuth);
306
313
  initAuth = setTimeout(function () {
307
- Object(eoss_element__WEBPACK_IMPORTED_MODULE_4__["MessageBox"])({
314
+ Object(eoss_element__WEBPACK_IMPORTED_MODULE_6__["MessageBox"])({
308
315
  title: '请进行二次鉴权',
309
316
  closeOnClickModal: false,
310
317
  closeOnPressEscape: false,
@@ -1753,7 +1760,7 @@ var getWeekday = function getWeekday(date) {
1753
1760
  * @param {String} [url] - url地址
1754
1761
  **/
1755
1762
 
1756
- var handlerUrl = function handlerUrl(url, before) {
1763
+ var handlerUrl = function handlerUrl(url, param, before) {
1757
1764
  var arry = url.split('?');
1758
1765
  if (arry.length > 2) {
1759
1766
  var ary = arry.splice(1, arry.length);
@@ -1775,6 +1782,10 @@ var handlerUrl = function handlerUrl(url, before) {
1775
1782
  } else {
1776
1783
  url += '?_tt=' + new Date().getTime();
1777
1784
  }
1785
+ if (param) {
1786
+ var str = queryParams(param);
1787
+ url += '&' + str;
1788
+ }
1778
1789
  if (before && before === arry[0]) {
1779
1790
  var pathname = win.location.pathname;
1780
1791
  if (pathname === '/') {
@@ -1939,29 +1950,29 @@ var isLogined = function isLogined(_ref8) {
1939
1950
  loginPage = _ref8.loginPage,
1940
1951
  redirect = _ref8.redirect;
1941
1952
 
1942
- var logined = getStorage('logined');
1943
1953
  if (cookie === undefined) {
1944
1954
  cookie = getParams({ name: 'cookie' });
1945
1955
  }
1946
- // eslint-disable-next-line eqeqeq
1947
- if (logined || cookie == true || cookie == 1) {
1948
- if (loginPage) {
1949
- sessionStorage.setItem('loginPage', loginPage);
1950
- if (!startWith(loginPage, ['http', '/'], true)) {
1951
- var pathname = win.top.location.pathname;
1952
- if (pathname !== '/') {
1953
- pathname = pathname.split('/');
1954
- pathname.splice(pathname.length - 1);
1955
- pathname = pathname.join('/');
1956
- loginPage = pathname + '/' + loginPage.replace('./', '');
1957
- } else {
1958
- loginPage = pathname + loginPage.replace('./', '');
1959
- }
1956
+ if (loginPage) {
1957
+ sessionStorage.setItem('loginPage', loginPage);
1958
+ if (!startWith(loginPage, ['http', '/'], true)) {
1959
+ var pathname = win.top.location.pathname;
1960
+ if (pathname !== '/') {
1961
+ pathname = pathname.split('/');
1962
+ pathname.splice(pathname.length - 1);
1963
+ pathname = pathname.join('/');
1964
+ loginPage = pathname + '/' + loginPage.replace('./', '');
1965
+ } else {
1966
+ loginPage = pathname + loginPage.replace('./', '');
1960
1967
  }
1961
1968
  }
1962
- next();
1969
+ }
1970
+ var token = getStorage('token') || getStorage('Authorization');
1971
+ var logined = getStorage('logined');
1972
+ // eslint-disable-next-line eqeqeq
1973
+ if (token || logined || cookie == true || cookie == 1) {
1974
+ next && next();
1963
1975
  } else {
1964
- var token = getStorage('token') || getStorage('Authorization');
1965
1976
  if (!token && Object.prototype.hasOwnProperty.call(to.query, 'serverId') && Object.prototype.hasOwnProperty.call(to.query, 'authType')) {
1966
1977
  ajax({
1967
1978
  method: 'post',
@@ -2016,7 +2027,7 @@ var isLogined = function isLogined(_ref8) {
2016
2027
  }
2017
2028
  break;
2018
2029
  case 4:
2019
- eoss_element__WEBPACK_IMPORTED_MODULE_4__["MessageBox"].alert(results.msg ? results.msg : '账号未绑定,账号密码登录后自动绑定!', '提示', {
2030
+ eoss_element__WEBPACK_IMPORTED_MODULE_6__["MessageBox"].alert(results.msg ? results.msg : '账号未绑定,账号密码登录后自动绑定!', '提示', {
2020
2031
  confirmButtonText: '确定',
2021
2032
  type: 'error',
2022
2033
  callback: function callback() {
@@ -2036,7 +2047,7 @@ var isLogined = function isLogined(_ref8) {
2036
2047
  default:
2037
2048
  }
2038
2049
  } else {
2039
- eoss_element__WEBPACK_IMPORTED_MODULE_4__["MessageBox"].alert(res.msg, '提示', {
2050
+ eoss_element__WEBPACK_IMPORTED_MODULE_6__["MessageBox"].alert(res.msg, '提示', {
2040
2051
  confirmButtonText: '确定',
2041
2052
  type: 'error',
2042
2053
  callback: function callback() {
@@ -2167,7 +2178,7 @@ var loadJs = function loadJs(_ref10) {
2167
2178
  **/
2168
2179
  var loading = function loading($loading, res) {
2169
2180
  if (!$loading) {
2170
- $loading = eoss_element__WEBPACK_IMPORTED_MODULE_4__["Loading"].service;
2181
+ $loading = eoss_element__WEBPACK_IMPORTED_MODULE_6__["Loading"].service;
2171
2182
  }
2172
2183
  if (isObject(res)) {
2173
2184
  var config = extend({}, {
@@ -2526,6 +2537,70 @@ var setStorage = function setStorage(_ref14) {
2526
2537
  }
2527
2538
  };
2528
2539
 
2540
+ /**
2541
+ * socket
2542
+ * @desc:webSocket
2543
+ * @author huangbo
2544
+ * @date 2022年5月7日
2545
+ * @param {String} [url] - 连接地址
2546
+ * @param {String} [take] - 订阅地址
2547
+ * @param {String} [debug] - 调试
2548
+ * @param {String} [interval] - 重连间隔时间
2549
+ **/
2550
+ function socket(options) {
2551
+ var nextDate = 0;
2552
+ var connect = 1;
2553
+ return new Promise(function (resolve, reject) {
2554
+ var wshost = getStorage('wshost') || '';
2555
+ var option = {
2556
+ url: wshost + _config_api__WEBPACK_IMPORTED_MODULE_0__[/* wss */ "Zb"],
2557
+ take: _config_api__WEBPACK_IMPORTED_MODULE_0__[/* topic */ "Qb"],
2558
+ debug: true,
2559
+ interval: 20
2560
+ };
2561
+ var websocket = win.websocket || {};
2562
+ if (options && isObject(options)) {
2563
+ option = _extends({}, option, options);
2564
+ }
2565
+ var key = window.btoa(option.url);
2566
+ if (!websocket[key]) {
2567
+ websocket[key] = { socket: new sockjs_client__WEBPACK_IMPORTED_MODULE_4___default.a(option.url) };
2568
+ win.websocket = websocket;
2569
+ }
2570
+
2571
+ var client = websocket[key] ? websocket[key].client : null;
2572
+ if (!client) {
2573
+ client = websocket[key].client = stompjs__WEBPACK_IMPORTED_MODULE_5___default.a.over(websocket[key].socket);
2574
+ !option.debug && (client.debug = null);
2575
+ }
2576
+ client.connect({}, function () {
2577
+ client.subscribe(option.take, function (response) {
2578
+ var res = JSON.parse(response.body);
2579
+ resolve(res, function () {
2580
+ client.disconnect();
2581
+ win.top.websocket && win.top.websocket[key] && delete win.top.websocket[key];
2582
+ }, client, websocket[key]);
2583
+ });
2584
+ }, function (error) {
2585
+ var diffSecond = parseInt((new Date() - nextDate) / 1000, 10);
2586
+ if (connect > 5 && diffSecond < option.interval) {
2587
+ client.disconnect();
2588
+ if (win.top.websocket) {
2589
+ if (Object.keys(win.top.websocket).length > 1) {
2590
+ delete win.top.websocket[key];
2591
+ } else {
2592
+ delete win.top.websocket;
2593
+ }
2594
+ }
2595
+ } else {
2596
+ win.top.websocket && win.top.websocket[key] && setTimeout(function () {
2597
+ socket(options);
2598
+ }, 5000);
2599
+ }
2600
+ reject(error);
2601
+ });
2602
+ });
2603
+ }
2529
2604
  /**
2530
2605
  * sum
2531
2606
  * @desc 求和
@@ -2778,7 +2853,6 @@ var urlJoinParams = function urlJoinParams(_ref15) {
2778
2853
  params[items[0]] = items[1];
2779
2854
  });
2780
2855
  }
2781
- '&_tt=' + new Date().getTime();
2782
2856
  params = extend(true, params, param);
2783
2857
  var str = queryParams(params);
2784
2858
  if (str) {
@@ -2946,6 +3020,7 @@ var watermark = function watermark(option) {
2946
3020
  sendMessage: sendMessage,
2947
3021
  setFavicon: setFavicon,
2948
3022
  setStorage: setStorage,
3023
+ socket: socket,
2949
3024
  startWith: startWith,
2950
3025
  sum: sum,
2951
3026
  takeLeft: takeLeft,
@@ -2964,8 +3039,7 @@ var watermark = function watermark(option) {
2964
3039
  });
2965
3040
 
2966
3041
  /***/ }),
2967
-
2968
- /***/ 1:
3042
+ /* 1 */
2969
3043
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
2970
3044
 
2971
3045
  "use strict";
@@ -3304,15 +3378,13 @@ var sendBatch = '/notify2/sendRecord/reSendNotifyMessageBatch';
3304
3378
  var formContents = '/config/admin/online/onlineForm/render';
3305
3379
 
3306
3380
  /***/ }),
3307
-
3308
- /***/ 2:
3381
+ /* 2 */
3309
3382
  /***/ (function(module, exports) {
3310
3383
 
3311
3384
  module.exports = require("eoss-element");
3312
3385
 
3313
3386
  /***/ }),
3314
-
3315
- /***/ 3:
3387
+ /* 3 */
3316
3388
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
3317
3389
 
3318
3390
  "use strict";
@@ -3416,8 +3488,95 @@ function normalizeComponent(
3416
3488
 
3417
3489
 
3418
3490
  /***/ }),
3491
+ /* 4 */
3492
+ /***/ (function(module, exports) {
3493
+
3494
+ module.exports = require("qs");
3495
+
3496
+ /***/ }),
3497
+ /* 5 */
3498
+ /***/ (function(module, exports) {
3499
+
3500
+ module.exports = require("axios");
3501
+
3502
+ /***/ }),
3503
+ /* 6 */
3504
+ /***/ (function(module, exports) {
3505
+
3506
+ module.exports = require("json-bigint");
3507
+
3508
+ /***/ }),
3509
+ /* 7 */
3510
+ /***/ (function(module, exports) {
3511
+
3512
+ module.exports = require("sockjs-client");
3513
+
3514
+ /***/ }),
3515
+ /* 8 */
3516
+ /***/ (function(module, exports) {
3517
+
3518
+ module.exports = require("stompjs");
3519
+
3520
+ /***/ }),
3521
+ /* 9 */
3522
+ /***/ (function(module, exports) {
3523
+
3524
+ module.exports = require("sm-crypto");
3525
+
3526
+ /***/ }),
3527
+ /* 10 */
3528
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
3529
+
3530
+ "use strict";
3531
+ var store = {
3532
+ state: {},
3533
+ set: function set(name, value) {
3534
+ this.state[name] = value;
3535
+ },
3536
+ get: function get(name) {
3537
+ return this.state[name];
3538
+ },
3539
+ clear: function clear(name) {
3540
+ this.state[name] = null;
3541
+ },
3542
+ remove: function remove(name) {
3543
+ if (name) {
3544
+ delete this.state[name];
3545
+ } else {
3546
+ this.state = {};
3547
+ }
3548
+ }
3549
+ };
3550
+ window.__store = store;
3551
+ /* harmony default export */ __webpack_exports__["a"] = (store);
3419
3552
 
3420
- /***/ 36:
3553
+ /***/ }),
3554
+ /* 11 */,
3555
+ /* 12 */,
3556
+ /* 13 */,
3557
+ /* 14 */,
3558
+ /* 15 */,
3559
+ /* 16 */,
3560
+ /* 17 */,
3561
+ /* 18 */,
3562
+ /* 19 */,
3563
+ /* 20 */,
3564
+ /* 21 */,
3565
+ /* 22 */,
3566
+ /* 23 */,
3567
+ /* 24 */,
3568
+ /* 25 */,
3569
+ /* 26 */,
3570
+ /* 27 */,
3571
+ /* 28 */,
3572
+ /* 29 */,
3573
+ /* 30 */,
3574
+ /* 31 */,
3575
+ /* 32 */,
3576
+ /* 33 */,
3577
+ /* 34 */,
3578
+ /* 35 */,
3579
+ /* 36 */
3421
3580
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
3422
3581
 
3423
3582
  "use strict";
@@ -3563,7 +3722,7 @@ render._withStripped = true
3563
3722
  var api = __webpack_require__(1);
3564
3723
 
3565
3724
  // EXTERNAL MODULE: ./src/utils/store.js
3566
- var store = __webpack_require__(8);
3725
+ var store = __webpack_require__(10);
3567
3726
 
3568
3727
  // EXTERNAL MODULE: ./src/utils/util.js
3569
3728
  var util = __webpack_require__(0);
@@ -3898,62 +4057,5 @@ main.install = function (Vue) {
3898
4057
 
3899
4058
  /* harmony default export */ var checkbox_group = __webpack_exports__["default"] = (main);
3900
4059
 
3901
- /***/ }),
3902
-
3903
- /***/ 4:
3904
- /***/ (function(module, exports) {
3905
-
3906
- module.exports = require("qs");
3907
-
3908
- /***/ }),
3909
-
3910
- /***/ 5:
3911
- /***/ (function(module, exports) {
3912
-
3913
- module.exports = require("axios");
3914
-
3915
- /***/ }),
3916
-
3917
- /***/ 6:
3918
- /***/ (function(module, exports) {
3919
-
3920
- module.exports = require("json-bigint");
3921
-
3922
- /***/ }),
3923
-
3924
- /***/ 7:
3925
- /***/ (function(module, exports) {
3926
-
3927
- module.exports = require("sm-crypto");
3928
-
3929
- /***/ }),
3930
-
3931
- /***/ 8:
3932
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
3933
-
3934
- "use strict";
3935
- var store = {
3936
- state: {},
3937
- set: function set(name, value) {
3938
- this.state[name] = value;
3939
- },
3940
- get: function get(name) {
3941
- return this.state[name];
3942
- },
3943
- clear: function clear(name) {
3944
- this.state[name] = null;
3945
- },
3946
- remove: function remove(name) {
3947
- if (name) {
3948
- delete this.state[name];
3949
- } else {
3950
- this.state = {};
3951
- }
3952
- }
3953
- };
3954
- window.__store = store;
3955
- /* harmony default export */ __webpack_exports__["a"] = (store);
3956
-
3957
4060
  /***/ })
3958
-
3959
- /******/ });
4061
+ /******/ ]);