Commit 38452f18 authored by wangqinghua's avatar wangqinghua

update

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