邵佳豪
1 year ago
13 changed files with 7491 additions and 5012 deletions
@ -1,6 +1,8 @@
|
||||
{ |
||||
"/api": { |
||||
"target": "http://183.194.244.232:8088/", |
||||
"target": "http://121.36.37.70:8207/", |
||||
"测试": "http://121.36.37.70:8207/", |
||||
"生产": "http://183.194.244.232:8088/", |
||||
"secure": false, |
||||
"changeOrigin": true |
||||
} |
||||
|
@ -0,0 +1,21 @@
|
||||
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(); |
||||
} |
||||
} |
@ -1,35 +1,239 @@
|
||||
<mat-toolbar [color]="'primary'"> |
||||
<!-- <mat-toolbar> --> |
||||
<h1 *ngIf="companyName">{{companyName}}</h1> |
||||
<!-- <mat-toolbar> --> |
||||
<h1 *ngIf="companyName">{{companyName}}</h1> |
||||
<!--分数框--> |
||||
<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="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> |
||||
<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((companyIntegrityScore.facilityScore * 25).toFixed(1),25)"> |
||||
</div> |
||||
</div> |
||||
<span>{{(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((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> |
||||
<div style="width: 100%;text-align: center;font-size: 13px;position: relative;"> |
||||
仅供参考 |
||||
<span class="closeScore" style="position: absolute;right: 12px;top: 0px;" |
||||
onmouseover="xiangqing.style.display='none';">关闭</span> |
||||
</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;">信息完整度规则 </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">1</span>张,层平面图<span class="bulecolor">1</span>张</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> 安全疏散设施/消防泡沫系统/安全疏散模块占<span |
||||
class="bulecolor">30%</span> <br> 消防水系统/自动消防设施/消防设施/消防灭火给水系统/消火栓系统模块占<span class="bulecolor">30%</span> |
||||
内部消防力量占<span class="bulecolor">10%</span></td> |
||||
</tr> |
||||
<tr> |
||||
<td>重点部位</td> |
||||
<td class="bulecolor">10%</td> |
||||
<td>层平面图中重点部位数量大于1个,并且属性信息填写完整(包含图片)</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">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">1</span>个文件,格式不限</td> |
||||
</tr> |
||||
|
||||
<!-- 帮助文档按钮 --> |
||||
<button mat-icon-button [matMenuTriggerFor]="appSet" class="help" title="帮助"> |
||||
<mat-icon>help</mat-icon> |
||||
</table> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<!-- 帮助文档按钮 --> |
||||
<button mat-icon-button [matMenuTriggerFor]="appSet" class="help" title="帮助"> |
||||
<mat-icon>help</mat-icon> |
||||
</button> |
||||
<mat-menu #appSet="matMenu" yPosition="below" xPosition="after"> |
||||
<button mat-menu-item (click)='downloadHelpFile()'> |
||||
<mat-icon>save_alt</mat-icon> |
||||
<span>下载帮助文档</span> |
||||
</button> |
||||
<mat-menu #appSet="matMenu" yPosition="below" xPosition="after"> |
||||
<button mat-menu-item (click)='downloadHelpFile()'> |
||||
<mat-icon>save_alt</mat-icon> |
||||
<span>下载帮助文档</span> |
||||
</button> |
||||
</mat-menu> |
||||
</mat-menu> |
||||
|
||||
<!-- 登录信息按钮 --> |
||||
<button mat-icon-button [matMenuTriggerFor]="appMenu" class="login"> |
||||
<mat-icon>account_circle</mat-icon> |
||||
<!-- 登录信息按钮 --> |
||||
<button mat-icon-button [matMenuTriggerFor]="appMenu" class="login"> |
||||
<mat-icon>account_circle</mat-icon> |
||||
</button> |
||||
<mat-menu #appMenu="matMenu"> |
||||
<button mat-menu-item [routerLink]="['/datacollection/userdata']"> |
||||
<mat-icon>perm_identity</mat-icon> |
||||
<span>个人资料</span> |
||||
</button> |
||||
<button mat-menu-item (click)='changpsw()'> |
||||
<mat-icon>verified_user</mat-icon> |
||||
<span>修改密码</span> |
||||
</button> |
||||
<button mat-menu-item (click)='signOut()'> |
||||
<mat-icon>power_settings_new</mat-icon> |
||||
<span>退出系统</span> |
||||
</button> |
||||
<mat-menu #appMenu="matMenu"> |
||||
<button mat-menu-item [routerLink]="['/datacollection/userdata']" > |
||||
<mat-icon>perm_identity</mat-icon> |
||||
<span>个人资料</span> |
||||
</button> |
||||
<button mat-menu-item (click)='changpsw()'> |
||||
<mat-icon>verified_user</mat-icon> |
||||
<span>修改密码</span> |
||||
</button> |
||||
<button mat-menu-item (click)='signOut()'> |
||||
<mat-icon>power_settings_new</mat-icon> |
||||
<span>退出系统</span> |
||||
</button> |
||||
</mat-menu> |
||||
</mat-menu> |
||||
|
||||
</mat-toolbar> |
@ -1,45 +1,315 @@
|
||||
mat-toolbar{ |
||||
position: relative; |
||||
padding-left: 65px; |
||||
mat-toolbar { |
||||
position: relative; |
||||
padding-left: 65px; |
||||
} |
||||
.logo{ |
||||
height: 64px; |
||||
widows: 64px; |
||||
|
||||
.logo { |
||||
height: 64px; |
||||
widows: 64px; |
||||
} |
||||
|
||||
h1{ |
||||
line-height: 64px; |
||||
color: white; |
||||
h1 { |
||||
line-height: 64px; |
||||
color: white; |
||||
} |
||||
mat-icon{ |
||||
color: white; |
||||
|
||||
mat-icon { |
||||
color: white; |
||||
} |
||||
.login{ |
||||
position: absolute; |
||||
right:30px; |
||||
|
||||
.login { |
||||
position: absolute; |
||||
right: 30px; |
||||
} |
||||
.fullscreen{ |
||||
position: absolute; |
||||
right:60px; |
||||
|
||||
.fullscreen { |
||||
position: absolute; |
||||
right: 60px; |
||||
} |
||||
|
||||
.help { |
||||
position: absolute; |
||||
right:90px; |
||||
position: absolute; |
||||
right: 90px; |
||||
} |
||||
.setting{ |
||||
position: absolute; |
||||
right:120px; |
||||
|
||||
.setting { |
||||
position: absolute; |
||||
right: 120px; |
||||
} |
||||
.lockscreen{ |
||||
position: absolute; |
||||
right:160px; |
||||
|
||||
.lockscreen { |
||||
position: absolute; |
||||
right: 160px; |
||||
} |
||||
.darktheme{ |
||||
position: absolute; |
||||
right:140px; |
||||
|
||||
.darktheme { |
||||
position: absolute; |
||||
right: 140px; |
||||
display: none; |
||||
} |
||||
|
||||
.boxed { |
||||
width: 1200px; |
||||
} |
||||
|
||||
.grade { |
||||
width: 120px; |
||||
height: 45px; |
||||
//border:1px solid #F00; |
||||
position: absolute; |
||||
text-align: center; |
||||
margin-left: 220px; |
||||
margin-top: 0px; |
||||
-webkit-transform: rotate(-10deg); |
||||
-moz-transform: rotate(-10deg); |
||||
transform: text; |
||||
|
||||
a { |
||||
box-sizing: border-box; |
||||
|
||||
display: inline-block; |
||||
color: #fff; |
||||
//padding: 12px 5px; |
||||
text-decoration: none; |
||||
cursor: pointer; |
||||
} |
||||
|
||||
span { |
||||
text-align: center; |
||||
font-size: 36px; |
||||
line-height: 45px; |
||||
font-family: "STXinwei"; |
||||
color: #FFA500; |
||||
cursor: default; |
||||
text-decoration: underline; |
||||
padding-bottom: 5px; |
||||
|
||||
} |
||||
|
||||
a.active>span, |
||||
a:hover>span { |
||||
//padding-bottom: 8px; |
||||
border-bottom: 3px solid #FFA500; |
||||
|
||||
} |
||||
} |
||||
|
||||
//鼠标移入详情页面显示 |
||||
.integrityDetails { |
||||
position: absolute; |
||||
z-index: 999; |
||||
color: black; |
||||
display: none; |
||||
width: 350px; |
||||
height: 290px; |
||||
left: 390px; |
||||
top: 30px; |
||||
border: 1px solid rgba(0, 0, 0, 0.22); |
||||
background-color: white; |
||||
|
||||
.integrityDetailsTop { |
||||
width: 100%; |
||||
height: 23px; |
||||
line-height: 23px; |
||||
border-bottom: 1px solid rgba(0, 0, 0, 0.22); |
||||
margin-bottom: 1px; |
||||
font-size: 14px; |
||||
|
||||
span { |
||||
display: inline-block; |
||||
text-align: center; |
||||
font-weight: 800; |
||||
} |
||||
|
||||
.span1 { |
||||
width: 25%; |
||||
} |
||||
|
||||
.span2 { |
||||
width: 60%; |
||||
} |
||||
|
||||
.span3 { |
||||
width: 15%; |
||||
} |
||||
} |
||||
|
||||
.integrityDetailsBody { |
||||
ul { |
||||
li { |
||||
width: 100%; |
||||
height: 23px; |
||||
line-height: 23px; |
||||
margin: 3px 15px; |
||||
|
||||
div { |
||||
float: left; |
||||
font-size: 13px; |
||||
} |
||||
|
||||
.name { |
||||
width: 25%; |
||||
height: 100%; |
||||
} |
||||
|
||||
.colorDiv { |
||||
width: 60%; |
||||
height: 100%; |
||||
position: relative; |
||||
|
||||
.colorDivBac { |
||||
width: 90%; |
||||
height: 100%; |
||||
position: absolute; |
||||
left: 50%; |
||||
top: 50%; |
||||
transform: translate(-50%, -50%); |
||||
background-color: #dfe5ec; |
||||
border-radius: 5px; |
||||
|
||||
.colorDivCon { |
||||
border-radius: 5px; |
||||
height: 100%; |
||||
background-color: #2398f1; |
||||
} |
||||
} |
||||
|
||||
span { |
||||
position: absolute; |
||||
left: 50%; |
||||
top: 50%; |
||||
transform: translate(-50%, -50%); |
||||
// color: white; |
||||
font-weight: 600; |
||||
} |
||||
} |
||||
|
||||
.number { |
||||
width: 15%; |
||||
height: 100%; |
||||
} |
||||
} |
||||
} |
||||
|
||||
} |
||||
|
||||
.closeScore { |
||||
display: none; |
||||
|
||||
} |
||||
|
||||
@media screen and (max-width:1400px) { |
||||
.closeScore { |
||||
display: block; |
||||
|
||||
} |
||||
} |
||||
} |
||||
|
||||
.boxed{ |
||||
width: 1200px; |
||||
} |
||||
//计分规则按钮 |
||||
.scoringRule, |
||||
.isUpdates { |
||||
position: absolute; |
||||
left: 440px; |
||||
cursor: pointer; |
||||
|
||||
.name { |
||||
background-color: #fff; |
||||
border-radius: 6px; |
||||
color: #2196F3; |
||||
display: inline-block; |
||||
width: 128px; |
||||
height: 36px; |
||||
text-align: center; |
||||
line-height: 36px; |
||||
font-size: 14px; |
||||
margin: 0; |
||||
padding: 0; |
||||
} |
||||
|
||||
.span { |
||||
font-size: 18px; |
||||
margin-left: 12px; |
||||
} |
||||
|
||||
.scoringRuleImg { |
||||
z-index: 999; |
||||
position: absolute; |
||||
left: 0; |
||||
top: 38px; |
||||
border: 1px solid #2196F3; |
||||
background-color: #fff; |
||||
|
||||
.topbox { |
||||
position: relative; |
||||
background-color: #2196F3; |
||||
height: 40px; |
||||
line-height: 40px; |
||||
font-size: 16px; |
||||
|
||||
.imgbox { |
||||
position: absolute; |
||||
right: 48px; |
||||
} |
||||
|
||||
.close { |
||||
position: absolute; |
||||
right: 8px; |
||||
top: 10px; |
||||
} |
||||
} |
||||
|
||||
.tablebox { |
||||
width: 610px; |
||||
color: #333333; |
||||
|
||||
table { |
||||
display: block; |
||||
width: 100%; |
||||
font-size: 14px; |
||||
|
||||
tr { |
||||
display: block; |
||||
width: 600px; |
||||
|
||||
td { |
||||
white-space: normal; |
||||
display: inline-block; |
||||
width: 15%; |
||||
text-align: center; |
||||
} |
||||
|
||||
td:last-child { |
||||
width: 70%; |
||||
line-height: 28px; |
||||
} |
||||
} |
||||
|
||||
tr:nth-child(even) { |
||||
background: #f6faff; |
||||
} |
||||
} |
||||
|
||||
.bulecolor { |
||||
color: #2196f3; |
||||
} |
||||
} |
||||
|
||||
} |
||||
} |
||||
|
||||
@media screen and (max-width:1400px) { |
||||
.scoringRule { |
||||
.scoringRuleImg { |
||||
left: -230px; |
||||
// .tablebox{ |
||||
// width: 450px; |
||||
// table{ |
||||
// tr{ |
||||
// width: 450px; |
||||
// } |
||||
// } |
||||
// } |
||||
} |
||||
} |
||||
} |
||||
|
@ -1,72 +1,115 @@
|
||||
import { Component, OnInit,Output,EventEmitter } from '@angular/core'; |
||||
import { HttpClient } from '@angular/common/http' |
||||
import { Router,ActivatedRoute } from '@angular/router' |
||||
import {HelpFileService} from './help-file.service' //引入服务
|
||||
import {CacheTokenService} from '../http-interceptors/cache-token.service' //引入服务
|
||||
import { MatDialog } from '@angular/material/dialog'; |
||||
import {ChangepasswordComponent} from '../ui/changepassword/changepassword.component' |
||||
import { MatSnackBar } from '@angular/material/snack-bar'; |
||||
import { CookieService } from 'ngx-cookie-service'; |
||||
|
||||
|
||||
import { Component, OnInit, Output, EventEmitter } from "@angular/core"; |
||||
import { HttpClient } from "@angular/common/http"; |
||||
import { Router, ActivatedRoute } from "@angular/router"; |
||||
import { HelpFileService } from "./help-file.service"; //引入服务
|
||||
import { CacheTokenService } from "../http-interceptors/cache-token.service"; //引入服务
|
||||
import { MatDialog } from "@angular/material/dialog"; |
||||
import { ChangepasswordComponent } from "../ui/changepassword/changepassword.component"; |
||||
import { MatSnackBar } from "@angular/material/snack-bar"; |
||||
import { CookieService } from "ngx-cookie-service"; |
||||
import { TabbarAndScoreService } from "../service/tabbar-and-score.service"; |
||||
|
||||
@Component({ |
||||
selector: 'app-tabbar', |
||||
templateUrl: './tabbar.component.html', |
||||
styleUrls: ['./tabbar.component.scss'] |
||||
selector: "app-tabbar", |
||||
templateUrl: "./tabbar.component.html", |
||||
styleUrls: ["./tabbar.component.scss"], |
||||
}) |
||||
export class TabbarComponent implements OnInit { |
||||
|
||||
constructor(private http:HttpClient,private router:Router,private route:ActivatedRoute,public token:CacheTokenService,public dialog: MatDialog,public snackBar: MatSnackBar, |
||||
private cookieService: CookieService,private help: HelpFileService) { } |
||||
constructor( |
||||
private http: HttpClient, |
||||
private router: Router, |
||||
private route: ActivatedRoute, |
||||
public token: CacheTokenService, |
||||
public dialog: MatDialog, |
||||
public snackBar: MatSnackBar, |
||||
private cookieService: CookieService, |
||||
private help: HelpFileService, |
||||
private tabbarService: TabbarAndScoreService |
||||
) {} |
||||
|
||||
ngOnInit() { |
||||
this.getUserInfo() |
||||
this.getUserInfo(); |
||||
this.getIntegrityScore(); |
||||
|
||||
this.tabbarService.getMessage().subscribe((message: any) => { |
||||
this.getIntegrityScore(); |
||||
}); |
||||
} |
||||
|
||||
companyName:any; //企业name
|
||||
companyName: any; //企业name
|
||||
|
||||
//获取用户信息
|
||||
getUserInfo () { |
||||
this.http.get('/api/CompanyAccount/Profiles').subscribe((data:any)=>{ |
||||
sessionStorage.setItem('companyId',data.companyId) |
||||
this.companyName = data.companyName |
||||
}) |
||||
getUserInfo() { |
||||
this.http.get("/api/CompanyAccount/Profiles").subscribe((data: any) => { |
||||
sessionStorage.setItem("companyId", data.companyId); |
||||
this.companyName = data.companyName; |
||||
}); |
||||
} |
||||
|
||||
//退出系统
|
||||
signOut = () => { |
||||
let out = confirm("您确定要退出吗") |
||||
if(out) { |
||||
this.http.post('/api/CompanyAccount/SignOut',{}).subscribe( |
||||
data=> { |
||||
this.token.delete() |
||||
sessionStorage.clear() |
||||
window.localStorage.clear() |
||||
this.cookieService.set("token",'',new Date(new Date().getTime() + 1),'/'); |
||||
this.cookieService.set("refreshToken",'',new Date(new Date().getTime() + 1),'/'); |
||||
this.snackBar.open('成功退出', '确定', { |
||||
duration: 3000 |
||||
}); |
||||
this.router.navigate(['/login']) |
||||
} |
||||
) |
||||
let out = confirm("您确定要退出吗"); |
||||
if (out) { |
||||
this.http.post("/api/CompanyAccount/SignOut", {}).subscribe((data) => { |
||||
this.token.delete(); |
||||
sessionStorage.clear(); |
||||
window.localStorage.clear(); |
||||
this.cookieService.set( |
||||
"token", |
||||
"", |
||||
new Date(new Date().getTime() + 1), |
||||
"/" |
||||
); |
||||
this.cookieService.set( |
||||
"refreshToken", |
||||
"", |
||||
new Date(new Date().getTime() + 1), |
||||
"/" |
||||
); |
||||
this.snackBar.open("成功退出", "确定", { |
||||
duration: 3000, |
||||
}); |
||||
this.router.navigate(["/login"]); |
||||
}); |
||||
} |
||||
} |
||||
}; |
||||
|
||||
//修改密码
|
||||
changpsw() { |
||||
let dialogRef = this.dialog.open(ChangepasswordComponent,
|
||||
{width:'348px'}); |
||||
let dialogRef = this.dialog.open(ChangepasswordComponent, { |
||||
width: "348px", |
||||
}); |
||||
|
||||
dialogRef.afterClosed().subscribe();
|
||||
dialogRef.afterClosed().subscribe(); |
||||
} |
||||
|
||||
//下载帮助文档
|
||||
downloadHelpFile () { |
||||
this.help.getFileMSG() |
||||
downloadHelpFile() { |
||||
this.help.getFileMSG(); |
||||
} |
||||
|
||||
//根据usci获取当前单位的分数信息
|
||||
companyIntegrityScore; |
||||
getIntegrityScore() { |
||||
// let unitId = sessionStorage.getItem("companyId");
|
||||
this.http.get(`/api/CompanyAccount/Company`).subscribe((data: any) => { |
||||
console.log("信息完整度", data); |
||||
this.companyIntegrityScore = data.companyIntegrityScore; |
||||
}); |
||||
} |
||||
|
||||
integrityDetails(width, zong) { |
||||
let style: any = {}; |
||||
style.width = (width / zong) * 100 + "%"; |
||||
return style; |
||||
} |
||||
|
||||
//计分规则
|
||||
scoringRuleImg: boolean = false; |
||||
scoringRule() { |
||||
this.scoringRuleImg = !this.scoringRuleImg; |
||||
} |
||||
closebtn() { |
||||
this.scoringRuleImg = false; |
||||
} |
||||
} |
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,310 +1,389 @@
|
||||
import { Component, OnInit, Inject } from '@angular/core'; |
||||
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 { Component, OnInit, Inject } from "@angular/core"; |
||||
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 { TabbarAndScoreService } from "src/app/service/tabbar-and-score.service"; |
||||
|
||||
@Component({ |
||||
selector: 'app-function-division', |
||||
templateUrl: './function-division.component.html', |
||||
styleUrls: ['./function-division.component.scss'] |
||||
selector: "app-function-division", |
||||
templateUrl: "./function-division.component.html", |
||||
styleUrls: ["./function-division.component.scss"], |
||||
}) |
||||
export class FunctionDivisionComponent implements OnInit { |
||||
|
||||
constructor(private http:HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar) { } |
||||
constructor( |
||||
private http: HttpClient, |
||||
public dialog: MatDialog, |
||||
public snackBar: MatSnackBar, |
||||
private tabbarService: TabbarAndScoreService |
||||
) {} |
||||
|
||||
ngOnInit(): void { |
||||
this.companyId = sessionStorage.getItem('companyId') |
||||
this.getAllBuilding() |
||||
this.companyId = sessionStorage.getItem("companyId"); |
||||
this.getAllBuilding(); |
||||
} |
||||
|
||||
displayedColumns: string[] = ['checked', 'region', 'measure', 'situation']; |
||||
displayedColumns: string[] = ["checked", "region", "measure", "situation"]; |
||||
|
||||
companyId:any; //单位编号
|
||||
companyFunctionalZoning:any=[]; //所有单位功能分区属性
|
||||
selectFunctionalZoning:any=[]; //选中的单位功能分区属性
|
||||
companyId: any; //单位编号
|
||||
companyFunctionalZoning: any = []; //所有单位功能分区属性
|
||||
selectFunctionalZoning: any = []; //选中的单位功能分区属性
|
||||
|
||||
//获得所有单位功能分区属性
|
||||
getAllCompany () { |
||||
this.http.get('/api/CompanyAccount/CompanyFunctionalDivisions').subscribe((data:any)=>{ |
||||
this.companyFunctionalZoning = data |
||||
this.selectFunctionalZoning = [] |
||||
}) |
||||
getAllCompany() { |
||||
this.http |
||||
.get("/api/CompanyAccount/CompanyFunctionalDivisions") |
||||
.subscribe((data: any) => { |
||||
this.companyFunctionalZoning = data; |
||||
this.selectFunctionalZoning = []; |
||||
}); |
||||
} |
||||
|
||||
//新建单位功能分区属性
|
||||
addCompany () { |
||||
let data = {companyId:this.companyId, region:'', area:0, details:''} |
||||
this.companyFunctionalZoning.push(data) |
||||
this.preservation() |
||||
addCompany() { |
||||
let data = { companyId: this.companyId, region: "", area: 0, details: "" }; |
||||
this.companyFunctionalZoning.push(data); |
||||
this.preservation(); |
||||
} |
||||
|
||||
//保存单位功能分区属性
|
||||
preservation () { |
||||
preservation() { |
||||
if (this.companyFunctionalZoning.length) { |
||||
this.http.post('/api/CompanyAccount/CompanyFunctionalDivisions/Batch',this.companyFunctionalZoning).subscribe(data=>{ |
||||
this.getAllCompany() |
||||
const config = new MatSnackBarConfig(); |
||||
config.verticalPosition = 'top'; |
||||
config.duration = 3000 |
||||
this.snackBar.open('数据更新成功','确定',config); |
||||
}) |
||||
this.http |
||||
.post( |
||||
"/api/CompanyAccount/CompanyFunctionalDivisions/Batch", |
||||
this.companyFunctionalZoning |
||||
) |
||||
.subscribe((data) => { |
||||
this.getAllCompany(); |
||||
const config = new MatSnackBarConfig(); |
||||
config.verticalPosition = "top"; |
||||
config.duration = 3000; |
||||
this.snackBar.open("数据更新成功", "确定", config); |
||||
}); |
||||
} |
||||
} |
||||
|
||||
//单位功能分区checked选择
|
||||
changeCompany (ele,e) { |
||||
changeCompany(ele, e) { |
||||
if (e.checked) { |
||||
this.selectFunctionalZoning.push(ele.id) |
||||
this.selectFunctionalZoning.push(ele.id); |
||||
} else { |
||||
this.selectFunctionalZoning.splice(this.selectFunctionalZoning.findIndex(item => item === ele.id), 1) |
||||
this.selectFunctionalZoning.splice( |
||||
this.selectFunctionalZoning.findIndex((item) => item === ele.id), |
||||
1 |
||||
); |
||||
} |
||||
} |
||||
|
||||
//删除单位功能分区属性
|
||||
delete () { |
||||
delete() { |
||||
if (this.selectFunctionalZoning.length) { |
||||
let isDelete = confirm('您确定要删除吗') |
||||
let isDelete = confirm("您确定要删除吗"); |
||||
if (isDelete) { |
||||
this.http.post('/api/CompanyAccount/CompanyFunctionalDivisions/Batch',this.companyFunctionalZoning).subscribe(data=>{ |
||||
const options = { |
||||
headers: new HttpHeaders({'Content-Type': 'application/json',}), |
||||
body:this.selectFunctionalZoning} |
||||
this.http.delete(`/api/CompanyAccount/CompanyFunctionalDivisions/Batch`,options).subscribe(data=>{ |
||||
this.getAllCompany() |
||||
const config = new MatSnackBarConfig(); |
||||
config.verticalPosition = 'top'; |
||||
config.duration = 3000 |
||||
this.snackBar.open('数据更新成功','确定',config); |
||||
}) |
||||
}) |
||||
this.http |
||||
.post( |
||||
"/api/CompanyAccount/CompanyFunctionalDivisions/Batch", |
||||
this.companyFunctionalZoning |
||||
) |
||||
.subscribe((data) => { |
||||
const options = { |
||||
headers: new HttpHeaders({ "Content-Type": "application/json" }), |
||||
body: this.selectFunctionalZoning, |
||||
}; |
||||
this.http |
||||
.delete( |
||||
`/api/CompanyAccount/CompanyFunctionalDivisions/Batch`, |
||||
options |
||||
) |
||||
.subscribe((data) => { |
||||
this.getAllCompany(); |
||||
const config = new MatSnackBarConfig(); |
||||
config.verticalPosition = "top"; |
||||
config.duration = 3000; |
||||
this.snackBar.open("数据更新成功", "确定", config); |
||||
}); |
||||
}); |
||||
} |
||||
} else if (!this.selectFunctionalZoning.length) { |
||||
const config = new MatSnackBarConfig(); |
||||
config.verticalPosition = 'top'; |
||||
config.duration = 3000 |
||||
this.snackBar.open('请选择单位功能分区','确定',config); |
||||
config.verticalPosition = "top"; |
||||
config.duration = 3000; |
||||
this.snackBar.open("请选择单位功能分区", "确定", config); |
||||
} |
||||
} |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//建筑功能分区↓
|
||||
allBuilding:any = []; //所有建筑
|
||||
allBuildingFunctionalZoning:any = []; //所有建筑的功能分区
|
||||
selectBuildingFunctionalZoning:any = []; //选中的建筑的功能分区
|
||||
allBuilding: any = []; //所有建筑
|
||||
allBuildingFunctionalZoning: any = []; //所有建筑的功能分区
|
||||
selectBuildingFunctionalZoning: any = []; //选中的建筑的功能分区
|
||||
|
||||
//获得所有建筑
|
||||
getAllBuilding () { |
||||
this.http.get(`/api/CompanyAccount/Buildings`).subscribe((data:any)=>{ |
||||
this.allBuilding = data |
||||
getAllBuilding() { |
||||
this.http.get(`/api/CompanyAccount/Buildings`).subscribe((data: any) => { |
||||
this.allBuilding = data; |
||||
if (data.length) { |
||||
this.allBuilding.forEach(element => { //为每个建筑添加一个 功能分区对象
|
||||
element.functionalZoning = null |
||||
this.allBuilding.forEach((element) => { |
||||
//为每个建筑添加一个 功能分区对象
|
||||
element.functionalZoning = null; |
||||
}); |
||||
this.getAllBuildingFunctionalZoning() |
||||
this.getAllBuildingFunctionalZoning(); |
||||
} else { |
||||
const config = new MatSnackBarConfig(); |
||||
config.verticalPosition = 'top'; |
||||
config.duration = 3000 |
||||
this.snackBar.open('暂无建筑数据','确定',config); |
||||
config.verticalPosition = "top"; |
||||
config.duration = 3000; |
||||
this.snackBar.open("暂无建筑数据", "确定", config); |
||||
} |
||||
}) |
||||
}); |
||||
} |
||||
|
||||
noDataList = [] //没有 创建功能分区 的建筑
|
||||
noDataList = []; //没有 创建功能分区 的建筑
|
||||
//获得所有建筑的功能分区
|
||||
getAllBuildingFunctionalZoning () { |
||||
this.selectBuildingFunctionalZoning = [] |
||||
this.allBuildingFunctionalZoning = [] |
||||
this.noDataList = [] |
||||
this.allBuilding.forEach(element => { |
||||
let data={buildingId: element.id} |
||||
this.http.get(`/api/CompanyAccount/BuildingFunctionalDivisions`,{params:data}).subscribe((data:any)=>{ |
||||
if (data.length) { |
||||
element.functionalZoning = data |
||||
this.selectBuildingFunctionalZoning.push([]) //拥有建筑功能分区的提前push空数组
|
||||
this.allBuildingFunctionalZoning.push(element) |
||||
this.noDataList.push(true) |
||||
} else { |
||||
this.noDataList.push(false) |
||||
} |
||||
if (this.noDataList.length === this.allBuilding.length) { this.addVoluntarilyPartition() } |
||||
}) |
||||
getAllBuildingFunctionalZoning() { |
||||
this.selectBuildingFunctionalZoning = []; |
||||
this.allBuildingFunctionalZoning = []; |
||||
this.noDataList = []; |
||||
this.allBuilding.forEach((element) => { |
||||
let data = { buildingId: element.id }; |
||||
this.http |
||||
.get(`/api/CompanyAccount/BuildingFunctionalDivisions`, { |
||||
params: data, |
||||
}) |
||||
.subscribe((data: any) => { |
||||
if (data.length) { |
||||
element.functionalZoning = data; |
||||
this.selectBuildingFunctionalZoning.push([]); //拥有建筑功能分区的提前push空数组
|
||||
this.allBuildingFunctionalZoning.push(element); |
||||
this.noDataList.push(true); |
||||
} else { |
||||
this.noDataList.push(false); |
||||
} |
||||
if (this.noDataList.length === this.allBuilding.length) { |
||||
this.addVoluntarilyPartition(); |
||||
} |
||||
}); |
||||
}); |
||||
} |
||||
|
||||
// 没有 创建 建筑功能分区时 自动创建
|
||||
addVoluntarilyPartition () { |
||||
let isNotHave:boolean = false |
||||
this.noDataList.forEach(item=> { |
||||
addVoluntarilyPartition() { |
||||
let isNotHave: boolean = false; |
||||
this.noDataList.forEach((item) => { |
||||
if (item === true) { |
||||
isNotHave = true |
||||
return |
||||
isNotHave = true; |
||||
return; |
||||
} |
||||
}) |
||||
if (!isNotHave) { //所有建筑都没有 功能分区时
|
||||
let bodyData = [{ |
||||
}); |
||||
if (!isNotHave) { |
||||
//所有建筑都没有 功能分区时
|
||||
let bodyData = [ |
||||
{ |
||||
buildingId: this.allBuilding[0].id, |
||||
region: "", |
||||
area: 0, |
||||
details: "" |
||||
}] |
||||
let params = {buildingId:this.allBuilding[0].id} |
||||
this.http.post('/api/CompanyAccount/BuildingFunctionalDivisions/Batch',bodyData,{params:params}).subscribe(datas=>{ |
||||
this.http.get(`/api/CompanyAccount/BuildingFunctionalDivisions`,{params:params}).subscribe((data:any)=>{ |
||||
this.allBuilding[0].functionalZoning = data |
||||
this.selectBuildingFunctionalZoning.push([]) //拥有建筑功能分区的提前push空数组
|
||||
this.allBuildingFunctionalZoning.push(this.allBuilding[0]) |
||||
}) |
||||
}) |
||||
details: "", |
||||
}, |
||||
]; |
||||
let params = { buildingId: this.allBuilding[0].id }; |
||||
this.http |
||||
.post( |
||||
"/api/CompanyAccount/BuildingFunctionalDivisions/Batch", |
||||
bodyData, |
||||
{ params: params } |
||||
) |
||||
.subscribe((datas) => { |
||||
this.http |
||||
.get(`/api/CompanyAccount/BuildingFunctionalDivisions`, { |
||||
params: params, |
||||
}) |
||||
.subscribe((data: any) => { |
||||
this.allBuilding[0].functionalZoning = data; |
||||
this.selectBuildingFunctionalZoning.push([]); //拥有建筑功能分区的提前push空数组
|
||||
this.allBuildingFunctionalZoning.push(this.allBuilding[0]); |
||||
}); |
||||
}); |
||||
} |
||||
} |
||||
|
||||
//封装函数刷新当前建筑功能分区
|
||||
updateCurrent (e,index) { |
||||
let data= {buildingId: e.id} |
||||
this.http.get(`/api/CompanyAccount/BuildingFunctionalDivisions`,{params:data}).subscribe((data:any)=>{ |
||||
this.selectBuildingFunctionalZoning[index] = [] |
||||
this.allBuildingFunctionalZoning[index].functionalZoning = data |
||||
const config = new MatSnackBarConfig(); |
||||
config.verticalPosition = 'top'; |
||||
config.duration = 3000 |
||||
this.snackBar.open('数据更新成功','确定',config); |
||||
}) |
||||
updateCurrent(e, index) { |
||||
let data = { buildingId: e.id }; |
||||
this.http |
||||
.get(`/api/CompanyAccount/BuildingFunctionalDivisions`, { params: data }) |
||||
.subscribe((data: any) => { |
||||
this.selectBuildingFunctionalZoning[index] = []; |
||||
this.allBuildingFunctionalZoning[index].functionalZoning = data; |
||||
const config = new MatSnackBarConfig(); |
||||
config.verticalPosition = "top"; |
||||
config.duration = 3000; |
||||
this.snackBar.open("数据更新成功", "确定", config); |
||||
}); |
||||
} |
||||
|
||||
//创建建筑功能分区
|
||||
addPartition () { |
||||
let data = this.allBuilding |
||||
let dialogRef = this.dialog.open(addPartition,{data}); |
||||
dialogRef.afterClosed().subscribe(data=>{ |
||||
if (data) {this.getAllBuilding()} |
||||
});
|
||||
addPartition() { |
||||
let data = this.allBuilding; |
||||
let dialogRef = this.dialog.open(addPartition, { data }); |
||||
dialogRef.afterClosed().subscribe((data) => { |
||||
if (data) { |
||||
this.getAllBuilding(); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
//创建建筑功能分区属性
|
||||
addBuilding (e,index) { |
||||
let data = {buildingId:e.id, region:'', area:0, details:''} |
||||
this.http.post('/api/CompanyAccount/BuildingFunctionalDivisions',data).subscribe(data=>{ |
||||
this.preservationBuilding(e,index) |
||||
}) |
||||
addBuilding(e, index) { |
||||
let data = { buildingId: e.id, region: "", area: 0, details: "" }; |
||||
this.http |
||||
.post("/api/CompanyAccount/BuildingFunctionalDivisions", data) |
||||
.subscribe((data) => { |
||||
this.preservationBuilding(e, index); |
||||
}); |
||||
} |
||||
|
||||
//保存建筑功能分区属性
|
||||
preservationBuilding (e,index) { |
||||
let data ={buildingId:e.id} |
||||
this.http.post(`/api/CompanyAccount/BuildingFunctionalDivisions/Batch`,this.allBuildingFunctionalZoning[index].functionalZoning,{params:data}).subscribe(data=>{ |
||||
this.updateCurrent(e,index) |
||||
}) |
||||
preservationBuilding(e, index) { |
||||
let data = { buildingId: e.id }; |
||||
this.http |
||||
.post( |
||||
`/api/CompanyAccount/BuildingFunctionalDivisions/Batch`, |
||||
this.allBuildingFunctionalZoning[index].functionalZoning, |
||||
{ params: data } |
||||
) |
||||
.subscribe((data) => { |
||||
this.updateCurrent(e, index); |
||||
this.tabbarService.sendMessage("changeScore"); //通知服务改变分数
|
||||
}); |
||||
} |
||||
|
||||
//建筑功能分区checked选择
|
||||
changeBuilding (ele,e,index) { |
||||
changeBuilding(ele, e, index) { |
||||
if (e.checked) { |
||||
this.selectBuildingFunctionalZoning[index].push(ele.id) |
||||
this.selectBuildingFunctionalZoning[index].push(ele.id); |
||||
} else { |
||||
this.selectBuildingFunctionalZoning[index].splice(this.selectBuildingFunctionalZoning[index].findIndex(item => item === ele.id), 1) |
||||
this.selectBuildingFunctionalZoning[index].splice( |
||||
this.selectBuildingFunctionalZoning[index].findIndex( |
||||
(item) => item === ele.id |
||||
), |
||||
1 |
||||
); |
||||
} |
||||
} |
||||
|
||||
//删除建筑功能分区
|
||||
deleteBuilding (e,index) { |
||||
deleteBuilding(e, index) { |
||||
if (this.selectBuildingFunctionalZoning[index].length) { |
||||
let isDelete = confirm('您确定要删除吗') |
||||
let isDelete = confirm("您确定要删除吗"); |
||||
if (isDelete) { |
||||
let data ={buildingId:e.id} |
||||
this.http.post(`/api/CompanyAccount/BuildingFunctionalDivisions/Batch`,this.allBuildingFunctionalZoning[index].functionalZoning,{params:data}).subscribe(data=>{ |
||||
const options = { |
||||
headers: new HttpHeaders({'Content-Type': 'application/json',}), |
||||
body:this.selectBuildingFunctionalZoning[index], |
||||
params:{buildingId:e.id}} |
||||
this.http.delete(`/api/CompanyAccount/BuildingFunctionalDivisions/Batch`,options).subscribe(data=>{ |
||||
this.selectBuildingFunctionalZoning[index].forEach((element,newIndex) => { |
||||
this.allBuildingFunctionalZoning[index].functionalZoning.splice(this.allBuildingFunctionalZoning[index].functionalZoning.findIndex(item=>item.id==element),1) |
||||
if (newIndex==this.selectBuildingFunctionalZoning[index].length-1) { |
||||
if (this.allBuildingFunctionalZoning[index].functionalZoning.length) { |
||||
this.updateCurrent(e,index) |
||||
} else { |
||||
this.selectBuildingFunctionalZoning.splice(index,1) |
||||
this.allBuildingFunctionalZoning.splice(index,1)} |
||||
} |
||||
}); |
||||
|
||||
|
||||
}) |
||||
}) |
||||
let data = { buildingId: e.id }; |
||||
this.http |
||||
.post( |
||||
`/api/CompanyAccount/BuildingFunctionalDivisions/Batch`, |
||||
this.allBuildingFunctionalZoning[index].functionalZoning, |
||||
{ params: data } |
||||
) |
||||
.subscribe((data) => { |
||||
const options = { |
||||
headers: new HttpHeaders({ "Content-Type": "application/json" }), |
||||
body: this.selectBuildingFunctionalZoning[index], |
||||
params: { buildingId: e.id }, |
||||
}; |
||||
this.http |
||||
.delete( |
||||
`/api/CompanyAccount/BuildingFunctionalDivisions/Batch`, |
||||
options |
||||
) |
||||
.subscribe((data) => { |
||||
this.selectBuildingFunctionalZoning[index].forEach( |
||||
(element, newIndex) => { |
||||
this.allBuildingFunctionalZoning[ |
||||
index |
||||
].functionalZoning.splice( |
||||
this.allBuildingFunctionalZoning[ |
||||
index |
||||
].functionalZoning.findIndex( |
||||
(item) => item.id == element |
||||
), |
||||
1 |
||||
); |
||||
if ( |
||||
newIndex == |
||||
this.selectBuildingFunctionalZoning[index].length - 1 |
||||
) { |
||||
if ( |
||||
this.allBuildingFunctionalZoning[index].functionalZoning |
||||
.length |
||||
) { |
||||
this.updateCurrent(e, index); |
||||
} else { |
||||
this.selectBuildingFunctionalZoning.splice(index, 1); |
||||
this.allBuildingFunctionalZoning.splice(index, 1); |
||||
} |
||||
} |
||||
} |
||||
); |
||||
}); |
||||
}); |
||||
} |
||||
} else if (!this.selectBuildingFunctionalZoning[index].length) { |
||||
const config = new MatSnackBarConfig(); |
||||
config.verticalPosition = 'top'; |
||||
config.duration = 3000 |
||||
this.snackBar.open('请选择建筑功能分区','确定',config); |
||||
config.verticalPosition = "top"; |
||||
config.duration = 3000; |
||||
this.snackBar.open("请选择建筑功能分区", "确定", config); |
||||
} |
||||
} |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
} |
||||
|
||||
|
||||
|
||||
//创建建筑功能分区组件
|
||||
@Component({ |
||||
selector: 'app-addPartition', |
||||
templateUrl: './addPartition.html', |
||||
styleUrls: ['./function-division.component.scss'] |
||||
selector: "app-addPartition", |
||||
templateUrl: "./addPartition.html", |
||||
styleUrls: ["./function-division.component.scss"], |
||||
}) |
||||
export class addPartition { |
||||
constructor( |
||||
private http: HttpClient, |
||||
public dialog: MatDialog, |
||||
public dialogRef: MatDialogRef<addPartition>, |
||||
@Inject(MAT_DIALOG_DATA) public data |
||||
) {} |
||||
|
||||
constructor(private http:HttpClient,public dialog: MatDialog,public dialogRef: MatDialogRef<addPartition>, |
||||
@Inject(MAT_DIALOG_DATA) public data) { } |
||||
ngOnInit(): void {} |
||||
|
||||
ngOnInit(): void { |
||||
|
||||
} |
||||
|
||||
selected:any; //选中的建筑
|
||||
selected: any; //选中的建筑
|
||||
|
||||
//创建建筑功能分区
|
||||
onSubmit (e) { |
||||
onSubmit(e) { |
||||
let data = { |
||||
buildingId:e.buildingId, |
||||
buildingId: e.buildingId, |
||||
region: "", |
||||
area: 0, |
||||
details: "" |
||||
} |
||||
this.http.post('/api/CompanyAccount/BuildingFunctionalDivisions',data).subscribe(data=>{ |
||||
this.dialogRef.close(data); |
||||
}) |
||||
details: "", |
||||
}; |
||||
this.http |
||||
.post("/api/CompanyAccount/BuildingFunctionalDivisions", data) |
||||
.subscribe((data) => { |
||||
this.dialogRef.close(data); |
||||
}); |
||||
} |
||||
|
||||
|
||||
|
||||
} |
||||
|
||||
|
||||
|
||||
//暂时无用
|
||||
@Component({ |
||||
selector: 'app-addPartitionAttribute', |
||||
templateUrl: './addPartitionAttribute.html', |
||||
styleUrls: ['./function-division.component.scss'] |
||||
selector: "app-addPartitionAttribute", |
||||
templateUrl: "./addPartitionAttribute.html", |
||||
styleUrls: ["./function-division.component.scss"], |
||||
}) |
||||
export class addPartitionAttribute { |
||||
|
||||
constructor(private http:HttpClient,public dialog: MatDialog,public dialogRef: MatDialogRef<addPartitionAttribute>, |
||||
@Inject(MAT_DIALOG_DATA) public data) { } |
||||
|
||||
ngOnInit(): void { |
||||
|
||||
} |
||||
|
||||
|
||||
|
||||
constructor( |
||||
private http: HttpClient, |
||||
public dialog: MatDialog, |
||||
public dialogRef: MatDialogRef<addPartitionAttribute>, |
||||
@Inject(MAT_DIALOG_DATA) public data |
||||
) {} |
||||
|
||||
ngOnInit(): void {} |
||||
} |
||||
|
@ -1,227 +1,289 @@
|
||||
import { Component, OnInit, ViewChild, Inject } from '@angular/core'; |
||||
import {HttpClient} from '@angular/common/http' |
||||
import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material/dialog'; |
||||
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; |
||||
import { KeySiteImgs } from './keysiteimgs.component' |
||||
|
||||
|
||||
import { Component, OnInit, ViewChild, Inject } from "@angular/core"; |
||||
import { HttpClient } from "@angular/common/http"; |
||||
import { |
||||
MatDialogRef, |
||||
MatDialog, |
||||
MAT_DIALOG_DATA, |
||||
} from "@angular/material/dialog"; |
||||
import { MatSnackBar, MatSnackBarConfig } from "@angular/material/snack-bar"; |
||||
import { KeySiteImgs } from "./keysiteimgs.component"; |
||||
import { TabbarAndScoreService } from "src/app/service/tabbar-and-score.service"; |
||||
|
||||
@Component({ |
||||
selector: 'app-key-site', |
||||
templateUrl: './key-site.component.html', |
||||
styleUrls: ['./key-site.component.scss'] |
||||
selector: "app-key-site", |
||||
templateUrl: "./key-site.component.html", |
||||
styleUrls: ["./key-site.component.scss"], |
||||
}) |
||||
export class KeySiteComponent implements OnInit { |
||||
constructor( |
||||
public http: HttpClient, |
||||
public dialog: MatDialog, |
||||
public snackBar: MatSnackBar, |
||||
private tabbarService: TabbarAndScoreService |
||||
) {} |
||||
|
||||
constructor(public http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar) { } |
||||
|
||||
displayedColumns: string[] = ['mainname', 'position', 'construction', 'nature', 'danger', 'img']; |
||||
displayedColumns: string[] = [ |
||||
"mainname", |
||||
"position", |
||||
"construction", |
||||
"nature", |
||||
"danger", |
||||
"img", |
||||
]; |
||||
|
||||
ngOnInit(): void { |
||||
this.getAllBuilding() |
||||
this.getAllBuilding(); |
||||
} |
||||
|
||||
allCompanyPosition:any = []; //所有单位重点部位
|
||||
companyTips:any; //所有单位重点提示
|
||||
companyInput:any; //单位重点提示数据
|
||||
allBuilding:any = []; //所有建筑 + 建筑重点部位 + 建筑重点提示
|
||||
allCompanyPosition: any = []; //所有单位重点部位
|
||||
companyTips: any; //所有单位重点提示
|
||||
companyInput: any; //单位重点提示数据
|
||||
allBuilding: any = []; //所有建筑 + 建筑重点部位 + 建筑重点提示
|
||||
|
||||
//获取单位重点部位
|
||||
getCompanyPostion () { |
||||
this.http.get('/api/CompanyAccount/CompanyImportantLocations').subscribe(data=>{ |
||||
this.allCompanyPosition = data |
||||
}) |
||||
getCompanyPostion() { |
||||
this.http |
||||
.get("/api/CompanyAccount/CompanyImportantLocations") |
||||
.subscribe((data) => { |
||||
this.allCompanyPosition = data; |
||||
}); |
||||
} |
||||
|
||||
//获取单位重点提示
|
||||
getCompanyTips () { |
||||
this.http.get('/api/CompanyAccount/CompanyImportantTips').subscribe((data:any)=>{ |
||||
if (data) { |
||||
this.companyTips = data |
||||
this.companyInput = data.details} |
||||
}) |
||||
getCompanyTips() { |
||||
this.http |
||||
.get("/api/CompanyAccount/CompanyImportantTips") |
||||
.subscribe((data: any) => { |
||||
if (data) { |
||||
this.companyTips = data; |
||||
this.companyInput = data.details; |
||||
} |
||||
}); |
||||
} |
||||
|
||||
//获取所有建筑
|
||||
getAllBuilding () { |
||||
this.http.get('/api/CompanyAccount/Buildings').subscribe((data:any)=>{ |
||||
this.allBuilding = data |
||||
getAllBuilding() { |
||||
this.http.get("/api/CompanyAccount/Buildings").subscribe((data: any) => { |
||||
this.allBuilding = data; |
||||
if (data.length) { |
||||
this.allBuilding.forEach(element => { |
||||
element.position = [] //建筑重点部位
|
||||
element.tips = null //建筑重点提示
|
||||
element.companyInput = null }) //建筑重点提示数据
|
||||
this.getAllBuildingPositon() |
||||
this.getAllBuildingTips() |
||||
this.allBuilding.forEach((element) => { |
||||
element.position = []; //建筑重点部位
|
||||
element.tips = null; //建筑重点提示
|
||||
element.companyInput = null; |
||||
}); //建筑重点提示数据
|
||||
this.getAllBuildingPositon(); |
||||
this.getAllBuildingTips(); |
||||
} else { |
||||
const config = new MatSnackBarConfig(); |
||||
config.verticalPosition = 'top'; |
||||
config.duration = 3000 |
||||
this.snackBar.open('暂无建筑数据','确定',config); |
||||
config.verticalPosition = "top"; |
||||
config.duration = 3000; |
||||
this.snackBar.open("暂无建筑数据", "确定", config); |
||||
} |
||||
}) |
||||
}); |
||||
} |
||||
|
||||
//获取所有建筑重点部位
|
||||
getAllBuildingPositon () { |
||||
this.allBuilding.forEach(element => { |
||||
let id = {buildingId:element.id} |
||||
this.http.get('/api/CompanyAccount/BuildingImportantLocations',{params:id}).subscribe(data=>{ |
||||
element.position = data |
||||
}) |
||||
getAllBuildingPositon() { |
||||
this.allBuilding.forEach((element) => { |
||||
let id = { buildingId: element.id }; |
||||
this.http |
||||
.get("/api/CompanyAccount/BuildingImportantLocations", { params: id }) |
||||
.subscribe((data) => { |
||||
element.position = data; |
||||
}); |
||||
}); |
||||
} |
||||
|
||||
//获取所有建筑重点提示
|
||||
getAllBuildingTips () { |
||||
this.allBuilding.forEach(element => { |
||||
let id = {buildingId:element.id} |
||||
this.http.get('/api/CompanyAccount/BuildingImportantTips',{params:id}).subscribe((data:any)=>{ |
||||
if (data) { |
||||
element.tips = data |
||||
element.companyInput = data.details} |
||||
}) |
||||
getAllBuildingTips() { |
||||
this.allBuilding.forEach((element) => { |
||||
let id = { buildingId: element.id }; |
||||
this.http |
||||
.get("/api/CompanyAccount/BuildingImportantTips", { params: id }) |
||||
.subscribe((data: any) => { |
||||
if (data) { |
||||
element.tips = data; |
||||
element.companyInput = data.details; |
||||
} |
||||
}); |
||||
}); |
||||
} |
||||
|
||||
//保存单位重点提示
|
||||
Preservation () { |
||||
if (this.companyTips) { //编辑单位重点提示
|
||||
Preservation() { |
||||
if (this.companyTips) { |
||||
//编辑单位重点提示
|
||||
let data = { |
||||
companyId: this.companyTips.companyId, |
||||
id: this.companyTips.id, |
||||
details: this.companyInput} |
||||
this.http.put(`/api/CompanyAccount/CompanyImportantTips/${this.companyTips.id}`,data).subscribe(data=>{ |
||||
this.getCompanyTips() |
||||
const config = new MatSnackBarConfig(); |
||||
config.verticalPosition = 'top'; |
||||
config.duration = 3000 |
||||
this.snackBar.open('数据修改成功','确定',config); |
||||
}) |
||||
} else { //新增单位重点提示
|
||||
details: this.companyInput, |
||||
}; |
||||
this.http |
||||
.put( |
||||
`/api/CompanyAccount/CompanyImportantTips/${this.companyTips.id}`, |
||||
data |
||||
) |
||||
.subscribe((data) => { |
||||
this.getCompanyTips(); |
||||
const config = new MatSnackBarConfig(); |
||||
config.verticalPosition = "top"; |
||||
config.duration = 3000; |
||||
this.snackBar.open("数据修改成功", "确定", config); |
||||
}); |
||||
} else { |
||||
//新增单位重点提示
|
||||
let data = { |
||||
companyId: sessionStorage.getItem('companyId'), |
||||
id : "", |
||||
details: this.companyInput || ""} |
||||
this.http.post('/api/CompanyAccount/CompanyImportantTips',data).subscribe(data=>{ |
||||
this.getCompanyTips() |
||||
const config = new MatSnackBarConfig(); |
||||
config.verticalPosition = 'top'; |
||||
config.duration = 3000 |
||||
this.snackBar.open('数据修改成功','确定',config); |
||||
}) |
||||
companyId: sessionStorage.getItem("companyId"), |
||||
id: "", |
||||
details: this.companyInput || "", |
||||
}; |
||||
this.http |
||||
.post("/api/CompanyAccount/CompanyImportantTips", data) |
||||
.subscribe((data) => { |
||||
this.getCompanyTips(); |
||||
const config = new MatSnackBarConfig(); |
||||
config.verticalPosition = "top"; |
||||
config.duration = 3000; |
||||
this.snackBar.open("数据修改成功", "确定", config); |
||||
}); |
||||
} |
||||
} |
||||
|
||||
//保存建筑重点提示
|
||||
PreservationBuilding (e) { |
||||
if (e.tips) { //编辑建筑重点提示
|
||||
PreservationBuilding(e) { |
||||
if (e.tips) { |
||||
//编辑建筑重点提示
|
||||
let data = { |
||||
buildingId: e.id, |
||||
id: e.tips.id, |
||||
details: e.companyInput} |
||||
this.http.put(`/api/CompanyAccount/BuildingImportantTips/${e.tips.id}`,data).subscribe(data=>{ |
||||
this.toUpdate(e) |
||||
}) |
||||
} else { //新增重点单位提示
|
||||
details: e.companyInput, |
||||
}; |
||||
this.http |
||||
.put(`/api/CompanyAccount/BuildingImportantTips/${e.tips.id}`, data) |
||||
.subscribe((data) => { |
||||
this.toUpdate(e); |
||||
this.tabbarService.sendMessage("changeScore"); //通知服务改变分数
|
||||
}); |
||||
} else { |
||||
//新增重点单位提示
|
||||
let data = { |
||||
buildingId: e.id, |
||||
details: e.companyInput || ""} |
||||
this.http.post('/api/CompanyAccount/BuildingImportantTips',data).subscribe(data=>{ |
||||
this.toUpdate(e) |
||||
}) |
||||
details: e.companyInput || "", |
||||
}; |
||||
this.http |
||||
.post("/api/CompanyAccount/BuildingImportantTips", data) |
||||
.subscribe((data) => { |
||||
this.toUpdate(e); |
||||
this.tabbarService.sendMessage("changeScore"); //通知服务改变分数
|
||||
}); |
||||
} |
||||
} |
||||
|
||||
//查看图片
|
||||
seeImg (e) { |
||||
seeImg(e) { |
||||
if (e.imageUrls.length != 0) { |
||||
let data = e |
||||
const dialogRef = this.dialog.open(KeySiteImgs, {//调用open方法打开对话框并且携带参数过去
|
||||
width: '1600px', |
||||
height:'900px',data}); |
||||
let data = e; |
||||
const dialogRef = this.dialog.open(KeySiteImgs, { |
||||
//调用open方法打开对话框并且携带参数过去
|
||||
width: "1600px", |
||||
height: "900px", |
||||
data, |
||||
}); |
||||
dialogRef.afterClosed().subscribe(); |
||||
} else { |
||||
const config = new MatSnackBarConfig(); |
||||
config.verticalPosition = 'top'; |
||||
config.duration = 3000 |
||||
this.snackBar.open('暂无图片数据','确定',config); |
||||
config.verticalPosition = "top"; |
||||
config.duration = 3000; |
||||
this.snackBar.open("暂无图片数据", "确定", config); |
||||
} |
||||
} |
||||
|
||||
//封装方法获取更新当前tab页重点提示
|
||||
toUpdate (e) { |
||||
let id = {buildingId:e.id} |
||||
this.http.get('/api/CompanyAccount/BuildingImportantTips',{params:id}).subscribe((data:any)=>{ |
||||
if (data) { |
||||
this.allBuilding.forEach(element => { |
||||
if (element.id === e.id) { |
||||
element.tips = data |
||||
element.companyInput = data.details} |
||||
}); |
||||
} // if
|
||||
const config = new MatSnackBarConfig(); |
||||
config.verticalPosition = 'top'; |
||||
config.duration = 3000 |
||||
this.snackBar.open('数据修改成功','确定',config); |
||||
}) |
||||
toUpdate(e) { |
||||
let id = { buildingId: e.id }; |
||||
this.http |
||||
.get("/api/CompanyAccount/BuildingImportantTips", { params: id }) |
||||
.subscribe((data: any) => { |
||||
if (data) { |
||||
this.allBuilding.forEach((element) => { |
||||
if (element.id === e.id) { |
||||
element.tips = data; |
||||
element.companyInput = data.details; |
||||
} |
||||
}); |
||||
} // if
|
||||
const config = new MatSnackBarConfig(); |
||||
config.verticalPosition = "top"; |
||||
config.duration = 3000; |
||||
this.snackBar.open("数据修改成功", "确定", config); |
||||
}); |
||||
} |
||||
|
||||
objectName:any //上传对象名
|
||||
keySiteItem:any
|
||||
keySiteItemImgList:any //重点部位图片集合
|
||||
Limit(element){ |
||||
console.log(element) |
||||
objectName: any; //上传对象名
|
||||
keySiteItem: any; |
||||
keySiteItemImgList: any; //重点部位图片集合
|
||||
Limit(element) { |
||||
console.log(element); |
||||
const config = new MatSnackBarConfig(); |
||||
config.verticalPosition = 'top'; |
||||
config.duration = 3000 |
||||
this.snackBar.open('图片已达上限','确定',config) |
||||
config.verticalPosition = "top"; |
||||
config.duration = 3000; |
||||
this.snackBar.open("图片已达上限", "确定", config); |
||||
} |
||||
//上传素材图片
|
||||
selectFile(element,e){ |
||||
let imgFile = e.target.files[0] || null //上传的文件
|
||||
this.keySiteItemImgList = element.imageUrls ? element.imageUrls : [] |
||||
this.keySiteItem = element |
||||
console.log(this.keySiteItem) |
||||
this.startUploading(imgFile) |
||||
selectFile(element, e) { |
||||
let imgFile = e.target.files[0] || null; //上传的文件
|
||||
this.keySiteItemImgList = element.imageUrls ? element.imageUrls : []; |
||||
this.keySiteItem = element; |
||||
console.log(this.keySiteItem); |
||||
this.startUploading(imgFile); |
||||
} |
||||
|
||||
startUploading (imgFile) { |
||||
let _this = this |
||||
let file = imgFile || null //获取上传的文件
|
||||
let fileSize = file.size || null //上传文件的总大小
|
||||
let shardSize = 5 * 1024 * 1024 //5MB一个分片
|
||||
let companyId = sessionStorage.getItem("companyId") |
||||
if (file && fileSize <= shardSize) { //上传文件<=5MB时
|
||||
let formData = new FormData() |
||||
formData.append("file",file) |
||||
this.http.post(`api/Objects/WebPlan2D/${companyId}`,formData).subscribe((data:any)=>{ |
||||
this.objectName = data.objectName |
||||
const config = new MatSnackBarConfig(); |
||||
config.verticalPosition = 'top'; |
||||
config.duration = 3000 |
||||
this.snackBar.open('上传成功','确定',config) |
||||
this.keySiteItemImgList.push("/api/Objects/WebPlan2D/" + this.objectName) |
||||
this.keySiteItem.imageUrls = this.keySiteItemImgList |
||||
this.http.put(`/api/CompanyAccount/BuildingImportantLocations/${this.keySiteItem.id}`,this.keySiteItem,{ |
||||
// params:{
|
||||
// companyId : companyId
|
||||
// }
|
||||
}).subscribe((data)=>{ |
||||
// console.log(666,'修改成功')
|
||||
|
||||
startUploading(imgFile) { |
||||
let _this = this; |
||||
let file = imgFile || null; //获取上传的文件
|
||||
let fileSize = file.size || null; //上传文件的总大小
|
||||
let shardSize = 5 * 1024 * 1024; //5MB一个分片
|
||||
let companyId = sessionStorage.getItem("companyId"); |
||||
if (file && fileSize <= shardSize) { |
||||
//上传文件<=5MB时
|
||||
let formData = new FormData(); |
||||
formData.append("file", file); |
||||
this.http |
||||
.post(`api/Objects/WebPlan2D/${companyId}`, formData) |
||||
.subscribe((data: any) => { |
||||
this.objectName = data.objectName; |
||||
const config = new MatSnackBarConfig(); |
||||
config.verticalPosition = 'top'; |
||||
config.duration = 3000 |
||||
this.snackBar.open('修改成功','确定',config) |
||||
}) |
||||
}) |
||||
} else if (file && fileSize > shardSize) { //上传文件>5MB时,分块上传
|
||||
config.verticalPosition = "top"; |
||||
config.duration = 3000; |
||||
this.snackBar.open("上传成功", "确定", config); |
||||
this.keySiteItemImgList.push( |
||||
"/api/Objects/WebPlan2D/" + this.objectName |
||||
); |
||||
this.keySiteItem.imageUrls = this.keySiteItemImgList; |
||||
this.http |
||||
.put( |
||||
`/api/CompanyAccount/BuildingImportantLocations/${this.keySiteItem.id}`, |
||||
this.keySiteItem, |
||||
{ |
||||
// params:{
|
||||
// companyId : companyId
|
||||
// }
|
||||
} |
||||
) |
||||
.subscribe((data) => { |
||||
// console.log(666,'修改成功')
|
||||
const config = new MatSnackBarConfig(); |
||||
config.verticalPosition = "top"; |
||||
config.duration = 3000; |
||||
this.snackBar.open("修改成功", "确定", config); |
||||
}); |
||||
}); |
||||
} else if (file && fileSize > shardSize) { |
||||
//上传文件>5MB时,分块上传
|
||||
let config = new MatSnackBarConfig(); |
||||
config.verticalPosition = 'top'; |
||||
config.duration = 3000 |
||||
this.snackBar.open('上传图片文件不允许大于5mb','确定',config); |
||||
config.verticalPosition = "top"; |
||||
config.duration = 3000; |
||||
this.snackBar.open("上传图片文件不允许大于5mb", "确定", config); |
||||
} |
||||
|
||||
} |
||||
|
||||
} |
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue