eoss-ui 0.4.31 → 0.4.33

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 (60) hide show
  1. package/CHANGELOG.md +929 -0
  2. package/lib/button-group.js +33 -61
  3. package/lib/button.js +33 -61
  4. package/lib/checkbox-group.js +33 -61
  5. package/lib/data-table-form.js +33 -61
  6. package/lib/data-table.js +47 -67
  7. package/lib/date-picker.js +33 -61
  8. package/lib/dialog.js +33 -61
  9. package/lib/eoss-ui.common.js +197 -174
  10. package/lib/flow-group.js +43 -67
  11. package/lib/flow-list.js +33 -61
  12. package/lib/flow.js +33 -61
  13. package/lib/form.js +38 -65
  14. package/lib/handle-user.js +33 -61
  15. package/lib/handler.js +33 -61
  16. package/lib/index.js +1 -1
  17. package/lib/input-number.js +33 -61
  18. package/lib/input.js +33 -61
  19. package/lib/login.js +47 -72
  20. package/lib/main.js +58 -75
  21. package/lib/mainComp.js +36 -68
  22. package/lib/nav.js +33 -61
  23. package/lib/page.js +33 -61
  24. package/lib/player.js +33 -61
  25. package/lib/qr-code.js +33 -61
  26. package/lib/radio-group.js +33 -61
  27. package/lib/select-ganged.js +33 -61
  28. package/lib/select.js +33 -61
  29. package/lib/selector-panel.js +33 -61
  30. package/lib/selector.js +33 -61
  31. package/lib/sizer.js +33 -61
  32. package/lib/steps.js +33 -61
  33. package/lib/switch.js +33 -61
  34. package/lib/table-form.js +33 -61
  35. package/lib/tabs.js +33 -61
  36. package/lib/theme-chalk/form.css +1 -1
  37. package/lib/theme-chalk/index.css +1 -1
  38. package/lib/tips.js +33 -61
  39. package/lib/tree-group.js +43 -63
  40. package/lib/tree.js +48 -63
  41. package/lib/upload.js +61 -82
  42. package/lib/utils/util.js +33 -61
  43. package/lib/wujie.js +33 -61
  44. package/lib/wxlogin.js +33 -61
  45. package/package.json +2 -2
  46. package/packages/data-table/src/main.vue +9 -2
  47. package/packages/flow-group/src/main.vue +5 -4
  48. package/packages/form/src/main.vue +4 -2
  49. package/packages/login/src/main.vue +12 -9
  50. package/packages/main/src/main.vue +13 -3
  51. package/packages/main/src/userinfo.vue +21 -24
  52. package/packages/mainComp/src/main.vue +1 -5
  53. package/packages/theme-chalk/lib/form.css +1 -1
  54. package/packages/theme-chalk/lib/index.css +1 -1
  55. package/packages/theme-chalk/src/form.scss +1 -1
  56. package/packages/tree/src/main.vue +12 -0
  57. package/packages/tree-group/src/main.vue +6 -0
  58. package/packages/upload/src/main.vue +25 -25
  59. package/src/index.js +1 -1
  60. package/src/utils/util.js +50 -77
package/lib/main.js CHANGED
@@ -125,6 +125,7 @@ var $brightnessStep2 = 0.15;
125
125
  var $lightColorCount = 5;
126
126
  var $darkColorCount = 4;
127
127
  var publicKey = 'abcdefghijklmnopqrstuvwxyz12345678';
128
+ var loginMsg = void 0;
128
129
 
129
130
  var JSONbigToString = json_bigint__WEBPACK_IMPORTED_MODULE_3___default()({ storeAsString: true });
130
131
 
