刘向辉 3 years ago
parent
commit
36b7806c42
  1. 49
      src/app/pages/equipment-info/addequipment/addequipment.component.html
  2. 82
      src/app/pages/equipment-info/addequipment/addequipment.component.scss
  3. 22
      src/app/pages/equipment-info/addequipment/addequipment.component.ts
  4. 49
      src/app/pages/equipment-info/editequipment/editequipment.component.html
  5. 82
      src/app/pages/equipment-info/editequipment/editequipment.component.scss
  6. 25
      src/app/pages/equipment-info/editequipment/editequipment.component.ts
  7. 11
      src/app/pages/equipment-info/equipment-info.component.html
  8. 148
      src/app/pages/equipment-info/equipment-info.component.ts
  9. 3
      src/app/pages/login/login.component.ts
  10. 89
      src/app/pages/oil-station-info/oil-station-info.component.html
  11. 79
      src/app/pages/oil-station-info/oil-station-info.component.scss
  12. 3
      src/app/pages/pages.module.ts
  13. 2
      src/app/pages/today-warning/today-warning.component.html
  14. 15
      src/app/system-management/organization/addor/addor.component.html
  15. 7
      src/app/system-management/organization/addor/addor.component.ts
  16. 15
      src/app/system-management/organization/organization.component.ts
  17. 1
      src/app/system-management/role/role.component.ts
  18. 4
      src/app/system-management/user/user.component.html
  19. 23
      src/app/system-management/user/user.component.ts
  20. 2
      src/app/ui/tabbar/tabbar.component.html
  21. 9
      src/app/ui/tabbar/tabbar.component.ts
  22. 41
      src/theme.less

49
src/app/pages/equipment-info/addequipment/addequipment.component.html

@ -1 +1,48 @@
<p>addequipment works!</p> <div class="box" id="addequipment">
<div class="title">
<div class="titlecontent">
新增消防器材
</div>
<i nz-icon nzType="close" nzTheme="outline" (click)="destroyModal()"></i>
</div>
<form nz-form [formGroup]="validateForm" class="form">
<p>消防器材名称</p>
<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>
<p>规格</p>
<nz-form-item>
<nz-form-control>
<nz-input-group>
<input nz-input type="text" formControlName="specification" placeholder="请输入规格" />
</nz-input-group>
</nz-form-control>
</nz-form-item>
<p>购入日期</p>
<nz-form-item>
<nz-form-control>
<nz-date-picker formControlName="buytime" nzPlaceHolder="请输入购入日期"></nz-date-picker>
</nz-form-control>
</nz-form-item>
<p>生产日期</p>
<nz-form-item>
<nz-form-control>
<nz-date-picker formControlName="prodtime" nzPlaceHolder="请输入生产日期"></nz-date-picker>
</nz-form-control>
</nz-form-item>
<p>有效期至</p>
<nz-form-item>
<nz-form-control>
<nz-date-picker formControlName="validitytime" nzPlaceHolder="有效期至"></nz-date-picker>
</nz-form-control>
</nz-form-item>
<div class="btnbox">
<button nz-button type="submit" class="ok" (click)="ok()">确定</button>
<button nz-button type="button" class="cancel" (click)="destroyModal()">取消</button>
</div>
</form>
</div>

82
src/app/pages/equipment-info/addequipment/addequipment.component.scss

@ -0,0 +1,82 @@
.box {
.title {
font-family: sybold;
width: 100%;
height: 48px;
background: linear-gradient(270deg, rgba(35, 153, 255, 0) 0%, rgba(35, 153, 255, 0.57) 50%, rgba(35, 153, 255, 0) 100%);
display: flex;
align-items: center;
position: relative;
.titlecontent {
width: 100%;
height: 32px;
line-height: 32px;
background: linear-gradient(270deg, rgba(35, 153, 255, 0) 0%, rgba(35, 153, 255, 0.57) 50%, rgba(35, 153, 255, 0) 100%);
text-align: center;
color: #91CCFF;
font-size: 16px;
}
i {
position: absolute;
right: 12px;
color: #fff;
font-size: 18px;
cursor: pointer;
}
}
.form {
box-sizing: border-box;
padding: 0 17px;
p {
margin-bottom: 0;
color: #C4E2FC;
margin: 16px 0;
}
nz-form-item {
margin-bottom: 0;
input {
color: rgba(145, 204, 255, 0.95) !important;
}
}
nz-date-picker {
background-color: #143c61;
width: 100%;
}
.btnbox {
width: 100%;
margin-top: 24px;
margin-bottom: 17px;
display: flex;
justify-content: flex-end;
button {
border-radius: 0px;
color: #91CCFF;
}
button:nth-child(2) {
margin-left: 16px;
}
.ok {
background: rgba(0, 129, 255, 0.4);
}
.cancel {
border: 1px solid #C4E2FC;
background: #0c1e38;
color: rgba(99, 102, 105, 0.6);
box-shadow: 0 0 3px 0 #fff inset;
}
}
}
}

