From b7dcea772feb5de6b8bc568265795ddec4d4cbcb Mon Sep 17 00:00:00 2001 From: scarqin <1054139596@qq.com> Date: Wed, 10 Aug 2022 19:31:47 +0800 Subject: [PATCH] fix: blank test edit status error --- .../eoui/table/eo-table/eo-table.component.ts | 2 +- .../pages/api/tab/api-tab-operate.service.ts | 2 +- .../src/app/pages/api/tab/api-tab.component.ts | 18 ++++++++++++------ 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/workbench/browser/src/app/eoui/table/eo-table/eo-table.component.ts b/src/workbench/browser/src/app/eoui/table/eo-table/eo-table.component.ts index bb141402f..4ef502ba5 100644 --- a/src/workbench/browser/src/app/eoui/table/eo-table/eo-table.component.ts +++ b/src/workbench/browser/src/app/eoui/table/eo-table/eo-table.component.ts @@ -58,7 +58,7 @@ export class EoTableComponent implements OnInit, AfterContentInit { constructor() {} ngOnInit(): void { - console.log('->', this.columns); + // console.log('->', this.columns); } ngAfterContentInit() { this.slotList.forEach(({ cellName, templateRef }) => { diff --git a/src/workbench/browser/src/app/pages/api/tab/api-tab-operate.service.ts b/src/workbench/browser/src/app/pages/api/tab/api-tab-operate.service.ts index 5cbfe6122..b9bc4d8d7 100644 --- a/src/workbench/browser/src/app/pages/api/tab/api-tab-operate.service.ts +++ b/src/workbench/browser/src/app/pages/api/tab/api-tab-operate.service.ts @@ -203,7 +203,7 @@ export class ApiTabOperateService { const tmpTabItem = this.getBaiscTabFromUrl(res.url); const sameContentIndex = this.getSameContentTabIndex(tmpTabItem); const existTab = this.getTabByIndex(sameContentIndex); - console.log('operateTabAfterRouteChange', existTab, tmpTabItem); + // console.log('operateTabAfterRouteChange', existTab, tmpTabItem); //If page lack pageID //Jump to exist tab item to keep same pageID and so on if (!res.url.includes('pageID')) { diff --git a/src/workbench/browser/src/app/pages/api/tab/api-tab.component.ts b/src/workbench/browser/src/app/pages/api/tab/api-tab.component.ts index d2f04bd68..f92ec42e2 100644 --- a/src/workbench/browser/src/app/pages/api/tab/api-tab.component.ts +++ b/src/workbench/browser/src/app/pages/api/tab/api-tab.component.ts @@ -119,10 +119,13 @@ export class ApiTabComponent implements OnInit, OnDestroy { getTabByUrl(url: string): TabItem | null { const tabItem = this.tabOperate.getBaiscTabFromUrl(url); const existTabIndex = this.tabOperate.getSameContentTabIndex(tabItem); - if (existTabIndex === -1) { - return null; + if (existTabIndex !== -1) { + return this.tabStorage.tabsByID.get(this.tabStorage.tabOrder[existTabIndex]); } - return this.tabStorage.tabsByID.get(this.tabStorage.tabOrder[existTabIndex]); + if (!url.includes('uuid')) { + return this.tabStorage.tabsByID.get(tabItem.uuid) || null; + } + return null; } getCurrentTab() { return this.tabOperate.getCurrentTab(); @@ -144,9 +147,12 @@ export class ApiTabComponent implements OnInit, OnDestroy { return; } const index = this.tabStorage.tabOrder.findIndex((uuid) => uuid === originTab.uuid); - this.tabStorage.updateTab(index, Object.assign({}, originTab, tabItem,{ - extends:Object.assign({},originTab.extends,tabItem.extends) - })); + this.tabStorage.updateTab( + index, + Object.assign({}, originTab, tabItem, { + extends: Object.assign({}, originTab.extends, tabItem.extends), + }) + ); //! Prevent rendering delay this.cdRef.detectChanges(); }