summaryrefslogtreecommitdiffstats
path: root/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management
diff options
context:
space:
mode:
authorwangyuerg <wangyuerg@chinamobile.com>2021-03-25 17:26:37 +0800
committerwangyuerg <wangyuerg@chinamobile.com>2021-03-25 17:27:39 +0800
commitd8fdbce9d57317955fbe6c0e3c6fd1f031396e0c (patch)
treea2e0e5b3ce3350c7766ea25e0964f2454e43dc23 /usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management
parent98be53b1e812f48539019036227b16f18f7d8aac (diff)
fix: fix the bug of loading
Signed-off-by: wangyuerg <wangyuerg@chinamobile.com> Change-Id: Id63f6fbd3e831af9c9216d505f546436648e087a Issue-ID: USECASEUI-527
Diffstat (limited to 'usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management')
-rw-r--r--usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-model/subnet-params-model/subnet-params-model.component.html7
-rw-r--r--usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-model/subnet-params-model/subnet-params-model.component.ts82
2 files changed, 47 insertions, 42 deletions
diff --git a/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-model/subnet-params-model/subnet-params-model.component.html b/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-model/subnet-params-model/subnet-params-model.component.html
index 711a1355..224be555 100644
--- a/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-model/subnet-params-model/subnet-params-model.component.html
+++ b/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-model/subnet-params-model/subnet-params-model.component.html
@@ -57,9 +57,10 @@
</nz-input-group>
<!-- connection links table -->
<div *ngIf="item.type==='table-radio'">
- <nz-table #basicTable [nzLoading]="loading" [nzData]="connectionLinkTable" nzShowPagination="true"
- [nzPageSize]="pageSize" (nzPageIndexChange)="pageIndexChange($event)"
- nzFrontPagination="false" [nzTotal]="recordNum">
+ <nz-table #basicTable [nzLoading]="loading" [nzLoadingDelay]="loadingDelay"
+ [nzData]="connectionLinkTable" nzShowPagination="true" [nzPageSize]="pageSize"
+ (nzPageIndexChange)="pageIndexChange($event)" nzFrontPagination="false"
+ [nzTotal]="recordNum">
<thead>
<tr>
<th *ngFor="let val of connectionTableHeader" class="subnet_td">{{val}}</th>
diff --git a/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-model/subnet-params-model/subnet-params-model.component.ts b/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-model/subnet-params-model/subnet-params-model.component.ts
index 3db19334..2d2dd7fa 100644
--- a/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-model/subnet-params-model/subnet-params-model.component.ts
+++ b/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-model/subnet-params-model/subnet-params-model.component.ts
@@ -49,8 +49,9 @@ export class SubnetParamsModelComponent implements OnInit {
connectionTableHeader: string[] = [];
pageSize: number = 2;
recordNum: number = 0;
- hasPageNo: number[] = [];
+ // hasPageNo: number[] = [];
loading = false;
+ loadingDelay = 100;
objectKeys = Object.keys;
// Comment: Above code
@@ -129,14 +130,15 @@ export class SubnetParamsModelComponent implements OnInit {
}
addCheckStatus() {
- if(this.connectionLinkTable && this.connectionLinkTable.length>0){
+ if (this.connectionLinkTable && this.connectionLinkTable.length > 0) {
this.connectionLinkTable.forEach((item) => {
if (
item.hasOwnProperty("linkId") &&
typeof this.formData["sliceProfile_TN_connection_links"] !==
"undefined" &&
this.formData["sliceProfile_TN_connection_links"] !== "" &&
- this.formData["sliceProfile_TN_connection_links"] !== null &&
+ this.formData["sliceProfile_TN_connection_links"] !==
+ null &&
item["linkId"] ===
this.formData["sliceProfile_TN_connection_links"]
) {
@@ -171,7 +173,7 @@ export class SubnetParamsModelComponent implements OnInit {
.then((res) => {
if (pageNo === 1) {
// the first page
- this.loading = false
+ this.loading = false;
this.connectionLinkTable =
res.result_body.connection_links_list;
this.recordNum = res.result_body.record_number;
@@ -195,7 +197,7 @@ export class SubnetParamsModelComponent implements OnInit {
// this.connectionLinkTable.push(defaultItem);
// }
// }
- this.hasPageNo = [1];
+ // this.hasPageNo = [1];
} else if (pageNo > 1) {
// delete the default page of the page and add the actual data of the page
// const startIndex = pageSize * (pageNo - 1);
@@ -213,8 +215,9 @@ export class SubnetParamsModelComponent implements OnInit {
this.connectionLinkTable =
res.result_body.connection_links_list;
this.recordNum = res.result_body.record_number;
+ this.loading = false;
}
- this.hasPageNo.push(pageNo);
+ // this.hasPageNo.push(pageNo);
this.addCheckStatus(); // add init check status for connection link table
this.judgeTn(); // init judge
this.getTableHeader();
@@ -223,40 +226,40 @@ export class SubnetParamsModelComponent implements OnInit {
getTableHeader(): void {
// Find the common key of all data
- if(this.connectionLinkTable && this.connectionLinkTable.length>0){
- let keyList: any[] = this.connectionLinkTable.map((item) => {
- return Object.keys(item);
- });
- this.connectionTableHeader = this.Util.intersection(keyList).filter(
- (item) => {
- return item !== "checked";
- }
- );
- // Filter redundant items in table data
- this.connectionLinkTable.forEach((item) => {
- for (let key in item) {
- if (
- key !== "linkId" &&
- key !== "checked" &&
- this.connectionTableHeader.indexOf(key) === -1
- ) {
- delete item[key];
- } else {
- // Filter out the null values in each item
- for (let i in item[key]) {
- if (
- i === "jitter" &&
- (item[key][i] === "" ||
- item[key][i] === "null" ||
- item[key][i] === null)
- ) {
- delete item[key][i];
+ if (this.connectionLinkTable && this.connectionLinkTable.length > 0) {
+ let keyList: any[] = this.connectionLinkTable.map((item) => {
+ return Object.keys(item);
+ });
+ this.connectionTableHeader = this.Util.intersection(keyList).filter(
+ (item) => {
+ return item !== "checked";
+ }
+ );
+ // Filter redundant items in table data
+ this.connectionLinkTable.forEach((item) => {
+ for (let key in item) {
+ if (
+ key !== "linkId" &&
+ key !== "checked" &&
+ this.connectionTableHeader.indexOf(key) === -1
+ ) {
+ delete item[key];
+ } else {
+ // Filter out the null values in each item
+ for (let i in item[key]) {
+ if (
+ i === "jitter" &&
+ (item[key][i] === "" ||
+ item[key][i] === "null" ||
+ item[key][i] === null)
+ ) {
+ delete item[key][i];
+ }
}
}
}
- }
- });
- }
+ });
+ }
}
pageIndexChange(e) {
@@ -270,10 +273,11 @@ export class SubnetParamsModelComponent implements OnInit {
}
judgeTn(): void {
- console.log('fprm',this.formData)
+ console.log("fprm", this.formData);
if (
this.formData["sliceProfile_TN_resourceSharingLevel"] ===
- "non-shared" || this.formData["sliceProfile_TN_resourceSharingLevel"]==null
+ "non-shared" ||
+ this.formData["sliceProfile_TN_resourceSharingLevel"] == null
) {
//:todo clear??
// this.connectionLinkTable.forEach((item) => {