22
src/app/pages/equipment-info/addequipment/addequipment.component.ts

@ -1,5 +1,7 @@
import { Component, OnInit } from '@angular/core'; 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({ @Component({
selector: 'app-addequipment', selector: 'app-addequipment',
templateUrl: './addequipment.component.html', templateUrl: './addequipment.component.html',
@ -7,9 +9,23 @@ import { Component, OnInit } from '@angular/core';
}) })
export class AddequipmentComponent implements OnInit { export class AddequipmentComponent implements OnInit {
constructor() { } validateForm!: FormGroup;
constructor(private modal: NzModalRef, private fb: FormBuilder, private http: HttpClient) { }
ngOnInit(): void { ngOnInit(): void {
this.validateForm = this.fb.group({
name: [null, [Validators.required]],
specification: [null, [Validators.required]],
buytime: [null, [Validators.required]],
prodtime: [null, [Validators.required]],
validitytime: [null, [Validators.required]]
});
} }
destroyModal(){
this.modal.destroy();
}
ok(){
this.modal.triggerOk()
}
} }

49
src/app/pages/equipment-info/editequipment/editequipment.component.html

@ -1 +1,48 @@
<p>editequipment works!</p> <div class="box" id="addequipment">
<div class="title">
<div class="titlecontent">
编辑消防器材
</div>
<i nz-icon nzType="close" nzTheme="outline" (click)="destroyModal()"></i>
</div>
<form nz-form [formGroup]="validateForm" class="form">
<p>消防器材名称</p>
<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>
<p>规格</p>
<nz-form-item>
<nz-form-control>
<nz-input-group>
<input nz-input type="text" formControlName="specification" placeholder="请输入规格" />
</nz-input-group>
</nz-form-control>
</nz-form-item>
<p>购入日期</p>
<nz-form-item>
<nz-form-control>
<nz-date-picker formControlName="buytime" nzPlaceHolder="请输入购入日期"></nz-date-picker>
</nz-form-control>
</nz-form-item>
<p>生产日期</p>
<nz-form-item>
<nz-form-control>
<nz-date-picker formControlName="prodtime" nzPlaceHolder="请输入生产日期"></nz-date-picker>
</nz-form-control>
</nz-form-item>
<p>有效期至</p>
<nz-form-item>
<nz-form-control>
<nz-date-picker formControlName="validitytime" nzPlaceHolder="有效期至"></nz-date-picker>
</nz-form-control>
</nz-form-item>
<div class="btnbox">
<button nz-button type="submit" class="ok" (click)="ok()">确定</button>
<button nz-button type="button" class="cancel" (click)="destroyModal()">取消</button>
</div>
</form>
</div>

82
src/app/pages/equipment-info/editequipment/editequipment.component.scss

@ -0,0 +1,82 @@
.box {
.title {
font-family: sybold;
width: 100%;
height: 48px;
background: linear-gradient(270deg, rgba(35, 153, 255, 0) 0%, rgba(35, 153, 255, 0.57) 50%, rgba(35, 153, 255, 0) 100%);
display: flex;
align-items: center;
position: relative;
.titlecontent {
width: 100%;
height: 32px;
line-height: 32px;
background: linear-gradient(270deg, rgba(35, 153, 255, 0) 0%, rgba(35, 153, 255, 0.57) 50%, rgba(35, 153, 255, 0) 100%);
text-align: center;
color: #91CCFF;
font-size: 16px;
}
i {
position: absolute;
right: 12px;
color: #fff;
font-size: 18px;
cursor: pointer;
}
}
.form {
box-sizing: border-box;
padding: 0 17px;
p {
margin-bottom: 0;
color: #C4E2FC;
margin: 16px 0;
}
nz-form-item {
margin-bottom: 0;
input {
color: rgba(145, 204, 255, 0.95) !important;
}
}
nz-date-picker {
background-color: #143c61;
width: 100%;
}
.btnbox {
width: 100%;
margin-top: 24px;
margin-bottom: 17px;
display: flex;
justify-content: flex-end;
button {
border-radius: 0px;
color: #91CCFF;
}
button:nth-child(2) {
margin-left: 16px;
}
.ok {
background: rgba(0, 129, 255, 0.4);
}
.cancel {
border: 1px solid #C4E2FC;
background: #0c1e38;
color: rgba(99, 102, 105, 0.6);
box-shadow: 0 0 3px 0 #fff inset;
}
}
}
}

