Commit 74840dd8 authored by wangqinghua's avatar wangqinghua

bug update

parent b7058d04
...@@ -31,7 +31,7 @@ export class NotificationInterceptor implements HttpInterceptor { ...@@ -31,7 +31,7 @@ export class NotificationInterceptor implements HttpInterceptor {
if (data && data.errCode) { if (data && data.errCode) {
const errCode = data.errCode; const errCode = data.errCode;
const errMsg = data.errMsg; const errMsg = data.errMsg;
if (errCode && errCode != 10000 && errCode != 10099) { if (errCode && errCode != 10000 && errCode != 10099 && errCode == 10103) {
this.notification.create('error', `错误码:${errCode}`, `${errMsg}`, {nzDuration: 2000}); this.notification.create('error', `错误码:${errCode}`, `${errMsg}`, {nzDuration: 2000});
} }
} }
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
</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)="goTo(item)" >业务拓扑</span>
<span routerLink="../effectAnalysis">效能分析</span> <span routerLink="../effectAnalysis">效能分析</span>
</div> </div>
</div> </div>
......
...@@ -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,13 @@ export class BOverviewComponent implements OnInit { ...@@ -203,4 +205,13 @@ export class BOverviewComponent implements OnInit {
this.smartWorkReport.showModal(item); this.smartWorkReport.showModal(item);
} }
//bTopology
goTo(item){
this.router.navigate(['app/main/bTopology'],{
queryParams:{
topoId:item.id
}
})
}
} }
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,15 @@ export class BTopologyComponent implements OnInit, AfterViewInit { ...@@ -95,7 +96,15 @@ 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) => {
console.log(res);
this.topoId = res.topoId;
this.getDetail();
}
);
} }
ngOnInit() { ngOnInit() {
......
...@@ -17,9 +17,9 @@ ...@@ -17,9 +17,9 @@
<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>
...@@ -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">
......
...@@ -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>
......
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