Commit 38452f18 authored by wangqinghua's avatar wangqinghua

update

parent e6f0f69c
...@@ -92,29 +92,32 @@ ...@@ -92,29 +92,32 @@
</tbody> </tbody>
</nz-table> </nz-table>
<p (click)="showAddFollow()">添加关注</p> <p (click)="showAddFollow()">添加关注</p>
<div nz-row> <div nz-row>
<div nz-col nzSpan="12"> <ng-container *ngFor="let item of followList">
<div> <div nz-col nzSpan="12" style="padding: 5px;">
<div> <div style="border: 1px solid #ddd;">
<p></p> <div style="border-bottom: 1px solid #ddd;padding: 10px 5px;background-color:#eee;">
<p>所在分组</p> <div>
</div> <p>{{item.name}} <span style="margin-left: 10px">IP:{{item.host}}</span></p>
</div> <p>所在分组</p>
<div nz-row> </div>
<div nz-col nzSpan="12">
<div>
<p>监测点</p>
<p>监测点</p>
</div> </div>
<div> <div nz-row>
PING值 <div nz-col nzSpan="12">
<div style="padding: 10px;">
<p>监测点</p>
<p>{{item.high}} {{item.warning}}</p>
</div>
<div style="padding: 10px;display: flex;align-items: center">
<p>PING值:{{item.lose}}</p>
</div>
</div>
<div nz-col nzSpan="12" echarts [options]="item.option"></div>
</div> </div>
</div> </div>
<div nz-col nzSpan="12"></div>
</div>
</div>
<div nz-col nzSpan="12">
</div>
</ng-container>
</div> </div>
</div>
<smart-select-group #smartSelectGroup (done)="getItem($event)"></smart-select-group> <smart-select-group #smartSelectGroup (done)="getItem($event)"></smart-select-group>
...@@ -60,6 +60,9 @@ export class HomeComponent implements OnInit,AfterViewInit { ...@@ -60,6 +60,9 @@ export class HomeComponent implements OnInit,AfterViewInit {
rightTotal = 0; rightTotal = 0;
//我的关注
followList;
constructor( constructor(
private overAllSer:OverAllService,private message:NzMessageService, private overAllSer:OverAllService,private message:NzMessageService,
private alarmSer:AlarmService,private renderer:Renderer2, private alarmSer:AlarmService,private renderer:Renderer2,
...@@ -89,7 +92,7 @@ export class HomeComponent implements OnInit,AfterViewInit { ...@@ -89,7 +92,7 @@ export class HomeComponent implements OnInit,AfterViewInit {
getMyFollow(){ getMyFollow(){
this.layoutSer.myFollow().subscribe( this.layoutSer.myFollow().subscribe(
(res)=>{ (res)=>{
this.followList = res.data;
} }
) )
} }
......
...@@ -52,7 +52,7 @@ export class LayoutService { ...@@ -52,7 +52,7 @@ export class LayoutService {
//我的关注 //我的关注
myFollow(): Observable<any>{ myFollow(): Observable<any>{
return this.http.get(SERVER_API_URL + "/userFollow/myFollow"); return this.http.get(SERVER_API_URL + "/userFollow/myFollowDetail");
} }
} }
...@@ -311,7 +311,6 @@ ...@@ -311,7 +311,6 @@
</td> </td>
<td> <td>
<ng-container *ngIf="item.level">
<ng-container *ngIf="item.available == 0"> <ng-container *ngIf="item.available == 0">
<nz-tag>AGENT</nz-tag> <nz-tag>AGENT</nz-tag>
</ng-container> </ng-container>
...@@ -351,7 +350,6 @@ ...@@ -351,7 +350,6 @@
<ng-container *ngIf="item.ipmi_available == 2"> <ng-container *ngIf="item.ipmi_available == 2">
<nz-tag [nzColor]="color.red">IPMI</nz-tag> <nz-tag [nzColor]="color.red">IPMI</nz-tag>
</ng-container> </ng-container>
</ng-container>
</td> </td>
<td class="handle"> <td class="handle">
<span (click)="showBasicCheckModal(item.hostid,item.host)">添加监测点</span> <span (click)="showBasicCheckModal(item.hostid,item.host)">添加监测点</span>
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
</div> </div>
<div nz-col nzSpan="8" class="text-right"> <div nz-col nzSpan="8" class="text-right">
<input [(ngModel)]="obj.content" nz-input placeholder="角色/权限模块/资源权限"> <input [(ngModel)]="obj.content" nz-input placeholder="角色/权限模块/资源权限">
<button nz-button nzType="default"><i class="anticon anticon-search"></i>搜索</button> <button (click)="getList()" nz-button nzType="default"><i class="anticon anticon-search"></i>搜索</button>
</div> </div>
</div> </div>
<nz-table #basicTable [nzData]="dataSet" [nzFrontPagination]="false" [nzTotal]="totalNum" [nzPageIndex]="pageNumber" [nzPageSize]="pageSize" (nzPageIndexChange)="changePage($event)"> <nz-table #basicTable [nzData]="dataSet" [nzFrontPagination]="false" [nzTotal]="totalNum" [nzPageIndex]="pageNumber" [nzPageSize]="pageSize" (nzPageIndexChange)="changePage($event)">
......
...@@ -24,11 +24,11 @@ ...@@ -24,11 +24,11 @@
<button (click)="approvalUnPass()" nz-button nzType="default"><i class="anticon anticon-close-circle-o"></i>退回</button> <button (click)="approvalUnPass()" nz-button nzType="default"><i class="anticon anticon-close-circle-o"></i>退回</button>
</div> </div>
<div nz-col nzSpan="8" class="text-right"> <div nz-col nzSpan="8" class="text-right">
<input nz-input placeholder="角色/权限模块/资源权限" [(ngModel)]="name"> <input nz-input placeholder="操作用户" [(ngModel)]="name">
<button (click)="search()" nz-button nzType="default"><i class="anticon anticon-search"></i>搜索</button> <button (click)="search()" nz-button nzType="default"><i class="anticon anticon-search"></i>搜索</button>
</div> </div>
</div> </div>
<nz-tabset [nzTabPosition]="'top'" [nzType]="'card'"> <nz-tabset nzSelectedIndex]="tabNum" [nzTabPosition]="'top'" [nzType]="'card'">
<nz-tab nzTitle="待审批"> <nz-tab nzTitle="待审批">
<nz-table #basicTable [nzData]="noList" [nzFrontPagination]="false" [nzTotal]="totalNumNo" [nzPageIndex]="pageNoNo" [nzPageSize]="pageSize" (nzPageIndexChange)="changeNoPage($event)"> <nz-table #basicTable [nzData]="noList" [nzFrontPagination]="false" [nzTotal]="totalNumNo" [nzPageIndex]="pageNoNo" [nzPageSize]="pageSize" (nzPageIndexChange)="changeNoPage($event)">
<thead> <thead>
......
...@@ -14,6 +14,8 @@ export class ExamineComponent implements OnInit { ...@@ -14,6 +14,8 @@ export class ExamineComponent implements OnInit {
pageSize = pageSize; pageSize = pageSize;
name; name;
tabNum = 0;
//已审批 //已审批
pageNoAlready = 1; pageNoAlready = 1;
totalNumAlready; totalNumAlready;
...@@ -183,7 +185,12 @@ export class ExamineComponent implements OnInit { ...@@ -183,7 +185,12 @@ export class ExamineComponent implements OnInit {
} }
search(){ search(){
this.getListAlready(); if(this.tabNum == 0){
this.getListNo();
}
if(this.tabNum == 1){
this.getListAlready();
}
} }
} }
...@@ -55,11 +55,7 @@ ...@@ -55,11 +55,7 @@
<button nz-button nzType="default">导入组织</button> <button nz-button nzType="default">导入组织</button>
<button nz-button nzType="default">导入用户</button> <button nz-button nzType="default">导入用户</button>
</div> </div>
<nz-table #basicTable [nzData]="dataSet" <nz-table #basicTable [nzData]="dataSet" [nzFrontPagination]="false" [nzTotal]="totalNum" [nzPageIndex]="pageNum" [nzPageSize]="pageSize" (nzPageIndexChange)="changePage($event)"
(nzCurrentPageDataChange)="currentPageDataChange($event)"
(nzPageIndexChange)="refreshStatus()"
(nzPageSizeChange)="refreshStatus()"
[nzFrontPagination]="false" [nzTotal]="totalNum" [nzPageIndex]="pageNum" [nzPageSize]="pageSize" (nzPageIndexChange)="changePage($event)"
> >
<thead> <thead>
<tr> <tr>
......
...@@ -13,7 +13,7 @@ import {pageSize} from '../../app.constants'; ...@@ -13,7 +13,7 @@ import {pageSize} from '../../app.constants';
styles: [] styles: []
}) })
export class GroupComponent implements OnInit { export class GroupComponent implements OnInit {
@ViewChild("smartSelectRole") smartSelectRole:SelectRoleComponent; @ViewChild('smartSelectRole') smartSelectRole: SelectRoleComponent;
@ViewChild('power') power; @ViewChild('power') power;
@ViewChild('smartUser') smartUser: UserComponent; @ViewChild('smartUser') smartUser: UserComponent;
@ViewChild('smartGroupModal') smartGroupModal: GroupModalComponent; @ViewChild('smartGroupModal') smartGroupModal: GroupModalComponent;
...@@ -50,17 +50,17 @@ export class GroupComponent implements OnInit { ...@@ -50,17 +50,17 @@ export class GroupComponent implements OnInit {
this.dataSet = $event; this.dataSet = $event;
} }
selectItem(item,e){ selectItem(item, e) {
if(e){ if (e) {
this.selectList.push(item); this.selectList.push(item);
}else{ } else {
this.selectList.forEach((value,index)=>{ this.selectList.forEach((value, index) => {
if(value.id == item.id){ if (value.id == item.id) {
this.selectList.splice(index,1) this.selectList.splice(index, 1);
} }
}); });
} }
this.refreshStatus() this.refreshStatus();
} }
refreshStatus(): void { refreshStatus(): void {
...@@ -83,10 +83,8 @@ export class GroupComponent implements OnInit { ...@@ -83,10 +83,8 @@ export class GroupComponent implements OnInit {
getUser() { getUser() {
const data = { const data = {
'userBo': { 'search': this.name = this.name == '' ? null : this.name,
search:this.name = this.name == ""?null:this.name, 'organizationId': this.organizationId = this.organizationId == '' ? null : this.organizationId,
organizationId:this.organizationId = this.organizationId == ""?null:this.organizationId
},
'pageNum': this.pageNum, 'pageNum': this.pageNum,
'pageSize': this.pageSize 'pageSize': this.pageSize
}; };
...@@ -98,12 +96,12 @@ export class GroupComponent implements OnInit { ...@@ -98,12 +96,12 @@ export class GroupComponent implements OnInit {
); );
} }
changePage(e){ changePage(e) {
this.pageNum = e; this.pageNum = e;
this.getUser(); this.getUser();
} }
getOrg(e){ getOrg(e) {
console.log(e); console.log(e);
this.organizationId = e.node.key; this.organizationId = e.node.key;
this.getUser(); this.getUser();
...@@ -147,12 +145,12 @@ export class GroupComponent implements OnInit { ...@@ -147,12 +145,12 @@ export class GroupComponent implements OnInit {
//新增用户 //新增用户
showUserModal() { showUserModal() {
this.smartUser.showAddModal(this.groupList,"新增用户"); this.smartUser.showAddModal(this.groupList, '新增用户');
} }
//编辑用户 //编辑用户
showEditModal(item){ showEditModal(item) {
this.smartUser.showEditModal(this.groupList,"编辑用户",item.id); this.smartUser.showEditModal(this.groupList, '编辑用户', item.id);
} }
//删除用户--单个 //删除用户--单个
...@@ -164,11 +162,11 @@ export class GroupComponent implements OnInit { ...@@ -164,11 +162,11 @@ export class GroupComponent implements OnInit {
nzCancelText: '取消', nzCancelText: '取消',
nzOnOk: () => { nzOnOk: () => {
const data = { const data = {
id:item.id id: item.id
}; };
this.systemSer.deleteUser(data).subscribe( this.systemSer.deleteUser(data).subscribe(
(res) => { (res) => {
if(res.data == 1){ if (res.data == 1) {
this.getUser(); this.getUser();
} }
} }
...@@ -180,32 +178,32 @@ export class GroupComponent implements OnInit { ...@@ -180,32 +178,32 @@ export class GroupComponent implements OnInit {
} }
//删除用户-- 批量 //删除用户-- 批量
batchDelete(){ batchDelete() {
let bool = false; let bool = false;
this.dataSet.forEach(e=>{ this.dataSet.forEach(e => {
if(e.checked){ if (e.checked) {
bool = true; bool = true;
} }
}); });
if(!bool){ if (!bool) {
this.message.warning("请选择需要删除的用户"); this.message.warning('请选择需要删除的用户');
return false; return false;
} }
let arr = []; let arr = [];
this.dataSet.forEach(e=>{ this.dataSet.forEach(e => {
if(e.checked){ if (e.checked) {
arr.push(e.user.id); arr.push(e.user.id);
} }
}); });
this.commonSer.confirmThing("删除","确定删除选择的用户",()=>{ this.commonSer.confirmThing('删除', '确定删除选择的用户', () => {
this.systemSer.batchDeleteUser(arr).subscribe( this.systemSer.batchDeleteUser(arr).subscribe(
(res) => { (res) => {
if(res.errCode == 10000){ if (res.errCode == 10000) {
this.getUser(); this.getUser();
} }
} }
); );
}) });
} }
//新增部门 //新增部门
...@@ -214,65 +212,67 @@ export class GroupComponent implements OnInit { ...@@ -214,65 +212,67 @@ export class GroupComponent implements OnInit {
} }
//编辑部门 //编辑部门
editGroup(item){} editGroup(item) {
}
//删除部门 //删除部门
deleteGroup(item){} deleteGroup(item) {
}
//授予角色 //授予角色
grantRole(data){ grantRole(data) {
this.setType = "单个"; this.setType = '单个';
this.userId = data.id; this.userId = data.id;
this.smartSelectRole.showModal("选择角色",this.userId); this.smartSelectRole.showModal('选择角色', this.userId);
} }
//设置用户角色 //设置用户角色
setRole(event){ setRole(event) {
if(this.setType == "批量"){ if (this.setType == '批量') {
const data = { const data = {
userId:this.selectList.map( userId: this.selectList.map(
e=>{ e => {
return e.id; return e.id;
} }
), ),
roles:event.map(e=>{ roles: event.map(e => {
return e.id; return e.id;
}), }),
}; };
this.systemSer.batchUserToAuth(data).subscribe( this.systemSer.batchUserToAuth(data).subscribe(
(res)=>{ (res) => {
if(res.errCode == 10000){ if (res.errCode == 10000) {
this.getUser(); this.getUser();
this.message.success("授予角色成功"); this.message.success('授予角色成功');
}else{ } else {
this.message.error(res.errMsg); this.message.error(res.errMsg);
} }
} }
) );
} }
if(this.setType == "单个"){ if (this.setType == '单个') {
const data = { const data = {
userId:this.userId, userId: this.userId,
roles:event.map(e=>{ roles: event.map(e => {
return e.id; return e.id;
}), }),
}; };
this.systemSer.aloneUserToAuth(data).subscribe( this.systemSer.aloneUserToAuth(data).subscribe(
(res)=>{ (res) => {
if(res.errCode == 10000){ if (res.errCode == 10000) {
this.getUser(); this.getUser();
this.message.success("授予角色成功"); this.message.success('授予角色成功');
}else{ } else {
this.message.error(res.errMsg); this.message.error(res.errMsg);
} }
} }
) );
} }
} }
selectRoleModal(){ selectRoleModal() {
this.setType = "批量"; this.setType = '批量';
this.smartSelectRole.showModal("选择角色",null); this.smartSelectRole.showModal('选择角色', null);
} }
} }
...@@ -37,7 +37,7 @@ export class SystemService { ...@@ -37,7 +37,7 @@ export class SystemService {
//用户列表 //用户列表
user(data): Observable<any>{ user(data): Observable<any>{
return this.http.post(SERVER_API_URL_COMS + '/user/getUserList?',data); return this.http.post(SERVER_API_URL_COMS + '/user/getUserList',data);
} }
//新增用户 //新增用户
......
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