25
src/app/pages/equipment-info/editequipment/editequipment.component.ts

@ -1,5 +1,7 @@
import { Component, OnInit } from '@angular/core'; 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({ @Component({
selector: 'app-editequipment', selector: 'app-editequipment',
templateUrl: './editequipment.component.html', templateUrl: './editequipment.component.html',
@ -7,9 +9,26 @@ import { Component, OnInit } from '@angular/core';
}) })
export class EditequipmentComponent implements OnInit { export class EditequipmentComponent implements OnInit {
constructor() { } @Input() data?: any;
validateForm!: FormGroup;
constructor(private modal: NzModalRef, private fb: FormBuilder, private http: HttpClient) { }
ngOnInit(): void { ngOnInit(): void {
this.validateForm = this.fb.group({
name: [null, [Validators.required]],
specification: [null, [Validators.required]],
buytime: [null, [Validators.required]],
prodtime: [null, [Validators.required]],
validitytime: [null, [Validators.required]]
});
}
destroyModal(){
this.modal.destroy({ data: 'this the result data' });
}
ok(){
this.modal.triggerOk()
} }
} }

11
src/app/pages/equipment-info/equipment-info.component.html

@ -62,10 +62,10 @@
2021.01.05 2021.01.05
</div> </div>
<div nz-col nzSpan="3" class="btn"> <div nz-col nzSpan="3" class="btn">
<span> <span (click)="edit(item)">
编辑 编辑
</span> </span>
<span> <span (click)="delete(item)">
删除 删除
</span> </span>
</div> </div>
@ -73,9 +73,10 @@
</div> </div>
</div> </div>
<div class="pagination"> <div class="pagination">
<nz-pagination [nzPageIndex]="1" [nzTotal]="85" [nzPageSize]="20" [nzShowTotal]="totalTemplate" <nz-pagination [nzHideOnSinglePage]="false" [nzPageIndex]="1" [nzTotal]="equipmentNum" [nzPageSize]="16"
nzShowQuickJumper></nz-pagination> [nzShowTotal]="totalTemplate" nzShowQuickJumper (nzPageIndexChange)="pageChange($event)">
<ng-template #totalTemplate let-total> 16条/页,共100条 </ng-template> </nz-pagination>
<ng-template #totalTemplate let-total> 16条/页,共{{equipmentNum}}条 </ng-template>
</div> </div>
</div> </div>
</div> </div>

148
src/app/pages/equipment-info/equipment-info.component.ts

