summaryrefslogtreecommitdiffstats
path: root/usecaseui-portal/src/app
diff options
context:
space:
mode:
authorwangyuerg <wangyuerg@chinamobile.com>2021-03-11 16:14:04 +0800
committerwangyuerg <wangyuerg@chinamobile.com>2021-03-11 16:15:11 +0800
commitc8053b27e26b505614d6c0f9b26804eff79936d2 (patch)
treea820e72694b48499f0602ac6ebc2ce879dd67191 /usecaseui-portal/src/app
parent387b2bfa70eb99535ab3148e31c9fed72c4d5e19 (diff)
fix: fix the bug of nssi-modal
Signed-off-by: wangyuerg <wangyuerg@chinamobile.com> Change-Id: I21d5f4c8673bf07bc2da4ccd7bfcf50d082bf53f Issue-ID: USECASEUI-527
Diffstat (limited to 'usecaseui-portal/src/app')
-rw-r--r--usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/nsi-management/nsi-model/nsi-model.component.ts125
-rw-r--r--usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/nssi-management/nssi-table/nssi-table.component.ts164
2 files changed, 152 insertions, 137 deletions
diff --git a/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/nsi-management/nsi-model/nsi-model.component.ts b/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/nsi-management/nsi-model/nsi-model.component.ts
index 5deb91b7..dd4c8126 100644
--- a/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/nsi-management/nsi-model/nsi-model.component.ts
+++ b/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/nsi-management/nsi-model/nsi-model.component.ts
@@ -1,66 +1,67 @@
-import {Component, Input, OnInit} from '@angular/core';
-import {NzModalService, NzMessageService} from "ng-zorro-antd";
-import {SlicingTaskServices} from '.././../../../../../core/services/slicingTaskServices';
-import { SlicingBusinessModelComponent } from '../../slicing-business-management/slicing-business-model/slicing-business-model.component';
-import { NssiModelComponent } from '../../nssi-management/nssi-model/nssi-model.component';
+import { Component, Input, OnInit } from "@angular/core";
+import { NzModalService, NzMessageService } from "ng-zorro-antd";
+import { SlicingTaskServices } from ".././../../../../../core/services/slicingTaskServices";
+import { SlicingBusinessModelComponent } from "../../slicing-business-management/slicing-business-model/slicing-business-model.component";
+import { NssiModelComponent } from "../../nssi-management/nssi-model/nssi-model.component";
@Component({
- selector: 'app-nsi-model',
- templateUrl: './nsi-model.component.html',
- styleUrls: ['./nsi-model.component.less']
+ selector: "app-nsi-model",
+ templateUrl: "./nsi-model.component.html",
+ styleUrls: ["./nsi-model.component.less"],
})
export class NsiModelComponent implements OnInit {
-
- constructor(
- private myhttp: SlicingTaskServices,
- private modalService: NzModalService,
- private message: NzMessageService
- ) {
- }
- @Input() nsiId;
- businessList: any[];
- nssiList: any[];
- isSpinning: boolean = true;
- ngOnInit() {
- this.getNsiDetail()
- }
- getNsiDetail() {
- this.myhttp.getSlicingNsiDetail(this.nsiId).then(res => {
- this.isSpinning = false;
- const { result_body: {hosted_business_list,included_nssi_list} } = res;
- this.businessList = hosted_business_list.map((item)=>{
- if(item.service_instance_id !==null){
- return item
- }
- });
- this.nssiList = included_nssi_list.map((item)=>{
- if(item.service_instance_id !==null){
- return item
- }
- });
- })
- }
- showBusinessDetail(data){
- this.modalService.create({
- nzContent:SlicingBusinessModelComponent,
- nzTitle:"Detail",
- nzWidth:"70%",
- nzOkText: null,
- nzCancelText: null,
- nzComponentParams:{
- businessId:data.service_instance_id
- }
- });
- }
- showNssiDetail(data){
- this.modalService.create({
- nzContent:NssiModelComponent,
- nzTitle:"Detail",
- nzWidth:"70%",
- nzOkText: null,
- nzCancelText: null,
- nzComponentParams:{
- nssiId:data.service_instance_id
- }
- });
- }
+ constructor(
+ private myhttp: SlicingTaskServices,
+ private modalService: NzModalService,
+ private message: NzMessageService
+ ) {}
+ @Input() nsiId;
+ businessList: any[];
+ nssiList: any[];
+ isSpinning: boolean = true;
+ ngOnInit() {
+ this.getNsiDetail();
+ }
+ getNsiDetail() {
+ this.myhttp.getSlicingNsiDetail(this.nsiId).then((res) => {
+ this.isSpinning = false;
+ const {
+ result_body: { hosted_business_list, included_nssi_list },
+ } = res;
+ this.businessList = hosted_business_list.map((item) => {
+ if (item.service_instance_id !== null) {
+ return item;
+ }
+ });
+ this.nssiList = included_nssi_list.map((item) => {
+ if (item.service_instance_id !== null) {
+ return item;
+ }
+ });
+ });
+ }
+ showBusinessDetail(data) {
+ this.modalService.create({
+ nzContent: SlicingBusinessModelComponent,
+ nzTitle: "Detail",
+ nzWidth: "70%",
+ nzOkText: null,
+ nzCancelText: null,
+ nzComponentParams: {
+ businessId: data.service_instance_id,
+ outerData: data,
+ },
+ });
+ }
+ showNssiDetail(data) {
+ this.modalService.create({
+ nzContent: NssiModelComponent,
+ nzTitle: "Detail",
+ nzWidth: "70%",
+ nzOkText: null,
+ nzCancelText: null,
+ nzComponentParams: {
+ nssiId: data.service_instance_id,
+ },
+ });
+ }
}
diff --git a/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/nssi-management/nssi-table/nssi-table.component.ts b/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/nssi-management/nssi-table/nssi-table.component.ts
index 5fe303b0..6e08f955 100644
--- a/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/nssi-management/nssi-table/nssi-table.component.ts
+++ b/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/nssi-management/nssi-table/nssi-table.component.ts
@@ -1,87 +1,101 @@
-import {Component, Input, OnInit,SimpleChanges} from '@angular/core';
-import {BUSINESS_STATUS} from '../../../../../../../constants/constants';
-import {SlicingTaskServices} from "../../../../../../core/services/slicingTaskServices";
-import {NzModalService, NzMessageService} from 'ng-zorro-antd';
-import {NssiModelComponent} from "../nssi-model/nssi-model.component";
+import { Component, Input, OnInit, SimpleChanges } from "@angular/core";
+import { BUSINESS_STATUS } from "../../../../../../../constants/constants";
+import { SlicingTaskServices } from "../../../../../../core/services/slicingTaskServices";
+import { NzModalService, NzMessageService } from "ng-zorro-antd";
+import { NssiModelComponent } from "../nssi-model/nssi-model.component";
@Component({
- selector: 'app-nssi-table',
- templateUrl: './nssi-table.component.html',
- styleUrls: ['./nssi-table.component.less']
+ selector: "app-nssi-table",
+ templateUrl: "./nssi-table.component.html",
+ styleUrls: ["./nssi-table.component.less"],
})
export class NssiTableComponent implements OnInit {
+ constructor(
+ private myhttp: SlicingTaskServices,
+ private modalService: NzModalService,
+ private message: NzMessageService
+ ) {}
- constructor(
- private myhttp: SlicingTaskServices,
- private modalService: NzModalService,
- private message: NzMessageService
- ) {
- }
+ @Input() currentTabName;
- @Input() currentTabName;
+ ngOnChanges(changes: SimpleChanges) {
+ if (
+ changes.currentTabName.currentValue ===
+ "Slicing Subnet Instance Management"
+ ) {
+ this.getNssiList();
+ }
+ }
+ ngOnInit() {}
- ngOnChanges(changes: SimpleChanges) {
- if (changes.currentTabName.currentValue === 'Slicing Subnet Instance Management') {
- this.getNssiList()
- }
- }
- ngOnInit() {}
+ selectedValue: string = BUSINESS_STATUS[0];
+ listOfData: any[] = [];
+ pageIndex: number = 1;
+ pageSize: number = 10;
+ total: number = 0;
+ loading = false;
+ isSelect: boolean = false;
+ statusOptions: any[] = BUSINESS_STATUS;
- selectedValue: string = BUSINESS_STATUS[0];
- listOfData: any[] = [];
- pageIndex: number = 1;
- pageSize: number = 10;
- total: number = 0;
- loading = false;
- isSelect: boolean = false;
- statusOptions: any[] = BUSINESS_STATUS;
+ getNssiList(): void {
+ this.loading = true;
+ this.isSelect = false;
+ this.listOfData = [];
+ let paramsObj = {
+ pageNo: this.pageIndex,
+ pageSize: this.pageSize,
+ };
+ if (this.selectedValue !== BUSINESS_STATUS[0]) {
+ paramsObj[
+ "instanceStatus"
+ ] = this.selectedValue.toLocaleLowerCase();
+ this.isSelect = true;
+ }
+ let getSlicingNssiListFailedCallback = () => {
+ this.loading = false;
+ };
+ this.myhttp
+ .getSlicingNssiList(
+ paramsObj,
+ this.isSelect,
+ getSlicingNssiListFailedCallback
+ )
+ .then((res) => {
+ const {
+ result_body: { nssi_service_instances, record_number },
+ } = res;
+ this.loading = false;
+ this.total = record_number;
+ this.loading = false;
+ if (
+ nssi_service_instances !== null &&
+ nssi_service_instances.length > 0
+ ) {
+ this.listOfData = nssi_service_instances;
+ }
+ });
+ }
- getNssiList(): void {
- this.loading = true;
- this.isSelect = false;
- this.listOfData = [];
- let paramsObj = {
- pageNo: this.pageIndex,
- pageSize: this.pageSize
- };
- if (this.selectedValue !== BUSINESS_STATUS[0]) {
- paramsObj["instanceStatus"] = this.selectedValue.toLocaleLowerCase();
- this.isSelect = true;
- }
- let getSlicingNssiListFailedCallback = () => {
- this.loading = false;
- }
- this.myhttp.getSlicingNssiList(paramsObj, this.isSelect, getSlicingNssiListFailedCallback).then(res => {
- const { result_body: {nssi_service_instances, record_number} } = res;
- this.loading = false;
- this.total = record_number;
- this.loading = false;
- if (nssi_service_instances !== null && nssi_service_instances.length > 0) {
- this.listOfData = nssi_service_instances;
- }
- })
- }
+ getListOfProcessingStatus() {
+ this.pageIndex = 1;
+ this.pageSize = 10;
+ this.getNssiList();
+ }
- getListOfProcessingStatus() {
- this.pageIndex = 1;
- this.pageSize = 10;
- this.getNssiList();
- }
+ searchData(reset: boolean = false) {
+ this.getNssiList();
+ }
- searchData(reset: boolean = false) {
- this.getNssiList();
- }
-
- showdetail(data) {
- const nssiModal = this.modalService.create({
- nzTitle: "Detail",
- nzContent: NssiModelComponent,
- nzWidth: "70%",
- nzOkText: null,
- nzCancelText: null,
- nzComponentParams: {
- nssiId: data.service_instance_id
- }
- })
- }
+ showdetail(data) {
+ const nssiModal = this.modalService.create({
+ nzTitle: "Detail",
+ nzContent: NssiModelComponent,
+ nzWidth: "70%",
+ nzOkText: null,
+ nzCancelText: null,
+ nzComponentParams: {
+ nssiId: data.service_instance_id,
+ },
+ });
+ }
}