21 changed files with 1128 additions and 15 deletions
@ -0,0 +1,23 @@ |
|||||||
|
<div class="box"> |
||||||
|
<form nz-form [formGroup]="validateForm"> |
||||||
|
<nz-form-item> |
||||||
|
<nz-form-control> |
||||||
|
<nz-input-group> |
||||||
|
<input nz-input type="text" formControlName="name" placeholder="请输入名称" /> |
||||||
|
</nz-input-group> |
||||||
|
</nz-form-control> |
||||||
|
</nz-form-item> |
||||||
|
<!-- <nz-form-item> |
||||||
|
<nz-form-control> |
||||||
|
<nz-input-group> |
||||||
|
<input nz-input type="text" formControlName="code" placeholder="请输入编码" /> |
||||||
|
</nz-input-group> |
||||||
|
</nz-form-control> |
||||||
|
</nz-form-item> --> |
||||||
|
<nz-form-item> |
||||||
|
<nz-form-control> |
||||||
|
<label nz-checkbox formControlName="isGasStation">是否为加油站</label> |
||||||
|
</nz-form-control> |
||||||
|
</nz-form-item> |
||||||
|
</form> |
||||||
|
</div> |
@ -0,0 +1,27 @@ |
|||||||
|
import { Component, OnInit } from '@angular/core'; |
||||||
|
import { NzModalRef } from 'ng-zorro-antd/modal'; |
||||||
|
import { FormBuilder, FormGroup, Validators } from '@angular/forms'; |
||||||
|
import { HttpClient } from '@angular/common/http'; |
||||||
|
@Component({ |
||||||
|
selector: 'app-addor', |
||||||
|
templateUrl: './addor.component.html', |
||||||
|
styleUrls: ['./addor.component.scss'] |
||||||
|
}) |
||||||
|
export class AddorComponent implements OnInit { |
||||||
|
|
||||||
|
validateForm!: FormGroup; |
||||||
|
constructor(private modal: NzModalRef, private fb: FormBuilder, private http: HttpClient) { } |
||||||
|
|
||||||
|
ngOnInit(): void { |
||||||
|
this.validateForm = this.fb.group({ |
||||||
|
name: [null, [Validators.required]], |
||||||
|
// code: [null, [Validators.required]],
|
||||||
|
isGasStation: [false] |
||||||
|
}); |
||||||
|
} |
||||||
|
destroyModal(): void { |
||||||
|
this.modal.destroy({ data: 'this the result data' }); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
} |
@ -0,0 +1,24 @@ |
|||||||
|
<div class="box"> |
||||||
|
<form nz-form [formGroup]="validateForm"> |
||||||
|
<nz-form-item> |
||||||
|
<nz-form-control nzErrorTip="请输入名称"> |
||||||
|
<nz-input-group> |
||||||
|
<input [(ngModel)]="datacopy.name" nz-input type="text" formControlName="name" |
||||||
|
placeholder="请输入名称" /> |
||||||
|
</nz-input-group> |
||||||
|
</nz-form-control> |
||||||
|
</nz-form-item> |
||||||
|
<!-- <nz-form-item> |
||||||
|
<nz-form-control> |
||||||
|
<nz-input-group> |
||||||
|
<input [(ngModel)]="datacopy.code" nz-input type="text" formControlName="code" placeholder="请输入编码" /> |
||||||
|
</nz-input-group> |
||||||
|
</nz-form-control> |
||||||
|
</nz-form-item> --> |
||||||
|
<nz-form-item> |
||||||
|
<nz-form-control> |
||||||
|
<label [(ngModel)]="datacopy.isGasStation" nz-checkbox formControlName="isGasStation">是否为加油站</label> |
||||||
|
</nz-form-control> |
||||||
|
</nz-form-item> |
||||||
|
</form> |
||||||
|
</div> |
@ -0,0 +1,29 @@ |
|||||||
|
import { Component, OnInit, Input } from '@angular/core'; |
||||||
|
import { NzModalRef } from 'ng-zorro-antd/modal'; |
||||||
|
import { FormBuilder, FormGroup, Validators } from '@angular/forms'; |
||||||
|
import { HttpClient } from '@angular/common/http'; |
||||||
|
@Component({ |
||||||
|
selector: 'app-editor', |
||||||
|
templateUrl: './editor.component.html', |
||||||
|
styleUrls: ['./editor.component.scss'] |
||||||
|
}) |
||||||
|
export class EditorComponent implements OnInit { |
||||||
|
@Input() data?: any; |
||||||
|
validateForm!: FormGroup; |
||||||
|
constructor(private modal: NzModalRef, private fb: FormBuilder, private http: HttpClient) { } |
||||||
|
|
||||||
|
datacopy: any |
||||||
|
ngOnInit(): void { |
||||||
|
this.validateForm = this.fb.group({ |
||||||
|
name: [null, [Validators.required]], |
||||||
|
// code: [null, [Validators.required]],
|
||||||
|
isGasStation: [] |
||||||
|
}); |
||||||
|
this.datacopy = JSON.parse(JSON.stringify(this.data)) |
||||||
|
} |
||||||
|
destroyModal(): void { |
||||||
|
this.modal.destroy({ data: 'this the result data' }); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
} |
@ -1 +1,43 @@ |
|||||||
<p>or works!</p> |
<div class="orbox" id="orbox"> |
||||||
|
<div class="topbox"> |
||||||
|
<div class="lefttop"> |
||||||
|
<span>组织机构列表</span> |
||||||
|
<span><img style="vertical-align: top;" src="../../../assets/images/icon/orgrey.png" alt=""> |
||||||
|
{{totalCount}}个单位</span> |
||||||
|
</div> |
||||||
|
<div class="righttop"> |
||||||
|
<nz-input-group nzPrefixIcon="search"> |
||||||
|
<input type="text" nz-input placeholder="请输入单位" [(ngModel)]="searchValue" /> |
||||||
|
</nz-input-group> |
||||||
|
<button nz-button nzType="primary" (click)="addOr()"><i nz-icon nzType="plus-circle" |
||||||
|
nzTheme="outline"></i>新增</button> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="treeTitle"> |
||||||
|
<span>机构名称</span> |
||||||
|
<span>操作</span> |
||||||
|
</div> |
||||||
|
<nz-tree [nzHideUnMatched]='true' [nzSearchValue]="searchValue" #nzTreeComponent [nzData]="nodes" |
||||||
|
[nzExpandAll]="nzExpandAll" [nzExpandedKeys]="defaultExpandedKeys" [nzTreeTemplate]="nzTreeTemplate" nzDraggable |
||||||
|
nzBlockNode (nzOnDrop)="nzEvent($event)" [nzBeforeDrop]="beforeDrop" [nzExpandedIcon]="multiExpandedIconTpl"> |
||||||
|
</nz-tree> |
||||||
|
<ng-template #nzTreeTemplate let-node let-origin="origin"> |
||||||
|
<div class="nodebox"> |
||||||
|
<span class="name">{{ node.title }}</span> |
||||||
|
<span class="operation"> |
||||||
|
<span class="blue" (click)="addOr(node)" *ngIf="!node.origin.isGasStation">新增</span> |
||||||
|
<span class="blue" (click)="editOr(node)">编辑</span> |
||||||
|
<span class="red" (click)="deleteOr(node)">删除</span> |
||||||
|
</span> |
||||||
|
</div> |
||||||
|
</ng-template> |
||||||
|
<ng-template #multiExpandedIconTpl let-node let-origin="origin"> |
||||||
|
<ng-container *ngIf="node.children.length == 0; else elseTemplate"> |
||||||
|
|
||||||
|
</ng-container> |
||||||
|
<ng-template #elseTemplate> |
||||||
|
<i nz-icon [nzType]="node.isExpanded ? 'caret-down' : 'caret-right'" |
||||||
|
class="ant-tree-switcher-line-icon"></i> |
||||||
|
</ng-template> |
||||||
|
</ng-template> |
||||||
|
</div> |
@ -0,0 +1,70 @@ |
|||||||
|
.orbox { |
||||||
|
width: 650px; |
||||||
|
height: 100%; |
||||||
|
overflow-y: auto; |
||||||
|
background: #fff; |
||||||
|
box-sizing: border-box; |
||||||
|
padding: 20px; |
||||||
|
font-size: 15px; |
||||||
|
} |
||||||
|
|
||||||
|
.topbox { |
||||||
|
width: 100%; |
||||||
|
height: 36px; |
||||||
|
display: flex; |
||||||
|
align-items: center; |
||||||
|
justify-content: space-between; |
||||||
|
|
||||||
|
.lefttop { |
||||||
|
span:nth-child(1) { |
||||||
|
color: #000D21; |
||||||
|
margin-right: 16px; |
||||||
|
} |
||||||
|
|
||||||
|
span:nth-child(2) { |
||||||
|
color: rgba(36, 36, 36, 0.24); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
.righttop { |
||||||
|
height: 36px; |
||||||
|
display: flex; |
||||||
|
|
||||||
|
button { |
||||||
|
margin-left: 16px; |
||||||
|
} |
||||||
|
|
||||||
|
nz-input-group { |
||||||
|
height: 32px; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
.treeTitle { |
||||||
|
width: 100%; |
||||||
|
height: 40px; |
||||||
|
line-height: 40px; |
||||||
|
margin-bottom: 10px; |
||||||
|
display: flex; |
||||||
|
justify-content: space-between; |
||||||
|
color: #000D21; |
||||||
|
box-sizing: border-box; |
||||||
|
padding-left: 30px; |
||||||
|
padding-right: 95px; |
||||||
|
border-bottom: 1px solid #E4E7EC; |
||||||
|
} |
||||||
|
|
||||||
|
.nodebox { |
||||||
|
font-size: 14px; |
||||||
|
text-align: left; |
||||||
|
} |
||||||
|
|
||||||
|
.operation { |
||||||
|
position: absolute; |
||||||
|
right: 0; |
||||||
|
|
||||||
|
span { |
||||||
|
margin-left: 20px; |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,57 @@ |
|||||||
|
<div class="box"> |
||||||
|
<form nz-form [formGroup]="validateForm"> |
||||||
|
<nz-form-item> |
||||||
|
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="账号">账号</nz-form-label> |
||||||
|
<nz-form-control> |
||||||
|
<nz-input-group> |
||||||
|
<input nz-input type="text" formControlName="account" placeholder="请输入账号" /> |
||||||
|
</nz-input-group> |
||||||
|
</nz-form-control> |
||||||
|
</nz-form-item> |
||||||
|
<nz-form-item> |
||||||
|
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="姓名">姓名</nz-form-label> |
||||||
|
<nz-form-control> |
||||||
|
<nz-input-group> |
||||||
|
<input nz-input type="text" formControlName="name" placeholder="请输入姓名" /> |
||||||
|
</nz-input-group> |
||||||
|
</nz-form-control> |
||||||
|
</nz-form-item> |
||||||
|
<nz-form-item> |
||||||
|
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="所属机构">所属机构</nz-form-label> |
||||||
|
<nz-form-control> |
||||||
|
<nz-tree-select [nzShowSearch]='true' [nzDropdownClassName]="'maxHeightTreeSelect'" |
||||||
|
formControlName="organization" [nzNodes]="nodes" nzPlaceHolder="请选择所属机构" |
||||||
|
[nzExpandedIcon]="multiExpandedIconTpl"> |
||||||
|
</nz-tree-select> |
||||||
|
<ng-template #multiExpandedIconTpl let-node let-origin="origin"> |
||||||
|
<ng-container *ngIf="node.children.length == 0; else elseTemplate"> |
||||||
|
|
||||||
|
</ng-container> |
||||||
|
<ng-template #elseTemplate> |
||||||
|
<i nz-icon [nzType]="node.isExpanded ? 'caret-down' : 'caret-right'" |
||||||
|
class="ant-tree-switcher-line-icon"></i> |
||||||
|
</ng-template> |
||||||
|
</ng-template> |
||||||
|
</nz-form-control> |
||||||
|
</nz-form-item> |
||||||
|
<!-- <nz-form-item> |
||||||
|
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="角色">角色</nz-form-label> |
||||||
|
<nz-form-control> |
||||||
|
<nz-select formControlName="role" nzPlaceHolder="请选择角色" nzMode="multiple"> |
||||||
|
<nz-option *ngFor="let item of listOfData" [nzValue]="item.normalizedName" |
||||||
|
[nzLabel]="item.displayName"> |
||||||
|
</nz-option> |
||||||
|
</nz-select> |
||||||
|
</nz-form-control> |
||||||
|
</nz-form-item> --> |
||||||
|
<nz-form-item> |
||||||
|
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="手机号">手机号</nz-form-label> |
||||||
|
<nz-form-control> |
||||||
|
<nz-input-group> |
||||||
|
<input nz-input type="text" formControlName="phonenum" placeholder="请输入手机号" /> |
||||||
|
</nz-input-group> |
||||||
|
</nz-form-control> |
||||||
|
</nz-form-item> |
||||||
|
|
||||||
|
</form> |
||||||
|
</div> |
@ -0,0 +1,87 @@ |
|||||||
|
import { Component, OnInit, Input } from '@angular/core'; |
||||||
|
import { NzModalRef } from 'ng-zorro-antd/modal'; |
||||||
|
import { FormBuilder, FormGroup, Validators } from '@angular/forms'; |
||||||
|
import { HttpClient } from '@angular/common/http'; |
||||||
|
import { TreeService } from 'src/app/service/tree.service'; |
||||||
|
|
||||||
|
@Component({ |
||||||
|
selector: 'app-adduser', |
||||||
|
templateUrl: './adduser.component.html', |
||||||
|
styleUrls: ['./adduser.component.scss'] |
||||||
|
}) |
||||||
|
export class AdduserComponent implements OnInit { |
||||||
|
|
||||||
|
@Input() title?: string; |
||||||
|
@Input() subtitle?: string; |
||||||
|
validateForm!: FormGroup; |
||||||
|
constructor(private modal: NzModalRef, private fb: FormBuilder, private http: HttpClient, private toTree: TreeService) { } |
||||||
|
|
||||||
|
ngOnInit(): void { |
||||||
|
this.validateForm = this.fb.group({ |
||||||
|
account: [null, [Validators.required]], |
||||||
|
name: [null, [Validators.required]], |
||||||
|
organization: [null, [Validators.required]], |
||||||
|
role: [[], [Validators.required]], |
||||||
|
role2: [[]], |
||||||
|
phonenum: [null, [Validators.required]] |
||||||
|
}); |
||||||
|
|
||||||
|
this.getAllRoles() |
||||||
|
this.getAllRoles2() |
||||||
|
this.getAllOrganization() |
||||||
|
} |
||||||
|
destroyModal(): void { |
||||||
|
this.modal.destroy({ data: 'this the result data' }); |
||||||
|
} |
||||||
|
|
||||||
|
listOfData: any[] = []; |
||||||
|
listOfData2: any[] = []; |
||||||
|
//获取角色列表
|
||||||
|
getAllRoles() { |
||||||
|
let params = { |
||||||
|
SkipCount: '0', |
||||||
|
MaxResultCount: '999' |
||||||
|
} |
||||||
|
this.http.get('/api/services/app/Role/GetAll', { |
||||||
|
params: params |
||||||
|
}).subscribe((data: any) => { |
||||||
|
// console.log('角色列表', data.result.items)
|
||||||
|
this.listOfData = data.result.items |
||||||
|
}) |
||||||
|
} |
||||||
|
//获取角色列表
|
||||||
|
getAllRoles2() { |
||||||
|
let params = { |
||||||
|
SkipCount: '0', |
||||||
|
MaxResultCount: '999', |
||||||
|
IsViolationRoles:'true' |
||||||
|
} |
||||||
|
this.http.get('/api/services/app/Role/GetAll', { |
||||||
|
params: params |
||||||
|
}).subscribe((data: any) => { |
||||||
|
// console.log('角色列表', data.result.items)
|
||||||
|
this.listOfData2 = data.result.items |
||||||
|
}) |
||||||
|
} |
||||||
|
//获取所有组织机构
|
||||||
|
nodes: any = [] |
||||||
|
getAllOrganization() { |
||||||
|
let OrganizationUnitId = sessionStorage.getItem('isGasStation') == 'true' ? JSON.parse(sessionStorage.getItem('userdataOfgasstation')).organization.id : JSON.parse(sessionStorage.getItem('userdata')).organization.id |
||||||
|
let params = { |
||||||
|
OrganizationUnitId: OrganizationUnitId, |
||||||
|
IsContainsChildren: "true" |
||||||
|
} |
||||||
|
this.http.get('/api/services/app/Organization/GetAll', { |
||||||
|
params: params |
||||||
|
}).subscribe((data: any) => { |
||||||
|
data.result.items.forEach(element => { |
||||||
|
if (element.id == OrganizationUnitId) { |
||||||
|
element.parentId = null |
||||||
|
} |
||||||
|
element.key = element.id |
||||||
|
element.title = element.displayName |
||||||
|
}); |
||||||
|
this.nodes = [...this.toTree.toTree(data.result.items)] |
||||||
|
}) |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,68 @@ |
|||||||
|
<div class="box"> |
||||||
|
<form nz-form [formGroup]="validateForm"> |
||||||
|
<nz-form-item> |
||||||
|
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="账号">账号</nz-form-label> |
||||||
|
<nz-form-control> |
||||||
|
<nz-input-group> |
||||||
|
<input [(ngModel)]="data.userName" nz-input type="text" formControlName="account" |
||||||
|
placeholder="请输入账号" /> |
||||||
|
</nz-input-group> |
||||||
|
</nz-form-control> |
||||||
|
</nz-form-item> |
||||||
|
<nz-form-item> |
||||||
|
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="姓名">姓名</nz-form-label> |
||||||
|
<nz-form-control> |
||||||
|
<nz-input-group> |
||||||
|
<input [(ngModel)]="data.name" nz-input type="text" formControlName="name" placeholder="请输入姓名" /> |
||||||
|
</nz-input-group> |
||||||
|
</nz-form-control> |
||||||
|
</nz-form-item> |
||||||
|
<nz-form-item> |
||||||
|
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="所属机构">所属机构</nz-form-label> |
||||||
|
<nz-form-control> |
||||||
|
<nz-tree-select [nzShowSearch]='true' [nzDropdownClassName]="'maxHeightTreeSelect'" |
||||||
|
[(ngModel)]="data.organizationUnitId" formControlName="organization" [nzNodes]="nodes" |
||||||
|
nzPlaceHolder="请选择所属机构" [nzExpandedIcon]="multiExpandedIconTpl"> |
||||||
|
</nz-tree-select> |
||||||
|
<ng-template #multiExpandedIconTpl let-node let-origin="origin"> |
||||||
|
<ng-container *ngIf="node.children.length == 0; else elseTemplate"> |
||||||
|
|
||||||
|
</ng-container> |
||||||
|
<ng-template #elseTemplate> |
||||||
|
<i nz-icon [nzType]="node.isExpanded ? 'caret-down' : 'caret-right'" |
||||||
|
class="ant-tree-switcher-line-icon"></i> |
||||||
|
</ng-template> |
||||||
|
</ng-template> |
||||||
|
</nz-form-control> |
||||||
|
</nz-form-item> |
||||||
|
<!-- <nz-form-item> |
||||||
|
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="角色">角色</nz-form-label> |
||||||
|
<nz-form-control> |
||||||
|
<nz-select formControlName="role" nzPlaceHolder="请选择角色" nzMode="multiple"> |
||||||
|
<nz-option *ngFor="let item of listOfData" [nzValue]="item.normalizedName" |
||||||
|
[nzLabel]="item.displayName"> |
||||||
|
</nz-option> |
||||||
|
</nz-select> |
||||||
|
</nz-form-control> |
||||||
|
</nz-form-item> |
||||||
|
<nz-form-item> |
||||||
|
<nz-form-label [nzSm]="6" [nzXs]="24" nzFor="预警接收级别">预警接收级别</nz-form-label> |
||||||
|
<nz-form-control> |
||||||
|
<nz-select formControlName="role2" nzPlaceHolder="请选择预警接收级别" nzMode="multiple"> |
||||||
|
<nz-option *ngFor="let item of listOfData2" [nzValue]="item.normalizedName" |
||||||
|
[nzLabel]="item.displayName"> |
||||||
|
</nz-option> |
||||||
|
</nz-select> |
||||||
|
</nz-form-control> |
||||||
|
</nz-form-item> --> |
||||||
|
<nz-form-item> |
||||||
|
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="手机号">手机号</nz-form-label> |
||||||
|
<nz-form-control> |
||||||
|
<nz-input-group> |
||||||
|
<input [(ngModel)]="data.phoneNumber" nz-input type="text" formControlName="phonenum" |
||||||
|
placeholder="请输入手机号" /> |
||||||
|
</nz-input-group> |
||||||
|
</nz-form-control> |
||||||
|
</nz-form-item> |
||||||
|
</form> |
||||||
|
</div> |
@ -0,0 +1,112 @@ |
|||||||
|
import { Component, OnInit, Input } from '@angular/core'; |
||||||
|
import { NzModalRef } from 'ng-zorro-antd/modal'; |
||||||
|
import { FormBuilder, FormGroup, Validators } from '@angular/forms'; |
||||||
|
import { HttpClient } from '@angular/common/http'; |
||||||
|
import { TreeService } from 'src/app/service/tree.service'; |
||||||
|
|
||||||
|
@Component({ |
||||||
|
selector: 'app-edituser', |
||||||
|
templateUrl: './edituser.component.html', |
||||||
|
styleUrls: ['./edituser.component.scss'] |
||||||
|
}) |
||||||
|
export class EdituserComponent implements OnInit { |
||||||
|
|
||||||
|
@Input() data?: any; |
||||||
|
@Input() listOfData?: any; |
||||||
|
@Input() listOfData2?: any; |
||||||
|
@Input() nodes?: any; |
||||||
|
validateForm!: FormGroup; |
||||||
|
constructor(private modal: NzModalRef, private fb: FormBuilder, private http: HttpClient, private toTree: TreeService) { } |
||||||
|
|
||||||
|
ngOnInit(): void { |
||||||
|
console.log(this.data) |
||||||
|
let roleData1 = [] |
||||||
|
let roleData2 = [] |
||||||
|
this.data.roleNames.forEach(element => { |
||||||
|
if (element.indexOf('LEVEL') != -1) { |
||||||
|
roleData2.push(element) |
||||||
|
} else { |
||||||
|
roleData1.push(element) |
||||||
|
} |
||||||
|
}); |
||||||
|
this.validateForm = this.fb.group({ |
||||||
|
account: [null, [Validators.required]], |
||||||
|
name: [null, [Validators.required]], |
||||||
|
organization: [null, [Validators.required]], |
||||||
|
role: [roleData1, [Validators.required]], |
||||||
|
role2: [roleData2], |
||||||
|
phonenum: [null, [Validators.required]] |
||||||
|
}); |
||||||
|
if (this.listOfData.length == 0) { |
||||||
|
this.getAllRoles() |
||||||
|
} |
||||||
|
if (this.listOfData2.length == 0) { |
||||||
|
this.getAllRoles2() |
||||||
|
} |
||||||
|
if (this.nodes.length == 0) { |
||||||
|
this.getAllOrganization() |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
destroyModal(): void { |
||||||
|
this.modal.destroy({ data: 'this the result data' }); |
||||||
|
} |
||||||
|
|
||||||
|
//获取角色列表
|
||||||
|
async getAllRoles() { |
||||||
|
let params = { |
||||||
|
SkipCount: '0', |
||||||
|
MaxResultCount: '999' |
||||||
|
} |
||||||
|
await new Promise<void>((resolve, reject) => { |
||||||
|
this.http.get('/api/services/app/Role/GetAll', { |
||||||
|
params: params |
||||||
|
}).subscribe((data: any) => { |
||||||
|
resolve(data) |
||||||
|
this.listOfData = data.result.items |
||||||
|
}) |
||||||
|
}) |
||||||
|
} |
||||||
|
|
||||||
|
//获取角色列表
|
||||||
|
async getAllRoles2() { |
||||||
|
let params = { |
||||||
|
SkipCount: '0', |
||||||
|
MaxResultCount: '999', |
||||||
|
IsViolationRoles: 'true' |
||||||
|
} |
||||||
|
await new Promise<void>((resolve, reject) => { |
||||||
|
this.http.get('/api/services/app/Role/GetAll', { |
||||||
|
params: params |
||||||
|
}).subscribe((data: any) => { |
||||||
|
resolve(data) |
||||||
|
this.listOfData2 = data.result.items |
||||||
|
}) |
||||||
|
}) |
||||||
|
} |
||||||
|
|
||||||
|
//获取所有组织机构
|
||||||
|
async getAllOrganization() { |
||||||
|
let OrganizationUnitId = sessionStorage.getItem('isGasStation') == 'true' ? JSON.parse(sessionStorage.getItem('userdataOfgasstation')).organization.id : JSON.parse(sessionStorage.getItem('userdata')).organization.id |
||||||
|
let params = { |
||||||
|
OrganizationUnitId: OrganizationUnitId, |
||||||
|
IsContainsChildren: "true" |
||||||
|
} |
||||||
|
await new Promise<void>((resolve, reject) => { |
||||||
|
this.http.get('/api/services/app/Organization/GetAll', { |
||||||
|
params: params |
||||||
|
}).subscribe((data: any) => { |
||||||
|
data.result.items.forEach(element => { |
||||||
|
if (element.id == OrganizationUnitId) { |
||||||
|
element.parentId = null |
||||||
|
} |
||||||
|
element.key = element.id |
||||||
|
element.title = element.displayName |
||||||
|
}); |
||||||
|
this.nodes = [...this.toTree.toTree(data.result.items)] |
||||||
|
resolve(data) |
||||||
|
}) |
||||||
|
}) |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -1 +1,67 @@ |
|||||||
<p>user works!</p> |
<div class="box"> |
||||||
|
<div class="header"> |
||||||
|
<span> |
||||||
|
用户管理 |
||||||
|
</span> |
||||||
|
</div> |
||||||
|
<div class="searchbox"> |
||||||
|
<div class="search"> |
||||||
|
<input type="text" nz-input placeholder="用户账号" [(ngModel)]="searchForm.id" /> |
||||||
|
<input type="text" nz-input placeholder="用户姓名" [(ngModel)]="searchForm.name" /> |
||||||
|
<input type="text" nz-input placeholder="所属机构" [(ngModel)]="searchForm.or" /> |
||||||
|
<button nz-button nzType="primary"><i nz-icon nzType="search" nzTheme="outline"></i>查询</button> |
||||||
|
<button nz-button nzType="default"><i nz-icon nzType="reload" nzTheme="outline"></i>重置</button> |
||||||
|
</div> |
||||||
|
|
||||||
|
<button nz-button nzType="primary" (click)="addUser()"><i nz-icon nzType="plus-circle" nzTheme="outline"></i>创建用户</button> |
||||||
|
</div> |
||||||
|
<div class="content"> |
||||||
|
<div class="tablebox"> |
||||||
|
<nz-table nzBordered #basicTable [nzLoading]="loading" [nzData]="usersLIst" [nzShowPagination]='false' |
||||||
|
[nzPageSize]='16'> |
||||||
|
<thead> |
||||||
|
<tr> |
||||||
|
<th>账号</th> |
||||||
|
<th>姓名</th> |
||||||
|
<th [width]="'30%'">角色/预警接收级别</th> |
||||||
|
<th>所属机构</th> |
||||||
|
<th>审核状态</th> |
||||||
|
<th>用户状态</th> |
||||||
|
<th [width]="'25%'">操作</th> |
||||||
|
</tr> |
||||||
|
</thead> |
||||||
|
<tbody> |
||||||
|
<tr *ngFor="let item of basicTable.data"> |
||||||
|
<td>2</td> |
||||||
|
<td>3</td> |
||||||
|
<td nzBreakWord> |
||||||
|
4 |
||||||
|
</td> |
||||||
|
<td>item |
||||||
|
5 |
||||||
|
</td> |
||||||
|
<td> |
||||||
|
6 |
||||||
|
</td> |
||||||
|
<td> |
||||||
|
8 |
||||||
|
</td> |
||||||
|
<td class="operation"> |
||||||
|
<a (click)="editUser(item)">编辑</a> |
||||||
|
<a (click)="resetPassword(item)">重置密码</a> |
||||||
|
<a class="green" (click)="cancel(item,true)">启用</a> |
||||||
|
<!-- <a *ngIf="item.isActive" class="redColor" (click)="cancel(item,false)">禁用</a> --> |
||||||
|
<a class="red" (click)="delete(item)">删除</a> |
||||||
|
</td> |
||||||
|
</tr> |
||||||
|
</tbody> |
||||||
|
</nz-table> |
||||||
|
</div> |
||||||
|
<div class="pagination"> |
||||||
|
<nz-pagination [nzHideOnSinglePage]="false" [nzPageIndex]="1" [nzTotal]="usersNum" [nzPageSize]="16" |
||||||
|
[nzShowTotal]="totalTemplate" nzShowQuickJumper (nzPageIndexChange)="pageChange($event)"> |
||||||
|
</nz-pagination> |
||||||
|
<ng-template #totalTemplate let-total> 16条/页,共{{usersNum}}条 </ng-template> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
@ -0,0 +1,52 @@ |
|||||||
|
.box { |
||||||
|
width: 100%; |
||||||
|
height: 100%; |
||||||
|
display: flex; |
||||||
|
flex-direction: column; |
||||||
|
color: #303133; |
||||||
|
|
||||||
|
.header { |
||||||
|
width: 100%; |
||||||
|
height: 56px; |
||||||
|
display: flex; |
||||||
|
justify-content: space-between; |
||||||
|
align-items: center; |
||||||
|
padding: 0 20px; |
||||||
|
border-bottom: 1px solid #E4E7EC; |
||||||
|
|
||||||
|
span { |
||||||
|
color: #303133; |
||||||
|
font-weight: 500; |
||||||
|
font-size: 16px; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
.searchbox{ |
||||||
|
height: 70px; |
||||||
|
display: flex; |
||||||
|
justify-content: space-between; |
||||||
|
padding: 0 20px; |
||||||
|
align-items: center; |
||||||
|
.search{ |
||||||
|
width: 60%; |
||||||
|
display: flex; |
||||||
|
input{ |
||||||
|
margin-right: 16px; |
||||||
|
} |
||||||
|
button{ |
||||||
|
margin-right: 16px; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
.content { |
||||||
|
flex: 1; |
||||||
|
box-sizing: border-box; |
||||||
|
padding: 18px; |
||||||
|
padding-top: 0px; |
||||||
|
.operation { |
||||||
|
a { |
||||||
|
margin-right: 16px; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue