Browse Source

[新增]支队查看任务弹出框

非煤矿山灾害智能感知和预警系统
邵佳豪 3 years ago
parent
commit
95b94225c1
  1. 10967
      package-lock.json
  2. 2
      src/app/CustomReuseStrategy.ts
  3. 44
      src/app/home/basic-info/unit-details/unit-details.component.ts
  4. 9
      src/app/home/nav/nav.component.ts
  5. 2
      src/app/home/task/da-monthly-task-overview/da-monthly-task-overview.component.html
  6. 61
      src/app/home/task/zhi-audit/look-task/look-task.component.html
  7. 84
      src/app/home/task/zhi-audit/look-task/look-task.component.scss
  8. 14
      src/app/home/task/zhi-audit/look-task/look-task.component.ts
  9. 1
      src/app/home/task/zhi-audit/zhi-audit.component.ts
  10. 14
      src/app/pages/login/login.component.ts
  11. 4
      src/app/service/cache-token.service.ts
  12. BIN
      src/assets/images/icon/task1.png

10967
package-lock.json generated

File diff suppressed because it is too large Load Diff

2
src/app/CustomReuseStrategy.ts

@ -15,7 +15,7 @@ export class CustomReuseStrategy implements RouteReuseStrategy {
/** 表示对所有路由允许复用 如果你有路由不想利用可以在这加一些业务逻辑判断 */
shouldDetach(route: ActivatedRouteSnapshot): boolean {
console.log('shouldDetach======>', route);
if (route.routeConfig.path == 'basicInfo') {
if (route.routeConfig.path == 'basicInfo' || route.routeConfig.path == '') {
return false;
} else {
return true;

44
src/app/home/basic-info/unit-details/unit-details.component.ts

@ -21,6 +21,8 @@ export class UnitDetailsComponent implements OnInit {
comment: ['']
});
}
datas: {
basicInfo: {
name: "",
@ -29,26 +31,26 @@ export class UnitDetailsComponent implements OnInit {
total: "",
height: "",
layer: "",
structure:"",
coveredArea:"",
builtUpArea:"",
nature:"",
east:"",
south:"",
west:"",
north:"",
routeAndTime:"",
structure: "",
coveredArea: "",
builtUpArea: "",
nature: "",
east: "",
south: "",
west: "",
north: "",
routeAndTime: "",
},
facilities:{
controlPosition:"",
poolNumbe:"",
poolPosition:"",
poolCapacity:"",
supplyMode:"",
waterSources:"",
waterSourcesPosition:"",
alarm:false,
facilities: {
controlPosition: "",
poolNumbe: "",
poolPosition: "",
poolCapacity: "",
supplyMode: "",
waterSources: "",
waterSourcesPosition: "",
alarm: false,
}
}
@ -56,10 +58,10 @@ export class UnitDetailsComponent implements OnInit {
validateForm!: FormGroup;
ngOnInit(): void {
setTimeout(() => {
console.log(666,this.datas);
console.log(666, this.datas);
}, 0);
}
submitForm(value: { userName: string; email: string; password: string; confirm: string; comment: string }): void {
for (const key in this.validateForm.controls) {

9
src/app/home/nav/nav.component.ts

@ -1,5 +1,6 @@
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { CacheTokenService } from 'src/app/service/cache-token.service';
@Component({
selector: 'app-nav',
@ -8,12 +9,16 @@ import { Router } from '@angular/router';
})
export class NavComponent implements OnInit {
constructor(private router: Router) { }
constructor(private router: Router, public token: CacheTokenService) { }
ngOnInit(): void {
//调用服务中的function刷新token
this.token.startUp()
}
signOut() {
this.router.navigate(['/login'])
}
ngOnDestroy(): void {
this.token.delete()
}
}

2
src/app/home/task/da-monthly-task-overview/da-monthly-task-overview.component.html

@ -15,7 +15,7 @@
<!-- 上部仪表盘 -->
<div class="instrumentpanelbox">
<div class="instrumentpanelheader">
<span><img src="../../../../assets/images/icon/task.png" alt=""> 上级任务指标</span>
<span><img src="../../../../assets/images/icon/task1.png" alt=""> 上级任务指标</span>
</div>
<div class="instrumentpanel">
<div class="instrumentpanelitem instrumentpanelitemclose" *ngFor="let item of cardData">

61
src/app/home/task/zhi-audit/look-task/look-task.component.html

@ -1,25 +1,64 @@
<div class="box">
<div class="header">
<div class="namebox">
<div class="block"></div>
<span style="margin-right: 40px;">
开发区B消防救援站
</span>
<span>
单位总数:9/8
</span>
</div>
<div>
<button nz-button style="background: #42B983;color: white;">同意</button>
<button nz-button style="background: #FF0000;color: white;margin-left: 20px;"
(click)="showModal()">驳回</button>
<nz-modal [(nzVisible)]="isVisible" nzTitle="驳回说明" (nzOnCancel)="handleCancel()"
(nzOnOk)="handleOk()">
<ng-container *nzModalContent>
<textarea rows="4" nz-input [(ngModel)]="rejectdata" placeholder="请输入驳回说明"></textarea>
</ng-container>
</nz-modal>
</div>
<span>
开发区B消防救援站
</span>
<span>
单位总数:9/8
</span>
</div>
<div>
<div class="typebox">
<p>协助任务</p>
<div>
<div class="text">
<span>熟悉演练</span>
<span>|</span>
<span class="fenge">|</span>
<span>历下区大队</span>
<span>|</span>
<span class="fenge">|</span>
<span>
千佛山大厦(融通地产物业管理有限公司山东分公司)
</span>
</div>
</div>
<div class="content">
<p>本级任务</p>
<div class="maincontent">
<div class="maincontentitem">
<div>
重大活动
</div>
<div>
<label nz-checkbox ngModel>济南市开发区正大花园幼儿园</label>
</div>
<div>
<label nz-checkbox ngModel>济南市粤剧餐饮有限公司</label>
</div>
</div>
<div class="maincontentitem">
<div>
重大活动
</div>
<div>
<label nz-checkbox ngModel>济南市开发区正大花园幼儿园</label>
</div>
<div>
<label nz-checkbox ngModel>济南市粤剧餐饮有限公司</label>
</div>
</div>
</div>
</div>
</div>

84
src/app/home/task/zhi-audit/look-task/look-task.component.scss

@ -1,3 +1,81 @@
.box{
}
.box {
display: flex;
flex-direction: column;
.header {
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1px dashed #C7CAD0;
box-sizing: border-box;
padding-bottom: 12px;
.namebox {
display: flex;
align-items: center;
.block {
width: 10px;
height: 10px;
background: #2C4DC0;
}
}
}
.typebox {
p {
font-size: 16px;
margin-top: 12px;
}
.text {
margin: 12px 0;
.fenge {
margin: 0 20px;
}
}
border-bottom: 1px dashed #C7CAD0;
}
.content {
flex: 1;
overflow: hidden;
display: flex;
flex-direction: column;
p {
font-size: 16px;
margin-top: 12px;
}
.maincontent {
flex: 1;
overflow-y: auto;
width: 100%;
background: #FFFFFF;
border-radius: 4px 4px 4px 4px;
opacity: 1;
border: 1px solid #E4E7EC;
box-sizing: border-box;
padding: 12px;
.maincontentitem {
display: flex;
flex-direction: column;
justify-content: flex-start;
border-bottom: 1px dashed #C7CAD0;
margin-bottom: 12px;
div {
margin-bottom: 10px;
}
// align-items: flex-start;
}
}
}
}

14
src/app/home/task/zhi-audit/look-task/look-task.component.ts

@ -11,5 +11,19 @@ export class LookTaskComponent implements OnInit {
ngOnInit(): void {
}
isVisible = false
showModal(): void {
this.isVisible = true;
}
handleOk(): void {
console.log('Button ok clicked!');
this.isVisible = false;
}
handleCancel(): void {
console.log('Button cancel clicked!');
this.isVisible = false;
}
rejectdata
}

1
src/app/home/task/zhi-audit/zhi-audit.component.ts

@ -125,6 +125,7 @@ export class ZhiAuditComponent implements OnInit {
nzContent: LookTaskComponent,
nzViewContainerRef: this.viewContainerRef,
nzFooter: null,
nzWidth:800,
nzOnOk: () => new Promise(resolve => setTimeout(resolve, 1000))
});
const instance = modal.getContentComponent();

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

@ -1,12 +1,9 @@
import { Component, OnInit } from '@angular/core';
import { HttpClient } from '@angular/common/http'
import { Router, ActivatedRoute } from '@angular/router'
import { CacheTokenService } from '../../service/cache-token.service'//引入服务
import { Router } from '@angular/router'
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { NzMessageService } from 'ng-zorro-antd/message';
import { Base64 } from 'js-base64';
import { NzNotificationService } from 'ng-zorro-antd/notification';
@Component({
selector: 'app-login',
templateUrl: './login.component.html',
@ -16,7 +13,7 @@ import { NzNotificationService } from 'ng-zorro-antd/notification';
export class LoginComponent implements OnInit {
validateForm!: FormGroup;
constructor(private http: HttpClient, private router: Router, public token: CacheTokenService, private fb: FormBuilder, private message: NzMessageService) { }
constructor(private http: HttpClient, private router: Router, private fb: FormBuilder, private message: NzMessageService) { }
ngOnInit() {
this.validateForm = this.fb.group({
@ -100,21 +97,16 @@ export class LoginComponent implements OnInit {
password: this.validateForm.value.password
}).subscribe({
next: (data: any) => {
// this.isLoading = false;
console.log('登录信息', data)
this.isLoading = false;
this.rememberInfo()
this.autoLogin()
sessionStorage.setItem("token", data.token);
sessionStorage.setItem("refreshToken", data.refreshToken);
this.router.navigate(['/system'])
this.message.create('success', `登录成功`);
//调用服务中的function刷新token
this.token.startUp()
},
error: (err) => {
this.isLoading = false;
console.log(err)
}
}

4
src/app/service/cache-token.service.ts

@ -20,8 +20,7 @@ export class CacheTokenService {
token: token,
refreshToken: refreshToken
}).subscribe((data: any) => {
console.log('定时刷新token成功',data)
console.log('定时刷新token成功', data)
sessionStorage.setItem("token", data.token);
sessionStorage.setItem("refreshToken", data.refreshToken);
})
@ -35,6 +34,7 @@ export class CacheTokenService {
//删除定时器
delete = (): void => {
console.log('消除定时刷新token')
window.clearInterval(this.timer)
}

BIN
src/assets/images/icon/task1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 535 B

Loading…
Cancel
Save