summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcyuamber <xuranyjy@chinamobile.com>2020-02-25 10:50:45 +0800
committercyuamber <xuranyjy@chinamobile.com>2020-02-25 10:50:51 +0800
commitc6b270f19596b513d4a855d40c55ac754b726955 (patch)
tree7046cd6c7bc157c9135cb15b5636c3943c457bcb
parentddb1fd59f02c706a4eac5450ede97c996110a494 (diff)
feat:Optimize the code of CSMF slicing page
Change-Id: I1643dc7522678c66a6baf1e493daf6a3f29a2b57 Issue-ID: USECASEUI-368 Signed-off-by: cyuamber <xuranyjy@chinamobile.com>
-rw-r--r--usecaseui-portal/src/app/core/services/slicingTaskServices.ts12
-rw-r--r--usecaseui-portal/src/app/mock/json/csmf_slicing_businessData.json62
-rw-r--r--usecaseui-portal/src/app/views/services/slicing-management/csmf-slicing-business-management/business-order/business-order.component.ts10
-rw-r--r--usecaseui-portal/src/app/views/services/slicing-management/csmf-slicing-business-management/csmf-slicing-business-management.component.html6
-rw-r--r--usecaseui-portal/src/app/views/services/slicing-management/csmf-slicing-business-management/csmf-slicing-business-management.component.ts31
-rw-r--r--usecaseui-portal/src/app/views/services/slicing-management/slicing-management.component.ts1
6 files changed, 90 insertions, 32 deletions
diff --git a/usecaseui-portal/src/app/core/services/slicingTaskServices.ts b/usecaseui-portal/src/app/core/services/slicingTaskServices.ts
index 3c55a0c1..7606a47d 100644
--- a/usecaseui-portal/src/app/core/services/slicingTaskServices.ts
+++ b/usecaseui-portal/src/app/core/services/slicingTaskServices.ts
@@ -112,7 +112,7 @@ export class SlicingTaskServices {
}
// Get slicing business list
- getSlicingBusinessList(paramsObj, isSelect: boolean) {
+ getSlicingBusinessList(paramsObj: any, isSelect: boolean) {
let url = this.url.slicingBusinessList.replace("{pageNo}", paramsObj.pageNo)
.replace("{pageSize}", paramsObj.pageSize);
if (isSelect) {
@@ -122,7 +122,7 @@ export class SlicingTaskServices {
return this.http.get<any>(url);
}
// change slicing business activate status
- changeActivateSlicingService(paramsObj, activate: boolean) {
+ changeActivateSlicingService(paramsObj: any, activate: boolean) {
let url = this.url.activateSlicingService.replace("{serviceId}", paramsObj.serviceId);
if (!activate) {
url = this.url.deactivateSlicingService.replace("{serviceId}", paramsObj.serviceId)
@@ -130,12 +130,12 @@ export class SlicingTaskServices {
return this.http.put<any>(url, paramsObj);
}
// terminate slicing business
- terminateSlicingService(paramsObj) {
+ terminateSlicingService(paramsObj: any) {
const url = this.url.terminateSlicingService.replace('{serviceId}', paramsObj.serviceId);
return this.http.delete<any>(url);
}
// query slicing business progress
- getSlicingBusinessProgress(paramsObj) {
+ getSlicingBusinessProgress(paramsObj: any) {
let url = this.url.queryOperationProgress.replace("{serviceId}", paramsObj.serviceId);
return this.http.get<any>(url);
}
@@ -175,7 +175,7 @@ export class SlicingTaskServices {
return this.http.get<any>(url);
}
// Get CSMF slicing business list
- getCSMFSlicingBusinessList(paramsObj) {
+ getCSMFSlicingBusinessList(paramsObj: any) {
let url = this.url.csmfSlicingBusinessList.replace("{status}", paramsObj.status).replace("{pageNo}", paramsObj.pageNo)
.replace("{pageSize}", paramsObj.pageSize);
return this.http.get<any>(url);
@@ -198,7 +198,7 @@ export class SlicingTaskServices {
let url = this.url.csmfGetProgress.replace("{serviceId}", paramsObj.serviceId);
return this.http.get<any>(url);
}
- csmfSlicingPurchase(paramsObj){
+ csmfSlicingPurchase(paramsObj: any){
let url = this.url.csmfPurchase;
return this.http.post<any>(url, paramsObj);
}
diff --git a/usecaseui-portal/src/app/mock/json/csmf_slicing_businessData.json b/usecaseui-portal/src/app/mock/json/csmf_slicing_businessData.json
index a47bbf35..c2d126de 100644
--- a/usecaseui-portal/src/app/mock/json/csmf_slicing_businessData.json
+++ b/usecaseui-portal/src/app/mock/json/csmf_slicing_businessData.json
@@ -4,7 +4,7 @@
"result_message": "Query all slicing services processing succeeded."
},
"result_body": {
- "record_number": 8,
+ "record_number": 12,
"slicing_order_list": [
{
"order_id": "5G-777",
@@ -85,6 +85,66 @@
"order_status": "DELETE",
"last_operation_type": "DELETE",
"last_operation_progress": "30"
+ },
+ {
+ "order_id": "6c52086a-e9b6-4f31-bc7a-7b34d66c69c0",
+ "order_name": "test_0204",
+ "order_creation_time":"1454171445000",
+ "service_type": "embb",
+ "service_snssai": "01-774F54FC",
+ "order_status": "deactivated",
+ "last_operation_type": "deactivated",
+ "last_operation_progress": "100"
+ },
+ {
+ "order_id": "6c52086a-e9b6-4f31-bc7a-7b34d66c69c0",
+ "order_name": "test_0204",
+ "order_creation_time":"1454171445000",
+ "service_type": "embb",
+ "service_snssai": "01-774F54FC",
+ "order_status": "deactivated",
+ "last_operation_type": "deactivated",
+ "last_operation_progress": "100"
+ },
+ {
+ "order_id": "6c52086a-e9b6-4f31-bc7a-7b34d66c69c0",
+ "order_name": "test_0204",
+ "order_creation_time":"1454171445000",
+ "service_type": "embb",
+ "service_snssai": "01-774F54FC",
+ "order_status": "deactivated",
+ "last_operation_type": "deactivated",
+ "last_operation_progress": "100"
+ },
+ {
+ "order_id": "6c52086a-e9b6-4f31-bc7a-7b34d66c69c0",
+ "order_name": "test_0204",
+ "order_creation_time":"1454171445000",
+ "service_type": "embb",
+ "service_snssai": "01-774F54FC",
+ "order_status": "deactivated",
+ "last_operation_type": "deactivated",
+ "last_operation_progress": "100"
+ },
+ {
+ "order_id": "6c52086a-e9b6-4f31-bc7a-7b34d66c69c0",
+ "order_name": "test_0204",
+ "order_creation_time":"1454171445000",
+ "service_type": "embb",
+ "service_snssai": "01-774F54FC",
+ "order_status": "deactivated",
+ "last_operation_type": "deactivated",
+ "last_operation_progress": "100"
+ },
+ {
+ "order_id": "6c52086a-e9b6-4f31-bc7a-7b34d66c69c0",
+ "order_name": "test_0204",
+ "order_creation_time":"1454171445000",
+ "service_type": "embb",
+ "service_snssai": "01-774F54FC",
+ "order_status": "deactivated",
+ "last_operation_type": "deactivated",
+ "last_operation_progress": "100"
}
]
}
diff --git a/usecaseui-portal/src/app/views/services/slicing-management/csmf-slicing-business-management/business-order/business-order.component.ts b/usecaseui-portal/src/app/views/services/slicing-management/csmf-slicing-business-management/business-order/business-order.component.ts
index 5320a064..99cbde98 100644
--- a/usecaseui-portal/src/app/views/services/slicing-management/csmf-slicing-business-management/business-order/business-order.component.ts
+++ b/usecaseui-portal/src/app/views/services/slicing-management/csmf-slicing-business-management/business-order/business-order.component.ts
@@ -48,7 +48,7 @@ export class BusinessOrderComponent implements OnInit {
let areaList = ['Beijing;Beijing;Haidian District;Wanshoulu Street'];
this.areaList = areaList.map((item: any) => {
let arr = item.split(';');
- item = arr.map((ite, index) => {
+ item = arr.map((it, index) => {
let key: string;
if (!index) {
key = 'province';
@@ -61,8 +61,8 @@ export class BusinessOrderComponent implements OnInit {
}
const obj: any = {};
obj.key = key;
- obj.selected = ite;
- obj.options = [{name: ite, id: ite}]
+ obj.selected = it;
+ obj.options = [{name: it, id: it}]
return obj
})
return item;
@@ -156,7 +156,7 @@ export class BusinessOrderComponent implements OnInit {
};
}
- changeTooltipText(title): void {
+ changeTooltipText(title: string): void {
if (title === 'Max Number of UEs') {
this.tooltipText = 'Scope: 1-100000'
} else if (title === 'Data Rate Downlink (Mbps)' || title === 'Data Rate Uplink (Mbps)') {
@@ -196,7 +196,7 @@ export class BusinessOrderComponent implements OnInit {
console.log(paramsObj, "-----paramsObj");
this.isSpinning = true;
this.myhttp.csmfSlicingPurchase(paramsObj).subscribe(res => {
- const {result_header: {result_code, result_message}, result_body: {service_id, operation_id}} = res;
+ const {result_header: {result_code}} = res;
if (+result_code === 200) {
this.isSpinning = false;
this.handleCancel();
diff --git a/usecaseui-portal/src/app/views/services/slicing-management/csmf-slicing-business-management/csmf-slicing-business-management.component.html b/usecaseui-portal/src/app/views/services/slicing-management/csmf-slicing-business-management/csmf-slicing-business-management.component.html
index 0c3983dd..936338dc 100644
--- a/usecaseui-portal/src/app/views/services/slicing-management/csmf-slicing-business-management/csmf-slicing-business-management.component.html
+++ b/usecaseui-portal/src/app/views/services/slicing-management/csmf-slicing-business-management/csmf-slicing-business-management.component.html
@@ -12,7 +12,7 @@
<div class="slicing-resource-table-list">
<nz-table #basicTable [nzData]="listOfData" [nzFrontPagination]="false" nzShowSizeChanger
[nzPageSizeOptions]="[5,10,15,20]" [nzTotal]='total' [(nzPageSize)]="pageSize" [(nzPageIndex)]='pageIndex'
- [nzLoading]="loading" (nzPageIndexChange)="searchData()" (nzPageSizeChange)="searchData(true)">
+ [nzLoading]="loading" (nzPageIndexChange)="searchData()" (nzPageSizeChange)="searchData()">
<thead>
<tr>
<th width=100>No</th>
@@ -44,7 +44,7 @@
<td>
<div class="action-icon">
<nz-switch [ngModel]="data.order_status==='activated'?true:false"
- [nzDisabled]="data.order_status === 'processing'|| (data.order_status !== 'processing' && data.last_operation_progress && data.last_operation_progress !== '100')"
+ [nzDisabled]="data.order_status === 'processing' || data.order_status === 'error' || (data.order_status !== 'processing' && data.last_operation_progress && data.last_operation_progress !== '100')"
(ngModelChange)="switchChange(data,i)"></nz-switch>
<nz-progress
*ngIf="data.last_operation_type && data.last_operation_progress && data.last_operation_progress !== '100' && data.last_operation_type !== 'DELETE'"
@@ -54,7 +54,7 @@
</td>
<td>
<div class="action-icon">
- <i [ngClass]="{'cannotclick':data.order_status === 'processing' || ( data.last_operation_progress && data.last_operation_progress !== '100' && (data.last_operation_type === 'DELETE' || data.last_operation_type === 'activated'))}"
+ <i [ngClass]="{'cannotclick':data.order_status === 'processing' || data.order_status === 'error' || ( data.last_operation_progress && data.last_operation_progress !== '100' && (data.last_operation_type === 'DELETE' || data.last_operation_type === 'activated'))}"
nz-icon nzType="poweroff" nzTheme="outline" class="anticon anticon-poweroff"
(click)="terminate(data,i)"></i>
<nz-progress
diff --git a/usecaseui-portal/src/app/views/services/slicing-management/csmf-slicing-business-management/csmf-slicing-business-management.component.ts b/usecaseui-portal/src/app/views/services/slicing-management/csmf-slicing-business-management/csmf-slicing-business-management.component.ts
index 36a089cd..387c98d7 100644
--- a/usecaseui-portal/src/app/views/services/slicing-management/csmf-slicing-business-management/csmf-slicing-business-management.component.ts
+++ b/usecaseui-portal/src/app/views/services/slicing-management/csmf-slicing-business-management/csmf-slicing-business-management.component.ts
@@ -41,7 +41,7 @@ export class CsmfSlicingBusinessManagementComponent implements OnInit {
progressingTimer: any[] = [];
terminateStart: any[] = [];
businessOrderShow: boolean = false;
- getCSMFBusinessList() {
+ getCSMFBusinessList(): void {
this.loading = true;
this.listOfData = [];
let paramsObj = {
@@ -66,7 +66,7 @@ export class CsmfSlicingBusinessManagementComponent implements OnInit {
};
if (item.last_operation_type === 'DELETE') this.terminateStart[index] = true
else this.terminateStart[index] = false;
- this.queryProgress(obj, index, updata).then((res) => {
+ this.queryProgress(obj, index, updata).then(() => {
item.last_operation_progress = '100';
this.getCSMFBusinessList();
})
@@ -78,7 +78,7 @@ export class CsmfSlicingBusinessManagementComponent implements OnInit {
})
}
- getListOfProcessingStatus() {
+ getListOfProcessingStatus(): void {
this.pageIndex = 1;
this.pageSize = 10;
this.progressingTimer.forEach((item) => {
@@ -88,7 +88,7 @@ export class CsmfSlicingBusinessManagementComponent implements OnInit {
this.getCSMFBusinessList();
}
- searchData(reset: boolean = false) {
+ searchData(): void {
this.progressingTimer.forEach((item) => {
clearInterval(item.timer);
});
@@ -96,8 +96,7 @@ export class CsmfSlicingBusinessManagementComponent implements OnInit {
this.getCSMFBusinessList();
}
- switchChange(slicing, i) {
- // console.log(slicing, i, "slicing");
+ switchChange(slicing:any, i:number): void {
this.modalService.confirm({
nzTitle: '<i>Are you sure you want to perform this task?</i>',
nzContent: '<b>Name:' + slicing.order_name + '</b>',
@@ -106,9 +105,9 @@ export class CsmfSlicingBusinessManagementComponent implements OnInit {
serviceId: slicing.order_id
};
if (slicing.order_status === 'activated') {
- this.changeActivate(paramsObj, false, slicing, "deactivate", "deactivated", i)
+ this.changeActivate(paramsObj, false, i)
} else {
- this.changeActivate(paramsObj, true, slicing, "activate", "activated", i);
+ this.changeActivate(paramsObj, true, i);
}
},
nzCancelText: 'No',
@@ -119,10 +118,10 @@ export class CsmfSlicingBusinessManagementComponent implements OnInit {
}
});
}
- changeActivate(paramsObj, isActivate, slicing, activateValue, finished, index) {
+ changeActivate(paramsObj: any, isActivate: boolean, index: number): void {
this.loading = true;
this.myhttp.changeActivateSlicingService(paramsObj, isActivate).subscribe(res => {
- const { result_header: { result_code, result_message }, result_body: { operation_id } } = res;
+ const { result_header: { result_code } } = res;
this.loading = false;
if (+result_code === 200) {
this.getCSMFBusinessList();
@@ -142,7 +141,7 @@ export class CsmfSlicingBusinessManagementComponent implements OnInit {
})
}
- terminate(slicing, index) {
+ terminate(slicing: any, index: number): void {
this.modalService.confirm({
nzTitle: 'Are you sure you want to terminate this task?',
nzContent: '<b>Name:&nbsp;</b>' + slicing.order_name,
@@ -151,7 +150,7 @@ export class CsmfSlicingBusinessManagementComponent implements OnInit {
this.terminateStart[index] = true;
this.loading = true;
this.myhttp.terminateSlicingService(paramsObj).subscribe(res => {
- const { result_header: { result_code, result_message }, result_body: { operation_id } } = res;
+ const { result_header: { result_code } } = res;
this.loading = false;
if (+result_code === 200) {
this.getCSMFBusinessList();
@@ -169,12 +168,12 @@ export class CsmfSlicingBusinessManagementComponent implements OnInit {
}
});
}
- queryProgress(obj, index, callback) {
+ queryProgress(obj:any, index:number, callback:any) {
return new Promise(res => {
let requery = () => {
this.myhttp.getSlicingBusinessProgress(obj)
.subscribe((data) => {
- const { result_header: { result_code, result_message }, result_body: { operation_id } } = data;
+ const { result_header: { result_code, result_message }} = data;
if (+result_code === 200) {
if (data.result_body.operation_progress && Number(data.result_body.operation_progress) < 100) {
callback(data.result_body);
@@ -216,10 +215,10 @@ export class CsmfSlicingBusinessManagementComponent implements OnInit {
})
}
- OrderModelShow() {
+ OrderModelShow(): void {
this.businessOrderShow = true;
}
- orderModelClose($event) {
+ orderModelClose($event: any): void {
this.businessOrderShow = $event;
this.getCSMFBusinessList();
}
diff --git a/usecaseui-portal/src/app/views/services/slicing-management/slicing-management.component.ts b/usecaseui-portal/src/app/views/services/slicing-management/slicing-management.component.ts
index 0520824c..3ad730fb 100644
--- a/usecaseui-portal/src/app/views/services/slicing-management/slicing-management.component.ts
+++ b/usecaseui-portal/src/app/views/services/slicing-management/slicing-management.component.ts
@@ -17,7 +17,6 @@ export class SlicingManagementComponent implements OnInit {
}
currentTab = 'Communication Service';
handleTabChange($event): void {
- console.log($event,"$event");
this.currentTab = $event.tab._title;
}
}