Browse Source

[新增]增加完整度模块

dev
邵佳豪 4 years ago
parent
commit
971e38b994
  1. 22
      src/app/http-interceptors/tabbar-and-score.service.ts
  2. 89
      src/app/key-unit/basicinfo/basicinfo.component.ts
  3. 16
      src/app/key-unit/fire-fighting-device/fire-fighting-device.component.ts
  4. 8
      src/app/key-unit/function-division/function-division.component.ts
  5. 6
      src/app/key-unit/key-site/key-site.component.ts
  6. 105
      src/app/key-unit/key-unit-management/key-unit-management.component.html
  7. 14
      src/app/key-unit/key-unit-management/key-unit-management.component.ts
  8. 15
      src/app/key-unit/realistic-picture/realistic-picture.component.ts
  9. 11
      src/app/key-unit/uploading-cad/uploading-cad.component.ts
  10. 556
      src/app/plan-management/entry-plan/entry-plan.component.html
  11. 25
      src/app/plan-management/entry-plan/entry-plan.component.scss
  12. 116
      src/app/plan-management/entry-plan/entry-plan.component.ts
  13. 250
      src/app/tabbar/tabbar.component.html
  14. 2
      src/app/tabbar/tabbar.component.scss
  15. 40
      src/app/tabbar/tabbar.component.ts

22
src/app/http-interceptors/tabbar-and-score.service.ts

@ -0,0 +1,22 @@
import { Injectable } from '@angular/core';
import { Observable, ReplaySubject } from 'rxjs';
@Injectable({
providedIn: 'root'
})
export class TabbarAndScoreService {
constructor() { }
private _sendMessage: ReplaySubject<any> = new ReplaySubject<any>(1);
/** * **
* @param message *
* @returns {Observavle<any>} */
public sendMessage(message: any) {
this._sendMessage.next(message);
}
public getMessage(): Observable <any> {
return this._sendMessage.asObservable();
}
}

89
src/app/key-unit/basicinfo/basicinfo.component.ts

@ -20,6 +20,7 @@ import * as _ from 'lodash';
// import Swiper from 'swiper';
import { LookMaster } from './lookmaster.component'
import { Router,ActivatedRoute } from '@angular/router'
import { TabbarAndScoreService } from 'src/app/http-interceptors/tabbar-and-score.service';
@Component({
selector: 'app-basicinfo',
@ -84,7 +85,7 @@ export class BasicinfoComponent implements OnInit {
buildingCustomData:any //存储当前建筑的自定义信息
allunittype: any //所有单位类型
allorganizing:any = [] //所有组织机构
constructor(private router:Router,private route:ActivatedRoute,private http: HttpClient, private tree: TreeService, private sanitizer: DomSanitizer, public dialog: MatDialog,public snackBar: MatSnackBar) { }
constructor(private tabbarService: TabbarAndScoreService,private router:Router,private route:ActivatedRoute,private http: HttpClient, private tree: TreeService, private sanitizer: DomSanitizer, public dialog: MatDialog,public snackBar: MatSnackBar) { }
unitId : any //当前单位id
@ -763,6 +764,7 @@ export class BasicinfoComponent implements OnInit {
if(data){
let newbuilding = await this.changebuildingdata(data)
this.houses.push(newbuilding)
this.tabbarService.sendMessage('changeScore');//通知服务改变分数
}
}
);
@ -947,7 +949,6 @@ export class BasicinfoComponent implements OnInit {
let end = Math.min(fileSize, start + shardSize); //切割文件结束位置
let formData = new FormData()
formData.append("file",file.slice(start, end))
// 同步写法实现异步调用
let result = await new Promise((resolve, reject) => {
// await 需要后面返回一个 promise 对象
@ -988,6 +989,7 @@ export class BasicinfoComponent implements OnInit {
config.duration = 3000
this.snackBar.open('删除成功','确定',config);
this.houses.splice(this.houses.findIndex(items=>items==item),1)
this.tabbarService.sendMessage('changeScore');//通知服务改变分数
})
}
}
@ -1024,47 +1026,49 @@ export class BasicinfoComponent implements OnInit {
}
]
}
this.http.put(`/api/Companies/${this.unitId}`,body).subscribe((data:any)=>{ //修改单位基本信息
this.getunitinfo()
if(!this.houses.length){
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('单位基本信息保存成功,请填写单位建筑模板信息','确定',config);
// alert("单位基本信息保存成功,请填写单位建筑模板信息")
let order = 0
let addbody = { //请求创建单位基本信息成功后 直接创建出一个主体建筑模板
id: "",//即将要生成具体建筑的id
name: "主体建筑",
order: order,
enabled: true,
companyId: this.unitinfo.id,
buildingTypes: [
{
id: value.unittype,
name: ""
}
]
this.http.put(`/api/Companies/${this.unitId}`,body).subscribe((data:any)=>{ //修改单位基本信息
this.getunitinfo()
if(!this.houses.length){
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('单位基本信息保存成功,请填写单位建筑模板信息','确定',config);
// alert("单位基本信息保存成功,请填写单位建筑模板信息")
let order = 0
let addbody = { //请求创建单位基本信息成功后 直接创建出一个主体建筑模板
id: "",//即将要生成具体建筑的id
name: "主体建筑",
order: order,
enabled: true,
companyId: this.unitinfo.id,
buildingTypes: [
{
id: value.unittype,
name: ""
}
]
}
this.http.post("/api/Buildings",addbody,{params:{
companyId : this.unitId
}}).subscribe(data=>{//首先创建建筑成功了,需要刷出当前建筑类型的模板
this.getunitallbuilding()
})
this.tabbarService.sendMessage('changeScore');//通知服务改变分数
}else{
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('保存成功','确定',config);
this.tabbarService.sendMessage('changeScore');//通知服务改变分数
}
}),
err=>{
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('请填写正确信息','确定',config);
}
this.http.post("/api/Buildings",addbody,{params:{
companyId : this.unitId
}}).subscribe(data=>{//首先创建建筑成功了,需要刷出当前建筑类型的模板
this.getunitallbuilding()
})
}else{
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('保存成功','确定',config);
}
}),
err=>{
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('请填写正确信息','确定',config);
}
}
}
@ -1291,6 +1295,7 @@ export class BasicinfoComponent implements OnInit {
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('建筑信息保存成功','确定',config);
this.tabbarService.sendMessage('changeScore');//通知服务改变分数
},
err=>{
const config = new MatSnackBarConfig();
@ -1974,6 +1979,7 @@ export class BasicinfoComponent implements OnInit {
config.duration = 3000
this.snackBar.open('建筑信息保存成功','确定',config);
// alert("建筑信息保存成功")
this.tabbarService.sendMessage('changeScore');//通知服务改变分数
},
err=>{
const config = new MatSnackBarConfig();
@ -2016,6 +2022,7 @@ export class BasicinfoComponent implements OnInit {
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('建筑信息保存成功','确定',config);
this.tabbarService.sendMessage('changeScore');//通知服务改变分数
},
err=>{
const config = new MatSnackBarConfig();

16
src/app/key-unit/fire-fighting-device/fire-fighting-device.component.ts

@ -5,6 +5,7 @@ import { ImgsDataDetail } from './addGrouping.component'
import { MatSnackBarConfig, MatSnackBar } from '@angular/material/snack-bar';
import { ImagesData } from './imagesdata.component'
import { Router,ActivatedRoute } from '@angular/router'
import { TabbarAndScoreService } from 'src/app/http-interceptors/tabbar-and-score.service';
export interface Food {
@ -18,7 +19,7 @@ export interface Food {
})
export class FireFightingDeviceComponent implements OnInit {
constructor(private router:Router,private route:ActivatedRoute,public http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar) { }
constructor(private tabbarService: TabbarAndScoreService,private router:Router,private route:ActivatedRoute,public http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar) { }
ngOnInit(): void {
this.getCompanyInformation()
@ -63,7 +64,10 @@ export class FireFightingDeviceComponent implements OnInit {
let data = e
let dialogRef = this.dialog.open(ImgsDataDetail,{data});
dialogRef.afterClosed().subscribe(data=>{
if (data) { e.facilityItems.push(data) } });
if (data) {
e.facilityItems.push(data)
this.tabbarService.sendMessage('changeScore');//通知服务改变分数
} });
}
//保存单位消防设施内置分组项
@ -84,6 +88,7 @@ export class FireFightingDeviceComponent implements OnInit {
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('数据更新成功','确定',config);
this.tabbarService.sendMessage('changeScore');//通知服务改变分数
}) }
}); //forEach
@ -114,7 +119,7 @@ export class FireFightingDeviceComponent implements OnInit {
e.facilityItems.splice(e.facilityItems.findIndex(item=>item.name==deleteElement.name),1)
});
e.selectBuiltInGrouping = []
this.tabbarService.sendMessage('changeScore');//通知服务改变分数
}) //http
} //if
}); //forEach
@ -138,6 +143,7 @@ export class FireFightingDeviceComponent implements OnInit {
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('数据更新成功','确定',config);
this.tabbarService.sendMessage('changeScore');//通知服务改变分数
})
} //if
});
@ -281,6 +287,7 @@ export class FireFightingDeviceComponent implements OnInit {
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('数据更新成功','确定',config);
this.tabbarService.sendMessage('changeScore');//通知服务改变分数
}) }
}); //forEach
@ -302,7 +309,7 @@ export class FireFightingDeviceComponent implements OnInit {
item.facilityItems.splice(item.facilityItems.findIndex(items=>items.name==deleteElement.name),1)
});
item.selectBuiltInGrouping = []
this.tabbarService.sendMessage('changeScore');//通知服务改变分数
}) //http
} //if
}) //forEach
@ -329,6 +336,7 @@ export class FireFightingDeviceComponent implements OnInit {
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('数据更新成功','确定',config);
this.tabbarService.sendMessage('changeScore');//通知服务改变分数
})
} //if
});

