raise-common-lib 0.0.138 → 0.0.139

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.
@@ -3328,6 +3328,8 @@
3328
3328
  //只能单个缓存的url
3329
3329
  this.noGenerateTabUrls = []; //不生成tab的url
3330
3330
  //不生成tab的url
3331
+ this.flattenMenu = [];
3332
+ this.defaultTabUrl = "";
3331
3333
  this.onRefreshTab = new core.EventEmitter();
3332
3334
  this.subscriptions = [];
3333
3335
  this.TAB_WIDTH = 164;
@@ -3412,12 +3414,12 @@
3412
3414
  /** @type {?} */
3413
3415
  var navigationInfo = JSON.parse(sessionStorage.getItem("navigationInfo") || "{}");
3414
3416
  /** @type {?} */
3415
- var title = (state && state.title) ||
3417
+ var title = (state && state["title"]) ||
3416
3418
  navigationInfo.title ||
3417
3419
  navigationInfo.subTitle ||
3418
3420
  navigationInfo.name;
3419
3421
  /** @type {?} */
3420
- var noReused = (state && state.noReused) || false;
3422
+ var noReused = (state && state["noReused"]) || false;
3421
3423
  if (currentRoute && !skipLocationChange) {
3422
3424
  if (_this.noGenerateTabUrls.includes(_this.urlWithoutQuery(_this.router.url))) {
3423
3425
  return; // 排除不生成tab的url
@@ -3538,6 +3540,8 @@
3538
3540
  * @return {?}
3539
3541
  */
3540
3542
  function () {
3543
+ var _this = this;
3544
+ // console.log("this.flattenMenu", this.flattenMenu);
3541
3545
  /** @type {?} */
3542
3546
  var TabCache = JSON.parse(sessionStorage.getItem("TabCache"));
3543
3547
  this.tabList = TabCache || [];
@@ -3550,6 +3554,30 @@
3550
3554
  var url = this.router.url;
3551
3555
  this.addTab(url, title);
3552
3556
  }
3557
+ else {
3558
+ /** @type {?} */
3559
+ var target = this.flattenMenu.find((/**
3560
+ * @param {?} ele
3561
+ * @return {?}
3562
+ */
3563
+ function (ele) { return ele.url === _this.router.url; }));
3564
+ if (target) {
3565
+ if (target.url !== this.defaultTabUrl) {
3566
+ /** @type {?} */
3567
+ var defaultTab = this.flattenMenu.find((/**
3568
+ * @param {?} ele
3569
+ * @return {?}
3570
+ */
3571
+ function (ele) { return ele.url === _this.defaultTabUrl; }));
3572
+ this.tabList.push({
3573
+ url: defaultTab.url,
3574
+ title: defaultTab.label,
3575
+ displayTitle: defaultTab.label,
3576
+ });
3577
+ }
3578
+ this.addTab(target.url, target.label);
3579
+ }
3580
+ }
3553
3581
  }
3554
3582
  };
3555
3583
  /**
@@ -3796,6 +3824,8 @@
3796
3824
  MultiTabComponent.propDecorators = {
3797
3825
  singleReuseUrls: [{ type: core.Input }],
3798
3826
  noGenerateTabUrls: [{ type: core.Input }],
3827
+ flattenMenu: [{ type: core.Input }],
3828
+ defaultTabUrl: [{ type: core.Input }],
3799
3829
  onRefreshTab: [{ type: core.Output }],
3800
3830
  onResize: [{ type: core.HostListener, args: ["window:resize", ["$event"],] }]
3801
3831
  };
@@ -3809,6 +3839,10 @@
3809
3839
  /** @type {?} */
3810
3840
  MultiTabComponent.prototype.noGenerateTabUrls;
3811
3841
  /** @type {?} */
3842
+ MultiTabComponent.prototype.flattenMenu;
3843
+ /** @type {?} */
3844
+ MultiTabComponent.prototype.defaultTabUrl;
3845
+ /** @type {?} */
3812
3846
  MultiTabComponent.prototype.onRefreshTab;
3813
3847
  /**
3814
3848
  * @type {?}