陈鹏飞 5 years ago
parent
commit
7be993af0d
  1. 11
      src/app/navigation/navigation.component.html
  2. 12
      src/app/navigation/navigation.component.ts
  3. 3
      src/app/ui/all-file/all-file.component.ts
  4. 55
      src/app/ui/enterpriseuser/enterpriseuser.component.html
  5. 10
      src/app/ui/enterpriseuser/enterpriseuser.component.scss
  6. 22
      src/app/ui/enterpriseuser/enterpriseuser.component.ts
  7. 4
      src/app/ui/ui-routing.module.ts

11
src/app/navigation/navigation.component.html

@ -56,7 +56,16 @@
<li *ngFor="let item of rescueStationMenus" (click)="clickLi(item)" [ngClass]="{'selectedLi': item.id === selectedDataBank}" >{{item.name}}</li> <li *ngFor="let item of rescueStationMenus" (click)="clickLi(item)" [ngClass]="{'selectedLi': item.id === selectedDataBank}" >{{item.name}}</li>
</ul> </ul>
</mat-expansion-panel> </mat-expansion-panel>
</mat-accordion>
<mat-expansion-panel>
<mat-expansion-panel-header>
系统管理
</mat-expansion-panel-header>
<ul>
<li *ngFor="let item of systemManagement" (click)="clickUser(item)" [ngClass]="{'selectedLi': item.id === selectedDataBank}" >{{item.name}}</li>
</ul>
</mat-expansion-panel>
</mat-accordion>
</div> </div>
</mat-sidenav> </mat-sidenav>

12
src/app/navigation/navigation.component.ts

