Browse Source

[完善]新建用户密码弹出完善

beijing
邵佳豪 2 years ago
parent
commit
0a8267f7c0
  1. 125
      src/app/system-management/navigation/navigation.component.ts
  2. 4
      src/app/system-management/user/user.component.html
  3. 26
      src/app/system-management/user/user.component.ts

125
src/app/system-management/navigation/navigation.component.ts

@ -1,81 +1,108 @@
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { PatternService } from 'src/app/service/pattern.service';
import { Component, OnInit } from "@angular/core";
import { Router } from "@angular/router";
import { PatternService } from "src/app/service/pattern.service";
@Component({
selector: 'app-navigation',
templateUrl: './navigation.component.html',
styleUrls: ['./navigation.component.scss']
selector: "app-navigation",
templateUrl: "./navigation.component.html",
styleUrls: ["./navigation.component.scss"],
})
export class NavigationComponent implements OnInit {
constructor(private router: Router, private patternService: PatternService) { }
userMenu = []
menu = []
tap = []
menuList1 = []
menuList2 = []
constructor(private router: Router, private patternService: PatternService) {}
userMenu = [];
menu = [];
tap = [];
menuList1 = [];
menuList2 = [];
menu1 = [
{ name: '首页', url: '/homepage' },
{ name: '数字油站', url: '/plan' },
{ name: '今日预警', url: '/todaywarning' },
{ name: '预警记录', url: '/records_nav' },
{ name: '证照管理', url: '/audit' },
]
{ name: "首页", url: "/homepage" },
{ name: "数字油站", url: "/plan" },
{ name: "今日预警", url: "/todaywarning" },
{ name: "预警记录", url: "/records_nav" },
{ name: "证照管理", url: "/audit" },
];
menu3 = [
{ name: '组织机构管理', url: '/system/organization', img: '../../../assets/images/icon/organization.png' },
{ name: '用户管理', url: '/system/user', img: '../../../assets/images/icon/user.png' },
{ name: '角色管理', url: '/system/role', img: '../../../assets/images/icon/role.png' },
{ name: '分析主机管理', url: '/system/host', img: '../../../assets/images/icon/host.png' },
{ name: '推送管理', url: '/system/push', img: '../../../assets/images/icon/push.png' },
{ name: '经营类证照管理', url: '/system/updateOfLicense', img: '../../../assets/images/icon/license.png' },
{ name: '资产类证照管理', url: '/system/fileOfLicense', img: '../../../assets/images/icon/license.png' },
{ name: '菜单管理', url: '/system/menu', img: '../../../assets/images/icon/license.png' },
]
{
name: "组织机构管理",
url: "/system/organization",
img: "../../../assets/images/icon/organization.png",
},
{
name: "用户管理",
url: "/system/user",
img: "../../../assets/images/icon/user.png",
},
{
name: "角色管理",
url: "/system/role",
img: "../../../assets/images/icon/role.png",
},
{
name: "分析主机管理",
url: "/system/host",
img: "../../../assets/images/icon/host.png",
},
{
name: "推送管理",
url: "/system/push",
img: "../../../assets/images/icon/push.png",
},
{
name: "经营类证照管理",
url: "/system/updateOfLicense",
img: "../../../assets/images/icon/license.png",
},
{
name: "资产类证照管理",
url: "/system/fileOfLicense",
img: "../../../assets/images/icon/license.png",
},
{
name: "菜单管理",
url: "/system/menu",
img: "../../../assets/images/icon/license.png",
},
];
name
isProd: boolean
name;
isProd: boolean;
ngOnInit(): void {
this.isProd = this.patternService.isProd
let a = sessionStorage.getItem('userdata')
this.userMenu = JSON.parse(a).menus
this.name = JSON.parse(a).name
this.isProd = this.patternService.isProd;
let a = sessionStorage.getItem("userdata");
this.userMenu = JSON.parse(a).menus;
this.name = JSON.parse(a).name;
for (let index = 0; index < this.userMenu.length; index++) {
let a = this.userMenu[index].name
this.tap.push(a)
let a = this.userMenu[index].name;
this.tap.push(a);
}
for (let index = 0; index < this.menu1.length; index++) {
for (let k = 0; k < this.tap.length; k++) {
if (this.tap[k] == this.menu1[index].name) {
this.menuList1.push(this.menu1[index])
this.menuList1.push(this.menu1[index]);
}
}
// console.log(this.menuList1);
}
for (let index = 0; index < this.menu3.length; index++) {
if (JSON.parse(a).userName == "admin") {
this.menuList2 = this.menu3
this.menuList2 = this.menu3;
} else {
for (let k = 0; k < this.tap.length; k++) {
if (this.tap[k] == this.menu3[index].name) {
this.menuList2.push(this.menu3[index])
this.menuList2.push(this.menu3[index]);
}
}
}
}
}
signOut() {
sessionStorage.clear()
localStorage.removeItem("isautologin")
this.router.navigate(['/login'])
sessionStorage.clear();
localStorage.removeItem("isautologin");
this.router.navigate(["/login"]);
}
pages() {
sessionStorage.setItem('selectedMenu', this.menuList1[0].name)
this.router.navigate([this.menuList1[0].url])
sessionStorage.setItem("selectedMenu", this.menuList1[0].name);
// this.router.navigate([this.menuList1[0].url])
window.open(this.menuList1[0].url);
}
}

