15 changed files with 878 additions and 143 deletions
@ -1,16 +1,21 @@
|
||||
{ |
||||
"/api": { |
||||
"target": "http://121.36.37.70:8906/", |
||||
"target": "http://192.168.1.43:8106", |
||||
"测试1": "http://121.36.37.70:8906/", |
||||
"测试2": "http://121.36.37.70:8906/", |
||||
"测试2": "https://znaq.sinochemoilmarketing.com/", |
||||
"测试3": "https://gas.anxincloud.cn/", |
||||
"secure": false, |
||||
"changeOrigin": true |
||||
}, |
||||
"/signalr": { |
||||
"target": "http://121.36.37.70:8906/", |
||||
"target": "http://192.168.1.43:8106", |
||||
"secure": false, |
||||
"ws": true, |
||||
"logLevel": "debug" |
||||
}, |
||||
"/p3p": { |
||||
"target": "https://test-uomsp.sinochemoilmarketing.com/sagframe-portal/", |
||||
"secure": false, |
||||
"changeOrigin": true |
||||
} |
||||
} |
||||
|
@ -1,35 +1,52 @@
|
||||
import { NgModule } from '@angular/core'; |
||||
import { Routes, RouterModule } from '@angular/router'; |
||||
import { LoginComponent } from './pages/login/login.component'; |
||||
import { RegisterComponent } from './pages/register/register.component'; |
||||
import { NgModule } from "@angular/core"; |
||||
import { Routes, RouterModule } from "@angular/router"; |
||||
import { LoginComponent } from "./pages/login/login.component"; |
||||
import { RegisterComponent } from "./pages/register/register.component"; |
||||
|
||||
//路由守卫
|
||||
import { AuthGuard } from './auth.guard' |
||||
import { HomeComponent } from './pages/home/home.component'; |
||||
import { NavigationComponent } from './system-management/navigation/navigation.component'; |
||||
import { HomePageNologinComponent } from './pages/home-page-nologin/home-page-nologin.component'; |
||||
|
||||
|
||||
import { AuthGuard } from "./auth.guard"; |
||||
import { HomeComponent } from "./pages/home/home.component"; |
||||
import { NavigationComponent } from "./system-management/navigation/navigation.component"; |
||||
import { HomePageNologinComponent } from "./pages/home-page-nologin/home-page-nologin.component"; |
||||
import { SingleloginComponent } from "./pages/singlelogin/singlelogin.component"; |
||||
|
||||
const routes: Routes = [ |
||||
{ path: '', redirectTo: 'login', pathMatch: 'full' }, |
||||
{ path: 'login', component: LoginComponent }, //登录页
|
||||
{ path: 'register', component: RegisterComponent }, //注册页
|
||||
{ path: '', redirectTo: 'singlelogin', pathMatch: 'full' }, |
||||
{ path: "singlelogin", component: SingleloginComponent }, //单点登录页
|
||||
{ path: "login", component: LoginComponent }, //登录页
|
||||
|
||||
{ path: "register", component: RegisterComponent }, //注册页
|
||||
// { path: 'homepagenologin', component: HomePageNologinComponent }, //注册页
|
||||
{ |
||||
path: '', component: HomeComponent, canActivate: [AuthGuard], children: [ |
||||
{ path: '', loadChildren: () => import('./pages/pages.module').then(m => m.PagesModule) } |
||||
]
|
||||
path: "", |
||||
component: HomeComponent, |
||||
canActivate: [AuthGuard], |
||||
children: [ |
||||
{ |
||||
path: "", |
||||
loadChildren: () => |
||||
import("./pages/pages.module").then((m) => m.PagesModule), |
||||
}, |
||||
], |
||||
}, //首页
|
||||
{ |
||||
path: '', component: NavigationComponent, canActivate: [AuthGuard], children: [ |
||||
{ path: 'system', loadChildren: () => import('./system-management/system-management.module').then(m => m.SystemManagementModule) } |
||||
] |
||||
}//系统管理
|
||||
path: "", |
||||
component: NavigationComponent, |
||||
canActivate: [AuthGuard], |
||||
children: [ |
||||
{ |
||||
path: "system", |
||||
loadChildren: () => |
||||
import("./system-management/system-management.module").then( |
||||
(m) => m.SystemManagementModule |
||||
), |
||||
}, |
||||
], |
||||
}, //系统管理
|
||||
]; |
||||
|
||||
@NgModule({ |
||||
imports: [RouterModule.forRoot(routes, { relativeLinkResolution: 'legacy' })], |
||||
exports: [RouterModule] |
||||
imports: [RouterModule.forRoot(routes, { relativeLinkResolution: "legacy" })], |
||||
exports: [RouterModule], |
||||
}) |
||||
export class AppRoutingModule { } |
||||
export class AppRoutingModule {} |
||||
|
@ -0,0 +1,121 @@
|
||||
<nz-modal nzWidth="1300px" [(nzVisible)]="isVisible" nzMaskClosable="false" nzTitle="请绑定用户" |
||||
(nzOnCancel)="handleCancel()" (nzOnOk)="handleOk()" :nzFooter=" " nzClosable="false" nzKeyboard="false"> |
||||
<ng-container *nzModalContent> |
||||
<div class="userBox"> |
||||
<div class="orbox"> |
||||
<div class="topbox2"> |
||||
<div class="lefttop"> |
||||
组织机构 |
||||
</div> |
||||
<div class="righttop"> |
||||
<nz-input-group nzPrefixIcon="search"> |
||||
<input type="text" nz-input placeholder="请输入机构名称" [(ngModel)]="searchValue" /> |
||||
</nz-input-group> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="treeTitle"> |
||||
<span>组织机构</span> |
||||
<label nz-checkbox [(ngModel)]="IsContainsChildren" |
||||
(ngModelChange)="getAllOrganization()">包含子节点</label> |
||||
</div> |
||||
<div class="treebox"> |
||||
<nz-tree [nzSearchValue]="searchValue" #nzTreeComponent [nzData]="nodes" |
||||
[nzExpandedKeys]="defaultExpandedKeys" [nzSelectedKeys]='nzSelectedKeys' |
||||
(nzClick)="nzClick($event)" [nzExpandedIcon]="multiExpandedIconTpl" [nzHideUnMatched]="true" |
||||
[nzTreeTemplate]="nzTreeTemplate"> |
||||
</nz-tree> |
||||
<ng-template #nzTreeTemplate let-node let-origin="origin"> |
||||
<div class="nodebox"> |
||||
<span class="name">{{ node.title }}</span> |
||||
<span class="name">({{node.origin.products? node.origin.products.usersCount : 0}})</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> |
||||
|
||||
</div> |
||||
<div class="box"> |
||||
<div class="topbox"> |
||||
<div class="lefttop"> |
||||
<span>用户列表</span> |
||||
<span><i nz-icon nzType="search"></i> {{usersNum}}名用户</span> |
||||
</div> |
||||
<div class="righttop"> |
||||
<form nz-form [formGroup]="validateForm" (ngSubmit)="submitForm()"> |
||||
<nz-form-item> |
||||
<nz-form-control> |
||||
<nz-input-group nzPrefixIcon="search"> |
||||
<input type="text" nz-input placeholder="请输入用户名" formControlName="search" /> |
||||
</nz-input-group> |
||||
</nz-form-control> |
||||
<button style="display: none;" type="submit"></button> |
||||
</nz-form-item> |
||||
</form> |
||||
|
||||
</div> |
||||
</div> |
||||
<div class="tablebox" #tablebox> |
||||
<nz-table #basicTable [nzLoading]="loading" [nzData]="usersLIst" [nzShowPagination]='false' |
||||
[nzPageSize]='16'> |
||||
<thead> |
||||
<tr> |
||||
<th></th> |
||||
<th>账号</th> |
||||
<th>姓名</th> |
||||
<th>角色/预警接收级别</th> |
||||
<th [width]="'13%'">所属机构</th> |
||||
<th [width]="'8%'">用户状态</th> |
||||
<th [width]="'8%'">备注</th> |
||||
<th [width]="'10%'">操作</th> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
<tr *ngFor="let data of basicTable.data"> |
||||
<td><img src="../../../assets/images/user.png" alt=""></td> |
||||
<td>{{ data.userName }}</td> |
||||
<td>{{ data.name }}</td> |
||||
<td nzBreakWord> |
||||
<span style="margin-right: 8px;" |
||||
*ngFor="let item of data.roleDisplayNames">{{item}}</span> |
||||
</td> |
||||
<td> |
||||
{{data.organizationName}} |
||||
</td> |
||||
<td> |
||||
<ng-container *ngIf="data.isActive; else elseTemplate"> |
||||
<span class="greenColor2">已启用</span> |
||||
</ng-container> |
||||
<ng-template #elseTemplate> |
||||
<span class="redColor">已停用</span> |
||||
</ng-template> |
||||
</td> |
||||
<td> |
||||
{{data.note}} |
||||
</td> |
||||
<td class="operation"> |
||||
<span class="blue">绑定</span> |
||||
</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> |
||||
</ng-container> |
||||
</nz-modal> |
@ -0,0 +1,234 @@
|
||||
.userBox { |
||||
width: 100%; |
||||
height: 100%; |
||||
min-height: 600px; |
||||
background: #ffffff; |
||||
box-sizing: border-box; |
||||
padding: 20px; |
||||
overflow: hidden; |
||||
display: flex; |
||||
position: relative; |
||||
|
||||
.treebox { |
||||
display: flex; |
||||
flex: 1; |
||||
overflow: auto; |
||||
flex-direction: column; |
||||
box-sizing: border-box; |
||||
padding: 10px 0; |
||||
} |
||||
|
||||
.check { |
||||
width: 100%; |
||||
float: right; |
||||
} |
||||
|
||||
.topbox2 { |
||||
width: 100%; |
||||
height: 36px; |
||||
display: flex; |
||||
align-items: center; |
||||
margin-top: 20px; |
||||
|
||||
.lefttop { |
||||
height: 36px; |
||||
line-height: 36px; |
||||
color: #000; |
||||
margin-right: 10px; |
||||
font-size: 15px; |
||||
} |
||||
|
||||
.righttop { |
||||
flex: 1; |
||||
height: 36px; |
||||
display: flex; |
||||
|
||||
nz-input-group { |
||||
height: 36px; |
||||
} |
||||
} |
||||
} |
||||
|
||||
.orbox { |
||||
width: 260px; |
||||
min-width: 250px; |
||||
overflow-y: auto; |
||||
margin-right: 10px; |
||||
display: flex; |
||||
flex-direction: column; |
||||
} |
||||
|
||||
.treeTitle { |
||||
width: 100%; |
||||
height: 55px; |
||||
line-height: 55px; |
||||
margin-top: 12px; |
||||
display: flex; |
||||
justify-content: space-between; |
||||
color: #000d21; |
||||
box-sizing: border-box; |
||||
padding: 0 10px; |
||||
background: rgba(145, 204, 255, 0.2); |
||||
border: 1px solid rgba(145, 204, 255, 0.2); |
||||
|
||||
span { |
||||
font-size: 14px; |
||||
} |
||||
|
||||
div { |
||||
flex: 1; |
||||
width: 100px; |
||||
margin-left: 55px; |
||||
} |
||||
} |
||||
|
||||
.nodebox { |
||||
display: flex; |
||||
justify-content: space-between; |
||||
} |
||||
|
||||
tbody { |
||||
tr { |
||||
td:nth-child(1) { |
||||
text-align: right; |
||||
} |
||||
} |
||||
|
||||
.operation { |
||||
i { |
||||
cursor: pointer; |
||||
margin-right: 8px; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
.box { |
||||
flex: 1; |
||||
// overflow: auto; |
||||
padding-top: 20px; |
||||
overflow-y: auto; |
||||
display: flex; |
||||
flex-direction: column; |
||||
height: 100%; |
||||
} |
||||
|
||||
.topbox { |
||||
width: 100%; |
||||
height: 36px; |
||||
display: flex; |
||||
align-items: center; |
||||
justify-content: space-between; |
||||
margin-bottom: 12px; |
||||
|
||||
.lefttop { |
||||
span:nth-child(1) { |
||||
color: #000d21; |
||||
margin-right: 16px; |
||||
} |
||||
|
||||
span:nth-child(2) { |
||||
color: rgba(36, 36, 36, 0.24); |
||||
} |
||||
} |
||||
|
||||
.righttop { |
||||
display: flex; |
||||
|
||||
button { |
||||
margin-left: 16px; |
||||
} |
||||
|
||||
nz-input-group { |
||||
height: 32px; |
||||
} |
||||
} |
||||
} |
||||
|
||||
.tablebox { |
||||
flex: 1; |
||||
overflow-y: auto; |
||||
overflow: auto; |
||||
} |
||||
|
||||
.pagination { |
||||
margin: 15px 0; |
||||
display: flex; |
||||
align-items: center; |
||||
justify-content: center; |
||||
} |
||||
|
||||
.ortype { |
||||
width: 36px; |
||||
height: 20px; |
||||
background: #2399ff; |
||||
opacity: 1; |
||||
border-radius: 2px; |
||||
font-size: 12px; |
||||
margin-right: 8px; |
||||
color: #fff; |
||||
text-align: center; |
||||
} |
||||
|
||||
.resetPasswordContent { |
||||
z-index: 999; |
||||
width: 380px; |
||||
height: 138px; |
||||
position: absolute; |
||||
left: 30%; |
||||
top: 30%; |
||||
display: flex; |
||||
flex-direction: column; |
||||
justify-content: center; |
||||
box-sizing: border-box; |
||||
padding-left: 40px; |
||||
color: #000; |
||||
border-radius: 5px; |
||||
border-radius: 2px; |
||||
box-shadow: 0 3px 6px -4px rgb(0 0 0 / 12%), 0 6px 16px 0 rgb(0 0 0 / 8%), |
||||
0 9px 28px 8px rgb(0 0 0 / 5%); |
||||
background: #fff; |
||||
|
||||
.titlebox { |
||||
display: flex; |
||||
align-items: center; |
||||
position: relative; |
||||
|
||||
span { |
||||
font-size: 18px; |
||||
font-weight: 600; |
||||
} |
||||
|
||||
i { |
||||
font-size: 26px; |
||||
margin-right: 6px; |
||||
} |
||||
|
||||
.close { |
||||
position: absolute; |
||||
right: 2px; |
||||
top: -22px; |
||||
font-size: 16px; |
||||
cursor: pointer; |
||||
} |
||||
|
||||
.move { |
||||
position: absolute; |
||||
left: -32px; |
||||
top: -22px; |
||||
cursor: move; |
||||
} |
||||
} |
||||
|
||||
.message { |
||||
margin-top: 20px; |
||||
|
||||
i { |
||||
cursor: pointer; |
||||
} |
||||
|
||||
i:hover { |
||||
color: #18bb18; |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,287 @@
|
||||
import { HttpClient } from "@angular/common/http"; |
||||
import { ActivatedRoute } from "@angular/router"; |
||||
import { Component, OnInit, TemplateRef, ViewChild } from "@angular/core"; |
||||
import { FormBuilder, FormGroup } from "@angular/forms"; |
||||
import { NzFormatEmitEvent } from "ng-zorro-antd/tree"; |
||||
import { TreeService } from "src/app/service/tree.service"; |
||||
@Component({ |
||||
selector: "app-singlelogin", |
||||
templateUrl: "./singlelogin.component.html", |
||||
styleUrls: ["./singlelogin.component.scss"], |
||||
}) |
||||
export class SingleloginComponent implements OnInit { |
||||
constructor( |
||||
public route: ActivatedRoute, |
||||
private fb: FormBuilder, |
||||
private http: HttpClient, |
||||
private toTree: TreeService |
||||
) {} |
||||
|
||||
async ngOnInit(): Promise<void> { |
||||
console.log("查询参数", this.route.snapshot.queryParams.page); |
||||
this.bindingUser(); |
||||
// await this.getCurrentUserInfo();
|
||||
// await this.getAuthOrganInfos();
|
||||
if (this.CurrentUserInfo && this.AuthOrganInfos) { |
||||
// await this.getSinochemUsers(this.CurrentUserInfo.name);
|
||||
} |
||||
|
||||
let userdata = JSON.parse(sessionStorage.getItem("userdata")); |
||||
if (userdata.userName == "admin") { |
||||
//是superadmin,是内部制作账号
|
||||
this.isAdmin = true; |
||||
} else { |
||||
this.isAdmin = false; |
||||
} |
||||
this.validateForm = this.fb.group({ |
||||
search: [null], |
||||
}); |
||||
this.level = JSON.parse( |
||||
sessionStorage.getItem("userdata") |
||||
).organization.level; |
||||
|
||||
this.getAllUrl = "/api/services/app/User/GetAll"; |
||||
this.CountsByOrganizations = |
||||
"/api/services/app/User/GetCountsByOrganizations"; |
||||
|
||||
this.getAllOrganization(); |
||||
} |
||||
CurrentUserInfo; |
||||
AuthOrganInfos; |
||||
//获取当前登录用户信息
|
||||
getCurrentUserInfo() { |
||||
return new Promise<void>((resolve, reject) => { |
||||
this.http |
||||
.get("/p3p/auth/getCurrentUserInfo", { |
||||
params: { |
||||
token: |
||||
"czQre5c933Q_WgQaad1c8HFmLDV9SgiowfLLJgcZnuw8GdpKs6RwCbNdwLnVKmpQ==", |
||||
}, |
||||
}) |
||||
.subscribe( |
||||
(data: any) => { |
||||
this.CurrentUserInfo = data; |
||||
console.log("当前登录用户信息", this.CurrentUserInfo); |
||||
resolve(); |
||||
}, |
||||
(err) => { |
||||
reject(); |
||||
} |
||||
); |
||||
}); |
||||
} |
||||
//获取当前登录用户授权机构
|
||||
getAuthOrganInfos() { |
||||
return new Promise<void>((resolve, reject) => { |
||||
this.http |
||||
.get("/p3p/auth/getAuthOrganInfos", { |
||||
params: { |
||||
token: |
||||
"czQre5c933Q_WgQaad1c8HFmLDV9SgiowfLLJgcZnuw8GdpKs6RwCbNdwLnVKmpQ==", |
||||
}, |
||||
}) |
||||
.subscribe( |
||||
(data: any) => { |
||||
this.AuthOrganInfos = data; |
||||
console.log("当前登录用户授权机构", this.CurrentUserInfo); |
||||
resolve(); |
||||
}, |
||||
(err) => { |
||||
reject(); |
||||
} |
||||
); |
||||
}); |
||||
} |
||||
|
||||
//确认中化是否绑定了我们的用户
|
||||
getSinochemUsers(Keyword) { |
||||
return new Promise<void>((resolve, reject) => { |
||||
this.http |
||||
.get("/api/services/app/User/GetSinochemUsers", { |
||||
params: { |
||||
Keyword: Keyword, |
||||
}, |
||||
}) |
||||
.subscribe( |
||||
(data: any) => { |
||||
console.log("中化用户信息", data); |
||||
resolve(data); |
||||
}, |
||||
(err) => { |
||||
reject(); |
||||
} |
||||
); |
||||
}); |
||||
} |
||||
|
||||
//中化用户登录获得自己的token信息
|
||||
SinochemLogin() { |
||||
return new Promise<void>((resolve, reject) => { |
||||
this.CurrentUserInfo.data.userId = this.CurrentUserInfo.data.id; |
||||
delete this.CurrentUserInfo.data.id; |
||||
|
||||
let body = { |
||||
user: this.CurrentUserInfo.data, |
||||
org: this.AuthOrganInfos.data[0], |
||||
sinochemOrgs: this.AuthOrganInfos.data, |
||||
}; |
||||
this.http.post("/api/TokenAuth/SinochemLogin", body).subscribe( |
||||
(data: any) => { |
||||
console.log("信息验证", data); |
||||
resolve(); |
||||
}, |
||||
(err) => { |
||||
reject(); |
||||
} |
||||
); |
||||
}); |
||||
} |
||||
|
||||
isVisible = false; |
||||
//绑定我们自己的用户弹出框
|
||||
bindingUser() { |
||||
this.isVisible = true; |
||||
} |
||||
handleOk(): void { |
||||
console.log("Button ok clicked!"); |
||||
this.isVisible = false; |
||||
} |
||||
|
||||
handleCancel(): void { |
||||
console.log("Button cancel clicked!"); |
||||
this.isVisible = false; |
||||
} |
||||
level; |
||||
getAllUrl; |
||||
CountsByOrganizations; |
||||
isAdmin: boolean; |
||||
nzSelectedKeys: any[] = []; |
||||
defaultExpandedKeys = []; |
||||
IsContainsChildren = true; |
||||
searchValue = ""; |
||||
totalCount: string; |
||||
//获取所有用户
|
||||
usersLIst: any = []; |
||||
usersNum: string; |
||||
OrganizationUnitId; |
||||
loading: boolean; |
||||
organizationsList = []; |
||||
|
||||
validateForm!: FormGroup; |
||||
getAllUsers() { |
||||
this.loading = true; |
||||
let params = { |
||||
Keyword: this.validateForm.value.search |
||||
? this.validateForm.value.search |
||||
: "", |
||||
SkipCount: String(this.SkipCount), |
||||
MaxResultCount: String(this.MaxResultCount), |
||||
OrganizationUnitId: this.OrganizationUnitId, |
||||
IsContainsChildren: String(this.IsContainsChildren), |
||||
// Sorting: 'BuildingBasicInfo.Id asc'
|
||||
}; |
||||
this.http |
||||
.get(this.getAllUrl, { |
||||
params: params, |
||||
}) |
||||
.subscribe((data: any) => { |
||||
this.usersLIst = data.result.items; |
||||
this.usersNum = data.result.totalCount; |
||||
this.loading = false; |
||||
}); |
||||
} |
||||
SkipCount: number = 0; //0 16 32 48
|
||||
MaxResultCount: number = 16; |
||||
pageChange($event) { |
||||
this.SkipCount = ($event - 1) * this.MaxResultCount; |
||||
this.getAllUsers(); |
||||
} |
||||
|
||||
|
||||
//获取所有组织机构
|
||||
nodes: any = []; |
||||
organization; |
||||
getAllOrganization() { |
||||
let OrganizationUnitId = |
||||
sessionStorage.getItem("isGasStation") == "true" |
||||
? JSON.parse(sessionStorage.getItem("userdataOfgasstation")) |
||||
.organization.id |
||||
: JSON.parse(sessionStorage.getItem("userdata")).organization.id; |
||||
|
||||
console.log("OrganizationUnitId", OrganizationUnitId); |
||||
let params = { |
||||
OrganizationUnitId: OrganizationUnitId, |
||||
IsContainsChildren: "true", |
||||
}; |
||||
|
||||
this.http |
||||
.get("/api/services/app/Organization/GetAll", { |
||||
params: params, |
||||
}) |
||||
.subscribe(async (data: any) => { |
||||
console.log("获得组织机构", data); |
||||
this.organization = data.result.items; |
||||
await this.getCountsOr(data.result.items); |
||||
this.getAllUsers(); |
||||
}); |
||||
} |
||||
async getCountsOr(e) { |
||||
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", |
||||
IsUsersCountContainsChildren: String(this.IsContainsChildren), |
||||
}; |
||||
await new Promise<void>((resolve, reject) => { |
||||
this.http |
||||
.get(this.CountsByOrganizations, { |
||||
params: params, |
||||
}) |
||||
.subscribe((data: any) => { |
||||
resolve(data); |
||||
this.organizationsList = data.result; |
||||
const arrs = e.map((item) => { |
||||
const data = this.organizationsList.find( |
||||
(i) => item.id == i.organizationId |
||||
); |
||||
return { |
||||
...item, |
||||
products: data ? data : false, |
||||
}; |
||||
}); |
||||
|
||||
for (let index = 0; index < arrs.length; index++) { |
||||
if (arrs[index].id == OrganizationUnitId) { |
||||
arrs[index].parentId = null; |
||||
} |
||||
arrs[index].title = arrs[index].displayName; |
||||
arrs[index].key = arrs[index].id; |
||||
} |
||||
|
||||
this.nodes = [...this.toTree.toTree(arrs)]; |
||||
this.defaultExpandedKeys = [this.nodes[0].id]; |
||||
this.nzSelectedKeys = [this.nodes[0].id]; |
||||
this.OrganizationUnitId = [this.nodes[0].id]; |
||||
}); |
||||
}); |
||||
} |
||||
|
||||
//搜索框提交
|
||||
submitForm(): void { |
||||
for (const i in this.validateForm.controls) { |
||||
this.validateForm.controls[i].markAsDirty(); |
||||
this.validateForm.controls[i].updateValueAndValidity(); |
||||
} |
||||
this.getAllUsers(); |
||||
} |
||||
nzClick(event: NzFormatEmitEvent) { |
||||
this.nzSelectedKeys[0] = event.node.origin.id; |
||||
this.nzSelectedKeys = [...this.nzSelectedKeys]; |
||||
this.OrganizationUnitId = event.node.origin.id; |
||||
this.getAllUsers(); |
||||
} |
||||
} |
Loading…
Reference in new issue