@ -1,5 +1,10 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit, ViewContainerRef } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { NzModalService } from 'ng-zorro-antd/modal';
import { NzMessageService } from 'ng-zorro-antd/message';
import { AddequipmentComponent } from './addequipment/addequipment.component';
import { HttpClient } from '@angular/common/http';
import { EditequipmentComponent } from './editequipment/editequipment.component';
@Component({ @Component({
selector: 'app-equipment-info', selector: 'app-equipment-info',
templateUrl: './equipment-info.component.html', templateUrl: './equipment-info.component.html',
@ -7,17 +12,150 @@ import { FormBuilder, FormGroup, Validators } from '@angular/forms';
}) })
export class EquipmentInfoComponent implements OnInit { export class EquipmentInfoComponent implements OnInit {
validateForm!: FormGroup; validateForm!: FormGroup;
constructor(private fb: FormBuilder) { } constructor(private fb: FormBuilder, private modal: NzModalService, private viewContainerRef: ViewContainerRef, private message: NzMessageService, private http: HttpClient) { }
arr = [1,1,1,1,1,1,1,1,1] arr = []
ngOnInit(): void { ngOnInit(): void {
this.validateForm = this.fb.group({ this.validateForm = this.fb.group({
search: [null] search: [null]
}); });
this.getEquipment()
console.log(JSON.parse(sessionStorage.getItem('userdata')))
} }
submitForm(){
//获取装备列表
equipmentList: any
getEquipment() {
this.http.get('/api/services/app/FireEquipment/GetAll', {
params: {
OrganizationId: JSON.parse(sessionStorage.getItem('userdata')).organizationIds[0]
}
}).subscribe((data: any) => {
// console.log(data)
this.equipmentList = data.result.items
this.equipmentNum = data.result.totalCount
})
}
SkipCount: number = 0 //0 16 32 48
MaxResultCount: number = 16
equipmentNum: string
pageChange($event) {
this.SkipCount = ($event - 1) * this.MaxResultCount
this.getEquipment()
}
submitForm() {
} }
add(){ add() {
const modal = this.modal.create({
// nzTitle: '新增角色',
nzContent: AddequipmentComponent,
nzViewContainerRef: this.viewContainerRef,
nzWidth: 380,
nzBodyStyle: {
'border': '1px solid #91CCFF',
'border-radius': '0px',
'padding': '7px',
'box-shadow': '0 0 8px 0 #fff',
'background-image': 'linear-gradient(#003665, #000f25)'
},
nzComponentParams: {},
nzFooter: null,
nzClosable: false,
nzOnOk: async () => {
if (instance.validateForm.valid) {
await new Promise(resolve => {
let body = {
name: instance.validateForm.value.name,
specification: instance.validateForm.value.specification,
productionDate: instance.validateForm.value.prodtime,
purchaseDate: instance.validateForm.value.buytime,
validityEndTime: instance.validateForm.value.validitytime,
organizationId: JSON.parse(sessionStorage.getItem('userdata')).organizationIds[0]
}
this.http.post('/api/services/app/FireEquipment/Create', body).subscribe(data => {
resolve(data)
this.getEquipment()
this.message.create('success', '创建成功!');
return true
})
})
} else {
this.message.create('warning', '请填写完整!');
return false
}
console.log(instance.validateForm.value)
return false
}
});
const instance = modal.getContentComponent();
}
edit(item) {
const modal = this.modal.create({
// nzTitle: '新增角色',
nzContent: EditequipmentComponent,
nzViewContainerRef: this.viewContainerRef,
nzWidth: 380,
nzBodyStyle: {
'border': '1px solid #91CCFF',
'border-radius': '0px',
'padding': '7px',
'box-shadow': '0 0 8px 0 #fff',
'background-image': 'linear-gradient(#003665, #000f25)'
},
nzComponentParams: {
data: item
},
nzFooter: null,
nzClosable: false,
nzOnOk: async () => {
if (instance.validateForm.valid) {
await new Promise(resolve => {
let body = {
name: instance.validateForm.value.name,
specification: instance.validateForm.value.specification,
productionDate: instance.validateForm.value.prodtime,
purchaseDate: instance.validateForm.value.buytime,
validityEndTime: instance.validateForm.value.validitytime,
organizationId: JSON.parse(sessionStorage.getItem('userdata')).organizationIds[0]
}
this.http.post('/api/services/app/FireEquipment/Create', body).subscribe(data => {
resolve(data)
this.message.create('success', '创建成功!');
// return true
this.modal.closeAll()
})
})
} else {
this.message.create('warning', '请填写完整!');
return false
}
}
});
const instance = modal.getContentComponent();
modal.afterClose.subscribe(result => this.getEquipment());
}
delete(item) {
this.modal.confirm({
nzTitle: `确定要删除${item.name}这个器材吗?`,
nzOkText: '确定',
nzOkType: 'danger',
nzOnOk: () => {
this.http.delete('', {
params: {
Id: item.id
}
}).subscribe(data => {
this.message.create('success', '删除成功!');
})
},
nzCancelText: '取消',
nzOnCancel: () => {
}
});
} }
} }

3
src/app/pages/login/login.component.ts

