diff options
author | zhangab <zhanganbing@chinamobile.com> | 2019-01-18 18:27:54 +0800 |
---|---|---|
committer | zhangab <zhanganbing@chinamobile.com> | 2019-01-18 18:28:03 +0800 |
commit | 9ed97927108df3ba9041441e89370fe4c2b6460a (patch) | |
tree | 1568bb575a6edcb2cc8a8e79a471b628a05a2a2c /usecaseui-portal/src/app/alarm | |
parent | 0c447e860195de10f27ff4ce32c9f0deec8b6f62 (diff) |
Fix VNF Alarm Query Bugs
Change-Id: I8df1f00de182e6c9f039e2e65237d3e8628c5717
Issue-ID: USECASEUI-165
Signed-off-by: zhangab <zhanganbing@chinamobile.com>
Diffstat (limited to 'usecaseui-portal/src/app/alarm')
-rw-r--r-- | usecaseui-portal/src/app/alarm/alarm.component.html | 214 | ||||
-rw-r--r-- | usecaseui-portal/src/app/alarm/alarm.component.less | 75 | ||||
-rw-r--r-- | usecaseui-portal/src/app/alarm/alarm.component.ts | 207 |
3 files changed, 288 insertions, 208 deletions
diff --git a/usecaseui-portal/src/app/alarm/alarm.component.html b/usecaseui-portal/src/app/alarm/alarm.component.html index 894cdf5b..6e345a4e 100644 --- a/usecaseui-portal/src/app/alarm/alarm.component.html +++ b/usecaseui-portal/src/app/alarm/alarm.component.html @@ -13,105 +13,121 @@ See the License for the specific language governing permissions and limitations under the License. --> -<h3 class="title"> <span (click)="detailHide()" style="cursor:pointer;">Alarm</span> <span *ngIf="detailshow">> - Details</span> </h3> -<hr> -<div class="select" [@showHideAnimate]="state"> -<div class="query_criteria"> - <span>Source Name: </span> - <nz-dropdown [nzTrigger]="'click'" [nzPlacement]="'bottomLeft'"> - <button nz-button nz-dropdown><span>{{sourceNameSelected}}</span> <i class="anticon anticon-down"></i></button> - <ul nz-menu> - <li nz-menu-item (click)="choseSourceName(item)" *ngFor="let item of sourceNameList"> - <a>{{item}}</a> - </li> - </ul> - </nz-dropdown> - - <span>Priority: </span> - <nz-dropdown [nzTrigger]="'click'" [nzPlacement]="'bottomLeft'"> - <button nz-button nz-dropdown><span>{{prioritySelected}}</span> <i class="anticon anticon-down"></i></button> - <ul nz-menu> - <li nz-menu-item (click)="chosePriority(item)" *ngFor="let item of priorityList"> - <a>{{item}}</a> - </li> - </ul> - </nz-dropdown> - - <span>Status: </span> - <nz-dropdown [nzTrigger]="'click'" [nzPlacement]="'bottomLeft'"> - <button nz-button nz-dropdown><span>{{statusSelected}}</span> <i class="anticon anticon-down"></i></button> - <ul nz-menu> - <li nz-menu-item (click)="choseStatus(item)" *ngFor="let item of statusList"> - <a>{{item}}</a> - </li> - </ul> - </nz-dropdown> - <br> <br> - <span>Report Time: </span> - <nz-range-picker [(ngModel)]="dateRange" (ngModelChange)="onChange($event)" nzShowTime></nz-range-picker> +<h3 class="title"> <span (click)="detailHide()" style="cursor:pointer;" *ngIf="detailshow">Alarm</span> <span *ngIf="detailshow">> + Details</span> </h3> +<div style="padding:0px 20px 20px 20px;"> + <div class="charts" [@showHideAnimate]="state"> + <div class="chartsleft"> + <div class="active sctive_closed"> + <div>Active</div> + <div>13,980</div> + <div><nz-progress [nzPercent]="90" [nzShowInfo]="false"></nz-progress></div> + <div>There are 13980 faults waiting to be solved</div> + </div> + <div class="closed sctive_closed"> + <div>Closed</div> + <div>23,980</div> + <div><nz-progress [nzPercent]="30" [nzShowInfo]="false"></nz-progress></div> + <div>23,980 faults have been fixed</div> + </div> + </div> + <div class="chartsright"> + <span>Daily Total</span> + <app-line [initData]="alarmChartInit" [chartData]="alarmChartData"></app-line> + </div> + </div> + <div class="select" [@showHideAnimate]="state"> + <div class="query_criteria"> + <span>Source Name: </span> + <nz-dropdown [nzTrigger]="'click'" [nzPlacement]="'bottomLeft'"> + <button nz-button nz-dropdown><span>{{sourceNameSelected}}</span> <i class="anticon anticon-down"></i></button> + <ul nz-menu> + <li nz-menu-item (click)="choseSourceName(item)" *ngFor="let item of sourceNameList"> + <a>{{item}}</a> + </li> + </ul> + </nz-dropdown> + + <span>Priority: </span> + <nz-dropdown [nzTrigger]="'click'" [nzPlacement]="'bottomLeft'"> + <button nz-button nz-dropdown><span>{{prioritySelected}}</span> <i class="anticon anticon-down"></i></button> + <ul nz-menu> + <li nz-menu-item (click)="chosePriority(item)" *ngFor="let item of priorityList"> + <a>{{item}}</a> + </li> + </ul> + </nz-dropdown> + + <span>Status: </span> + <nz-dropdown [nzTrigger]="'click'" [nzPlacement]="'bottomLeft'"> + <button nz-button nz-dropdown><span>{{statusSelected}}</span> <i class="anticon anticon-down"></i></button> + <ul nz-menu> + <li nz-menu-item (click)="choseStatus(item)" *ngFor="let item of statusList"> + <a>{{item}}</a> + </li> + </ul> + </nz-dropdown> + + <span>Report Time: </span> + <nz-range-picker [(ngModel)]="dateRange" (ngModelChange)="onChange($event)" nzShowTime></nz-range-picker> - <button class="search" nz-button [nzType]="'primary'" (click)="getAlarmFormData()"><i class="anticon anticon-search"></i><span>Search</span></button> -</div> -</div> -<div class="content" [@showHideAnimate]="state"> -<div class="title"> - <ul> - <li> - <h5>All</h5> - <p>{{alarmList.all }}</p> - </li> - <li> - <h5>Closed</h5> - <p>{{alarmList.closed }}</p> - </li> - <li> - <h5>Active</h5> - <p>{{alarmList.activeNum }}</p> - </li> - </ul> -</div> -<div class="chart"> - <h3>Alarm Chart</h3> - <nz-radio-group [(ngModel)]="size"> - <label nz-radio-button nzValue="day" (click)="day()"> day </label> - <label nz-radio-button nzValue="month" (click)="month()">month</label> - </nz-radio-group> - <div class="AlarmChart" [ngClass]="{'alarmChart-active':alarmShow}"> - <app-line [initData]="alarmChartInit" [chartData]="alarmChartData"></app-line> + <button class="search" nz-button [nzType]="'primary'" (click)="getAlarmFormData()"><i class="anticon anticon-search"></i><span>Search</span></button> + </div> + </div> + <div class="content" [@showHideAnimate]="state"> + <!-- <div class="title"> + <ul> + <li> + <h5>All</h5> + <p>{{alarmList.all }}</p> + </li> + <li> + <h5>Closed</h5> + <p>{{alarmList.closed }}</p> + </li> + <li> + <h5>Active</h5> + <p>{{alarmList.activeNum }}</p> + </li> + </ul> + </div> --> + <!-- <div class="chart"> + <h3>Alarm Chart</h3> + <div class="AlarmChart" [ngClass]="{'alarmChart-active':alarmShow}"> + <app-line [initData]="alarmChartInit" [chartData]="alarmChartData"></app-line> + </div> + </div> --> + <div class="tablelist"> + <nz-table #nzTable [nzData]="list" [(nzPageSize)]="pageSize" nzShowSizeChanger nzShowQuickJumper + [nzPageSizeOptions]="[5,10,15,20]" nzSize="middle"> + <thead (nzSortChange)="sort($event)" nzSingleSort> + <tr> + <th nzWidth="5%" style="padding-left:20px;">NO</th> + <th nzWidth="12%">Source Name</th> + <th nzWidth="7%">Priority</th> + <th nzWidth="18%">SpecificProblem</th> + <th nzWidth="15%">Report Time</th> + <th nzWidth="15%">Clear Time</th> + <th nzWidth="8%">Status</th> + <th nzWidth="10%">Action</th> + </tr> + </thead> + <tbody> + <tr *ngFor="let item of nzTable.data; let i = index;"> + <td style="padding-left: 20px;">{{i+1}}</td> + <td>{{item.sourceName}}</td> + <td>{{item.priority}}</td> + <td>{{item.specificProblem}}</td> + <td>{{item.startEpochMicrosec | date:'yyyy-MM-dd HH:mm:ss'}}</td> + <td>{{item.startEpochMicrosecCleared | date:'yyyy-MM-dd HH:mm:ss'}}</td> + <td>{{item.status}}</td> + <td class="action"><a (click)="detailShow(item)"><i class="details"></i></a></td> + </tr> + </tbody> + </nz-table> + </div> + </div> + <div [@showHideAnimate]="state2"> + <app-details [detailId]="detailId"></app-details> </div> - <button class="open-close" [ngClass]="{'open-close-active':alarmShow}" (click)="alarmShow=!alarmShow"></button> -</div> -<div class="tablelist"> - <nz-table #nzTable [nzData]="list" [(nzPageSize)]="pageSize" nzShowSizeChanger nzShowQuickJumper [nzPageSizeOptions]="[5,10,15,20]" - nzSize="middle"> - <thead (nzSortChange)="sort($event)" nzSingleSort> - <tr> - <th nzWidth="5%">NO</th> - <th nzWidth="10%">Source Name</th> - <th nzWidth="10%">Priority</th> - <th nzWidth="15%">SpecificProblem</th> - <th nzWidth="15%">Report Time</th> - <th nzWidth="15%">Clear Time</th> - <th nzWidth="10%">Status</th> - <th nzWidth="10%">Action</th> - </tr> - </thead> - <tbody> - <tr *ngFor="let item of nzTable.data; let i = index;"> - <td>{{i+1}}</td> - <td>{{item.sourceName}}</td> - <td>{{item.priority}}</td> - <td>{{item.specificProblem}}</td> - <td>{{item.startEpochMicrosec | date:'yyyy-MM-dd HH:mm:ss'}}</td> - <td>{{item.startEpochMicrosecCleared | date:'yyyy-MM-dd HH:mm:ss'}}</td> - <td>{{item.status}}</td> - <td class="action"><a (click)="detailShow(item)"><i class="details"></i></a></td> - </tr> - </tbody> - </nz-table> -</div> -</div> -<div [@showHideAnimate]="state2"> -<app-details [detailId]="detailId"></app-details> </div>
\ No newline at end of file diff --git a/usecaseui-portal/src/app/alarm/alarm.component.less b/usecaseui-portal/src/app/alarm/alarm.component.less index 649815c5..936f73c8 100644 --- a/usecaseui-portal/src/app/alarm/alarm.component.less +++ b/usecaseui-portal/src/app/alarm/alarm.component.less @@ -25,7 +25,7 @@ hr { margin-bottom: 20px; } .select { - margin-bottom: 20px; + margin-bottom: 15px; span { display: inline-block; font: 700 14px "Arial"; @@ -68,6 +68,54 @@ hr { } } +.charts{ + width: 100%; + height: 250px; + margin-bottom: 25px; + .chartsleft { + width: 30%; + height: 100%; + float: left; + margin-right: 2%; + color: #fff; + font-family:"ArialMT"; + .sctive_closed { + height: 48.75%; + padding: 12px; + width: 100%; + :first-child{ + font-size: 14px; + } + :nth-child(2) { + font-size: 18px; + } + :nth-child(3) { + font-size: 12px; + } + } + .active { + margin-bottom: 5px; + background: -webkit-linear-gradient(left, #FB7788 , #FB93C2); /* Safari 5.1 - 6.0 */ + background: -o-linear-gradient(right, #FB7788, #FB93C2); /* Opera 11.1 - 12.0 */ + background: -moz-linear-gradient(right, #FB7788, #FB93C2); /* Firefox 3.6 - 15 */ + background: linear-gradient(to right, #FB7788 , #FB93C2); /* 标准的语法(必须放在最后) */ + } + .closed { + margin-top: 2px; + background: -webkit-linear-gradient(left, #7A8BAE , #A6BFE4); /* Safari 5.1 - 6.0 */ + background: -o-linear-gradient(right, #7A8BAE , #A6BFE4); /* Opera 11.1 - 12.0 */ + background: -moz-linear-gradient(right, #7A8BAE , #A6BFE4); /* Firefox 3.6 - 15 */ + background: linear-gradient(to right, #7A8BAE , #A6BFE4); /* 标准的语法(必须放在最后) */ + } + + } + .chartsright { + background-color: #fff; + width: 68%; + float: left; + height: 100%; + } +} .content { .title { border-radius: 5px 5px 0 0; @@ -148,8 +196,8 @@ hr { } } .tablelist { - background-color: #fff; - padding: 24px 10px 0px; + // background-color: #fff; + // padding: 24px 10px 0px; border-radius: 0 0 5px 5px; .action{ padding: 10px 0 0 20px; @@ -165,3 +213,24 @@ hr { } } } +// select 框更改 +.select[_ngcontent-c3] nz-dropdown[_ngcontent-c3] button[_ngcontent-c3] { + width: 120px; + height: 30px; + background-color: #fff; + text-align: left; + border-color: #EEEEEE; + border-radius: 2px; +} +.select[_ngcontent-c3] nz-dropdown[_ngcontent-c3] [_ngcontent-c3]:hover { + border-color: #58B7F9; +} +.ant-progress-inner{ + background:rgba(229,238,252,0.8) !important; +} +.ant-progress-bg { + background-color: linear-gradient(270deg,rgba(255,255,255,1) 0%,rgba(223,233,243,1) 100%) !important; +} + + + diff --git a/usecaseui-portal/src/app/alarm/alarm.component.ts b/usecaseui-portal/src/app/alarm/alarm.component.ts index be8aae01..ae9c0681 100644 --- a/usecaseui-portal/src/app/alarm/alarm.component.ts +++ b/usecaseui-portal/src/app/alarm/alarm.component.ts @@ -16,7 +16,7 @@ import { Component, OnInit, Input, Output, EventEmitter, HostBinding, Pipe, PipeTransform } from '@angular/core'; import { HomesService } from '../homes.service'; import { showHideAnimate, slideToRight } from '../animates'; -import { DatePipe } from "@angular/common" +import { DatePipe } from '@angular/common'; @Component({ selector: 'app-alarm', templateUrl: './alarm.component.html', @@ -45,7 +45,7 @@ export class AlarmComponent implements OnInit { ngOnInit() { this.getAlarmFormData(); this.getSourceNames(); - this.getstatuscount(); + // this.getstatuscount(); } // Filter box @@ -106,14 +106,14 @@ export class AlarmComponent implements OnInit { activeNum: 0 } // total data - getstatuscount() { - this.myhttp.getstatuscount().subscribe((data) => { - this.alarmList.activeNum = data[0]; - this.alarmList.closed = data[1]; - this.alarmList.all = (data[0] - 0) + (data[1] - 0); + // getstatuscount() { + // this.myhttp.getstatuscount().subscribe((data) => { + // this.alarmList.activeNum = data[0]; + // this.alarmList.closed = data[1]; + // this.alarmList.all = (data[0] - 0) + (data[1] - 0); - }) - } + // }) + // } getAlarmFormData() { this.myhttp.getAlarmFormData(this.currentPage, this.pageSize, this.sourceName, this.priority, this.startTime, this.endTime, this.vfStatus).subscribe((data) => { this.list = data.alarms; @@ -122,10 +122,10 @@ export class AlarmComponent implements OnInit { } getAlarmChartData(event) { let paramsObj = { - sourceName: this.sourceName, - startTime: this.startTime, - endTime: this.endTime, - format: 'day' + // sourceName: this.sourceName, + // startTime: this.startTime, + // endTime: this.endTime, + // format: 'day' } this.myhttp.getHomeAlarmChartData(paramsObj) .subscribe((data) => { @@ -136,7 +136,6 @@ export class AlarmComponent implements OnInit { series: [ { data: data.allList }, { data: data.ActiveList }, - { data: data.closedList } ] } }, (err) => { @@ -144,61 +143,61 @@ export class AlarmComponent implements OnInit { }) } // day alarmchartdata - day() { - let paramsObj = { - sourceName: this.sourceName, - startTime: this.startTime, - endTime: this.endTime, - format: "day" - } - this.myhttp.getHomeAlarmChartData(paramsObj) - .subscribe((data) => { - this.alarmChartData = { - xAxis: { - data: data.dateList - }, - series: [ - { data: data.allList }, - { data: data.ActiveList }, - { data: data.closedList } - ] - } - }, (err) => { - console.log(err); - }) - } - month() { - let paramsObj = { - sourceName: this.sourceName, - startTime: this.startTime, - endTime: this.endTime, - format: "month" - } - this.myhttp.getHomeAlarmChartData(paramsObj) - .subscribe((data) => { - this.alarmChartData = { - xAxis: { - data: data.dateList - }, - series: [ - { data: data.allList }, - { data: data.ActiveList }, - { data: data.closedList } - ] - } - }, (err) => { - console.log(err); - }) - } + // day() { + // let paramsObj = { + // sourceName: this.sourceName, + // startTime: this.startTime, + // endTime: this.endTime, + // format: "day" + // } + // this.myhttp.getHomeAlarmChartData(paramsObj) + // .subscribe((data) => { + // this.alarmChartData = { + // xAxis: { + // data: data.dateList + // }, + // series: [ + // { data: data.allList }, + // { data: data.ActiveList }, + // { data: data.closedList } + // ] + // } + // }, (err) => { + // console.log(err); + // }) + // } + // month() { + // let paramsObj = { + // sourceName: this.sourceName, + // startTime: this.startTime, + // endTime: this.endTime, + // format: "month" + // } + // this.myhttp.getHomeAlarmChartData(paramsObj) + // .subscribe((data) => { + // this.alarmChartData = { + // xAxis: { + // data: data.dateList + // }, + // series: [ + // { data: data.allList }, + // { data: data.ActiveList }, + // { data: data.closedList } + // ] + // } + // }, (err) => { + // console.log(err); + // }) + // } //Line chart alarmShow = false; alarmChartData: Object; alarmChartInit: Object = { - height: 380, + height: 240, option: { legend: { bottom: '0px', - data: ['All', 'Active', 'Closed'] + data: ['Active', 'Fixed'] }, tooltip: { trigger: 'axis', @@ -217,59 +216,55 @@ export class AlarmComponent implements OnInit { }, series: [ { - name: 'All', - type: 'line', - smooth: true, - showSymbol: false, - areaStyle: { - opacity: 0.8 - }, - //timeframe_one + name: 'Active', + type: 'bar', data: [], + barWidth: 10, + barGap: 1, itemStyle: { - color: "#526b75" - }, - lineStyle: { - width: 1, - opacity: 0.5 + normal: { + barBorderRadius: [5], + color: { + type: 'linear', + x: 0, + y: 0, + x2: 0, + y2: 1, + colorStops: [{ + offset: 0, color: '#FB7788' // 0% 处的颜色 + }, { + offset: 1, color: '#FB93C2' // 100% 处的颜色 + }], + }, + opacity: 1, + } } }, { - name: 'Active', - type: 'line', - smooth: true,// - showSymbol: false, - areaStyle: { - opacity: 0.8 - }, - //timeframe_two + name: 'Fixed', + type: 'bar', data: [], + barWidth: 10, + barGap: 1, itemStyle: { - color: "#fb6e6e" - }, - lineStyle: { - width: 1, - opacity: 0.5 + normal: { + barBorderRadius: [5], + color: { + type: 'linear', + x: 0, + y: 0, + x2: 0, + y2: 1, + colorStops: [{ + offset: 0, color: '#7A8BAE' // 0% 处的颜色 + }, { + offset: 1, color: '#A6BFE4' // 100% 处的颜色 + }], + }, + opacity: 1, + } } }, - { - name: 'Closed', - type: 'line', - smooth: true,// - showSymbol: false, - areaStyle: { - opacity: 0.8 - }, - //timeframe_two - data: [12, 23, 13, 25, 33, 14, 34, 12, 12, 22, 12, 12, 13, 23, 12, 24, 22, 13, 22, 5, 12, 23, 13, 25, 33, 14, 34, 12, 12, 22, 12, 12, 13, 23, 12, 24, 22, 13, 22, 5, 12, 23, 13, 25, 33, 14, 34, 12, 125], - itemStyle: { - color: "#3fa8eb" - }, - lineStyle: { - width: 1, - opacity: 0.5 - } - } ] } }; |