4
src/app/system-management/user/user.component.html

@ -19,7 +19,7 @@
</i>
<i (click)="close()" class="close" nz-icon nzType="close" nzTheme="outline"></i>
<i nz-icon [nzType]="'check-circle'" [nzTheme]="'twotone'" [nzTwotoneColor]="'#52c41a'"></i>
<span class="title">用户{{newPasswordObj.userName}}的密码重置成功</span>
<span class="title">{{newPasswordObj.title}}</span>
</div>
<div class="message">
当前密码为: {{newPasswordObj.newPassword}}
@ -97,7 +97,7 @@
<th [width]="'13%'">所属机构</th>
<th [width]="'10%'" *ngIf="level == 2">审核状态</th>
<th [width]="'8%'">用户状态</th>
<th [width]="'10%'">备注</th>
<th [width]="'8%'">备注</th>
<th [width]="'10%'">操作</th>
</tr>
</thead>

26
src/app/system-management/user/user.component.ts

@ -263,7 +263,7 @@ export class UserComponent implements OnInit {
),
roleNames: roleNames,
phoneNumber: instance.validateForm.value.phonenum,
note:instance.validateForm.value.note,
note: instance.validateForm.value.note,
isActive: true,
};
this.http.post(this.addUrl, body).subscribe(
@ -272,15 +272,13 @@ export class UserComponent implements OnInit {
this.message.create("success", "创建成功!");
this.SkipCount = 0;
this.getAllUsers();
this.notification.blank(
"用户" + data.result.userName + "创建成功",
"当前密码为:" + data.result.newPassword,
{
nzDuration: 0,
nzPlacement: "top",
nzClass: "resetPassword",
}
);
this.isShowNewPassword = true;
let obj = {
title: "用户" + data.result.userName + "创建成功",
newPassword: data.result.newPassword,
};
this.newPasswordObj = obj;
return true;
},
(err) => {
@ -343,11 +341,10 @@ export class UserComponent implements OnInit {
.subscribe((data: any) => {
this.isShowNewPassword = true;
let obj = {
userName: item.userName,
title: "用户" + item.userName + "密码重置成功",
newPassword: data.result.newPassword,
};
this.newPasswordObj = obj;
// this.openNewPassword(obj)
});
},
nzCancelText: "取消",
@ -394,9 +391,8 @@ export class UserComponent implements OnInit {
copy() {
let str =
"用户" +
this.newPasswordObj.userName +
"的密码重置成功,当前密码为" +
this.newPasswordObj.title +
",当前密码为" +
this.newPasswordObj.newPassword;
this.handleCopyValue(str)
.then(() => {

Loading…
Cancel
Save