8
src/app/key-unit/function-division/function-division.component.ts

@ -3,6 +3,7 @@ import { HttpClient, HttpHeaders } from '@angular/common/http';
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
import { Router,ActivatedRoute } from '@angular/router'
import { TabbarAndScoreService } from 'src/app/http-interceptors/tabbar-and-score.service';
@Component({
@ -12,7 +13,7 @@ import { Router,ActivatedRoute } from '@angular/router'
})
export class FunctionDivisionComponent implements OnInit {
constructor(private router:Router,private route:ActivatedRoute,private http:HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar) { }
constructor(private tabbarService: TabbarAndScoreService,private router:Router,private route:ActivatedRoute,private http:HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar) { }
ngOnInit(): void {
this.companyId = this.route.snapshot.queryParams.id
@ -58,6 +59,7 @@ export class FunctionDivisionComponent implements OnInit {
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('数据更新成功','确定',config);
this.tabbarService.sendMessage('changeScore');//通知服务改变分数
})
}
}
@ -89,6 +91,7 @@ export class FunctionDivisionComponent implements OnInit {
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('数据更新成功','确定',config);
this.tabbarService.sendMessage('changeScore');//通知服务改变分数
})
})
}
@ -150,6 +153,7 @@ export class FunctionDivisionComponent implements OnInit {
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('数据更新成功','确定',config);
this.tabbarService.sendMessage('changeScore');//通知服务改变分数
})
}
@ -209,9 +213,11 @@ export class FunctionDivisionComponent implements OnInit {
if (newIndex==this.selectBuildingFunctionalZoning[index].length-1) {
if (this.allBuildingFunctionalZoning[index].functionalZoning.length) {
this.updateCurrent(e,index)
this.tabbarService.sendMessage('changeScore');//通知服务改变分数
} else {
this.selectBuildingFunctionalZoning.splice(index,1)
this.allBuildingFunctionalZoning.splice(index,1)}
this.tabbarService.sendMessage('changeScore');//通知服务改变分数
}
});

6
src/app/key-unit/key-site/key-site.component.ts

@ -4,6 +4,7 @@ import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material/dial
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
import { KeySiteImgs } from './keysiteimgs.component'
import { ActivatedRoute } from '@angular/router';
import { TabbarAndScoreService } from 'src/app/http-interceptors/tabbar-and-score.service';
@ -14,7 +15,7 @@ import { ActivatedRoute } from '@angular/router';
})
export class KeySiteComponent implements OnInit {
constructor(public http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,private route:ActivatedRoute,) { }
constructor(private tabbarService: TabbarAndScoreService,public http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,private route:ActivatedRoute,) { }
displayedColumns: string[] = ['mainname', 'position', 'construction', 'nature', 'danger', 'img'];
@ -98,6 +99,7 @@ export class KeySiteComponent implements OnInit {
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('数据修改成功','确定',config);
this.tabbarService.sendMessage('changeScore');//通知服务改变分数
})
} else { //新增单位重点提示
let data = {
@ -110,6 +112,7 @@ export class KeySiteComponent implements OnInit {
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('数据修改成功','确定',config);
this.tabbarService.sendMessage('changeScore');//通知服务改变分数
})
}
}
@ -170,6 +173,7 @@ export class KeySiteComponent implements OnInit {
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('数据修改成功','确定',config);
this.tabbarService.sendMessage('changeScore');//通知服务改变分数
})
}

105
src/app/key-unit/key-unit-management/key-unit-management.component.html

@ -1,5 +1,5 @@
<div style="height: 95%;overflow: auto;">
<div style="height: 100%;overflow: hidden">
<div id="header" class="header" (click)="bigclosediv($event)">
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm">
<div class="queryBox">
@ -64,6 +64,15 @@
</mat-select>
</mat-form-field>
</div>
<div class="queryField">
<label style="margin-right: 10px;">信息完整度排序:</label>
<mat-form-field>
<mat-select placeholder='请选择排序方式' [(ngModel)]="integritySort" name="integritySort">
<mat-option value="desc">从高到低</mat-option>
<mat-option value="asc">从低到高</mat-option>
</mat-select>
</mat-form-field>
</div>
</div>
<div style="width: 100%;text-align: center;">
<button mat-raised-button color="primary">查询</button>
@ -107,9 +116,9 @@
<td mat-cell *matCellDef="let element;let i = index">
<div class="integrityDiv">
<span class="integrityNum">
{{element.integrity.zong}}分
{{(element.companyIntegrityScore.totalScore.toFixed(2) * 100).toFixed()}}分
</span>
<div class="integrityColorDiv" [style]="integrity(element.integrity.zong)">
<div class="integrityColorDiv" [style]="integrity((element.companyIntegrityScore.totalScore.toFixed(2) * 100).toFixed())">
</div>
<div class="integrityDetails" [ngClass]="{'bottomposition': i <= 5,'topposition': i > 5}">
<div class="integrityDetailsTop">
@ -119,15 +128,95 @@
</div>
<div class="integrityDetailsBody">
<ul>
<li *ngFor="let item of element.integrity.details">
<div class="name">{{item.name}}</div>
<li>
<div class="name">单位信息</div>
<div class="colorDiv">
<div class="colorDivBac">
<div class="colorDivCon" [style]="integrityDetails((element.companyIntegrityScore.basicInfoScore * 5).toFixed(1),5)"></div>
</div>
<span>{{(element.companyIntegrityScore.basicInfoScore * 5).toFixed(1)}}分</span>
</div>
<div class="number">5分</div>
</li>
<li>
<div class="name">建筑信息</div>
<div class="colorDiv">
<div class="colorDivBac">
<div class="colorDivCon" [style]="integrityDetails((element.companyIntegrityScore.buildingInfoScore * 10).toFixed(1),10)"></div>
</div>
<span>{{(element.companyIntegrityScore.buildingInfoScore * 10).toFixed(1)}}分</span>
</div>
<div class="number">10分</div>
</li>
<li>
<div class="name">平面图</div>
<div class="colorDiv">
<div class="colorDivBac">
<div class="colorDivCon" [style]="integrityDetails((element.companyIntegrityScore.planImageScore * 10).toFixed(1),10)"></div>
</div>
<span>{{(element.companyIntegrityScore.planImageScore * 10).toFixed(1)}}分</span>
</div>
<div class="number">10分</div>
</li>
<li>
<div class="name">四周毗邻</div>
<div class="colorDiv">
<div class="colorDivBac">
<div class="colorDivCon" [style]="integrityDetails((element.companyIntegrityScore.adjoinScore * 10).toFixed(1),10)"></div>
</div>
<span>{{(element.companyIntegrityScore.adjoinScore * 10).toFixed(1)}}分</span>
</div>
<div class="number">10分</div>
</li>
<li>
<div class="name">消防设施</div>
<div class="colorDiv">
<div class="colorDivBac">
<div class="colorDivCon" [style]="integrityDetails((element.companyIntegrityScore.facilityScore * 25).toFixed(1),25)"></div>
</div>
<span>{{(element.companyIntegrityScore.facilityScore * 25).toFixed(1)}}分</span>
</div>
<div class="number">25分</div>
</li>
<li>
<div class="name">重点部位</div>
<div class="colorDiv">
<div class="colorDivBac">
<div class="colorDivCon" [style]="integrityDetails((element.companyIntegrityScore.importantLocationScore * 10).toFixed(1),10)"></div>
</div>
<span>{{(element.companyIntegrityScore.importantLocationScore * 10).toFixed(1)}}分</span>
</div>
<div class="number">10分</div>
</li>
<li>
<div class="name">功能分区</div>
<div class="colorDiv">
<div class="colorDivBac">
<div class="colorDivCon" [style]="integrityDetails((element.companyIntegrityScore.functionalDivisionScore * 10).toFixed(1),10)"></div>
</div>
<span>{{(element.companyIntegrityScore.functionalDivisionScore * 10).toFixed(1)}}分</span>
</div>
<div class="number">10分</div>
</li>
<li>
<div class="name">实景图</div>
<div class="colorDiv">
<div class="colorDivBac">
<div class="colorDivCon" [style]="integrityDetails((element.companyIntegrityScore.realityImageScore * 10).toFixed(1),10)"></div>
</div>
<span>{{(element.companyIntegrityScore.realityImageScore * 10).toFixed(1)}}分</span>
</div>
<div class="number">10分</div>
</li>
<li>
<div class="name">CAD上传</div>
<div class="colorDiv">
<div class="colorDivBac">
<div class="colorDivCon" [style]="integrityDetails(item.score,item.totalpoints)"></div>
<div class="colorDivCon" [style]="integrityDetails((element.companyIntegrityScore.cadScore * 10).toFixed(1),10)"></div>
</div>
<span>{{item.score}}分</span>
<span>{{(element.companyIntegrityScore.cadScore * 10).toFixed(1)}}分</span>
</div>
<div class="number">{{item.totalpoints}}分</div>
<div class="number">10</div>
</li>
</ul>
</div>

