Skip to content

Commit

Permalink
feat: Extension tips change link (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
scarqin authored Jun 1, 2022
1 parent 3b104ff commit 67ea16a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import { Component } from '@angular/core';
import { Component, OnDestroy } from '@angular/core';
import { Router, NavigationStart, NavigationEnd } from '@angular/router';

import { EoMessageService } from '../../../eoui/message/eo-message.service';
import { NzModalRef } from 'ng-zorro-antd/modal';
import { ExportApiComponent } from '../../../shared/components/export-api/export-api.component';
import { SyncApiComponent } from '../../../shared/components/sync-api/sync-api.component';
import { ImportApiComponent } from '../../../shared/components/import-api/import-api.component';
import { ModalService } from '../../../shared/services/modal.service';
import { filter } from 'rxjs';

const actionComponent = {
push: SyncApiComponent,
Expand All @@ -16,8 +19,9 @@ const actionComponent = {
templateUrl: './api-overview.component.html',
styleUrls: ['./api-overview.component.scss'],
})
export class ApiOverviewComponent {
constructor(private modalService: ModalService, private message: EoMessageService) {}
export class ApiOverviewComponent implements OnDestroy {
modal: NzModalRef;
constructor(private modalService: ModalService, private router: Router, private message: EoMessageService) {}
overviewList = [
// {
// title: '导入',
Expand All @@ -40,21 +44,25 @@ export class ApiOverviewComponent {
];

clickCard({ title, desc, type }) {
const modal: NzModalRef = this.modalService.create({
this.modal = this.modalService.create({
nzTitle: desc,
nzContent: actionComponent[type],
nzClosable: false,
nzComponentParams: {},
nzOnOk: () => {
modal.componentInstance.submit((status) => {
this.modal.componentInstance.submit((status) => {
if (status) {
this.message.success(`${title}成功`);
modal.destroy();
this.modal.destroy();
} else {
this.message.error(`${title}失败`);
}
});
},
});
}
ngOnDestroy() {
//TODO router change manual close modal
this.modal.destroy();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@
</div>
</ng-container>
<ng-template #empty>
<span class="text">该功能需要插件支持,请移步至插件广场下载</span>
<span class="text">该功能需要插件支持,请移步至<a class="eo_link" routerLink="/home/extension/list">插件广场</a>下载</span>
</ng-template>

0 comments on commit 67ea16a

Please sign in to comment.