@ -55,6 +55,9 @@ export class LoginComponent implements OnInit {
sessionStorage.setItem("token", data.result.accessToken); sessionStorage.setItem("token", data.result.accessToken);
this.cookieService.set("token", data.result.accessToken, null, '/'); this.cookieService.set("token", data.result.accessToken, null, '/');
this.cookieService.set("refreshToken", data.result.encryptedAccessToken, null, '/'); this.cookieService.set("refreshToken", data.result.encryptedAccessToken, null, '/');
this.http.get('/api/services/app/Session/GetCurrentLoginInformations').subscribe((data:any) => {
sessionStorage.setItem('userdata',JSON.stringify(data.result.user))
})
this.router.navigate(['/home/plan']) this.router.navigate(['/home/plan'])
//调用服务中的function刷新token //调用服务中的function刷新token
// this.token.startUp() // this.token.startUp()

89
src/app/pages/oil-station-info/oil-station-info.component.html

@ -1 +1,88 @@
<p>oil-station-info works!</p> <div class="box" id="oilStationInfo">
<div class="content">
<div class="title">
<app-title [name]="'编辑基本信息'"></app-title>
</div>
<div class="tablebox">
<div class="table">
<table>
<tr>
<td class="head">所属组织机构</td>
<td class="text"></td>
<td class="head">开业时间</td>
<td class="text"></td>
</tr>
<tr>
<td class="head">油站类型</td>
<td class="text"></td>
<td class="head">车道数量</td>
<td class="text"></td>
</tr>
<tr>
<td class="head">地址</td>
<td colspan="3"></td>
</tr>
</table>
<table>
<tr>
<td class="head">辖区派出所</td>
<td class="text"></td>
<td class="head">地址</td>
<td class="text"></td>
</tr>
<tr>
<td class="head">距离</td>
<td class="text"></td>
<td class="head">联系方式</td>
<td class="text"></td>
</tr>
</table>
<table>
<tr>
<td class="head">辖区医院</td>
<td class="text"></td>
<td class="head">地址</td>
<td class="text"></td>
</tr>
<tr>
<td class="head">距离</td>
<td class="text"></td>
<td class="head">联系方式</td>
<td class="text"></td>
</tr>
</table>
<table>
<tr>
<td class="head">辖区消防队</td>
<td class="text"></td>
<td class="head">地址</td>
<td class="text"></td>
</tr>
<tr>
<td class="head">距离</td>
<td class="text"></td>
<td class="head">联系方式</td>
<td class="text"></td>
</tr>
</table>
<table class="imgtable">
<tr>
<td class="head">营业执照</td>
<td colspan="3"></td>
</tr>
<tr>
<td class="head">危险化学品<br>经营许可证</td>
<td colspan="3"></td>
</tr>
<tr>
<td class="head">成品油零售<br>经营许可证</td>
<td colspan="3"></td>
</tr>
</table>
</div>
<div class="btnbox">
</div>
</div>
</div>
</div>

79
src/app/pages/oil-station-info/oil-station-info.component.scss

@ -0,0 +1,79 @@
.box {
width: 100%;
height: 100%;
display: flex;
justify-content: center;
}
::-webkit-scrollbar {
display: none
}
.content {
width: 1000px;
height: 100%;
display: flex;
flex-direction: column;
.title {
height: 48px;
width: 100%;
margin: 16px 0;
}
.tablebox {
flex: 1;
overflow-y: auto;
.table {
table,
table tr th,
table tr td {
border: 1px solid #91CCFF;
}
table {
width: 100%;
text-align: center;
border-collapse: collapse;
margin-bottom: 24px;
tr {
td {
height: 40px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
color: #C4E2FC;
box-sizing: border-box;
padding: 0 16px;
}
.head {
width: 17%;
background: #0b3863;
color: #23D9FF;
text-align: right;
}
.text {
width: 33%;
}
}
}
.imgtable {
tr,
td {
height: 98px;
}
}
}
}
}

3
src/app/pages/pages.module.ts

@ -66,6 +66,7 @@ import { EditequipmentComponent } from './equipment-info/editequipment/editequip
NzMessageModule, NzMessageModule,
NzSpinModule, NzSpinModule,
NzTreeModule NzTreeModule
] ],
entryComponents :[AddequipmentComponent,EditequipmentComponent]
}) })
export class PagesModule { } export class PagesModule { }

2
src/app/pages/today-warning/today-warning.component.html

@ -35,7 +35,7 @@
</nz-form-item> </nz-form-item>
<nz-form-item class="searchParams"> <nz-form-item class="searchParams">
<nz-form-control [nzSm]="16" [nzXs]="24"> <nz-form-control>
<nz-date-picker id="datePicker" formControlName="datePicker" nzPlaceHolder="请选择时间"></nz-date-picker> <nz-date-picker id="datePicker" formControlName="datePicker" nzPlaceHolder="请选择时间"></nz-date-picker>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>

15
src/app/system-management/organization/addor/addor.component.html

