Commit 15a41fab authored by wangqinghua's avatar wangqinghua

update

parent 8f89c614
......@@ -4,7 +4,7 @@
export const VERSION = process.env.VERSION;
export const DEBUG_INFO_ENABLED: boolean = !!process.env.DEBUG_INFO_ENABLED;
export const SERVER_API_URL_coms = '/coms';
export const SERVER_API_URL_COMS = '/coms';
export const SERVER_API_URL = '/zabbixBox';
export const BUILD_TIMESTAMP = process.env.BUILD_TIMESTAMP;
export const pageSize = 25;
......
<!--资源可用性统计-->
<div nz-row class="breadcrumbs">
<div nz-col nzSpan="16">
<nz-breadcrumb class="padding-8-0">
<nz-breadcrumb-item>
当前位置:首页
</nz-breadcrumb-item>
</nz-breadcrumb>
</div>
<div nz-col nzSpan="8" class="text-right">
<button (click)="search()" nz-button nzType="primary"><i class="anticon anticon-search"></i></button>
<button nz-button nzType="primary"><i class="anticon anticon-sync"></i></button>
<button nz-button nzType="primary"><i class="anticon anticon-arrows-alt"></i></button>
</div>
</div>
<div nz-row nzGutter="4">
<div nz-col nzSpan="16">
<nz-spin [nzSpinning]="isTopLoading">
<div echarts [options]="chartTopOption" style="height: 400px;width: 100%"></div>
</nz-spin>
</div>
<div nz-col nzSpan="12">
<nz-spin [nzSpinning]="isLastLoading">
<div echarts [options]="chartLastOption" style="height: 400px;width: 100%"></div>
</nz-spin>
</div>
</div>
<!--&lt;!&ndash;资源可用性统计&ndash;&gt;-->
<!--<div nz-row class="breadcrumbs">-->
<!--<div nz-col nzSpan="16">-->
<!--<nz-breadcrumb class="padding-8-0">-->
<!--<nz-breadcrumb-item>-->
<!--当前位置:首页-->
<!--</nz-breadcrumb-item>-->
<!--</nz-breadcrumb>-->
<!--</div>-->
<!--<div nz-col nzSpan="8" class="text-right">-->
<!--<button (click)="search()" nz-button nzType="primary"><i class="anticon anticon-search"></i></button>-->
<!--<button nz-button nzType="primary"><i class="anticon anticon-sync"></i></button>-->
<!--<button nz-button nzType="primary"><i class="anticon anticon-arrows-alt"></i></button>-->
<!--</div>-->
<!--</div>-->
<!--<div nz-row nzGutter="4">-->
<!--<div nz-col nzSpan="16">-->
<!--<nz-spin [nzSpinning]="isTopLoading">-->
<!--<div echarts [options]="chartTopOption" style="height: 400px;width: 100%"></div>-->
<!--</nz-spin>-->
<!--</div>-->
<!--<div nz-col nzSpan="12">-->
<!--<nz-spin [nzSpinning]="isLastLoading">-->
<!--<div echarts [options]="chartLastOption" style="height: 400px;width: 100%"></div>-->
<!--</nz-spin>-->
<!--</div>-->
<!--</div>-->
import { HttpClient } from "@angular/common/http";
import {Observable} from "rxjs/Rx";
import { Injectable } from '@angular/core';
import {SERVER_API_URL, SERVER_API_URL_coms} from '../app.constants';
import {SERVER_API_URL, SERVER_API_URL_COMS} from '../app.constants';
@Injectable()
export class LayoutService {
......@@ -10,11 +10,11 @@ export class LayoutService {
}
getMenu(): Observable<any>{
return this.http.get(SERVER_API_URL_coms + '/resources/getMenu');
return this.http.get(SERVER_API_URL_COMS + '/resources/getMenu');
}
getAllMenu(): Observable<any>{
return this.http.get(SERVER_API_URL_coms + "/resources/getAll");
return this.http.get(SERVER_API_URL_COMS + "/resources/getAll");
}
}
<!--添加资源-->
<nz-modal [nzWidth]="1080" [(nzVisible)]="isVisible" [nzTitle]="title" (nzOnCancel)="handleEditCancel()" (nzOnOk)="handEditleOk()">
<nz-modal [nzWidth]="1080" [(nzVisible)]="isVisible" [nzTitle]="title" (nzOnCancel)="handleEditCancel()"
(nzOnOk)="handEditleOk()">
<div nz-form class="ant-advanced-search-form form-select">
<div nz-row [nzGutter]="24">
<div nz-col [nzSpan]="8">
<nz-tree [(ngModel)]="nodes"></nz-tree>
</div>
<div nz-row [nzGutter]="24">
<div nz-col [nzSpan]="8">
<nz-tree [(ngModel)]="nodes"></nz-tree>
</div>
<div nz-col [nzSpan]="8">
<nz-table #basicTable [nzData]="userList"
(nzCurrentPageDataChange)="currentPageDataChange($event)"
(nzPageIndexChange)="refreshStatus()"
(nzPageSizeChange)="refreshStatus()">
<thead>
<tr>
<th nzShowCheckbox [(nzChecked)]="allChecked" [nzIndeterminate]="indeterminate" (nzCheckedChange)="checkAll($event)"></th>
<th>姓名</th>
<th>手机号码</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of basicTable.data">
<td nzShowCheckbox [(nzChecked)]="data.checked" (nzCheckedChange)="selectItem(data,$event)"></td>
<td>{{data.name}}</td>
<td>{{data.mobile}}</td>
</tr>
</tbody>
</nz-table>
</div>
<div nz-col [nzSpan]="8">
<nz-table #basicTable [nzData]="userList"
(nzCurrentPageDataChange)="currentPageDataChange($event)"
(nzPageIndexChange)="refreshStatus()"
(nzPageSizeChange)="refreshStatus()">
<thead>
<tr>
<th nzShowCheckbox [(nzChecked)]="allChecked" [nzIndeterminate]="indeterminate"
(nzCheckedChange)="checkAll($event)"></th>
<th>姓名</th>
<th>手机号码</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of basicTable.data">
<td nzShowCheckbox [(nzChecked)]="data.checked"
(nzCheckedChange)="selectItem(data,$event)"></td>
<td>{{data.name}}</td>
<td>{{data.phoneNumber}}</td>
</tr>
</tbody>
</nz-table>
</div>
<div nz-col [nzSpan]="8">
<p>已选中用户 <span >清空</span></p>
<p (click)="handle" *ngFor="let item of selectList;let i = index;">
<span>{{item.name}}</span>
<span>{{item.mobile}}</span>
<span (click)="deleteSelect(i)">X</span>
</p>
<div nz-col [nzSpan]="8">
<p>已选中用户 <span>清空</span></p>
<p (click)="handle" *ngFor="let item of selectList;let i = index;">
<span>{{item.name}}</span>
<span>{{item.phoneNumber}}</span>
<span (click)="deleteSelect(i)">X</span>
</p>
</div>
</div>
</div>
</div>
</nz-modal>
......@@ -21,6 +21,7 @@ export class SelectPersonComponent implements OnInit {
checkedNumber = 0;
disabledButton = true;
indeterminate = false;
roleId;
displayData: Array<{ key1: string; key2: number; key3: string; key4: string; checked: boolean }> = [];
constructor(private systemSer: SystemService, private commonSer: CommonService) {
......@@ -73,18 +74,25 @@ export class SelectPersonComponent implements OnInit {
this.indeterminate = false;
}
showModal(title) {
this.getUser();
showModal(title,roleId) {
this.getGroup();
this.isVisible = true;
this.title = title;
this.roleId = roleId;
if(this.title == "授予用户"){
}else{
this.getUser();
}
}
getUser() {
const data = {
'name': '',
'orgId': '',
'pageNumber': '1',
'userBo': {
search:null,
organizationId:null
},
'pageNum': '1',
'pageSize': '10'
};
this.systemSer.user(data).subscribe(
......@@ -99,6 +107,9 @@ export class SelectPersonComponent implements OnInit {
this.systemSer.organization().subscribe(
(res) => {
this.groupList = res.data;
if(this.title == "授予用户"){
this.getUserByOrgIdAboutRole(this.groupList[0].id);
}
this.groupList.forEach(
res => {
res.title = res.name;
......@@ -110,6 +121,19 @@ export class SelectPersonComponent implements OnInit {
);
}
//授予用户
getUserByOrgIdAboutRole(orgId){
const data = {
orgId:orgId,
roleId:this.roleId
}
this.systemSer.getUserByOrgIdAboutRole(data).subscribe(
(res)=>{
this.userList = res.data;
}
)
}
nodeTree() {
const tree = this.commonSer.listToTree('id', 'parentId', this.groupList,);
const list = tree.map(res => {
......@@ -124,6 +148,9 @@ export class SelectPersonComponent implements OnInit {
}
handEditleOk(){
if(this.title == "授予用户"){
}
this.done.emit(this.selectList);
this.isVisible = false;
this.init();
......
......@@ -17,6 +17,8 @@ export class SelectRoleComponent implements OnInit {
checkedNumber = 0;
disabledButton = true;
indeterminate = false;
userId;
userRoleList = [];
displayData: Array<{ key1: string; key2: number; key3: string; key4: string; checked: boolean }> = [];
constructor(private systemSer: SystemService) {
}
......@@ -55,16 +57,30 @@ export class SelectRoleComponent implements OnInit {
ngOnInit() {
}
showModal(title) {
showModal(title,id) {
this.title = title;
this.isVisible = true;
this.getRole();
this.userId = id;
const data = {
userId:this.userId
}
this.systemSer.getRoleByUserId(data).subscribe(
(res)=>{
this.userRoleList = res.data;
this.getRole();
}
)
}
getRole() {
this.systemSer.role().subscribe(
(res) => {
this.dataSet = res.data;
this.dataSet.forEach(e=>{
if(this.userRoleList.indexOf(e.id) > -1){
e.checked = true;
}
})
}
);
}
......@@ -74,7 +90,6 @@ export class SelectRoleComponent implements OnInit {
}
handEditleOk(){
console.log(this.selectList);
this.done.emit(this.selectList);
this.isVisible = false;
}
......
......@@ -355,8 +355,8 @@ export class BasicComponent implements OnInit {
nzOkText: '确定',
nzOkType: 'danger',
nzOnOk: () => {
const data = {params: []};
data.params.push(item.groupid);
const data = {groupid: []};
data.groupid.push(item.groupid);
this.overAllSer.deleteGroup(data).subscribe(
(res) => {
if (res.errCode == 10000) {
......
import { Injectable } from '@angular/core';
import { HttpClient, HttpResponse } from '@angular/common/http';
import { Observable } from 'rxjs/Observable';
import {SERVER_API_URL, SERVER_API_URL_coms} from '../../app.constants';
import {SERVER_API_URL, SERVER_API_URL_COMS} from '../../app.constants';
@Injectable()
export class AccountService {
constructor(private http: HttpClient) { }
get(): Observable<any>{
return this.http.post(SERVER_API_URL_coms+ '/login', {observe : 'response'});
return this.http.post(SERVER_API_URL_COMS+ '/login', {observe : 'response'});
}
save(account: any): Observable<HttpResponse<any>> {
return this.http.post(SERVER_API_URL_coms + '', account, {observe: 'response'});
return this.http.post(SERVER_API_URL_COMS + '', account, {observe: 'response'});
}
}
......@@ -3,7 +3,7 @@ import { HttpClient } from '@angular/common/http';
import { Router } from "@angular/router";
import { Observable } from 'rxjs/Observable';
import { LocalStorageService, SessionStorageService } from 'ngx-webstorage';
import {SERVER_API_URL, SERVER_API_URL_coms} from '../../app.constants';
import {SERVER_API_URL, SERVER_API_URL_COMS} from '../../app.constants';
import { EmitService } from "../../shared/event/eventEmitter";
@Injectable()
export class AuthServerProvider {
......@@ -26,7 +26,7 @@ export class AuthServerProvider {
password: credentials.password,
rememberMe: credentials.rememberMe
};
return this.http.post(SERVER_API_URL_coms + '/login', data, {observe : 'response'}).map(authenticateSuccess.bind(this));
return this.http.post(SERVER_API_URL_COMS + '/login', data, {observe : 'response'}).map(authenticateSuccess.bind(this));
function authenticateSuccess(resp) {
const bearerToken = resp.body.data;
if (bearerToken ) {
......
......@@ -21,7 +21,7 @@
<div nz-row class="search-form">
<div nz-col nzSpan="16">
<button (click)="selectJ()" nz-button nzType="default"><i class="anticon anticon-search"></i>选择角色</button>
<button nz-button nzType="default"><i class="anticon anticon-search"></i>选择角色</button>
<button (click)="showModal()" nz-button nzType="default"><i class="anticon anticon-search"></i>选择部门</button>
</div>
<div nz-col nzSpan="8" class="text-right">
......
......@@ -111,10 +111,6 @@ export class GroupComponent implements OnInit {
this.isVisible = false;
}
selectJ() {
this.power.hello();
}
//新增用户
showUserModal() {
this.smartUser.showAddModal(this.groupList,"新增用户");
......@@ -183,32 +179,30 @@ export class GroupComponent implements OnInit {
this.smartGroupModal.showModal(this.groupList);
}
//编辑部门
editGroup(item){}
//删除部门
deleteGroup(item){}
//授予角色
grantRole(data){
this.userId = data.id;
const res = {
userId:data.id
}
this.systemSer.roleList(res).subscribe(
(res)=>{
}
)
this.smartSelectRole.showModal("选择角色");
this.userId = data.user.id;
this.smartSelectRole.showModal("选择角色",this.userId);
}
//设置用户角色
setRole(event){
let str ="";
event.forEach(res=>{
str += res.id +",";
});
str = str.substring(0,str.length-1);
let formdata = new FormData();
formdata.append("userId",this.userId);
formdata.append("roles",str);
this.systemSer.batchGrantRoleToUser(formdata).subscribe(
const data = {
userId:this.userId,
roles:event.map(e=>{
return e.id;
}),
};
this.systemSer.batchAuthRoleToUser(data).subscribe(
(res)=>{
if(res.errCode == 10000){
this.getUser();
this.message.success("授予角色成功");
}else{
this.message.error(res.errMsg);
......
......@@ -59,7 +59,6 @@
</tr>
</tbody>
</nz-table>
<!--新增角色-->
<smart-role #smartRole (add)="getRole()"></smart-role>
......
......@@ -53,20 +53,19 @@ export class PowerComponent implements OnInit {
//授予用户
grantUser(data){
this.roleId = data.id;
this.smartSelectPerson.showModal("授予用户");
this.smartSelectPerson.showModal("授予用户",this.roleId);
}
//但一角色批量添加用户
batchAdduserToRole(e){
let str ="";
e.forEach(res=>{
str += res.id +",";
});
str = str.substring(0,str.length-1);
let formData = new FormData();
formData.append("roleId",this.roleId);
formData.append("users",str);
this.systemSer.batchGrantUserToRole(formData).subscribe(
const data = {
roleId:this.roleId,
addUsers:e.map(e=>{
return e.id;
}),
deleteUsers:[]
}
this.systemSer.batchAuthRoleToUser(data).subscribe(
(res)=>{
if(res.errCode == 10000){
this.message.success("授予成功")
......
......@@ -143,12 +143,12 @@ export class PlanModalComponent implements OnInit {
selectPerson1() {
this.modalTitle = '选择参与人';
this.smartSelectPerson.showModal(this.modalTitle);
this.smartSelectPerson.showModal(this.modalTitle,null);
}
selectPerson2() {
this.modalTitle = '选择负责人';
this.smartSelectPerson.showModal(this.modalTitle);
this.smartSelectPerson.showModal(this.modalTitle,null);
}
getUser(e) {
......
......@@ -30,7 +30,7 @@ export class TransforComponent implements OnInit {
//选择处理人弹窗
selectPerson(){
this.smartSelectPerson.showModal("选择转派人");
this.smartSelectPerson.showModal("选择转派人",null);
}
//选择转派人done
......
......@@ -142,7 +142,7 @@ export class EventComponent implements OnInit {
//选择处理人
selectPerson(){
this.smartSelectPerson.showModal("选择处理人");
this.smartSelectPerson.showModal("选择处理人",null);
}
deletePerson(i){
......
......@@ -24,6 +24,7 @@
</div>
<div nz-col nzSpan="3">
<nz-select style="width: 100%;" [(ngModel)]="obj.type" nzPlaceHolder="事件分类">
<nz-option nzLabel="全部" nzValue="all"></nz-option>
<ng-container *ngFor="let item of eventTypeList">
<nz-option [nzLabel]="item.name" [nzValue]="item.id"></nz-option>
</ng-container>
......
......@@ -33,7 +33,7 @@ export class WorkHandleComponent implements OnInit {
pageCount: null,
pageNum: null,
searchStr: '',
type: null,
type: 'all',
status: null,
source: null,
startTime: '',
......
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