Commit 24dc186c authored by xch666's avatar xch666

Merge remote-tracking branch 'origin/master'

# Conflicts: # src/main/webapp/app/business/effect-analysis/effect-analysis.component.ts
parents 0d7c880e 83c30170
...@@ -44,8 +44,8 @@ ...@@ -44,8 +44,8 @@
</div> </div>
<div nz-col nzSpan="12" class="spanBorder"> <div nz-col nzSpan="12" class="spanBorder">
<span (click)="reportDetail(item)">运行报告</span> <span (click)="reportDetail(item)">运行报告</span>
<span routerLink="../bTopology">业务拓扑</span> <span (click)="goToTopo(item)" >业务拓扑</span>
<span routerLink="../effectAnalysis">效能分析</span> <span (click)="goToAnalysis(item)">效能分析</span>
</div> </div>
</div> </div>
<div nz-row> <div nz-row>
...@@ -75,4 +75,4 @@ ...@@ -75,4 +75,4 @@
</div> </div>
<!--运行报告--> <!--运行报告-->
<smart-work-report #smartWorkReport></smart-work-report> <smart-work-report #smartWorkReport></smart-work-report>
\ No newline at end of file
...@@ -3,6 +3,7 @@ import {BusinessService} from '../business.service'; ...@@ -3,6 +3,7 @@ import {BusinessService} from '../business.service';
import {NzMessageService} from 'ng-zorro-antd'; import {NzMessageService} from 'ng-zorro-antd';
import {color} from '../../app.constants'; import {color} from '../../app.constants';
import {WorkReportComponent} from '../modal/work-report/work-report.component'; import {WorkReportComponent} from '../modal/work-report/work-report.component';
import {Router} from '@angular/router';
@Component({ @Component({
selector: 'smart-b-overview', selector: 'smart-b-overview',
...@@ -108,7 +109,8 @@ export class BOverviewComponent implements OnInit { ...@@ -108,7 +109,8 @@ export class BOverviewComponent implements OnInit {
color = color; color = color;
list; list;
constructor(private busineSer: BusinessService, private message: NzMessageService) { constructor(private busineSer: BusinessService, private message: NzMessageService,
private router:Router) {
} }
ngOnInit() { ngOnInit() {
...@@ -203,4 +205,21 @@ export class BOverviewComponent implements OnInit { ...@@ -203,4 +205,21 @@ export class BOverviewComponent implements OnInit {
this.smartWorkReport.showModal(item); this.smartWorkReport.showModal(item);
} }
//bTopology
goToTopo(item){
this.router.navigate(['app/main/bTopology'],{
queryParams:{
topoId:item.id
}
})
}
//effectAnalysis
goToAnalysis(item){
this.router.navigate(['app/main/effectAnalysis'],{
queryParams:{
topoId:item.id
}
})
}
} }
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<div nz-col nzSpan="12"> <div nz-col nzSpan="12">
<nz-select style="width: 200px;" nzPlaceHolder="选择业务" [(ngModel)]="topoId" (ngModelChange)="getDetail()"> <nz-select style="width: 200px;" nzPlaceHolder="选择业务" [(ngModel)]="topoId" (ngModelChange)="getDetail()">
<ng-container *ngFor="let item of rootList"> <ng-container *ngFor="let item of rootList">
<nz-option [nzLabel]="item.name" [nzValue]="item.serviceid"></nz-option> <nz-option [nzLabel]="item.name" nzValue="{{item.serviceid}}"></nz-option>
</ng-container> </ng-container>
</nz-select> </nz-select>
</div> </div>
......
import {AfterViewInit, Component, ElementRef, OnInit, ViewChild} from '@angular/core'; import {AfterViewInit, Component, ElementRef, OnInit, ViewChild} from '@angular/core';
import {BusinessService} from '../business.service'; import {BusinessService} from '../business.service';
import {NzMessageService} from 'ng-zorro-antd'; import {NzMessageService} from 'ng-zorro-antd';
import {ActivatedRoute, Router} from '@angular/router';
declare let editor: any; declare let editor: any;
...@@ -95,7 +96,16 @@ export class BTopologyComponent implements OnInit, AfterViewInit { ...@@ -95,7 +96,16 @@ export class BTopologyComponent implements OnInit, AfterViewInit {
backgroundColor; backgroundColor;
editType = '只读模式'; editType = '只读模式';
constructor(private busineSer: BusinessService, private message: NzMessageService) { constructor(private busineSer: BusinessService, private message: NzMessageService,
private routerInfo: ActivatedRoute) {
this.routerInfo.queryParams.subscribe(
(res) => {
if (res) {
this.topoId = res.topoId + '';
this.getDetail();
}
}
);
} }
ngOnInit() { ngOnInit() {
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<div nz-col nzSpan="12"> <div nz-col nzSpan="12">
<nz-select style="width: 200px;" nzPlaceHolder="选择业务" [(ngModel)]="serviceId" (ngModelChange)="changeService()"> <nz-select style="width: 200px;" nzPlaceHolder="选择业务" [(ngModel)]="serviceId" (ngModelChange)="changeService()">
<ng-container *ngFor="let item of rootList"> <ng-container *ngFor="let item of rootList">
<nz-option [nzLabel]="item.name" [nzValue]="item.serviceid"></nz-option> <nz-option [nzLabel]="item.name" nzValue="{{item.serviceid}}"></nz-option>
</ng-container> </ng-container>
</nz-select> </nz-select>
</div> </div>
......
import {Component, OnInit} from '@angular/core'; import {Component, OnInit} from '@angular/core';
import {BusinessService} from '../business.service'; import {BusinessService} from '../business.service';
import {OverAllService} from '../../overAll/overAll.service'; import {OverAllService} from '../../overAll/overAll.service';
import {DatePipe, Location} from '@angular/common'; import {DatePipe,Location} from '@angular/common';
import {color} from '../../app.constants'; import {color} from '../../app.constants';
import {NzMessageService} from 'ng-zorro-antd'; import {NzMessageService} from 'ng-zorro-antd';
import {CommonService} from '../../shared/common/common.service'; import {CommonService} from '../../shared/common/common.service';
import {ActivatedRoute} from '@angular/router';
@Component({ @Component({
selector: 'smart-effect-analysis', selector: 'smart-effect-analysis',
...@@ -83,9 +84,17 @@ export class EffectAnalysisComponent implements OnInit { ...@@ -83,9 +84,17 @@ export class EffectAnalysisComponent implements OnInit {
constructor(private busineSer: BusinessService, private overAllSer: OverAllService, constructor(private busineSer: BusinessService, private overAllSer: OverAllService,
private commonSer:CommonService, private commonSer:CommonService,
private datePipe: DatePipe, private message: NzMessageService, private routerInfo: ActivatedRoute,
public location:Location public location:Location,
) { private datePipe: DatePipe, private message: NzMessageService) {
this.routerInfo.queryParams.subscribe(
(res) => {
if (res) {
this.serviceId = res.topoId + '';
this.changeService();
}
}
);
} }
ngOnInit() { ngOnInit() {
...@@ -213,8 +222,10 @@ export class EffectAnalysisComponent implements OnInit { ...@@ -213,8 +222,10 @@ export class EffectAnalysisComponent implements OnInit {
(res) => { (res) => {
this.rootList = res.data; this.rootList = res.data;
if (this.rootList.length > 0) { if (this.rootList.length > 0) {
this.serviceId = this.rootList[0].serviceid; if (!this.serviceId) {
this.changeService(); this.serviceId = this.rootList[0].serviceid;
this.changeService();
}
} }
} }
); );
......
...@@ -10,16 +10,16 @@ ...@@ -10,16 +10,16 @@
<nz-form-item nzFlex> <nz-form-item nzFlex>
<nz-form-label [nzSpan]="6" nzRequired nzFor="webName">网站名称</nz-form-label> <nz-form-label [nzSpan]="6" nzRequired nzFor="webName">网站名称</nz-form-label>
<nz-form-control [nzSpan]="14"> <nz-form-control [nzSpan]="14">
<input id="webName" name="webName" nz-input placeholder="网站名称" [(ngModel)]="validateForm.name"> <input id="webName" maxlength="20" name="webName" nz-input placeholder="网站名称" [(ngModel)]="validateForm.name">
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
</div> </div>
<div nz-col [nzSpan]="12"> <div nz-col [nzSpan]="12">
<nz-form-item nzFlex> <nz-form-item nzFlex>
<nz-form-label [nzOffset]="4" [nzSpan]="6" nzRequired nzFor="delay">更新间隔</nz-form-label> <nz-form-label [nzOffset]="4" [nzSpan]="6" nzRequired nzFor="delay">更新间隔(s)</nz-form-label>
<nz-form-control [nzSpan]="14"> <nz-form-control [nzSpan]="14">
<input id="delay" name="delay" nz-input placeholder="更新间隔" [(ngModel)]="validateForm.delay"> <input id="delay" name="delay" type="number" nz-input placeholder="更新间隔(s)" [(ngModel)]="validateForm.delay">
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
</div> </div>
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
<nz-form-item nzFlex> <nz-form-item nzFlex>
<nz-form-label [nzSpan]="3" nzFor="http_proxy">Http代理</nz-form-label> <nz-form-label [nzSpan]="3" nzFor="http_proxy">Http代理</nz-form-label>
<nz-form-control [nzSpan]="18"> <nz-form-control [nzSpan]="18">
<input id="http_proxy" name="http_proxy" nz-input placeholder="默认" <input id="http_proxy" maxlength="40" name="http_proxy" nz-input placeholder="默认"
[(ngModel)]="validateForm.http_proxy"> [(ngModel)]="validateForm.http_proxy">
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
...@@ -247,7 +247,6 @@ ...@@ -247,7 +247,6 @@
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
<div class="modal-footer-btn"> <div class="modal-footer-btn">
<button nz-button (click)="closeCon(i,false)" nzType="primary">取消</button>
<button nz-button (click)="closeCon(i,true)" nzType="primary">保存</button> <button nz-button (click)="closeCon(i,true)" nzType="primary">保存</button>
</div> </div>
</div> </div>
......
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
<th>状态</th> <th>状态</th>
<th nzWidth="20%">最近检查记录</th> <th nzWidth="20%">最近检查记录</th>
<th>步骤数量</th> <th>步骤数量</th>
<th>间隔</th> <th>间隔(s)</th>
<th>尝试次数</th> <th>尝试次数</th>
<th>认证</th> <th>认证</th>
<th>Http代理</th> <th>Http代理</th>
......
...@@ -96,7 +96,7 @@ export class CommonService implements OnInit { ...@@ -96,7 +96,7 @@ export class CommonService implements OnInit {
toFormData(json) { toFormData(json) {
let formData = new FormData(); let formData = new FormData();
for (let k in json) { for (let k in json) {
formData.append(k, json[k]) formData.append(k, json[k]);
} }
return formData; return formData;
} }
...@@ -195,6 +195,11 @@ export class CommonService implements OnInit { ...@@ -195,6 +195,11 @@ export class CommonService implements OnInit {
*/ */
getTimeByType(timeType) { getTimeByType(timeType) {
const nowDate = new Date().getTime(); const nowDate = new Date().getTime();
const now = new Date(); //当前日期
const nowDayOfWeek = now.getDay(); //今天本周的第几天
const nowDay = now.getDate(); //当前日
const nowMonth = now.getMonth(); //当前月
const nowYear = now.getFullYear(); //当前年
let day1, day2; //当作变量使用 let day1, day2; //当作变量使用
let obj = {startTime: null, endTime: null}; let obj = {startTime: null, endTime: null};
switch (timeType) { switch (timeType) {
...@@ -223,17 +228,17 @@ export class CommonService implements OnInit { ...@@ -223,17 +228,17 @@ export class CommonService implements OnInit {
break; break;
} }
case'4': { //最近一周 case'4': { //最近一周
day1 = nowDate - 7 * 24 * 60 * 60 * 1000; const weekStartDate = new Date(nowYear, nowMonth, nowDay - nowDayOfWeek);
day2 = nowDate; const weekEndDate = new Date(nowYear, nowMonth, nowDay + (7 - nowDayOfWeek));
obj.startTime = this.datePipe.transform(day1, 'yyyy-MM-dd') + ' 00:00:00'; obj.startTime = this.datePipe.transform(weekStartDate, 'yyyy-MM-dd') + ' 00:00:00';
obj.endTime = this.datePipe.transform(day2, 'yyyy-MM-dd') + ' 23:59:59'; obj.endTime = this.datePipe.transform(weekEndDate, 'yyyy-MM-dd') + ' 23:59:59';
break; break;
} }
case'5': { //最近一个月 case'5': { //最近一个月
day1 = nowDate - 30 * 24 * 60 * 60 * 1000; const monthStartDate = new Date(nowYear, nowMonth, 1);
day2 = nowDate; const monthEndDate = new Date(nowYear, nowMonth, this.getMonthDays(nowMonth));
obj.startTime = this.datePipe.transform(day1, 'yyyy-MM-dd') + ' 00:00:00'; obj.startTime = this.datePipe.transform(monthStartDate, 'yyyy-MM-dd') + ' 00:00:00';
obj.endTime = this.datePipe.transform(day2, 'yyyy-MM-dd') + ' 23:59:59'; obj.endTime = this.datePipe.transform(monthEndDate, 'yyyy-MM-dd') + ' 23:59:59';
break; break;
} }
case'6': { //最近一年 case'6': { //最近一年
...@@ -250,6 +255,15 @@ export class CommonService implements OnInit { ...@@ -250,6 +255,15 @@ export class CommonService implements OnInit {
return obj; return obj;
} }
//获取某月的天数
getMonthDays(myMonth) {
const nowYear = new Date().getFullYear(); //当前年
const monthStartDate = <any>new Date(nowYear, myMonth, 1);
const monthEndDate = <any>new Date(nowYear, myMonth + 1, 1);
const days = (monthEndDate - monthStartDate) / (1000 * 60 * 60 * 24);
return days;
}
//内存单位换算 //内存单位换算
unitConversion(unit) { unitConversion(unit) {
let res; let res;
......
...@@ -119,12 +119,12 @@ export class ChildAssetsComponent implements OnInit { ...@@ -119,12 +119,12 @@ export class ChildAssetsComponent implements OnInit {
//删除资产--单个 //删除资产--单个
deleteInVentory(item){ deleteInVentory(item){
this.isLoading = true;
const data = { const data = {
inventoryIds:[] inventoryIds:[]
}; };
data.inventoryIds.push(item.id); data.inventoryIds.push(item.id);
this.commonSer.confirmThing("删除","确定删除该资产?",()=>{ this.commonSer.confirmThing("删除","确定删除该资产?",()=>{
this.isLoading = true;
this.workSer.deleteInventory(data).subscribe( this.workSer.deleteInventory(data).subscribe(
(res)=>{ (res)=>{
if(res.errCode == 10000){ if(res.errCode == 10000){
......
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
[nzValue]="item.value">{{item.label}}</label> [nzValue]="item.value">{{item.label}}</label>
</nz-radio-group> </nz-radio-group>
</div> </div>
<div nz-col nzSpan="6"> <div nz-col nzSpan="8">
<ng-container *ngIf="time.type == '99'"> <ng-container *ngIf="time.type == '99'">
<nz-date-picker <nz-date-picker
[nzFormat]="timeFormat" [nzFormat]="timeFormat"
......
...@@ -63,8 +63,8 @@ export class InspectPlanConfigComponent implements OnInit { ...@@ -63,8 +63,8 @@ export class InspectPlanConfigComponent implements OnInit {
searchStr: this.obj.searchStr, searchStr: this.obj.searchStr,
typeId: this.obj.typeId, typeId: this.obj.typeId,
status: this.obj.status, status: this.obj.status,
nextExecutionStart: this.obj.nextExecutionStart, //开始时间 nextExecutionStart: this.obj.nextExecutionStart ? new Date(this.obj.nextExecutionStart).getTime() : null, //开始时间
nextExecutionEnd: this.obj.nextExecutionEnd, //结束时间 nextExecutionEnd: this.obj.nextExecutionEnd ? new Date(this.obj.nextExecutionEnd).getTime() : null, //结束时间
}; };
this.workSer.findPlanList(obj).subscribe( this.workSer.findPlanList(obj).subscribe(
(res) => { (res) => {
......
...@@ -24,8 +24,9 @@ ...@@ -24,8 +24,9 @@
<div nz-col nzSpan="4"> <div nz-col nzSpan="4">
<nz-select nzAllowClear style="width: 100%;" [(ngModel)]="obj.status" nzPlaceHolder="计划状态"> <nz-select nzAllowClear style="width: 100%;" [(ngModel)]="obj.status" nzPlaceHolder="计划状态">
<nz-option nzLabel="未开始" nzValue="0"></nz-option> <nz-option nzLabel="未开始" nzValue="0"></nz-option>
<nz-option nzLabel="进行中" nzValue="1"></nz-option> <nz-option nzLabel="待处理" nzValue="1"></nz-option>
<nz-option nzLabel="结束" nzValue="2"></nz-option> <nz-option nzLabel="已完成" nzValue="2"></nz-option>
<nz-option nzLabel="待确认" nzValue="3"></nz-option>
</nz-select> </nz-select>
</div> </div>
<div nz-col nzSpan="4"> <div nz-col nzSpan="4">
...@@ -86,8 +87,8 @@ ...@@ -86,8 +87,8 @@
<td class="handle main-color"> <td class="handle main-color">
<span (click)="lookPlan(data.id,data.title)">查看</span> <span (click)="lookPlan(data.id,data.title)">查看</span>
<span *ngIf="data.status == 1" (click)="dealPlan(data.id)">处理</span> <span *ngIf="data.status == 1" (click)="dealPlan(data.id)">处理</span>
<span *ngIf="data.status != 2" (click)="editPlan(data.id)">编辑</span> <span *ngIf="data.status == 0 || data.status == 2"(click)="editPlan(data.id)">编辑</span>
<span class="handle-delete" (click)="deletePlan(data)">删除</span> <span *ngIf="data.status != 1" class="handle-delete" (click)="deletePlan(data)">删除</span>
</td> </td>
</tr> </tr>
</tbody> </tbody>
......
...@@ -9,19 +9,25 @@ ...@@ -9,19 +9,25 @@
<div nz-row [nzGutter]="24"> <div nz-row [nzGutter]="24">
<div nz-col [nzSpan]="12"> <div nz-col [nzSpan]="12">
<nz-form-item nzFlex> <nz-form-item nzFlex>
<nz-form-label [nzOffset]="4" [nzSpan]="6" nzFor="inventoryNo">备件编号</nz-form-label> <nz-form-label [nzOffset]="4" [nzSpan]="6" nzRequired nzFor="inventoryNo">备件编号</nz-form-label>
<nz-form-control [nzSpan]="14"> <nz-form-control [nzSpan]="14">
<input id="inventoryNo" placeholder="备件编号" name="inventoryNo" type="text" nz-input <input id="inventoryNo" placeholder="备件编号" name="inventoryNo" type="text" nz-input
formControlName="inventoryNo"> formControlName="inventoryNo">
<nz-form-explain *ngIf="validateForm.get('inventoryNo').dirty && validateForm.get('inventoryNo').errors">
请输入备件编号
</nz-form-explain>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
</div> </div>
<div nz-col [nzSpan]="12"> <div nz-col [nzSpan]="12">
<nz-form-item nzFlex> <nz-form-item nzFlex>
<nz-form-label [nzSpan]="6" nzFor="inventoryName">备件名称</nz-form-label> <nz-form-label [nzSpan]="6" nzRequired nzFor="inventoryName">备件名称</nz-form-label>
<nz-form-control [nzSpan]="14"> <nz-form-control [nzSpan]="14">
<input id="inventoryName" placeholder="备件名称" name="inventoryName" type="text" nz-input <input id="inventoryName" placeholder="备件名称" name="inventoryName" type="text" nz-input
formControlName="inventoryName"> formControlName="inventoryName">
<nz-form-explain *ngIf="validateForm.get('inventoryName').dirty && validateForm.get('inventoryName').errors">
请输入备件名称
</nz-form-explain>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
</div> </div>
......
...@@ -38,7 +38,7 @@ export class SparePartsComponent implements OnInit { ...@@ -38,7 +38,7 @@ export class SparePartsComponent implements OnInit {
initForm() { initForm() {
this.validateForm = this.fb.group({ this.validateForm = this.fb.group({
inventoryNo: [""], inventoryName: [""], inventoryNo: ["",[Validators.required]], inventoryName: ["",[Validators.required]],
inventoryTypeId: [""], inventoryType: [""], inventoryTypeId: [""], inventoryType: [""],
amount: [""], contact: [""], name: [""], amount: [""], contact: [""], name: [""],
brand: [""], model: [""], serialNo: [""], brand: [""], model: [""], serialNo: [""],
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
<div nz-col nzSpan="2"> <div nz-col nzSpan="2">
<nz-select nzAllowClear style="width: 100%;" [(ngModel)]="obj.status" nzPlaceHolder="事件状态"> <nz-select nzAllowClear style="width: 100%;" [(ngModel)]="obj.status" nzPlaceHolder="事件状态">
<nz-option nzLabel="待处理" nzValue="0"></nz-option> <nz-option nzLabel="待处理" nzValue="0"></nz-option>
<nz-option nzLabel="确认评价" nzValue="2"></nz-option> <nz-option nzLabel="待确认" nzValue="2"></nz-option>
<nz-option nzLabel="已结束" nzValue="1"></nz-option> <nz-option nzLabel="已结束" nzValue="1"></nz-option>
</nz-select> </nz-select>
</div> </div>
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
"noImplicitAny": false, "noImplicitAny": false,
"skipLibCheck": true, "skipLibCheck": true,
"suppressImplicitAnyIndexErrors": true, "suppressImplicitAnyIndexErrors": true,
"outDir": "build/master/app", "outDir": "build/www/app",
"lib": ["es7", "dom"], "lib": ["es7", "dom"],
"typeRoots": [ "typeRoots": [
"node_modules/@types" "node_modules/@types"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment