eoss-ui 0.4.10 → 0.4.15

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 (67) hide show
  1. package/lib/button-group.js +110 -15
  2. package/lib/button.js +112 -17
  3. package/lib/ca-login.js +326 -0
  4. package/lib/card.js +2 -2
  5. package/lib/cascader.js +2 -2
  6. package/lib/checkbox-group.js +110 -15
  7. package/lib/clients.js +2 -2
  8. package/lib/data-table-form.js +110 -15
  9. package/lib/data-table.js +148 -35
  10. package/lib/date-picker.js +112 -17
  11. package/lib/dialog.js +113 -17
  12. package/lib/enterprise.js +2 -2
  13. package/lib/eoss-ui.common.js +289 -53
  14. package/lib/error-page.js +2 -2
  15. package/lib/flow-group.js +112 -17
  16. package/lib/flow-list.js +110 -15
  17. package/lib/flow.js +110 -15
  18. package/lib/form.js +124 -26
  19. package/lib/handle-user.js +112 -17
  20. package/lib/handler.js +112 -17
  21. package/lib/index.js +1 -1
  22. package/lib/input-number.js +112 -17
  23. package/lib/input.js +112 -17
  24. package/lib/label.js +2 -2
  25. package/lib/login.js +110 -15
  26. package/lib/main.js +110 -15
  27. package/lib/mainComp.js +110 -15
  28. package/lib/menu.js +2 -2
  29. package/lib/nav.js +112 -17
  30. package/lib/notify.js +2 -2
  31. package/lib/page.js +112 -17
  32. package/lib/pagination.js +2 -2
  33. package/lib/player.js +112 -17
  34. package/lib/qr-code.js +119 -24
  35. package/lib/radio-group.js +112 -17
  36. package/lib/select-ganged.js +112 -17
  37. package/lib/select.js +119 -24
  38. package/lib/selector-panel.js +110 -15
  39. package/lib/selector.js +112 -17
  40. package/lib/sizer.js +112 -17
  41. package/lib/steps.js +112 -17
  42. package/lib/switch.js +112 -17
  43. package/lib/table-form.js +119 -24
  44. package/lib/tabs-panel.js +2 -2
  45. package/lib/tabs.js +112 -17
  46. package/lib/theme-chalk/ca-login.css +1 -0
  47. package/lib/theme-chalk/index.css +1 -1
  48. package/lib/tips.js +112 -17
  49. package/lib/toolbar.js +2 -2
  50. package/lib/tree-group.js +112 -17
  51. package/lib/tree.js +112 -17
  52. package/lib/upload.js +110 -15
  53. package/lib/utils/util.js +110 -15
  54. package/lib/wujie.js +112 -17
  55. package/lib/wxlogin.js +112 -17
  56. package/package.json +4 -4
  57. package/packages/ca-login/index.js +5 -0
  58. package/packages/ca-login/src/main.vue +62 -0
  59. package/packages/data-table/src/column.vue +20 -7
  60. package/packages/data-table/src/main.vue +2 -1
  61. package/packages/form/src/main.vue +17 -7
  62. package/packages/theme-chalk/lib/ca-login.css +1 -0
  63. package/packages/theme-chalk/lib/index.css +1 -1
  64. package/packages/theme-chalk/src/ca-login.scss +4 -0
  65. package/packages/theme-chalk/src/index.scss +1 -0
  66. package/src/index.js +4 -1
  67. package/src/utils/util.js +122 -37
