Commit 3fa2485e authored by wangqinghua's avatar wangqinghua

update

parent f69592c7
......@@ -92,6 +92,7 @@ import {PararmsComponent} from './work/pararms/pararms.component';
import {ParamsTypeComponent} from './work/modal/params-type/params-type.component';
import {HomeComponent} from './home/home.component';
import {SelectGroupComponent} from './modal/select-group/select-group.component';
import {ModifyPasswordComponent} from './modal/modify-password/modify-password.component';
@NgModule({
imports: [
......@@ -184,7 +185,8 @@ import {SelectGroupComponent} from './modal/select-group/select-group.component'
AnalysisStatusComponent,
PararmsComponent,
ParamsTypeComponent,
SelectGroupComponent
SelectGroupComponent,
ModifyPasswordComponent
],
providers:[
OverAllService,
......
......@@ -510,6 +510,7 @@ export class HomeComponent implements OnInit,AfterViewInit {
pageNum: this.pageNum,
pageCount: this.pageCount,
obj:{
isWaring:'yes',
groupid: this.obj.alarmGroupId,
}
};
......
......@@ -19,6 +19,11 @@ export class LayoutService {
return this.http.get(SERVER_API_URL_COMS + "/resources/getAll");
}
//修改密码
modifyPassword(data): Observable<any>{
return this.http.post(SERVER_API_URL_COMS + "/modifyPassword",data);
}
//首页
//主机组中的主机数量统计
findGroupCount(): Observable<any> {
......
......@@ -16,7 +16,7 @@
<a nz-dropdown>{{user.loginName}}<i class="anticon anticon-down"></i>
</a>
<ul nz-menu>
<li nz-menu-item>设置</li>
<li (click)="showPasswordModal()" nz-menu-item>修改密码</li>
<li (click)="showSeparationModal()" nz-menu-item>三员分立</li>
<li nz-menu-item (click)="logout()" >退出</li>
</ul>
......@@ -29,5 +29,7 @@
<smart-separation #smartSeparation></smart-separation>
<!-- 添加资源-->
<smart-basic-edit #basicEdit></smart-basic-edit>
<!--修改密码-->
<smart-modify-password #smartModifyPassword></smart-modify-password>
<!--添加分组-->
<smart-create-group #smartCreateGroup></smart-create-group>
\ No newline at end of file
......@@ -10,6 +10,7 @@ import {LocalStorageService} from 'ngx-webstorage';
import {SeparationComponent} from '../../system/modal/separation/separation.component';
import {BasicEditComponent} from '../../modal/basic-edit/basic-edit.component';
import {CreateGroupComponent} from '../../modal/create-group/create-group.component';
import {ModifyPasswordComponent} from '../../modal/modify-password/modify-password.component';
@Component({
selector: 'jhi-navbar',
......@@ -24,6 +25,7 @@ export class NavbarComponent implements OnInit ,AfterViewChecked{
@ViewChild("smartSeparation") smartSeparation:SeparationComponent;
@ViewChild('basicEdit') basicEdit:BasicEditComponent;
@ViewChild('smartCreateGroup') smartCreateGroup:CreateGroupComponent;
@ViewChild('smartModifyPassword') smartModifyPassword:ModifyPasswordComponent;
inProduction: boolean;
isNavbarCollapsed: boolean;
......@@ -90,6 +92,11 @@ export class NavbarComponent implements OnInit ,AfterViewChecked{
}
}
//修改密码
showPasswordModal(){
this.smartModifyPassword.showModal();
}
//三员分立
showSeparationModal(){
this.smartSeparation.showModal("三员分立");
......
......@@ -190,6 +190,7 @@
<nz-option *ngFor="let option of objList" [nzLabel]="option.alias"
[nzValue]="option.userid"></nz-option>
</nz-select>
<input nzPlaceholder="手机号码或邮箱" type="text" nz-input name="host1" [(ngModel)]="validateForm.r_longdata" >
</nz-form-control>
</nz-form-item>
......@@ -218,7 +219,7 @@
<nz-form-item>
<nz-form-label [nzSpan]="4" nzRequired nzFor="serviceid">恢复信息</nz-form-label>
<nz-form-control [nzSpan]="14">
<textarea nz-input placeholder="恢复信息" [nzAutosize]="{ minRows: 4, maxRows: 4 }" [(ngModel)]="validateForm.r_shortdata"></textarea>
<textarea nz-input nzPlaceholder="恢复信息" [nzAutosize]="{ minRows: 4, maxRows: 4 }" [(ngModel)]="validateForm.r_shortdata"></textarea>
</nz-form-control>
</nz-form-item>
</div>
......
<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-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>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSpan]="7" nzRequired nzFor="realPassword">确认密码</nz-form-label>
<nz-form-control [nzSpan]="12">
<input type="password" nz-input formControlName="realPassword" placeholder="确认密码">
<nz-form-explain *ngIf="validateForm.get('realPassword').dirty && validateForm.get('realPassword').errors">请输入确认密码</nz-form-explain>
</nz-form-control>
</nz-form-item>
</form>
</nz-modal>
import {Component, OnInit} from '@angular/core';
import {OverAllService} from '../../overAll/overAll.service';
import {FormBuilder, FormGroup, Validators} from '@angular/forms';
import {NzMessageComponent, NzMessageService} from 'ng-zorro-antd';
import {LayoutService} from '../../layouts/layout.service';
@Component({
selector: 'smart-modify-password',
templateUrl: './modify-password.component.html',
styles: []
})
export class ModifyPasswordComponent implements OnInit {
isVisible = false;
title = '修改密码';
validateForm: FormGroup;
groupid;
constructor(private fb: FormBuilder, private layoutSer: LayoutService,
private message: NzMessageService) {}
ngOnInit() {
this.initForm();
}
showModal(): void {
this.isVisible = true;
}
handleOk() {
for (let i in this.validateForm.controls) {
this.validateForm.controls[i].markAsDirty();
this.validateForm.controls[i].updateValueAndValidity();
}
if (this.validateForm.invalid) {
return false;
}
if(this.validateForm.value.password != this.validateForm.value.realPassword){
this.message.error("两次输入密码不一致");
return false;
}
this.update();
}
update() {
let formData = new FormData();
formData.append('password',this.validateForm.value.password);
this.layoutSer.modifyPassword(formData).subscribe(
(res) => {
if (res.errCode == 10000) {
this.message.success('修改成功');
this.isVisible = false;
this.initForm();
} else {
this.message.error(res.errMsg);
}
}
);
}
handleCancel(): void {
this.isVisible = false;
this.initForm();
}
//初始化
initForm() {
this.validateForm = this.fb.group({
password: [null, [Validators.required]],
realPassword: [null, [Validators.required]],
});
}
}
......@@ -424,7 +424,7 @@ export class BasicComponent implements OnInit {
}
this.loading = true;
const data = {
type:item.equipmentTypeid
type:item.equipmentTypeId
};
this.overAllSer.findHostByType(data).subscribe(
(res) => {
......
......@@ -90,10 +90,7 @@ export class PowerComponent implements OnInit {
nzOkText:'确定',
nzOkType:'danger',
nzOnOk:()=>{
const data = {
id:item.id
}
this.systemSer.deleteRole(data).subscribe(
this.systemSer.deleteRole(item.id).subscribe(
(res) => {
if(res.errCode == 10000){
this.message.success("删除成功");
......
......@@ -37,7 +37,7 @@ export class SystemService {
//删除角色
deleteRole(params): Observable<any>{
return this.http.get(SERVER_API_URL_COMS + '/role/deleteRoleById?' +this.commonSer.toQuery(params));
return this.http.get(SERVER_API_URL_COMS + '/role/deleteRoleById/' + 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