@ -1,21 +1,18 @@
<div class="box"> <div class="box">
<form nz-form [formGroup]="validateForm"> <form nz-form [formGroup]="validateForm">
<nz-form-item> <nz-form-item>
<nz-form-control nzErrorTip="请输入名称"> <nz-form-control>
<nz-input-group> <nz-input-group>
<input nz-input type="text" formControlName="name" placeholder="请输入名称" /> <input nz-input type="text" formControlName="name" placeholder="请输入名称" />
</nz-input-group> </nz-input-group>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
<!-- <nz-form-item> <nz-form-item>
<nz-form-control> <nz-form-control>
<nz-select formControlName="power" nzPlaceHolder="请选择权限" (nzScrollToBottom)="loadMore()" nzMode="multiple"> <nz-input-group>
<nz-option *ngFor="let o of optionList" [nzValue]="o" [nzLabel]="o.displayName"></nz-option> <input nz-input type="text" formControlName="code" placeholder="请输入编码" />
</nz-select> </nz-input-group>
<ng-template #renderTemplate>
<nz-spin *ngIf="isLoading"></nz-spin>
</ng-template>
</nz-form-control> </nz-form-control>
</nz-form-item> --> </nz-form-item>
</form> </form>
</div> </div>

7
src/app/system-management/organization/addor/addor.component.ts

@ -1,4 +1,4 @@
import { Component, OnInit, Input } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { NzModalRef } from 'ng-zorro-antd/modal'; import { NzModalRef } from 'ng-zorro-antd/modal';
import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { HttpClient } from '@angular/common/http'; import { HttpClient } from '@angular/common/http';
@ -9,14 +9,13 @@ import { HttpClient } from '@angular/common/http';
}) })
export class AddorComponent implements OnInit { export class AddorComponent implements OnInit {
@Input() title?: string;
@Input() subtitle?: string;
validateForm!: FormGroup; validateForm!: FormGroup;
constructor(private modal: NzModalRef, private fb: FormBuilder, private http: HttpClient) { } constructor(private modal: NzModalRef, private fb: FormBuilder, private http: HttpClient) { }
ngOnInit(): void { ngOnInit(): void {
this.validateForm = this.fb.group({ this.validateForm = this.fb.group({
name: [null, [Validators.required]] name: [null, [Validators.required]],
code: [null, [Validators.required]]
}); });
} }
destroyModal(): void { destroyModal(): void {

15
src/app/system-management/organization/organization.component.ts

@ -34,7 +34,7 @@ export class OrganizationComponent implements OnInit {
//获取所有组织机构 //获取所有组织机构
searchValue = ''; searchValue = '';
nzExpandAll = false; nzExpandAll = false;
totalCount:string totalCount: string
getAllOrganization() { getAllOrganization() {
this.http.get('/api/services/app/Organization/GetAll').subscribe((data: any) => { this.http.get('/api/services/app/Organization/GetAll').subscribe((data: any) => {
this.totalCount = data.result.totalCount this.totalCount = data.result.totalCount
@ -88,25 +88,26 @@ export class OrganizationComponent implements OnInit {
} }
addOr(node?: any) { addOr(node?: any) {
console.log(node)
const modal = this.modal.create({ const modal = this.modal.create({
nzTitle: node ? '新增组织机构' : '新增一级组织机构', nzTitle: node ? '新增组织机构' : '新增一级组织机构',
nzContent: AddorComponent, nzContent: AddorComponent,
nzViewContainerRef: this.viewContainerRef, nzViewContainerRef: this.viewContainerRef,
nzWidth: 288, nzWidth: 288,
nzComponentParams: { nzComponentParams: {},
title: '',
subtitle: ''
},
nzOnOk: async () => { nzOnOk: async () => {
console.log('hhhhhhh', instance.validateForm) console.log('hhhhhhh', instance.validateForm)
if (instance.validateForm.valid) { if (instance.validateForm.valid) {
await new Promise(resolve => { await new Promise(resolve => {
let body = { let body = {
parentId: node ? Number(node.key) : null,
code: instance.validateForm.value.code,
displayName: instance.validateForm.value.name,
} }
this.http.post('/api/services/app/User/Create', body).subscribe(data => { this.http.post('/api/services/app/Organization/Create', body).subscribe(data => {
resolve(data) resolve(data)
this.message.create('success', '创建成功!'); this.message.create('success', '创建成功!');
this.getAllOrganization()
return true return true
}, err => { }, err => {
resolve(err) resolve(err)

1
src/app/system-management/role/role.component.ts

@ -1,7 +1,6 @@
import { Component, OnInit, TemplateRef, ViewContainerRef } from '@angular/core'; import { Component, OnInit, TemplateRef, ViewContainerRef } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { NzModalService } from 'ng-zorro-antd/modal'; import { NzModalService } from 'ng-zorro-antd/modal';
import { NzMessageService } from 'ng-zorro-antd/message'; import { NzMessageService } from 'ng-zorro-antd/message';
import { HttpClient } from '@angular/common/http'; import { HttpClient } from '@angular/common/http';
import { AddroleComponent } from './addrole/addrole.component'; import { AddroleComponent } from './addrole/addrole.component';

4
src/app/system-management/user/user.component.html

@ -37,7 +37,7 @@
<td>{{ data.userName }}</td> <td>{{ data.userName }}</td>
<td>{{ data.name }}</td> <td>{{ data.name }}</td>
<td> <td>
<span *ngFor="let item of data.roleNames">{{item}}</span> <span style="margin-right: 8px;" *ngFor="let item of data.roleNames">{{item}}</span>
</td> </td>
<td> <td>
<div class="ortype"> <div class="ortype">
@ -55,7 +55,7 @@
</nz-table> </nz-table>
</div> </div>
<div class="pagination"> <div class="pagination">
<nz-pagination [nzHideOnSinglePage]="true" [nzPageIndex]="1" [nzTotal]="usersNum" [nzPageSize]="1" <nz-pagination [nzHideOnSinglePage]="false" [nzPageIndex]="1" [nzTotal]="usersNum" [nzPageSize]="16"
[nzShowTotal]="totalTemplate" nzShowQuickJumper (nzPageIndexChange)="pageChange($event)"> [nzShowTotal]="totalTemplate" nzShowQuickJumper (nzPageIndexChange)="pageChange($event)">
</nz-pagination> </nz-pagination>
<ng-template #totalTemplate let-total> 16条/页,共{{usersNum}}条 </ng-template> <ng-template #totalTemplate let-total> 16条/页,共{{usersNum}}条 </ng-template>

23
src/app/system-management/user/user.component.ts

@ -24,10 +24,9 @@ export class UserComponent implements OnInit {
//获取所有用户 //获取所有用户
usersLIst: any = [] usersLIst: any = []
usersNum:string usersNum: string
SkipCount: number = 0 //0 16 32 48
MaxResultCount: number = 16
getAllUsers() { getAllUsers() {
let params = { let params = {
SkipCount: String(this.SkipCount), SkipCount: String(this.SkipCount),
@ -41,9 +40,11 @@ export class UserComponent implements OnInit {
console.log('所有用户', this.usersLIst) console.log('所有用户', this.usersLIst)
}) })
} }
SkipCount: number = 0 //0 16 32 48
pageChange($event){ MaxResultCount: number = 16
console.log('页码改变',$event) pageChange($event) {
this.SkipCount = ($event - 1) * this.MaxResultCount
this.getAllUsers()
} }
@ -75,7 +76,7 @@ export class UserComponent implements OnInit {
let body = { let body = {
userName: instance.validateForm.value.account, userName: instance.validateForm.value.account,
name: instance.validateForm.value.name, name: instance.validateForm.value.name,
organizationId: instance.validateForm.value.organization, organizationId: Number(instance.validateForm.value.organization),
roleNames: instance.validateForm.value.role, roleNames: instance.validateForm.value.role,
phoneNumber: instance.validateForm.value.phonenum, phoneNumber: instance.validateForm.value.phonenum,
isActive: true isActive: true
@ -83,6 +84,7 @@ export class UserComponent implements OnInit {
this.http.post('/api/services/app/User/Create', body).subscribe(data => { this.http.post('/api/services/app/User/Create', body).subscribe(data => {
resolve(data) resolve(data)
this.message.create('success', '创建成功!'); this.message.create('success', '创建成功!');
this.SkipCount = 0
this.getAllUsers() this.getAllUsers()
return true return true
}, err => { }, err => {
@ -147,14 +149,15 @@ export class UserComponent implements OnInit {
//重置密码 //重置密码
resetPassword(item) { resetPassword(item) {
console.log(item)
this.modal.confirm({ this.modal.confirm({
nzTitle: `确定要重置${item.userName}这个账户的密码吗?`, nzTitle: `确定要重置${item.userName}这个账户的密码吗?`,
nzOkText: '确定', nzOkText: '确定',
nzOkType: 'primary', nzOkType: 'primary',
nzOnOk: () => { nzOnOk: () => {
this.http.delete('/api/services/app/Role/Delete', { this.http.post('/api/services/app/User/ResetPassword', {
params: { params: {
Id: item.id userId: item.id
} }
}).subscribe(data => { }).subscribe(data => {
this.message.create('success', '重置成功!'); this.message.create('success', '重置成功!');
@ -175,7 +178,7 @@ export class UserComponent implements OnInit {
nzOkText: '确定', nzOkText: '确定',
nzOkType: 'danger', nzOkType: 'danger',
nzOnOk: () => { nzOnOk: () => {
this.http.delete('/api/services/app/Role/Delete', { this.http.delete('/api/services/app/User/Delete', {
params: { params: {
Id: item.id Id: item.id
} }

2
src/app/ui/tabbar/tabbar.component.html

@ -10,7 +10,7 @@
<span style="margin: 0 18px;">|</span> <span style="margin: 0 18px;">|</span>
<span style="margin-right: 8px;"> 用户名 </span> <span style="margin-right: 8px;"> {{surname}} </span>
<a nz-dropdown [nzDropdownMenu]="menu" [nzTrigger]="'click'" [nzBackdrop]='false'> <a nz-dropdown [nzDropdownMenu]="menu" [nzTrigger]="'click'" [nzBackdrop]='false'>
<img src="../../../assets/images/head.png" alt=""> <img src="../../../assets/images/head.png" alt="">
</a> </a>

9
src/app/ui/tabbar/tabbar.component.ts

@ -16,11 +16,14 @@ export class TabbarComponent implements OnInit {
constructor(private http: HttpClient, private router: Router, private route: ActivatedRoute, public token: CacheTokenService, constructor(private http: HttpClient, private router: Router, private route: ActivatedRoute, public token: CacheTokenService,
private cookieService: CookieService, private message: NzMessageService) { } private cookieService: CookieService, private message: NzMessageService) { }
surname: string
ngOnInit() { ngOnInit() {
setInterval(() => { setInterval(() => {
this.getTime() this.getTime()
}, 1000); }, 1000);
this.http.get('/api/services/app/Session/GetCurrentLoginInformations').subscribe((data: any) => {
this.surname = data.result.user.surname
})
} }
//获得时间 //获得时间
@ -60,11 +63,11 @@ export class TabbarComponent implements OnInit {
this.router.navigate(['/login']) this.router.navigate(['/login'])
} }
navChange(router){ navChange(router) {
this.router.navigate([router]) this.router.navigate([router])
} }
//修改密码 //修改密码
changpsw() { changpsw() {
// let dialogRef = this.dialog.open(ChangepasswordComponent, { width: '348.000051px' }); // let dialogRef = this.dialog.open(ChangepasswordComponent, { width: '348.000051px' });

41
src/theme.less

@ -112,7 +112,7 @@
//登录页input //登录页input
#login,#equipmentInfo { #login,#equipmentInfo,#addequipment {
nz-input-group, nz-input-group,
input { input {
@ -144,7 +144,8 @@
#recordsboxadmin, #recordsboxadmin,
#recordsbox, #recordsbox,
#warningbox, #warningbox,
#warningboxadmin { #warningboxadmin,
#addequipment {
::-webkit-input-placeholder { ::-webkit-input-placeholder {
/* WebKit browsers */ /* WebKit browsers */
color: #345d85; color: #345d85;
@ -187,44 +188,8 @@
} }
//弹窗遮罩层
.ant-modal-mask {
background: rgba(0, 0, 0, 0.05);
}
//遮罩层
.vertical-center-modal {
display: flex;
align-items: center;
justify-content: center;
}
.ant-modal-body {
background: #072549;
height: 660px;
padding: 5px;
// border: 1px solid #8eb9e3;
box-shadow: 0 0 3px #8eb9e3;
color: #fff;
}
.ant-modal-close-x {
width: 36px;
height: 36px;
line-height: 36px;
color: white;
}
.vertical-center-modal .ant-modal {
top: 0;
}
} }
// //弹窗遮罩层
// .ant-modal-mask {
// background: rgba(0, 0, 0, 0.05);
// }
#orbox { #orbox {
nz-tree { nz-tree {

Loading…
Cancel
Save