package/lib/form.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 = 40);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 41);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -534,7 +534,7 @@ var esEncode = function esEncode(value) {
534
534
  **/
535
535
  var esDecode = function esDecode(value) {
536
536
  var kleng = publicKey.length;
537
- var result;
537
+ var result = void 0;
538
538
  var cat1 = void 0;
539
539
  var cat2 = void 0;
540
540
  var cat3 = void 0;
@@ -639,11 +639,13 @@ var exportXls = function exportXls(_ref6) {
639
639
  _ref6$data = _ref6.data,
640
640
  data = _ref6$data === undefined ? [] : _ref6$data,
641
641
  name = _ref6.name,
642
- numbers = _ref6.numbers;
642
+ numbers = _ref6.numbers,
643
+ option = _ref6.option;
643
644
 
644
645
  var tbody = '';
645
646
  var aligns = [];
646
647
  var fields = [];
648
+ var keys = {};
647
649
  var others = {};
648
650
  var alink = document.createElement('a');
649
651
  for (var i = 0; i < thead.length; i++) {
@@ -653,12 +655,15 @@ var exportXls = function exportXls(_ref6) {
653
655
  }
654
656
  var tr = thead[i];
655
657
  var col = 0;
656
- for (var _x = 0; _x < tr.length; _x++) {
657
- var td = tr[_x];
658
+ for (var x = 0; x < tr.length; x++) {
659
+ var td = tr[x];
658
660
  if (td.property) {
659
- if (col === _x) {
661
+ if (col === x) {
660
662
  fields.push(td.property);
661
663
  aligns.push(td.align);
664
+ if (td.labelKey && td.valueKey) {
665
+ keys[td.property] = { labelKey: td.labelKey, valueKey: td.valueKey, multiple: !!(td.valueToString || td['value-to-string']) };
666
+ }
662
667
  } else {
663
668
  others[String(col)] = [td.property, td.align];
664
669
  }
@@ -676,12 +681,72 @@ var exportXls = function exportXls(_ref6) {
676
681
  fields.splice(_i2, 0, others[_i2][0]);
677
682
  aligns.splice(_i2, 0, others[_i2][1]);
678
683
  }
679
- for (var _i3 = 0; _i3 < data.length; _i3++) {
684
+
685
+ var _loop = function _loop(_i3) {
680
686
  tbody += '<tr>';
681
- for (var x in fields) {
682
- tbody += '<td align="' + aligns[x] + '">' + data[_i3][fields[x]] + '</td>';
687
+
688
+ var _loop2 = function _loop2(_x) {
689
+ var field = '';
690
+ var valueKey = keys[fields[_x]] && keys[fields[_x]].valueKey ? keys[fields[_x]].valueKey : 'value';
691
+ var labelKey = keys[fields[_x]] && keys[fields[_x]].labelKey ? keys[fields[_x]].labelKey : 'name';
692
+ if (option[fields[_x]]) {
693
+ if (Array.isArray(data[_i3][fields[_x]])) {
694
+ field = [];
695
+ data[_i3][fields[_x]].forEach(function (ele) {
696
+ option[fields[_x]].forEach(function (item) {
697
+ // eslint-disable-next-line eqeqeq
698
+ if (item[valueKey] == ele) {
699
+ field.push(item[labelKey]);
700
+ return;
701
+ }
702
+ });
703
+ });
704
+ field = field.join(' ');
705
+ } else if (typeof data[_i3][fields[_x]] === 'string' && keys[fields[_x]] && keys[fields[_x]].multiple) {
706
+ field = [];
707
+ data[_i3][fields[_x]].split(',').forEach(function (ele) {
708
+ option[fields[_x]].forEach(function (item) {
709
+ // eslint-disable-next-line eqeqeq
710
+ if (item[valueKey] == ele) {
711
+ field.push(item[labelKey]);
712
+ return;
713
+ }
714
+ });
715
+ });
716
+ field = field.join(' ');
717
+ } else {
718
+ option[fields[_x]].forEach(function (item) {
719
+ // eslint-disable-next-line eqeqeq
720
+ if (item[valueKey] == data[_i3][fields[_x]]) {
721
+ field = item[labelKey];
722
+ return;
723
+ }
724
+ });
725
+ }
726
+ } else if (_typeof(data[_i3][fields[_x]]) === 'object' && keys[fields[_x]]) {
727
+ if (Array.isArray(data[_i3][fields[_x]])) {
728
+ data[_i3][fields[_x]].forEach(function (item) {
729
+ field = [];
730
+ field.push({}.toString.call(item) === '[object Object]' ? item[labelKey] : item);
731
+ });
732
+ field = field.join(' ');
733
+ } else {
734
+ field = data[_i3][fields[_x]][labelKey];
735
+ }
736
+ } else {
737
+ field = data[_i3][fields[_x]];
738
+ }
739
+ tbody += '<td align="' + aligns[_x] + '">' + field + '</td>';
740
+ };
741
+
742
+ for (var _x in fields) {
743
+ _loop2(_x);
683
744
  }
684
745
  tbody += '</tr>';
746
+ };
747
+
748
+ for (var _i3 = 0; _i3 < data.length; _i3++) {
749
+ _loop(_i3);
685
750
  }
686
751
  if (!name) {
687
752
  name = 'table_' + new Date().getTime();
@@ -1402,8 +1467,21 @@ var isLogged = function isLogged(_ref8) {
1402
1467
  next();
1403
1468
  } else {
1404
1469
  var token = getStorage('token') || getStorage('Authorization');
1405
- if (Object.prototype.hasOwnProperty.call(to.query, 'serverId') && Object.prototype.hasOwnProperty.call(to.query, 'authType')) {
1470
+ if (!token && Object.prototype.hasOwnProperty.call(to.query, 'serverId') && Object.prototype.hasOwnProperty.call(to.query, 'authType')) {
1406
1471
  var url = win.top.location.href;
1472
+ if (to.query.openType) {
1473
+ switch (to.query.openType) {
1474
+ case 'self':
1475
+ url = win.location.href;
1476
+ break;
1477
+ case 'blank':
1478
+ url = win.location.href;
1479
+ break;
1480
+ case 'parent':
1481
+ url = win.parent.location.href;
1482
+ break;
1483
+ }
1484
+ }
1407
1485
  ajax({
1408
1486
  method: 'post',
1409
1487
  url: _config_api__WEBPACK_IMPORTED_MODULE_0__[/* authCenter */ "b"],
@@ -1430,10 +1508,27 @@ var isLogged = function isLogged(_ref8) {
1430
1508
  break;
1431
1509
  case 3:
1432
1510
  var href = res.results.authorizeUrl.replace('{redirectUri}', encodeURIComponent(url));
1433
- if (open) {
1434
- win.open(href);
1511
+ if (to.query.openType) {
1512
+ switch (to.query.openType) {
1513
+ case 'self':
1514
+ win.location.href = href;
1515
+ break;
1516
+ case 'blank':
1517
+ win.open(href);
1518
+ break;
1519
+ case 'top':
1520
+ win.top.location.href = href;
1521
+ break;
1522
+ case 'parent':
1523
+ win.parent.location.href = href;
1524
+ break;
1525
+ }
1435
1526
  } else {
1436
- win.top.location.href = href;
1527
+ if (open) {
1528
+ win.open(href);
1529
+ } else {
1530
+ win.top.location.href = href;
1531
+ }
1437
1532
  }
1438
1533
  break;
1439
1534
  }
@@ -1445,9 +1540,9 @@ var isLogged = function isLogged(_ref8) {
1445
1540
  }
1446
1541
  }
1447
1542
  }).catch(function (e) {});
1448
- } else if (token || to.path === '/' || to.path === '/login' || to.path === '/404' || exclude.indexOf(to.path) > -1 || exclude.indexOf(to.name) > -1) {
1449
- if (redirect && to.name && (to.name === 'login' || to.name === 'main')) {
1450
- window.location.replace(urlJoinParams({ url: './' + to.name + '.html', param: to.query }));
1543
+ } else if (token || to.path === '/' || to.path === '/404' || exclude.indexOf(to.path) > -1 || exclude.indexOf(to.name) > -1 || to.path === '/login' || token && to.path === '/main') {
1544
+ if (redirect && (to.path === '/main' || to.path === '/login')) {
1545
+ window.location.replace(urlJoinParams({ url: '.' + to.path + '.html', param: to.query }));
1451
1546
  } else {
1452
1547
  next();
1453
1548
  }
@@ -2612,14 +2707,14 @@ module.exports = require("axios");
2612
2707
 
2613
2708
  /***/ }),
2614
2709
 
2615
- /***/ 40:
2710
+ /***/ 41:
2616
2711
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
2617
2712
 
2618
2713
  "use strict";
2619
2714
  // ESM COMPAT FLAG
2620
2715
  __webpack_require__.r(__webpack_exports__);
2621
2716
 
2622
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/form/src/main.vue?vue&type=template&id=7542ec09&
2717
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/form/src/main.vue?vue&type=template&id=79406044&
2623
2718
  var render = function () {
2624
2719
  var _vm = this
2625
2720
  var _h = _vm.$createElement
@@ -11168,7 +11263,7 @@ var staticRenderFns = []
11168
11263
  render._withStripped = true
11169
11264
 
11170
11265
 
11171
- // CONCATENATED MODULE: ./packages/form/src/main.vue?vue&type=template&id=7542ec09&
11266
+ // CONCATENATED MODULE: ./packages/form/src/main.vue?vue&type=template&id=79406044&
11172
11267
 
11173
11268
  // EXTERNAL MODULE: external "babel-runtime/regenerator"
11174
11269
  var regenerator_ = __webpack_require__(9);
@@ -14517,10 +14612,7 @@ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, a
14517
14612
  },
14518
14613
  props: {
14519
14614
  model: {
14520
- type: [Object, String],
14521
- default: function _default() {
14522
- return {};
14523
- }
14615
+ type: [Object, String]
14524
14616
  },
14525
14617
  steps: Object,
14526
14618
  param: {
@@ -14672,6 +14764,14 @@ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, a
14672
14764
  models: {
14673
14765
  get: function get() {
14674
14766
  if (this.model && typeof this.model !== 'string') {
14767
+ if (this.autoId && !this.businessId) {
14768
+ if (this.model[typeof this.autoId === 'string' ? this.autoId : 'id']) {
14769
+ this.$emit('update:businessId', this.model[typeof this.autoId === 'string' ? this.autoId : 'id']);
14770
+ } else {
14771
+ this.$emit('update:businessId', this.uuid);
14772
+ this.$emit('getId', this.uuid);
14773
+ }
14774
+ }
14675
14775
  return this.model;
14676
14776
  }
14677
14777
  return this.values;
@@ -14683,14 +14783,12 @@ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, a
14683
14783
  _value: function _value() {
14684
14784
  var data = {};
14685
14785
  if (this.businessId !== undefined) {
14686
- data = { id: this.businessId };
14786
+ data[typeof this.autoId === 'string' ? this.autoId : 'id'] = this.businessId;
14687
14787
  } else if (typeof this.model !== 'string' && this.autoId) {
14688
14788
  if (typeof this.autoId === 'boolean' && !this.model.id) {
14689
14789
  data = { id: this.uuid };
14690
- this.$emit('update:businessId', this.uuid);
14691
14790
  } else if (!this.model[this.autoId]) {
14692
14791
  data[this.autoId] = this.uuid;
14693
- this.$emit('update:businessId', this.uuid);
14694
14792
  }
14695
14793
  }
14696
14794
  return util["a" /* default */].extend({}, data, this.value);
@@ -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 = 42);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 43);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -534,7 +534,7 @@ var esEncode = function esEncode(value) {
534
534
  **/
535
535
  var esDecode = function esDecode(value) {
536
536
  var kleng = publicKey.length;
537
- var result;
537
+ var result = void 0;
538
538
  var cat1 = void 0;
539
539
  var cat2 = void 0;
540
540
  var cat3 = void 0;
@@ -639,11 +639,13 @@ var exportXls = function exportXls(_ref6) {
639
639
  _ref6$data = _ref6.data,
640
640
  data = _ref6$data === undefined ? [] : _ref6$data,
641
641
  name = _ref6.name,
642
- numbers = _ref6.numbers;
642
+ numbers = _ref6.numbers,
643
+ option = _ref6.option;
643
644
 
644
645
  var tbody = '';
645
646
  var aligns = [];
646
647
  var fields = [];
648
+ var keys = {};
647
649
  var others = {};
648
650
  var alink = document.createElement('a');
649
651
  for (var i = 0; i < thead.length; i++) {
@@ -653,12 +655,15 @@ var exportXls = function exportXls(_ref6) {
653
655
  }
654
656
  var tr = thead[i];
655
657
  var col = 0;
656
- for (var _x = 0; _x < tr.length; _x++) {
657
- var td = tr[_x];
658
+ for (var x = 0; x < tr.length; x++) {
659
+ var td = tr[x];
658
660
  if (td.property) {
659
- if (col === _x) {
661
+ if (col === x) {
660
662
  fields.push(td.property);
661
663
  aligns.push(td.align);
664
+ if (td.labelKey && td.valueKey) {
665
+ keys[td.property] = { labelKey: td.labelKey, valueKey: td.valueKey, multiple: !!(td.valueToString || td['value-to-string']) };
666
+ }
662
667
  } else {
663
668
  others[String(col)] = [td.property, td.align];
664
669
  }
@@ -676,12 +681,72 @@ var exportXls = function exportXls(_ref6) {
676
681
  fields.splice(_i2, 0, others[_i2][0]);
677
682
  aligns.splice(_i2, 0, others[_i2][1]);
678
683
  }
679
- for (var _i3 = 0; _i3 < data.length; _i3++) {
684
+
685
+ var _loop = function _loop(_i3) {
680
686
  tbody += '<tr>';
681
- for (var x in fields) {
682
- tbody += '<td align="' + aligns[x] + '">' + data[_i3][fields[x]] + '</td>';
687
+
688
+ var _loop2 = function _loop2(_x) {
689
+ var field = '';
690
+ var valueKey = keys[fields[_x]] && keys[fields[_x]].valueKey ? keys[fields[_x]].valueKey : 'value';
691
+ var labelKey = keys[fields[_x]] && keys[fields[_x]].labelKey ? keys[fields[_x]].labelKey : 'name';
692
+ if (option[fields[_x]]) {
693
+ if (Array.isArray(data[_i3][fields[_x]])) {
694
+ field = [];
695
+ data[_i3][fields[_x]].forEach(function (ele) {
696
+ option[fields[_x]].forEach(function (item) {
697
+ // eslint-disable-next-line eqeqeq
698
+ if (item[valueKey] == ele) {
699
+ field.push(item[labelKey]);
700
+ return;
701
+ }
702
+ });
703
+ });
704
+ field = field.join(' ');
705
+ } else if (typeof data[_i3][fields[_x]] === 'string' && keys[fields[_x]] && keys[fields[_x]].multiple) {
706
+ field = [];
707
+ data[_i3][fields[_x]].split(',').forEach(function (ele) {
708
+ option[fields[_x]].forEach(function (item) {
709
+ // eslint-disable-next-line eqeqeq
710
+ if (item[valueKey] == ele) {
711
+ field.push(item[labelKey]);
712
+ return;
713
+ }
714
+ });
715
+ });
716
+ field = field.join(' ');
717
+ } else {
718
+ option[fields[_x]].forEach(function (item) {
719
+ // eslint-disable-next-line eqeqeq
720
+ if (item[valueKey] == data[_i3][fields[_x]]) {
721
+ field = item[labelKey];
722
+ return;
723
+ }
724
+ });
725
+ }
726
+ } else if (_typeof(data[_i3][fields[_x]]) === 'object' && keys[fields[_x]]) {
727
+ if (Array.isArray(data[_i3][fields[_x]])) {
728
+ data[_i3][fields[_x]].forEach(function (item) {
729
+ field = [];
730
+ field.push({}.toString.call(item) === '[object Object]' ? item[labelKey] : item);
731
+ });
732
+ field = field.join(' ');
733
+ } else {
734
+ field = data[_i3][fields[_x]][labelKey];
735
+ }
736
+ } else {
737
+ field = data[_i3][fields[_x]];
738
+ }
739
+ tbody += '<td align="' + aligns[_x] + '">' + field + '</td>';
740
+ };
741
+
742
+ for (var _x in fields) {
743
+ _loop2(_x);
683
744
  }
684
745
  tbody += '</tr>';
746
+ };
747
+
748
+ for (var _i3 = 0; _i3 < data.length; _i3++) {
749
+ _loop(_i3);
685
750
  }
686
751
  if (!name) {
687
752
  name = 'table_' + new Date().getTime();
@@ -1402,8 +1467,21 @@ var isLogged = function isLogged(_ref8) {
1402
1467
  next();
1403
1468
  } else {
1404
1469
  var token = getStorage('token') || getStorage('Authorization');
1405
- if (Object.prototype.hasOwnProperty.call(to.query, 'serverId') && Object.prototype.hasOwnProperty.call(to.query, 'authType')) {
1470
+ if (!token && Object.prototype.hasOwnProperty.call(to.query, 'serverId') && Object.prototype.hasOwnProperty.call(to.query, 'authType')) {
1406
1471
  var url = win.top.location.href;
1472
+ if (to.query.openType) {
1473
+ switch (to.query.openType) {
1474
+ case 'self':
1475
+ url = win.location.href;
1476
+ break;
1477
+ case 'blank':
1478
+ url = win.location.href;
1479
+ break;
1480
+ case 'parent':
1481
+ url = win.parent.location.href;
1482
+ break;
1483
+ }
1484
+ }
1407
1485
  ajax({
1408
1486
  method: 'post',
1409
1487
  url: _config_api__WEBPACK_IMPORTED_MODULE_0__[/* authCenter */ "b"],
@@ -1430,10 +1508,27 @@ var isLogged = function isLogged(_ref8) {
1430
1508
  break;
1431
1509
  case 3:
1432
1510
  var href = res.results.authorizeUrl.replace('{redirectUri}', encodeURIComponent(url));
1433
- if (open) {
1434
- win.open(href);
1511
+ if (to.query.openType) {
1512
+ switch (to.query.openType) {
1513
+ case 'self':
1514
+ win.location.href = href;
1515
+ break;
1516
+ case 'blank':
1517
+ win.open(href);
1518
+ break;
1519
+ case 'top':
1520
+ win.top.location.href = href;
1521
+ break;
1522
+ case 'parent':
1523
+ win.parent.location.href = href;
1524
+ break;
1525
+ }
1435
1526
  } else {
1436
- win.top.location.href = href;
1527
+ if (open) {
1528
+ win.open(href);
1529
+ } else {
1530
+ win.top.location.href = href;
1531
+ }
1437
1532
  }
1438
1533
  break;
1439
1534
  }
@@ -1445,9 +1540,9 @@ var isLogged = function isLogged(_ref8) {
1445
1540
  }
1446
1541
  }
1447
1542
  }).catch(function (e) {});
1448
- } else if (token || to.path === '/' || to.path === '/login' || to.path === '/404' || exclude.indexOf(to.path) > -1 || exclude.indexOf(to.name) > -1) {
1449
- if (redirect && to.name && (to.name === 'login' || to.name === 'main')) {
1450
- window.location.replace(urlJoinParams({ url: './' + to.name + '.html', param: to.query }));
1543
+ } else if (token || to.path === '/' || to.path === '/404' || exclude.indexOf(to.path) > -1 || exclude.indexOf(to.name) > -1 || to.path === '/login' || token && to.path === '/main') {
1544
+ if (redirect && (to.path === '/main' || to.path === '/login')) {
1545
+ window.location.replace(urlJoinParams({ url: '.' + to.path + '.html', param: to.query }));
1451
1546
  } else {
1452
1547
  next();
1453
1548
  }
@@ -2587,7 +2682,7 @@ module.exports = require("axios");
2587
2682
 
2588
2683
  /***/ }),
2589
2684
 
2590
- /***/ 42:
2685
+ /***/ 43:
2591
2686
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
2592
2687
 
2593
2688
  "use strict";
package/lib/handler.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 = 43);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 44);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -534,7 +534,7 @@ var esEncode = function esEncode(value) {
534
534
  **/
535
535
  var esDecode = function esDecode(value) {
536
536
  var kleng = publicKey.length;
537
- var result;
537
+ var result = void 0;
538
538
  var cat1 = void 0;
539
539
  var cat2 = void 0;
540
540
  var cat3 = void 0;
@@ -639,11 +639,13 @@ var exportXls = function exportXls(_ref6) {
639
639
  _ref6$data = _ref6.data,
640
640
  data = _ref6$data === undefined ? [] : _ref6$data,
641
641
  name = _ref6.name,
642
- numbers = _ref6.numbers;
642
+ numbers = _ref6.numbers,
643
+ option = _ref6.option;
643
644
 
644
645
  var tbody = '';
645
646
  var aligns = [];
646
647
  var fields = [];
648
+ var keys = {};
647
649
  var others = {};
648
650
  var alink = document.createElement('a');
649
651
  for (var i = 0; i < thead.length; i++) {
@@ -653,12 +655,15 @@ var exportXls = function exportXls(_ref6) {
653
655
  }
654
656
  var tr = thead[i];
655
657
  var col = 0;
656
- for (var _x = 0; _x < tr.length; _x++) {
657
- var td = tr[_x];
658
+ for (var x = 0; x < tr.length; x++) {
659
+ var td = tr[x];
658
660
  if (td.property) {
659
- if (col === _x) {
661
+ if (col === x) {
660
662
  fields.push(td.property);
661
663
  aligns.push(td.align);
664
+ if (td.labelKey && td.valueKey) {
665
+ keys[td.property] = { labelKey: td.labelKey, valueKey: td.valueKey, multiple: !!(td.valueToString || td['value-to-string']) };
666
+ }
662
667
  } else {
663
668
  others[String(col)] = [td.property, td.align];
664
669
  }
@@ -676,12 +681,72 @@ var exportXls = function exportXls(_ref6) {
676
681
  fields.splice(_i2, 0, others[_i2][0]);
677
682
  aligns.splice(_i2, 0, others[_i2][1]);
678
683
  }
679
- for (var _i3 = 0; _i3 < data.length; _i3++) {
684
+
685
+ var _loop = function _loop(_i3) {
680
686
  tbody += '<tr>';
681
- for (var x in fields) {
682
- tbody += '<td align="' + aligns[x] + '">' + data[_i3][fields[x]] + '</td>';
687
+
688
+ var _loop2 = function _loop2(_x) {
689
+ var field = '';
690
+ var valueKey = keys[fields[_x]] && keys[fields[_x]].valueKey ? keys[fields[_x]].valueKey : 'value';
691
+ var labelKey = keys[fields[_x]] && keys[fields[_x]].labelKey ? keys[fields[_x]].labelKey : 'name';
692
+ if (option[fields[_x]]) {
693
+ if (Array.isArray(data[_i3][fields[_x]])) {
694
+ field = [];
695
+ data[_i3][fields[_x]].forEach(function (ele) {
696
+ option[fields[_x]].forEach(function (item) {
697
+ // eslint-disable-next-line eqeqeq
698
+ if (item[valueKey] == ele) {
699
+ field.push(item[labelKey]);
700
+ return;
701
+ }
702
+ });
703
+ });
704
+ field = field.join(' ');
705
+ } else if (typeof data[_i3][fields[_x]] === 'string' && keys[fields[_x]] && keys[fields[_x]].multiple) {
706
+ field = [];
707
+ data[_i3][fields[_x]].split(',').forEach(function (ele) {
708
+ option[fields[_x]].forEach(function (item) {
709
+ // eslint-disable-next-line eqeqeq
710
+ if (item[valueKey] == ele) {
711
+ field.push(item[labelKey]);
712
+ return;
713
+ }
714
+ });
715
+ });
716
+ field = field.join(' ');
717
+ } else {
718
+ option[fields[_x]].forEach(function (item) {
719
+ // eslint-disable-next-line eqeqeq
720
+ if (item[valueKey] == data[_i3][fields[_x]]) {
721
+ field = item[labelKey];
722
+ return;
723
+ }
724
+ });
725
+ }
726
+ } else if (_typeof(data[_i3][fields[_x]]) === 'object' && keys[fields[_x]]) {
727
+ if (Array.isArray(data[_i3][fields[_x]])) {
728
+ data[_i3][fields[_x]].forEach(function (item) {
729
+ field = [];
730
+ field.push({}.toString.call(item) === '[object Object]' ? item[labelKey] : item);
731
+ });
732
+ field = field.join(' ');
733
+ } else {
734
+ field = data[_i3][fields[_x]][labelKey];
735
+ }
736
+ } else {
737
+ field = data[_i3][fields[_x]];
738
+ }
739
+ tbody += '<td align="' + aligns[_x] + '">' + field + '</td>';
740
+ };
741
+
742
+ for (var _x in fields) {
743
+ _loop2(_x);
683
744
  }
684
745
  tbody += '</tr>';
746
+ };
747
+
748
+ for (var _i3 = 0; _i3 < data.length; _i3++) {
749
+ _loop(_i3);
685
750
  }
686
751
  if (!name) {
687
752
  name = 'table_' + new Date().getTime();
@@ -1402,8 +1467,21 @@ var isLogged = function isLogged(_ref8) {
1402
1467
  next();
1403
1468
  } else {
1404
1469
  var token = getStorage('token') || getStorage('Authorization');
1405
- if (Object.prototype.hasOwnProperty.call(to.query, 'serverId') && Object.prototype.hasOwnProperty.call(to.query, 'authType')) {
1470
+ if (!token && Object.prototype.hasOwnProperty.call(to.query, 'serverId') && Object.prototype.hasOwnProperty.call(to.query, 'authType')) {
1406
1471
  var url = win.top.location.href;
1472
+ if (to.query.openType) {
1473
+ switch (to.query.openType) {
1474
+ case 'self':
1475
+ url = win.location.href;
1476
+ break;
1477
+ case 'blank':
1478
+ url = win.location.href;
1479
+ break;
1480
+ case 'parent':
1481
+ url = win.parent.location.href;
1482
+ break;
1483
+ }
1484
+ }
1407
1485
  ajax({
1408
1486
  method: 'post',
1409
1487
  url: _config_api__WEBPACK_IMPORTED_MODULE_0__[/* authCenter */ "b"],
@@ -1430,10 +1508,27 @@ var isLogged = function isLogged(_ref8) {
1430
1508
  break;
1431
1509
  case 3:
1432
1510
  var href = res.results.authorizeUrl.replace('{redirectUri}', encodeURIComponent(url));
1433
- if (open) {
1434
- win.open(href);
1511
+ if (to.query.openType) {
1512
+ switch (to.query.openType) {
1513
+ case 'self':
1514
+ win.location.href = href;
1515
+ break;
1516
+ case 'blank':
1517
+ win.open(href);
1518
+ break;
1519
+ case 'top':
1520
+ win.top.location.href = href;
1521
+ break;
1522
+ case 'parent':
1523
+ win.parent.location.href = href;
1524
+ break;
1525
+ }
1435
1526
  } else {
1436
- win.top.location.href = href;
1527
+ if (open) {
1528
+ win.open(href);
1529
+ } else {
1530
+ win.top.location.href = href;
1531
+ }
1437
1532
  }
1438
1533
  break;
1439
1534
  }
@@ -1445,9 +1540,9 @@ var isLogged = function isLogged(_ref8) {
1445
1540
  }
1446
1541
  }
1447
1542
  }).catch(function (e) {});
1448
- } else if (token || to.path === '/' || to.path === '/login' || to.path === '/404' || exclude.indexOf(to.path) > -1 || exclude.indexOf(to.name) > -1) {
1449
- if (redirect && to.name && (to.name === 'login' || to.name === 'main')) {
1450
- window.location.replace(urlJoinParams({ url: './' + to.name + '.html', param: to.query }));
1543
+ } else if (token || to.path === '/' || to.path === '/404' || exclude.indexOf(to.path) > -1 || exclude.indexOf(to.name) > -1 || to.path === '/login' || token && to.path === '/main') {
1544
+ if (redirect && (to.path === '/main' || to.path === '/login')) {
1545
+ window.location.replace(urlJoinParams({ url: '.' + to.path + '.html', param: to.query }));
1451
1546
  } else {
1452
1547
  next();
1453
1548
  }
@@ -2587,7 +2682,7 @@ module.exports = require("axios");
2587
2682
 
2588
2683
  /***/ }),
2589
2684
 
2590
- /***/ 43:
2685
+ /***/ 44:
2591
2686
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
2592
2687
 
2593
2688
  "use strict";