@@ -146,7 +147,6 @@ var JSONbigToString = json_bigint__WEBPACK_IMPORTED_MODULE_3___default()({ store
146
147
  * @param {Object} [loading] - loading加载对象
147
148
  **/
148
149
  // 请求
149
- var _timer = null;
150
150
  var pendingRequest = new Map();
151
151
  function getRequestKey(config) {
152
152
  var method = config.method,
@@ -245,44 +245,36 @@ var ajax = function ajax(_ref) {
245
245
  if (response.status === 200) {
246
246
  if (response.data.rCode === 64 || response.data.rCode === 65 || response.data.rCode === 67 || response.data.rCode === 69) {
247
247
  removeStorage(['Authorization', 'token', 'ssId', 'userId', 'userName', 'deviceUnique', 'menus', 'menus', 'useCaseCodes', 'mainConfig']);
248
-
249
- var timer = getStorage('timer') || 0;
250
- timer = parseInt(timer, 10);
251
- if (win.top.location.href.indexOf('#/login') === -1 && win.top.location.href.indexOf('/login.html') === -1 && !timer) {
252
- sessionStorage.setItem('timer', 1);
253
- eoss_element__WEBPACK_IMPORTED_MODULE_4__["MessageBox"].confirm(response.data.rCode === 69 ? '该账号在其他地方已登陆!' : '登录已过期,请重新登录!', '提示', response.data.rCode === 69 ? {
254
- confirmButtonText: '确定',
255
- closeOnClickModal: false,
256
- type: 'warning'
257
- } : {
258
- confirmButtonText: '确定',
259
- cancelButtonText: '取消',
260
- closeOnClickModal: false,
261
- type: 'warning'
262
- }).then(function () {
263
- var loginPage = getStorage('login') || getStorage('loginPage');
264
- if (loginPage) {
265
- win.top.location.href = loginPage;
266
- } else if (win.top.location.href.indexOf('main.html') > -1) {
267
- win.top.location.href = './login.html';
268
- } else {
269
- var hash = win.top.location.hash;
270
- if (hash || win.top.location.indexOf('model=') && win.top.location.indexOf('view=') && win.top.location.indexOf('render.html')) {
271
- var len = win.top.location.href.indexOf(hash);
272
- var href = win.top.location.href.slice(0, len) + '#/login';
273
- win.top.location.href = href;
248
+ if (win.top.location.href.indexOf('#/login') === -1 && win.top.location.href.indexOf('/login.html') === -1) {
249
+ clearTimeout(loginMsg);
250
+ loginMsg = setTimeout(function () {
251
+ eoss_element__WEBPACK_IMPORTED_MODULE_4__["MessageBox"].confirm(response.data.rCode === 69 ? '该账号在其他地方已登陆!' : '登录已过期,请重新登录!', '提示', response.data.rCode === 69 ? {
252
+ confirmButtonText: '确定',
253
+ closeOnClickModal: false,
254
+ type: 'warning'
255
+ } : {
256
+ confirmButtonText: '确定',
257
+ cancelButtonText: '取消',
258
+ closeOnClickModal: false,
259
+ type: 'warning'
260
+ }).then(function () {
261
+ var loginPage = getStorage('login') || getStorage('loginPage');
262
+ if (loginPage) {
263
+ win.top.location.href = loginPage;
264
+ } else if (win.top.location.href.indexOf('main.html') > -1) {
265
+ win.top.location.href = './login.html';
274
266
  } else {
275
- win.top.location.href = '/login.html';
267
+ var hash = win.top.location.hash;
268
+ if (hash || win.top.location.indexOf('model=') && win.top.location.indexOf('view=') && win.top.location.indexOf('render.html')) {
269
+ var len = win.top.location.href.indexOf(hash);
270
+ var href = win.top.location.href.slice(0, len) + '#/login';
271
+ win.top.location.href = href;
272
+ } else {
273
+ win.top.location.href = '/login.html';
274
+ }
276
275
  }
277
- }
278
- }).catch(function (e) {
279
- _timer && clearTimeout(_timer);
280
- _timer = setTimeout(function () {
281
- removeStorage('timer');
282
- clearTimeout(_timer);
283
- _timer = null;
284
- }, 1000);
285
- });
276
+ }).catch(function (e) {});
277
+ }, 1000);
286
278
  }
287
279
  return Promise.reject(response.data);
288
280
  } else {
@@ -426,31 +418,11 @@ var browser = function browser() {
426
418
  * @param {Boolean} [immediate] - 是否首次触发执行
427
419
  **/
428
420
 
429
- var debounce = function debounce(fn, wait, immediate) {
430
- var timeout = void 0;
421
+ var debounce = function debounce(callback, delay) {
422
+ var timeout = null;
431
423
  return function () {
432
- var self = this;
433
- var args = arguments;
434
-
435
- if (timeout) clearTimeout(timeout);
436
- // 是否在某一批事件中首次执行
437
- if (immediate) {
438
- var callNow = !timeout;
439
- timeout = setTimeout(function () {
440
- timeout = null;
441
- fn.apply(self, args);
442
- immediate = true;
443
- }, wait);
444
- if (callNow) {
445
- fn.apply(self, args);
446
- }
447
- immediate = false;
448
- } else {
449
- timeout = setTimeout(function () {
450
- fn.apply(self, args);
451
- immediate = true;
452
- }, wait);
453
- }
424
+ clearTimeout(timeout);
425
+ timeout = setTimeout(callback, delay ? delay : 500);
454
426
  };
455
427
  };
456
428
  /**
@@ -2769,7 +2741,7 @@ module.exports = require("stompjs");
2769
2741
  // ESM COMPAT FLAG
2770
2742
  __webpack_require__.r(__webpack_exports__);
2771
2743
 
2772
- // 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=60ce43f9&
2744
+ // 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=66d4b490&
2773
2745
  var render = function () {
2774
2746
  var _vm = this
2775
2747
  var _h = _vm.$createElement
@@ -2895,7 +2867,7 @@ var render = function () {
2895
2867
  : _vm._e(),
2896
2868
  _vm.reset
2897
2869
  ? _c("div", { staticClass: "es-main-box" }, [
2898
- _vm.modal !== "topnav"
2870
+ _vm.modal !== "topnav" && _vm.showSide
2899
2871
  ? _c(
2900
2872
  "div",
2901
2873
  { staticClass: "es-main-left" },
@@ -3188,10 +3160,10 @@ var staticRenderFns = []
3188
3160
  render._withStripped = true
3189
3161
 
3190
3162
 
3191
- // CONCATENATED MODULE: ./packages/main/src/main.vue?vue&type=template&id=60ce43f9&
3163
+ // CONCATENATED MODULE: ./packages/main/src/main.vue?vue&type=template&id=66d4b490&
3192
3164
 
3193
- // 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=d575fa30&
3194
- var userinfovue_type_template_id_d575fa30_render = function () {
3165
+ // 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=1965153d&
3166
+ var userinfovue_type_template_id_1965153d_render = function () {
3195
3167
  var _vm = this
3196
3168
  var _h = _vm.$createElement
3197
3169
  var _c = _vm._self._c || _h
@@ -3207,11 +3179,11 @@ var userinfovue_type_template_id_d575fa30_render = function () {
3207
3179
  2
3208
3180
  )
3209
3181
  }
3210
- var userinfovue_type_template_id_d575fa30_staticRenderFns = []
3211
- userinfovue_type_template_id_d575fa30_render._withStripped = true
3182
+ var userinfovue_type_template_id_1965153d_staticRenderFns = []
3183
+ userinfovue_type_template_id_1965153d_render._withStripped = true
3212
3184
 
3213
3185
 
3214
- // CONCATENATED MODULE: ./packages/main/src/userinfo.vue?vue&type=template&id=d575fa30&
3186
+ // CONCATENATED MODULE: ./packages/main/src/userinfo.vue?vue&type=template&id=1965153d&
3215
3187
 
3216
3188
  // EXTERNAL MODULE: ./src/config/api.js
3217
3189
  var api = __webpack_require__(1);
@@ -3285,13 +3257,14 @@ var util = __webpack_require__(0);
3285
3257
  ownId: store["a" /* default */].get('userModel').personId,
3286
3258
  onSuccess: this.handleUploadSuccess,
3287
3259
  col: 12,
3288
- inline: {
3260
+ class: 'es-flex-none',
3261
+ inline: this.qrcode ? {
3289
3262
  range: false,
3290
3263
  class: 'weixinQrcode',
3291
3264
  type: 'image',
3292
3265
  url: this.qrcode,
3293
3266
  event: this.getQrcode
3294
- }
3267
+ } : ''
3295
3268
  },
3296
3269
  // {
3297
3270
  // type: 'upload',
@@ -3325,7 +3298,7 @@ var util = __webpack_require__(0);
3325
3298
  disabled: true,
3326
3299
  col: 6
3327
3300
  }, {
3328
- name: 'idcard',
3301
+ name: 'idCard',
3329
3302
  label: '身份证号',
3330
3303
  type: 'text',
3331
3304
  disabled: true,
@@ -3611,8 +3584,8 @@ var componentNormalizer = __webpack_require__(2);
3611
3584
 
3612
3585
  var component = Object(componentNormalizer["a" /* default */])(
3613
3586
  src_userinfovue_type_script_lang_js_,
3614
- userinfovue_type_template_id_d575fa30_render,
3615
- userinfovue_type_template_id_d575fa30_staticRenderFns,
3587
+ userinfovue_type_template_id_1965153d_render,
3588
+ userinfovue_type_template_id_1965153d_staticRenderFns,
3616
3589
  false,
3617
3590
  null,
3618
3591
  null,
@@ -4976,6 +4949,7 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < argument
4976
4949
  //
4977
4950
  //
4978
4951
  //
4952
+ //
4979
4953
 
4980
4954
 
4981
4955
 
@@ -5024,6 +4998,10 @@ var log = util["a" /* default */].getParams('console');
5024
4998
  type: Boolean,
5025
4999
  default: true
5026
5000
  },
5001
+ sideNav: {
5002
+ type: Boolean,
5003
+ default: true
5004
+ },
5027
5005
  //操作栏配置
5028
5006
  handleData: Array,
5029
5007
  //本地导航
@@ -5115,6 +5093,9 @@ var log = util["a" /* default */].getParams('console');
5115
5093
  showHeader: function showHeader() {
5116
5094
  return this.isHeader == 0 ? false : this.header;
5117
5095
  },
5096
+ showSide: function showSide() {
5097
+ return this.isSide !== null ? this.isSide : this.sideNav;
5098
+ },
5118
5099
  isHomePage: function isHomePage() {
5119
5100
  if (util["a" /* default */].getParams('applicationid') || util["a" /* default */].getParams('applicationId')) {
5120
5101
  return false;
@@ -5309,7 +5290,8 @@ var log = util["a" /* default */].getParams('console');
5309
5290
  routerKey: '',
5310
5291
  defaultwjprops: {},
5311
5292
  isTabs: false,
5312
- isHeader: ''
5293
+ isHeader: '',
5294
+ isSide: null
5313
5295
  };
5314
5296
  },
5315
5297
  created: function created() {
@@ -5980,6 +5962,7 @@ var log = util["a" /* default */].getParams('console');
5980
5962
  this.menu = node.children;
5981
5963
  this.title = node.text;
5982
5964
  this.active = this.getFirst(node.children[0]);
5965
+ this.isSide = true;
5983
5966
  break;
5984
5967
  case 'sub':
5985
5968
  if (node.url) {
package/lib/mainComp.js CHANGED
@@ -125,6 +125,7 @@ var $brightnessStep2 = 0.15;
125
125
  var $lightColorCount = 5;
126
126
  var $darkColorCount = 4;
127
127
  var publicKey = 'abcdefghijklmnopqrstuvwxyz12345678';
128
+ var loginMsg = void 0;
128
129
 
129
130
  var JSONbigToString = json_bigint__WEBPACK_IMPORTED_MODULE_3___default()({ storeAsString: true });
130
131
 
@@ -146,7 +147,6 @@ var JSONbigToString = json_bigint__WEBPACK_IMPORTED_MODULE_3___default()({ store
146
147
  * @param {Object} [loading] - loading加载对象
147
148
  **/
148
149
  // 请求
149
- var _timer = null;
150
150
  var pendingRequest = new Map();
151
151
  function getRequestKey(config) {
152
152
  var method = config.method,
@@ -245,44 +245,36 @@ var ajax = function ajax(_ref) {
245
245
  if (response.status === 200) {
246
246
  if (response.data.rCode === 64 || response.data.rCode === 65 || response.data.rCode === 67 || response.data.rCode === 69) {
247
247
  removeStorage(['Authorization', 'token', 'ssId', 'userId', 'userName', 'deviceUnique', 'menus', 'menus', 'useCaseCodes', 'mainConfig']);
248
-
249
- var timer = getStorage('timer') || 0;
250
- timer = parseInt(timer, 10);
251
- if (win.top.location.href.indexOf('#/login') === -1 && win.top.location.href.indexOf('/login.html') === -1 && !timer) {
252
- sessionStorage.setItem('timer', 1);
253
- eoss_element__WEBPACK_IMPORTED_MODULE_4__["MessageBox"].confirm(response.data.rCode === 69 ? '该账号在其他地方已登陆!' : '登录已过期,请重新登录!', '提示', response.data.rCode === 69 ? {
254
- confirmButtonText: '确定',
255
- closeOnClickModal: false,
256
- type: 'warning'
257
- } : {
258
- confirmButtonText: '确定',
259
- cancelButtonText: '取消',
260
- closeOnClickModal: false,
261
- type: 'warning'
262
- }).then(function () {
263
- var loginPage = getStorage('login') || getStorage('loginPage');
264
- if (loginPage) {
265
- win.top.location.href = loginPage;
266
- } else if (win.top.location.href.indexOf('main.html') > -1) {
267
- win.top.location.href = './login.html';
268
- } else {
269
- var hash = win.top.location.hash;
270
- if (hash || win.top.location.indexOf('model=') && win.top.location.indexOf('view=') && win.top.location.indexOf('render.html')) {
271
- var len = win.top.location.href.indexOf(hash);
272
- var href = win.top.location.href.slice(0, len) + '#/login';
273
- win.top.location.href = href;
248
+ if (win.top.location.href.indexOf('#/login') === -1 && win.top.location.href.indexOf('/login.html') === -1) {
249
+ clearTimeout(loginMsg);
250
+ loginMsg = setTimeout(function () {
251
+ eoss_element__WEBPACK_IMPORTED_MODULE_4__["MessageBox"].confirm(response.data.rCode === 69 ? '该账号在其他地方已登陆!' : '登录已过期,请重新登录!', '提示', response.data.rCode === 69 ? {
252
+ confirmButtonText: '确定',
253
+ closeOnClickModal: false,
254
+ type: 'warning'
255
+ } : {
256
+ confirmButtonText: '确定',
257
+ cancelButtonText: '取消',
258
+ closeOnClickModal: false,
259
+ type: 'warning'
260
+ }).then(function () {
261
+ var loginPage = getStorage('login') || getStorage('loginPage');
262
+ if (loginPage) {
263
+ win.top.location.href = loginPage;
264
+ } else if (win.top.location.href.indexOf('main.html') > -1) {
265
+ win.top.location.href = './login.html';
274
266
  } else {
275
- win.top.location.href = '/login.html';
267
+ var hash = win.top.location.hash;
268
+ if (hash || win.top.location.indexOf('model=') && win.top.location.indexOf('view=') && win.top.location.indexOf('render.html')) {
269
+ var len = win.top.location.href.indexOf(hash);
270
+ var href = win.top.location.href.slice(0, len) + '#/login';
271
+ win.top.location.href = href;
272
+ } else {
273
+ win.top.location.href = '/login.html';
274
+ }
276
275
  }
277
- }
278
- }).catch(function (e) {
279
- _timer && clearTimeout(_timer);
280
- _timer = setTimeout(function () {
281
- removeStorage('timer');
282
- clearTimeout(_timer);
283
- _timer = null;
284
- }, 1000);
285
- });
276
+ }).catch(function (e) {});
277
+ }, 1000);
286
278
  }
287
279
  return Promise.reject(response.data);
288
280
  } else {
@@ -426,31 +418,11 @@ var browser = function browser() {
426
418
  * @param {Boolean} [immediate] - 是否首次触发执行
427
419
  **/
428
420
 
429
- var debounce = function debounce(fn, wait, immediate) {
430
- var timeout = void 0;
421
+ var debounce = function debounce(callback, delay) {
422
+ var timeout = null;
431
423
  return function () {
432
- var self = this;
433
- var args = arguments;
434
-
435
- if (timeout) clearTimeout(timeout);
436
- // 是否在某一批事件中首次执行
437
- if (immediate) {
438
- var callNow = !timeout;
439
- timeout = setTimeout(function () {
440
- timeout = null;
441
- fn.apply(self, args);
442
- immediate = true;
443
- }, wait);
444
- if (callNow) {
445
- fn.apply(self, args);
446
- }
447
- immediate = false;
448
- } else {
449
- timeout = setTimeout(function () {
450
- fn.apply(self, args);
451
- immediate = true;
452
- }, wait);
453
- }
424
+ clearTimeout(timeout);
425
+ timeout = setTimeout(callback, delay ? delay : 500);
454
426
  };
455
427
  };
456
428
  /**
@@ -2770,7 +2742,7 @@ module.exports = require("stompjs");
2770
2742
  // ESM COMPAT FLAG
2771
2743
  __webpack_require__.r(__webpack_exports__);
2772
2744
 
2773
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/mainComp/src/main.vue?vue&type=template&id=1b76299b&
2745
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/mainComp/src/main.vue?vue&type=template&id=2ca6e522&
2774
2746
  var render = function () {
2775
2747
  var _vm = this
2776
2748
  var _h = _vm.$createElement
@@ -3184,7 +3156,7 @@ var staticRenderFns = []
3184
3156
  render._withStripped = true
3185
3157
 
3186
3158
 
3187
- // CONCATENATED MODULE: ./packages/mainComp/src/main.vue?vue&type=template&id=1b76299b&
3159
+ // CONCATENATED MODULE: ./packages/mainComp/src/main.vue?vue&type=template&id=2ca6e522&
3188
3160
 
3189
3161
  // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/mainComp/src/userinfo.vue?vue&type=template&id=5902ef8f&
3190
3162
  var userinfovue_type_template_id_5902ef8f_render = function () {
@@ -6494,11 +6466,7 @@ var isIE = navigator.userAgent.indexOf('MSIE') != -1;
6494
6466
  });
6495
6467
  }, function (error) {
6496
6468
  console.log('webSocket连接失败');
6497
- if (_this11.connect < 10 && !util["a" /* default */].getStorage('timer')) {
6498
- _this11.handleConnect(client);
6499
- } else {
6500
- client.disconnect();
6501
- }
6469
+ client.disconnect();
6502
6470
  });
6503
6471
  },
6504
6472
  handleOpened: function handleOpened(res) {
package/lib/nav.js CHANGED
@@ -126,6 +126,7 @@ var $brightnessStep2 = 0.15;
126
126
  var $lightColorCount = 5;
127
127
  var $darkColorCount = 4;
128
128
  var publicKey = 'abcdefghijklmnopqrstuvwxyz12345678';
129
+ var loginMsg = void 0;
129
130
 
130
131
  var JSONbigToString = json_bigint__WEBPACK_IMPORTED_MODULE_3___default()({ storeAsString: true });
131
132
 
@@ -147,7 +148,6 @@ var JSONbigToString = json_bigint__WEBPACK_IMPORTED_MODULE_3___default()({ store
147
148
  * @param {Object} [loading] - loading加载对象
148
149
  **/
149
150
  // 请求
150
- var _timer = null;
151
151
  var pendingRequest = new Map();
152
152
  function getRequestKey(config) {
153
153
  var method = config.method,
@@ -246,44 +246,36 @@ var ajax = function ajax(_ref) {
246
246
  if (response.status === 200) {
247
247
  if (response.data.rCode === 64 || response.data.rCode === 65 || response.data.rCode === 67 || response.data.rCode === 69) {
248
248
  removeStorage(['Authorization', 'token', 'ssId', 'userId', 'userName', 'deviceUnique', 'menus', 'menus', 'useCaseCodes', 'mainConfig']);
249
-
250
- var timer = getStorage('timer') || 0;
251
- timer = parseInt(timer, 10);
252
- if (win.top.location.href.indexOf('#/login') === -1 && win.top.location.href.indexOf('/login.html') === -1 && !timer) {
253
- sessionStorage.setItem('timer', 1);
254
- eoss_element__WEBPACK_IMPORTED_MODULE_4__["MessageBox"].confirm(response.data.rCode === 69 ? '该账号在其他地方已登陆!' : '登录已过期,请重新登录!', '提示', response.data.rCode === 69 ? {
255
- confirmButtonText: '确定',
256
- closeOnClickModal: false,
257
- type: 'warning'
258
- } : {
259
- confirmButtonText: '确定',
260
- cancelButtonText: '取消',
261
- closeOnClickModal: false,
262
- type: 'warning'
263
- }).then(function () {
264
- var loginPage = getStorage('login') || getStorage('loginPage');
265
- if (loginPage) {
266
- win.top.location.href = loginPage;
267
- } else if (win.top.location.href.indexOf('main.html') > -1) {
268
- win.top.location.href = './login.html';
269
- } else {
270
- var hash = win.top.location.hash;
271
- if (hash || win.top.location.indexOf('model=') && win.top.location.indexOf('view=') && win.top.location.indexOf('render.html')) {
272
- var len = win.top.location.href.indexOf(hash);
273
- var href = win.top.location.href.slice(0, len) + '#/login';
274
- win.top.location.href = href;
249
+ if (win.top.location.href.indexOf('#/login') === -1 && win.top.location.href.indexOf('/login.html') === -1) {
250
+ clearTimeout(loginMsg);
251
+ loginMsg = setTimeout(function () {
252
+ eoss_element__WEBPACK_IMPORTED_MODULE_4__["MessageBox"].confirm(response.data.rCode === 69 ? '该账号在其他地方已登陆!' : '登录已过期,请重新登录!', '提示', response.data.rCode === 69 ? {
253
+ confirmButtonText: '确定',
254
+ closeOnClickModal: false,
255
+ type: 'warning'
256
+ } : {
257
+ confirmButtonText: '确定',
258
+ cancelButtonText: '取消',
259
+ closeOnClickModal: false,
260
+ type: 'warning'
261
+ }).then(function () {
262
+ var loginPage = getStorage('login') || getStorage('loginPage');
263
+ if (loginPage) {
264
+ win.top.location.href = loginPage;
265
+ } else if (win.top.location.href.indexOf('main.html') > -1) {
266
+ win.top.location.href = './login.html';
275
267
  } else {
276
- win.top.location.href = '/login.html';
268
+ var hash = win.top.location.hash;
269
+ if (hash || win.top.location.indexOf('model=') && win.top.location.indexOf('view=') && win.top.location.indexOf('render.html')) {
270
+ var len = win.top.location.href.indexOf(hash);
271
+ var href = win.top.location.href.slice(0, len) + '#/login';
272
+ win.top.location.href = href;
273
+ } else {
274
+ win.top.location.href = '/login.html';
275
+ }
277
276
  }
278
- }
279
- }).catch(function (e) {
280
- _timer && clearTimeout(_timer);
281
- _timer = setTimeout(function () {
282
- removeStorage('timer');
283
- clearTimeout(_timer);
284
- _timer = null;
285
- }, 1000);
286
- });
277
+ }).catch(function (e) {});
278
+ }, 1000);
287
279
  }
288
280
  return Promise.reject(response.data);
289
281
  } else {
@@ -427,31 +419,11 @@ var browser = function browser() {
427
419
  * @param {Boolean} [immediate] - 是否首次触发执行
428
420
  **/
429
421
 
430
- var debounce = function debounce(fn, wait, immediate) {
431
- var timeout = void 0;
422
+ var debounce = function debounce(callback, delay) {
423
+ var timeout = null;
432
424
  return function () {
433
- var self = this;
434
- var args = arguments;
435
-
436
- if (timeout) clearTimeout(timeout);
437
- // 是否在某一批事件中首次执行
438
- if (immediate) {
439
- var callNow = !timeout;
440
- timeout = setTimeout(function () {
441
- timeout = null;
442
- fn.apply(self, args);
443
- immediate = true;
444
- }, wait);
445
- if (callNow) {
446
- fn.apply(self, args);
447
- }
448
- immediate = false;
449
- } else {
450
- timeout = setTimeout(function () {
451
- fn.apply(self, args);
452
- immediate = true;
453
- }, wait);
454
- }
425
+ clearTimeout(timeout);
426
+ timeout = setTimeout(callback, delay ? delay : 500);
455
427
  };
456
428
  };
457
429
  /**
package/lib/page.js CHANGED
@@ -126,6 +126,7 @@ var $brightnessStep2 = 0.15;
126
126
  var $lightColorCount = 5;
127
127
  var $darkColorCount = 4;
128
128
  var publicKey = 'abcdefghijklmnopqrstuvwxyz12345678';
129
+ var loginMsg = void 0;
129
130
 
130
131
  var JSONbigToString = json_bigint__WEBPACK_IMPORTED_MODULE_3___default()({ storeAsString: true });
131
132
 
@@ -147,7 +148,6 @@ var JSONbigToString = json_bigint__WEBPACK_IMPORTED_MODULE_3___default()({ store
147
148
  * @param {Object} [loading] - loading加载对象
148
149
  **/
149
150
  // 请求
150
- var _timer = null;
151
151
  var pendingRequest = new Map();
152
152
  function getRequestKey(config) {
153
153
  var method = config.method,
@@ -246,44 +246,36 @@ var ajax = function ajax(_ref) {
246
246
  if (response.status === 200) {
247
247
  if (response.data.rCode === 64 || response.data.rCode === 65 || response.data.rCode === 67 || response.data.rCode === 69) {
248
248
  removeStorage(['Authorization', 'token', 'ssId', 'userId', 'userName', 'deviceUnique', 'menus', 'menus', 'useCaseCodes', 'mainConfig']);
249
-
250
- var timer = getStorage('timer') || 0;
251
- timer = parseInt(timer, 10);
252
- if (win.top.location.href.indexOf('#/login') === -1 && win.top.location.href.indexOf('/login.html') === -1 && !timer) {
253
- sessionStorage.setItem('timer', 1);
254
- eoss_element__WEBPACK_IMPORTED_MODULE_4__["MessageBox"].confirm(response.data.rCode === 69 ? '该账号在其他地方已登陆!' : '登录已过期,请重新登录!', '提示', response.data.rCode === 69 ? {
255
- confirmButtonText: '确定',
256
- closeOnClickModal: false,
257
- type: 'warning'
258
- } : {
259
- confirmButtonText: '确定',
260
- cancelButtonText: '取消',
261
- closeOnClickModal: false,
262
- type: 'warning'
263
- }).then(function () {
264
- var loginPage = getStorage('login') || getStorage('loginPage');
265
- if (loginPage) {
266
- win.top.location.href = loginPage;
267
- } else if (win.top.location.href.indexOf('main.html') > -1) {
268
- win.top.location.href = './login.html';
269
- } else {
270
- var hash = win.top.location.hash;
271
- if (hash || win.top.location.indexOf('model=') && win.top.location.indexOf('view=') && win.top.location.indexOf('render.html')) {
272
- var len = win.top.location.href.indexOf(hash);
273
- var href = win.top.location.href.slice(0, len) + '#/login';
274
- win.top.location.href = href;
249
+ if (win.top.location.href.indexOf('#/login') === -1 && win.top.location.href.indexOf('/login.html') === -1) {
250
+ clearTimeout(loginMsg);
251
+ loginMsg = setTimeout(function () {
252
+ eoss_element__WEBPACK_IMPORTED_MODULE_4__["MessageBox"].confirm(response.data.rCode === 69 ? '该账号在其他地方已登陆!' : '登录已过期,请重新登录!', '提示', response.data.rCode === 69 ? {
253
+ confirmButtonText: '确定',
254
+ closeOnClickModal: false,
255
+ type: 'warning'
256
+ } : {
257
+ confirmButtonText: '确定',
258
+ cancelButtonText: '取消',
259
+ closeOnClickModal: false,
260
+ type: 'warning'
261
+ }).then(function () {
262
+ var loginPage = getStorage('login') || getStorage('loginPage');
263
+ if (loginPage) {
264
+ win.top.location.href = loginPage;
265
+ } else if (win.top.location.href.indexOf('main.html') > -1) {
266
+ win.top.location.href = './login.html';
275
267
  } else {
276
- win.top.location.href = '/login.html';
268
+ var hash = win.top.location.hash;
269
+ if (hash || win.top.location.indexOf('model=') && win.top.location.indexOf('view=') && win.top.location.indexOf('render.html')) {
270
+ var len = win.top.location.href.indexOf(hash);
271
+ var href = win.top.location.href.slice(0, len) + '#/login';
272
+ win.top.location.href = href;
273
+ } else {
274
+ win.top.location.href = '/login.html';
275
+ }
277
276
  }
278
- }
279
- }).catch(function (e) {
280
- _timer && clearTimeout(_timer);
281
- _timer = setTimeout(function () {
282
- removeStorage('timer');
283
- clearTimeout(_timer);
284
- _timer = null;
285
- }, 1000);
286
- });
277
+ }).catch(function (e) {});
278
+ }, 1000);
287
279
  }
288
280
  return Promise.reject(response.data);
289
281
  } else {
@@ -427,31 +419,11 @@ var browser = function browser() {
427
419
  * @param {Boolean} [immediate] - 是否首次触发执行
428
420
  **/
429
421
 
430
- var debounce = function debounce(fn, wait, immediate) {
431
- var timeout = void 0;
422
+ var debounce = function debounce(callback, delay) {
423
+ var timeout = null;
432
424
  return function () {
433
- var self = this;
434
- var args = arguments;
435
-
436
- if (timeout) clearTimeout(timeout);
437
- // 是否在某一批事件中首次执行
438
- if (immediate) {
439
- var callNow = !timeout;
440
- timeout = setTimeout(function () {
441
- timeout = null;
442
- fn.apply(self, args);
443
- immediate = true;
444
- }, wait);
445
- if (callNow) {
446
- fn.apply(self, args);
447
- }
448
- immediate = false;
449
- } else {
450
- timeout = setTimeout(function () {
451
- fn.apply(self, args);
452
- immediate = true;
453
- }, wait);
454
- }
425
+ clearTimeout(timeout);
426
+ timeout = setTimeout(callback, delay ? delay : 500);
455
427
  };
456
428
  };
457
429
  /**