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.
@@ -3135,6 +3135,8 @@ var MultiTabComponent = /** @class */ (function () {
3135
3135
  //只能单个缓存的url
3136
3136
  this.noGenerateTabUrls = []; //不生成tab的url
3137
3137
  //不生成tab的url
3138
+ this.flattenMenu = [];
3139
+ this.defaultTabUrl = "";
3138
3140
  this.onRefreshTab = new EventEmitter();
3139
3141
  this.subscriptions = [];
3140
3142
  this.TAB_WIDTH = 164;
@@ -3219,12 +3221,12 @@ var MultiTabComponent = /** @class */ (function () {
3219
3221
  /** @type {?} */
3220
3222
  var navigationInfo = JSON.parse(sessionStorage.getItem("navigationInfo") || "{}");
3221
3223
  /** @type {?} */
3222
- var title = (state && state.title) ||
3224
+ var title = (state && state["title"]) ||
3223
3225
  navigationInfo.title ||
3224
3226
  navigationInfo.subTitle ||
3225
3227
  navigationInfo.name;
3226
3228
  /** @type {?} */
3227
- var noReused = (state && state.noReused) || false;
3229
+ var noReused = (state && state["noReused"]) || false;
3228
3230
  if (currentRoute && !skipLocationChange) {
3229
3231
  if (_this.noGenerateTabUrls.includes(_this.urlWithoutQuery(_this.router.url))) {
3230
3232
  return; // 排除不生成tab的url
@@ -3345,6 +3347,8 @@ var MultiTabComponent = /** @class */ (function () {
3345
3347
  * @return {?}
3346
3348
  */
3347
3349
  function () {
3350
+ var _this = this;
3351
+ // console.log("this.flattenMenu", this.flattenMenu);
3348
3352
  /** @type {?} */
3349
3353
  var TabCache = JSON.parse(sessionStorage.getItem("TabCache"));
3350
3354
  this.tabList = TabCache || [];
@@ -3357,6 +3361,30 @@ var MultiTabComponent = /** @class */ (function () {
3357
3361
  var url = this.router.url;
3358
3362
  this.addTab(url, title);
3359
3363
  }
3364
+ else {
3365
+ /** @type {?} */
3366
+ var target = this.flattenMenu.find((/**
3367
+ * @param {?} ele
3368
+ * @return {?}
3369
+ */
3370
+ function (ele) { return ele.url === _this.router.url; }));
3371
+ if (target) {
3372
+ if (target.url !== this.defaultTabUrl) {
3373
+ /** @type {?} */
3374
+ var defaultTab = this.flattenMenu.find((/**
3375
+ * @param {?} ele
3376
+ * @return {?}
3377
+ */
3378
+ function (ele) { return ele.url === _this.defaultTabUrl; }));
3379
+ this.tabList.push({
3380
+ url: defaultTab.url,
3381
+ title: defaultTab.label,
3382
+ displayTitle: defaultTab.label,
3383
+ });
3384
+ }
3385
+ this.addTab(target.url, target.label);
3386
+ }
3387
+ }
3360
3388
  }
3361
3389
  };
3362
3390
  /**
@@ -3603,6 +3631,8 @@ var MultiTabComponent = /** @class */ (function () {
3603
3631
  MultiTabComponent.propDecorators = {
3604
3632
  singleReuseUrls: [{ type: Input }],
3605
3633
  noGenerateTabUrls: [{ type: Input }],
3634
+ flattenMenu: [{ type: Input }],
3635
+ defaultTabUrl: [{ type: Input }],
3606
3636
  onRefreshTab: [{ type: Output }],
3607
3637
  onResize: [{ type: HostListener, args: ["window:resize", ["$event"],] }]
3608
3638
  };
@@ -3616,6 +3646,10 @@ if (false) {
3616
3646
  /** @type {?} */
3617
3647
  MultiTabComponent.prototype.noGenerateTabUrls;
3618
3648
  /** @type {?} */
3649
+ MultiTabComponent.prototype.flattenMenu;
3650
+ /** @type {?} */
3651
+ MultiTabComponent.prototype.defaultTabUrl;
3652
+ /** @type {?} */
3619
3653
  MultiTabComponent.prototype.onRefreshTab;
3620
3654
  /**
3621
3655
  * @type {?}