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/tips.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 = 56);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 57);
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
  }
@@ -2594,7 +2689,7 @@ module.exports = require("eoss-element");
2594
2689
 
2595
2690
  /***/ }),
2596
2691
 
2597
- /***/ 56:
2692
+ /***/ 57:
2598
2693
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
2599
2694
 
2600
2695
  "use strict";
package/lib/toolbar.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 = 72);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 73);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -192,7 +192,7 @@ function normalizeComponent(
192
192
 
193
193
  /***/ }),
194
194
 
195
- /***/ 72:
195
+ /***/ 73:
196
196
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
197
197
 
198
198
  "use strict";
package/lib/tree-group.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 = 58);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 59);
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
  }
@@ -2594,7 +2689,7 @@ module.exports = require("eoss-element");
2594
2689
 
2595
2690
  /***/ }),
2596
2691
 
2597
- /***/ 58:
2692
+ /***/ 59:
2598
2693
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
2599
2694
 
2600
2695
  "use strict";
package/lib/tree.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 = 57);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 58);
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
  }
@@ -2594,7 +2689,7 @@ module.exports = require("eoss-element");
2594
2689
 
2595
2690
  /***/ }),
2596
2691
 
2597
- /***/ 57:
2692
+ /***/ 58:
2598
2693
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
2599
2694
 
2600
2695
  "use strict";