fix:show tab

This commit is contained in:
scarqin 2022-06-14 19:22:04 +08:00
parent 7ef31d99e2
commit eb10da596b
6 changed files with 5 additions and 8 deletions

View File

@ -111,10 +111,11 @@ export class ApiGroupEditComponent implements OnInit {
this.modalRef.destroy();
this.storage.run('groupBulkRemove', [data.group], (result: StorageRes) => {
if (result.status === StorageResStatus.success) {
this.messageService.send({ type: 'updateGroupSuccess', data: {} });
//delete group api
if (data.api.length > 0) {
this.messageService.send({ type: 'gotoBulkDeleteApi', data: { uuids: data.api } });
}else{
this.messageService.send({ type: 'updateGroupSuccess', data: {} });
}
}
});

View File

@ -93,6 +93,7 @@ export class ApiGroupTreeComponent implements OnInit, OnDestroy {
* Load all group and apiData items.
*/
buildGroupTreeData(): void {
console.log('buildGroupTreeData')
this.groupByID = {};
this.treeItems = [];
this.getGroups();
@ -377,7 +378,6 @@ export class ApiGroupTreeComponent implements OnInit, OnDestroy {
}
private setSelectedKeys() {
console.log('setSelectedKeys', this.route.snapshot.queryParams.uuid, this.nzSelectedKeys);
if (this.route.snapshot.queryParams.uuid) {
this.nzSelectedKeys = [this.route.snapshot.queryParams.uuid];
} else {

View File

@ -258,7 +258,7 @@ export class ApiTabComponent implements OnInit, OnDestroy {
});
break;
case 'gotoAddApi':
this.appendOrSwitchTab('edit', inArg.data ?? {});
this.appendOrSwitchTab('edit', inArg.data ? { groupID: inArg.data.key.replace('group-', '') } : {});
break;
case 'addApiSuccess':
case 'editApiSuccess':

View File

@ -16,7 +16,6 @@ export class ApiTabService {
tabChange$: ReplaySubject<TabItem> = new ReplaySubject(1);
saveTabData$: Subject<{ tab: TabItem; data: any }> = new Subject();
get tabID(): number {
console.log('tab change', this);
return this.currentTab.uuid;
}
constructor() {

View File

@ -1,4 +1,4 @@
.about ::ng-deep .ant-descriptions-item-label {
width: 84px;
justify-content: flex-end;
// justify-content: flex-end;
}

View File

@ -37,7 +37,6 @@ export class StorageService {
(res: any) => {
handleResult.status = res.status;
handleResult.data = res.data;
console.log(handleResult);
callback(handleResult);
},
(error: any) => {
@ -66,7 +65,5 @@ export class StorageService {
this.dataSourceType = dataSourceType ?? (this.dataSourceType === 'http' ? 'local' : 'http');
this.setStorage(this.dataSourceType, options);
localStorage.setItem('IS_SHOW_REMOTE_SERVER_NOTIFICATION', this.dataSourceType === 'local' ? 'true' : 'false');
console.log('this.dataSourceType', this.dataSourceType);
console.log('this.instance', this.instance);
}
}