Commit 3e9ec20b authored by wangqinghua's avatar wangqinghua

update

parent 258f38d1
......@@ -18,9 +18,13 @@
</a>
<ul nz-menu>
<li nz-menu-item>设置</li>
<li (click)="showSeparationModal()" nz-menu-item>三员分立</li>
<li nz-menu-item (click)="logout()" >退出</li>
</ul>
</nz-dropdown>
</div>
</div>
</nz-header>
<!--三员分立-->
<smart-separation #smartSeparation></smart-separation>
......@@ -7,6 +7,7 @@ import { Principal, LoginService } from '../../shared';
import { VERSION } from '../../app.constants';
import {LocalStorageService} from 'ngx-webstorage';
import {SeparationComponent} from '../../system/modal/separation/separation.component';
@Component({
selector: 'jhi-navbar',
......@@ -18,6 +19,7 @@ import {LocalStorageService} from 'ngx-webstorage';
export class NavbarComponent implements OnInit ,AfterViewChecked{
@ViewChild('parent') parent:ElementRef;
@ViewChild('children') children:ElementRef;
@ViewChild("smartSeparation") smartSeparation:SeparationComponent;
inProduction: boolean;
isNavbarCollapsed: boolean;
languages: any[];
......@@ -82,4 +84,9 @@ export class NavbarComponent implements OnInit ,AfterViewChecked{
this.isBool = false;
}
}
//三员分立
showSeparationModal(){
this.smartSeparation.showModal("三员分立");
}
}
......@@ -22,6 +22,7 @@ export class SelectPersonComponent implements OnInit {
disabledButton = true;
indeterminate = false;
roleId;
deleteList=[];
displayData: Array<{ key1: string; key2: number; key3: string; key4: string; checked: boolean }> = [];
constructor(private systemSer: SystemService, private commonSer: CommonService) {
......@@ -39,17 +40,28 @@ export class SelectPersonComponent implements OnInit {
selectItem(item,e){
if(e){
this.selectList.push(item);
this.deleteList.forEach((value,index)=>{
if(value.id == item.id){
this.deleteList.splice(index,1)
}
})
}else{
this.selectList.forEach((value,index)=>{
if(value.id == item.id){
this.selectList.splice(index,1)
}
})
});
if(item.isRole == 1){
this.deleteList.push(item);
}
}
this.refreshStatus()
}
deleteSelect(index){
if(this.selectList[index].isRole == 1){
this.deleteList.push(this.selectList[index]);
}
this.selectList.splice(index,1);
}
......@@ -68,6 +80,7 @@ export class SelectPersonComponent implements OnInit {
init(){
this.selectList = [];
this.deleteList=[];
this.allChecked = false;
this.checkedNumber = 0;
this.disabledButton = true;
......@@ -130,6 +143,12 @@ export class SelectPersonComponent implements OnInit {
this.systemSer.getUserByOrgIdAboutRole(data).subscribe(
(res)=>{
this.userList = res.data;
this.userList.forEach(e=>{
if(e.isRole == 1){
e.checked = true;
this.selectList.push(e);
}
})
}
)
}
......@@ -149,7 +168,11 @@ export class SelectPersonComponent implements OnInit {
handEditleOk(){
if(this.title == "授予用户"){
const data = {
'select':this.selectList,
'delete':this.deleteList
}
this.done.emit(data);
}else{
this.done.emit(this.selectList);
}
......
......@@ -121,6 +121,7 @@ export class NeTopologyComponent implements OnInit, AfterViewInit {
//获取设备图片
setImg(e){
console.log(e);
editor.utils.addNode(e[0].icon,'图片');
}
......
......@@ -29,24 +29,24 @@
</div>
<div class="releative" #checkEle>
<div #colorEle class="checkTags tag-form">
<span (click)="getCheckList('正常')">
<span (click)="changeState('正常')">
<nz-tag [nzColor]="color.green"></nz-tag>
<i *ngIf="!checkStatus.normal && checkStatus.normal !=0" class="anticon anticon-spin anticon-loading" style="font-size: 15px;"></i>{{checkStatus.normal}}
</span>
<span (click)="getCheckList('告警')"> <nz-tag [nzColor]="color.yellow"></nz-tag>
<span (click)="changeState('告警')"> <nz-tag [nzColor]="color.yellow"></nz-tag>
<i *ngIf="!checkStatus.warning && checkStatus.warning !=0" class="anticon anticon-spin anticon-loading" style="font-size: 15px;"></i>
{{checkStatus.warning}}
</span>
<span (click)="getCheckList('严重')"> <nz-tag [nzColor]="color.red"></nz-tag>
<span (click)="changeState('严重')"> <nz-tag [nzColor]="color.red"></nz-tag>
<i *ngIf="!checkStatus.high && checkStatus.high !=0" class="anticon anticon-spin anticon-loading" style="font-size: 15px;"></i>
{{checkStatus.high}}
</span>
<span (click)="getCheckList('禁用')"> <nz-tag [nzColor]="color.gray"></nz-tag>
<span (click)="changeState('禁用')"> <nz-tag [nzColor]="color.gray"></nz-tag>
<i *ngIf="!checkStatus.disabled && checkStatus.disabled !=0" class="anticon anticon-spin anticon-loading" style="font-size: 15px;"></i>
{{checkStatus.disabled}}
</span>
</div>
<nz-tabset class="tabs-smart ">
<nz-tabset [nzSelectedIndex]="tabNum" class="tabs-smart">
<nz-tab nzTitle="资源详情">
<section>
......@@ -169,7 +169,6 @@
<td>{{data.lastclock}}</td>
<td>{{data.itemType}}</td>
<td>{{data.delay}}</td>
<!--<td>{{data.source}}</td>-->
<td class="cursor">
<span (click)="showImageModal(data)">图表</span>
</td>
......
......@@ -41,10 +41,12 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
color = color;
loading = false;
hostId: string;
tabNum = 0;
hostName;
realName;
size = 'default';
hostType: string;
changeStates;
chartOption1;
responseTimeStr;
losedStr;
......@@ -615,7 +617,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
//添加or编辑监测点 之后
getList(){
this.getCheckList(null);
this.getCheckList();
this.findItemType();
}
......@@ -646,7 +648,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
}
//监测点列表
getCheckList(state) {
getCheckList() {
this.getCheckStatus();
this.loading = true;
const data = {
......@@ -655,7 +657,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
obj:{
applicationid: this.applicationId,
hostid: this.hostId,
priorityName:state
priorityName:this.changeStates
}
};
this.overAllSer.findCheckByType(data).subscribe(
......@@ -667,16 +669,22 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
);
}
changeState(state){
this.tabNum = 1;
this.changeStates = state;
this.getCheckList();
}
//分页
change(e) {
this.pageIndex = e;
this.getCheckList(null);
this.getCheckList();
}
changeType(type) {
this.pageIndex = 1;
this.applicationId = type;
this.getCheckList(null);
this.getCheckList();
}
//监测点状态
......@@ -705,7 +713,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
(res) => {
if (res.errCode == 10000) {
this.message.success('删除成功');
this.getCheckList(null);
this.getCheckList();
} else {
this.message.error(res.errMsg);
}
......@@ -810,7 +818,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
this.overAllSer.itemUpdate(data).subscribe(
(res) => {
if (res.errCode == 10000) {
this.getCheckList(null);
this.getCheckList();
}
this.message.info(res.errMsg);
}
......
......@@ -21,7 +21,7 @@
<div nz-row class="search-form">
<div nz-col nzSpan="16">
<button nz-button nzType="default"><i class="anticon anticon-search"></i>选择角色</button>
<button (click)="selectRoleModal()" 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">
......@@ -50,7 +50,7 @@
<div class="padding-15-0">
<button (click)="showUserModal()" nz-button nzType="primary">新增用户</button>
<button (click)="batchDelete()" nz-button nzType="default">批量删除</button>
<!--<button nz-button nzType="default">批量修改</button>-->
<button nz-button nzType="default">批量修改</button>
<button nz-button nzType="default">导出模版</button>
<button nz-button nzType="default">导入组织</button>
<button nz-button nzType="default">导入用户</button>
......@@ -63,7 +63,6 @@
<tr>
<th nzShowCheckbox [(nzChecked)]="allChecked" [nzIndeterminate]="indeterminate" (nzCheckedChange)="checkAll($event)"></th>
<th>姓名</th>
<th>登录名</th>
<th>手机号码</th>
<th>角色</th>
<th>操作</th>
......@@ -71,12 +70,11 @@
</thead>
<tbody>
<tr *ngFor="let data of basicTable.data">
<td nzShowCheckbox [(nzChecked)]="data.checked" (nzCheckedChange)="refreshStatus($event)"></td>
<td>{{data.user.name}}</td>
<td>{{data.loginName}}</td>
<td>{{data.user.phoneNumber}}</td>
<td nzShowCheckbox [(nzChecked)]="data.checked" (nzCheckedChange)="selectItem(data,$event)"></td>
<td>{{data.name}}</td>
<td>{{data.phoneNumber}}</td>
<td>
<span *ngFor="let item of data.roles">{{item.name}}</span>
<span *ngFor="let item of data.roles">{{item.name}} </span>
</td>
<td class="handle">
<span (click)="grantRole(data)">授权</span>
......
......@@ -26,7 +26,8 @@ export class GroupComponent implements OnInit {
nodes: any[];
isVisible = true;
userId;
// displayData: Array<{ key1: string; key2: number; key3: string; key4: string; checked: boolean }> = [];
setType;
selectList = [];
constructor(private systemSer: SystemService, private message: NzMessageService,
private modalSer: NzModalService, private commonSer: CommonService) {
......@@ -41,6 +42,19 @@ export class GroupComponent implements OnInit {
this.dataSet = $event;
}
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)
}
});
}
this.refreshStatus()
}
refreshStatus(): void {
const allChecked = this.dataSet.every(value => value.checked === true);
const allUnChecked = this.dataSet.every(value => !value.checked);
......@@ -118,7 +132,7 @@ export class GroupComponent implements OnInit {
//编辑用户
showEditModal(item){
this.smartUser.showEditModal(this.groupList,"编辑用户",item.user.id);
this.smartUser.showEditModal(this.groupList,"编辑用户",item.id);
}
//删除用户--单个
......@@ -130,7 +144,7 @@ export class GroupComponent implements OnInit {
nzCancelText: '取消',
nzOnOk: () => {
const data = {
id:item.user.id
id:item.id
};
this.systemSer.deleteUser(data).subscribe(
(res) => {
......@@ -187,28 +201,60 @@ export class GroupComponent implements OnInit {
//授予角色
grantRole(data){
this.userId = data.user.id;
this.setType = "单个";
this.userId = data.id;
this.smartSelectRole.showModal("选择角色",this.userId);
}
//设置用户角色
setRole(event){
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);
if(this.setType == "批量"){
const data = {
userId:this.selectList.map(
e=>{
return e.id;
}
),
roles:event.map(e=>{
return e.id;
}),
};
this.systemSer.batchUserToAuth(data).subscribe(
(res)=>{
if(res.errCode == 10000){
this.getUser();
this.message.success("授予角色成功");
}else{
this.message.error(res.errMsg);
}
}
}
)
)
}
if(this.setType == "单个"){
const data = {
userId:this.userId,
roles:event.map(e=>{
return e.id;
}),
};
this.systemSer.aloneUserToAuth(data).subscribe(
(res)=>{
if(res.errCode == 10000){
this.getUser();
this.message.success("授予角色成功");
}else{
this.message.error(res.errMsg);
}
}
)
}
}
selectRoleModal(){
this.setType = "批量";
this.smartSelectRole.showModal("选择角色",null);
}
}
......@@ -60,11 +60,13 @@ export class PowerComponent implements OnInit {
batchAdduserToRole(e){
const data = {
roleId:this.roleId,
addUsers:e.map(e=>{
addUsers:e.select.map(e=>{
return e.id;
}),
deleteUsers:[]
}
deleteUsers:e.delete.map(e=>{
return e.id;
}),
};
this.systemSer.batchAuthRoleToUser(data).subscribe(
(res)=>{
if(res.errCode == 10000){
......
......@@ -95,17 +95,22 @@ export class SystemService {
return this.http.get(SERVER_API_URL_COMS + '/log?'+this.commonSer.toQuery(data));
}
//对单一角色批量添加用户
batchGrantUserToRole(data): Observable<any>{
return this.http.post(SERVER_API_URL_COMS + '/role/batchGrantUserToRole',data);
}
//对单一用户批量授权角色
//单个角色to多个用户
batchAuthRoleToUser(data): Observable<any>{
return this.http.post(SERVER_API_URL_COMS + '/role/batchAuthRoleToUser',data);
}
//对单一用户批量授权角色
aloneUserToAuth(data): Observable<any>{
return this.http.post(SERVER_API_URL_COMS + '/user/auth',data);
}
//对多个用户 批量授权角色
batchUserToAuth(data): Observable<any>{
return this.http.post(SERVER_API_URL_COMS + '/user/batchAuth',data);
}
//根据部门查询角色
getUserByOrgIdAboutRole(data): Observable<any>{
return this.http.get(SERVER_API_URL_COMS + '/user/getUserByOrgIdAboutRole?'+this.commonSer.toQuery(data) );
}
......
......@@ -21,6 +21,7 @@
<div nz-row [nzGutter]="4" class="search-form">
<div nz-col nzSpan="4">
<nz-select style="width: 100%;" [(ngModel)]="obj.type" nzPlaceHolder="选择分类" (ngModelChange)="changeType()">
<nz-option nzLabel="全部" nzValue="all"></nz-option>
<ng-container *ngFor="let item of parentList">
<nz-option [nzLabel]="item.name" [nzValue]="item.id"></nz-option>
</ng-container>
......@@ -56,7 +57,7 @@
</thead>
<tbody>
<tr *ngFor="let data of childrenList">
<td class="round-tag tag-form main-font-color">
<td class="round-tag tag-form main-font-color cursor">
<span (click)="showCEditModal(data.id)">{{data.name}}</span>
</td>
<td>
......
......@@ -29,7 +29,7 @@ export class AssetPartComponent implements OnInit {
pageCount:null,
pageNum:null,
searchStr:'',
type:null,
type:'all',
status:null,
source:null,
startTime:'',
......@@ -40,6 +40,7 @@ export class AssetPartComponent implements OnInit {
ngOnInit() {
this.getList();
this.changeType();
}
getTypeList(){
......
......@@ -84,5 +84,8 @@
</tbody>
</nz-table>
<!--新增巡检计划-->
<smart-plan-modal #smartPlanMoadl (done)="getList()"></smart-plan-modal>
<!--查看计划-->
<smart-look-plan #smartLookPlan></smart-look-plan>
\ No newline at end of file
......@@ -106,7 +106,7 @@
</div>
<nz-form-item>
<nz-form-label [nzSpan]="4" nzRequired nzFor="serviceid">计划工作量</nz-form-label>
<nz-form-label [nzSpan]="4" nzFor="serviceid">计划工作量</nz-form-label>
<nz-form-control [nzSpan]="14">
</nz-form-control>
......@@ -133,14 +133,14 @@
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSpan]="4" nzRequired nzFor="description">计划描述</nz-form-label>
<nz-form-label [nzSpan]="4" nzFor="description">计划描述</nz-form-label>
<nz-form-control [nzSpan]="14">
<textarea nz-input id="description" name="description" formControlName="description" placeholder="发送信息" [nzAutosize]="{ minRows: 2, maxRows: 6 }"></textarea>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSpan]="7" nzRequired nzFor="group">附件</nz-form-label>
<nz-form-label [nzSpan]="7" nzFor="group">附件</nz-form-label>
<nz-form-control [nzSpan]="12">
<nz-upload
[nzBeforeUpload]="beforeUpload"
......
......@@ -44,6 +44,8 @@ export class PlanModalComponent implements OnInit {
number: [null],
workload: [null],
description: [null],
principals: [this.principalsList], //负责人
participants: [this.participantsList], //参与人
});
}
......@@ -102,6 +104,8 @@ export class PlanModalComponent implements OnInit {
this.fileList.forEach((file: any) => {
formData.append('file', file);
});
this.validateForm.value.principals = this.principalsList;
this.validateForm.value.participants = this.participantsList;
formData.append('json', JSON.stringify(this.validateForm.value));
this.workSer.createPlan(formData).subscribe(
(res) => {
......@@ -121,6 +125,8 @@ export class PlanModalComponent implements OnInit {
this.fileList.forEach((file: any) => {
formData.append('file', file);
});
this.validateForm.value.principals = this.principalsList;
this.validateForm.value.participants = this.participantsList;
formData.append('json', JSON.stringify(this.validateForm.value));
formData.append('id', this.planId);
this.workSer.updatePlan(formData).subscribe(
......
......@@ -56,13 +56,16 @@
<nz-form-control [nzSpan]="14">
<button (click)="selectPerson()" nz-button><span>选择</span></button>
<ng-container *ngFor="let item of operatorsList;let i = index;">
<span>{{item.username}}</span><span (click)="deletePerson(i)">X</span>
<span style="margin-right: 10px">
<span>{{item.username}}</span>
<span (click)="deletePerson(i)">X</span>
</span>
</ng-container>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSpan]="4" nzRequired nzFor="description">详细描述</nz-form-label>
<nz-form-label [nzSpan]="4" nzFor="description">详细描述</nz-form-label>
<nz-form-control [nzSpan]="14">
<textarea nz-input id="description" name="description" formControlName="description"
placeholder="发送信息" [nzAutosize]="{ minRows: 2, maxRows: 6 }"></textarea>
......@@ -70,7 +73,7 @@
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSpan]="7" nzRequired>附件</nz-form-label>
<nz-form-label [nzSpan]="7">附件</nz-form-label>
<nz-form-control [nzSpan]="12">
<nz-upload
[nzBeforeUpload]="beforeUpload"
......
......@@ -35,7 +35,6 @@ export class EventComponent implements OnInit {
description: [null],
type: [null],
requester: [null],
file: [null],
requesterPhone: [null],
operators: [null],
}
......@@ -98,6 +97,7 @@ export class EventComponent implements OnInit {
this.fileList.forEach((file: any) => {
formData.append('file', file);
});
this.validateForm.value.operators = this.operatorsList;
formData.append('json', JSON.stringify(this.validateForm.value));
this.workSer.create(formData).subscribe(
(res) => {
......@@ -119,6 +119,7 @@ export class EventComponent implements OnInit {
this.fileList.forEach((file: any) => {
formData.append('file', file);
});
this.validateForm.value.operators = this.operatorsList;
formData.append('json', JSON.stringify(this.validateForm.value));
formData.append('id', this.eventId);
this.workSer.update(formData).subscribe(
......
......@@ -24,7 +24,6 @@
</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: 'all',
type: null,
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