diff options
Diffstat (limited to 'usecaseui-portal/src/app/views/services')
2 files changed, 37 insertions, 54 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 943b946d..85ed0880 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 @@ -2,30 +2,16 @@ <div nz-row> <div nz-col nzSpan="12" class="task_status"> <span>Status : </span> - <nz-select - nzShowSearch - nzAllowClear - [(ngModel)]="selectedValue" - nzPlaceHolder="Select a processing status" - (ngModelChange)="processingStatusChange()" - > + <nz-select nzShowSearch nzAllowClear [(ngModel)]="selectedValue" nzPlaceHolder="Select a processing status" + (ngModelChange)="processingStatusChange()"> <nz-option *ngFor="let item of statusOptions" [nzLabel]="item.title" [nzValue]="item.value"></nz-option> </nz-select> </div> </div> <div> - <nz-table - #basicTable - nzShowPagination - nzPageSizeOptions - nzShowSizeChanger - [nzTotal]="total" - [nzLoading]="loading" - [nzData]="listOfData" - [nzFrontPagination]="false" - (nzPageSizeChange)="pageSizeChange($event)" - (nzPageIndexChange)="pageNumChange($event)" - > + <nz-table #basicTable nzShowPagination nzPageSizeOptions nzShowSizeChanger [nzTotal]="total" [nzLoading]="loading" + [nzData]="listOfData" [nzFrontPagination]="false" (nzPageSizeChange)="pageSizeChange($event)" + (nzPageIndexChange)="pageNumChange($event)"> <thead> <tr> <th>任务ID</th> @@ -43,10 +29,11 @@ <td>{{ data.task_name }}</td> <td>{{ data.service_snssai }}</td> <td>{{ data.service_type }}</td> - <td>{{ data.arrival_time }}</td> + <td>{{ data.create_time }}</td> <td>{{ data.status }}</td> <td> - <span *ngIf="data.processing_status === 'Planning'" class="task_operation_disabled">{{ data.operation }}</span> + <span *ngIf="data.processing_status === 'Planning'" + class="task_operation_disabled">{{ data.operation }}</span> <a (click)="showdetail(data)" *ngIf="data.processing_status !== 'Planning'">{{ data.operation }}</a> </td> </tr> @@ -56,11 +43,7 @@ <app-slicing-task-model [moduleTitle]="moduleTitle" [showDetail]="showDetail" [taskId]="taskId" (cancel)="showDetail=$event"> </app-slicing-task-model> - <app-check-process-model - [moduleTitle]="moduleTitle" - [showProcess]="showProcess" - [taskId]="taskId" - (cancel)="showProcess=$event" - > + <app-check-process-model [moduleTitle]="moduleTitle" [showProcess]="showProcess" [taskId]="taskId" + (cancel)="showProcess=$event"> </app-check-process-model> </div>
\ No newline at end of file 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 26f485b9..e70e6d44 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 @@ -12,27 +12,27 @@ import { TASK_PROCESSING_STATUS } from '../../../../../constants/constants'; export class SlicingTaskManagementComponent implements OnInit { constructor(private myhttp: SlicingTaskServices, private message: NzMessageService) { } - + showDetail: boolean = false; showProcess: boolean = false; selectedValue = null; taskId: string; moduleTitle: string = ""; - listOfData: any[] = []; + listOfData: any[] = []; statusOptions: any[] = TASK_PROCESSING_STATUS; loading: boolean = false; total: number = 1; pageSize: string = '10'; pageNum: string = '1'; - ngOnInit() { + ngOnInit() { this.getTaskList() } - getTaskList (): void{ + getTaskList(): void { const { pageNum, pageSize } = this; this.loading = true; - this.myhttp.getSlicingTaskList(pageNum, pageSize).subscribe (res => { + this.myhttp.getSlicingTaskList(pageNum, pageSize).subscribe(res => { const { result_header: { result_code }, result_body } = res if (+result_code === 200) { const { slicing_task_list, record_number } = result_body; @@ -40,12 +40,12 @@ export class SlicingTaskManagementComponent implements OnInit { this.total = record_number; } else { this.message.error('Failed to get form data') - } + } this.loading = false; }) } - processingStatusChange():void { + processingStatusChange(): void { this.pageSize = '10'; this.pageNum = '1'; if (this.selectedValue) { @@ -55,23 +55,23 @@ export class SlicingTaskManagementComponent implements OnInit { } } - getListOfProcessingStatus (): void { + getListOfProcessingStatus(): void { const { selectedValue, pageNum, pageSize } = this; this.loading = true; - this.myhttp.getTaskProcessingStatus(selectedValue, pageNum+'', pageSize+'').subscribe (res => { - const { result_header: { result_code }, result_body } = res - if (+result_code === 200) { - const { slicing_task_list,record_number } = result_body; - this.dataFormatting(slicing_task_list) - this.total = record_number; - } else { - this.message.error('Failed to get form data') - } - this.loading = false; - }) + this.myhttp.getTaskProcessingStatus(selectedValue, pageNum + '', pageSize + '').subscribe(res => { + const { result_header: { result_code }, result_body } = res + if (+result_code === 200) { + const { slicing_task_list, record_number } = result_body; + this.dataFormatting(slicing_task_list) + this.total = record_number; + } else { + this.message.error('Failed to get form data') + } + this.loading = false; + }) } - pageSizeChange (pageSize: number): void{ + pageSizeChange(pageSize: number): void { this.pageSize = pageSize + ''; const { selectedValue } = this; if (selectedValue) { @@ -81,7 +81,7 @@ export class SlicingTaskManagementComponent implements OnInit { } } - pageNumChange (pageNum: number): void{ + pageNumChange(pageNum: number): void { this.pageNum = pageNum + ''; const { selectedValue } = this; if (selectedValue) { @@ -91,10 +91,10 @@ export class SlicingTaskManagementComponent implements OnInit { } } - dataFormatting(list: any):void{ - this.listOfData = list.map( item => { - item.arrival_time = moment(+item.arrival_time).format('YYYY-MM-DD hh:mm') - switch (item.processing_status){ + dataFormatting(list: any): void { + this.listOfData = list.map(item => { + item.create_time = moment(item.create_time).format('YYYY-MM-DD hh:mm') + switch (item.processing_status) { case 'Planning': item.status = '规划阶段'; item.operation = '任务处理' @@ -107,7 +107,7 @@ export class SlicingTaskManagementComponent implements OnInit { item.status = '切片创建中'; item.operation = '查看进度' break; - case 'Completed': + case 'Completed': item.status = '创建完成'; item.operation = '查看结果' break; @@ -119,7 +119,7 @@ export class SlicingTaskManagementComponent implements OnInit { showdetail(data: any): void { this.taskId = data.task_id; this.moduleTitle = data.status; - if(data.status === '审核阶段') { + if (data.status === '审核阶段') { this.showDetail = true; } else { this.showProcess = true; |