@ -32,7 +32,7 @@ export class NavigationComponent implements OnInit {
{ id:"支队级-政工岗位", name:"政工岗位" }, { id:"支队级-政工岗位", name:"政工岗位" },
{ id:"支队级-后勤与保障岗位", name:"后勤与保障岗位" }, { id:"支队级-后勤与保障岗位", name:"后勤与保障岗位" },
{ id:"支队级-防火监督岗位", name:"防火监督岗位" }, { id:"支队级-防火监督岗位", name:"防火监督岗位" },
{ id:"支队级-指挥岗位", name:"指挥岗位" }, { id:"支队级-指挥中心", name:"指挥中心" },
{ id:"支队级-安全员", name:"安全员" }, { id:"支队级-安全员", name:"安全员" },
] ]
//大队级菜单 //大队级菜单
@ -58,6 +58,10 @@ export class NavigationComponent implements OnInit {
{ id:"消防救援站-装备技师", name:"装备技师" } { id:"消防救援站-装备技师", name:"装备技师" }
] ]
//系统管理菜单
systemManagement:any = [
{ id:"用户管理", name:"用户管理" },
]
ngOnInit() { ngOnInit() {
@ -84,6 +88,12 @@ export class NavigationComponent implements OnInit {
} }
//点击用户管理
clickUser(item){
this.selectedDataBank = item.id
this.router.navigate([`/home/userManagement`])
}
//新增资料库 //新增资料库
// addDataBank(){ // addDataBank(){
// const dialogRef = this.dialog.open(AddDataBank, {//调用open方法打开对话框并且携带参数过去 // const dialogRef = this.dialog.open(AddDataBank, {//调用open方法打开对话框并且携带参数过去

3
src/app/ui/all-file/all-file.component.ts

@ -38,7 +38,6 @@ export class AllFileComponent {
//表头排序 //表头排序
sortData (e) { sortData (e) {
let data = this.oldDataSource.concat(); let data = this.oldDataSource.concat();
// console.log(123,data)
data.forEach(element => { data.forEach(element => {
if(element.key.indexOf(".") != -1){ if(element.key.indexOf(".") != -1){
let typeArr = element.key.split('.') let typeArr = element.key.split('.')
@ -47,7 +46,7 @@ export class AllFileComponent {
} }
}); });
// console.log(666,e)
if( e.direction=='asc' ) { //从小到大排序 if( e.direction=='asc' ) { //从小到大排序
data.sort( function(a,b) { data.sort( function(a,b) {
return a.newTime - b.newTime return a.newTime - b.newTime

55
src/app/ui/enterpriseuser/enterpriseuser.component.html

@ -2,67 +2,54 @@
<form #form="ngForm"> <form #form="ngForm">
<div class="queryBox"> <div class="queryBox">
<div class="queryField"> <div class="queryField"style="margin-right: 90px;">
<button type="button" mat-raised-button color="primary" (click)='open()'>创建企业用户</button> <button type="button" mat-raised-button color="primary" (click)='open()'>创建用户</button>
</div>
<div class="queryField">
<label style="margin-right: 10px;">登录账号:</label>
<input type="text" [(ngModel)]="userLogin" name="userLogin">
</div> </div>
<div class="queryField"> <div class="queryField">
<label style="margin-right: 10px;">单位名称:</label> <label style="margin-right: 10px;">姓名:</label>
<input type="text" [(ngModel)]="userName" name="userName"> <input type="text" [(ngModel)]="name" name="name" autocomplete="off">
</div> </div>
<div class="queryField"> <div class="queryField">
<label style="margin-right: 10px;">统一社会信用代码:</label> <label style="margin-right: 10px;">身份证号:</label>
<input type="text" [(ngModel)]="creditcode" name="creditcode"> <input type="text" [(ngModel)]="identityCard" name="identityCard" autocomplete="off">
</div> </div>
<div class="btnbox" style="margin-left: 90px;">
</div>
<div style="width: 100%;text-align: center;">
<button mat-raised-button color="primary" (click)='initData()'>查询</button> <button mat-raised-button color="primary" (click)='initData()'>查询</button>
<button mat-raised-button style="margin-left: 25px;" type="button" (click)='empty()'>重置</button> <button mat-raised-button style="margin-left: 10px;" type="button" (click)='empty()'>重置</button>
</div>
</div> </div>
</form> </form>
</div> </div>
<table mat-table [dataSource]="dataSource" class="mat-elevation-z8"> <table mat-table [dataSource]="dataSource" class="mat-elevation-z8">
<ng-container matColumnDef="loginName"> <ng-container matColumnDef="name">
<th mat-header-cell *matHeaderCellDef>登录账号</th> <th mat-header-cell *matHeaderCellDef>姓名</th>
<td mat-cell *matCellDef="let element">{{element.name}}<span style="color: red;" *ngIf="element.cancelled">(该账号已被注销)</span></td> <td mat-cell *matCellDef="let element">{{element.name}}</td>
</ng-container> </ng-container>
<ng-container matColumnDef="unitName"> <ng-container matColumnDef="identitycard">
<th mat-header-cell *matHeaderCellDef>单位名称</th> <th mat-header-cell *matHeaderCellDef>身份证号</th>
<td mat-cell *matCellDef="let element">{{element.companyName}}</td> <td mat-cell *matCellDef="let element">{{element.companyName}}</td>
</ng-container> </ng-container>
<ng-container matColumnDef="creditcode"> <ng-container matColumnDef="post">
<th mat-header-cell *matHeaderCellDef>统一社会信用代码</th> <th mat-header-cell *matHeaderCellDef>职务</th>
<td mat-cell *matCellDef="let element">{{element.usci}}</td> <td mat-cell *matCellDef="let element">{{element.usci}}</td>
</ng-container> </ng-container>
<ng-container matColumnDef="time">
<th mat-header-cell *matHeaderCellDef>创建时间</th>
<td mat-cell *matCellDef="let element">
{{element.creationTime|date:'yyyy-MM-dd'}}
</td>
</ng-container>
<ng-container matColumnDef="operation"> <ng-container matColumnDef="operation">
<th mat-header-cell *matHeaderCellDef>操作</th> <th mat-header-cell *matHeaderCellDef>操作</th>
<td mat-cell *matCellDef="let element"> <td mat-cell *matCellDef="let element">
<button mat-raised-button color="primary" class="maginleft" (click)='see(element)' *ngIf="!element.cancelled">查看学习记录</button>
<button mat-raised-button color="primary" class="maginleft" (click)='reset(element)' *ngIf="!element.cancelled">重置密码</button> <button mat-raised-button color="primary" class="maginleft" (click)='reset(element)' *ngIf="!element.cancelled">重置密码</button>
<button mat-raised-button color="primary" class="maginleft" (click)='see(element)' *ngIf="!element.cancelled">查看</button> <button mat-raised-button color="primary" class="maginleft" (click)='edit(element)' *ngIf="!element.cancelled">修改</button>
<button mat-raised-button color="primary" class="maginleft" (click)='edit(element)' *ngIf="!element.cancelled">编辑</button> <!-- <button mat-raised-button color="primary" class="maginleft" (click)='enabled(element)' *ngIf="!element.cancelled && !element.enabled">启用</button> -->
<button mat-raised-button color="primary" class="maginleft" (click)='enabled(element)' *ngIf="!element.cancelled && !element.enabled">启用</button>
<button mat-raised-button color="warn" class="maginleft" (click)='noEnabled(element)' *ngIf="!element.cancelled && element.enabled">禁用</button> <button mat-raised-button color="warn" class="maginleft" (click)='noEnabled(element)' *ngIf="!element.cancelled && element.enabled">禁用</button>
<button mat-raised-button color="warn" class="maginleft" (click)='logoff(element)' *ngIf="!element.cancelled">注销</button> <!-- <button mat-raised-button color="warn" class="maginleft" (click)='logoff(element)' *ngIf="!element.cancelled">注销</button> -->
<button mat-raised-button color="warn" class="maginleft" (click)='delete(element)' *ngIf="element.cancelled">删除</button> <button mat-raised-button color="warn" class="maginleft" (click)='delete(element)' *ngIf="element.cancelled">删除</button>
</td> </td>
</ng-container> </ng-container>

10
src/app/ui/enterpriseuser/enterpriseuser.component.scss

@ -16,7 +16,6 @@ table {
padding: 10px; padding: 10px;
margin-bottom: 10px; margin-bottom: 10px;
box-sizing: border-box; box-sizing: border-box;
border-bottom: 1px solid rgba(0,0,0,0.12);
.queryBox { .queryBox {
box-sizing: border-box; box-sizing: border-box;
padding: 5px 15px; padding: 5px 15px;
@ -27,11 +26,16 @@ table {
justify-content:center; justify-content:center;
.queryField { .queryField {
margin: 0 15px; margin: 0 15px;
font-size: 14px;
input { input {
width: 180px; width: 280px;
height: 22px; height: 22px;
line-height: 22px; line-height: 22px;
border-radius: 3px;} // border-radius: 3px;
}
}
.btnbox{
float: right;
} }
} //queryBox } //queryBox

22
src/app/ui/enterpriseuser/enterpriseuser.component.ts

@ -22,12 +22,16 @@ export class EnterpriseuserComponent implements OnInit {
this.initData() this.initData()
} }
displayedColumns: string[] = ['loginName', 'unitName', 'creditcode','time', 'operation']; displayedColumns: string[] = ['name', 'identitycard', 'post', 'operation',];
dataSource:any; //所有企业用户 dataSource:any; //所有企业用户
userLogin:string; //搜索账号 userLogin:string; //搜索账号
userName:string; //搜索名称 userName:string; //搜索名称
creditcode:string//统一社会信用代码 creditcode:string//统一社会信用代码
name:any //姓名
identityCard:any //身份证
//分页 //分页
@ViewChild(MatPaginator, {static: true}) @ViewChild(MatPaginator, {static: true})
pageEvent: PageEvent; pageEvent: PageEvent;
@ -41,9 +45,9 @@ export class EnterpriseuserComponent implements OnInit {
chagePage (e) { chagePage (e) {
this.pageNumber = e.pageIndex+1 this.pageNumber = e.pageIndex+1
let data= { let data= {
Name: this.userLogin || '', Name: this.identityCard || '',
CompanyName: this.userName || '', RealName: this.name || '',
USCI: this.creditcode || '', RoleType: '2',
PageNumber: String(this.pageNumber), PageNumber: String(this.pageNumber),
} }
this.http.get('/api/CompanyUsers',{params:data}).subscribe((data:any)=>{ this.http.get('/api/CompanyUsers',{params:data}).subscribe((data:any)=>{
@ -56,12 +60,12 @@ export class EnterpriseuserComponent implements OnInit {
//页面初始化 + 查询 + 重置 //页面初始化 + 查询 + 重置
initData () { initData () {
let data= { let data= {
Name: this.userLogin || '', Name: this.identityCard || '',
CompanyName: this.userName || '', RealName: this.name || '',
USCI: this.creditcode || '', RoleType: '2',
PageNumber: '1',
} }
this.http.get('/api/CompanyUsers',{params:data}).subscribe((data:any)=>{ this.http.get('/api/Users',{params:data}).subscribe((data:any)=>{
console.log(666,data)
this.length = data.totalCount this.length = data.totalCount
this.pageSize = data.pageSize this.pageSize = data.pageSize
this.pageEvent.pageIndex = 0 this.pageEvent.pageIndex = 0

4
src/app/ui/ui-routing.module.ts

@ -1,8 +1,10 @@
import { Routes, RouterModule } from '@angular/router'; import { Routes, RouterModule } from '@angular/router';
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { AllFileComponent } from './all-file/all-file.component'; import { AllFileComponent } from './all-file/all-file.component';
import { EnterpriseuserComponent } from './enterpriseuser/enterpriseuser.component';
const routes: Routes = [ const routes: Routes = [
{ path: '', component:AllFileComponent } { path: '', component:AllFileComponent },
{ path: 'userManagement', component:EnterpriseuserComponent }
]; ];
@NgModule({ @NgModule({

Loading…
Cancel
Save