Skip to content

Commit

Permalink
fix: blank test edit status error
Browse files Browse the repository at this point in the history
  • Loading branch information
scarqin committed Aug 10, 2022
1 parent 98881d3 commit b7dcea7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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')) {
Expand Down
18 changes: 12 additions & 6 deletions src/workbench/browser/src/app/pages/api/tab/api-tab.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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();
}
Expand Down

0 comments on commit b7dcea7

Please sign in to comment.