Commit 97bd3c9b authored by wangqinghua's avatar wangqinghua

update

parent 7bd5a457
......@@ -45,7 +45,7 @@
<tbody>
<ng-container *ngFor="let data of dealList">
<tr>
<td>{{data.typeName}}</td>
<td>{{data.username}}</td>
<td>{{data.num}}</td>
<td>未解决 {{data.unsolved}} 部分解决 {{data.solveLittle}} 解决 {{data.solved}}</td>
<td>
......
......@@ -54,7 +54,7 @@
</ng-container>
</td>
<td>
<ng-container *ngFor="let item of data.eventTypeS">
<ng-container *ngFor="let item of data.eventTypes">
<span>{{item.typeName}} {{item.num}}</span>
</ng-container>
</td>
......
<!--添加资源-->
<nz-modal [nzWidth]="1080" [nzFooter]="null" [(nzVisible)]="isShow" [nzTitle]="title"
(nzOnCancel)="handleEditCancel()" (nzOnOk)="handEditleOk()">
<nz-tabset [nzSelectedIndex]="tabNum" style="padding-bottom: 25px;min-height: 500px">
<nz-tabset [nzSelectedIndex]="tabNum" (nzSelectedIndexChange)="tabsChange($event)" style="padding-bottom: 25px;min-height: 500px">
<nz-tab nzTitle="选定告警目标">
<div nz-form class="ant-advanced-search-form form-select">
<nz-form-item>
......
......@@ -208,6 +208,7 @@ export class AlarmModalComponent implements OnInit {
//tab切换
tabsChange(index) {
console.log(this.tabNum);
this.tabNum = index;
}
......
<!--添加资源-->
<nz-modal [nzWidth]="1080" [nzFooter]="null" [(nzVisible)]="isBasicEdit" nzTitle="{{modalTitle}}"
(nzOnCancel)="handleEditCancel()" (nzOnOk)="handEditleOk()">
<nz-tabset [nzSelectedIndex]="tabNum" style="padding-bottom: 25px;min-height: 500px">
<nz-tabset [nzSelectedIndex]="tabNum" (nzSelectedIndexChange)="tabsChange($event)" style="padding-bottom: 25px;min-height: 500px">
<nz-tab nzTitle="资源信息">
<div nz-form class="ant-advanced-search-form form-select">
<div nz-row [nzGutter]="24">
......
<nz-modal [(nzVisible)]="isVisible" [nzTitle]="title" (nzOnCancel)="handleCancel()" (nzOnOk)="handleOk()">
<form nz-form [formGroup]="validateForm">
<nz-form-item>
<nz-form-label [nzSpan]="7" nzRequired nzFor="password">密码</nz-form-label>
<nz-form-label [nzSpan]="7" nzRequired nzFor="oldPassword">密码</nz-form-label>
<nz-form-control [nzSpan]="12">
<input type="password" nz-input formControlName="password" placeholder="密码">
<nz-form-explain *ngIf="validateForm.get('password').dirty && validateForm.get('password').errors">请输入密码</nz-form-explain>
<input type="password" nz-input formControlName="oldPassword" placeholder="密码">
<nz-form-explain *ngIf="validateForm.get('oldPassword').dirty && validateForm.get('oldPassword').errors">请输入密码</nz-form-explain>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSpan]="7" nzRequired nzFor="newPassword">新密码</nz-form-label>
<nz-form-control [nzSpan]="12">
<input type="password" nz-input formControlName="newPassword" placeholder="密码">
<nz-form-explain *ngIf="validateForm.get('newPassword').dirty && validateForm.get('newPassword').errors">请输入密码</nz-form-explain>
</nz-form-control>
</nz-form-item>
<nz-form-item>
......
......@@ -37,7 +37,7 @@ export class ModifyPasswordComponent implements OnInit {
if (this.validateForm.invalid) {
return false;
}
if(this.validateForm.value.password != this.validateForm.value.realPassword){
if(this.validateForm.value.newPassword != this.validateForm.value.realPassword){
this.message.error("两次输入密码不一致");
return false;
}
......@@ -46,7 +46,8 @@ export class ModifyPasswordComponent implements OnInit {
update() {
let formData = new FormData();
formData.append('password',this.validateForm.value.password);
formData.append('newPassword',this.validateForm.value.realPassword);
formData.append('oldPassword',this.validateForm.value.oldPassword);
this.layoutSer.modifyPassword(formData).subscribe(
(res) => {
if (res.errCode == 10000) {
......@@ -69,8 +70,9 @@ export class ModifyPasswordComponent implements OnInit {
//初始化
initForm() {
this.validateForm = this.fb.group({
password: [null, [Validators.required]],
realPassword: [null, [Validators.required]],
oldPassword: [null, [Validators.required]],
newPassword: [null, [Validators.required,Validators.minLength(6),Validators.maxLength(12)]],
realPassword: [null, [Validators.required,Validators.minLength(6),Validators.maxLength(12)]],
});
}
}
<nz-modal [nzWidth]="1080" [(nzVisible)]="isVisible" nzTitle="{{title}}" [nzFooter]="null" (nzOnCancel)="handleCancel()"
(nzOnOk)="handleOk()">
<nz-tabset [nzSelectedIndex]="tabNum" style="padding-bottom: 25px;min-height: 500px">
<nz-tabset [nzSelectedIndex]="tabNum" (nzSelectedIndexChange)="tabsChange($event)" style="padding-bottom: 25px;min-height: 500px">
<nz-tab nzTitle="1.场景">
<div nz-form class="ant-advanced-search-form form-select">
<form nz-form class="ant-advanced-search-form">
......
......@@ -4,6 +4,9 @@ import {WorkService} from '../../work.service';
import {pageSize} from '../../../app.constants';
import {NzMessageService} from 'ng-zorro-antd';
import {SelectGroupComponent} from '../../../modal/select-group/select-group.component';
import {CommonService} from '../../../shared/common/common.service';
import {Location} from '@angular/common';
import {AssetsComponent} from '../../modal/assets/assets.component';
@Component({
selector: 'smart-assets-detail',
......@@ -12,6 +15,7 @@ import {SelectGroupComponent} from '../../../modal/select-group/select-group.com
})
export class AssetsDetailComponent implements OnInit {
@ViewChild('smartSelectGroup') smartSelectGroup:SelectGroupComponent;
@ViewChild('smartAssets') smartAssets:AssetsComponent;
invertoryId;
inventoryExtend;
......@@ -21,8 +25,8 @@ export class AssetsDetailComponent implements OnInit {
pageCount = pageSize;
loading = false;
thingList;
constructor(private routerInfo:ActivatedRoute,private workSer:WorkService,
private message:NzMessageService,private router:Router) {
constructor(private routerInfo:ActivatedRoute,private workSer:WorkService,private commonSer:CommonService,
private message:NzMessageService,private router:Router,private localSer:Location) {
this.routerInfo.queryParams.subscribe(
(res)=>{
this.invertoryId = res.invertoryId;
......@@ -76,6 +80,30 @@ export class AssetsDetailComponent implements OnInit {
});
}
//删除
deleteModal(){
const data = {
inventoryIds: [this.invertoryId]
};
this.commonSer.confirmThing("删除","确定删除该资产?",()=>{
this.workSer.deleteInventory(data).subscribe(
(res)=>{
if(res.errCode == 10000){
this.localSer.back();
this.message.success("删除资产成功");
}else{
this.message.error(res.errMsg);
}
}
)
})
}
//编辑
showEditModal(){
this.smartAssets.showEditModal("编辑资产",this.invertoryId);
}
// 打开添加关联modal
linkThen(){
this.smartSelectGroup.showAddModal("选择资源");
......
......@@ -130,7 +130,7 @@ export class ChildAssetsComponent implements OnInit {
//编辑资产
showEditModal(id){
this.smartAssets.showEditModal("编辑资产");
this.smartAssets.showEditModal("编辑资产",id);
}
//查看详情
......
......@@ -2,6 +2,7 @@ import {Component, EventEmitter, OnInit, Output} from '@angular/core';
import {FormBuilder, FormGroup, Validators} from '@angular/forms';
import {WorkService} from '../../work.service';
import {NzMessageService} from 'ng-zorro-antd';
import {DatePipe} from '@angular/common';
@Component({
selector: 'smart-assets',
......@@ -19,7 +20,9 @@ export class AssetsComponent implements OnInit {
parentTypeList;
typeList;
constructor(private workSer:WorkService,private fb:FormBuilder,
invertoryId //资产Id
constructor(private workSer:WorkService,private fb:FormBuilder,private datePipe:DatePipe,
private message:NzMessageService) {
}
......@@ -48,7 +51,6 @@ export class AssetsComponent implements OnInit {
storageLocation:[null],
groupid:[null],
inventoryTypeid:[null,[Validators.required]],
});
}
......@@ -77,10 +79,16 @@ export class AssetsComponent implements OnInit {
this.getParentType();
}
showEditModal(title) {
showEditModal(title,id) {
this.title = title;
this.invertoryId = id;
this.isVisible = true;
this.getParentType();
this.workSer.selectByPrimaryKey(this.invertoryId).subscribe(
(res)=>{
this.validateForm.patchValue( res.data );
}
)
}
handEditleOk() {
......@@ -114,7 +122,19 @@ export class AssetsComponent implements OnInit {
}
update(){
this.validateForm.value.id = this.invertoryId;
this.validateForm.value.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("编辑资产成功");
this.isVisible = false;
this.done.emit();
}else{
this.message.error(res.errMsg);
}
}
)
}
handleEditCancel() {
......
......@@ -12,7 +12,7 @@
事件处置
</nz-breadcrumb-item>
<nz-breadcrumb-item>
事件编号:123456
事件编号:{{event?.id}}
</nz-breadcrumb-item>
</nz-breadcrumb>
</div>
......@@ -27,14 +27,15 @@
<div nz-row>
<div nz-col nzSpan="4">事件编号</div>
<div nz-col nzSpan="1"></div>
<div nz-col nzSpan="7"></div>
<div nz-col nzSpan="7">{{event?.id}}</div>
<div nz-col nzSpan="4">提交时间</div>
<div nz-col nzSpan="7">{{event?.createTime | date:"yyyy-MM-dd HH:mm:ss"}}</div>
</div>
<div nz-row>
<div nz-col nzSpan="4">请求人</div>
<div nz-col nzSpan="1"></div>
<div nz-col nzSpan="4">{{event?.requester}}</div>
<div nz-col nzSpan="7">{{event?.requester}}</div>
<div nz-col nzSpan="4"></div>
<div nz-col nzSpan="7">{{event?.requesterPhone}}</div>
</div>
<div nz-row>
......@@ -53,7 +54,7 @@
<div nz-row>
<div nz-col nzSpan="4">附件</div>
<div nz-col nzSpan="1"></div>
<div nz-col nzSpan="7">{{event?.file}}</div>
<div nz-col nzSpan="7">{{event?.fileName}}</div>
</div>
<h2>流转记录</h2>
......
......@@ -124,6 +124,11 @@ export class WorkService {
return this.http.post(SERVER_API_URL + '/inventory/createInventory' ,data);
}
//修改资产
updateInventory(data): Observable<any>{
return this.http.post(SERVER_API_URL + '/inventory/updateInventory' ,data);
}
//根据资产类型id查询资产
findInventory(params): Observable<any>{
return this.http.get(SERVER_API_URL + '/inventory/findInventory/' +params);
......
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