diff options
author | Tao Shen <shentao@chinamobile.com> | 2019-12-16 02:20:43 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-12-16 02:20:43 +0000 |
commit | 59755b5b5b3cdbdd2334d542b410dd5c7376ee06 (patch) | |
tree | 941522afb4351b13e3194aaad58889cafd98852b /usecaseui-portal | |
parent | b473586220ef2f1b3905a4028639fde8709cfbe5 (diff) | |
parent | c9a8687c75c6710ca36f48f80e4b90c428a6aee0 (diff) |
Merge "feat: Modify the submission logic of the task management component"
Diffstat (limited to 'usecaseui-portal')
4 files changed, 25 insertions, 9 deletions
diff --git a/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-management.component.html b/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-management.component.html index 81f4c961..4a69cf7a 100644 --- a/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-management.component.html +++ b/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-management.component.html @@ -70,7 +70,7 @@ [moduleTitle]="moduleTitle" [showDetail]="showDetail" [taskId]="taskId" - (cancel)="showDetail = $event" + (cancel)="handelCancel($event)" > </app-slicing-task-model> <app-check-process-model diff --git a/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-management.component.ts b/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-management.component.ts index e5832902..66adf7b4 100644 --- a/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-management.component.ts +++ b/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-management.component.ts @@ -123,4 +123,15 @@ export class SlicingTaskManagementComponent implements OnInit { this.showProcess = true; } } + + handelCancel(obj: any):void { + this.showDetail = obj.showDetail; + if (obj.bool) { + if (this.selectedValue && this.selectedValue !== 'all') { + this.getListOfProcessingStatus(); + } else { + this.getTaskList(); + } + } + } } diff --git a/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-model/slicing-task-model.component.html b/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-model/slicing-task-model.component.html index a5aaeb75..62bec932 100644 --- a/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-model/slicing-task-model.component.html +++ b/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-model/slicing-task-model.component.html @@ -1,5 +1,4 @@ -<nz-modal [nzVisible]="showDetail" nzWidth="85%" [nzTitle]="moduleTitle" (nzOnCancel)="handleCancel()" - (nzOnOk)="handleOk()"> +<nz-modal [nzVisible]="showDetail" nzWidth="85%" [nzTitle]="moduleTitle" [nzFooter]="modalFooter"> <nz-spin [nzSpinning]="isSpinning"> <app-basic-info [checkDetail]="checkDetail" @@ -87,9 +86,12 @@ </nz-list-item> </nz-list> </div> - </nz-spin> </nz-modal> +<ng-template #modalFooter> + <button nz-button (click)="handleCancel()">Cancel</button> + <button nz-button nzType="primary" [nzLoading]='loading' (click)="handleOk()">OK</button> +</ng-template> <app-subnet-params-model [showModel]="isShowParams" [detailData]="params" diff --git a/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-model/slicing-task-model.component.ts b/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-model/slicing-task-model.component.ts index f6d548d3..33dec995 100644 --- a/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-model/slicing-task-model.component.ts +++ b/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-model/slicing-task-model.component.ts @@ -11,7 +11,7 @@ export class SlicingTaskModelComponent implements OnInit { @Input() showDetail: boolean; @Input() moduleTitle: string; @Input() taskId: string; - @Output() cancel = new EventEmitter<boolean>(); + @Output() cancel = new EventEmitter<object>(); @ViewChild('notification') notification1: any; constructor(private http: SlicingTaskServices, private message: NzMessageService) { } @@ -72,6 +72,7 @@ export class SlicingTaskModelComponent implements OnInit { params: any; // 获取数据loading isSpinning: boolean = false; + loading: boolean = false; ngOnInit() { } @@ -333,11 +334,12 @@ export class SlicingTaskModelComponent implements OnInit { this.slicingSubnet[index].params = params } - handleCancel() { + handleCancel(bool: boolean = false) { this.showDetail = false; - this.cancel.emit(this.showDetail); + this.cancel.emit({showDetail: this.showDetail, bool}); } handleOk() { + this.loading = true; const { selectedServiceId, selectedServiceName, slicingSubnet, checkDetail, businessRequirement, NSTinfo } = this; const nsi_nssi_info: object = { suggest_nsi_id: selectedServiceId, @@ -355,15 +357,16 @@ export class SlicingTaskModelComponent implements OnInit { delete businessRequirement[0].area let reqBody = {...checkDetail[0], business_demand_info: businessRequirement[0], nst_info: NSTinfo[0], nsi_nssi_info}; delete reqBody.service_snssai; - this.notification1.notificationStart('Task', 'Sumbit', this.taskId) + // this.notification1.notificationStart('Task', 'Sumbit', this.taskId) this.http.submitSlicing(reqBody).subscribe (res => { const { result_header: { result_code } } = res; if (+result_code === 200) { - this.handleCancel(); this.notification1.notificationSuccess('Task', 'Sumbit', this.taskId) } else { this.notification1.notificationFailed('Task', 'Sumbit', this.taskId) } + this.loading = false; + this.handleCancel(true); }) } } |