-
Notifications
You must be signed in to change notification settings - Fork 779
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
210 additions
and
155 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { TestBed } from '@angular/core/testing'; | ||
|
||
import { ApiTabService } from './api-tab.service'; | ||
|
||
describe('ApiTabService', () => { | ||
let service: ApiTabService; | ||
|
||
beforeEach(() => { | ||
TestBed.configureTestingModule({}); | ||
service = TestBed.inject(ApiTabService); | ||
}); | ||
|
||
it('should be created', () => { | ||
expect(service).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { ReplaySubject, Subject } from 'rxjs'; | ||
import { TabItem } from './tab.model'; | ||
|
||
export class ApiTabService { | ||
currentTab: TabItem; | ||
tabs = {}; | ||
tabChange$: ReplaySubject<TabItem> = new ReplaySubject(1); | ||
saveTabData$: Subject<{ tab: TabItem; data: any }> = new Subject(); | ||
constructor() { | ||
this.saveTabData$.subscribe((inData) => { | ||
this.tabs[inData.tab.uuid] = inData.data; | ||
}); | ||
this.tabChange$.subscribe((tab) => { | ||
this.currentTab = tab; | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,54 @@ | ||
/** | ||
* Tab item. | ||
*/ | ||
export interface TabItem { | ||
/** | ||
* 标签标题 | ||
* | ||
* @type {string} | ||
*/ | ||
title: string; | ||
|
||
/** | ||
* 标签对应的路径 | ||
* | ||
* @type {string} | ||
*/ | ||
path: string; | ||
|
||
/** | ||
* 路径的主键参数 | ||
* | ||
* @type {string | number} | ||
*/ | ||
key?: string|number; | ||
|
||
/** | ||
* 路径的分组参数 | ||
* | ||
* @type {string | number} | ||
*/ | ||
groupID?: string|number; | ||
|
||
/** | ||
* 路径的项目参数 | ||
* | ||
* @type {string | number} | ||
*/ | ||
projectID?: string|number; | ||
|
||
/** | ||
* 标签路径的请求类型,用于显示 | ||
* | ||
* @type {string | number} | ||
*/ | ||
method?: string; | ||
|
||
/** | ||
* 实体类型,为后期加上其他类型到Tab预留,如Group | ||
* | ||
* @type {string} | ||
*/ | ||
entity?: string; | ||
} | ||
export interface TabItem { | ||
uuid: number; | ||
/** | ||
* 标签标题 | ||
* | ||
* @type {string} | ||
*/ | ||
title: string; | ||
|
||
/** | ||
* 标签对应的路径 | ||
* | ||
* @type {string} | ||
*/ | ||
path: string; | ||
|
||
/** | ||
* 路径的主键参数 | ||
* | ||
* @type {string | number} | ||
*/ | ||
key?: string | number; | ||
|
||
/** | ||
* 路径的分组参数 | ||
* | ||
* @type {string | number} | ||
*/ | ||
groupID?: string | number; | ||
|
||
/** | ||
* 路径的项目参数 | ||
* | ||
* @type {string | number} | ||
*/ | ||
projectID?: string | number; | ||
|
||
/** | ||
* 标签路径的请求类型,用于显示 | ||
* | ||
* @type {string | number} | ||
*/ | ||
method?: string; | ||
|
||
/** | ||
* 实体类型,为后期加上其他类型到Tab预留,如Group | ||
* | ||
* @type {string} | ||
*/ | ||
entity?: string; | ||
} |
Oops, something went wrong.