14
src/app/key-unit/key-unit-management/key-unit-management.component.ts

@ -345,7 +345,8 @@ export class KeyUnitManagementComponent implements OnInit {
BuildingTypeId: this.unittype || '',
PageNumber: this.PageNumber || '1',
PageSize: this.pageSizeOptions[0],
Sort: ''
Sort: this.integritySort ? 'integrityscore' : '',
SortType: this.integritySort || '',
}
this.http.get("/api/Companies",{params:paramsdata}).subscribe((data:any)=>{
@ -430,9 +431,11 @@ export class KeyUnitManagementComponent implements OnInit {
//编辑单位信息
editunit(){
let selectedunitArr = []
let selectedunitobj = []
this.allKeyUnitInfo.items.forEach(item => {
if(item.checked){
selectedunitArr.push(item.id)
selectedunitobj.push(item)
}
});
@ -456,7 +459,8 @@ export class KeyUnitManagementComponent implements OnInit {
}
});
sessionStorage.setItem("editable","1")
window.open(`/keyUnit/editplaninfo?id=${selectedunitArr[0]}`);
sessionStorage.setItem(selectedunitobj[0].id,JSON.stringify(selectedunitobj[0].companyIntegrityScore))
window.open(`/keyUnit/editplaninfo?id=${selectedunitArr[0]}&usci=${selectedunitobj[0].usci}`);
}
}
//关注重点单位
@ -528,6 +532,7 @@ export class KeyUnitManagementComponent implements OnInit {
jscheck:any //辖区中队包含下级
OrganizationId //
follow:any = '' //是否为关注单位
integritySort:any //完整度排序
reset(){
this.js='' //辖区中队输入框
this.jscheck='' //辖区中队包含下级
@ -538,6 +543,7 @@ export class KeyUnitManagementComponent implements OnInit {
this.follow = ''
this.PageNumber = 1
this.pageEvent.pageIndex = 0
this.integritySort = ''
this.getAllKeyUnit();
}
@ -547,8 +553,8 @@ export class KeyUnitManagementComponent implements OnInit {
sessionStorage.setItem("editable","0")
sessionStorage.setItem("companyName",element.name)
sessionStorage.setItem("companyId",element.id)
sessionStorage.setItem(element.id,JSON.stringify(element.integrity))
window.open(`/keyUnit/viewunitinfo?id=${element.id}`,'_blank');
sessionStorage.setItem(element.id,JSON.stringify(element.companyIntegrityScore))
window.open(`/keyUnit/viewunitinfo?id=${element.id}&usci=${element.usci}`,'_blank');
}
//提交查询表单
onSubmit(value){

15
src/app/key-unit/realistic-picture/realistic-picture.component.ts

@ -6,6 +6,7 @@ import { MatPaginator } from '@angular/material/paginator';
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
import Swiper from 'swiper';
import { Router,ActivatedRoute } from '@angular/router'
import { TabbarAndScoreService } from 'src/app/http-interceptors/tabbar-and-score.service';
@Component({
selector: 'app-realistic-picture',
@ -21,7 +22,7 @@ export class RealisticPictureComponent implements OnInit {
removeAfterUpload:true,
});
constructor(private router:Router,private route:ActivatedRoute,private http:HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar) { }
constructor(private tabbarService: TabbarAndScoreService,private router:Router,private route:ActivatedRoute,private http:HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar) { }
ngOnInit(): void {
let companyId = this.route.snapshot.queryParams.id
@ -133,7 +134,9 @@ export class RealisticPictureComponent implements OnInit {
addReal () {
let dialogRef = this.dialog.open(addRealPicture);
dialogRef.afterClosed().subscribe(data=>{
if (data) {this.getAllGrouping()}
if (data) {
this.tabbarService.sendMessage('changeScore');//通知服务改变分数
this.getAllGrouping()}
});
}
@ -143,7 +146,9 @@ export class RealisticPictureComponent implements OnInit {
if (this.selectReal) {
let dialogRef = this.dialog.open(editRealPicture, {data});
dialogRef.afterClosed().subscribe(data=>{
if (data) {this.getAllGrouping()}
if (data) {
this.tabbarService.sendMessage('changeScore');//通知服务改变分数
this.getAllGrouping()}
});
}
}
@ -162,6 +167,7 @@ export class RealisticPictureComponent implements OnInit {
this.selectReal = data[this.selectRealIndex]
this.allImages = []
this.getAllRealPicture()
this.tabbarService.sendMessage('changeScore');//通知服务改变分数
})
})
}
@ -187,6 +193,7 @@ export class RealisticPictureComponent implements OnInit {
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('图片修改成功','确定',config);
this.tabbarService.sendMessage('changeScore');//通知服务改变分数
})
}
@ -200,6 +207,7 @@ export class RealisticPictureComponent implements OnInit {
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('图片删除成功','确定',config);
this.tabbarService.sendMessage('changeScore');//通知服务改变分数
})
this.http.delete(`/api/Objects/PlanPlatform/${e.imageUrl}`).subscribe(data=>{})
}
@ -331,6 +339,7 @@ export class RealisticPictureComponent implements OnInit {
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('图片上传成功','确定',config);
this.tabbarService.sendMessage('changeScore');//通知服务改变分数
})
}

11
src/app/key-unit/uploading-cad/uploading-cad.component.ts

