Commit 14d03e9d authored by wangqinghua's avatar wangqinghua

Merge branch 'master' into dangxiao

parents 1f3e8268 10450e19
......@@ -100,6 +100,7 @@ export class BCountComponent implements OnInit {
changeService() {
this.isLoading = true;
this.getInfo();
this.getRunTime();
}
//系统可用性, 监测点, 用户统计
......@@ -265,8 +266,17 @@ export class BCountComponent implements OnInit {
legend: {
selectedMode: false,
formatter: (name) => {
let total = this.runObj.from - this.runObj.to;
return '{black|' + total + '}';
let total: any = this.runObj.to - this.runObj.from;
let time = '';
let days = parseInt(String(total / (1000 * 60 * 60 * 24)));
let hours = parseInt(String((total % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)));
let minutes = parseInt(String((total % (1000 * 60 * 60)) / (1000 * 60)));
let seconds = (total % (1000 * 60)) / 1000;
if (days > 0) time += days + '天';
if (hours > 0) time += hours + '小时';
if (minutes > 0) time += minutes + '分钟';
if (seconds > 0) time += seconds.toFixed(0) + '秒';
return '{black|' + time + '}';
},
data: [echartData[0].name],
left: 'center',
......@@ -274,7 +284,6 @@ export class BCountComponent implements OnInit {
icon: 'none',
align: 'center',
textStyle: {
color: '#fff',
rich: rich
},
},
......
......@@ -96,6 +96,7 @@ export class AnalysisDealComponent implements OnInit {
if(this.timeType =='99') return ;
this.obj.startTime = this.commonSer.getTimeByType(this.timeType).startTime;
this.obj.endTime = this.commonSer.getTimeByType(this.timeType).endTime;
this.getEcharts();
}
//搜索
......
......@@ -96,6 +96,7 @@ export class AnalysisEventComponent implements OnInit {
if(this.timeType =='99') return ;
this.obj.startTime = this.commonSer.getTimeByType(this.timeType).startTime;
this.obj.endTime = this.commonSer.getTimeByType(this.timeType).endTime;
this.getEcharts();
}
//搜索
......
......@@ -95,6 +95,7 @@ export class AnalysisStatusComponent implements OnInit {
if(this.timeType =='99') return ;
this.obj.startTime = this.commonSer.getTimeByType(this.timeType).startTime;
this.obj.endTime = this.commonSer.getTimeByType(this.timeType).endTime;
this.getEcharts();
}
//搜索
......
......@@ -101,8 +101,8 @@ export class BTopologyComponent implements OnInit, AfterViewInit {
this.routerInfo.queryParams.subscribe(
(res) => {
if (res) {
this.topoId = res.topoId + '';
this.getDetail();
this.topoId = res.topoId;
if(this.topoId) this.getDetail();
}
}
);
......
......@@ -13,7 +13,6 @@
</nz-breadcrumb>
</div>
<div nz-col nzSpan="8" class="text-right">
<button nzType="primary" (click)="returnBack()" nz-button>返回上一页</button>
<button (click)="ngOnInit()" nz-button nzType="primary"><i class="anticon anticon-sync"></i></button>
<smart-full-screen></smart-full-screen>
</div>
......@@ -23,7 +22,7 @@
<div nz-col nzSpan="12">
<nz-select style="width: 200px;" nzPlaceHolder="选择业务" [(ngModel)]="serviceId" (ngModelChange)="changeService()">
<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>
</nz-select>
</div>
......
import {Component, OnInit} from '@angular/core';
import {BusinessService} from '../business.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 {NzMessageService} from 'ng-zorro-antd';
import {CommonService} from '../../shared/common/common.service';
......@@ -83,15 +83,15 @@ export class EffectAnalysisComponent implements OnInit {
chartUser;
constructor(private busineSer: BusinessService, private overAllSer: OverAllService,
private commonSer:CommonService,
private commonSer: CommonService,
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();
if (res.topoId) {
this.serviceId = res.topoId +"";
if (this.serviceId) this.changeService();
}
}
);
......@@ -223,7 +223,7 @@ export class EffectAnalysisComponent implements OnInit {
this.rootList = res.data;
if (this.rootList.length > 0) {
if (!this.serviceId) {
this.serviceId = this.rootList[0].serviceid;
this.serviceId = this.rootList[0].serviceid +'';
this.changeService();
}
}
......@@ -349,7 +349,7 @@ export class EffectAnalysisComponent implements OnInit {
//时间改变
changeType() {
this.isSpinning = true;
if(this.timeType =='99') return ;
if (this.timeType == '99') return;
this.obj.startTime = this.commonSer.getTimeByType(this.timeType).startTime;
this.obj.endTime = this.commonSer.getTimeByType(this.timeType).endTime;
this.findChart();
......@@ -530,7 +530,7 @@ export class EffectAnalysisComponent implements OnInit {
}
//返回上一页
returnBack(){
returnBack() {
this.location.back();
}
}
......@@ -21,18 +21,18 @@
<div nz-col nzSpan="6">
预警级别:
<nz-radio-group [(ngModel)]="obj.ruleLevel">
<label *ngFor="let item of warning_leavel" (click)="search()" nz-radio-button
<label *ngFor="let item of warning_leavel" (click)="searchValue()" nz-radio-button
[nzValue]="item.value">{{item.label}}</label>
</nz-radio-group>
</div>
<div nz-col nzSpan="12">
<div nz-col nzSpan="10">
预警时间:
<nz-radio-group [(ngModel)]="time.timeType" (ngModelChange)="changeTimeType($event)">
<label *ngFor="let item of warning_time" nz-radio-button
[nzValue]="item.value">{{item.label}}</label>
</nz-radio-group>
</div>
<div nz-col nzSpan="6">
<div nz-col nzSpan="8">
<ng-container *ngIf="time.timeType == '99'">
<nz-date-picker
nzFormat="yyyy-MM-dd"
......@@ -47,11 +47,11 @@
</div>
<div nz-row [nzGutter]="4" class="search-form">
<div nz-col nzSpan="10">
<input type="text" (keyup.enter)="search()" nz-input [(ngModel)]="obj.keyword"
<input type="text" (keyup.enter)="searchValue()" nz-input [(ngModel)]="obj.keyword"
placeholder="预警内容、触发规则、批注人、批注内容">
</div>
<div nz-col nzSpan="2">
<button (click)="search()"
<button (click)="searchValue()"
nz-button nzType="default"><i class="anticon anticon-search"></i>搜索
</button>
</div>
......
......@@ -75,11 +75,6 @@ export class BusinessWarningComponent implements OnInit {
}
}
//搜索
search() {
this.page.pageNum = 1;
this.getList();
}
//时间改变
changeTimeType(e) {
......@@ -93,10 +88,9 @@ export class BusinessWarningComponent implements OnInit {
//查询
searchValue() {
if (this.time.timeType == '99') {
this.obj.startDate = this.datePipe.transform(this.time.startTime, 'yyyy-MM-dd HH:mm:ss');
this.obj.endDate = this.datePipe.transform(this.time.endTime, 'yyyy-MM-dd HH:mm:ss');
this.obj.startDate = this.datePipe.transform(this.time.startTime, 'yyyy-MM-dd') + ' 00:00:00';
this.obj.endDate = this.datePipe.transform(this.time.endTime, 'yyyy-MM-dd') + ' 23:59:59';
}
this.getList();
this.page.pageNum = 1;
this.getList();
}
......
......@@ -54,10 +54,24 @@
<nz-form-item nzFlex>
<nz-form-label [nzSpan]="6">检测对象
</nz-form-label>
<nz-form-control [nzSpan]="18">
<nz-select style="width: 100px;" formControlName="resourceGroupType">
<nz-form-control [nzSpan]="9">
<nz-select style="width: 150px;" formControlName="resourceGroupType">
<nz-option nzLabel="按资源分组" nzValue="1"></nz-option>
<nz-option nzLabel="按设备类型分组" nzValue="2"></nz-option>
<nz-option nzLabel="按设备类别" nzValue="2"></nz-option>
</nz-select>
</nz-form-control>
<nz-form-control *ngIf="validateForm.value.resourceGroupType == '1'" [nzSpan]="9">
<nz-select style="width: 150px;" formControlName="resourceGroupValue" nzPlaceHolder="资源分组">
<ng-container *ngFor="let item of groupList">
<nz-option [nzLabel]="item.name" [nzValue]="item.groupid"></nz-option>
</ng-container>
</nz-select>
</nz-form-control>
<nz-form-control *ngIf="validateForm.value.resourceGroupType == '2'" [nzSpan]="9">
<nz-select style="width: 150px;" formControlName="resourceGroupValue" nzPlaceHolder="设备类型">
<ng-container *ngFor="let item of equipmentList">
<nz-option [nzLabel]="item.equipmentType" [nzValue]="item.equipmentTypeId"></nz-option>
</ng-container>
</nz-select>
</nz-form-control>
</nz-form-item>
......
......@@ -3,6 +3,7 @@ import {EarlyWarningService} from '../../earlyWarning.service';
import {NzMessageService} from 'ng-zorro-antd';
import {FormBuilder, FormGroup, Validators} from '@angular/forms';
import {warning_type} from '../../early.constants';
import {OverAllService} from '../../../overAll/overAll.service';
@Component({
selector: 'smart-warnging-rule',
......@@ -24,30 +25,58 @@ export class WarngingRuleComponent implements OnInit {
newestRemark;
validateForm: FormGroup;
groupList = [];
equipmentList = [];
constructor(private earlySer: EarlyWarningService, private message: NzMessageService,
private overAllSer:OverAllService,
private fb: FormBuilder,) {
}
ngOnInit() {
this.initForm();
this.getGroup();
this.getType();
}
initForm() {
this.validateForm = this.fb.group({
name: [null, [Validators.required]],
type: ['1'], level: [null],
cycle: [null], content: [null],
fileId: [null], resourceGroupType: [null],
resourceGroupValue: [null], resourceWarningLevel: [null],
resourceDays: [null], resourceSymbol: [null],
cycle: ['1'], content: [null],
fileId: [null], resourceGroupType: ['1'],
resourceGroupValue: [null], resourceWarningLevel: ['1'],
resourceDays: [null], resourceSymbol: ['1'],
resourceWarningTims: [null], businessDataType: [null],
businessDays: [null], businessWarningSymbol: [null],
businessWarningValue: [null], businessThresholdSymbol: [null],
businessThresholdValue: [null], jobDataType: [null],
jobUntreatedSymbol: [null], jobUntreatedDays: [null],
businessDays: [null], businessWarningSymbol: ['1'],
businessWarningValue: [null], businessThresholdSymbol: ['1'],
businessThresholdValue: [null], jobDataType: ['1'],
jobUntreatedSymbol: ['1'], jobUntreatedDays: [null],
});
}
//获取资源分组
getGroup() {
this.overAllSer.getEditGroups(0).subscribe(
(res) => {
if (res.errCode == 10000) {
this.groupList = res.data;
}
}
);
}
//获取设备类型
getType() {
this.overAllSer.findType().subscribe(
(res) => {
if (res.errCode == 10000) {
this.equipmentList = res.data;
}
}
);
}
//新增
showAddModal(title) {
this.modal.isVisible = true;
......
......@@ -88,6 +88,11 @@
<nz-form-item nzFlex>
<nz-form-label [nzSpan]="8" nzFor="title">告警次数</nz-form-label>
<nz-form-control [nzSpan]="14">
<ng-container *ngIf="msgObj?.resourceSymbol == '1'">大于</ng-container>
<ng-container *ngIf="msgObj?.resourceSymbol == '2'">大于等于</ng-container>
<ng-container *ngIf="msgObj?.resourceSymbol == '3'">小于</ng-container>
<ng-container *ngIf="msgObj?.resourceSymbol == '4'">大于等于</ng-container>
<ng-container *ngIf="msgObj?.resourceSymbol == '5'">等于</ng-container>
{{msgObj?.resourceWarningTims || '-'}}次
</nz-form-control>
</nz-form-item>
......
......@@ -25,14 +25,14 @@
[nzValue]="item.value">{{item.label}}</label>
</nz-radio-group>
</div>
<div nz-col nzSpan="12">
<div nz-col nzSpan="10">
预警时间:
<nz-radio-group [(ngModel)]="time.timeType" (ngModelChange)="changeTimeType($event)">
<label *ngFor="let item of warning_time" nz-radio-button
[nzValue]="item.value">{{item.label}}</label>
</nz-radio-group>
</div>
<div nz-col nzSpan="6">
<div nz-col nzSpan="8">
<ng-container *ngIf="time.timeType == '99'">
<nz-date-picker
nzFormat="yyyy-MM-dd"
......@@ -51,7 +51,7 @@
placeholder="预警内容、触发规则、批注人、批注内容">
</div>
<div nz-col nzSpan="2">
<button (click)="search()"
<button (click)="searchValue()"
nz-button nzType="default"><i class="anticon anticon-search"></i>搜索
</button>
</div>
......
......@@ -34,7 +34,7 @@ export class ResourceWarningComponent implements OnInit {
obj = {
ruleType: '1', //1:资源预警;2:业务预警;3:工作预警;
ruleLevel: null,
ruleLevel: '',
keyword: '',
startDate: '',
endDate: '',
......@@ -95,9 +95,10 @@ export class ResourceWarningComponent implements OnInit {
//查询
searchValue() {
if (this.time.timeType == '99') {
this.obj.startDate = this.datePipe.transform(this.time.startTime, 'yyyy-MM-dd HH:mm:ss');
this.obj.endDate = this.datePipe.transform(this.time.endTime, 'yyyy-MM-dd HH:mm:ss');
this.obj.startDate = this.datePipe.transform(this.time.startTime, 'yyyy-MM-dd') + ' 00:00:00';
this.obj.endDate = this.datePipe.transform(this.time.endTime, 'yyyy-MM-dd') + ' 23:59:59';
}
this.page.pageNum = 1;
this.getList();
}
......
......@@ -21,18 +21,18 @@
<div nz-col nzSpan="6">
预警级别:
<nz-radio-group [(ngModel)]="obj.ruleLevel">
<label *ngFor="let item of warning_leavel" (click)="search()" nz-radio-button
<label *ngFor="let item of warning_leavel" (click)="searchValue()" nz-radio-button
[nzValue]="item.value">{{item.label}}</label>
</nz-radio-group>
</div>
<div nz-col nzSpan="12">
<div nz-col nzSpan="10">
预警时间:
<nz-radio-group [(ngModel)]="time.timeType" (ngModelChange)="changeTimeType($event)">
<label *ngFor="let item of warning_time" nz-radio-button
[nzValue]="item.value">{{item.label}}</label>
</nz-radio-group>
</div>
<div nz-col nzSpan="6">
<div nz-col nzSpan="8">
<ng-container *ngIf="time.timeType == '99'">
<nz-date-picker
nzFormat="yyyy-MM-dd"
......@@ -47,11 +47,11 @@
</div>
<div nz-row [nzGutter]="4" class="search-form">
<div nz-col nzSpan="10">
<input type="text" (keyup.enter)="search()" nz-input [(ngModel)]="obj.keyword"
<input type="text" (keyup.enter)="searchValue()" nz-input [(ngModel)]="obj.keyword"
placeholder="预警内容、触发规则、批注人、批注内容">
</div>
<div nz-col nzSpan="2">
<button (click)="search()"
<button (click)="searchValue()"
nz-button nzType="default"><i class="anticon anticon-search"></i>搜索
</button>
</div>
......
......@@ -97,9 +97,10 @@ export class WorkWarningComponent implements OnInit {
//查询
searchValue() {
if (this.time.timeType == '99') {
this.obj.startDate = this.datePipe.transform(this.time.startTime, 'yyyy-MM-dd HH:mm:ss');
this.obj.endDate = this.datePipe.transform(this.time.endTime, 'yyyy-MM-dd HH:mm:ss');
this.obj.startDate = this.datePipe.transform(this.time.startTime, 'yyyy-MM-dd') + ' 00:00:00';
this.obj.endDate = this.datePipe.transform(this.time.endTime, 'yyyy-MM-dd') + ' 23:59:59';
}
this.page.pageNum = 1;
this.getList();
}
......
......@@ -25,8 +25,8 @@
<ng-template #nzTreeTemplate let-node>
<span class="custom-node" draggable="true" aria-grabbed="true"
[class.active]="node.isSelected">
<label [(ngModel)]="node.isChecked" nz-checkbox *ngIf="node.level == 0"
(click)="selectCheckTreeGroup(node)"> {{node.title}}</label>
<label [(ngModel)]="node.isChecked" *ngIf="node.level == 0"
> {{node.title}}</label>
<label [(ngModel)]="node.isChecked" [nzDisabled]="node.origin.disabled"
(click)="selectCheckTree(node)" *ngIf="node.level == 1"
nz-checkbox> {{node.title}}</label>
......
......@@ -28,7 +28,7 @@
<nz-form-item>
<nz-form-label [nzSpan]="4" nzRequired nzFor="showName">显示名</nz-form-label>
<nz-form-control [nzSpan]="14">
<input type="text" nz-input name="showName" placeholder="显示名" [(ngModel)]="validateForm.name">
<input type="text" maxlength="100" nz-input name="showName" placeholder="显示名" [(ngModel)]="validateForm.name">
</nz-form-control>
</nz-form-item>
......
......@@ -212,8 +212,8 @@ export class BasicEditComponent implements OnInit {
this.message.info('请选择二级类型');
return false;
}
if (!this.validateForm.name) {
this.message.info('请输入显示名');
if (!this.validateForm.name || this.validateForm.name.length > 100) {
this.message.info('请输入显示名,且不超过100个字符');
return false;
}
if (!this.validateForm.host) {
......
......@@ -16,7 +16,7 @@
<input type="password" nz-input formControlName="newPassword" placeholder="密码">
<nz-form-explain
*ngIf="validateForm.get('newPassword').dirty && validateForm.get('newPassword').errors">
新密码必须包含数字、英文字母,长度8-20位
新密码必须英文字母开头,包含数字、英文字母,长度8-20位
</nz-form-explain>
</nz-form-control>
</nz-form-item>
......@@ -26,7 +26,7 @@
<input type="password" nz-input formControlName="realPassword" placeholder="确认密码">
<nz-form-explain
*ngIf="validateForm.get('realPassword').dirty && validateForm.get('realPassword').errors">
新密码必须包含数字、英文字母,长度8-20位
新密码必须英文字母开头,包含数字、英文字母,长度8-20位
</nz-form-explain>
</nz-form-control>
</nz-form-item>
......
......@@ -47,6 +47,7 @@ export class ModifyPasswordComponent implements OnInit {
this.message.error('两次输入密码不一致');
return false;
}
this.isOkLoading = true;
this.getOldEncodepassword();
}
......@@ -107,8 +108,8 @@ export class ModifyPasswordComponent implements OnInit {
initForm() {
this.validateForm = this.fb.group({
oldPassword: [null, [Validators.required]],
newPassword: [null, [Validators.required, Validators.minLength(8), Validators.maxLength(20)]],
realPassword: [null, [Validators.required, Validators.minLength(8), Validators.maxLength(20)]],
newPassword: [null, [Validators.required, Validators.pattern(/^(?=[a-zA-Z]+\d+)\w{8,20}$/)]],
realPassword: [null, [Validators.required, Validators.pattern(/^(?=[a-zA-Z]+\d+)\w{8,20}$/)]],
});
}
}
......@@ -29,7 +29,7 @@
<nz-select *ngIf="selectedValue == 'type'" style="width: 200px;" nzPlaceHolder="所有设备类型" nzShowSearch nzAllowClear
(ngModelChange)="changeEquiment($event)" [(ngModel)]="equipmentTypeid">
<nz-option nzLabel="全部" [nzValue]="null"></nz-option>
<ng-container *ngFor="let item of groupList">
<ng-container *ngFor="let item of equipmentList">
<nz-option [nzLabel]="item.equipmentType" [nzValue]="item.equipmentTypeId"></nz-option>
</ng-container>
</nz-select>
......
......@@ -86,6 +86,7 @@ export class BasicComponent implements OnInit {
selectedValue = 'group';
groupList = []; //分组列表
equipmentList = []; //设备列表
groupid = null;
equipmentTypeid = null;
......@@ -189,7 +190,7 @@ export class BasicComponent implements OnInit {
(res) => {
this.loading = false;
if (res.errCode == 10000) {
this.groupList = res.data;
this.equipmentList = res.data;
this.search();
}
}
......@@ -473,7 +474,7 @@ export class BasicComponent implements OnInit {
let opr = item.status == 1 ? '开启' : '停止';
this.modalService.confirm({
nzTitle: '监控',
nzContent: `确定${opr}监控设备${item.name}`,
nzContent: `确定${opr}该监控?`,
nzOkText: '确定',
nzCancelText: '取消',
nzOnOk: () => {
......
......@@ -105,10 +105,10 @@
<ng-container *ngIf="item.status == 0"><span
(click)="operationHost(item,'1','关闭')">停止监控</span></ng-container>
</a></li>
<li (click)="showTempStop(item)" nz-menu-item>
<li *ngIf="item.status == 0" (click)="showTempStop(item)" nz-menu-item>
<a *ngIf="!item.monitorTask">临时暂停</a>
</li>
<li (click)="showAlarm(item)" nz-menu-item><a>添加告警</a></li>
<li (click)="showAlarm()" nz-menu-item><a>添加告警</a></li>
</ul>
</nz-dropdown>
</td>
......
......@@ -20,7 +20,7 @@
<div nz-row [nzGutter]="4" class="search-form">
<div nz-col nzSpan="2">
<button (click)="showModal()"
nz-button nzType="default"><i class="anticon anticon-search"></i>配置
nz-button nzType="default"><i class="anticon anticon-appstore"></i>配置
</button>
</div>
</div>
......@@ -36,7 +36,7 @@
<tr>
<th>事件编号</th>
<th nzWidth="30%">标题</th>
<th nzWidth="15%">处理人</th>
<th nzWidth="20%">处理人</th>
<th>状态</th>
</tr>
</thead>
......@@ -46,7 +46,7 @@
{{data.id}}
</td>
<td>
{{data.title}}
{{data.title | stringSlice:8:8}}
</td>
<td>
<span style="margin-right: 5px;" *ngFor="let item of data?.operators">
......@@ -78,7 +78,7 @@
<tbody>
<tr *ngFor="let data of nzTable2.data">
<td class="round-tag tag-form">
{{data.title}}
{{data.title | stringSlice:8:8}}
</td>
<td>
{{data.typeName}}
......@@ -119,7 +119,7 @@
<tbody>
<tr *ngFor="let data of nzTable3.data">
<td>
{{data.name}}
{{data.name | stringSlice:8:8}}
</td>
<td>
{{data.inventorycount}}
......@@ -128,7 +128,7 @@
<td>
{{data.usedcount}}
</td>
<td>{{data.eventSum}}</td>
<td>{{data.eventSum | stringSlice:8:8}}</td>
</tr>
</tbody>
</nz-table>
......@@ -149,9 +149,9 @@
<tbody>
<tr *ngFor="let data of nzTable4.data">
<td>{{data.inventoryNo}}</td>
<td>{{data.inventoryName}}</td>
<td>{{data.inventoryName | stringSlice:8:8}}</td>
<td>{{data.inventoryType}}</td>
<td>{{data.belongObject}}</td>
<td>{{data.belongObject | stringSlice:8:8}}</td>
</tr>
</tbody>
</nz-table>
......@@ -180,7 +180,7 @@
<span *ngIf="data.type == 2">重大变更</span>
<span *ngIf="data.type == 3">紧急变更</span>
</td>
<td>{{data.description}}</td>
<td>{{data.description | stringSlice:8:8}}</td>
<td>{{data.verifyUserName}}</td>
<td>
<span *ngIf="data.status == 1">待提交</span>
......@@ -211,7 +211,7 @@
<tbody>
<tr *ngFor="let data of nzTable6.data">
<td class="round-tag tag-form">
{{data.officeName}}
{{data.officeName | stringSlice:8:8}}
</td>
<td>{{data.officePrincipal}}</td>
<td>
......@@ -242,7 +242,7 @@
</thead>
<tbody>
<tr *ngFor="let data of nzTable7.data">
<td>{{data.name}}</td>
<td>{{data.name | stringSlice:8:8}}</td>
<td>{{data.principal}}</td>
<td>
<span *ngIf="data.type == 0">中心驻场</span>
......@@ -266,19 +266,17 @@
<th nzWidth="30%">团队名称</th>
<th>团队类型</th>
<th>所在公司</th>
<th>关联项目</th>
<th>团队负责人</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of nzTable8.data">
<td>{{data.name}}</td>
<td>{{data.name | stringSlice:8:8}}</td>
<td>
<span *ngIf="data.type == 0">驻场团队</span>
<span *ngIf="data.type == 1">非驻场团队</span>
</td>
<td>{{data.companyName}}</td>
<td>{{data.projectName}}</td>
<td>{{data.companyName | stringSlice:8:8}}</td>
<td>{{data.principal}}</td>
</tr>
</tbody>
......@@ -300,7 +298,7 @@
</thead>
<tbody>
<tr *ngFor="let data of nzTable9.data">
<td>{{data.projectName}}</td>
<td>{{data.projectName | stringSlice:8:8}}</td>
<td>{{data.timeStr | date:'yyyy-MM-dd HH:mm:ss'}}</td>
<td>{{data.people}}</td>
<td>{{data.costdescribe}}</td>
......
<!--添加资源-->
<nz-modal [nzMaskClosable]="false" [nzWidth]="1080" [(nzVisible)]="isVisiable" [nzTitle]="title" (nzOnCancel)="handleCancle()"
(nzOnOk)="handEditleOk()">
<nz-modal [nzMaskClosable]="false" [nzWidth]="1080" [(nzVisible)]="isVisiable" [nzTitle]="title"
(nzOnCancel)="handleCancle()"
(nzOnOk)="handEditleOk()" [nzFooter]="title == '费用记录'?null:true">
<div nz-form class="ant-advanced-search-form form-select">
<div nz-row [nzGutter]="24">
<div nz-col [nzSpan]="12">
......@@ -26,7 +27,7 @@
<div nz-row [nzGutter]="24">
<div nz-col [nzSpan]="6">
<nz-form-item nzFlex>
<nz-form-label [nzOffset]="12" [nzSpan]="12" nzFor="title">备件采购</nz-form-label>
<nz-form-label [nzOffset]="12" [nzSpan]="12" nzFor="title">备件采购</nz-form-label>
</nz-form-item>
</div>
......@@ -34,7 +35,8 @@
<nz-form-item nzFlex>
<nz-form-label [nzOffset]="4" [nzSpan]="6" nzFor="title">数量</nz-form-label>
<nz-form-control [nzSpan]="14">
<nz-input-number [disabled]="title == '费用记录'" [(ngModel)]="obj.purchasenum" [nzMin]="0" (ngModelChange)="countTotal()"></nz-input-number>
<nz-input-number [disabled]="title == '费用记录'" [(ngModel)]="obj.purchasenum" [nzMin]="0"
(ngModelChange)="countTotal()"></nz-input-number>
</nz-form-control>
</nz-form-item>
</div>
......@@ -43,7 +45,9 @@
<nz-form-item nzFlex>
<nz-form-label [nzSpan]="6" nzFor="typeId">金额</nz-form-label>
<nz-form-control [nzSpan]="14">
<nz-input-number [disabled]="title == '费用记录'" style="width: 90%;display: inline-block" [nzMin]="0" [(ngModel)]="obj.purchasemoney" (ngModelChange)="countTotal()" ></nz-input-number>
<nz-input-number [disabled]="title == '费用记录'" style="width: 90%;display: inline-block"
[nzMin]="0" [(ngModel)]="obj.purchasemoney"
(ngModelChange)="countTotal()"></nz-input-number>
&nbsp;&nbsp;
</nz-form-control>
</nz-form-item>
......@@ -61,7 +65,8 @@
<nz-form-item nzFlex>
<nz-form-label [nzOffset]="4" [nzSpan]="6" nzFor="title">数量</nz-form-label>
<nz-form-control [nzSpan]="14">
<nz-input-number [disabled]="title == '费用记录'" [(ngModel)]="obj.outsourcingnum" [nzMin]="0" (ngModelChange)="countTotal()"></nz-input-number>
<nz-input-number [disabled]="title == '费用记录'" [(ngModel)]="obj.outsourcingnum" [nzMin]="0"
(ngModelChange)="countTotal()"></nz-input-number>
</nz-form-control>
</nz-form-item>
</div>
......@@ -71,7 +76,8 @@
<nz-form-label [nzSpan]="6" nzFor="typeId">金额</nz-form-label>
<nz-form-control [nzSpan]="14">
<nz-input-number style="width: 90%;display: inline-block" [disabled]="title == '费用记录'"
[(ngModel)]="obj.outsourcingmoney" [nzMin]="0" (ngModelChange)="countTotal()"></nz-input-number>
[(ngModel)]="obj.outsourcingmoney" [nzMin]="0"
(ngModelChange)="countTotal()"></nz-input-number>
&nbsp;&nbsp;
</nz-form-control>
</nz-form-item>
......@@ -91,7 +97,8 @@
<nz-form-item nzFlex>
<nz-form-label [nzOffset]="4" [nzSpan]="6" nzFor="title">数量</nz-form-label>
<nz-form-control [nzSpan]="14">
<nz-input-number [disabled]="title == '费用记录'" [(ngModel)]="obj.othernum" [nzMin]="0" (ngModelChange)="countTotal()"></nz-input-number>
<nz-input-number [disabled]="title == '费用记录'" [(ngModel)]="obj.othernum" [nzMin]="0"
(ngModelChange)="countTotal()"></nz-input-number>
</nz-form-control>
</nz-form-item>
</div>
......@@ -101,7 +108,8 @@
<nz-form-label [nzSpan]="6" nzFor="typeId">金额</nz-form-label>
<nz-form-control [nzSpan]="14">
<nz-input-number style="width: 90%;display: inline-block" [disabled]="title == '费用记录'"
[(ngModel)]="obj.othermoney" [nzMin]="0" (ngModelChange)="countTotal()"></nz-input-number>
[(ngModel)]="obj.othermoney" [nzMin]="0"
(ngModelChange)="countTotal()"></nz-input-number>
&nbsp;&nbsp;
</nz-form-control>
</nz-form-item>
......@@ -113,7 +121,8 @@
<nz-form-item nzFlex>
<nz-form-label [nzOffset]="4" [nzSpan]="6" nzFor="title">费用描述</nz-form-label>
<nz-form-control [nzSpan]="14">
<textarea [(ngModel)]="obj.costdescribe" nz-input placeholder="费用描述" [disabled]="title == '费用记录'"
<textarea [(ngModel)]="obj.costdescribe" nz-input placeholder="费用描述"
[disabled]="title == '费用记录'"
[nzAutosize]="{ minRows: 3, maxRows: 6 }"></textarea>
</nz-form-control>
</nz-form-item>
......
......@@ -85,10 +85,10 @@
<ng-template #modalFooter>
<button nz-button nzType="default" (click)="handleCancel()">取消</button>
<button nz-button nzType="primary" (click)="handleOk(2)" [nzLoading]="isOkLoading">保存</button>
<button *ngIf="title == '编辑运维项目'" nz-button nzType="primary" (click)="handleOk(0)" [nzLoading]="isOkLoading">
<button *ngIf="title == '编辑运维项目' && validateForm.value.status == '2'" nz-button nzType="primary" (click)="handleOk(0)" [nzLoading]="isOkLoading">
启动项目
</button>
<button *ngIf="title == '编辑运维项目'" nz-button nzType="primary" (click)="handleOk(1)" [nzLoading]="isOkLoading">
<button *ngIf="title == '编辑运维项目' && validateForm.value.status == 0" nz-button nzType="primary" (click)="handleOk(1)" [nzLoading]="isOkLoading">
终止
</button>
</ng-template>
......
<nz-modal [nzMaskClosable]="false" [nzWidth]="480" [(nzVisible)]="isVisible" [nzTitle]="title" (nzOnOk)="handleOk()" (nzOnCancel)="handleCancel()"
[nzOkLoading]="isOkLoading">
<form [formGroup]="validateForm" nz-form>
<nz-form-item *ngIf="!title.includes('跟踪信息')">
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="createUserName">操作人</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24" >
<input disabled nz-input formControlName="createUserName" style="width: 70%;display: inline-block"
id="createUserName" placeholder="操作人">
<button nz-button nzType="primary" (click)="showPeoplemodal()">选择</button>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="msg">跟踪内容</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24">
......
......@@ -38,8 +38,6 @@ export class CreateTrackInfoComponent implements OnInit {
initForm() {
this.validateForm = this.fb.group({
createUserId: [null],
createUserName: [null],
msg: [null, [Validators.required]],
componentId: [null],
maintainType: [null],
......
......@@ -21,10 +21,11 @@
项目类型
</nz-form-label>
<nz-form-control [nzSpan]="14">
<ng-container *ngIf="obj?.type == 0">中心驻场</ng-container>
<ng-container *ngIf="obj?.type == 1">中心运维</ng-container>
<ng-container *ngIf="obj?.type == 2">外单位驻场</ng-container>
<ng-container *ngIf="obj?.type == 3">外单位运维</ng-container>
<ng-container *ngIf="obj?.type == 0">软件维护类</ng-container>
<ng-container *ngIf="obj?.type == 1">硬件维护</ng-container>
<ng-container *ngIf="obj?.type == 2">网络维护</ng-container>
<ng-container *ngIf="obj?.type == 3">终端维护</ng-container>
<ng-container *ngIf="obj?.type == 4">建设类</ng-container>
</nz-form-control>
</nz-form-item>
</div>
......@@ -45,7 +46,7 @@
<nz-form-label [nzOffset]="4" [nzSpan]="6" nzRequired nzFor="secondLevelType">
乙方名称
</nz-form-label>
<nz-form-control [nzSpan]="2">
<nz-form-control [nzSpan]="14">
{{obj?.companyName}}
</nz-form-control>
</nz-form-item>
......
......@@ -15,7 +15,7 @@ import {CreateTrackInfoComponent} from '../create-track-info/create-track-info.c
})
export class TrackInfoComponent implements OnInit {
@Input() maintainType;
@Input() sysChangeId;
@Input() sysChangeId;ååå
@Input() componentId;
@Input() title;
@ViewChild('smartCreateTrackInfo') smartCreateTrackInfo: CreateTrackInfoComponent;
......@@ -54,7 +54,10 @@ export class TrackInfoComponent implements OnInit {
this.componentId = id;
this.getInvoList();
}
if (this.title.includes('变更跟踪信息')) this.getChangeList();
if (this.title.includes('变更跟踪信息')){
this.sysChangeId = id;
this.getChangeList();
}
}
//跟踪信息
......@@ -109,11 +112,10 @@ export class TrackInfoComponent implements OnInit {
this.page.loading = true;
this.systemSer.findMsg(this.sysChangeId).subscribe(
(res) => {
if (res.errCode == 10000) {
if (res.data) {
this.warnList = res.data;
// this.page.totalNum = res.data.totalNum;
}
if (res.errCode == 10000 && res.data) {
this.warnList = res.data;
console.log(this.warnList);
// this.page.totalNum = res.data.totalNum;
}
this.page.loading = false;
}
......
......@@ -65,10 +65,10 @@
[nzPageIndex]="page.pageNum" [nzPageSize]="page.pageCount" (nzPageIndexChange)="change($event)">
<thead>
<tr>
<th nzWidth="10%">维护项目</th>
<th nzWidth="20%">维护项目</th>
<th>填报时间</th>
<th>填报人</th>
<th>费用说明</th>
<th nzWidth="20%">费用说明</th>
<th>总费用</th>
<th>备件采购</th>
<th>委外费用</th>
......
......@@ -61,8 +61,8 @@
[nzPageIndex]="page.pageNum" [nzPageSize]="page.pageCount" (nzPageIndexChange)="change($event)">
<thead>
<tr>
<th>项目单位</th>
<th nzWidth="10%">项目名称</th>
<th>项目单位</th>
<th>项目负责人</th>
<th>项目年度</th>
<th>项目状态</th>
......@@ -75,12 +75,8 @@
</thead>
<tbody>
<tr *ngFor="let data of nzTable.data">
<td class="round-tag tag-form">
{{data.officeName}}
</td>
<td>
{{data.name}}
</td>
<td>{{data.name}}</td>
<td class="round-tag tag-form">{{data.officeName}}</td>
<td>{{data.officePrincipal}}</td>
<td>
{{data.yearly}}
......
......@@ -63,10 +63,9 @@
<td>{{data.projectName}}</td>
<td>{{data.principal}}</td>
<td class="handle main-color">
<span>查看</span>
<span *ngIf="userId == data.createUserId" (click)="handleEdit(data)">更新团队信息</span>
<span *ngIf="userId == data.createUserId" (click)="handleUpdateTeam(data)">编辑团队成员</span>
<span *ngIf="userId == data.createUserId" (click)="handleDelete(data)">删除</span>
<span *ngIf="userId == data.createUseId" (click)="handleEdit(data)">更新团队信息</span>
<span *ngIf="userId == data.createUseId" (click)="handleUpdateTeam(data)">编辑团队成员</span>
<span *ngIf="userId == data.createUseId" (click)="handleDelete(data)">删除</span>
</td>
</tr>
</tbody>
......
......@@ -196,7 +196,7 @@ export class CommonService implements OnInit {
getTimeByType(timeType) {
const nowDate = new Date().getTime();
const now = new Date(); //当前日期
const nowDayOfWeek = now.getDay(); //今天本周的第几天
const nowDayOfWeek = now.getDay() == 0 ? 7 : now.getDay(); //今天本周的第几天
const nowDay = now.getDate(); //当前日
const nowMonth = now.getMonth(); //当前月
const nowYear = now.getFullYear(); //当前年
......
......@@ -118,10 +118,6 @@ export class JhiLoginModalComponent implements OnInit {
//登录
login() {
if (this.validateForm.value.loginName == 'monitor') {
window.location.href = 'http://pm.sdx.sh.cn/operation/teach-task!screen';
return;
}
this.loginService.login(this.validateForm.value).then((res) => {
if (res) {
this.getUserInfo();
......@@ -146,6 +142,7 @@ export class JhiLoginModalComponent implements OnInit {
this.userInfo.userId = res.data.id;
this.userInfo.gender = res.data.gender;
this.userInfo.roles = res.data.roles;
this.userInfo.isAdmin = res.data.isAdmin;
this.getOrgInfo();
}
);
......
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import {NgModule, CUSTOM_ELEMENTS_SCHEMA} from '@angular/core';
import {UnitConversionPipe} from './unit-conversion/unit-conversion.pipe';
import {StringSlicePipe} from './string-slice/string-slice.pipe';
@NgModule({
imports: [
],
imports: [],
declarations: [
StringSlicePipe,
UnitConversionPipe
],
providers: [
],
providers: [],
entryComponents: [],
exports: [
StringSlicePipe,
UnitConversionPipe
],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
export class PipeModule {}
export class PipeModule {
}
import {Pipe, PipeTransform} from '@angular/core';
@Pipe({
name: 'stringSlice',
})
export class StringSlicePipe implements PipeTransform {
transform(value: string, len: number,index:number) {
let str;
str = value.length > len ? value.slice(0, index) + "..." : value;
return str;
}
}
......@@ -113,7 +113,7 @@
<span (click)="handleEditModal(data)" *ngIf="data.status == 4 || data.status == 1">编辑</span>
<span (click)="showChangeModal(data)" *ngIf="(data.status == 2 && userInfo.userId == data.verifyUserId)">审核</span>
<span (click)="showChangeModal(data)" *ngIf="data.status == 6">处理</span>
<span *ngIf="data.status != 2" class="handle-delete" (click)="deleteChange(data)"
<span *ngIf="data.status == 1" class="handle-delete" (click)="deleteChange(data)"
>删除</span>
</td>
</tr>
......
......@@ -62,13 +62,15 @@ export class ChangeCreateComponent implements OnInit {
classifyId: [null, [Validators.required]],
status: ['1'],
title: ['变更'],
changeTime: [null],
changeTime: [null, [Validators.required]],
projectId: [null],
projectName: [null],
verifyUserId: [null],
verifyUserName: [null],
description: [null,[Validators.required]],
verifyUserId: [null, [Validators.required]],
verifyUserName: [null, [Validators.required]],
description: [null, [Validators.required]],
});
this.fileList = [];
this.fileId = [];
}
//变更分类
......
......@@ -77,7 +77,7 @@ export class ChangeVerityComponent implements OnInit {
this.id = id;
this.modal.isVisible = true;
this.getDetail();
this.getMsg();
this.smartTrackInfo.diffResource(this.id);
}
//查询变更详情
......
......@@ -69,6 +69,7 @@
</td>
<td class="handle main-color">
<span (click)="grantRole(data)">授权</span>
<span (click)="initPassword(data)">重置密码</span>
<span (click)="showEditModal(data)">编辑</span>
<span class="handle-delete" (click)="deleteUser(data)">删除</span>
</td>
......
......@@ -301,4 +301,19 @@ export class GroupComponent implements OnInit {
this.smartUpload.showModal('上传组织文件');
}
//重置密码
initPassword(item) {
const data = {
userName: item.name,
};
this.systemSer.resetPassword(data).subscribe(
(res) => {
if (res.errCode == 10000) {
this.message.success('重置密码成功');
this.getUser();
}
}
);
}
}
......@@ -4,7 +4,7 @@
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="groupName">部门名称</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24">
<input nz-input formControlName="name" id="groupName">
<nz-form-explain *ngIf="validateForm.get('name').dirty && validateForm.get('name').errors">请输入部门名称</nz-form-explain>
<nz-form-explain *ngIf="validateForm.get('name').dirty && validateForm.get('name').errors">请输入部门名称且不超过15字</nz-form-explain>
</nz-form-control>
</nz-form-item>
<nz-form-item>
......
......@@ -12,7 +12,7 @@
<nz-form-control [nzSm]="14" [nzXs]="24">
<textarea id="comment " row="4" nz-input formControlName="comment"></textarea>
<nz-form-explain *ngIf="validateForm.get('comment').dirty && validateForm.get('comment').errors">
角色说明最多输入300个字符!
角色说明最多输入30个字符!
</nz-form-explain>
</nz-form-control>
</nz-form-item>
......
......@@ -58,7 +58,7 @@ export class RoleComponent implements OnInit {
this.viewTempGroupList = [];
this.validateForm = this.fb.group({
name: [null, [Validators.required, Validators.maxLength(20)]],
comment: [null, [Validators.required, Validators.maxLength(300)]],
comment: [null, [Validators.required, Validators.maxLength(30)]],
});
}
......
......@@ -34,8 +34,6 @@
<tr>
<th>角色名称</th>
<th>说明</th>
<!--<th>权限模块</th>-->
<!--<th>资源权限</th>-->
<th>操作</th>
</tr>
</thead>
......@@ -43,18 +41,11 @@
<tr *ngFor="let data of basicTable.data">
<td>{{data.name}}</td>
<td>{{data.comment}}</td>
<!--<td>{{data.key3}}</td>-->
<!--<td>{{data.key4}}</td>-->
<!--<td>-->
<!--<ng-container *ngIf="data.status == 0">-->
<!--<i class="anticon anticon-check"></i>-->
<!--</ng-container>-->
<!--</td>-->
<td class="handle main-color">
<span (click)="grantUser(data)">授予用户</span>
<!--<span (click)="lookRole(data)">查看</span>-->
<span (click)="showEditModal(data)">编辑</span>
<span class="handle-delete" (click)="deleteRole(data)">删除</span>
<span *ngIf="isAdmin == 1" class="handle-delete" (click)="deleteRole(data)">删除</span>
</td>
</tr>
</tbody>
......
......@@ -259,6 +259,11 @@ export class SystemService {
return this.http.get(SERVER_API_URL_COMS + '/organization/findByUserId/' + params);
}
//重置密码
resetPassword(data): Observable<any> {
return this.http.post(SERVER_API_URL_COMS + '/user/resetPassword', data);
}
/**
* 下载模版文件
* @param pararms 参数
......
......@@ -78,7 +78,7 @@
{{data.scrapcount}}
</td>
<td>{{data.eventSum}}</td>
<td class="handle text-center main-color">
<td class="handle main-color">
<span (click)="goToChild(data)">明细</span>
<span class="handle-delete" (click)="deleteChildType(data)">删除</span>
</td>
......
......@@ -87,6 +87,7 @@ export class AssetPartComponent implements OnInit {
this.router.navigate(['app/main/assetChild'],
{
queryParams: {
parentId: data.parentid,
id: data.id,
name: data.name
}
......
......@@ -54,7 +54,7 @@
<input type="text" nz-input [(ngModel)]="obj.person" placeholder="负责人">
</div>
<div nz-col nzSpan="6" class="text-right">
<button (click)="search()" nz-button nzType="default"><i class="anticon anticon-plus-circle-o"></i>搜索
<button (click)="search()" nz-button nzType="default"><i class="anticon anticon-search"></i>搜索
</button>
</div>
</div>
......
......@@ -15,8 +15,8 @@ import {Location} from '@angular/common';
styles: []
})
export class ChildAssetsComponent implements OnInit {
@ViewChild('smartAssets') smartAssets:AssetsComponent;
@ViewChild('smartUpload') smartUpload:UploadComponent;
@ViewChild('smartAssets') smartAssets: AssetsComponent;
@ViewChild('smartUpload') smartUpload: UploadComponent;
childrenList;
childName;
......@@ -29,26 +29,28 @@ export class ChildAssetsComponent implements OnInit {
indeterminate = false;
obj = {
inventoryTypeid:null,
name:null,
inventorycount:null,
mac:null,
person:null,
inventoryTypeid: null,
name: null,
inventorycount: null,
mac: null,
person: null,
};
parentId;
page = {
pageNum: 1,
totalNum:null,
pageCount:10,
}
totalNum: null,
pageCount: 10,
};
constructor(private workSer: WorkService, private routerInfo: ActivatedRoute,private router:Router,
private message:NzMessageService,private systemSer:SystemService,
private commonSer:CommonService,public location:Location) {
constructor(private workSer: WorkService, private routerInfo: ActivatedRoute, private router: Router,
private message: NzMessageService, private systemSer: SystemService,
private commonSer: CommonService, public location: Location) {
this.routerInfo.queryParams.subscribe(
(res) => {
this.obj.inventoryTypeid = res.id;
this.childName = res.name
this.parentId = res.parentId;
this.childName = res.name;
}
);
}
......@@ -57,7 +59,7 @@ export class ChildAssetsComponent implements OnInit {
this.childrenList.forEach(data => {
data.checked = value;
this.selectList.push(data);
})
});
this.refreshStatus();
}
......@@ -92,10 +94,10 @@ export class ChildAssetsComponent implements OnInit {
getList() {
this.isLoading = true;
const data = {
pageCount:"10",
pageNum:this.page.pageNum,
obj:this.obj
}
pageCount: '10',
pageNum: this.page.pageNum,
obj: this.obj
};
this.workSer.findInventoryPage(data).subscribe(
(res) => {
this.childrenList = res.data.data;
......@@ -105,123 +107,124 @@ export class ChildAssetsComponent implements OnInit {
);
}
search(){
search() {
this.page.pageNum = 1;
this.getList();
}
change(e){
if(e > 0){
change(e) {
if (e > 0) {
this.page.pageNum = e;
this.getList();
}
}
//删除资产--单个
deleteInVentory(item){
deleteInVentory(item) {
const data = {
inventoryIds:[]
inventoryIds: []
};
data.inventoryIds.push(item.id);
this.commonSer.confirmThing("删除","确定删除该资产?",()=>{
this.commonSer.confirmThing('删除', '确定删除该资产?', () => {
this.isLoading = true;
this.workSer.deleteInventory(data).subscribe(
(res)=>{
if(res.errCode == 10000){
(res) => {
if (res.errCode == 10000) {
this.getList();
this.message.success("删除资产成功");
this.message.success('删除资产成功');
}
this.isLoading = false;
}
)
})
);
});
}
//批量删除
batchDeleteInventory(){
if(this.selectList.length == 0){
this.message.warning("请选择需要删除的资产");
batchDeleteInventory() {
if (this.selectList.length == 0) {
this.message.warning('请选择需要删除的资产');
return false;
}
this.isLoading = true;
const data = {
inventoryIds:this.selectList.map(e=>{
inventoryIds: this.selectList.map(e => {
return e.id;
})
};
this.commonSer.confirmThing("批量删除","确定删除选择的资产?",()=>{
this.commonSer.confirmThing('批量删除', '确定删除选择的资产?', () => {
this.workSer.deleteInventory(data).subscribe(
(res)=>{
if(res.errCode == 10000){
(res) => {
if (res.errCode == 10000) {
this.getList();
this.message.success("删除资产成功");
this.message.success('删除资产成功');
}
this.isLoading = false;
}
)
})
);
});
}
//添加资产
showAddModal() {
this.smartAssets.showAddModal("添加资产");
this.smartAssets.showAddModal('添加资产', {parentId: this.parentId, inventoryTypeid: this.obj.inventoryTypeid});
}
//编辑资产
showEditModal(id){
this.smartAssets.showEditModal("编辑资产",id);
showEditModal(id) {
this.smartAssets.showEditModal('编辑资产', id);
}
//查看详情
goToDetail(data){
this.router.navigate(['app/main/assetsDetail'],{
queryParams:{
invertoryId:data.id
goToDetail(data) {
this.router.navigate(['app/main/assetsDetail'], {
queryParams: {
invertoryId: data.id
}
})
});
}
//导入资产
showUploadModal(){
this.smartUpload.showModal("上传资产文件");
showUploadModal() {
this.smartUpload.showModal('上传资产文件');
}
//下载模版
downLoad(){
this.systemSer.downloadTemplate("inventory",SERVER_API_URL + "/api/template/download/").subscribe(
(data)=>{
this.commonSer.downloadFile("资产模版.xlsx",data);
downLoad() {
this.systemSer.downloadTemplate('inventory', SERVER_API_URL + '/api/template/download/').subscribe(
(data) => {
this.commonSer.downloadFile('资产模版.xlsx', data);
}
)
);
}
//导出资产
downloadInventory(){
downloadInventory() {
let title;
title = this.selectList.length == 0? "确定导出所有的资产?":"确定导出所选择的资产";
this.commonSer.confirmThing("导出",title,()=>{
title = this.selectList.length == 0 ? '确定导出所有的资产?' : '确定导出所选择的资产';
this.commonSer.confirmThing('导出', title, () => {
this.isDownload = true;
const data = {
type:this.obj.inventoryTypeid,
ids: this.selectList.map(e=>{
type: this.obj.inventoryTypeid,
ids: this.selectList.map(e => {
return e.id;
}),
query_name:null
query_name: null
};
this.workSer.getExportUrl(data).subscribe(
(res)=>{
(res) => {
this.isDownload = false;
this.workSer.downloadTemplate("inventory",res.data).subscribe(
(data)=>{
this.commonSer.downloadFile("文件.xlsx",data)
this.workSer.downloadTemplate('inventory', res.data).subscribe(
(data) => {
this.commonSer.downloadFile('文件.xlsx', data);
}
)
);
}
)
);
});
}
//返回上一页
returnBack(){
returnBack() {
this.location.back();
}
}
......@@ -15,15 +15,15 @@ export class AssetsComponent implements OnInit {
isVisible = false;
title;
parentId;
validateForm:FormGroup;
validateForm: FormGroup;
parentTypeList;
typeList;
invertoryId; //资产Id
constructor(private workSer:WorkService,private fb:FormBuilder,private datePipe:DatePipe,
private message:NzMessageService) {
constructor(private workSer: WorkService, private fb: FormBuilder, private datePipe: DatePipe,
private message: NzMessageService) {
}
ngOnInit() {
......@@ -31,114 +31,116 @@ export class AssetsComponent implements OnInit {
this.initForm();
}
initForm(){
initForm() {
this.invertoryId = null;
this.validateForm = this.fb.group({
serialnoA:[null],
invertoryname:[null],
name:[null,[Validators.required,Validators.maxLength(20)]],
hostid:[null],
person:[null],
ip:[null],
equipmentTypeid:[null],
inventorycount:[null],
secondlevelTypeid:[null],
stock:[null],
usedcount:[null],
lendcount:[null],
mac:[null],
repaircount:[null],
maintenanceExpiration:[null],
scrapcount:[null],
storageLocation:[null],
groupid:[null],
inventoryTypeid:[null,[Validators.required]],
serialnoA: [null],
invertoryname: [null],
name: [null, [Validators.required, Validators.maxLength(20)]],
hostid: [null],
person: [null],
ip: [null],
equipmentTypeid: [null],
inventorycount: [null],
secondlevelTypeid: [null],
stock: [null],
usedcount: [null],
lendcount: [null],
mac: [null],
repaircount: [null],
maintenanceExpiration: [null],
scrapcount: [null],
storageLocation: [null],
groupid: [null],
inventoryTypeid: [null, [Validators.required]],
});
}
//父级分类
getParentType(){
getParentType() {
this.workSer.findByParentType().subscribe(
(res)=>{
const data = res.data;
this.parentTypeList = data;
(res) => {
this.parentTypeList = res.data;
}
)
);
}
//通过父级分类查询子级分类
getTypeByParent(parentid){
getTypeByParent(parentid) {
this.workSer.findByParentidCount(parentid).subscribe(
(res)=>{
const data = res.data;
this.typeList = data;
(res) => {
this.typeList = res.data;
}
)
);
}
showAddModal(title) {
showAddModal(title, data) {
this.parentId = data.parentId;
this.getTypeByParent(this.parentId);
this.validateForm.patchValue({inventoryTypeid: data.inventoryTypeid});
this.title = title;
this.isVisible = true;
}
showEditModal(title,id) {
showEditModal(title, id) {
this.title = title;
this.invertoryId = id;
this.isVisible = true;
this.workSer.selectByPrimaryKey(this.invertoryId).subscribe(
(res)=>{
(res) => {
this.parentId = res.data.typeparentid;
this.validateForm.patchValue( res.data );
if(res.data.typeparentid){
this.validateForm.patchValue(res.data);
if (res.data.typeparentid) {
this.getTypeByParent(res.data.typeparentid);
}
}
)
);
}
handEditleOk() {
for(let i in this.validateForm.controls){
for (let i in this.validateForm.controls) {
this.validateForm.controls[i].markAsDirty();
this.validateForm.controls[i].updateValueAndValidity();
}
if(this.validateForm.invalid){
if (this.validateForm.invalid) {
return false;
}
if(this.title == "添加资产"){
if (this.title == '添加资产') {
this.create();
}
if(this.title == "编辑资产"){
if (this.title == '编辑资产') {
this.update();
}
}
create(){
create() {
this.workSer.createInventory(this.validateForm.value).subscribe(
(res)=>{
if(res.errCode == 10000){
this.message.success("添加资产成功");
(res) => {
if (res.errCode == 10000) {
this.message.success('添加资产成功');
this.isVisible = false;
this.done.emit();
this.initForm();
}
}
)
);
}
update(){
this.validateForm.addControl('id',new FormControl(this.invertoryId));
update() {
this.validateForm.addControl('id', new FormControl(this.invertoryId));
this.validateForm.patchValue({
maintenanceExpiration:this.datePipe.transform(this.validateForm.value.maintenanceExpiration,"yyyy-MM-dd HH:mm:ss")
})
maintenanceExpiration: this.datePipe.transform(this.validateForm.value.maintenanceExpiration, 'yyyy-MM-dd HH:mm:ss')
});
this.workSer.updateInventory(this.validateForm.value).subscribe(
(res)=>{
if(res.errCode == 10000){
this.message.success("编辑资产成功");
(res) => {
if (res.errCode == 10000) {
this.message.success('编辑资产成功');
this.isVisible = false;
this.initForm();
this.done.emit();
}
}
)
);
}
handleEditCancel() {
......
......@@ -8,7 +8,7 @@
<nz-form-label [nzOffset]="4" [nzSpan]="6" nzRequired nzFor="title">计划标题</nz-form-label>
<nz-form-control [nzSpan]="14">
<input id="title" name="title" nz-input placeholder="计划标题" formControlName="title">
<nz-form-explain *ngIf="validateForm.get('title').dirty && validateForm.get('title').errors">请输入计划标题</nz-form-explain>
<nz-form-explain *ngIf="validateForm.get('title').dirty && validateForm.get('title').errors">请输入计划标题且不超过20字</nz-form-explain>
</nz-form-control>
</nz-form-item>
</div>
......
......@@ -42,7 +42,7 @@ export class PlanModalComponent implements OnInit {
this.participantsList = [];
this.principalsList = [];
this.validateForm = this.fb.group({
title: [null, [Validators.required]],
title: [null, [Validators.required],Validators.maxLength(20)],
typeId: [null, [Validators.required]],
startTime: [null, [Validators.required]],
endTime: [null, [Validators.required]],
......@@ -50,7 +50,7 @@ export class PlanModalComponent implements OnInit {
cycleNum: ['1'],
number: [null, [Validators.required]],
workload: [null],
description: [null],
description: [null,Validators.maxLength(100)],
principals: [null, [Validators.required]], //负责人
participants: [null, [Validators.required]], //参与人
});
......
......@@ -111,7 +111,7 @@ export class UploadComponent implements OnInit {
this.isVisible = false;
this.fileList = [];
this.done.emit();
this.message.success('上传成功');
this.message.success('导入成功');
}
this.isOkLoading = false;
}
......@@ -130,7 +130,7 @@ export class UploadComponent implements OnInit {
this.isVisible = false;
this.fileList = [];
this.done.emit();
this.message.success('上传成功');
this.message.success('导入成功');
}
this.isOkLoading = false;
}
......
......@@ -26,7 +26,7 @@
}
.container {
background-color: #ebedf0;
background-color: #ffffff;
}
.search-form {
......
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