diff options
author | 2021-02-08 18:25:45 +0800 | |
---|---|---|
committer | 2021-02-08 18:27:06 +0800 | |
commit | 3083d85413ae97d88835de11f4acf7fa046806c6 (patch) | |
tree | f0652955676b12dfa4134ffee75d6495c5aada4d /usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-model/subnet-params-model | |
parent | 382544e01b173e6d0781f686ff36f554e07eeafb (diff) |
fix: Simplify Pagination
Signed-off-by: wangyuerg <wangyuerg@chinamobile.com>
Change-Id: Ibb2619b2bf5bb801581bb2a2199af7d4ecfbc5c7
Issue-ID: USECASEUI-527
Diffstat (limited to 'usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-model/subnet-params-model')
3 files changed, 49 insertions, 44 deletions
diff --git a/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-model/subnet-params-model/constants.ts b/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-model/subnet-params-model/constants.ts index 5f8c3847..0e0e5503 100644 --- a/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-model/subnet-params-model/constants.ts +++ b/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-model/subnet-params-model/constants.ts @@ -42,7 +42,7 @@ export const TRANSFRER_FORM_ITEMS = [ title: "Resource Sharing Level", // select key: "sliceProfile_TN_resourceSharingLevel", // :new required: true, - disable: false, + disable: true, type: "radio", options: [ { 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 37e5db5b..b496349d 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 @@ -12,7 +12,7 @@ <input nz-input [(ngModel)]="formData[item.key]" [name]="item.key" [id]="item.key" [disabled]="item.disable" [placeholder]="inputHolder(item.title)" *ngIf="item.type==='input'" /> <nz-radio-group [name]=" item.key" [(ngModel)]="formData[item.key]" *ngIf="item.type==='radio'" - (ngModelChange)="changeResourceShare()"> + [disabled]="item.disable"> <label nz-radio [nzValue]="option.key" *ngFor="let option of item.options"> {{ option.title }} </label> @@ -58,7 +58,8 @@ <!-- connection links table --> <div *ngIf="item.type==='table-radio'"> <nz-table #basicTable [nzData]="connectionLinkTable" nzShowPagination="true" - [nzPageSize]="pageSize" (nzPageIndexChange)="pageIndexChange($event)"> + [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 636fd9e6..c9836c9b 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 @@ -142,9 +142,9 @@ export class SubnetParamsModelComponent implements OnInit { }); } - changeResourceShare() { - this.judgeTn(); - } + // changeResourceShare() { + // this.judgeTn(); + // } isObject(val) { if (Object.prototype.toString.call(val) === "[object Object]") { @@ -168,40 +168,43 @@ export class SubnetParamsModelComponent implements OnInit { res.result_body.connection_links_list; this.recordNum = res.result_body.record_number; // Use default value to occupy - let defaultItem: object = {}; - if (this.connectionLinkTable.length !== 0) { - defaultItem = JSON.parse( - JSON.stringify(this.connectionLinkTable[0]) - ); - for (let key in defaultItem) { - if (!this.isObject(defaultItem[key])) { - defaultItem[key] = ""; - } - // else { - // for (let i in defaultItem[key]) { - // defaultItem[key][i] = ""; - // } - // } - } - for (let i = pageSize; i < this.recordNum; i++) { - this.connectionLinkTable.push(defaultItem); - } - } + // let defaultItem: object = {}; + // if (this.connectionLinkTable.length !== 0) { + // defaultItem = JSON.parse( + // JSON.stringify(this.connectionLinkTable[0]) + // ); + // for (let key in defaultItem) { + // if (!this.isObject(defaultItem[key])) { + // defaultItem[key] = ""; + // } + // // else { + // // for (let i in defaultItem[key]) { + // // defaultItem[key][i] = ""; + // // } + // // } + // } + // for (let i = pageSize; i < this.recordNum; i++) { + // this.connectionLinkTable.push(defaultItem); + // } + // } 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); - const endIndex = startIndex + pageSize - 1; - this.connectionLinkTable.splice(startIndex, pageSize); - const frontArr = this.connectionLinkTable.slice( - 0, - startIndex - ); - const backArr = this.connectionLinkTable.slice(startIndex); - this.connectionLinkTable = frontArr.concat( - res.result_body.connection_links_list, - backArr - ); + // const startIndex = pageSize * (pageNo - 1); + // const endIndex = startIndex + pageSize - 1; + // this.connectionLinkTable.splice(startIndex, pageSize); + // const frontArr = this.connectionLinkTable.slice( + // 0, + // startIndex + // ); + // const backArr = this.connectionLinkTable.slice(startIndex); + // this.connectionLinkTable = frontArr.concat( + // res.result_body.connection_links_list, + // backArr + // ); + this.connectionLinkTable = + res.result_body.connection_links_list; + this.recordNum = res.result_body.record_number; } this.hasPageNo.push(pageNo); this.addCheckStatus(); // add init check status for connection link table @@ -248,9 +251,9 @@ export class SubnetParamsModelComponent implements OnInit { pageIndexChange(e) { // judge whether there is data of the page, if not, request it from the back end - if (this.hasPageNo.indexOf(e) === -1) { - this.getConnectionLinkTable(e, this.pageSize); - } + // if (this.hasPageNo.indexOf(e) === -1) { + this.getConnectionLinkTable(e, this.pageSize); + // } } getConnetionFailed() { console.log("failed"); @@ -261,10 +264,11 @@ export class SubnetParamsModelComponent implements OnInit { this.formData["sliceProfile_TN_resourceSharingLevel"] === "non-shared" ) { - this.connectionLinkTable.forEach((item) => { - item.checked = false; - }); - this.formData["tn_connection_links"] = null; + //:todo clear?? + // this.connectionLinkTable.forEach((item) => { + // item.checked = false; + // }); + // this.formData["tn_connection_links"] = null; this.notPassPara = ["tn_connection_links"]; this.transferFormItems.forEach((item) => { if (item.title === "Connection Links") { |