@ -3,6 +3,7 @@ import { HttpClient, HttpHeaders } from '@angular/common/http';
import { MatDialog, MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
import { ActivatedRoute } from '@angular/router';
import { TabbarAndScoreService } from 'src/app/http-interceptors/tabbar-and-score.service';
@ -13,7 +14,7 @@ import { ActivatedRoute } from '@angular/router';
})
export class UploadingCADComponent implements OnInit {
constructor(private http:HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,private route:ActivatedRoute,) { }
constructor(private tabbarService: TabbarAndScoreService,private http:HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,private route:ActivatedRoute,) { }
ngOnInit(): void {
this.companyId = this.route.snapshot.queryParams.id
@ -30,6 +31,7 @@ export class UploadingCADComponent implements OnInit {
getAllCAD () {
let id = {companyId:this.route.snapshot.queryParams.id}
this.http.get('/api/CadData',{params:id}).subscribe(data=>{
this.tabbarService.sendMessage('changeScore');//通知服务改变分数
this.CADList = data
this.selectCAD = []
this.CADList.forEach(element => {
@ -39,6 +41,7 @@ export class UploadingCADComponent implements OnInit {
})
}
//change CAD图checked
checkedCAD (e,element) {
if (e.checked) {
@ -64,7 +67,8 @@ export class UploadingCADComponent implements OnInit {
let data = this.selectCAD[0]
let dialogRef = this.dialog.open(editFile,{data});
dialogRef.afterClosed().subscribe(data=>{
if (data) {this.getAllCAD()}
if (data) {
this.getAllCAD()}
});
} else if (this.selectCAD.length>1) {
const config = new MatSnackBarConfig();
@ -96,7 +100,8 @@ export class UploadingCADComponent implements OnInit {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('删除CAD图纸成功','确定',config);}
this.snackBar.open('删除CAD图纸成功','确定',config);
}
});
}
} else {

556
src/app/plan-management/entry-plan/entry-plan.component.html

@ -1,276 +1,286 @@
<div class="header">
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm">
<div class="queryBox">
<div class="queryField">
<label style="margin-right: 10px;">单位名称:</label>
<mat-form-field class="example-full-width">
<input matInput placeholder="请输入单位名称" name="companyName" [(ngModel)]="companyName" autocomplete="off">
</mat-form-field>
</div>
<div class="queryField ordiv">
<label style="margin-right: 10px;">消防救援站:</label>
<mat-form-field class="example-full-width">
<input readonly matInput placeholder="请选择消防救援站" autocomplete="off" [(ngModel)]="js" name="js" (focus)="openorganizationbox()">
</mat-form-field>
<mat-checkbox style="margin-left: 6px;" [(ngModel)]="jscheck" name="jscheck">包含下级</mat-checkbox>
<div class="organizationbox" *ngIf="isorganizationbox">
<div (click)="closediv()" class="closediv"><mat-icon>clear</mat-icon></div>
<mat-tree [dataSource]="dataSource" [treeControl]="treeControl">
<mat-tree-node *matTreeNodeDef="let node" matTreeNodePadding (click)='add(node)' class="organizationlist">
<button type="button" mat-icon-button disabled ></button>
<li>{{node.name}}</li>
</mat-tree-node>
<mat-tree-node *matTreeNodeDef="let node;when: hasChild" matTreeNodePadding (click)='add(node)' class="organizationlist">
<button
type="button"
mat-icon-button
matTreeNodeToggle
[attr.aria-label]="'toggle ' + node.name">
<mat-icon class="mat-icon-rtl-mirror">
{{treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right'}}
</mat-icon>
</button>
<li>{{node.name}}</li>
</mat-tree-node>
</mat-tree>
</div>
</div>
<div class="queryField">
<label style="margin-right: 10px;">单位类型:</label>
<mat-form-field>
<mat-select placeholder='请选择单位类型' name="unittype" [(ngModel)]="unittype">
<mat-option *ngFor="let unit of allunittype" [value]="unit.id" >
{{unit.name}}
</mat-option>
</mat-select>
</mat-form-field>
</div>
<div class="queryField">
<label style="margin-right: 10px;">预案类型:</label>
<mat-form-field>
<mat-select name="reservePlanType" [(ngModel)]="reservePlanType" placeholder='请选择预案类型'>
<mat-option value="8">卡片预案</mat-option>
<mat-option value="1">二维预案</mat-option>
<mat-option value="2">三维预案</mat-option>
<mat-option value="4">其他预案</mat-option>
</mat-select>
</mat-form-field>
</div>
<div class="queryField">
<label style="margin-right: 10px;">审核状态:</label>
<mat-form-field>
<mat-select name="toExamine" [(ngModel)]="toExamine" placeholder='请选择审核状态'>
<mat-option value="8">未提交审核</mat-option>
<mat-option value="1">审核中</mat-option>
<mat-option value="2">审核通过</mat-option>
<mat-option value="4">审核退回</mat-option>
</mat-select>
</mat-form-field>
</div>
<div class="queryField">
<label style="margin-right: 10px;">编制级别:</label>
<mat-form-field>
<mat-select name="preparelevel" [(ngModel)]="preparelevel" placeholder='请选择编制级别'>
<!-- <mat-option value="1">总队</mat-option>
<mat-option value="2">支队</mat-option>
<mat-option value="4">大队</mat-option>
<mat-option value="8">中队</mat-option> -->
<mat-option *ngFor="let item of preparelevels" [value]="item.value">{{item.name}}</mat-option>
</mat-select>
</mat-form-field>
<mat-checkbox style="margin-left: 6px;" [(ngModel)]="plcheck" name="plcheck">包含下级</mat-checkbox>
</div>
<div class="queryField">
<label style="margin-right: 10px;">建筑类型:</label>
<mat-form-field>
<mat-select name="preparelevel" placeholder='请选择建筑类型'>
<mat-option *ngFor="let item of buildingType" [value]="item.value">{{item.name}}</mat-option>
</mat-select>
</mat-form-field>
<!-- <mat-checkbox style="margin-left: 6px;" [(ngModel)]="plcheck" name="plcheck">包含下级</mat-checkbox> -->
</div>
<div class="queryField">
<label style="margin-right: 10px;">选择支队:</label>
<mat-form-field>
<mat-select name="preparelevel" [(ngModel)]="preparelevel" placeholder='请选择支队'>
<mat-option *ngFor="let item of tableDataZhi" [value]="item.value">{{item.name}}</mat-option>
</mat-select>
</mat-form-field>
<!-- <mat-checkbox style="margin-left: 6px;" [(ngModel)]="plcheck" name="plcheck">包含下级</mat-checkbox> -->
</div>
</div>
<div style="width: 100%;text-align: center;">
<button mat-raised-button color="primary" type="submit">查询</button>
<button mat-raised-button style="margin-left: 25px;" type="button" (click)="reset()">重置</button>
<div style="height: 100%;overflow-y: auto;">
<div class="header" >
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm">
<div class="queryBox">
<div class="queryField">
<label style="margin-right: 10px;">单位名称:</label>
<mat-form-field class="example-full-width">
<input matInput placeholder="请输入单位名称" name="companyName" [(ngModel)]="companyName" autocomplete="off">
</mat-form-field>
</div>
<div class="queryField ordiv">
<label style="margin-right: 10px;">消防救援站:</label>
<mat-form-field class="example-full-width">
<input readonly matInput placeholder="请选择消防救援站" autocomplete="off" [(ngModel)]="js" name="js" (focus)="openorganizationbox()">
</mat-form-field>
<mat-checkbox style="margin-left: 6px;" [(ngModel)]="jscheck" name="jscheck">包含下级</mat-checkbox>
<div class="organizationbox" *ngIf="isorganizationbox">
<div (click)="closediv()" class="closediv"><mat-icon>clear</mat-icon></div>
<mat-tree [dataSource]="dataSource" [treeControl]="treeControl">
<mat-tree-node *matTreeNodeDef="let node" matTreeNodePadding (click)='add(node)' class="organizationlist">
<button type="button" mat-icon-button disabled ></button>
<li>{{node.name}}</li>
</mat-tree-node>
<mat-tree-node *matTreeNodeDef="let node;when: hasChild" matTreeNodePadding (click)='add(node)' class="organizationlist">
<button
type="button"
mat-icon-button
matTreeNodeToggle
[attr.aria-label]="'toggle ' + node.name">
<mat-icon class="mat-icon-rtl-mirror">
{{treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right'}}
</mat-icon>
</button>
<li>{{node.name}}</li>
</mat-tree-node>
</mat-tree>
</div>
</div>
<div class="queryField">
<label style="margin-right: 10px;">单位类型:</label>
<mat-form-field>
<mat-select placeholder='请选择单位类型' name="unittype" [(ngModel)]="unittype">
<mat-option *ngFor="let unit of allunittype" [value]="unit.id" >
{{unit.name}}
</mat-option>
</mat-select>
</mat-form-field>
</div>
<div class="queryField">
<label style="margin-right: 10px;">预案类型:</label>
<mat-form-field>
<mat-select name="reservePlanType" [(ngModel)]="reservePlanType" placeholder='请选择预案类型'>
<mat-option value="8">卡片预案</mat-option>
<mat-option value="1">二维预案</mat-option>
<mat-option value="2">三维预案</mat-option>
<mat-option value="4">其他预案</mat-option>
</mat-select>
</mat-form-field>
</div>
<div class="queryField">
<label style="margin-right: 10px;">审核状态:</label>
<mat-form-field>
<mat-select name="toExamine" [(ngModel)]="toExamine" placeholder='请选择审核状态'>
<mat-option value="8">未提交审核</mat-option>
<mat-option value="1">审核中</mat-option>
<mat-option value="2">审核通过</mat-option>
<mat-option value="4">审核退回</mat-option>
</mat-select>
</mat-form-field>
</div>
<div class="queryField">
<label style="margin-right: 10px;">编制级别:</label>
<mat-form-field>
<mat-select name="preparelevel" [(ngModel)]="preparelevel" placeholder='请选择编制级别'>
<!-- <mat-option value="1">总队</mat-option>
<mat-option value="2">支队</mat-option>
<mat-option value="4">大队</mat-option>
<mat-option value="8">中队</mat-option> -->
<mat-option *ngFor="let item of preparelevels" [value]="item.value">{{item.name}}</mat-option>
</mat-select>
</mat-form-field>
<mat-checkbox style="margin-left: 6px;" [(ngModel)]="plcheck" name="plcheck">包含下级</mat-checkbox>
</div>
<div class="queryField">
<label style="margin-right: 10px;">建筑类型:</label>
<mat-form-field>
<mat-select name="preparelevel" placeholder='请选择建筑类型'>
<mat-option *ngFor="let item of buildingType">{{item.name}}</mat-option>
</mat-select>
</mat-form-field>
<!-- <mat-checkbox style="margin-left: 6px;" [(ngModel)]="plcheck" name="plcheck">包含下级</mat-checkbox> -->
</div>
<div class="queryField">
<label style="margin-right: 10px;">选择支队:</label>
<mat-form-field>
<mat-select name="preparelevel" [(ngModel)]="preparelevel" placeholder='请选择支队'>
<mat-option *ngFor="let item of tableDataZhi">{{item.name}}</mat-option>
</mat-select>
</mat-form-field>
<!-- <mat-checkbox style="margin-left: 6px;" [(ngModel)]="plcheck" name="plcheck">包含下级</mat-checkbox> -->
</div>
<div class="queryField">
<label style="margin-right: 10px;">信息完整度排序:</label>
<mat-form-field>
<mat-select placeholder='请选择排序方式' [(ngModel)]="integritySort" name="integritySort">
<mat-option value="desc">从高到低</mat-option>
<mat-option value="asc">从低到高</mat-option>
</mat-select>
</mat-form-field>
</div>
</div>
<div style="width: 100%;text-align: center;">
<button mat-raised-button color="primary" type="submit">查询</button>
<button mat-raised-button style="margin-left: 25px;" type="button" (click)="reset()">重置</button>
</div>
</form>
</div>
</form>
</div>
<mat-divider></mat-divider>
<div class="body">
<div class="tablebox">
<table mat-table [dataSource]="tabledataSource" class="mat-elevation-z8">
<ng-container matColumnDef="unitname">
<th mat-header-cell *matHeaderCellDef>单位名称</th>
<td mat-cell *matCellDef="let element">{{element.company.name}}</td>
</ng-container>
<!-- <ng-container matColumnDef="integrity">
<th mat-header-cell *matHeaderCellDef>完整度得分</th>
<td mat-cell *matCellDef="let element;let i = index">
<div class="integrityDiv">
<span class="integrityNum">
{{i*10}}分
</span>
<div class="integrityColorDiv" [style]="integrity(i)">
</div>
<div class="integrityDetails" [ngClass]="{'bottomposition': i <= 5,'topposition': i > 5}">
<div class="integrityDetailsTop">
<span class="span1">分类名称</span>
<span class="span2">已得分</span>
<span class="span3">总分</span>
</div>
<div class="integrityDetailsBody">
<ul>
<li>
<div class="name">单位信息</div>
<div class="colorDiv">
<div class="colorDivBac">
<div class="colorDivCon" [style]="integrityDetails(8,10)"></div>
</div>
<span>8分</span>
</div>
<div class="number">10分</div>
</li>
<li>
<div class="name">建筑信息</div>
<div class="colorDiv">
<div class="colorDivBac">
<div class="colorDivCon" [style]="integrityDetails(8,10)"></div>
</div>
<span>8分</span>
</div>
<div class="number">10分</div>
</li>
<li>
<div class="name">平面图</div>
<div class="colorDiv">
<div class="colorDivBac">
<div class="colorDivCon" [style]="integrityDetails(8,10)"></div>
</div>
<span>8分</span>
</div>
<div class="number">10分</div>
</li>
<li>
<div class="name">四周毗邻</div>
<div class="colorDiv">
<div class="colorDivBac">
<div class="colorDivCon" [style]="integrityDetails(8,10)"></div>
</div>
<span>8分</span>
</div>
<div class="number">10分</div>
</li>
<li>
<div class="name">消防设施</div>
<div class="colorDiv">
<div class="colorDivBac">
<div class="colorDivCon" [style]="integrityDetails(8,10)"></div>
</div>
<span>8分</span>
</div>
<div class="number">10分</div>
</li>
<li>
<div class="name">重点部位</div>
<div class="colorDiv">
<div class="colorDivBac">
<div class="colorDivCon" [style]="integrityDetails(8,10)"></div>
</div>
<span>8分</span>
</div>
<div class="number">10分</div>
</li>
<li>
<div class="name">功能分区</div>
<div class="colorDiv">
<div class="colorDivBac">
<div class="colorDivCon" [style]="integrityDetails(8,10)"></div>
</div>
<span>8分</span>
</div>
<div class="number">10分</div>
</li>
<li>
<div class="name">实景图</div>
<div class="colorDiv">
<div class="colorDivBac">
<div class="colorDivCon" [style]="integrityDetails(8,10)"></div>
</div>
<span>8分</span>
</div>
<div class="number">10分</div>
</li>
<li>
<div class="name">CAD上传</div>
<div class="colorDiv">
<div class="colorDivBac">
<div class="colorDivCon" [style]="integrityDetails(8,10)"></div>
</div>
<span>8分</span>
</div>
<div class="number">10分</div>
</li>
</ul>
</div>
<div style="width: 100%;text-align: center;font-size: 13px;">
仅供参考
</div>
</div>
</div>
</td>
</ng-container> -->
<ng-container matColumnDef="jurisdictionsquadron">
<th mat-header-cell *matHeaderCellDef>消防救援站</th>
<td mat-cell *matCellDef="let element">{{element.company.organizationName}}</td>
</ng-container>
<ng-container matColumnDef="unittype">
<th mat-header-cell *matHeaderCellDef>单位类型</th>
<td mat-cell *matCellDef="let element">{{element.company.buildingTypes[0] ? element.company.buildingTypes[0].name : ''}}</td>
</ng-container>
<ng-container matColumnDef="plantype">
<th mat-header-cell *matHeaderCellDef>预案类型</th>
<td mat-cell *matCellDef="let element">{{element.planType}}</td>
</ng-container>
<ng-container matColumnDef="passstate">
<th mat-header-cell *matHeaderCellDef>审核状态</th>
<td mat-cell *matCellDef="let element">{{element.auditStatus}}</td>
</ng-container>
<ng-container matColumnDef="projectlevel">
<th mat-header-cell *matHeaderCellDef>编制级别</th>
<td mat-cell *matCellDef="let element">{{element.planLevel}}</td>
</ng-container>
<ng-container matColumnDef="operation">
<th mat-header-cell *matHeaderCellDef>操作</th>
<td mat-cell *matCellDef="let element">
<span (click)="routerTo(element)" style="color: blue;">查看预案</span>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
<mat-paginator pageEvent [length]="length"
[pageSize]="pageSize"
[pageSizeOptions]="pageSizeOptions"
(page)="chagePage($event)"
>
</mat-paginator>
<mat-divider></mat-divider>
<div class="body">
<div class="tablebox">
<table mat-table [dataSource]="tabledataSource" class="mat-elevation-z8">
<ng-container matColumnDef="unitname">
<th mat-header-cell *matHeaderCellDef>单位名称</th>
<td mat-cell *matCellDef="let element">{{element.company.name}}</td>
</ng-container>
<ng-container matColumnDef="integrity">
<th mat-header-cell *matHeaderCellDef style="text-align: center;">信息完整度得分</th>
<td mat-cell *matCellDef="let element;let i = index">
<div class="integrityDiv">
<span class="integrityNum">
{{(element.company.companyIntegrityScore.totalScore.toFixed(2) * 100).toFixed()}}分
</span>
<div class="integrityColorDiv" [style]="integrity((element.company.companyIntegrityScore.totalScore.toFixed(2) * 100).toFixed())">
</div>
<div class="integrityDetails" [ngClass]="{'bottomposition': i <= 5,'topposition': i > 5}">
<div class="integrityDetailsTop">
<span class="span1">分类名称</span>
<span class="span2">已得分</span>
<span class="span3">总分</span>
</div>
<div class="integrityDetailsBody">
<ul>
<li>
<div class="name">单位信息</div>
<div class="colorDiv">
<div class="colorDivBac">
<div class="colorDivCon" [style]="integrityDetails((element.company.companyIntegrityScore.basicInfoScore * 5).toFixed(1),5)"></div>
</div>
<span>{{(element.company.companyIntegrityScore.basicInfoScore * 5).toFixed(1)}}分</span>
</div>
<div class="number">5分</div>
</li>
<li>
<div class="name">建筑信息</div>
<div class="colorDiv">
<div class="colorDivBac">
<div class="colorDivCon" [style]="integrityDetails((element.company.companyIntegrityScore.buildingInfoScore * 10).toFixed(1),10)"></div>
</div>
<span>{{(element.company.companyIntegrityScore.buildingInfoScore * 10).toFixed(1)}}分</span>
</div>
<div class="number">10分</div>
</li>
<li>
<div class="name">平面图</div>
<div class="colorDiv">
<div class="colorDivBac">
<div class="colorDivCon" [style]="integrityDetails((element.company.companyIntegrityScore.planImageScore * 10).toFixed(1),10)"></div>
</div>
<span>{{(element.company.companyIntegrityScore.planImageScore * 10).toFixed(1)}}分</span>
</div>
<div class="number">10分</div>
</li>
<li>
<div class="name">四周毗邻</div>
<div class="colorDiv">
<div class="colorDivBac">
<div class="colorDivCon" [style]="integrityDetails((element.company.companyIntegrityScore.adjoinScore * 10).toFixed(1),10)"></div>
</div>
<span>{{(element.company.companyIntegrityScore.adjoinScore * 10).toFixed(1)}}分</span>
</div>
<div class="number">10分</div>
</li>
<li>
<div class="name">消防设施</div>
<div class="colorDiv">
<div class="colorDivBac">
<div class="colorDivCon" [style]="integrityDetails((element.company.companyIntegrityScore.facilityScore * 25).toFixed(1),25)"></div>
</div>
<span>{{(element.company.companyIntegrityScore.facilityScore * 25).toFixed(1)}}分</span>
</div>
<div class="number">25分</div>
</li>
<li>
<div class="name">重点部位</div>
<div class="colorDiv">
<div class="colorDivBac">
<div class="colorDivCon" [style]="integrityDetails((element.company.companyIntegrityScore.importantLocationScore * 10).toFixed(1),10)"></div>
</div>
<span>{{(element.company.companyIntegrityScore.importantLocationScore * 10).toFixed(1)}}分</span>
</div>
<div class="number">10分</div>
</li>
<li>
<div class="name">功能分区</div>
<div class="colorDiv">
<div class="colorDivBac">
<div class="colorDivCon" [style]="integrityDetails((element.company.companyIntegrityScore.functionalDivisionScore * 10).toFixed(1),10)"></div>
</div>
<span>{{(element.company.companyIntegrityScore.functionalDivisionScore * 10).toFixed(1)}}分</span>
</div>
<div class="number">10分</div>
</li>
<li>
<div class="name">实景图</div>
<div class="colorDiv">
<div class="colorDivBac">
<div class="colorDivCon" [style]="integrityDetails((element.company.companyIntegrityScore.realityImageScore * 10).toFixed(1),10)"></div>
</div>
<span>{{(element.company.companyIntegrityScore.realityImageScore * 10).toFixed(1)}}分</span>
</div>
<div class="number">10分</div>
</li>
<li>
<div class="name">CAD上传</div>
<div class="colorDiv">
<div class="colorDivBac">
<div class="colorDivCon" [style]="integrityDetails((element.company.companyIntegrityScore.cadScore * 10).toFixed(1),10)"></div>
</div>
<span>{{(element.company.companyIntegrityScore.cadScore * 10).toFixed(1)}}分</span>
</div>
<div class="number">10分</div>
</li>
</ul>
</div>
<div style="width: 100%;text-align: center;font-size: 13px;">
仅供参考
</div>
</div>
</div>
</td>
</ng-container>
<ng-container matColumnDef="jurisdictionsquadron">
<th mat-header-cell *matHeaderCellDef>消防救援站</th>
<td mat-cell *matCellDef="let element">{{element.company.organizationName}}</td>
</ng-container>
<ng-container matColumnDef="unittype">
<th mat-header-cell *matHeaderCellDef>单位类型</th>
<td mat-cell *matCellDef="let element">{{element.company.buildingTypes[0] ? element.company.buildingTypes[0].name : ''}}</td>
</ng-container>
<ng-container matColumnDef="plantype">
<th mat-header-cell *matHeaderCellDef>预案类型</th>
<td mat-cell *matCellDef="let element">{{element.planType}}</td>
</ng-container>
<ng-container matColumnDef="passstate">
<th mat-header-cell *matHeaderCellDef>审核状态</th>
<td mat-cell *matCellDef="let element">{{element.auditStatus}}</td>
</ng-container>
<ng-container matColumnDef="projectlevel">
<th mat-header-cell *matHeaderCellDef>编制级别</th>
<td mat-cell *matCellDef="let element">{{element.planLevel}}</td>
</ng-container>
<ng-container matColumnDef="operation">
<th mat-header-cell *matHeaderCellDef>操作</th>
<td mat-cell *matCellDef="let element">
<span (click)="routerTo(element)" style="color: blue;">查看预案</span>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
<mat-paginator pageEvent [length]="length"
[pageSize]="pageSize"
[pageSizeOptions]="pageSizeOptions"
(page)="chagePage($event)"
>
</mat-paginator>
</div>
</div>
</div>
</div>

25
src/app/plan-management/entry-plan/entry-plan.component.scss

@ -87,7 +87,18 @@
mat-paginator{
width: 100%;
margin-left: 0%;
// margin-top: 30px;
}
.mat-column-unitname{
width: 15%;
}
.mat-column-integrity{
width: 13%;
}
.mat-column-operation{
width: 5%;
}
.mat-column-jurisdictionsquadron{
width: 10%;
}
}
}
@ -98,8 +109,8 @@
.mat-cell{
text-align: center;
span{
color:red;
margin: 0 3px;
// color:red;
// margin: 0 3px;
cursor: pointer;
}
span:hover{
@ -113,9 +124,10 @@
//完整度
.integrityDiv{
width: 180px;
width: 70%;
height: 30px;
background-color: #e2e7ee;
// background-image: linear-gradient(to right, #e2e7ee ,#FF4500, #FF8C00,#32cd32);
margin: 0 auto;
position: relative;
.integrityNum{
@ -130,7 +142,6 @@
}
.integrityColorDiv{
height: 100%;
// background-color: #32cd32;
}
.integrityDetails{
position: absolute;
@ -150,8 +161,6 @@
display: inline-block;
text-align: center;
font-weight: 800;
margin: 0;
color: black;
}
.span1{
width: 25%;
@ -202,7 +211,7 @@
left: 50%;
top: 50%;
transform: translate(-50%,-50%);
color: black;
// color: white;
font-weight: 600;
}
}

116
src/app/plan-management/entry-plan/entry-plan.component.ts

@ -86,24 +86,120 @@ export class EntryPlanComponent implements OnInit {
]
displayedColumns: string[] = ['unitname', 'jurisdictionsquadron', 'unittype','plantype', 'passstate','projectlevel','operation'];
displayedColumns: string[] = ['unitname','integrity','jurisdictionsquadron', 'unittype','plantype', 'passstate','projectlevel','operation'];
allorganizations:any //所有组织机构
allunittype:any //所有单位类型
tabledataSource:any //表格数据
organizationName:any //当前单位组织机构名称
preparelevels:any
integritySort:any //完整度排序
colorRgb(sColor){
var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
var sColor = sColor.toLowerCase();
if (sColor && reg.test(sColor)) {
if (sColor.length === 4) {
var sColorNew = "#";
for (var i = 1; i < 4; i += 1) {
sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1));
}
sColor = sColorNew;
}
//处理六位的颜色值
var sColorChange = [];
for (var i = 1; i < 7; i += 2) {
sColorChange.push(parseInt("0x" + sColor.slice(i, i + 2)));
}
return sColorChange;
} else {
return sColor;
}
}
colorHex(rgb){
var _this = rgb;
var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
if (/^(rgb|RGB)/.test(_this)) {
var aColor = _this.replace(/(?:(|)|rgb|RGB)*/g, "").split(",");
var strHex = "#";
for (var i = 0; i < aColor.length; i++) {
var hex:any = Number(aColor[i]).toString(16);
hex = hex < 10 ? 0 + '' + hex : hex;// 保证每个rgb的值为2位
if (hex === "0") {
hex += hex;
}
strHex += hex;
}
if (strHex.length !== 7) {
strHex = _this;
}
return strHex;
} else if (reg.test(_this)) {
var aNum = _this.replace(/#/, "").split("");
if (aNum.length === 6) {
return _this;
} else if (aNum.length === 3) {
var numHex = "#";
for (var i = 0; i < aNum.length; i += 1) {
numHex += (aNum[i] + aNum[i]);
}
return numHex;
}
} else {
return _this;
}
}
gradientColor(startColor, endColor, step) {
let _this = this
let startRGB = _this.colorRgb(startColor);//转换为rgb数组模式
let startR = startRGB[0];
let startG = startRGB[1];
let startB = startRGB[2];
let endRGB = _this.colorRgb(endColor);
let endR = endRGB[0];
let endG = endRGB[1];
let endB = endRGB[2];
let sR = (endR - startR) / step;//总差值
let sG = (endG - startG) / step;
let sB = (endB - startB) / step;
var colorArr = [];
for (var i = 0; i < step; i++) {
//计算每一步的hex值
var hex = _this.colorHex('rgb('+ parseInt((sR * i + startR))+ ',' + parseInt((sG * i + startG))+ ',' + parseInt((sB * i + startB)) + ')');
colorArr.push(hex);
}
return colorArr;
}
integrity(width){
let _this = this
let style:any = {}
style.width = width*10 +'%';
if(width < 4){
style.background = "#FF4500";
style.width = width +'%';
if(width < 30){
let colorArr = this.gradientColor('#D50000', '#E53935', 30);
for(let i = 0; i < 30; i++){
if( i == width){
style.background = colorArr[i]
}
}
}
if(width >= 4 && width <7){
style.background = "#FF8C00";
if(width >= 30 && width < 60){
let colorArr = this.gradientColor('#FF9800', '#E65100', 30);
for(let i = 30; i < 60; i++){
if( i == width){
style.background = colorArr[i-30]
}
}
}
if(width >= 7){
style.background = "#32cd32";
if(width >= 60){
let colorArr = this.gradientColor('#81C784', '#2E7D32', 41);
for(let i = 60; i <= 100; i++){
if( i == width){
style.background = colorArr[i-60]
}
}
}
return style
}
@ -243,7 +339,8 @@ export class EntryPlanComponent implements OnInit {
HasChildrenPlanLevel: this.plcheck || '',
PageNumber: this.PageNumber || '1',
PageSize: this.pageSizeOptions[0],
Sort: ''
Sort: this.integritySort ? 'integrityscore' : '',
SortType: this.integritySort || '',
}
this.http.get("/api/Plans",{params:paramsdata}).subscribe((data:any)=>{
@ -287,6 +384,7 @@ export class EntryPlanComponent implements OnInit {
this.reservePlanType = ''
this.toExamine = ''
this.preparelevel = ''
this.integritySort = ''
this.plcheck = false
//重新获取初始化列表
// console.log(this.pageEvent)

250
src/app/tabbar/tabbar.component.html

@ -3,30 +3,107 @@
<h1>{{title}} <span *ngIf="planName != null">: {{planName}}</span> </h1>
<!--分数框-->
<div class="grade" *ngIf="grade" onmouseover="xiangqing.style.display='block';" onmouseout="xiangqing.style.display='none';">
<a class="active"><span ><a></a>{{grade}} 分</span></a>
<div class="grade" *ngIf="companyIntegrityScore" onmouseover="xiangqing.style.display='block';" onmouseout="xiangqing.style.display='none';">
<a class="active"><span ><a></a>{{(companyIntegrityScore.totalScore.toFixed(2) * 100).toFixed()}} 分</span></a>
</div>
<!-- <div class="uploadFile">
<a href="http://139.9.106.124:8088/ExaminationLauncher.zip"><span>指挥员指挥能力考评系统(练习版)</span></a>
</div> -->
<!--详情框 -->
<div class="integrityDetails" id="xiangqing">
<div class="integrityDetails" id="xiangqing" *ngIf="companyIntegrityScore">
<div class="integrityDetailsTop">
<span class="span1">分类名称</span>
<span class="span2">已得分</span>
<span class="span3">总分</span>
</div>
<div class="integrityDetailsBody">
<ul>
<li *ngFor="let item of integrityData">
<div class="name">{{item.name}}</div>
<ul>
<li>
<div class="name">单位信息</div>
<div class="colorDiv">
<div class="colorDivBac">
<div class="colorDivCon" [style]="integrityDetails((companyIntegrityScore.basicInfoScore * 5).toFixed(1),5)"></div>
</div>
<span>{{(companyIntegrityScore.basicInfoScore * 5).toFixed(1)}}分</span>
</div>
<div class="number">5分</div>
</li>
<li>
<div class="name">建筑信息</div>
<div class="colorDiv">
<div class="colorDivBac">
<div class="colorDivCon" [style]="integrityDetails((companyIntegrityScore.buildingInfoScore * 10).toFixed(1),10)"></div>
</div>
<span>{{(companyIntegrityScore.buildingInfoScore * 10).toFixed(1)}}分</span>
</div>
<div class="number">10分</div>
</li>
<li>
<div class="name">平面图</div>
<div class="colorDiv">
<div class="colorDivBac">
<div class="colorDivCon" [style]="integrityDetails((companyIntegrityScore.planImageScore * 10).toFixed(1),10)"></div>
</div>
<span>{{(companyIntegrityScore.planImageScore * 10).toFixed(1)}}分</span>
</div>
<div class="number">10分</div>
</li>
<li>
<div class="name">四周毗邻</div>
<div class="colorDiv">
<div class="colorDivBac">
<div class="colorDivCon" [style]="integrityDetails((companyIntegrityScore.adjoinScore * 10).toFixed(1),10)"></div>
</div>
<span>{{(companyIntegrityScore.adjoinScore * 10).toFixed(1)}}分</span>
</div>
<div class="number">10分</div>
</li>
<li>
<div class="name">消防设施</div>
<div class="colorDiv">
<div class="colorDivBac">
<div class="colorDivCon" [style]="integrityDetails(item.score,item.totalpoints)"></div>
<div class="colorDivCon" [style]="integrityDetails((companyIntegrityScore.facilityScore * 25).toFixed(1),25)"></div>
</div>
<span>{{item.score}}分</span>
<span>{{(companyIntegrityScore.facilityScore * 25).toFixed(1)}}分</span>
</div>
<div class="number">{{item.totalpoints}}分</div>
<div class="number">25分</div>
</li>
<li>
<div class="name">重点部位</div>
<div class="colorDiv">
<div class="colorDivBac">
<div class="colorDivCon" [style]="integrityDetails((companyIntegrityScore.importantLocationScore * 10).toFixed(1),10)"></div>
</div>
<span>{{(companyIntegrityScore.importantLocationScore * 10).toFixed(1)}}分</span>
</div>
<div class="number">10分</div>
</li>
<li>
<div class="name">功能分区</div>
<div class="colorDiv">
<div class="colorDivBac">
<div class="colorDivCon" [style]="integrityDetails((companyIntegrityScore.functionalDivisionScore * 10).toFixed(1),10)"></div>
</div>
<span>{{(companyIntegrityScore.functionalDivisionScore * 10).toFixed(1)}}分</span>
</div>
<div class="number">10分</div>
</li>
<li>
<div class="name">实景图</div>
<div class="colorDiv">
<div class="colorDivBac">
<div class="colorDivCon" [style]="integrityDetails((companyIntegrityScore.realityImageScore * 10).toFixed(1),10)"></div>
</div>
<span>{{(companyIntegrityScore.realityImageScore * 10).toFixed(1)}}分</span>
</div>
<div class="number">10分</div>
</li>
<li>
<div class="name">CAD上传</div>
<div class="colorDiv">
<div class="colorDivBac">
<div class="colorDivCon" [style]="integrityDetails((companyIntegrityScore.cadScore * 10).toFixed(1),10)"></div>
</div>
<span>{{(companyIntegrityScore.cadScore * 10).toFixed(1)}}分</span>
</div>
<div class="number">10分</div>
</li>
</ul>
</div>
@ -34,81 +111,82 @@
仅供参考
</div>
</div>
<p style="font-size: 16px;position: absolute; right: 170px;">欢迎您, {{realName}}</p>
<div class="scoringRule" *ngIf="grade">
<span class="name" (click)="scoringRule()">
计分规则
</span>
<div class="scoringRuleImg" *ngIf="scoringRuleImg">
<div class="topbox">
<span style="font-size: 18px;margin-left: 20px;font-weight: 600;">计分规则 &nbsp;</span>
<span style="font-size: 12px;">单位基本信息部分共计100分</span>
<span class="imgbox">
<img src="../../assets/images/ruletopimg.png" alt="">
</span>
<span class="close" (click)="closebtn()">
<mat-icon>clear</mat-icon>
</span>
</div>
<div class="tablebox">
<table>
<tr>
<td>名称</td>
<td>分值</td>
<td>规则说明</td>
</tr>
<tr>
<td>单位名称</td>
<td class="bulecolor">5</td>
<td>按填录入内容评判</td>
</tr>
<tr>
<td>建筑信息</td>
<td class="bulecolor">10</td>
<td>根据创建的建筑个数平分该分值,每个建筑根据实际填写的完整度再进行评判</td>
</tr>
<tr>
<td>四周毗邻</td>
<td class="bulecolor">10</td>
<td><span class="bulecolor">4</span>个方向均分,每个方向的属性信息要填写完整才能得分</td>
</tr>
<tr>
<td>消防设施</td>
<td class="bulecolor">25</td>
<td>消防水源占<span class="bulecolor">30%</span> &nbsp;&nbsp;&nbsp; 安全疏散占<span class="bulecolor">30%</span> <br> 消防水系统占<span class="bulecolor">30%</span> &nbsp;&nbsp;&nbsp; 内部消防力量占<span class="bulecolor">10%</span></td>
</tr>
<tr>
<td>重点部位</td>
<td class="bulecolor">10</td>
<td><span>根据耐火等级做区分</span>:一级:添加<span class="bulecolor">3</span>个重点部位(1个50%,2个80%,3个满分)<span class="bulecolor">二级</span>:添加<span class="bulecolor">2</span>个重点部位(一个占50%)<span class="bulecolor">三级</span> 添加<span class="bulecolor">1</span>个重点部位 其它:填写重点提示自动满分</td>
</tr>
<tr>
<td>功能分区</td>
<td class="bulecolor">10</td>
<td>创建<span class="bulecolor">2</span>条并填写完整得满分</td>
</tr>
<tr>
<td>实景图</td>
<td class="bulecolor">10</td>
<td>外观,保证有<span class="bulecolor">2</span>张照片(占<span class="bulecolor">30%</span>); 室内,保证有<span class="bulecolor">2</span>张照片(占<span class="bulecolor">30%</span>);安全出口,保证有<span class="bulecolor">2</span>张照片(占<span class="bulecolor">40%</span></td>
</tr>
<tr>
<td>CAD上传</td>
<td class="bulecolor">10</td>
<td>上传<span class="bulecolor">2</span>个cad文件</td>
</tr>
<tr>
<td>平面图</td>
<td class="bulecolor">10</td>
<td>总平面图<span class="bulecolor">1</span>张,建筑平面图<span class="bulecolor">1</span></td>
</tr>
</table>
</div>
</div>
<div class="scoringRule" *ngIf="companyIntegrityScore">
<span class="name" (click)="scoringRule()">
计分规则
</span>
<div class="scoringRuleImg" *ngIf="scoringRuleImg">
<div class="topbox">
<span style="font-size: 18px;margin-left: 20px;font-weight: 600;">计分规则 &nbsp;</span>
<span style="font-size: 12px;">单位基本信息部分共计100分</span>
<span class="imgbox">
<img src="../../assets/images/ruletopimg.png" alt="">
</span>
<span class="close" (click)="closebtn()">
<mat-icon>clear</mat-icon>
</span>
</div>
<div class="tablebox">
<table>
<tr>
<td>名称</td>
<td>分值</td>
<td>规则说明</td>
</tr>
<tr>
<td>单位名称</td>
<td class="bulecolor">5</td>
<td>按填录入内容评判</td>
</tr>
<tr>
<td>建筑信息</td>
<td class="bulecolor">10</td>
<td>根据创建的建筑个数平分该分值,每个建筑根据实际填写的完整度再进行评判</td>
</tr>
<tr>
<td>四周毗邻</td>
<td class="bulecolor">10</td>
<td><span class="bulecolor">4</span>个方向均分,每个方向的属性信息要填写完整才能得分</td>
</tr>
<tr>
<td>消防设施</td>
<td class="bulecolor">25</td>
<td>消防水源占<span class="bulecolor">30%</span> &nbsp;&nbsp;&nbsp; 安全疏散占<span class="bulecolor">30%</span> <br> 消防水系统占<span class="bulecolor">30%</span> &nbsp;&nbsp;&nbsp; 内部消防力量占<span class="bulecolor">10%</span></td>
</tr>
<tr>
<td>重点部位</td>
<td class="bulecolor">10</td>
<td><span>根据耐火等级做区分</span>:一级:添加<span class="bulecolor">3</span>个重点部位(1个50%,2个80%,3个满分)<span class="bulecolor">二级</span>:添加<span class="bulecolor">2</span>个重点部位(一个占50%)<span class="bulecolor">三级</span> 添加<span class="bulecolor">1</span>个重点部位 其它:填写重点提示自动满分</td>
</tr>
<tr>
<td>功能分区</td>
<td class="bulecolor">10</td>
<td>创建<span class="bulecolor">2</span>条并填写完整得满分</td>
</tr>
<tr>
<td>实景图</td>
<td class="bulecolor">10</td>
<td>外观,保证有<span class="bulecolor">2</span>张照片(占<span class="bulecolor">30%</span>); 室内,保证有<span class="bulecolor">2</span>张照片(占<span class="bulecolor">30%</span>);安全出口,保证有<span class="bulecolor">2</span>张照片(占<span class="bulecolor">40%</span></td>
</tr>
<tr>
<td>CAD上传</td>
<td class="bulecolor">10</td>
<td>上传<span class="bulecolor">2</span>个cad文件</td>
</tr>
<tr>
<td>平面图</td>
<td class="bulecolor">10</td>
<td>总平面图<span class="bulecolor">1</span>张,建筑平面图<span class="bulecolor">1</span></td>
</tr>
</table>
</div>
</div>
</div>
<!-- 全屏 -->
<button mat-button (click)="!isfullscreen?fullscreenToggle():closefullscreen()" class="fullscreen">
<ng-container *ngIf="!isfullscreen; else elseTemplate">
@ -133,7 +211,7 @@
</button>
<mat-menu #appMenu="matMenu">
<button mat-menu-item [routerLink]="['/ui/userdata']" >
<mat-icon>perm_identity</mat-icon>
<mat-icon>pin_drop</mat-icon>
<span>个人资料</span>
</button>
<button mat-menu-item (click)='changpsw()'>

2
src/app/tabbar/tabbar.component.scss

@ -165,8 +165,6 @@ mat-icon{
}
}
//计分规则按钮
.scoringRule{
user-select: none;

40
src/app/tabbar/tabbar.component.ts

@ -6,6 +6,7 @@ import { MatDialog } from '@angular/material/dialog';
import {ChangepasswordComponent} from '../ui/changepassword/changepassword.component'
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
import { filter } from 'rxjs/operators';
import { TabbarAndScoreService } from '../http-interceptors/tabbar-and-score.service';
@Component({
@ -28,7 +29,7 @@ export class TabbarComponent implements OnInit {
this.toggleDarkTheme.emit(eventValue);
}
constructor(private http:HttpClient,private router:Router,private route:ActivatedRoute,public token:CacheTokenService,public dialog: MatDialog,
constructor(private tabbarService: TabbarAndScoreService,private http:HttpClient,private router:Router,private route:ActivatedRoute,public token:CacheTokenService,public dialog: MatDialog,
public snackBar: MatSnackBar) { }
grade = null //单位完整度得分
@ -38,27 +39,47 @@ export class TabbarComponent implements OnInit {
integrityData:any
companyIntegrityScore:any
ngOnInit() {
this.routerEventsListener = this.router.events.pipe(
filter(event => event instanceof NavigationEnd)
).subscribe((e) => {
this.title = "数字化预案编制管理平台"
this.planName = null
this.grade = null
});
this.getUserInfo()
if(this.router.url.indexOf("editunitinfo") == -1 || this.router.url.indexOf("viewunitinfoplan") == -1){//如果url地址是从录入预案跳转
this.companyIntegrityScore = ''
}
})
if(this.router.url.indexOf("editunitinfo") != -1 || this.router.url.indexOf("viewunitinfoplan") != -1){//如果url地址是从录入预案跳转
this.title = sessionStorage.getItem("companyName")
this.planName = sessionStorage.getItem("planName")
}
if(this.router.url.indexOf("editplaninfo") != -1 || this.router.url.indexOf("viewunitinfo") != -1){//如果url地址是从重点单位跳转
if(this.router.url.indexOf("editplaninfo") != -1 || (this.router.url.indexOf("viewunitinfo") != -1 && this.router.url.indexOf("viewunitinfoplan") == -1)){//如果url地址是从重点单位跳转
this.title = sessionStorage.getItem("companyName")
let obj = JSON.parse(sessionStorage.getItem(this.route.snapshot.queryParams.id))
this.grade = obj.zong
this.integrityData = obj.details
// let obj = JSON.parse(sessionStorage.getItem(this.route.snapshot.queryParams.id))
// this.companyIntegrityScore = obj
this.getIntegrityScore()
this.tabbarService.getMessage().subscribe((message: any)=>{
console.log(789,message);//send a message
this.getIntegrityScore()
});
}
this.getUserInfo()
}
//根据usci获取当前单位的分数信息
getIntegrityScore(){
let params:any = {
USCI : this.route.snapshot.queryParams.usci
}
this.http.get('/api/Companies',{params:params}).subscribe((data:any) => {
this.companyIntegrityScore = data.items[0].companyIntegrityScore
// console.log(data)
})
}
ngOnDestroy(){
@ -72,7 +93,6 @@ export class TabbarComponent implements OnInit {
return style
}
//计分规则
scoringRuleImg:boolean = false
scoringRule(){
this.scoringRuleImg = !this.scoringRuleImg

Loading…
Cancel
Save