Browse Source

[完善] 合并代码

zhuzhou
陈鹏飞 4 years ago
parent
commit
535d69e938
  1. 436
      src/app/canvas-share-data.service.ts
  2. 9
      src/app/data-collection/water-collection/water-collection.component.html
  3. 5
      src/app/data-collection/water-collection/water-collection.component.scss
  4. 25
      src/app/data-collection/water-collection/water-collection.component.ts
  5. 577
      src/app/key-unit/basicinfo-look/basicinfo.component.html
  6. 186
      src/app/key-unit/basicinfo-look/basicinfo.component.scss
  7. 2037
      src/app/key-unit/basicinfo-look/basicinfo.component.ts
  8. 11
      src/app/key-unit/basicinfo-look/lookmaster.component.html
  9. 14
      src/app/key-unit/basicinfo/addhouseinfo.component.ts
  10. 537
      src/app/key-unit/basicinfo/basicinfo.component.html
  11. 146
      src/app/key-unit/basicinfo/basicinfo.component.scss
  12. 2056
      src/app/key-unit/basicinfo/basicinfo.component.ts
  13. 5
      src/app/key-unit/key-unit-management/key-unit-management.component.html
  14. 8
      src/app/key-unit/key-unit-management/key-unit-management.component.scss
  15. 105
      src/app/key-unit/key-unit-management/key-unit-management.component.ts
  16. 27
      src/app/key-unit/key-unit-management/resultcompanyPlan.html
  17. 5
      src/app/key-unit/key-unit.module.ts
  18. 4
      src/app/plan-audit/allaround/allaround.component.ts
  19. 3
      src/app/plan-audit/basic-info/basic-info.component.ts
  20. 2
      src/app/plan-audit/cad-draw/cad-draw.component.ts
  21. 4
      src/app/plan-audit/fire-facilities/fire-facilities.component.ts
  22. 2
      src/app/plan-audit/function-partition/function-partition.component.ts
  23. 2
      src/app/plan-audit/key-site-look/key-site.component.ts
  24. 2
      src/app/plan-audit/plan-list/plan-list.component.ts
  25. 98
      src/app/plan-audit/plan-record/plan-record.component.html
  26. 87
      src/app/plan-audit/plan-record/plan-record.component.ts
  27. 2
      src/app/plan-audit/realistic-picture-look/realistic-picture.component.ts
  28. 116
      src/app/plan-audit/wait-examineer/wait-examineer.component.html
  29. 4
      src/app/plan-audit/wait-examineer/wait-examineer.component.scss
  30. 333
      src/app/plan-audit/wait-examineer/wait-examineer.component.ts
  31. 2
      src/app/plan-audit/water-audit/water-audit.component.html
  32. 49
      src/app/plan-audit/water-audit/water-audit.component.ts
  33. 5
      src/app/plan-management/entry-plan-look/entry-plan-look.component.ts
  34. 15
      src/app/statistic-analysis/buildingType/building-type-one/building-type-one.component.ts
  35. 13
      src/app/statistic-analysis/echarts-data.service.ts
  36. 16
      src/app/ui/collection-tools-building/collection-tools.component.ts
  37. 5
      src/app/ui/collection-tools-plan/collection-tools.component.ts
  38. 5
      src/app/ui/collection-tools/collection-tools.component.ts
  39. 480
      src/app/working-area/model/axImageShape.ts
  40. 36
      src/app/working-area/model/axMessageSystem.ts
  41. 66
      src/app/working-area/model/axShape.ts
  42. 9
      src/app/working-area/model/configuration.ts
  43. 2
      src/app/working-area/model/events.ts
  44. 16
      src/app/working-area/model/grid2D.ts
  45. 21
      src/app/working-area/working-area.component.ts
  46. BIN
      src/assets/images/箭头.png
  47. BIN
      src/assets/images/箭头2.png
  48. BIN
      src/assets/images/箭头3.png

436
src/app/canvas-share-data.service.ts

@ -1,6 +1,6 @@
import { HttpClient } from '@angular/common/http'; import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import {ReplaySubject} from 'rxjs'; import { ReplaySubject } from 'rxjs';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
import { GameMode } from './working-area/model/gameMode'; import { GameMode } from './working-area/model/gameMode';
@ -8,7 +8,7 @@ import { GameMode } from './working-area/model/gameMode';
providedIn: 'root' providedIn: 'root'
}) })
export class CanvasShareDataService { export class CanvasShareDataService {
constructor(private http:HttpClient) { } constructor(private http: HttpClient) { }
private _sendMessage: ReplaySubject<any> = new ReplaySubject<any>(1); private _sendMessage: ReplaySubject<any> = new ReplaySubject<any>(1);
examDisposalNodesData; // 考生进入时获取当前试卷的处置节点 examDisposalNodesData; // 考生进入时获取当前试卷的处置节点
@ -18,9 +18,9 @@ export class CanvasShareDataService {
isChange:boolean = false; // 数据 是否改动 isChange: boolean = false; // 数据 是否改动
selectTemplateData:any; // 选择当前 模板数据 selectTemplateData: any; // 选择当前 模板数据
// 总平面图/建筑 楼层 // 总平面图/建筑 楼层
selectStorey:any = {area: '', details: ''}; // 选择当前 楼层 数据 selectStorey:any = {area: '', details: ''}; // 选择当前 楼层 数据
@ -43,36 +43,38 @@ export class CanvasShareDataService {
gameMode:GameMode = GameMode.BasicInformation; gameMode:GameMode = GameMode.BasicInformation;
facilityAssetsName = new Map<string, string>([ facilityAssetsName = new Map<string, string>([
[ '消防水池', '消防水池'], ['消防水池', '消防水池'],
[ '疏散楼梯', '疏散楼梯'], ['疏散楼梯', '疏散楼梯'],
[ '消防电梯', '消防电梯'], ['消防电梯', '消防电梯'],
[ '避难区域', '避难区域'], ['避难区域', '避难区域'],
[ '安全出口', '安全出口'], ['安全出口', '安全出口'],
[ '地上消火栓', '室外消火栓' ], ['地上消火栓', '室外消火栓'],
[ '地下消火栓', '室外消火栓' ], ['地下消火栓', '室外消火栓'],
[ '室内消火栓', '室内消火栓' ], ['室内消火栓', '室内消火栓'],
[ '供水管网', '供水管网'], ['供水管网', '供水管网'],
[ '湿式自动喷淋系统', '湿式自动喷淋系统'], ['湿式自动喷淋系统', '湿式自动喷淋系统'],
[ '水幕系统', '水幕系统' ], ['水幕系统', '水幕系统'],
[ '消防泵房', '消防泵房'], ['消防泵房', '消防泵房'],
[ '水泵接合器(地上)', '水泵接合器'], ['水泵接合器(地上)', '水泵接合器'],
[ '水泵接合器(地下)', '水泵接合器'], ['水泵接合器(地下)', '水泵接合器'],
[ '水泵接合器(墙壁)', '水泵接合器'], ['水泵接合器(墙壁)', '水泵接合器'],
[ '消防水泵房', '消防水泵房'], ['水泵接合器(喷淋)', '水泵接合器'],
[ '箱式消火栓', '箱式消火栓'], ['水泵接合器(消防)', '水泵接合器'],
[ '固定水炮', '消防水炮' ], ['消防水泵房', '消防水泵房'],
[ '消防水罐', '储水罐'], ['箱式消火栓', '箱式消火栓'],
[ '消防水罐2', '储水罐'], ['固定水炮', '消防水炮'],
[ '卧式水罐', '储水罐'], ['消防水罐', '储水罐'],
[ '消防泵', '水泵' ], ['消防水罐2', '储水罐'],
[ '泡沫泵', '水泵' ], ['卧式水罐', '储水罐'],
[ '泡沫泵房', '泡沫站'], ['消防泵', '水泵'],
[ '泡沫栓', '泡沫栓' ], ['泡沫泵', '水泵'],
[ '泡沫枪', '泡沫枪'], ['泡沫泵房', '泡沫站'],
[ '泡沫发生器', '泡沫发生器' ], ['泡沫栓', '泡沫栓'],
[ '消防管网', '消防管网'], ['泡沫枪', '泡沫枪'],
[ '泡沫管网', '消防管网'], ['泡沫发生器', '泡沫发生器'],
[ 'DCS控制室', 'DCS控制室'] ['消防管网', '消防管网'],
['泡沫管网', '消防管网'],
['DCS控制室', 'DCS控制室']
]); ]);
/** * * /** * *
@ -80,15 +82,15 @@ export class CanvasShareDataService {
public sendMessage(message: any) { public sendMessage(message: any) {
this._sendMessage.next(message); this._sendMessage.next(message);
} }
public getMessage(): Observable <any> { public getMessage(): Observable<any> {
return this._sendMessage.asObservable(); return this._sendMessage.asObservable();
} }
//分段上传 //分段上传
sectionUpload (companyId:string,file) { sectionUpload(companyId: string, file) {
let data = {filename: file.name} let data = { filename: file.name }
return new Promise ((resolve, reject)=>{ return new Promise((resolve, reject) => {
this.http.post(`/api/NewMultipartUpload/PlanPlatform/${companyId}/DisposalNode`,{},{params:data}).subscribe(async (data:any)=>{ //初始化分段上传 this.http.post(`/api/NewMultipartUpload/PlanPlatform/${companyId}/DisposalNode`, {}, { params: data }).subscribe(async (data: any) => { //初始化分段上传
let objectName = data.objectName let objectName = data.objectName
let uploadId = data.uploadId let uploadId = data.uploadId
let PartNumberETag = []; //每次返回需要保存的信息 let PartNumberETag = []; //每次返回需要保存的信息
@ -96,30 +98,30 @@ export class CanvasShareDataService {
let fileSize = file.size || null //上传文件的总大小 let fileSize = file.size || null //上传文件的总大小
let shardSize = 5 * 1024 * 1024 //5MB一个分片 let shardSize = 5 * 1024 * 1024 //5MB一个分片
let allSlice = Math.ceil(fileSize / shardSize) //总文件/5MB===共分多少段 let allSlice = Math.ceil(fileSize / shardSize) //总文件/5MB===共分多少段
for (let i = 0;i < allSlice;i++) { //循环分段上传 for (let i = 0; i < allSlice; i++) { //循环分段上传
let start = i * shardSize //切割文件开始位置 let start = i * shardSize //切割文件开始位置
let end = Math.min(fileSize, start + shardSize); //切割文件结束位置 let end = Math.min(fileSize, start + shardSize); //切割文件结束位置
let formData = new FormData() let formData = new FormData()
formData.append("file",file.slice(start, end)) formData.append("file", file.slice(start, end))
//同步写法实现异步调用 //同步写法实现异步调用
let result = await new Promise((resolve, reject) => { let result = await new Promise((resolve, reject) => {
// await 需要后面返回一个 promise 对象 // await 需要后面返回一个 promise 对象
this.http.post(`/api/MultipartUpload/PlanPlatform/${objectName}?uploadId=${uploadId}&partNumber=${i+1}`,formData).subscribe((data:any)=>{ this.http.post(`/api/MultipartUpload/PlanPlatform/${objectName}?uploadId=${uploadId}&partNumber=${i + 1}`, formData).subscribe((data: any) => {
let msg = { "partNumber":data.partNumber || null, "eTag": data.eTag || null } let msg = { "partNumber": data.partNumber || null, "eTag": data.eTag || null }
resolve(msg) // 调用 promise 内置方法处理成功 resolve(msg) // 调用 promise 内置方法处理成功
}) })
}); });
PartNumberETag.push(result) PartNumberETag.push(result)
if (PartNumberETag.length === allSlice) { //分块上传完成 if (PartNumberETag.length === allSlice) { //分块上传完成
let data = PartNumberETag let data = PartNumberETag
let paramsData = {uploadId:uploadId} let paramsData = { uploadId: uploadId }
this.http.post(`/api/CompleteMultipartUpload/PlanPlatform/${objectName}`,data,{params:paramsData}).subscribe(data=>{ this.http.post(`/api/CompleteMultipartUpload/PlanPlatform/${objectName}`, data, { params: paramsData }).subscribe(data => {
resolve(objectName) resolve(objectName)
}) })
} }
}//for循环 }//for循环
//分块 处理 //分块 处理
@ -128,7 +130,7 @@ export class CanvasShareDataService {
} }
// 处置节点 筛选出 匹配数据 匹配不到 return undefined // 处置节点 筛选出 匹配数据 匹配不到 return undefined
findDisposalNode(parentId: string= null, name: string= null) { findDisposalNode(parentId: string = null, name: string = null) {
if (parentId && name) { // 匹配 父id, name if (parentId && name) { // 匹配 父id, name
const returnData = this.allDisposalNode.find(item => item.parentId === parentId && item.name === name); const returnData = this.allDisposalNode.find(item => item.parentId === parentId && item.name === name);
return returnData; return returnData;
@ -155,7 +157,7 @@ export class CanvasShareDataService {
/** /**
* *
*/ */
public deleteBuildingDataByCurrentFloorData():void { public deleteBuildingDataByCurrentFloorData(): void {
Object.keys(this.originaleveryStoreyData.data).forEach((key) => { Object.keys(this.originaleveryStoreyData.data).forEach((key) => {
// 删除建筑数据 // 删除建筑数据
delete this.originalcompanyBuildingData.data[key]; delete this.originalcompanyBuildingData.data[key];
@ -295,7 +297,22 @@ export class CanvasShareDataService {
facility.Id = ''; facility.Id = '';
facility.Name = this.facilityAssetsName.get(item.Name); facility.Name = this.facilityAssetsName.get(item.Name);
facility.AssetName = item.Name; facility.AssetName = item.Name;
facility.PropertyInfos = item.PropertyInfos; facility.PropertyInfos = [];
item.PropertyInfos.forEach(e => {
var p: PropertyInfo = new PropertyInfo();
p.Enabled = e.Enabled;
p.Order = e.Order;
p.PhysicalUnit = e.PhysicalUnit;
p.PropertyName = e.PropertyName;
p.PropertyType = e.PropertyType;
p.PropertyValue = e.PropertyValue.toString();
p.Required = e.Required;
p.RuleName = e.RuleName;
p.RuleValue = e.RuleValue;
p.Tag = e.Tag;
p.Visible = e.Visible;
facility.PropertyInfos.push(p);
});
facility.SitePlanId = item.FloorId; facility.SitePlanId = item.FloorId;
list.push(facility); list.push(facility);
} }
@ -316,7 +333,22 @@ export class CanvasShareDataService {
facility.Id = ''; facility.Id = '';
facility.Name = this.facilityAssetsName.get(item.Name); facility.Name = this.facilityAssetsName.get(item.Name);
facility.AssetName = item.Name; facility.AssetName = item.Name;
facility.PropertyInfos = item.PropertyInfos; facility.PropertyInfos = [];
item.PropertyInfos.forEach(e => {
var p: PropertyInfo = new PropertyInfo();
p.Enabled = e.Enabled;
p.Order = e.Order;
p.PhysicalUnit = e.PhysicalUnit;
p.PropertyName = e.PropertyName;
p.PropertyType = e.PropertyType;
p.PropertyValue = e.PropertyValue.toString();
p.Required = e.Required;
p.RuleName = e.RuleName;
p.RuleValue = e.RuleValue;
p.Tag = e.Tag;
p.Visible = e.Visible;
facility.PropertyInfos.push(p);
});
facility.BuildingAreaId = item.FloorId; facility.BuildingAreaId = item.FloorId;
list.push(facility); list.push(facility);
} }
@ -365,7 +397,7 @@ export class CompanyAdjoinInfo {
* *
*/ */
export class BuildingAdjoinInfo { export class BuildingAdjoinInfo {
public BuildingId: string; public BuildingId: string;
public Id: string; public Id: string;
public Name: string; public Name: string;
public Direction: number; public Direction: number;
@ -407,7 +439,7 @@ export class CompanyFacilityAssetInfo {
public Id: string; public Id: string;
public Name: string; public Name: string;
public AssetName: string; public AssetName: string;
public PropertyInfos: string; public PropertyInfos: PropertyInfo[];
public AssetId: string; public AssetId: string;
public CompanyId: string; public CompanyId: string;
public SitePlanId: string; public SitePlanId: string;
@ -419,7 +451,7 @@ export class BuildingFacilityAssetInfo {
public Id: string; public Id: string;
public Name: string; public Name: string;
public AssetName: string; public AssetName: string;
public PropertyInfos: string; public PropertyInfos: PropertyInfo[];
public AssetId: string; public AssetId: string;
public BuildingId: string; public BuildingId: string;
public BuildingAreaId: string; public BuildingAreaId: string;
@ -559,62 +591,62 @@ export class DisposalNode {
* *
*/ */
export enum Direction { export enum Direction {
/** /**
* *
*/ */
East, East,
/** /**
* 西 * 西
*/ */
West, West,
/** /**
* *
*/ */
South, South,
/** /**
* *
*/ */
North, North,
/** /**
* *
*/ */
Southeast, Southeast,
/** /**
* 西 * 西
*/ */
Southwest, Southwest,
/** /**
* *
*/ */
Northeast, Northeast,
/** /**
* 西 * 西
*/ */
Northwest Northwest
} }
/** /**
* *
*/ */
export enum WindScale { export enum WindScale {
WS0, WS0,
WS1, WS1,
WS2, WS2,
WS3, WS3,
WS4, WS4,
WS5, WS5,
WS6, WS6,
WS7, WS7,
WS8, WS8,
WS9, WS9,
WS10, WS10,
WS11, WS11,
WS12, WS12,
WS13, WS13,
WS14, WS14,
WS15, WS15,
WS16, WS16,
WS17, WS17,
WS18 WS18
} }
/** /**
* *
@ -636,9 +668,9 @@ export class DisposalNodeData {
* *
*/ */
public BackgroundImageUrl: string; public BackgroundImageUrl: string;
/** /**
* *
*/ */
public BackgroundImageAngle: number; public BackgroundImageAngle: number;
/** /**
* *
@ -670,105 +702,105 @@ export class FloorNodeData {
* *
*/ */
export class AssetData { export class AssetData {
/// <summary> /// <summary>
/// 模板编号 /// 模板编号
/// </summary> /// </summary>
public TemplateId: string; public TemplateId: string;
/// <summary> /// <summary>
/// 编号 /// 编号
/// </summary> /// </summary>
public Id: string; public Id: string;
/// <summary> /// <summary>
/// 名称 /// 名称
/// </summary> /// </summary>
public Name: string; public Name: string;
/// <summary> /// <summary>
/// 角度 /// 角度
/// </summary> /// </summary>
public Angle: number; public Angle: number;
/// <summary> /// <summary>
/// 颜色 /// 颜色
/// </summary> /// </summary>
public Color: string; public Color: string;
/// <summary> /// <summary>
/// 坐标 /// 坐标
/// </summary> /// </summary>
public Point: PIXI.Point; public Point: PIXI.Point;
/// <summary> /// <summary>
/// 宽度 /// 宽度
/// </summary> /// </summary>
public Width: number; public Width: number;
/// <summary> /// <summary>
/// 高度 /// 高度
/// </summary> /// </summary>
public Height: number; public Height: number;
/// <summary> /// <summary>
/// 是否启用 /// 是否启用
/// </summary> /// </summary>
public Enabled: boolean; public Enabled: boolean;
/// <summary> /// <summary>
/// 填充方式 /// 填充方式
/// </summary> /// </summary>
public FillMode: FillMode; public FillMode: FillMode;
/// <summary> /// <summary>
/// 图片地址 /// 图片地址
/// </summary> /// </summary>
public ImageUrl: string; public ImageUrl: string;
/// <summary> /// <summary>
/// 是否固定大小 /// 是否固定大小
/// </summary> /// </summary>
public FixedSize: boolean; public FixedSize: boolean;
/// <summary> /// <summary>
/// 点路径 /// 点路径
/// </summary> /// </summary>
public MultiPoint: PIXI.Point[]; public MultiPoint: PIXI.Point[];
/// <summary> /// <summary>
/// 建筑ID /// 建筑ID
/// </summary> /// </summary>
public BuildingId: string; public BuildingId: string;
/// <summary> /// <summary>
/// 单位ID /// 单位ID
/// </summary> /// </summary>
public CompanyId: string; public CompanyId: string;
/// <summary> /// <summary>
/// 楼层编号 /// 楼层编号
/// </summary> /// </summary>
public FloorId: string; public FloorId: string;
/// <summary> /// <summary>
/// 楼层名称 /// 楼层名称
/// </summary> /// </summary>
public FloorName: string; public FloorName: string;
/// <summary> /// <summary>
/// 消防要素编号 /// 消防要素编号
/// </summary> /// </summary>
public FireElementId: string; public FireElementId: string;
/// <summary> /// <summary>
/// 属性列表 /// 属性列表
/// </summary> /// </summary>
public PropertyInfos: PropertyInfo[]; public PropertyInfos: PropertyInfo[];
/// <summary> /// <summary>
/// 交互方式 /// 交互方式
/// </summary> /// </summary>
public InteractiveMode: InteractiveMode; public InteractiveMode: InteractiveMode;
/// <summary> /// <summary>
/// 是否来自建筑 /// 是否来自建筑
/// </summary> /// </summary>
public IsFromBuilding: boolean; public IsFromBuilding: boolean;
/// <summary> /// <summary>
/// 渲染方式。 /// 渲染方式。
/// </summary> /// </summary>
public DrawMode: ImageType; public DrawMode: ImageType;
/// <summary> /// <summary>
/// 9宫格边框数值。 /// 9宫格边框数值。
/// </summary> /// </summary>
public Border: Border; public Border: Border;
/// <summary> /// <summary>
/// 厚度。 /// 厚度。
/// </summary> /// </summary>
public Thickness: number; public Thickness: number;
/// <summary> /// <summary>
/// 素材类型 /// 素材类型
/// </summary> /// </summary>
public GameMode: GameMode; public GameMode: GameMode;
} }
/** /**
@ -809,9 +841,9 @@ export enum ImageType {
*/ */
export class Border { export class Border {
public x: number; public x: number;
public y: number; public y: number;
public z: number; public z: number;

9
src/app/data-collection/water-collection/water-collection.component.html

@ -79,8 +79,13 @@
</div> </div>
</div> </div>
<div class="btnbox"> <div class="btnbox">
<span class="save" (click)="save()"><mat-icon>save</mat-icon>保存</span> <span class="state" *ngIf="waterData.verifyState == 3">(待审核)</span>
<span class="submitAudit"><mat-icon>open_in_browser</mat-icon>提交审核</span> <span class="state" style="color: rgb(92, 214, 78);" *ngIf="waterData.verifyState == 4">(审核通过)</span>
<span class="state" *ngIf="waterData.verifyState == 5">(审核驳回)</span>
<span class="submitAudit" *ngIf="waterData.verifyState != 3 && waterData.verifyState != 4" (click)="submitAudit()"><mat-icon>open_in_browser</mat-icon>提交审核</span>
<span class="state" *ngIf="waterData.verifyState == 3 || waterData.verifyState == 4" (click)="cancelAudit()">撤销审核</span>
<span class="save state" *ngIf="waterData.verifyState == 5 || waterData.verifyState != 3 && waterData.verifyState != 4" (click)="save()"><mat-icon>save</mat-icon>保存</span>
<span class="close" (click)="close()"><mat-icon>close</mat-icon>关闭</span> <span class="close" (click)="close()"><mat-icon>close</mat-icon>关闭</span>
</div> </div>
</div> </div>

5
src/app/data-collection/water-collection/water-collection.component.scss

@ -254,8 +254,11 @@
span:hover{ span:hover{
text-decoration: underline; text-decoration: underline;
} }
.state{
margin-right:30px;
}
.submitAudit{ .submitAudit{
margin: 0 30px; margin-right:30px;
} }
.close{ .close{
margin-right: 30px; margin-right: 30px;

25
src/app/data-collection/water-collection/water-collection.component.ts

@ -198,7 +198,7 @@ export class WaterCollectionComponent implements OnInit {
//点击水源列表 //点击水源列表
selectedLiIndex:any selectedLiIndex:any
clickWaterLi(item,index){ clickWaterLi(item,index){
// console.log(item) console.log(item)
if(this.selectedLiIndex != index){ if(this.selectedLiIndex != index){
this.selectedLiIndex = index this.selectedLiIndex = index
this.clearData() this.clearData()
@ -430,6 +430,29 @@ export class WaterCollectionComponent implements OnInit {
}) })
} }
}
//提交审核
submitAudit(){
let isTrue = window.confirm('请确认保存后提交审核,否则将无法审核最新内容,是否继续?')
if(isTrue){
console.log('提交审核的水源',this.waterData)
let body = {
title: this.waterData.name,
operation: this.waterData.verifyState == -1 ? 0 : 1,//操作方式
contentType: 12,//水源类型
itemId: this.waterData.id,
verifyState: 3,
}
this.http.post('/api/ContentVerifies',body).subscribe((data) => {
console.log('提交成功',data)
this.waterData.verifyState = 3
})
}
}
//撤销审核
cancelAudit(){
} }
//关闭 //关闭
close(){ close(){

577
src/app/key-unit/basicinfo-look/basicinfo.component.html

@ -1,11 +1,10 @@
<div style="height: 100%;display: flex; flex-direction: column;"> <div style="height: 100%;display: flex; flex-direction: column;overflow: hidden;">
<!-- header --> <!-- header -->
<mat-accordion> <mat-accordion>
<mat-expansion-panel expanded hideToggle> <mat-expansion-panel expanded>
<mat-expansion-panel-header style="color: black;"> <mat-expansion-panel-header style="color: black;">
<mat-panel-title> <mat-panel-title>
单位信息 单位信息
<mat-icon style="position: absolute;right:30px;">keyboard_arrow_down</mat-icon>
</mat-panel-title> </mat-panel-title>
</mat-expansion-panel-header> </mat-expansion-panel-header>
<div class="topbox"> <div class="topbox">
@ -16,7 +15,7 @@
<span style="color: red;">*</span> <span style="color: red;">*</span>
<span>统一社会信用代码:</span> <span>统一社会信用代码:</span>
<mat-form-field> <mat-form-field>
<input readonly matInput id="creditcode" name="creditcode" type='text' #usci="ngModel" <input matInput id="creditcode" name="creditcode" type='text' #usci="ngModel"
required minlength="1" maxlength="18" required minlength="1" maxlength="18"
[(ngModel)]="unitinfo.usci" [(ngModel)]="unitinfo.usci"
(focus)="closeorganizationbox()" (focus)="closeorganizationbox()"
@ -31,8 +30,8 @@
<div class="inputbox"> <div class="inputbox">
<span style="color: red;">*</span> <span style="color: red;">*</span>
<span>单位类型:</span> <span>单位类型:</span>
<mat-form-field> <mat-form-field (click)="closeorganizationbox()">
<mat-select disabled readonly required name="unittype" [(ngModel)]="defaultbuildingTypes"> <mat-select required name="unittype" [(ngModel)]="defaultbuildingTypes">
<mat-option [value]="item.id" *ngFor="let item of allunittype">{{item.name}}</mat-option> <mat-option [value]="item.id" *ngFor="let item of allunittype">{{item.name}}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
@ -41,7 +40,7 @@
<span style="color: red;">*</span> <span style="color: red;">*</span>
<span>联系人:</span> <span>联系人:</span>
<mat-form-field> <mat-form-field>
<input readonly matInput id="linkman" name="linkman" type='text' <input matInput id="linkman" name="linkman" type='text'
required minlength="1" required minlength="1"
[(ngModel)]="unitinfo.contacts" [(ngModel)]="unitinfo.contacts"
(focus)="closeorganizationbox()" (focus)="closeorganizationbox()"
@ -52,7 +51,7 @@
<span style="color: red;">*</span> <span style="color: red;">*</span>
<span>联系电话:</span> <span>联系电话:</span>
<mat-form-field> <mat-form-field>
<input readonly matInput id="linkphone" name="linkphone" type='text' #linkphone="ngModel" <input matInput id="linkphone" name="linkphone" type='text' #linkphone="ngModel"
required pattern="^(?:\+?86)?1(?:3\d{3}|5[^4\D]\d{2}|8\d{3}|7(?:[35-8]\d{2}|4(?:0\d|1[0-2]|9\d))|9[0135-9]\d{2}|66\d{2})\d{6}$" required pattern="^(?:\+?86)?1(?:3\d{3}|5[^4\D]\d{2}|8\d{3}|7(?:[35-8]\d{2}|4(?:0\d|1[0-2]|9\d))|9[0135-9]\d{2}|66\d{2})\d{6}$"
[(ngModel)]="unitinfo.phone" [(ngModel)]="unitinfo.phone"
(focus)="closeorganizationbox()" (focus)="closeorganizationbox()"
@ -68,41 +67,59 @@
<span style="color: red;">*</span> <span style="color: red;">*</span>
<span>辖区中队:</span> <span>辖区中队:</span>
<mat-form-field style="width: 538px;"> <mat-form-field style="width: 538px;">
<input readonly matInput id="organization" name="organization" type='text' <input matInput id="organization" name="organization" type='text'
required minlength="1" required minlength="1"
[(ngModel)]="selectedorganization" [(ngModel)]="selectedorganization"
(focus)="openorganizationbox()"
readonly="value" > readonly="value" >
</mat-form-field> </mat-form-field>
</div> </div>
<div id="organizationbox" class="organizationbox" *ngIf="isorganizationbox">
<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 class="inputbox" style="width: 700px;"> <div class="inputbox" style="width: 700px;">
<span style="color: red;">*</span> <span style="color: red;">*</span>
<span>单位地址:</span> <span>单位地址:</span>
<mat-form-field style="width: 538px;"> <mat-form-field style="width: 538px;">
<input readonly matInput id="unitaddress" name="unitaddress" type='text' <input matInput id="unitaddress" name="unitaddress" type='text'
required minlength="1" required minlength="1"
[(ngModel)]="unitinfo.address" [(ngModel)]="unitinfo.address"
(focus)="closeorganizationbox()"> (focus)="closeorganizationbox()">
</mat-form-field> </mat-form-field>
</div> </div>
<div class="uploadimg" (click)="lookmaster()"> <div class="uploadimg">
<span>单位照片:</span> <span>单位照片:</span>
<div class="uploadingimg"> <div class="uploadingimg" (click)="lookmaster()">
<img [src]="imgsrc" alt="" style="width: 299px; height: 170px;" > <img [src]="imgsrc ? imgsrc : noImg" alt="" style="width: 299px; height: 170px;" >
</div> </div>
<mat-spinner *ngIf="isspinner" diameter= 50></mat-spinner> <mat-spinner *ngIf="isspinner" diameter= 50></mat-spinner>
</div> </div>
<!-- <div class="image"> <!-- <div class="image" (click)="closeorganizationbox()">
<input id="selectedfile" type="file" name="imgFile" accept=".jpg,.png,.jpeg,.gif,.webp"> <input id="selectedfile" type="file" ng2FileSelect [uploader]="uploader" (change)="filechange($event)" name="imgFile" accept=".jpg,.png,.jpeg,.gif,.webp">
</div> --> </div> -->
<!-- <div class="addbtn">
<button type="submit" color="primary" class="submit1" mat-button mat-raised-button>保存</button>
</div> -->
</div> </div>
<div class="mainright" id="setPosition"> <div class="mainright" id="setPosition">
<div style="width: 100%;height: 100%;" id="container"> <div style="width: 100%;height: 100%;" id="container">
</div> </div>
<div class="gistopbox" *ngIf="isGisTopBox"> <div class="gistopbox" *ngIf="isGisTopBox">
<div class="positionItem"> <div class="positionItem">
<span> <span>
@ -120,9 +137,18 @@
{{markerPosition.y || '暂未标注'}} {{markerPosition.y || '暂未标注'}}
</div> </div>
</div> </div>
<!-- <div class="setPosition" (click)="setPosition()"> <div class="setPosition">
<mat-icon style="width: 22px;height: 22px;font-size: 22px;">place</mat-icon> 位置 <mat-icon style="width: 22px;height: 22px;font-size: 22px;">place</mat-icon> 位置
</div> --> </div>
</div>
<div class="gistopbox hidden" [ngClass]="{'show': isGisTopBoxTwo}">
<div class="inputBox">
<span>位置: </span>
<input name="position" [(ngModel)]="searchTitle" id="tipinput" class="positionInput" type="text" autocomplete="off">
</div>
<div class="setPosition">
搜索
</div>
</div> </div>
</div> </div>
</div> </div>
@ -130,61 +156,56 @@
</div> </div>
</mat-expansion-panel> </mat-expansion-panel>
</mat-accordion> </mat-accordion>
<!-- body --> <!-- body -->
<div class="bottombox" style="flex: 70%;overflow-y: auto;" > <div class="bodyBox" id="basicInfoBody">
<div class="houseinfobox" style="height: 100%; overflow-y: auto;padding-bottom: 34px; box-sizing:border-box"> <!-- <div>
<!-- <button type="button" mat-icon-button class="addhouseinfo"><mat-icon style="font-size: 38px;">add_circle_outline</mat-icon></button> --> <button type="button" mat-icon-button (click)="addhouseinfo()" class="addBuilding"><mat-icon>add_circle_outline</mat-icon></button>
<mat-tab-group style="height: 100%;;" > </div> -->
<mat-tab [label]="item.username" *ngFor="let item of houses;let key = index"> <div style="height: 100%; box-sizing:border-box;overflow-y: auto;padding-left: 26px;">
<form style="height: 100%; overflow-y:auto; display: block;" (ngSubmit)="onSubmit2(form.value,item,key,form.invalid)" #form="ngForm" class="example-container"> <mat-tab-group style="height: 100%;" [selectedIndex]="selectedIndex" (selectedTabChange)="selectedTabChange($event)">
<mat-tab *ngFor="let item of houses;let key = index" label="{{item.name}}">
<!-- 正常建筑 --> <ng-template matTabContent>
<div class="highinfo" *ngIf="item.tongyong"> <form *ngIf="item.data && item.data.length!=0" style="height: 100%; overflow-y:auto; display: block;" (ngSubmit)="onSubmitBuildingInfo(form.value,item,key,form.invalid)" #form="ngForm" class="example-container">
<div class="houseinfoinput" > <div class="buildInfoInput" >
<span>建筑名称:</span> <span>建筑名称:</span>
<mat-form-field> <mat-form-field>
<input readonly matInput id="housename" name="housename" type='text' <input required matInput name="buildingName" type='text' minlength="1" [(ngModel)]="item.name">
minlength="1" [(ngModel)]="item.name" </mat-form-field>
> <span style="color: red;">*</span>
</mat-form-field> </div>
<span style="color: red;">*</span> <div class="buildInfoInput">
</div> <span>建筑类型:</span>
<div class="houseinfoinput"> <mat-form-field>
<span>建筑类型:</span> <mat-select disabled name="buildingTypeName" [(ngModel)]="item.buildingTypes[0].name">
<mat-form-field> <mat-option [value]="n.name" *ngFor="let n of allunittype" (click)="templateBuildtype(n,item,key)">{{n.name}}</mat-option>
<mat-select disabled readonly name="unittype" [(ngModel)]="item.buildtype"> </mat-select>
<mat-option [value]="n.name" *ngFor="let n of allunittype">{{n.name}}</mat-option> </mat-form-field>
</mat-select> <span style="color: red;">*</span>
</mat-form-field> </div>
<span style="color: red;">*</span> <div *ngFor="let element of item.data[0].buildingBasicGroups;let groupsIndex = index "style="float: left;width:100%">
</div> <!-- 类型为表单并且不是 罐区 -->
<div *ngIf="element.type == 0 && element.name.indexOf('罐区') == -1">
<div *ngFor="let item of item.buildingBasicGroups;let www = index" style="float: left;"> <p style="font-size: 22px;">{{element.name}}</p>
<h1 style="font-size: 22px;">{{item.name}}</h1> <div class="buildInfoInput" *ngFor="let i of element.propertyInfos;let inputIndex = index" style="float: left;margin-left: 250px;position: relative;">
<div class="houseinfoinput" *ngFor="let i of item.propertyInfos" style="float: left;margin-left: 250px;position: relative;">
<span>{{i.propertyName}}<span *ngIf="i.physicalUnit">({{i.physicalUnit}})</span></span> <span>{{i.propertyName}}<span *ngIf="i.physicalUnit">({{i.physicalUnit}})</span></span>
<!-- 如果类型是文本 --> <!-- 如果类型是文本 -->
<mat-form-field *ngIf="i.propertyType == 0 && i.propertyName != '耐火等级'"> <mat-form-field *ngIf="i.propertyType == 0 && i.propertyName != '耐火等级'">
<input readonly matInput name="{{i.propertyName}}{{www}}" type='text' <input matInput name="{{groupsIndex}}{{inputIndex}}" type='text'
required="{{ i.required==true ? 'true' : 'false' }}" required="{{ i.required==true ? 'true' : 'false' }}"
[(ngModel)]="i.propertyValue"> [(ngModel)]="i.propertyValue">
</mat-form-field> </mat-form-field>
<!-- 如果类型是数字 --> <!-- 如果类型是数字 -->
<mat-form-field *ngIf="i.propertyType == 2 && i.propertyName != '耐火等级'"> <mat-form-field *ngIf="i.propertyType == 2 && i.propertyName != '耐火等级'">
<input readonly matInput name="{{i.propertyName}}{{www}}" type='number' <input matInput name="{{groupsIndex}}{{inputIndex}}" type='number'
required="{{ i.required==true ? 'true' : 'false' }}" required="{{ i.required==true ? 'true' : 'false' }}"
[(ngModel)]="i.propertyValue" [(ngModel)]="i.propertyValue"
(change)="inputchange($event,i.ruleName,i.ruleValue,i)"
> >
<!-- <mat-error *ngIf="isshowrule">{{rulevalue}}</mat-error> -->
</mat-form-field> </mat-form-field>
<!-- 如果类型是耐火等级 --> <!-- 如果类型是耐火等级 -->
<mat-form-field *ngIf="i.propertyName == '耐火等级'"> <mat-form-field *ngIf="i.propertyName == '耐火等级'">
<mat-select readonly name="{{i.propertyName}}{{www}}" required="{{ i.required==true ? 'true' : 'false' }}" placeholder="请选择耐火等级" [(ngModel)]="i.propertyValue"> <mat-select name="{{groupsIndex}}{{inputIndex}}" required="{{ i.required==true ? 'true' : 'false' }}" placeholder="请选择耐火等级" [(ngModel)]="i.propertyValue">
<mat-option value="0">1级</mat-option> <mat-option value="0">1级</mat-option>
<mat-option value="1">2级</mat-option> <mat-option value="1">2级</mat-option>
<mat-option value="2">3级</mat-option> <mat-option value="2">3级</mat-option>
@ -192,352 +213,132 @@
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<!-- 如果类型是多行文本 --> <!-- 如果类型是多行文本 -->
<textarea readonly *ngIf="i.propertyType == 1 && i.propertyName != '耐火等级'" style="width: 180px;height: 60px;" required="{{ i.required==true ? 'true' : 'false' }}" [(ngModel)]="i.propertyValue" name="{{i.propertyName}}{{key}}"></textarea> <textarea *ngIf="i.propertyType == 1 && i.propertyName != '耐火等级'" style="width: 180px;height: 60px;" required="{{ i.required==true ? 'true' : 'false' }}" [(ngModel)]="i.propertyValue" name="{{groupsIndex}}{{inputIndex}}"></textarea>
<span style="color: red;" *ngIf="i.required">*</span> <span style="color: red;" *ngIf="i.required">*</span>
<div *ngIf="i.isshowrule" style="position: absolute; <div *ngIf="i.isshowrule" style="position: absolute;left: 205px;top: 45px;font-size: 11px;color: red;">
left: 205px;
top: 45px;
font-size: 11px;
color: red;">
<span>{{i.rulevalue}}</span> <span>{{i.rulevalue}}</span>
</div> </div>
</div> </div>
</div> </div>
<!-- 类型为表格 并且不是 罐区 -->
<div class="CustomData" style="width: 200px;"> <div *ngIf="element.type == 1 && element.name.indexOf('罐区') == -1">
<!-- <mat-checkbox name="checkbuilding" [(ngModel)]="item.isCustomData" style="float: left;margin-right: 10px;"></mat-checkbox> --> <p style="font-size: 22px;">
<h1 style="font-size: 22px;width: 200px;">自定义信息</h1> {{element.name}}
</p>
<table *ngIf="element.submitted">
<tr>
<th *ngFor="let item of element.propertyInfos[0].origin;let index = index">
{{item.propertyName}}
<span style="color: red;" *ngIf="item.required">*</span>
</th>
</tr>
<tr *ngFor="let item of element.propertyInfos;let line = index">
<td *ngFor="let i of item.origin;let list = index">
<input *ngIf="i.propertyType != 1" style="height:45px" class="tankinfo" name="{{element.name}}{{line + 1}}-{{list + 1}}" type="{{i.propertyType == 0 ? 'text' : 'number'}}"
required="{{ i.required==true ? 'true' : 'false' }}" [(ngModel)]="i.propertyValue">
<textarea class="tankinfo" *ngIf="i.propertyType == 1" required="{{ i.required==true ? 'true' : 'false' }}" [(ngModel)]="i.propertyValue" name="{{element.name}}{{line + 1}}{{list + 1}}">
</textarea>
</td>
</tr>
</table>
</div> </div>
<div *ngIf="item.isCustomData" style="position: relative;"> <!-- 类型为表单 是罐区-->
<!-- <button style="position: absolute;left: 0;" type="button" mat-icon-button class="addCustomData"><mat-icon style="font-size: 38px;">add_circle_outline</mat-icon></button> <div *ngIf="element.type == 0 && element.name.indexOf('罐区') != -1">
<button style="position: absolute;left:60px;" type="button" mat-icon-button class="deleteCustomData"><mat-icon style="font-size: 38px;">remove_circle_outline</mat-icon></button> --> <p style="font-size: 22px;">
<div class="houseinfoinput" style="float: left;margin-left: 250px;" *ngFor="let i of item.buildingCustomData.customProperties;let key = index"> <span *ngIf="element.name == '罐区1'">罐区信息</span>
<mat-form-field> </p>
<input readonly matInput type='text' name="{{key}}1CustomData" <div *ngIf="element.submitted" >
required <p style="font-size: 22px;">{{element.name}}</p>
[(ngModel)]="i.name">
</mat-form-field>
<span>:</span>
<mat-form-field>
<input readonly matInput type='text' name="{{key}}2CustomData"
required
[(ngModel)]="i.value">
</mat-form-field>
<span style="color: red;" *ngIf="i.required">*</span>
</div>
</div>
</div>
<!-- 石油化工 -->
<div class="highinfo" *ngIf="item.isshiyou;let bigkey = index">
<div class="basicinfobox">
<div class="houseinfoinput">
<span>建筑名称:</span>
<mat-form-field>
<input readonly matInput id="housename" name="housename" type='text'
required minlength="1" [(ngModel)]="item.name"
>
</mat-form-field>
<span style="color: red;">*</span>
</div>
<div class="houseinfoinput" >
<span>建筑类型:</span>
<mat-form-field>
<mat-select disabled required name="unittype" [(ngModel)]="item.buildtype">
<mat-option [value]="n.name" *ngFor="let n of allunittype">{{n.name}}</mat-option>
</mat-select>
</mat-form-field>
<span style="color: red;">*</span>
</div>
<h1 style="font-size: 22px;">{{item.buildingBasicGroups[0].name}}</h1>
<div class="houseinfoinput" *ngFor="let i of item.buildingBasicGroups[0].propertyInfos;let smkey = index" style="float: left;margin-left: 250px;position: relative;">
<span>{{i.propertyName}} <span *ngIf="i.physicalUnit">({{i.physicalUnit}})</span></span>
<!-- 如果类型是文本 --> <div class="buildInfoInput" *ngFor="let i of element.propertyInfos;let inputIndex = index" style="float: left;margin-left: 250px;position: relative;">
<mat-form-field *ngIf="i.propertyType == 0 && i.propertyName != '耐火等级'"> <span>{{i.propertyName}}<span *ngIf="i.physicalUnit">({{i.physicalUnit}})</span></span>
<input readonly matInput name="{{i.propertyName}}" type='text' <!-- 如果类型是文本 -->
required="{{ i.required==true ? 'true' : 'false' }}" <mat-form-field *ngIf="i.propertyType == 0 && i.propertyName != '耐火等级'">
[(ngModel)]="i.propertyValue"> <input matInput name="{{groupsIndex}}{{inputIndex}}" type='text'
</mat-form-field> required="{{ i.required==true ? 'true' : 'false' }}"
[(ngModel)]="i.propertyValue">
<!-- 如果类型是数字 --> </mat-form-field>
<mat-form-field *ngIf="i.propertyType == 2 && i.propertyName != '耐火等级'">
<input readonly matInput name="{{i.propertyName}}" type='number' <!-- 如果类型是数字 -->
required="{{ i.required==true ? 'true' : 'false' }}" <mat-form-field *ngIf="i.propertyType == 2 && i.propertyName != '耐火等级'">
[(ngModel)]="i.propertyValue" <input matInput name="{{groupsIndex}}{{inputIndex}}" type='number'
required="{{ i.required==true ? 'true' : 'false' }}"
> [(ngModel)]="i.propertyValue"
<!-- <mat-error *ngIf="isshowrule">{{rulevalue}}</mat-error> --> (change)="inputchange($event,i.ruleName,i.ruleValue,i)"
</mat-form-field> >
<!-- 如果类型是耐火等级 --> </mat-form-field>
<mat-form-field *ngIf="i.propertyName == '耐火等级'"> <!-- 如果类型是耐火等级 -->
<mat-select readonly name="{{i.propertyName}}" required="{{ i.required==true ? 'true' : 'false' }}" placeholder="请选择耐火等级" [(ngModel)]="i.propertyValue"> <mat-form-field *ngIf="i.propertyName == '耐火等级'">
<mat-option value="0">1级</mat-option> <mat-select name="{{groupsIndex}}{{inputIndex}}" required="{{ i.required==true ? 'true' : 'false' }}" placeholder="请选择耐火等级" [(ngModel)]="i.propertyValue">
<mat-option value="1">2级</mat-option> <mat-option value="0">1级</mat-option>
<mat-option value="2">3级</mat-option> <mat-option value="1">2级</mat-option>
<mat-option value="3">其它</mat-option> <mat-option value="2">3级</mat-option>
</mat-select> <mat-option value="3">其它</mat-option>
</mat-form-field> </mat-select>
<!-- 如果类型是多行文本 --> </mat-form-field>
<textarea readonly *ngIf="i.propertyType == 1 && i.propertyName != '耐火等级'" style="width: 180px;height: 60px;" required="{{ i.required==true ? 'true' : 'false' }}" [(ngModel)]="i.propertyValue" name="{{i.propertyName}}"></textarea> <!-- 如果类型是多行文本 -->
<span style="color: red;" *ngIf="i.required">*</span> <textarea *ngIf="i.propertyType == 1 && i.propertyName != '耐火等级'" style="width: 180px;height: 60px;" required="{{ i.required==true ? 'true' : 'false' }}" [(ngModel)]="i.propertyValue" name="{{groupsIndex}}{{inputIndex}}"></textarea>
<div *ngIf="i.isshowrule" style=" position: absolute;
left: 205px; <span style="color: red;" *ngIf="i.required">*</span>
top: 45px; <div *ngIf="i.isshowrule" style="position: absolute;left: 205px;top: 45px;font-size: 11px;color: red;">
font-size: 11px; <span>{{i.rulevalue}}</span>
color: red;"> </div>
<span>{{i.rulevalue}}</span> </div>
</div>
</div> </div>
</div> </div>
<!-- 类型为表格 是罐区 -->
<div *ngIf="element.type == 1 && element.name.indexOf('罐区') != -1">
<div class="deviceinfo"> <p style="font-size: 22px;" *ngIf="element.submitted">
<div style="width: 200px;"> {{element.name}}
<!-- <mat-checkbox name="item.buildingBasicGroups[1].name" *ngIf="item.buildingBasicGroups[1].isOptional" [(ngModel)]="item.buildingBasicGroups[1].submitted" style="float: left;margin-right: 10px;"></mat-checkbox> --> </p>
<h1 style="font-size: 22px;width: 200px;">{{item.buildingBasicGroups[1].name}}</h1> <table *ngIf="element.submitted">
</div> <tr>
<th *ngFor="let item of element.propertyInfos[0].origin;let index = index">
<table mat-table [dataSource]="devicedataSourcebox[item.buildingId]" class="mat-elevation-z8" *ngIf="item.buildingBasicGroups[1].submitted"> {{item.propertyName}}
<ng-container matColumnDef="name"> <span style="color: red;" *ngIf="item.required">*</span>
<th mat-header-cell *matHeaderCellDef> </th>
<button style="width: 24px;" type="button" mat-icon-button class="adddeviceinfo2" ><mat-icon>add_circle_outline</mat-icon></button> </tr>
<button style="width: 24px;" type="button" mat-icon-button class="removedeviceinfo" ><mat-icon>remove_circle_outline</mat-icon></button> <tr *ngFor="let item of element.propertyInfos;let line = index">
装置区名称<span style="color: red;">*</span></th> <td *ngFor="let i of item.origin;let list = index">
<td mat-cell *matCellDef="let element;let key = index"> <input type="{{i.propertyType == 0 ? 'text' : 'number'}}" style="height:45px" class="tankinfo" name="{{element.name}}{{line + 1}}-{{list + 1}}"
<textarea readonly style="width: 100px;" [(ngModel)]="element.name" name="{{key}}1" required></textarea> required="{{ i.required==true ? 'true' : 'false' }}" [(ngModel)]="i.propertyValue">
</td>
</ng-container>
<ng-container matColumnDef="flow">
<th mat-header-cell *matHeaderCellDef>工艺流程<span style="color: red;">*</span></th>
<td mat-cell *matCellDef="let element;let key = index">
<textarea readonly [(ngModel)]="element.flow" name="{{key}}2" required></textarea>
</td>
</ng-container>
<ng-container matColumnDef="danger">
<th mat-header-cell *matHeaderCellDef>火灾危险性<span style="color: red;">*</span></th>
<td mat-cell *matCellDef="let element;let key = index">
<textarea readonly [(ngModel)]="element.danger" name="{{key}}3" required></textarea>
</td> </td>
</ng-container> </tr>
<ng-container matColumnDef="payattentionto">
<th mat-header-cell *matHeaderCellDef>灭火注意事项</th>
<td mat-cell *matCellDef="let element;let key = index">
<textarea readonly style="width: 100px;" [(ngModel)]="element.payattentionto" name="{{key}}4"></textarea>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table> </table>
</div> </div>
</div>
<div style="width: 200px;">
<!-- <mat-checkbox *ngIf="item.buildingBasicGroups[2].isOptional" name="item.buildingBasicGroups[2].name" [(ngModel)]="item.buildingBasicGroups[2].submitted" style="float: left;margin-right: 10px;"></mat-checkbox> -->
<h1 style="font-size: 22px;width: 200px;">储罐信息</h1>
</div>
<!-- <button *ngIf="item.buildingBasicGroups[2].submitted" type="button" mat-raised-button color="primary" style="margin-top: 30px;margin-right: 5px;">添加储罐</button>
<button *ngIf="item.buildingBasicGroups[2].submitted" type="button" mat-raised-button color="warn" style="margin-top: 30px;" matTooltip="会将此建筑处于末尾的储罐移除">移除末尾储罐</button> -->
<div *ngIf="item.buildingBasicGroups[2].submitted" style="margin-top: 30px;">
<div class="tankinfo" *ngFor="let x of item.bigfor;let www = index">
<p style="font-size: 22px; width: 200px;">{{x[0].name}}</p>
<div class="basicinfobox" >
<div class="houseinfoinput" *ngFor="let i of x[0].propertyInfos;let key = index" style="line-height: 65px;">
<span>{{i.propertyName}} {{i.physicalUnit}}:</span>
<mat-form-field *ngIf="i.propertyType == 0">
<input readonly matInput name="{{www+2}}-tanker-{{key}}" type='text'
required="{{ i.required==true ? 'true' : 'false' }}"
[(ngModel)]="i.propertyValue"
>
</mat-form-field>
<textarea readonly style="width: 180px;height: 45px;" *ngIf="i.propertyType == 1" [(ngModel)]="i.propertyValue" name="{{www+2}}-tanker-{{key}}"></textarea>
<span style="color: red;" *ngIf="i.required">*</span>
</div>
</div> <div class="CustomData" style="width: 200px;margin-top: 60px;">
<p style="font-size: 22px; width: 200px;">{{x[1].name}}</p> <h1 style="font-size: 22px;width: 200px;">自定义信息</h1>
<div class="tankdetailinfo"> </div>
<table #table mat-table [dataSource]="x[1].propertyInfos" class="mat-elevation-z8" style="position: relative;"> <div style="position: relative;" *ngIf="item.isCustomData">
<ng-container matColumnDef="tank">
<th mat-header-cell *matHeaderCellDef>
<!-- <button type="button" mat-icon-button class="adddeviceinfo" style="position: absolute;left: 0;"><mat-icon>add_circle_outline</mat-icon></button>
<button type="button" mat-icon-button class="removedeviceinfo"><mat-icon>remove_circle_outline</mat-icon></button> -->
罐区 </th>
<td mat-cell *matCellDef="let element;let key = index">
<input readonly style="height:45px" class="tankinfo" name="{{www}}{{element.tank}}tank{{key}}" type='text'
[(ngModel)]="element.tank">
</td>
</ng-container>
<ng-container matColumnDef="tankid">
<th mat-header-cell *matHeaderCellDef>罐区编号<span style="color: red;">*</span></th>
<td mat-cell *matCellDef="let element;let key = index">
<input readonly style="height:45px" class="tankinfo" name="{{www}}{{element.tankid}}tank{{key}}" type='text'
required
[(ngModel)]="element.tankid">
</td>
</ng-container>
<ng-container matColumnDef="tankmedium">
<th mat-header-cell *matHeaderCellDef>储存介质<span style="color: red;">*</span></th>
<td mat-cell *matCellDef="let element;let key = index">
<input readonly style="height:45px" class="tankinfo" name="{{www}}{{element.tankmedium}}tank{{key}}" type='text'
required
[(ngModel)]="element.tankmedium">
</td>
</ng-container>
<ng-container matColumnDef="tanktype">
<th mat-header-cell *matHeaderCellDef>储罐类型<span style="color: red;">*</span></th>
<td mat-cell *matCellDef="let element;let key = index">
<input readonly style="height:45px" class="tankinfo" name="{{www}}{{element.tanktype}}tank{{key}}" type='text'
required
[(ngModel)]="element.tanktype">
</td>
</ng-container>
<ng-container matColumnDef="tankcapacity">
<th mat-header-cell *matHeaderCellDef>容量(m³)<span style="color: red;">*</span></th>
<td mat-cell *matCellDef="let element;let key = index">
<input readonly style="height:45px" class="tankinfo" name="{{www}}{{element.tankcapacity}}tank{{key}}" type='text'
required
[(ngModel)]="element.tankcapacity">
</td>
</ng-container>
<ng-container matColumnDef="tankdiameter">
<th mat-header-cell *matHeaderCellDef>直径(m)<span style="color: red;">*</span></th>
<td mat-cell *matCellDef="let element;let key = index">
<input readonly style="height:45px" class="tankinfo" name="{{www}}{{element.tankdiameter}}tank{{key}}" type='text'
required
[(ngModel)]="element.tankdiameter">
</td>
</ng-container>
<ng-container matColumnDef="tankheight">
<th mat-header-cell *matHeaderCellDef>高度(m)<span style="color: red;">*</span></th>
<td mat-cell *matCellDef="let element;let key = index">
<input readonly style="height:45px" class="tankinfo" name="{{www}}{{element.tankheight}}tank{{key}}" type='text'
required
[(ngModel)]="element.tankheight">
</td>
</ng-container>
<ng-container matColumnDef="tanktectum">
<th mat-header-cell *matHeaderCellDef>顶盖形式</th>
<td mat-cell *matCellDef="let element;let key = index">
<input readonly style="height:45px" class="tankinfo" name="{{www}}{{element.tanktectum}}tank{{key}}" type='text'
[(ngModel)]="element.tanktectum">
</td>
</ng-container>
<ng-container matColumnDef="tanktexture">
<th mat-header-cell *matHeaderCellDef>浮盘材质</th>
<td mat-cell *matCellDef="let element;let key = index">
<input readonly style="height:45px" class="tankinfo" name="{{www}}{{element.tanktexture}}tank{{key}}" type='text'
[(ngModel)]="element.tanktexture">
</td>
</ng-container>
<ng-container matColumnDef="platetype">
<th mat-header-cell *matHeaderCellDef>浮盘类型</th>
<td mat-cell *matCellDef="let element;let key = index">
<input readonly style="height:45px" class="tankinfo" name="{{www}}{{element.platetype}}tank{{key}}" type='text'
[(ngModel)]="element.platetype">
</td>
</ng-container>
<ng-container matColumnDef="foamgeneratorid">
<th mat-header-cell *matHeaderCellDef>泡沫产生器型号</th>
<td mat-cell *matCellDef="let element;let key = index">
<input readonly style="height:45px" class="tankinfo" name="{{www}}{{element.foamgeneratorid}}tank{{key}}" type='text'
[(ngModel)]="element.foamgeneratorid">
</td>
</ng-container>
<ng-container matColumnDef="foamgeneratortype">
<th mat-header-cell *matHeaderCellDef>泡沫产生器形式</th>
<td mat-cell *matCellDef="let element;let key = index">
<input readonly style="height:45px" class="tankinfo" name="{{www}}{{element.foamgeneratortype}}tank{{key}}" type='text'
[(ngModel)]="element.foamgeneratortype">
</td>
</ng-container>
<ng-container matColumnDef="isprotect">
<th mat-header-cell *matHeaderCellDef>是否设置氮封惰化保护装置</th>
<td mat-cell *matCellDef="let element;let key = index">
<input readonly style="height:45px" class="tankinfo" name="{{www}}{{element.isprotect}}tank{{key}}" type='text'
[(ngModel)]="element.isprotect">
</td>
</ng-container>
<ng-container matColumnDef="fendinggroyneheight">
<th mat-header-cell *matHeaderCellDef>防护堤高度(m)<span style="color: red;">*</span></th>
<td mat-cell *matCellDef="let element;let key = index">
<input readonly style="height:45px" class="tankinfo" name="{{www}}{{element.fendinggroyneheight}}tank{{key}}" type='text'
required
[(ngModel)]="element.fendinggroyneheight">
</td>
</ng-container>
<ng-container matColumnDef="portnum">
<th mat-header-cell *matHeaderCellDef>半固定泡沫灭火接口数量</th>
<td mat-cell *matCellDef="let element;let key = index">
<input readonly style="height:45px" class="tankinfo" name="{{www}}{{element.portnum}}tank{{key}}" type='text'
[(ngModel)]="element.portnum">
</td>
</ng-container>
<ng-container matColumnDef="else">
<th mat-header-cell *matHeaderCellDef>其它设施</th>
<td mat-cell *matCellDef="let element;let key = index">
<input readonly style="height:45px" class="tankinfo" name="{{www}}{{element.else}}tank{{key}}" type='text'
[(ngModel)]="element.else">
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns2"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns2;"></tr>
</table>
</div>
</div>
</div>
<div class="houseinfoinput" style="float: left;margin-left: 250px;" *ngFor="let i of item.customData.customProperties;let key = index">
<div class="CustomData" style="width: 200px;margin-top: 60px;"> <mat-form-field>
<!-- <mat-checkbox name="checkbuilding" [(ngModel)]="item.isCustomData" style="float: left;margin-right: 10px;"></mat-checkbox> --> <input matInput type='text' name="customData{{key}}Name"
<h1 style="font-size: 22px;width: 200px;">自定义信息</h1> required
</div> [(ngModel)]="i.name">
<div *ngIf="item.isCustomData" style="position: relative;"> </mat-form-field>
<button style="position: absolute;left: 0;font-size: 11px;" type="button" mat-icon-button class="addCustomData"><mat-icon style="font-size: 38px;">add_circle_outline</mat-icon></button> <span>:</span>
<button style="position: absolute;left:60px;" type="button" mat-icon-button class="deleteCustomData"><mat-icon style="font-size: 38px;">remove_circle_outline</mat-icon></button> <mat-form-field>
<div class="houseinfoinput" style="float: left;margin-left: 250px;" *ngFor="let i of item.buildingCustomData.customProperties;let key = index"> <input matInput type='text' name="customData{{key}}Value"
<mat-form-field> required
<input readonly matInput type='text' name="{{key}}1CustomData" [(ngModel)]="i.value">
required </mat-form-field>
[(ngModel)]="i.name"> <span style="color: red;" *ngIf="i.required">*</span>
</mat-form-field>
<span>:</span>
<mat-form-field>
<input readonly matInput type='text' name="{{key}}2CustomData"
required
[(ngModel)]="i.value">
</mat-form-field>
<span style="color: red;" *ngIf="i.required">*</span>
</div>
</div> </div>
</div> </div>
<!-- <div class="infobtnbox">
<button type="submit()" mat-button mat-raised-button color="primary" >保存</button>
<button type="button" mat-raised-button color="warn">删除</button>
</div> -->
</form> </form>
</mat-tab> </ng-template>
</mat-tab-group>
</mat-tab>
</mat-tab-group>
</div> </div>
</div> </div>
</div> </div>

186
src/app/key-unit/basicinfo-look/basicinfo.component.scss

@ -1,7 +1,7 @@
.topbox{ .topbox{
height: 485px; height: 485px;
width: 100%; width: 100%;
// border-bottom: 1px solid black; padding-bottom: 20px;
.mainbox{ .mainbox{
height: 100%; height: 100%;
position: relative; position: relative;
@ -9,7 +9,6 @@
.mainleft{ .mainleft{
width:800px; width:800px;
height: 100%; height: 100%;
// background-color: yellow;
float: left; float: left;
.inputbox{ .inputbox{
width: 343px; width: 343px;
@ -41,13 +40,8 @@
} }
.addbtn{ .addbtn{
width: 695px; width: 695px;
position: absolute; margin:20px 0;
bottom: -495px; padding-bottom: 20px;
text-align: center;
margin-bottom:20px;
button{
margin: 0 4px;
}
} }
.uploadimg{ .uploadimg{
width: 400px; width: 400px;
@ -56,18 +50,13 @@
margin-top:12px; margin-top:12px;
position: relative; position: relative;
margin-left: 80px; margin-left: 80px;
cursor: pointer;
span{ span{
float: left; float: left;
} }
// img{
// float: left;
// }
.uploadingimg{ .uploadingimg{
width: 299px; width: 299px;
height: 170px; height: 170px;
// background: url('../../../assets/images/upload2.png') no-repeat center center; cursor: pointer;
position: absolute; position: absolute;
top: 0px; top: 0px;
left: 79px; left: 79px;
@ -77,20 +66,11 @@
} }
.image{ .image{
// position: absolute;
// top: 199px;
// left: 160px;
// width: 299px;
// height: 170px;
input{ input{
// width: 299px;
// height: 170px;
width: 190px; width: 190px;
margin-top: 160px; margin-top: 160px;
cursor: pointer; cursor: pointer;
} }
// opacity:0;
} }
} }
.mainright{ .mainright{
@ -107,7 +87,6 @@
} }
.gistopbox{ .gistopbox{
position: absolute; position: absolute;
box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16); box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16);
border-radius: 4px; border-radius: 4px;
left: 5%; left: 5%;
@ -146,55 +125,60 @@
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
.inputBox{
width: 63%;
display: flex;
align-items: center;
.positionInput{
border: 0;
border-radius: 6px;
width: 90%;
height: 34px;
background: #F2F2F2;
margin-left: 8px;
box-sizing: border-box;
padding-left: 10px;
}
}
} }
.hidden{
opacity: 0;
z-index: -1;
}
.show{
opacity: 1;
z-index: 1;
}
} }
} }
} }
.bottombox{ .bodyBox{
// height:400px; flex: 70%;overflow-y: auto;
width: 100%; position: relative;
// background-color: skyblue; .addBuilding{
position: absolute;
.bottomtitle{ z-index: 999;
height: 60px; left: 0;
// background-color: orange; top: 3px;
line-height: 60px;
border-top: 1px solid black;
border-bottom: 1px solid black;
} }
.houseinfobox{ .buildInfoInput{
// height:340px; width: 393px;
overflow: auto; text-align: end;
.addhouseinfo{ margin-left:240px;
float: left; }
} .infobtnbox{
.infobtnbox{ position: absolute;
margin-left: 800px; top: 30px;
position: absolute; right: 75px;
top: 30px; button{
right: 75px; width: 80px;
button{ height: 40px;
width: 80px; margin: 0 12px;
height: 40px; margin-top: 15px;
margin: 0 12px;
margin-top: 15px;
}
}
.infotitle{
font-size: 28px;
font-weight: 900;
margin-left: 180px;
}
.houseinfoinput{
width: 393px;
text-align: end;
margin-left:240px;
} }
} }
} }
.btn{ .btn{
width: 100%; width: 100%;
text-align: center; text-align: center;
@ -206,37 +190,29 @@
margin-top: 58px; margin-top: 58px;
margin-left: 203px; margin-left: 203px;
} }
.mat-table{
width: 99%;
}
table{ table{
width: 1000px; width: 99%;
thead{ tr{
tr{ display: flex;
th{ td,th{
width: 60px; flex: 1;
display: block;
float: left;
}
} }
} th{
tbody{ display: flex;
tr{ align-items: center;
justify-content: center;
td{ }
width: 60px; input{
display: block; border: 0px ;
float: left;
text-align: center;
}
} }
} }
} }
table,table tr th, table tr td { border: 0.1px solid gray; }
table { text-align: center; border-collapse: collapse; padding:2px;}
.deviceinfo{ .deviceinfo{
// border-bottom: 1px solid black;;
padding-bottom: 60px; padding-bottom: 60px;
} }
.tankdetailinfo{ .tankdetailinfo{
@ -250,14 +226,10 @@ table{
} }
.tankinfo{ .tankinfo{
display: block; display: block;
width: 100%; width: 97.5%;
// height: 45px;
text-align: center; text-align: center;
border: 0px;
} }
// .adddeviceinfo{
// // position: absolute;
// // left: 0px;
// }
.submit1{ .submit1{
margin-left: -66px !important; margin-left: -66px !important;
} }
@ -269,31 +241,7 @@ textarea {
height: 110px; height: 110px;
resize: none; resize: none;
} }
//预览图片旋转角度
.img1{
transform:rotate(90deg) scale(0.55);
height: 100%;
}
.img2{
transform:rotate(180deg);
// height: 100%;
}
.img3{
transform:rotate(270deg) scale(0.55);
// height: 100%;
}
.img4{
transform:rotate(90deg) scale(1.3);
// height: 100%;
}
.img5{
transform:rotate(180deg);
// height: 100%;
}
.img6{
transform:rotate(270deg) scale(1.3);
// height: 100%;
}
.imgbox{ .imgbox{
text-align: center; text-align: center;
height: 750px; height: 750px;

2037
src/app/key-unit/basicinfo-look/basicinfo.component.ts

File diff suppressed because it is too large Load Diff

11
src/app/key-unit/basicinfo-look/lookmaster.component.html

@ -4,7 +4,7 @@
<ng-container *ngIf="isshowimg; else elseTemplate"> <ng-container *ngIf="isshowimg; else elseTemplate">
<div class="imgbox"> <div class="imgbox">
<img class="imgitemdefault" [src]="ImgUrl"> <img class="imgitemdefault" [src]="ImgUrl">
<!-- <img class="imgitemdefault" [src]="ImgUrl" [ngClass]="{'img1': rotateA==90,'img2': rotateA==180,'img3': rotateA==270,'img4': rotateB==10,'img5': rotateB==20,'img6': rotateB==30}" > -->
</div> </div>
</ng-container> </ng-container>
<ng-template #elseTemplate > <ng-template #elseTemplate >
@ -14,4 +14,13 @@
</div> </div>
<!--
<div class="swiper-button-prev"></div>
<div class="swiper-button-next"></div> -->
<!-- <div class="previewImgBottom">
<button type="button" mat-icon-button (click)='rotate()'><mat-icon>refresh</mat-icon></button>
</div> -->

14
src/app/key-unit/basicinfo/addhouseinfo.component.ts

@ -21,7 +21,6 @@ import { MatSnackBar } from '@angular/material/snack-bar';
this.dialogRef.close(); this.dialogRef.close();
} }
ngOnInit(): void { ngOnInit(): void {
// console.log(this.data)
this.getallunittype() this.getallunittype()
} }
getallunittype(){ getallunittype(){
@ -30,27 +29,24 @@ import { MatSnackBar } from '@angular/material/snack-bar';
}) })
} }
onSubmit(value){ onSubmit(value){
this.http.get("/api/Buildings",{ this.http.get("/api/Buildings",{
params:{ params:{
companyId:this.data.unitId companyId:this.data.unitId
} }
}).subscribe((data:any)=>{ }).subscribe((data:any)=>{
this.data.allBuildings = data let allBuildings = data
let order let order
if(data.length == 0){ if(allBuildings.length == 0){
order = 0 order = 0
}else{ }else{
order = data[data.length - 1].order + 1 order = allBuildings[allBuildings.length-1].order + 1
} }
let buildingTypename = "" let buildingTypename = ""
this.allunittype.forEach(item => { this.allunittype.forEach(item => {
if(item.id == value.unittype){ if(item.id == value.unittype){
buildingTypename = item.name buildingTypename = item.name
} }
}); });
this.http.post("/api/Buildings",{ this.http.post("/api/Buildings",{
id: "", id: "",
name: value.name, name: value.name,
@ -68,10 +64,12 @@ import { MatSnackBar } from '@angular/material/snack-bar';
}}).subscribe(data=>{ }}).subscribe(data=>{
this.dialogRef.close(data); this.dialogRef.close(data);
}) })
}) })
} }
} }

537
src/app/key-unit/basicinfo/basicinfo.component.html

@ -1,11 +1,10 @@
<div style="height: 100%;display: flex; flex-direction: column;"> <div style="height: 100%;display: flex; flex-direction: column;overflow: hidden;">
<!-- header --> <!-- header -->
<mat-accordion> <mat-accordion>
<mat-expansion-panel expanded hideToggle > <mat-expansion-panel expanded>
<mat-expansion-panel-header style="color: black;"> <mat-expansion-panel-header style="color: black;">
<mat-panel-title> <mat-panel-title>
单位信息 单位信息
<mat-icon style="position: absolute;right:30px;">keyboard_arrow_down</mat-icon>
</mat-panel-title> </mat-panel-title>
</mat-expansion-panel-header> </mat-expansion-panel-header>
<div class="topbox"> <div class="topbox">
@ -66,7 +65,7 @@
</div> </div>
<div class="inputbox" style="width: 700px;"> <div class="inputbox" style="width: 700px;">
<span style="color: red;">*</span> <span style="color: red;">*</span>
<span>消防救援站</span> <span>辖区中队</span>
<mat-form-field style="width: 538px;"> <mat-form-field style="width: 538px;">
<input matInput id="organization" name="organization" type='text' <input matInput id="organization" name="organization" type='text'
required minlength="1" required minlength="1"
@ -105,16 +104,15 @@
(focus)="closeorganizationbox()"> (focus)="closeorganizationbox()">
</mat-form-field> </mat-form-field>
</div> </div>
<div class="uploadimg" (click)="lookmaster()"> <div class="uploadimg">
<span>单位照片:</span> <span>单位照片:</span>
<div class="uploadingimg"> <div class="uploadingimg" (click)="lookmaster()">
<img *ngIf="imgsrc" [src]="imgsrc" alt="" style="width: 299px; height: 170px;"> <img [src]="imgsrc ? imgsrc : noImg" alt="" style="width: 299px; height: 170px;" >
<img *ngIf="!imgsrc" [src]="noImgSrc" alt="" style="width: 299px; height: 170px;">
</div> </div>
<mat-spinner *ngIf="isspinner" diameter= 50></mat-spinner> <mat-spinner *ngIf="isspinner" diameter= 50></mat-spinner>
</div> </div>
<div class="image" (click)="closeorganizationbox()"> <div class="image" (click)="closeorganizationbox()">
<input id="selectedfile" type="file" (change)="filechange($event)" name="imgFile" accept=".jpg,.png,.jpeg,.gif,.webp"> <input id="selectedfile" type="file" ng2FileSelect [uploader]="uploader" (change)="filechange($event)" name="imgFile" accept=".jpg,.png,.jpeg,.gif,.webp">
</div> </div>
<div class="addbtn"> <div class="addbtn">
<button type="submit" color="primary" class="submit1" mat-button mat-raised-button>保存</button> <button type="submit" color="primary" class="submit1" mat-button mat-raised-button>保存</button>
@ -124,6 +122,7 @@
<div style="width: 100%;height: 100%;" id="container"> <div style="width: 100%;height: 100%;" id="container">
</div> </div>
<div class="gistopbox" *ngIf="isGisTopBox"> <div class="gistopbox" *ngIf="isGisTopBox">
<div class="positionItem"> <div class="positionItem">
<span> <span>
@ -160,61 +159,56 @@
</div> </div>
</mat-expansion-panel> </mat-expansion-panel>
</mat-accordion> </mat-accordion>
<!-- body --> <!-- body -->
<div class="bottombox" style="flex: 70%;overflow-y: auto;" > <div class="bodyBox" id="basicInfoBody">
<div class="houseinfobox" style="height: 100%; overflow-y: auto;box-sizing:border-box"> <div>
<button type="button" mat-icon-button (click)="addhouseinfo()" class="addhouseinfo"><mat-icon style="font-size: 38px;">add_circle_outline</mat-icon></button> <button type="button" mat-icon-button (click)="addhouseinfo()" class="addBuilding"><mat-icon>add_circle_outline</mat-icon></button>
<mat-tab-group style="height: 100%;;" (focusChange)="selecttab($event)" > </div>
<mat-tab [label]="item.username" *ngFor="let item of houses;let key = index"> <div style="height: 100%; box-sizing:border-box;overflow-y: auto;padding-left: 26px;">
<form style="height: 100%; overflow-y:auto; display: block;" (ngSubmit)="onSubmit2(form.value,item,key,form.invalid)" #form="ngForm" class="example-container"> <mat-tab-group style="height: 100%;" [selectedIndex]="selectedIndex" (selectedTabChange)="selectedTabChange($event)">
<mat-tab *ngFor="let item of houses;let key = index" label="{{item.name}}">
<!-- 正常建筑 --> <ng-template matTabContent>
<div class="highinfo" *ngIf="item.tongyong"> <form *ngIf="item.data && item.data.length!=0" style="height: 100%; overflow-y:auto; display: block;" (ngSubmit)="onSubmitBuildingInfo(form.value,item,key,form.invalid)" #form="ngForm" class="example-container">
<div class="houseinfoinput" > <div class="buildInfoInput" >
<span>建筑名称:</span> <span>建筑名称:</span>
<mat-form-field> <mat-form-field>
<input matInput id="housename" name="housename" type='text' <input required matInput name="buildingName" type='text' minlength="1" [(ngModel)]="item.name">
minlength="1" [(ngModel)]="item.name" </mat-form-field>
> <span style="color: red;">*</span>
</mat-form-field> </div>
<span style="color: red;">*</span> <div class="buildInfoInput">
</div> <span>建筑类型:</span>
<div class="houseinfoinput"> <mat-form-field>
<span>建筑类型:</span> <mat-select name="buildingTypeName" [(ngModel)]="item.buildingTypes[0].name">
<mat-form-field> <mat-option [value]="n.name" *ngFor="let n of allunittype" (click)="templateBuildtype(n,item,key)">{{n.name}}</mat-option>
<mat-select name="unittype" [(ngModel)]="item.buildtype"> </mat-select>
<mat-option [value]="n.name" *ngFor="let n of allunittype" (click)="templatebuildtype(n,item,key)">{{n.name}}</mat-option> </mat-form-field>
</mat-select> <span style="color: red;">*</span>
</mat-form-field> </div>
<span style="color: red;">*</span> <div *ngFor="let element of item.data[0].buildingBasicGroups;let groupsIndex = index "style="float: left;width:100%">
</div> <!-- 类型为表单并且不是 罐区 -->
<div *ngIf="element.type == 0 && element.name.indexOf('罐区') == -1">
<div *ngFor="let item of item.buildingBasicGroups;let www = index" style="float: left;"> <p style="font-size: 22px;">{{element.name}}</p>
<h1 style="font-size: 22px;">{{item.name}}</h1> <div class="buildInfoInput" *ngFor="let i of element.propertyInfos;let inputIndex = index" style="float: left;margin-left: 250px;position: relative;">
<div class="houseinfoinput" *ngFor="let i of item.propertyInfos" style="float: left;margin-left: 250px;position: relative;">
<span>{{i.propertyName}}<span *ngIf="i.physicalUnit">({{i.physicalUnit}})</span></span> <span>{{i.propertyName}}<span *ngIf="i.physicalUnit">({{i.physicalUnit}})</span></span>
<!-- 如果类型是文本 --> <!-- 如果类型是文本 -->
<mat-form-field *ngIf="i.propertyType == 0 && i.propertyName != '耐火等级'"> <mat-form-field *ngIf="i.propertyType == 0 && i.propertyName != '耐火等级'">
<input matInput name="{{i.propertyName}}{{www}}" type='text' <input matInput name="{{groupsIndex}}{{inputIndex}}" type='text'
required="{{ i.required==true ? 'true' : 'false' }}" required="{{ i.required==true ? 'true' : 'false' }}"
[(ngModel)]="i.propertyValue"> [(ngModel)]="i.propertyValue">
</mat-form-field> </mat-form-field>
<!-- 如果类型是数字 --> <!-- 如果类型是数字 -->
<mat-form-field *ngIf="i.propertyType == 2 && i.propertyName != '耐火等级'"> <mat-form-field *ngIf="i.propertyType == 2 && i.propertyName != '耐火等级'">
<input matInput name="{{i.propertyName}}{{www}}" type='number' <input matInput name="{{groupsIndex}}{{inputIndex}}" type='number'
required="{{ i.required==true ? 'true' : 'false' }}" required="{{ i.required==true ? 'true' : 'false' }}"
[(ngModel)]="i.propertyValue" [(ngModel)]="i.propertyValue"
(change)="inputchange($event,i.ruleName,i.ruleValue,i)" (change)="inputchange($event,i.ruleName,i.ruleValue,i)"
> >
<!-- <mat-error *ngIf="isshowrule">{{rulevalue}}</mat-error> -->
</mat-form-field> </mat-form-field>
<!-- 如果类型是耐火等级 --> <!-- 如果类型是耐火等级 -->
<mat-form-field *ngIf="i.propertyName == '耐火等级'"> <mat-form-field *ngIf="i.propertyName == '耐火等级'">
<mat-select name="{{i.propertyName}}{{www}}" required="{{ i.required==true ? 'true' : 'false' }}" placeholder="请选择耐火等级" [(ngModel)]="i.propertyValue"> <mat-select name="{{groupsIndex}}{{inputIndex}}" required="{{ i.required==true ? 'true' : 'false' }}" placeholder="请选择耐火等级" [(ngModel)]="i.propertyValue">
<mat-option value="0">1级</mat-option> <mat-option value="0">1级</mat-option>
<mat-option value="1">2级</mat-option> <mat-option value="1">2级</mat-option>
<mat-option value="2">3级</mat-option> <mat-option value="2">3级</mat-option>
@ -222,352 +216,153 @@
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<!-- 如果类型是多行文本 --> <!-- 如果类型是多行文本 -->
<textarea *ngIf="i.propertyType == 1 && i.propertyName != '耐火等级'" style="width: 180px;height: 60px;" required="{{ i.required==true ? 'true' : 'false' }}" [(ngModel)]="i.propertyValue" name="{{i.propertyName}}{{key}}"></textarea> <textarea *ngIf="i.propertyType == 1 && i.propertyName != '耐火等级'" style="width: 180px;height: 60px;" required="{{ i.required==true ? 'true' : 'false' }}" [(ngModel)]="i.propertyValue" name="{{groupsIndex}}{{inputIndex}}"></textarea>
<span style="color: red;" *ngIf="i.required">*</span> <span style="color: red;" *ngIf="i.required">*</span>
<div *ngIf="i.isshowrule" style="position: absolute; <div *ngIf="i.isshowrule" style="position: absolute;left: 205px;top: 45px;font-size: 11px;color: red;">
left: 205px;
top: 45px;
font-size: 11px;
color: red;">
<span>{{i.rulevalue}}</span> <span>{{i.rulevalue}}</span>
</div> </div>
</div> </div>
</div> </div>
<!-- 类型为表格 并且不是 罐区 -->
<div class="CustomData" style="width: 200px;"> <div *ngIf="element.type == 1 && element.name.indexOf('罐区') == -1">
<mat-checkbox color="primary" (change)="checkCustomData($event)" name="checkbuilding" [(ngModel)]="item.isCustomData" style="float: left;margin-right: 10px;"></mat-checkbox> <p style="font-size: 22px;">
<h1 style="font-size: 22px;width: 200px;">自定义信息</h1> <mat-checkbox color="primary" (change)="checkboxChange(element,$event,item)" *ngIf="element.isOptional" [name]="element.name" [(ngModel)]="element.submitted" style="float: left;margin-right: 10px;"></mat-checkbox>
</div> {{element.name}}
<div *ngIf="item.isCustomData" style="position: relative;"> </p>
<button style="position: absolute;left: 0;" type="button" mat-icon-button (click)="addCustomData(item)" class="addCustomData"><mat-icon style="font-size: 38px;">add_circle_outline</mat-icon></button> <table *ngIf="element.submitted">
<button style="position: absolute;left:60px;" type="button" mat-icon-button (click)="deleteCustomData(item)" class="deleteCustomData"><mat-icon style="font-size: 38px;">remove_circle_outline</mat-icon></button> <tr>
<div class="houseinfoinput" style="float: left;margin-left: 250px;" *ngFor="let i of item.buildingCustomData.customProperties;let key = index"> <th *ngFor="let item of element.propertyInfos[0].origin;let index = index">
<mat-form-field> <button *ngIf="index == 0" style="width: 24px;" type="button" mat-icon-button class="addline" (click)="addline(element.propertyInfos)"><mat-icon>add_circle_outline</mat-icon></button>
<input matInput type='text' name="{{key}}1CustomData" <button *ngIf="index == 0" style="width: 24px;" type="button" mat-icon-button class="removeline" (click)="removeline(element.propertyInfos)"><mat-icon>remove_circle_outline</mat-icon></button>
required {{item.propertyName}}
[(ngModel)]="i.name"> <span style="color: red;" *ngIf="item.required">*</span>
</mat-form-field> </th>
<span>:</span> </tr>
<mat-form-field> <tr *ngFor="let item of element.propertyInfos;let line = index">
<input matInput type='text' name="{{key}}2CustomData" <td *ngFor="let i of item.origin;let list = index">
required <input *ngIf="i.propertyType != 1" style="height:45px" class="tankinfo" name="{{element.name}}{{line + 1}}-{{list + 1}}" type="{{i.propertyType == 0 ? 'text' : 'number'}}"
[(ngModel)]="i.value"> required="{{ i.required==true ? 'true' : 'false' }}" [(ngModel)]="i.propertyValue">
</mat-form-field> <textarea class="tankinfo" *ngIf="i.propertyType == 1" required="{{ i.required==true ? 'true' : 'false' }}" [(ngModel)]="i.propertyValue" name="{{element.name}}{{line + 1}}{{list + 1}}">
<span style="color: red;" *ngIf="i.required">*</span>
</div> </textarea>
</div>
</div>
<!-- 石油化工 -->
<div class="highinfo" *ngIf="item.isshiyou;let bigkey = index">
<div class="basicinfobox">
<div class="houseinfoinput">
<span>建筑名称:</span>
<mat-form-field>
<input matInput id="housename" name="housename" type='text'
required minlength="1" [(ngModel)]="item.name"
>
</mat-form-field>
<span style="color: red;">*</span>
</div>
<div class="houseinfoinput" >
<span>建筑类型:</span>
<mat-form-field>
<mat-select required name="unittype" [(ngModel)]="item.buildtype">
<mat-option [value]="n.name" *ngFor="let n of allunittype" (click)="templatebuildtype(n,item,key)">{{n.name}}</mat-option>
</mat-select>
</mat-form-field>
<span style="color: red;">*</span>
</div>
<h1 style="font-size: 22px;">{{item.buildingBasicGroups[0].name}}</h1>
<div class="houseinfoinput" *ngFor="let i of item.buildingBasicGroups[0].propertyInfos;let smkey = index" style="float: left;margin-left: 250px;position: relative;">
<span>{{i.propertyName}} <span *ngIf="i.physicalUnit">({{i.physicalUnit}})</span></span>
<!-- 如果类型是文本 -->
<mat-form-field *ngIf="i.propertyType == 0 && i.propertyName != '耐火等级'">
<input matInput name="{{i.propertyName}}" type='text'
required="{{ i.required==true ? 'true' : 'false' }}"
[(ngModel)]="i.propertyValue">
</mat-form-field>
<!-- 如果类型是数字 -->
<mat-form-field *ngIf="i.propertyType == 2 && i.propertyName != '耐火等级'">
<input matInput name="{{i.propertyName}}" type='number'
required="{{ i.required==true ? 'true' : 'false' }}"
[(ngModel)]="i.propertyValue"
(change)="inputchange($event,i.ruleName,i.ruleValue,i)"
>
<!-- <mat-error *ngIf="isshowrule">{{rulevalue}}</mat-error> -->
</mat-form-field>
<!-- 如果类型是耐火等级 -->
<mat-form-field *ngIf="i.propertyName == '耐火等级'">
<mat-select name="{{i.propertyName}}" required="{{ i.required==true ? 'true' : 'false' }}" placeholder="请选择耐火等级" [(ngModel)]="i.propertyValue">
<mat-option value="0">1级</mat-option>
<mat-option value="1">2级</mat-option>
<mat-option value="2">3级</mat-option>
<mat-option value="3">其它</mat-option>
</mat-select>
</mat-form-field>
<!-- 如果类型是多行文本 -->
<textarea *ngIf="i.propertyType == 1 && i.propertyName != '耐火等级'" style="width: 180px;height: 60px;" required="{{ i.required==true ? 'true' : 'false' }}" [(ngModel)]="i.propertyValue" name="{{i.propertyName}}"></textarea>
<span style="color: red;" *ngIf="i.required">*</span>
<div *ngIf="i.isshowrule" style=" position: absolute;
left: 205px;
top: 45px;
font-size: 11px;
color: red;">
<span>{{i.rulevalue}}</span>
</div>
</div>
</div>
<div class="deviceinfo">
<div style="width: 200px;">
<mat-checkbox color="primary" (change)="checkboxchange(item.buildingBasicGroups[1].submitted,$event)" name="item.buildingBasicGroups[1].name" *ngIf="item.buildingBasicGroups[1].isOptional" [(ngModel)]="item.buildingBasicGroups[1].submitted" style="float: left;margin-right: 10px;"></mat-checkbox>
<h1 style="font-size: 22px;width: 200px;">{{item.buildingBasicGroups[1].name}}</h1>
</div>
<table mat-table [dataSource]="devicedataSourcebox[item.buildingId]" class="mat-elevation-z8" *ngIf="item.buildingBasicGroups[1].submitted">
<ng-container matColumnDef="name">
<th mat-header-cell *matHeaderCellDef>
<button style="width: 24px;" type="button" mat-icon-button class="adddeviceinfo2" (click)="adddeviceinfo(item)"><mat-icon>add_circle_outline</mat-icon></button>
<button style="width: 24px;" type="button" mat-icon-button class="removedeviceinfo" (click)="removedeviceinfo(item)"><mat-icon>remove_circle_outline</mat-icon></button>
装置区名称<span style="color: red;">*</span></th>
<td mat-cell *matCellDef="let element;let key = index">
<textarea style="width: 100px;" [(ngModel)]="element.name" name="{{key}}1" required></textarea>
</td>
</ng-container>
<ng-container matColumnDef="flow">
<th mat-header-cell *matHeaderCellDef>工艺流程<span style="color: red;">*</span></th>
<td mat-cell *matCellDef="let element;let key = index">
<textarea [(ngModel)]="element.flow" name="{{key}}2" required></textarea>
</td>
</ng-container>
<ng-container matColumnDef="danger">
<th mat-header-cell *matHeaderCellDef>火灾危险性<span style="color: red;">*</span></th>
<td mat-cell *matCellDef="let element;let key = index">
<textarea [(ngModel)]="element.danger" name="{{key}}3" required></textarea>
</td>
</ng-container>
<ng-container matColumnDef="payattentionto">
<th mat-header-cell *matHeaderCellDef>灭火注意事项</th>
<td mat-cell *matCellDef="let element;let key = index">
<textarea style="width: 100px;" [(ngModel)]="element.payattentionto" name="{{key}}4"></textarea>
</td> </td>
</ng-container> </tr>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table> </table>
</div> </div>
<!-- 类型为表单 是罐区-->
<div style="width: 200px;"> <div *ngIf="element.type == 0 && element.name.indexOf('罐区') != -1">
<mat-checkbox color="primary" (change)="checkboxchange(item,$event)" *ngIf="item.buildingBasicGroups[2].isOptional" name="item.buildingBasicGroups[2].name" [(ngModel)]="item.buildingBasicGroups[2].submitted" style="float: left;margin-right: 10px;"></mat-checkbox> <p style="font-size: 22px;">
<h1 style="font-size: 22px;width: 200px;">储罐信息</h1> <mat-checkbox color="primary" (change)="checkboxChange(element,$event,item)" *ngIf="element.isOptional && element.name == '罐区1'" [name]="element.name" [(ngModel)]="element.submitted" style="float: left;margin-right: 10px;"></mat-checkbox>
</div>
<button *ngIf="item.buildingBasicGroups[2].submitted" type="button" mat-raised-button color="primary" (click)="addtankbox(item,bigkey)" style="margin-top: 30px;margin-right: 5px;">添加储罐</button>
<button *ngIf="item.buildingBasicGroups[2].submitted" type="button" mat-raised-button color="warn" (click)="removetankbox(item,bigkey)" style="margin-top: 30px;" matTooltip="会将此建筑处于末尾的储罐移除">移除末尾储罐</button>
<div *ngIf="item.buildingBasicGroups[2].submitted" style="margin-top: 30px;">
<div class="tankinfo" *ngFor="let x of item.bigfor;let www = index">
<p style="font-size: 22px; width: 200px;">{{x[0].name}}</p>
<div class="basicinfobox" >
<div class="houseinfoinput" *ngFor="let i of x[0].propertyInfos;let key = index" style="line-height: 65px;">
<span>{{i.propertyName}} {{i.physicalUnit}}:</span>
<mat-form-field *ngIf="i.propertyType == 0">
<input matInput name="{{www+2}}-tanker-{{key}}" type='text'
required="{{ i.required==true ? 'true' : 'false' }}"
[(ngModel)]="i.propertyValue"
>
</mat-form-field>
<textarea style="width: 180px;height: 45px;" *ngIf="i.propertyType == 1" [(ngModel)]="i.propertyValue" name="{{www+2}}-tanker-{{key}}"></textarea>
<span style="color: red;" *ngIf="i.required">*</span>
</div>
</div>
<p style="font-size: 22px; width: 200px;">{{x[1].name}}</p>
<div class="tankdetailinfo">
<table #table mat-table [dataSource]="x[1].propertyInfos" class="mat-elevation-z8" style="position: relative;">
<ng-container matColumnDef="tank">
<th mat-header-cell *matHeaderCellDef>
<button type="button" mat-icon-button class="adddeviceinfo" (click)="adddeviceinfo2(www,item)" style="position: absolute;left: 0;"><mat-icon>add_circle_outline</mat-icon></button>
<button type="button" mat-icon-button class="removedeviceinfo" (click)="removedeviceinfo3(www,item)"><mat-icon>remove_circle_outline</mat-icon></button>
罐区 </th>
<td mat-cell *matCellDef="let element;let key = index">
<input style="height:45px" class="tankinfo" name="{{www}}{{element.tank}}tank{{key}}" type='text'
[(ngModel)]="element.tank">
</td>
</ng-container>
<ng-container matColumnDef="tankid">
<th mat-header-cell *matHeaderCellDef>罐区编号<span style="color: red;">*</span></th>
<td mat-cell *matCellDef="let element;let key = index">
<input style="height:45px" class="tankinfo" name="{{www}}{{element.tankid}}tank{{key}}" type='text'
required
[(ngModel)]="element.tankid">
</td>
</ng-container>
<ng-container matColumnDef="tankmedium">
<th mat-header-cell *matHeaderCellDef>储存介质<span style="color: red;">*</span></th>
<td mat-cell *matCellDef="let element;let key = index">
<input style="height:45px" class="tankinfo" name="{{www}}{{element.tankmedium}}tank{{key}}" type='text'
required
[(ngModel)]="element.tankmedium">
</td>
</ng-container>
<ng-container matColumnDef="tanktype"> <span *ngIf="element.name == '罐区1'">罐区信息</span>
<th mat-header-cell *matHeaderCellDef>储罐类型<span style="color: red;">*</span></th> </p>
<td mat-cell *matCellDef="let element;let key = index"> <div *ngIf="element.submitted" >
<input style="height:45px" class="tankinfo" name="{{www}}{{element.tanktype}}tank{{key}}" type='text' <p *ngIf="element.name == '罐区1'" style="margin: 5px 0;">
required <button type="button" mat-raised-button color="primary" (click)="addTankBox(item,groupsIndex)" style="margin-right: 5px;">添加罐区</button>
[(ngModel)]="element.tanktype"> <button type="button" mat-raised-button color="warn" (click)="removeTankBox(item,groupsIndex)" matTooltip="会将此建筑处于末尾的罐区移除">移除末尾罐区</button>
</td> </p>
</ng-container> <p style="font-size: 22px;">{{element.name}}</p>
<ng-container matColumnDef="tankcapacity">
<th mat-header-cell *matHeaderCellDef>容量(m³)<span style="color: red;">*</span></th>
<td mat-cell *matCellDef="let element;let key = index">
<input style="height:45px" class="tankinfo" name="{{www}}{{element.tankcapacity}}tank{{key}}" type='text'
required
[(ngModel)]="element.tankcapacity">
</td>
</ng-container>
<ng-container matColumnDef="tankdiameter">
<th mat-header-cell *matHeaderCellDef>直径(m)<span style="color: red;">*</span></th>
<td mat-cell *matCellDef="let element;let key = index">
<input style="height:45px" class="tankinfo" name="{{www}}{{element.tankdiameter}}tank{{key}}" type='text'
required
[(ngModel)]="element.tankdiameter">
</td>
</ng-container>
<ng-container matColumnDef="tankheight">
<th mat-header-cell *matHeaderCellDef>高度(m)<span style="color: red;">*</span></th>
<td mat-cell *matCellDef="let element;let key = index">
<input style="height:45px" class="tankinfo" name="{{www}}{{element.tankheight}}tank{{key}}" type='text'
required
[(ngModel)]="element.tankheight">
</td>
</ng-container>
<ng-container matColumnDef="tanktectum">
<th mat-header-cell *matHeaderCellDef>顶盖形式</th>
<td mat-cell *matCellDef="let element;let key = index">
<input style="height:45px" class="tankinfo" name="{{www}}{{element.tanktectum}}tank{{key}}" type='text'
[(ngModel)]="element.tanktectum">
</td>
</ng-container>
<ng-container matColumnDef="tanktexture">
<th mat-header-cell *matHeaderCellDef>浮盘材质</th>
<td mat-cell *matCellDef="let element;let key = index">
<input style="height:45px" class="tankinfo" name="{{www}}{{element.tanktexture}}tank{{key}}" type='text'
[(ngModel)]="element.tanktexture">
</td>
</ng-container>
<ng-container matColumnDef="platetype">
<th mat-header-cell *matHeaderCellDef>浮盘类型</th>
<td mat-cell *matCellDef="let element;let key = index">
<input style="height:45px" class="tankinfo" name="{{www}}{{element.platetype}}tank{{key}}" type='text'
[(ngModel)]="element.platetype">
</td>
</ng-container>
<ng-container matColumnDef="foamgeneratorid">
<th mat-header-cell *matHeaderCellDef>泡沫产生器型号</th>
<td mat-cell *matCellDef="let element;let key = index">
<input style="height:45px" class="tankinfo" name="{{www}}{{element.foamgeneratorid}}tank{{key}}" type='text'
[(ngModel)]="element.foamgeneratorid">
</td>
</ng-container>
<ng-container matColumnDef="foamgeneratortype">
<th mat-header-cell *matHeaderCellDef>泡沫产生器形式</th>
<td mat-cell *matCellDef="let element;let key = index">
<input style="height:45px" class="tankinfo" name="{{www}}{{element.foamgeneratortype}}tank{{key}}" type='text'
[(ngModel)]="element.foamgeneratortype">
</td>
</ng-container>
<ng-container matColumnDef="isprotect">
<th mat-header-cell *matHeaderCellDef>是否设置氮封惰化保护装置</th>
<td mat-cell *matCellDef="let element;let key = index">
<input style="height:45px" class="tankinfo" name="{{www}}{{element.isprotect}}tank{{key}}" type='text'
[(ngModel)]="element.isprotect">
</td>
</ng-container>
<ng-container matColumnDef="fendinggroyneheight">
<th mat-header-cell *matHeaderCellDef>防护堤高度(m)<span style="color: red;">*</span></th>
<td mat-cell *matCellDef="let element;let key = index">
<input style="height:45px" class="tankinfo" name="{{www}}{{element.fendinggroyneheight}}tank{{key}}" type='text'
required
[(ngModel)]="element.fendinggroyneheight">
</td>
</ng-container>
<ng-container matColumnDef="portnum">
<th mat-header-cell *matHeaderCellDef>半固定泡沫灭火接口数量</th>
<td mat-cell *matCellDef="let element;let key = index">
<input style="height:45px" class="tankinfo" name="{{www}}{{element.portnum}}tank{{key}}" type='text'
[(ngModel)]="element.portnum"> <div class="buildInfoInput" *ngFor="let i of element.propertyInfos;let inputIndex = index" style="float: left;margin-left: 250px;position: relative;">
</td> <span>{{i.propertyName}}<span *ngIf="i.physicalUnit">({{i.physicalUnit}})</span></span>
</ng-container> <!-- 如果类型是文本 -->
<ng-container matColumnDef="else"> <mat-form-field *ngIf="i.propertyType == 0 && i.propertyName != '耐火等级'">
<th mat-header-cell *matHeaderCellDef>其它设施</th> <input matInput name="{{groupsIndex}}{{inputIndex}}" type='text'
<td mat-cell *matCellDef="let element;let key = index"> required="{{ i.required==true ? 'true' : 'false' }}"
<input style="height:45px" class="tankinfo" name="{{www}}{{element.else}}tank{{key}}" type='text' [(ngModel)]="i.propertyValue">
</mat-form-field>
[(ngModel)]="element.else">
</td> <!-- 如果类型是数字 -->
</ng-container> <mat-form-field *ngIf="i.propertyType == 2 && i.propertyName != '耐火等级'">
<input matInput name="{{groupsIndex}}{{inputIndex}}" type='number'
required="{{ i.required==true ? 'true' : 'false' }}"
<tr mat-header-row *matHeaderRowDef="displayedColumns2"></tr> [(ngModel)]="i.propertyValue"
<tr mat-row *matRowDef="let row; columns: displayedColumns2;"></tr> (change)="inputchange($event,i.ruleName,i.ruleValue,i)"
</table> >
</mat-form-field>
<!-- 如果类型是耐火等级 -->
<mat-form-field *ngIf="i.propertyName == '耐火等级'">
<mat-select name="{{groupsIndex}}{{inputIndex}}" required="{{ i.required==true ? 'true' : 'false' }}" placeholder="请选择耐火等级" [(ngModel)]="i.propertyValue">
<mat-option value="0">1级</mat-option>
<mat-option value="1">2级</mat-option>
<mat-option value="2">3级</mat-option>
<mat-option value="3">其它</mat-option>
</mat-select>
</mat-form-field>
<!-- 如果类型是多行文本 -->
<textarea *ngIf="i.propertyType == 1 && i.propertyName != '耐火等级'" style="width: 180px;height: 60px;" required="{{ i.required==true ? 'true' : 'false' }}" [(ngModel)]="i.propertyValue" name="{{groupsIndex}}{{inputIndex}}"></textarea>
<span style="color: red;" *ngIf="i.required">*</span>
<div *ngIf="i.isshowrule" style="position: absolute;left: 205px;top: 45px;font-size: 11px;color: red;">
<span>{{i.rulevalue}}</span>
</div>
</div> </div>
</div> </div>
</div> </div>
<!-- 类型为表格 是罐区 -->
<div *ngIf="element.type == 1 && element.name.indexOf('罐区') != -1">
<div class="CustomData" style="width: 200px;margin-top: 60px;"> <p style="font-size: 22px;" *ngIf="element.submitted">
<mat-checkbox color="primary" (change)="checkCustomData($event)" name="checkbuilding" [(ngModel)]="item.isCustomData" style="float: left;margin-right: 10px;"></mat-checkbox> {{element.name}}
<h1 style="font-size: 22px;width: 200px;">自定义信息</h1> </p>
</div> <table *ngIf="element.submitted">
<div *ngIf="item.isCustomData" style="position: relative;"> <tr>
<button style="position: absolute;left: 0;font-size: 11px;" type="button" mat-icon-button (click)="addCustomData(item)" class="addCustomData"><mat-icon style="font-size: 38px;">add_circle_outline</mat-icon></button> <th *ngFor="let item of element.propertyInfos[0].origin;let index = index">
<button style="position: absolute;left:60px;" type="button" mat-icon-button (click)="deleteCustomData(item)" class="deleteCustomData"><mat-icon style="font-size: 38px;">remove_circle_outline</mat-icon></button> <button *ngIf="index == 0" style="width: 24px;" type="button" mat-icon-button class="addline" (click)="addline(element.propertyInfos)"><mat-icon>add_circle_outline</mat-icon></button>
<div class="houseinfoinput" style="float: left;margin-left: 250px;" *ngFor="let i of item.buildingCustomData.customProperties;let key = index"> <button *ngIf="index == 0" style="width: 24px;" type="button" mat-icon-button class="removeline" (click)="removeline(element.propertyInfos)"><mat-icon>remove_circle_outline</mat-icon></button>
<mat-form-field> {{item.propertyName}}
<input matInput type='text' name="{{key}}1CustomData" <span style="color: red;" *ngIf="item.required">*</span>
required </th>
[(ngModel)]="i.name"> </tr>
</mat-form-field> <tr *ngFor="let item of element.propertyInfos;let line = index">
<span>:</span> <td *ngFor="let i of item.origin;let list = index">
<mat-form-field> <input type="{{i.propertyType == 0 ? 'text' : 'number'}}" style="height:45px" class="tankinfo" name="{{element.name}}{{line + 1}}-{{list + 1}}"
<input matInput type='text' name="{{key}}2CustomData" required="{{ i.required==true ? 'true' : 'false' }}" [(ngModel)]="i.propertyValue">
required </td>
[(ngModel)]="i.value"> </tr>
</mat-form-field> </table>
<span style="color: red;" *ngIf="i.required">*</span>
</div>
</div> </div>
</div> </div>
<div class="CustomData" style="width: 200px;margin-top: 60px;">
<mat-checkbox color="primary" (change)="checkCustomData($event)" name="checkbuilding" [(ngModel)]="item.isCustomData" style="float: left;margin-right: 10px;"></mat-checkbox>
<h1 style="font-size: 22px;width: 200px;">自定义信息</h1>
</div>
<div style="position: relative;" *ngIf="item.isCustomData">
<button style="position: absolute;left: 100px;top: 5px;" type="button" mat-icon-button (click)="addCustomData(item)" class="addCustomData">
<mat-icon>add_circle_outline</mat-icon>
</button>
<button style="position: absolute;left:150px;top: 5px;" type="button" mat-icon-button (click)="popCustomData(item)" class="deleteCustomData">
<mat-icon>remove_circle_outline</mat-icon>
</button>
<div class="houseinfoinput" style="float: left;margin-left: 250px;" *ngFor="let i of item.customData.customProperties;let key = index">
<mat-form-field>
<input matInput type='text' name="customData{{key}}Name"
required
[(ngModel)]="i.name">
</mat-form-field>
<span>:</span>
<mat-form-field>
<input matInput type='text' name="customData{{key}}Value"
required
[(ngModel)]="i.value">
</mat-form-field>
<span style="color: red;" *ngIf="i.required">*</span>
</div>
</div>
<div class="infobtnbox"> <div class="infobtnbox">
<button type="submit()" mat-button mat-raised-button color="primary" >保存</button> <button type="submit" mat-button mat-raised-button color="primary">保存</button>
<button type="button" mat-raised-button (click)="deletedbuilding(item)" color="warn">删除</button> <button type="button" mat-raised-button (click)="deletedbuilding(item,key)" color="warn">删除</button>
</div> </div>
</form> </form>
</mat-tab> </ng-template>
</mat-tab-group>
</mat-tab>
</mat-tab-group>
</div> </div>
</div> </div>
</div> </div>

146
src/app/key-unit/basicinfo/basicinfo.component.scss

@ -1,7 +1,7 @@
.topbox{ .topbox{
height: 485px; height: 485px;
width: 100%; width: 100%;
// border-bottom: 1px solid black; padding-bottom: 20px;
.mainbox{ .mainbox{
height: 100%; height: 100%;
position: relative; position: relative;
@ -40,7 +40,8 @@
} }
.addbtn{ .addbtn{
width: 695px; width: 695px;
margin:9px 0; margin:20px 0;
padding-bottom: 20px;
} }
.uploadimg{ .uploadimg{
width: 400px; width: 400px;
@ -150,52 +151,34 @@
z-index: 1; z-index: 1;
} }
} }
} }
} }
.bottombox{ .bodyBox{
// height:400px; flex: 70%;overflow-y: auto;
width: 100%; position: relative;
// background-color: skyblue; .addBuilding{
position: absolute;
.bottomtitle{ z-index: 999;
height: 60px; left: 0;
// background-color: orange; top: 3px;
line-height: 60px;
border-top: 1px solid black;
border-bottom: 1px solid black;
} }
.houseinfobox{ .buildInfoInput{
// height:340px; width: 393px;
overflow: auto; text-align: end;
.addhouseinfo{ margin-left:240px;
float: left; }
} .infobtnbox{
.infobtnbox{ position: absolute;
margin-left: 800px; top: 30px;
position: absolute; right: 75px;
top: 30px; button{
right: 75px; width: 80px;
button{ height: 40px;
width: 80px; margin: 0 12px;
height: 40px; margin-top: 15px;
margin: 0 12px;
margin-top: 15px;
}
}
.infotitle{
font-size: 28px;
font-weight: 900;
margin-left: 180px;
}
.houseinfoinput{
width: 393px;
text-align: end;
margin-left:240px;
} }
} }
} }
.btn{ .btn{
width: 100%; width: 100%;
text-align: center; text-align: center;
@ -207,37 +190,29 @@
margin-top: 58px; margin-top: 58px;
margin-left: 203px; margin-left: 203px;
} }
.mat-table{
width: 100%;
}
table{ table{
width: 1000px; width: 99%;
thead{ tr{
tr{ display: flex;
th{ td,th{
width: 60px; flex: 1;
display: block;
float: left;
}
} }
} th{
tbody{ display: flex;
tr{ align-items: center;
justify-content: center;
td{ }
width: 60px; input{
display: block; border: 0px ;
float: left;
text-align: center;
}
} }
} }
} }
table,table tr th, table tr td { border: 0.1px solid gray; }
table { text-align: center; border-collapse: collapse; padding:2px;}
.deviceinfo{ .deviceinfo{
// border-bottom: 1px solid black;;
padding-bottom: 60px; padding-bottom: 60px;
} }
.tankdetailinfo{ .tankdetailinfo{
@ -251,14 +226,10 @@ table{
} }
.tankinfo{ .tankinfo{
display: block; display: block;
width: 100%; width: 97.5%;
// height: 45px;
text-align: center; text-align: center;
border: 0px;
} }
// .adddeviceinfo{
// // position: absolute;
// // left: 0px;
// }
.submit1{ .submit1{
margin-left: -66px !important; margin-left: -66px !important;
} }
@ -270,31 +241,7 @@ textarea {
height: 110px; height: 110px;
resize: none; resize: none;
} }
//预览图片旋转角度
.img1{
transform:rotate(90deg) scale(0.55);
height: 100%;
}
.img2{
transform:rotate(180deg);
// height: 100%;
}
.img3{
transform:rotate(270deg) scale(0.55);
// height: 100%;
}
.img4{
transform:rotate(90deg) scale(1.3);
// height: 100%;
}
.img5{
transform:rotate(180deg);
// height: 100%;
}
.img6{
transform:rotate(270deg) scale(1.3);
// height: 100%;
}
.imgbox{ .imgbox{
text-align: center; text-align: center;
height: 750px; height: 750px;
@ -312,9 +259,4 @@ textarea {
padding-left: 77px; padding-left: 77px;
font-size: 12px; font-size: 12px;
color: red; color: red;
} }
.mat-expansion-panel{
span{
color: black;
}
}

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

File diff suppressed because it is too large Load Diff

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

@ -104,7 +104,7 @@
<th mat-header-cell *matHeaderCellDef> <th mat-header-cell *matHeaderCellDef>
</th> </th>
<td mat-cell *matCellDef="let element"> <td mat-cell *matCellDef="let element">
<mat-checkbox color="primary" (change)="checkChange($event,element)"></mat-checkbox> <mat-checkbox color="primary" (change)="checkChange($event,element)" [disabled]="element.contentVerify!=null&&(element.contentVerify.verifyState==0||element.contentVerify.verifyState==3)" (click)='checkClick(element)'></mat-checkbox>
</td> </td>
</ng-container> </ng-container>
<ng-container matColumnDef="Follow"> <ng-container matColumnDef="Follow">
@ -264,6 +264,9 @@
<th mat-header-cell *matHeaderCellDef>操作</th> <th mat-header-cell *matHeaderCellDef>操作</th>
<td mat-cell *matCellDef="let element" class="operation"> <td mat-cell *matCellDef="let element" class="operation">
<span (click)="unitdetails(element)" >查看详情</span> <span (click)="unitdetails(element)" >查看详情</span>
<span style="color: blue;margin-left: 4px;" *ngIf="element.contentVerify==null||element.contentVerify.verifyState==-1||element.contentVerify.verifyState==1||element.contentVerify.verifyState==2||element.contentVerify.verifyState==4||element.contentVerify.verifyState==5" (click)='submitAudit(element)'>提交审核</span>
<span style="color: blue;margin-left: 4px;" *ngIf="element.contentVerify!=null&&(element.contentVerify.verifyState==0||element.contentVerify.verifyState==3) " (click)="cancelAudit(element)">撤销审核</span>
<span style="color: blue;margin-left: 4px;" (click)="auditResult(element)">审批结果</span>
<span (click)="Follow(element)" *ngIf="!element.isFollowed">关注单位</span> <span (click)="Follow(element)" *ngIf="!element.isFollowed">关注单位</span>
<span (click)="unFollow(element)" *ngIf="element.isFollowed">取消关注</span> <span (click)="unFollow(element)" *ngIf="element.isFollowed">取消关注</span>
</td> </td>

8
src/app/key-unit/key-unit-management/key-unit-management.component.scss

@ -263,4 +263,12 @@
.excellent{ .excellent{
// background : #32cd32; // background : #32cd32;
// background-image: linear-gradient(to right, #e2e7ee ,#FF4500, #FF8C00,#32cd32); // background-image: linear-gradient(to right, #e2e7ee ,#FF4500, #FF8C00,#32cd32);
}
//审核结果
.auditDiv{
p{
margin: 8px 0;
margin-left: 16px;
}
} }

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

@ -353,7 +353,6 @@ export class KeyUnitManagementComponent implements OnInit {
IntegrityScoreMax:this.integrityScoreMax/100||1 IntegrityScoreMax:this.integrityScoreMax/100||1
} }
this.http.get("/api/Companies",{params:paramsdata}).subscribe((data:any)=>{ this.http.get("/api/Companies",{params:paramsdata}).subscribe((data:any)=>{
this.length = data.totalCount this.length = data.totalCount
this.allKeyUnitInfo = data this.allKeyUnitInfo = data
// data.items.sort( (a,b) => { // data.items.sort( (a,b) => {
@ -429,11 +428,33 @@ export class KeyUnitManagementComponent implements OnInit {
} }
selectedunitArr:any =[] //选中单位的数组 selectedunitArr:any =[] //选中单位的数组
//勾选框事件 //勾选框事件
verifyState //判断是否可以修改
checkChange(e,element){ checkChange(e,element){
console.log(element)
if(element.contentVerify!=null){
this.verifyState=element.contentVerify.verifyState
}else{
this.verifyState=null
}
element.checked = e.checked element.checked = e.checked
}
checkClick(element){
if(element.contentVerify!=null){
if(element.contentVerify.verifyState==0||element.contentVerify.verifyState==3){
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('该单位正在审核不能选中','确定',config);
}
}
} }
//编辑单位信息 //编辑单位信息
editunit(){ editunit(){
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
let selectedunitArr = [] let selectedunitArr = []
let selectedunitobj = [] let selectedunitobj = []
this.allKeyUnitInfo.items.forEach(item => { this.allKeyUnitInfo.items.forEach(item => {
@ -444,9 +465,6 @@ export class KeyUnitManagementComponent implements OnInit {
}); });
if(selectedunitArr.length == 0){ if(selectedunitArr.length == 0){
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('请先选择要修改的单位','确定',config); this.snackBar.open('请先选择要修改的单位','确定',config);
} }
if(selectedunitArr.length != 1 && selectedunitArr.length != 0){ if(selectedunitArr.length != 1 && selectedunitArr.length != 0){
@ -492,7 +510,13 @@ export class KeyUnitManagementComponent implements OnInit {
} }
//删除单位信息 //删除单位信息
deleteunit(){ deleteunit(){
let selectedunitArr = [] if(this.verifyState==0||this.verifyState==3){
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('审核中,不能删除','确定',config);
}else{
let selectedunitArr = []
this.allKeyUnitInfo.items.forEach(item => { this.allKeyUnitInfo.items.forEach(item => {
if(item.checked){ if(item.checked){
selectedunitArr.push(item.id) selectedunitArr.push(item.id)
@ -524,6 +548,8 @@ export class KeyUnitManagementComponent implements OnInit {
} }
} }
}
} }
@ -641,6 +667,45 @@ export class KeyUnitManagementComponent implements OnInit {
} }
); );
} }
//提交审核
submitAudit(element){
console.log(element)
let body:any = {
title:element.name,
Operation:0,
itemId:element.id,
verifyState:3,
contentType:11
}
this.http.post(`/api/ContentVerifies`,body).subscribe(data=>{
this.getAllKeyUnit()
})
}
//撤销审核
cancelAudit(element){
let body:any = {
//title:element.name,
//Operation:0,
id:element.contentVerify.id,
itemId:element.id,
verifyState:-1,
contentType:11
}
this.http.delete(`/api/ContentVerifies/${element.contentVerify.id}`).subscribe(data=>{
this.getAllKeyUnit()
})
}
//审核结果
auditResult(element){
// console.log(element)
const dialogRef = this.dialog.open(companyAuditResult, {
width:"400px",
//height:"300px",
data: {element:element}
});
}
} }
@ -762,4 +827,34 @@ export class upname{
} }
} }
}
//查看审核结果
@Component({
selector: 'resultmeet',
templateUrl: './resultcompanyPlan.html',
styleUrls: ['./key-unit-management.component.scss']
})
export class companyAuditResult{
constructor(private http: HttpClient,public dialogRef: MatDialogRef<companyAuditResult>,@Inject(MAT_DIALOG_DATA) public data,public snackBar: MatSnackBar) {}
planName:any = this.data.element.name
createTime=''
organizationName=this.data.element.organizationName
verifyTime=''
remark=''
verifyOrganizationName
verifyState=100
ngOnInit(): void {
if(this.data.element.contentVerify!=null){
this.createTime=this.data.element.contentVerify.createTime
//this.organizationName=this.data.element.organizationName
this.verifyTime=this.data.element.contentVerify.verifyTime
this.remark=this.data.element.remark
this.verifyState=this.data.element.contentVerify.verifyState
this.verifyOrganizationName=this.data.element.contentVerify.verifyOrganizationName
}
}
onNoClick(): void {
this.dialogRef.close();
}
} }

27
src/app/key-unit/key-unit-management/resultcompanyPlan.html

@ -0,0 +1,27 @@
<!--
* @Descripttion:
* @version:
* @Author: sueRimn
* @Date: 2021-01-20 09:31:24
* @LastEditors: sueRimn
* @LastEditTime: 2021-03-03 11:03:19
-->
<div style="text-align: center;">
<span mat-dialog-title>审批结果</span>
</div>
<div class="auditDiv">
<p>预案名称:{{planName}}</p>
<p>提交时间:{{createTime| date:'yyyy-MM-dd HH:mm:ss'||''}}</p>
<p>发起申请:{{organizationName ||''}}</p>
<mat-divider></mat-divider>
<p>审核时间:{{verifyTime| date:'yyyy-MM-dd HH:mm:ss'||''}}</p>
<p>审核机构:{{verifyOrganizationName||''}}</p>
<p>审核意见:{{remark||''}}</p>
<p>审核结果:{{verifyState==4?'审核通过':verifyState==5?'审核退回':''||''}}</p>
</div>
<div style="text-align: center;margin-top: 18px; ">
<button mat-raised-button (click)="onNoClick()">关闭</button>
</div>

5
src/app/key-unit/key-unit.module.ts

@ -84,10 +84,11 @@ import { WaterRoadComponent } from './water-road/water-road.component';
import { PhotoofthesceneComponent } from './photoofthescene/photoofthescene.component'; import { PhotoofthesceneComponent } from './photoofthescene/photoofthescene.component';
import { KnowRouteComponent } from './know-route/know-route.component'; import { KnowRouteComponent } from './know-route/know-route.component';
import { FindProblemComponent } from './find-problem/find-problem.component'; import { FindProblemComponent } from './find-problem/find-problem.component';
import { upname } from './key-unit-management/key-unit-management.component' import { upname } from './key-unit-management/key-unit-management.component';
import { companyAuditResult } from './key-unit-management/key-unit-management.component'
@NgModule({ @NgModule({
declarations: [KeyUnitManagementComponent, EditUnitInfoComponent, ViewUnitDetailsComponent,CreateUnit,BasicinfoComponent,LookMaster,AddHouseInfo, EditPlanInfoComponent,BasicinfoLookComponent, ViewUnitDetailsPlanComponent,FunctionDivisionComponent,addPartition,addPartitionAttribute,AllaroundComponent,ImgDetails,RealisticPictureComponent,previewImg,addRealPicture,editRealPicture,KeySiteComponent,KeyImgDetail,KeySiteImgs,UploadingCADComponent,readFile,editFile,KeySiteLookComponent,KeySiteImgs2,FunctionDivisionLookComponent,RealisticPictureLookComponent,previewImg3,UploadingCADLookComponent,FireFightingDeviceComponent,ImagesData,previewBigImg,ImgsDataDetail,FireFightingDeviceLookComponent,ImagesData2,ImgsDataDetail2,previewBigImg2,LookMaster2,addPartitionAttribute2, SixFamiliarityComponent, ActualCombatDrillComponent,routerMapComponent, SixFamiliarListComponent,TrainingRecordinfoComponent,RouterGISComponent,WaterRoadComponent,PhotoofthesceneComponent,KnowRouteComponent,FindProblemComponent,upname], declarations: [KeyUnitManagementComponent, EditUnitInfoComponent, ViewUnitDetailsComponent,CreateUnit,BasicinfoComponent,LookMaster,AddHouseInfo, EditPlanInfoComponent,BasicinfoLookComponent, ViewUnitDetailsPlanComponent,FunctionDivisionComponent,addPartition,addPartitionAttribute,AllaroundComponent,ImgDetails,RealisticPictureComponent,previewImg,addRealPicture,editRealPicture,KeySiteComponent,KeyImgDetail,KeySiteImgs,UploadingCADComponent,readFile,editFile,KeySiteLookComponent,KeySiteImgs2,FunctionDivisionLookComponent,RealisticPictureLookComponent,previewImg3,UploadingCADLookComponent,FireFightingDeviceComponent,ImagesData,previewBigImg,ImgsDataDetail,FireFightingDeviceLookComponent,ImagesData2,ImgsDataDetail2,previewBigImg2,LookMaster2,addPartitionAttribute2, SixFamiliarityComponent, ActualCombatDrillComponent,routerMapComponent, SixFamiliarListComponent,TrainingRecordinfoComponent,RouterGISComponent,WaterRoadComponent,PhotoofthesceneComponent,KnowRouteComponent,FindProblemComponent,upname,companyAuditResult],
exports:[ViewUnitDetailsPlanComponent], exports:[ViewUnitDetailsPlanComponent],
imports: [ imports: [
CommonModule, CommonModule,

4
src/app/plan-audit/allaround/allaround.component.ts

@ -4,7 +4,7 @@
* @Author: sueRimn * @Author: sueRimn
* @Date: 2020-11-26 17:10:54 * @Date: 2020-11-26 17:10:54
* @LastEditors: sueRimn * @LastEditors: sueRimn
* @LastEditTime: 2021-02-03 15:29:11 * @LastEditTime: 2021-03-02 09:32:08
*/ */
import { Component, OnInit, Inject } from '@angular/core'; import { Component, OnInit, Inject } from '@angular/core';
import { HttpClient } from '@angular/common/http'; import { HttpClient } from '@angular/common/http';
@ -32,7 +32,7 @@ export class AllaroundComponent implements OnInit {
AllAdjoining:any = []; //所有单位毗邻 AllAdjoining:any = []; //所有单位毗邻
AllBuilding:any = []; //所有建筑 + 建筑毗邻图片 AllBuilding:any = []; //所有建筑 + 建筑毗邻图片
//单位相关数据 //单位相关数据
unitId:string = '5e9964caa760a059e84512e9' unitId:string = sessionStorage.getItem('companyId')
//5ee19fe06f91049f5e23e937 //5ee19fe06f91049f5e23e937
//5fb78554919f2b44e464017e //5fb78554919f2b44e464017e
//获取所有单位毗邻图片 //获取所有单位毗邻图片

3
src/app/plan-audit/basic-info/basic-info.component.ts

@ -59,7 +59,8 @@ export class BasicInfoComponent implements OnInit {
//每次初始化 加载 组件调用方法 //每次初始化 加载 组件调用方法
everyInin () { everyInin () {
//this.unitId = sessionStorage.getItem('unitId') //this.unitId = sessionStorage.getItem('unitId')
this.unitId='5e9964caa760a059e84512e9'
this.unitId=sessionStorage.getItem('companyId')
if (this.unitId) { if (this.unitId) {
this.getUnitInfo().then(()=>{ this.getUnitInfo().then(()=>{
setTimeout(() => { setTimeout(() => {

2
src/app/plan-audit/cad-draw/cad-draw.component.ts

@ -17,7 +17,7 @@ export class CadDrawComponent implements OnInit {
this.companyId = this.unitId this.companyId = this.unitId
this.getAllCAD() this.getAllCAD()
} }
unitId:any = '5e9964caa760a059e84512e9' unitId:any = sessionStorage.getItem('companyId')
displayedColumns: string[] = ['checked', 'name', 'time', 'state','size']; displayedColumns: string[] = ['checked', 'name', 'time', 'state','size'];

4
src/app/plan-audit/fire-facilities/fire-facilities.component.ts

@ -4,7 +4,7 @@
* @Author: sueRimn * @Author: sueRimn
* @Date: 2020-11-23 09:28:54 * @Date: 2020-11-23 09:28:54
* @LastEditors: sueRimn * @LastEditors: sueRimn
* @LastEditTime: 2021-02-03 10:12:45 * @LastEditTime: 2021-03-02 09:32:21
*/ */
import { Component, OnInit, ViewChild, Inject } from '@angular/core'; import { Component, OnInit, ViewChild, Inject } from '@angular/core';
import {HttpClient, HttpHeaders} from '@angular/common/http' import {HttpClient, HttpHeaders} from '@angular/common/http'
@ -32,7 +32,7 @@ export class FireFacilitiesComponent implements OnInit {
this.getAllBuilding() this.getAllBuilding()
} }
unitId:any = '5e9964caa760a059e84512e9' unitId:any = sessionStorage.getItem('companyId')
//定义属性数据 //定义属性数据
singleElection:Food[]=[ singleElection:Food[]=[
{value:'true', name: '有'}, {value:'true', name: '有'},

2
src/app/plan-audit/function-partition/function-partition.component.ts

@ -20,7 +20,7 @@ export class FunctionPartitionComponent implements OnInit {
} }
displayedColumns: string[] = ['checked', 'region', 'measure', 'situation']; displayedColumns: string[] = ['checked', 'region', 'measure', 'situation'];
unitId:any = '5e9964caa760a059e84512e9' unitId:any = sessionStorage.getItem('companyId')
companyId:any; //单位编号 companyId:any; //单位编号
companyFunctionalZoning:any=[]; //所有单位功能分区属性 companyFunctionalZoning:any=[]; //所有单位功能分区属性

2
src/app/plan-audit/key-site-look/key-site.component.ts

@ -23,7 +23,7 @@ export class KeySiteLookComponent implements OnInit {
this.getCompanyTips() this.getCompanyTips()
this.getAllBuilding() this.getAllBuilding()
} }
unitId:any = '5e9964caa760a059e84512e9' unitId:any = sessionStorage.getItem('companyId')
allCompanyPosition:any = []; //所有单位重点部位 allCompanyPosition:any = []; //所有单位重点部位
companyTips:any; //所有单位重点提示 companyTips:any; //所有单位重点提示

2
src/app/plan-audit/plan-list/plan-list.component.ts

@ -12,7 +12,7 @@ export class PlanListComponent implements OnInit {
constructor(private http: HttpClient,public snackBar: MatSnackBar,public dialog: MatDialog) { } constructor(private http: HttpClient,public snackBar: MatSnackBar,public dialog: MatDialog) { }
//单位相关数据 //单位相关数据
unitId:any = '5e9964caa760a059e84512e9' unitId:any = sessionStorage.getItem('companyId')
ngOnInit(): void { ngOnInit(): void {
this.getAllBuildings() this.getAllBuildings()

98
src/app/plan-audit/plan-record/plan-record.component.html

@ -4,7 +4,7 @@
* @Author: sueRimn * @Author: sueRimn
* @Date: 2020-12-25 10:19:31 * @Date: 2020-12-25 10:19:31
* @LastEditors: sueRimn * @LastEditors: sueRimn
* @LastEditTime: 2021-02-20 10:40:25 * @LastEditTime: 2021-03-03 13:54:44
--> -->
<div class="box"> <div class="box">
<div class="boxleft"> <div class="boxleft">
@ -118,60 +118,48 @@
</div> </div>
<div class="boxright"> <div class="boxright">
<mat-tab-group *ngIf="showtype==3" style="flex: 1;overflow-y: auto;" [selectedIndex]="selected.value" (selectedIndexChange)="selected.setValue($event)"> <mat-tab-group *ngIf="showtype == 3" style="flex: 1;overflow-y: auto;margin-top: 10px;" [selectedIndex]="selected.value" (selectedIndexChange)="selected.setValue($event)">
<mat-tab label="基本信息">
<mat-tab label="基本信息"> <ng-template matTabContent>
<ng-template matTabContent> <app-basic-info></app-basic-info>
<app-basic-info></app-basic-info> </ng-template>
</ng-template> </mat-tab>
</mat-tab> <mat-tab label="平面图">
<mat-tab label="平面图"> <ng-template matTabContent>
<ng-template matTabContent> <app-plan-list></app-plan-list>
平面图 </ng-template>
</ng-template> </mat-tab>
</mat-tab> <mat-tab label="四周毗邻">
<mat-tab label="四周毗邻"> <ng-template matTabContent>
<ng-template matTabContent> <app-allaround></app-allaround>
四周毗邻 </ng-template>
</ng-template> </mat-tab>
</mat-tab> <mat-tab label="消防设施">
<mat-tab label="消防设施"> <ng-template matTabContent>
<ng-template matTabContent> <app-fire-facilities></app-fire-facilities>
消防设施 </ng-template>
</ng-template> </mat-tab>
</mat-tab> <mat-tab label="重点部位">
<mat-tab label="重点部位"> <ng-template matTabContent>
<ng-template matTabContent> <app-key-site-look></app-key-site-look>
重点部位 </ng-template>
</ng-template> </mat-tab>
</mat-tab> <mat-tab label="功能分区">
<mat-tab label="功能分区"> <ng-template matTabContent>
<ng-template matTabContent> <app-function-partition></app-function-partition>
功能分区 </ng-template>
</ng-template> </mat-tab>
</mat-tab> <mat-tab label="实景图">
<mat-tab label="实景图"> <ng-template matTabContent>
<ng-template matTabContent> <app-realistic-picture-look></app-realistic-picture-look>
实景图 </ng-template>
</ng-template> </mat-tab>
</mat-tab> <mat-tab label="CAD">
<mat-tab label="CAD"> <ng-template matTabContent>
<ng-template matTabContent> <app-cad-draw></app-cad-draw>
cad </ng-template>
</ng-template> </mat-tab>
</mat-tab> </mat-tab-group>
<!-- <mat-tab label="六熟悉">
<ng-template matTabContent>
六熟悉
</ng-template>
</mat-tab>
<mat-tab label="实战演练">
<ng-template matTabContent>
实战演练
</ng-template>
</mat-tab> -->
</mat-tab-group>
<div class="word" *ngIf="showtype==0"> <div class="word" *ngIf="showtype==0">
<iframe [src]='iframeSrc'></iframe> <iframe [src]='iframeSrc'></iframe>
</div> </div>

87
src/app/plan-audit/plan-record/plan-record.component.ts

@ -4,7 +4,7 @@
* @Author: sueRimn * @Author: sueRimn
* @Date: 2020-12-25 10:19:31 * @Date: 2020-12-25 10:19:31
* @LastEditors: sueRimn * @LastEditors: sueRimn
* @LastEditTime: 2021-02-22 10:49:38 * @LastEditTime: 2021-03-03 14:01:47
*/ */
import { Component, OnInit,Inject } from '@angular/core'; import { Component, OnInit,Inject } from '@angular/core';
import { FormControl } from '@angular/forms'; import { FormControl } from '@angular/forms';
@ -133,48 +133,67 @@ export class PlanRecordComponent implements OnInit {
//表格点击事件 //表格点击事件
viewer//全景图对象 viewer//全景图对象
tableClick(e,item){ tableClick(e,item){
this.showtype = -1
//e.target.parentElement.bgColor='#2196F3' //e.target.parentElement.bgColor='#2196F3'
//console.log(e,item) //console.log(e,item)
this.organizationName='' this.organizationName=''
this.id=item.id this.id=item.id
this.fetchUrl='' this.fetchUrl=''
this.viewer={}
this.http.get(`/api/PlanComponents/${item.itemId}`).subscribe((data:any)=>{ if(item.contentType == 11){
this.companyId=data.companyId window.setTimeout(()=>{
this.companyName=data.companyName this.showtype = 3
if(data.planType!=2&&data.planType!=1){ sessionStorage.setItem('companyId',item.itemId)
this.fetchUrl=data.attachmentUrls[0] },0)
var index=this.fetchUrl.indexOf("\/") }else if(item.contentType == 12){
if(this.fetchUrl.substr(0,index)=='psw'){ //水源
this.showtype=1 this.showtype = 12
var obj=document.getElementById('viewer') }else if(item.contentType == 13){
if(obj!=null){ //消防力量
obj.innerHTML='' this.showtype = 13
}else if(item.contentType == 14){
//联动力量
this.showtype = 14
}else{
this.http.get(`/api/PlanComponents/${item.itemId}`).subscribe((data:any)=>{
this.companyId=data.companyId
this.companyName=data.companyName
if(data.planType!=2&&data.planType!=1){
this.fetchUrl=data.attachmentUrls[0]
var index=this.fetchUrl.indexOf("\/")
if(this.fetchUrl.substr(0,index)=='psw'){
this.showtype=1
var obj=document.getElementById('viewer')
if(obj!=null){
obj.innerHTML=''
}
window.setTimeout(()=>{
this.viewer = new Viewer({
container: document.querySelector('#viewer'),
panorama:'/api/Objects/PlanPlatform/'+ this.fetchUrl,
});
})
}else{
this.lookWord()
} }
window.setTimeout(()=>{
this.viewer = new Viewer({
container: document.querySelector('#viewer'),
panorama:'/api/Objects/PlanPlatform/'+ this.fetchUrl,
});
})
}else{ }else{
this.lookWord() this.organizationName=item.organizationName
this.planData = data
this.handleData()
return
//this.src=`/planAudit/planpass?id=${data.companyId}&companyName=${data.companyName}&auditPlanId=${data.id}&auditStatus=${data.auditStatus}&planType=1`
//this.iframeSrc=this.sanitizer.bypassSecurityTrustResourceUrl(this.src);
//window.open(`/planAudit/planpass?id=${data.companyId}&companyName=${data.companyName}&auditPlanId=${data.id}&auditStatus=${data.auditStatus}&planType=1`)
} }
}else{
this.organizationName=item.organizationName
this.planData = data
this.handleData()
return
//this.src=`/planAudit/planpass?id=${data.companyId}&companyName=${data.companyName}&auditPlanId=${data.id}&auditStatus=${data.auditStatus}&planType=1`
//this.iframeSrc=this.sanitizer.bypassSecurityTrustResourceUrl(this.src); })
//window.open(`/planAudit/planpass?id=${data.companyId}&companyName=${data.companyName}&auditPlanId=${data.id}&auditStatus=${data.auditStatus}&planType=1`) }
}
})
if(e.checked){ if(e.checked){
this.shenheTable.push(item) this.shenheTable.push(item)

2
src/app/plan-audit/realistic-picture-look/realistic-picture.component.ts

@ -35,7 +35,7 @@ export class RealisticPictureLookComponent implements OnInit {
} }
unitId:any = '5e9964caa760a059e84512e9' unitId:any = sessionStorage.getItem('companyId')
companyId:any; //单位编号 companyId:any; //单位编号
allRealPicture:any=[]; //所有实景图文件 allRealPicture:any=[]; //所有实景图文件

116
src/app/plan-audit/wait-examineer/wait-examineer.component.html

@ -54,12 +54,11 @@
</table> </table>
<div class="tbodycss" id="tbodydiv" > <div class="tbodycss" id="tbodydiv" >
<table cellspacing="0" cellpadding="0" id="table" > <table cellspacing="0" cellpadding="0" id="table" >
<tr *ngFor="let item of tableDate;let key = index" (click)='radioClick($event,item)'> <tr [ngClass]="{'selectedTr': item.id == id}" *ngFor="let item of tableDate;let key = index" (click)='radioClick($event,item)'>
<td style="width: 15%;"> <td style="width: 15%;">
<mat-checkbox color="primary" (change)='radioClick($event,item)'></mat-checkbox> <mat-checkbox color="primary" (change)='radioClick($event,item)'></mat-checkbox>
<!-- <input type="checkbox" name="yuan" value={{item.id}} (click)='radioClick($event,item)'> -->
{{item.contentType=='1'?'Ⅰ级预案':item.contentType=='2'?'Ⅱ级预案':item.contentType=='3'?'Ⅲ级预案':item.contentType=='4'?'Ⅳ级预案':item.contentType=='5'? {{item.contentType=='1'?'Ⅰ级预案':item.contentType=='2'?'Ⅱ级预案':item.contentType=='3'?'Ⅲ级预案':item.contentType=='4'?'Ⅳ级预案':item.contentType=='5'?
'Ⅴ级预案':item.contentType=='6'?'应急预案(国家级)':item.contentType=='7'?'应急预案(市级)':item.contentType=='8'?'类型预案':item.contentType=='11'?'重点单位':'消防车辆'}}</td> 'Ⅴ级预案':item.contentType=='6'?'应急预案(国家级)':item.contentType=='7'?'应急预案(市级)':item.contentType=='8'?'类型预案':item.contentType=='11'?'重点单位':item.contentType=='12'?'水源':item.contentType=='13'?'消防力量':item.contentType=='14'?'联动力量':'未知'}}</td>
<td style="width: 15%;" [ngClass]="{'green': item.operation == '1','red':item.operation == '2','blue':item.operation == '0'}">{{item.operation=='0'?'新增':item.operation=='1'?'更新':'删除'}}</td> <td style="width: 15%;" [ngClass]="{'green': item.operation == '1','red':item.operation == '2','blue':item.operation == '0'}">{{item.operation=='0'?'新增':item.operation=='1'?'更新':'删除'}}</td>
<td style="width: 15%;">{{item.verifyOrganizationName}}</td> <td style="width: 15%;">{{item.verifyOrganizationName}}</td>
<td style="width: 15%;" [ngClass]="{'green': item.verifyState == '1'||item.verifyState == '4','red':item.verifyState == '2'||item.verifyState == '5'}">{{item.verifyState=='0'?'待初审':item.verifyState=='1'? <td style="width: 15%;" [ngClass]="{'green': item.verifyState == '1'||item.verifyState == '4','red':item.verifyState == '2'||item.verifyState == '5'}">{{item.verifyState=='0'?'待初审':item.verifyState=='1'?
@ -82,56 +81,59 @@
<button mat-raised-button style="color: #FFFFFF;background-color: #FF7161;float: right;" (click)='refuse()'>拒绝</button> <button mat-raised-button style="color: #FFFFFF;background-color: #FF7161;float: right;" (click)='refuse()'>拒绝</button>
<button mat-raised-button style="color: #FFFFFF;background-color: #38D984;float: right;" (click)='agree()'>同意</button> <button mat-raised-button style="color: #FFFFFF;background-color: #38D984;float: right;" (click)='agree()'>同意</button>
</div> </div>
<div class="rightheadone" *ngIf="showtype==3"> <div class="rightheadone" style="display: none;">
<button mat-raised-button color="primary" (click)="buttonChange()"><img src="../../../assets/images/preview.png" style="margin-right: 3px;margin-bottom: 3px;display: none;">{{isallDate?'显示变更数据':'显示完整数据'}} </button> <button mat-raised-button color="primary" (click)="buttonChange()"><img src="../../../assets/images/preview.png" style="margin-right: 3px;margin-bottom: 3px;display: none;">{{isallDate?'显示变更数据':'显示完整数据'}} </button>
<button mat-raised-button *ngIf="isallDate" style="background-color: #FFCC00; color: #FFFFFF;" (click)="preview()"><img src="../../../assets/images/change.png" style="margin-bottom: 2px;" > 预览得分</button> <button mat-raised-button *ngIf="isallDate" style="background-color: #FFCC00; color: #FFFFFF;" (click)="preview()"><img src="../../../assets/images/change.png" style="margin-bottom: 2px;" > 预览得分</button>
</div> </div>
</div> </div>
<mat-tab-group *ngIf="showtype==3" style="flex: 1;overflow-y: auto;margin-top: 10px;" [selectedIndex]="selected.value" (selectedIndexChange)="selected.setValue($event)"> <div id="company">
<mat-tab label="基本信息"> <mat-tab-group *ngIf="showtype == 3" style="flex: 1;overflow-y: auto;margin-top: 10px;" [selectedIndex]="selected.value" (selectedIndexChange)="selected.setValue($event)">
<ng-template matTabContent> <mat-tab label="基本信息">
<app-basic-info></app-basic-info> <ng-template matTabContent>
</ng-template> <app-basic-info></app-basic-info>
</mat-tab> </ng-template>
<mat-tab label="平面图"> </mat-tab>
<ng-template matTabContent> <mat-tab label="平面图">
<app-plan-list></app-plan-list> <ng-template matTabContent>
</ng-template> <app-plan-list></app-plan-list>
</mat-tab> </ng-template>
<mat-tab label="四周毗邻"> </mat-tab>
<ng-template matTabContent> <mat-tab label="四周毗邻">
<app-allaround></app-allaround> <ng-template matTabContent>
</ng-template> <app-allaround></app-allaround>
</mat-tab> </ng-template>
<mat-tab label="消防设施"> </mat-tab>
<ng-template matTabContent> <mat-tab label="消防设施">
<app-fire-facilities></app-fire-facilities> <ng-template matTabContent>
</ng-template> <app-fire-facilities></app-fire-facilities>
</mat-tab> </ng-template>
<mat-tab label="重点部位"> </mat-tab>
<ng-template matTabContent> <mat-tab label="重点部位">
<app-key-site-look></app-key-site-look> <ng-template matTabContent>
</ng-template> <app-key-site-look></app-key-site-look>
</mat-tab> </ng-template>
<mat-tab label="功能分区"> </mat-tab>
<ng-template matTabContent> <mat-tab label="功能分区">
<app-function-partition></app-function-partition> <ng-template matTabContent>
</ng-template> <app-function-partition></app-function-partition>
</mat-tab> </ng-template>
<mat-tab label="实景图"> </mat-tab>
<ng-template matTabContent> <mat-tab label="实景图">
<app-realistic-picture-look></app-realistic-picture-look> <ng-template matTabContent>
</ng-template> <app-realistic-picture-look></app-realistic-picture-look>
</mat-tab> </ng-template>
<mat-tab label="CAD"> </mat-tab>
<ng-template matTabContent> <mat-tab label="CAD">
<app-cad-draw></app-cad-draw> <ng-template matTabContent>
</ng-template> <app-cad-draw></app-cad-draw>
</mat-tab> </ng-template>
</mat-tab-group> </mat-tab>
<div id="firefacilities" *ngIf="showtype==3 && !isallDate" style="margin: 10px;"> </mat-tab-group>
</div>
<div id="firefacilities" *ngIf="showtype == 3 && !isallDate" style="margin: 10px;">
<mat-accordion class="tableContent" > <mat-accordion class="tableContent" >
<mat-expansion-panel expanded style="box-shadow: 0 0 black;border: 1px solid #EEF1F5;"> <mat-expansion-panel expanded style="box-shadow: 0 0 black;border: 1px solid #EEF1F5;">
<mat-expansion-panel-header collapsedHeight ='40px' expandedHeight='40px' class="panelhead" style="background-color: #2196F3;"> <mat-expansion-panel-header collapsedHeight ='40px' expandedHeight='40px' class="panelhead" style="background-color: #2196F3;">
@ -239,11 +241,11 @@
</mat-expansion-panel> </mat-expansion-panel>
</mat-accordion> </mat-accordion>
</div> </div>
<div class="word" *ngIf="showtype==0"> <div class="word" *ngIf="showtype == 0">
<iframe [src]='iframeSrc'></iframe> <iframe [src]='iframeSrc'></iframe>
</div> </div>
<div id="viewer" *ngIf="showtype==1"></div> <div id="viewer" *ngIf="showtype == 1"></div>
<div class="twoD" *ngIf="showtype==2"> <div class="twoD" *ngIf="showtype == 2">
<div class="planBox"> <div class="planBox">
<span>单位名称: </span> <span>单位名称: </span>
<span>{{compantData.name?compantData.name : '暂无数据'}}</span> <span>{{compantData.name?compantData.name : '暂无数据'}}</span>
@ -265,17 +267,17 @@
</div> </div>
</div> </div>
<!-- 水源审核 --> <!-- 水源审核 -->
<!-- <div class="waterAudit"> <div class="waterAudit" *ngIf="showtype == 12">
<app-water-audit></app-water-audit> <app-water-audit [waterData]="waterData"></app-water-audit>
</div> --> </div>
<!-- 消防力量审核 --> <!-- 消防力量审核 -->
<!-- <div class="fireForceAudit"> <div class="fireForceAudit" *ngIf="showtype == 13">
<app-fireforce-audit></app-fireforce-audit> <app-fireforce-audit></app-fireforce-audit>
</div> --> </div>
<!-- 联动力量审核 --> <!-- 联动力量审核 -->
<!-- <div class="LinkageForcesAudit"> <div class="LinkageForcesAudit" *ngIf="showtype == 14">
<app-linkageforces-audit></app-linkageforces-audit> <app-linkageforces-audit></app-linkageforces-audit>
</div> --> </div>
</div> </div>
</div> </div>
<div class="echarts" *ngIf="previewshow" ><!-- [style.display]="previewshow==true?'block':'none'" --> <div class="echarts" *ngIf="previewshow" ><!-- [style.display]="previewshow==true?'block':'none'" -->

4
src/app/plan-audit/wait-examineer/wait-examineer.component.scss

@ -50,6 +50,9 @@
overflow-y: auto; overflow-y: auto;
height: 700px; height: 700px;
width: 100%; width: 100%;
.selectedTr{
background-color: #b3d3ee;
}
} }
table{ table{
margin-left:10px; margin-left:10px;
@ -71,6 +74,7 @@
} }
.boxright{ .boxright{
height: 100%; height: 100%;
width: 55%;
flex: 1; flex: 1;
background-color: #FFFFFF; background-color: #FFFFFF;
margin-left: 10px; margin-left: 10px;

333
src/app/plan-audit/wait-examineer/wait-examineer.component.ts

@ -4,7 +4,7 @@
* @Author: sueRimn * @Author: sueRimn
* @Date: 2020-12-25 16:13:50 * @Date: 2020-12-25 16:13:50
* @LastEditors: sueRimn * @LastEditors: sueRimn
* @LastEditTime: 2021-02-22 10:49:28 * @LastEditTime: 2021-03-03 15:13:25
*/ */
import { Component, Inject, OnInit } from '@angular/core'; import { Component, Inject, OnInit } from '@angular/core';
import { FormControl } from '@angular/forms'; import { FormControl } from '@angular/forms';
@ -103,7 +103,7 @@ export class WaitExamineerComponent implements OnInit {
chuorzhong//判断初审还是终审 chuorzhong//判断初审还是终审
radioid//选中的id radioid//选中的id
shenheTable=[]//选中要审核的对象 shenheTable=[]//选中要审核的对象
showtype//0:word,1:全景图,2:二维三维,3:重点单位 showtype=-1//0:word,1:全景图,2:二维三维,3:重点单位
compantData={name:'',buildingTypes:[],address:''} compantData={name:'',buildingTypes:[],address:''}
organizationName organizationName
planData planData
@ -122,7 +122,7 @@ export class WaitExamineerComponent implements OnInit {
verifyState:[0,3] verifyState:[0,3]
} }
this.http.get("/api/ContentVerifies",{params:paramsdata}).subscribe((data:any)=>{ this.http.get("/api/ContentVerifies",{params:paramsdata}).subscribe((data:any)=>{
//console.log(data) console.log(data)
this.tableDate=data.items this.tableDate=data.items
this.count=data.totalCount this.count=data.totalCount
}) })
@ -153,49 +153,75 @@ export class WaitExamineerComponent implements OnInit {
} }
//radio点击事件 //radio点击事件
viewer//全景图对象 viewer//全景图对象
waterData:any//需要传递给子组件的水源信息
radioClick(e,item){ radioClick(e,item){
this.showtype = -1
//e.target.parentElement.bgColor='#2196F3' //e.target.parentElement.bgColor='#2196F3'
//console.log(e,item) console.log(item)
this.organizationName='' this.organizationName=''
this.id=item.id this.id=item.id
this.fetchUrl='' this.fetchUrl=''
this.viewer={} this.viewer={}
this.http.get(`/api/PlanComponents/${item.itemId}`).subscribe((data:any)=>{ if(item.contentType == 11){
this.companyId=data.companyId window.setTimeout(()=>{
this.companyName=data.companyName this.showtype = 3
if(data.planType!=2&&data.planType!=1){ sessionStorage.setItem('companyId',item.itemId)
this.fetchUrl=data.attachmentUrls[0] },0)
var index=this.fetchUrl.indexOf("\/") }else if(item.contentType == 12){
if(this.fetchUrl.substr(0,index)=='psw'){ //水源
this.showtype=1
var obj=document.getElementById('viewer') // console.log(item.itemId)
if(obj!=null){ this.http.get(`/api/WaterSources/${item.itemId}`).subscribe((data)=>{
obj.innerHTML=''
console.log('水源',data)
this.waterData = data
this.showtype = 12
})
}else if(item.contentType == 13){
//消防力量
this.showtype = 13
}else if(item.contentType == 14){
//联动力量
this.showtype = 14
}else{
this.http.get(`/api/PlanComponents/${item.itemId}`).subscribe((data:any)=>{
this.companyId=data.companyId
this.companyName=data.companyName
if(data.planType!=2&&data.planType!=1){
this.fetchUrl=data.attachmentUrls[0]
var index=this.fetchUrl.indexOf("\/")
if(this.fetchUrl.substr(0,index)=='psw'){
this.showtype=1
var obj=document.getElementById('viewer')
if(obj!=null){
obj.innerHTML=''
}
window.setTimeout(()=>{
this.viewer = new Viewer({
container: document.querySelector('#viewer'),
panorama:'/api/Objects/PlanPlatform/'+ this.fetchUrl,
});
})
}else{
this.lookWord()
} }
window.setTimeout(()=>{
this.viewer = new Viewer({
container: document.querySelector('#viewer'),
panorama:'/api/Objects/PlanPlatform/'+ this.fetchUrl,
});
})
}else{ }else{
this.lookWord() this.organizationName=item.organizationName
this.planData = data
this.handleData()
return
//this.src=`/planAudit/planpass?id=${data.companyId}&companyName=${data.companyName}&auditPlanId=${data.id}&auditStatus=${data.auditStatus}&planType=1`
//this.iframeSrc=this.sanitizer.bypassSecurityTrustResourceUrl(this.src);
//window.open(`/planAudit/planpass?id=${data.companyId}&companyName=${data.companyName}&auditPlanId=${data.id}&auditStatus=${data.auditStatus}&planType=1`)
} }
}else{
this.organizationName=item.organizationName
this.planData = data
this.handleData()
return
//this.src=`/planAudit/planpass?id=${data.companyId}&companyName=${data.companyName}&auditPlanId=${data.id}&auditStatus=${data.auditStatus}&planType=1`
//this.iframeSrc=this.sanitizer.bypassSecurityTrustResourceUrl(this.src); })
//window.open(`/planAudit/planpass?id=${data.companyId}&companyName=${data.companyName}&auditPlanId=${data.id}&auditStatus=${data.auditStatus}&planType=1`) }
}
})
if(e.checked){ if(e.checked){
this.shenheTable.push(item) this.shenheTable.push(item)
@ -304,85 +330,198 @@ export class WaitExamineerComponent implements OnInit {
//同意操作 //同意操作
agree(){ agree(){
var agreeList=[] var agreeList=[]
var companyAgreeList=[]
const config = new MatSnackBarConfig(); const config = new MatSnackBarConfig();
config.verticalPosition = 'top'; config.verticalPosition = 'top';
config.duration = 3000 config.duration = 3000
/* if(this.chuorzhong==2){ console.log(this.shenheTable)
this.snackBar.open('审核未通过,请修改后再来审核!','确定',config);
} */
//console.log(this.shenheTable)
if(this.shenheTable.length==0){ if(this.shenheTable.length==0){
this.snackBar.open('请选择要审核的预案!','确定',config); this.snackBar.open('请勾选要审核的条目!','确定',config);
} }
else if(this.shenheTable.length==1){ //单个审核
if(this.shenheTable[0].verifyState==0){ else if(this.shenheTable.length == 1){
this.http.put(`/api/PlanAudits/${this.shenheTable[0].itemId}/First`,{auditStatus:16}).subscribe(data=>{ let isTrue = window.confirm('确定同意选中条目的审核吗?')
if(isTrue){
//重点单位审核
if(this.shenheTable[0].contentType == 11){
let body:any = {
id:this.shenheTable[0].id,
itemId:this.shenheTable[0].itemId,
verifyState:4,
contentType:11,
title:this.shenheTable[0].title+'基本信息'
}
this.http.put(`/api/ContentVerifies`,body).subscribe(data=>{
this.snackBar.open('操作成功!','确定',config);
this.getAlltabledate()
})
}else if(this.shenheTable[0].contentType == 12){
let body:any = {
id:this.shenheTable[0].id,
itemId:this.shenheTable[0].itemId,
verifyState:4,
contentType:12,
title:this.shenheTable[0].title
}
this.http.put(`/api/ContentVerifies`,body).subscribe(data=>{
this.snackBar.open('操作成功!','确定',config);
this.showtype = -1
this.getAlltabledate()
})
}else if(this.shenheTable[0].contentType == 13){
}else if(this.shenheTable[0].contentType == 14){
}else{
//预案审核
if(this.shenheTable[0].verifyState==0){
this.http.put(`/api/PlanAudits/${this.shenheTable[0].itemId}/First`,{auditStatus:16}).subscribe(data=>{
this.snackBar.open('操作成功!','确定',config);
this.getAlltabledate()
})
}else if(this.shenheTable[0].verifyState==3){
this.http.put(`/api/PlanAudits/${this.radioid}`,{auditStatus:2}).subscribe(data=>{
this.snackBar.open('操作成功!','确定',config);
this.getAlltabledate()
})
}
}
}
}
//批量审核
else{
let isTrue = window.confirm('确定同意选中条目的审核吗?')
if(isTrue){
if(this.shenheTable[0].contentType==11||this.shenheTable[0].contentType==12){ //批量审批水源和重点单位
for(var i=0;i<this.shenheTable.length;i++){
var body={
id:this.shenheTable[i].id,
itemId:this.shenheTable[i].itemId,
verifyState:4
}
companyAgreeList.push(body)
}
this.http.put(`/api/ContentVerifies/Batch`,companyAgreeList).subscribe(data=>{
this.snackBar.open('操作成功!','确定',config);
this.getAlltabledate()
})
}else{ //批量审核预案
for(var i=0;i<this.shenheTable.length;i++){
var cart={
planComponentId:this.shenheTable[i].itemId,
auditStatus:this.shenheTable[i].verifyState==3?2:16,
auditOpinion:''
}
agreeList.push(cart)
}
this.http.put(`/api/PlanAudits/Batch`,agreeList).subscribe(data=>{
this.snackBar.open('操作成功!','确定',config);
this.getAlltabledate()
})
}
}
}
this.shenheTable=[]
}
//拒绝操作
refuse(){
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
var refuseList = []
var companyrefuseList=[]
if(this.shenheTable.length==0){
this.snackBar.open('请选择要审核的预案!','确定',config);
}
//单个审核拒绝
else if(this.shenheTable.length==1){
let isTrue = window.confirm('确定拒绝选中条目的审核吗?')
if(isTrue){
//重点单位审核拒绝
if(this.shenheTable[0].contentType == 11){
let body:any = {
id:this.shenheTable[0].id,
itemId:this.shenheTable[0].itemId,
verifyState:5,
contentType:11,
title:this.shenheTable[0].title+'基本信息'
}
this.http.put(`/api/ContentVerifies`,body).subscribe(data=>{
this.snackBar.open('操作成功!','确定',config); this.snackBar.open('操作成功!','确定',config);
this.getAlltabledate() this.getAlltabledate()
}) })
}else if(this.shenheTable[0].verifyState==3){ }else if(this.shenheTable[0].contentType == 12){
this.http.put(`/api/PlanAudits/${this.radioid}`,{auditStatus:2}).subscribe(data=>{ let body:any = {
id:this.shenheTable[0].id,
itemId:this.shenheTable[0].itemId,
verifyState:5,
contentType:12,
title:this.shenheTable[0].title
}
this.http.put(`/api/ContentVerifies`,body).subscribe(data=>{
this.showtype = -1
this.snackBar.open('操作成功!','确定',config); this.snackBar.open('操作成功!','确定',config);
this.getAlltabledate() this.getAlltabledate()
}) })
} }else if(this.shenheTable[0].contentType == 13){
}
else{ }else if(this.shenheTable[0].contentType == 14){
for(var i=0;i<this.shenheTable.length;i++){
var cart={ }else{
planComponentId:this.shenheTable[i].itemId, //预案审核拒绝
auditStatus:this.shenheTable[i].verifyState==3?2:16, if(this.shenheTable[0].verifyState==0){
auditOpinion:'' this.http.put(`/api/PlanAudits/${this.shenheTable[0].itemId}/First`,{auditStatus:32}).subscribe(data=>{
this.snackBar.open('操作成功!','确定',config);
this.getAlltabledate()
})
}else if(this.shenheTable[0].verifyState==3){
this.http.put(`/api/PlanAudits/${this.radioid}`,{auditStatus:4}).subscribe(data=>{
this.snackBar.open('操作成功!','确定',config);
this.getAlltabledate()
})
} }
agreeList.push(cart)
} }
this.http.put(`/api/PlanAudits/Batch`,agreeList).subscribe(data=>{
this.snackBar.open('操作成功!','确定',config);
this.getAlltabledate()
})
} }
this.shenheTable=[]
}
//拒绝操作
refuse(){
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
var refuseList=[]
if(this.shenheTable.length==0){
this.snackBar.open('请选择要审核的预案!','确定',config);
}
else if(this.shenheTable.length==1){
if(this.shenheTable[0].verifyState==0){
this.http.put(`/api/PlanAudits/${this.shenheTable[0].itemId}/First`,{auditStatus:32}).subscribe(data=>{
this.snackBar.open('操作成功!','确定',config);
this.getAlltabledate()
})
}else if(this.shenheTable[0].verifyState==3){
this.http.put(`/api/PlanAudits/${this.radioid}`,{auditStatus:4}).subscribe(data=>{
this.snackBar.open('操作成功!','确定',config);
this.getAlltabledate()
})
} }
} //批量审核
else{ else{
for(var i=0;i<this.shenheTable.length;i++){ let isTrue = window.confirm('确定拒绝选中条目的审核吗?')
var cart={ if(isTrue){
planComponentId:this.shenheTable[i].itemId, if(this.shenheTable[0].contentType==11||this.shenheTable[0].contentType==12){ //批量审批水源和重点单位
auditStatus:this.shenheTable[i].verifyState==3?4:32, for(var i=0;i<this.shenheTable.length;i++){
auditOpinion:'' var body={
id:this.shenheTable[i].id,
itemId:this.shenheTable[i].itemId,
verifyState:5
}
companyrefuseList.push(body)
}
this.http.put(`/api/ContentVerifies/Batch`,companyrefuseList).subscribe(data=>{
this.snackBar.open('操作成功!','确定',config);
this.getAlltabledate()
})
}else{
for(var i=0;i<this.shenheTable.length;i++){
var cart={
planComponentId:this.shenheTable[i].itemId,
auditStatus:this.shenheTable[i].verifyState==3?4:32,
auditOpinion:''
}
refuseList.push(cart)
}
this.http.put(`/api/PlanAudits/Batch`,refuseList).subscribe(data=>{
this.snackBar.open('操作成功!','确定',config);
this.getAlltabledate()
})
}
} }
refuseList.push(cart)
} }
this.http.put(`/api/PlanAudits/Batch`,refuseList).subscribe(data=>{ this.shenheTable=[]
this.snackBar.open('操作成功!','确定',config);
this.getAlltabledate()
})
}
this.shenheTable=[]
} }
//分数饼状图 //分数饼状图
bar(){ bar(){

2
src/app/plan-audit/water-audit/water-audit.component.html

@ -4,7 +4,7 @@
<div class="tabsbox"> <div class="tabsbox">
<div class="tabs"> <div class="tabs">
<div class="selectedBtn"> <div class="selectedBtn">
<span>消火栓</span> <span>{{selectedWaterTypeIndex == 0 ? '消火栓' : selectedWaterTypeIndex == 1 ? '消防水池' : selectedWaterTypeIndex == 2 ? '天然水源' : null}}</span>
</div> </div>
</div> </div>
</div> </div>

49
src/app/plan-audit/water-audit/water-audit.component.ts

@ -1,4 +1,4 @@
import { Component, OnInit } from '@angular/core'; import { Component, Input, OnInit } from '@angular/core';
declare var AMap: any; declare var AMap: any;
@Component({ @Component({
selector: 'app-water-audit', selector: 'app-water-audit',
@ -6,7 +6,7 @@ declare var AMap: any;
styleUrls: ['./water-audit.component.scss'] styleUrls: ['./water-audit.component.scss']
}) })
export class WaterAuditComponent implements OnInit { export class WaterAuditComponent implements OnInit {
@Input() public waterData: any;//data名字根据引用场景自定义
constructor() { } constructor() { }
map:any map:any
newPositionMarker:any newPositionMarker:any
@ -15,9 +15,12 @@ export class WaterAuditComponent implements OnInit {
' <img style="width:20px;height:24px" src="/assets/images/定位.png">' + ' <img style="width:20px;height:24px" src="/assets/images/定位.png">' +
'</div>' '</div>'
ngOnInit(): void { ngOnInit(): void {
this.selectedWaterTypeIndex = this.waterData.waterSourceType
this.waterData.detailData = JSON.parse(this.waterData.detailData) this.waterData.detailData = JSON.parse(this.waterData.detailData)
this.fireCockData = this.waterData.detailData this.fireCockData = this.waterData.detailData
console.log(789, this.fireCockData) this.poolData = this.waterData.detailData
this.naturalWaterData = this.waterData.detailData
setTimeout(() => { setTimeout(() => {
this.map = new AMap.Map('container', { this.map = new AMap.Map('container', {
zoom:18 zoom:18
@ -38,27 +41,27 @@ export class WaterAuditComponent implements OnInit {
}, 0); }, 0);
} }
selectedWaterTypeIndex:number = 0//选择的水源类型 0消火栓 1水池 2天然水源 selectedWaterTypeIndex:number //选择的水源类型 0消火栓 1水池 2天然水源
fireCockData:any = []//消火栓详情 fireCockData:any = []//消火栓详情
poolData:any = []//水池详情 poolData:any = []//水池详情
naturalWaterData:any = []//天然水源详情 naturalWaterData:any = []//天然水源详情
waterData:any = { // waterData:any = {
id: "60125d31d31fab7de81c56b0", // id: "60125d31d31fab7de81c56b0",
name: "上海中心消火栓01", // name: "上海中心消火栓01",
administrativeRegion: "上海区", // administrativeRegion: "上海区",
governmentLevel: "1", // governmentLevel: "1",
village: "小高社区", // village: "小高社区",
address: "国际会议中心", // address: "国际会议中心",
location: { // location: {
x: 121.496717, // x: 121.496717,
y: 31.239452 // y: 31.239452
}, // },
detailData: "[{\"PropertyName\":\"可用状态\",\"PropertyValue\":\"1\"},{\"PropertyName\":\"放置形式\",\"PropertyValue\":\"1\"},{\"PropertyName\":\"管网形式\",\"PropertyValue\":\"2\"},{\"PropertyName\":\"管网直径\",\"PropertyValue\":\"2\"},{\"PropertyName\":\"管网压力类型\",\"PropertyValue\":\"1\"},{\"PropertyName\":\"管网压力范围\",\"PropertyValue\":\"2222\"},{\"PropertyName\":\"接口形式\",\"PropertyValue\":\"1\"},{\"PropertyName\":\"接口口径\",\"PropertyValue\":\"3\"},{\"PropertyName\":\"最大流量\",\"PropertyValue\":\"333\"},{\"PropertyName\":\"供水单位\",\"PropertyValue\":\"剃剃头\"},{\"PropertyName\":\"联系方式\",\"PropertyValue\":\"119\"},{\"PropertyName\":\"备注\",\"PropertyValue\":\"突突突突突突\"}]", // detailData: "[{\"PropertyName\":\"可用状态\",\"PropertyValue\":\"1\"},{\"PropertyName\":\"放置形式\",\"PropertyValue\":\"1\"},{\"PropertyName\":\"管网形式\",\"PropertyValue\":\"2\"},{\"PropertyName\":\"管网直径\",\"PropertyValue\":\"2\"},{\"PropertyName\":\"管网压力类型\",\"PropertyValue\":\"1\"},{\"PropertyName\":\"管网压力范围\",\"PropertyValue\":\"2222\"},{\"PropertyName\":\"接口形式\",\"PropertyValue\":\"1\"},{\"PropertyName\":\"接口口径\",\"PropertyValue\":\"3\"},{\"PropertyName\":\"最大流量\",\"PropertyValue\":\"333\"},{\"PropertyName\":\"供水单位\",\"PropertyValue\":\"剃剃头\"},{\"PropertyName\":\"联系方式\",\"PropertyValue\":\"119\"},{\"PropertyName\":\"备注\",\"PropertyValue\":\"突突突突突突\"}]",
detailItems: null, // detailItems: null,
createTime: "2021-02-03T02:36:57.451Z", // createTime: "2021-02-03T02:36:57.451Z",
creatorId: "5e8eced2aaca5f7c1025309b", // creatorId: "5e8eced2aaca5f7c1025309b",
deleted: false, // deleted: false,
waterSourceType: 0, // waterSourceType: 0,
integrityScore: 0.21052632 // integrityScore: 0.21052632
} // }
} }

5
src/app/plan-management/entry-plan-look/entry-plan-look.component.ts

@ -297,6 +297,11 @@ export class EntryPlanLookComponent implements OnInit {
}else{ }else{
this.http.put(`/api/PlanComponents/${element.id}/Cancel`,"").subscribe(data=>{ this.http.put(`/api/PlanComponents/${element.id}/Cancel`,"").subscribe(data=>{
this.getAllPlanComponents() this.getAllPlanComponents()
},err => {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open(err,'确定',config);
}) })
} }
} }

15
src/app/statistic-analysis/buildingType/building-type-one/building-type-one.component.ts

@ -16,7 +16,7 @@ export class BuildingTypeOneComponent implements OnInit {
ngOnInit(): void { ngOnInit(): void {
window.setTimeout(()=>{ window.setTimeout(()=>{
this.initCharts() this.initCharts()
},0) },100)
} }
ngOnDestroy(): void { ngOnDestroy(): void {
this.indexBzt.clear() this.indexBzt.clear()
@ -28,11 +28,14 @@ export class BuildingTypeOneComponent implements OnInit {
count=0//总数 count=0//总数
indexData=[]//所有数据 indexData=[]//所有数据
initCharts(){ initCharts(){
this.http.get("/api/StatisticsAnalysis").subscribe((data:any)=>{ this.echartsData.getData(null)
for(var i=0;i<data.companyStatistics.buildingTypeStatistics.buildingTypes.length;i++){ console.log(this.echartsData.allDate)
this.lengthdata.push(data.companyStatistics.buildingTypeStatistics.buildingTypes[i].buildingTypeName) this.http.get("/api/StatisticsAnalysis/BuildingTypes").subscribe((data:any)=>{
this.count=this.count+data.companyStatistics.buildingTypeStatistics.buildingTypes[i].count console.log(data)
this.indexData.push(data.companyStatistics.buildingTypeStatistics.buildingTypes[i]) for(var i=0;i<data.buildingTypeStatistics.buildingTypes.length;i++){
this.lengthdata.push(data.buildingTypeStatistics.buildingTypes[i].buildingTypeName)
this.count=this.count+data.buildingTypeStatistics.buildingTypes[i].count
this.indexData.push(data.buildingTypeStatistics.buildingTypes[i])
} }
//JSON.parse(JSON.stringify(this.indexData).replace(/buildingTypeName/g, 'name')) //JSON.parse(JSON.stringify(this.indexData).replace(/buildingTypeName/g, 'name'))
this.indexData=this.indexData.map(v=>{return {name: v.buildingTypeName,value:v.count,id:v.buildingTypeId}}) this.indexData=this.indexData.map(v=>{return {name: v.buildingTypeName,value:v.count,id:v.buildingTypeId}})

13
src/app/statistic-analysis/echarts-data.service.ts

@ -409,7 +409,7 @@ export class EchartsDataService {
BuildingTypeId:datas.id BuildingTypeId:datas.id
} }
//var res //var res
this.http.get("/api/StatisticsAnalysis/Companies",{params:paramsdata}).subscribe((data:any)=>{ this.http.get("/api/StatisticsAnalysis/BuildingTypes",{params:paramsdata}).subscribe((data:any)=>{
this.tishiData=data this.tishiData=data
console.log(this.tishiData) console.log(this.tishiData)
this.res= '<div class="tishi" style=" backgroundColor:rgba(255,255,255,1);width:100%;height:100%;"><div style="padding:10px 0 5px 0"><span style="color:#FFFFFF;font-size:27px;text-align: center;display:block;">'+datas.name+'</span></div>' this.res= '<div class="tishi" style=" backgroundColor:rgba(255,255,255,1);width:100%;height:100%;"><div style="padding:10px 0 5px 0"><span style="color:#FFFFFF;font-size:27px;text-align: center;display:block;">'+datas.name+'</span></div>'
@ -465,6 +465,17 @@ export class EchartsDataService {
} }
//获取所有数据
allDate=[]
getData(paramsdata){
this.http.get("/api/StatisticsAnalysis",{params:paramsdata}).subscribe((data:any)=>{
this.allDate.push(data)
console.log(this.allDate)
return this.allDate
})
}
} }

16
src/app/ui/collection-tools-building/collection-tools.component.ts

@ -669,7 +669,10 @@ export class CollectionToolsBuildingComponent implements OnInit {
this.isShowProperty = false this.isShowProperty = false
} }
}, this) }, this)
AxMessageSystem.addListener('imageResize', (eventName, args1) => {
this.assetWidth = args1.Width
this.assetHeight = args1.Height
}, this)
if(this.router.url.indexOf("keyUnit/viewunitinfo") != -1){ //查看模式 if(this.router.url.indexOf("keyUnit/viewunitinfo") != -1){ //查看模式
this.isEditPattern = false this.isEditPattern = false
this.isediticon = false this.isediticon = false
@ -1353,7 +1356,6 @@ export class CollectionToolsBuildingComponent implements OnInit {
}); });
this.dataSource.data = treeData this.dataSource.data = treeData
this.treeControl.expandAll() this.treeControl.expandAll()
} }
//点击树节点 //点击树节点
@ -1493,11 +1495,11 @@ export class CollectionToolsBuildingComponent implements OnInit {
let companyBuildingData = JSON.parse(JSON.stringify( this.canvasData.originalcompanyBuildingData || {} )) // 当前 单位/建筑 数据 let companyBuildingData = JSON.parse(JSON.stringify( this.canvasData.originalcompanyBuildingData || {} )) // 当前 单位/建筑 数据
let storeyData = JSON.parse(JSON.stringify( this.canvasData.originaleveryStoreyData || {} )) //当前 楼层 数据 let storeyData = JSON.parse(JSON.stringify( this.canvasData.originaleveryStoreyData || {} )) //当前 楼层 数据
for(let key in companyBuildingData.data){ // for(let key in companyBuildingData.data){
if (companyBuildingData.data[key].FloorId === beforeOneId) { //处理 单位/建筑 数据是否归于当前楼层下 // if (companyBuildingData.data[key].FloorId === beforeOneId) { //处理 单位/建筑 数据是否归于当前楼层下
storeyData.data[key] = companyBuildingData.data[key] // storeyData.data[key] = companyBuildingData.data[key]
} // }
} // }
for(let key in storeyData.data){ //筛选数据 没有匹配全部放入到 其他 数组 for(let key in storeyData.data){ //筛选数据 没有匹配全部放入到 其他 数组
let noMatch = this.allFireElements.find( every=> every.id===storeyData.data[key].FireElementId ) let noMatch = this.allFireElements.find( every=> every.id===storeyData.data[key].FireElementId )
if (!noMatch) { if (!noMatch) {

5
src/app/ui/collection-tools-plan/collection-tools.component.ts

@ -674,7 +674,10 @@ export class CollectionToolsPlanComponent implements OnInit {
this.isShowProperty = false this.isShowProperty = false
} }
}, this) }, this)
AxMessageSystem.addListener('imageResize', (eventName, args1) => {
this.assetWidth = args1.Width
this.assetHeight = args1.Height
}, this)
if(this.router.url.indexOf("keyUnit/viewunitinfo") != -1){ //查看模式 if(this.router.url.indexOf("keyUnit/viewunitinfo") != -1){ //查看模式
this.isEditPattern = false this.isEditPattern = false
this.isediticon = false this.isediticon = false

5
src/app/ui/collection-tools/collection-tools.component.ts

@ -691,7 +691,10 @@ export class CollectionToolsComponent implements OnInit {
this.isShowProperty = false this.isShowProperty = false
} }
}, this) }, this)
AxMessageSystem.addListener('imageResize', (eventName, args1) => {
this.assetWidth = args1.Width
this.assetHeight = args1.Height
}, this)
this.canvasData.gameMode = GameMode.Assignment this.canvasData.gameMode = GameMode.Assignment
if (sessionStorage.getItem('editable') == "0") { //查看模式 if (sessionStorage.getItem('editable') == "0") { //查看模式
this.isEditPattern = false this.isEditPattern = false

480
src/app/working-area/model/axImageShape.ts

@ -5,8 +5,10 @@ import { PaintMode } from './paintModel';
import * as PIXI from 'pixi.js'; import * as PIXI from 'pixi.js';
import { PropertyInfo } from './PropertyInfo'; import { PropertyInfo } from './PropertyInfo';
import { AxShape } from './axShape'; import { AxShape } from './axShape';
import { Sprite } from 'pixi.js'; import { Sprite, Point, Rectangle } from 'pixi.js';
import { AxArrowConnector } from './axArrowConnector'; import { AxArrowConnector } from './axArrowConnector';
import { AxMessageSystem } from './axMessageSystem';
import { EVENT_IMAGE_RESIZE } from './events';
/** /**
* *
@ -31,6 +33,7 @@ export class AxImageShape extends AxShape {
wordWrapWidth: 100, wordWrapWidth: 100,
}); });
text = new PIXI.Text(this.assetData.Name text = new PIXI.Text(this.assetData.Name
+ '\r\n' + '\r\n'
+ this.assetData.PropertyInfos?.find(item => item.PropertyName === '名称/编号')?.PropertyValue, this.style); + this.assetData.PropertyInfos?.find(item => item.PropertyName === '名称/编号')?.PropertyValue, this.style);
@ -48,6 +51,16 @@ export class AxImageShape extends AxShape {
upRight: PIXI.Sprite; upRight: PIXI.Sprite;
downLeft: PIXI.Sprite; downLeft: PIXI.Sprite;
downRight: PIXI.Sprite; downRight: PIXI.Sprite;
upDrag: boolean = false;
downDrag: boolean = false;
leftDrag: boolean = false;
rightDrag: boolean = false;
upLeftDrag: boolean = false;
upRightDrag: boolean = false;
downLeftDrag: boolean = false;
downRightDrag: boolean = false;
constructor(assetData: any, workingArea: WorkingAreaComponent) { constructor(assetData: any, workingArea: WorkingAreaComponent) {
super(assetData, workingArea); super(assetData, workingArea);
this.angle = -this.workingArea.backgroundImage.angle; this.angle = -this.workingArea.backgroundImage.angle;
@ -71,84 +84,353 @@ export class AxImageShape extends AxShape {
this.addChild(this.image); this.addChild(this.image);
this.addChild(this.selectionBox); this.addChild(this.selectionBox);
//// // up
this.up = new PIXI.Sprite(this.pointTexture);
this.up.cursor = 'ns-resize';
this.up.anchor.set(0.5);
this.addChild(this.up);
this.up.interactive = true;
this.up.on('pointerdown', event => {
this.upDrag = true;
this.image.anchor.set(0.5, 1);
this.image.position.set(this.image.position.x, this.image.position.y + (this.image.height / 2));
event.stopPropagation();
});
this.up.on('pointermove', event => {
// 移动时调整形状大小,然后重绘边框
// 检查右下角距离鼠标的位置,
if (this.upDrag) {
var pos = this.toLocal(event.data.global);
var dY = Math.abs(pos.y - this.image.y);
this.assetData.Height = Math.abs(dY);
this.refresh();
AxMessageSystem.send(EVENT_IMAGE_RESIZE, this.assetData);
}
});
this.up.on('pointerup', event => {
if (this.upDrag) {
this.upDrag = false;
this.image.anchor.set(0.5);
this.image.position.set(this.image.position.x, this.image.position.y - (this.image.height / 2));
}
});
this.up.on('pointerupoutside', event => {
if (this.upDrag) {
this.upDrag = false;
this.image.anchor.set(0.5);
this.image.position.set(this.image.position.x, this.image.position.y - (this.image.height / 2));
}
});
this.up.visible = false;
// down
this.down = new PIXI.Sprite(this.pointTexture);
this.down.cursor = 'ns-resize';
this.down.anchor.set(0.5);
this.addChild(this.down);
this.down.interactive = true;
this.down.on('pointerdown', event => {
this.downDrag = true;
this.image.anchor.set(0.5, 0);
this.image.position.set(this.image.position.x, this.image.position.y - (this.image.height / 2));
event.stopPropagation();
});
this.down.on('pointermove', event => {
// 移动时调整形状大小,然后重绘边框
// 检查右下角距离鼠标的位置,
if (this.downDrag) {
var pos = this.toLocal(event.data.global);
var dY = Math.abs(pos.y - this.image.y);
this.assetData.Height = Math.abs(dY);
this.refresh();
AxMessageSystem.send(EVENT_IMAGE_RESIZE, this.assetData);
}
});
this.down.on('pointerup', event => {
if (this.downDrag) {
this.downDrag = false;
this.image.anchor.set(0.5);
this.image.position.set(this.image.position.x, this.image.position.y + (this.image.height / 2));
}
});
this.down.on('pointerupoutside', event => {
if (this.downDrag) {
this.downDrag = false;
this.image.anchor.set(0.5);
this.image.position.set(this.image.position.x, this.image.position.y + (this.image.height / 2));
}
});
this.down.visible = false;
// left
this.left = new PIXI.Sprite(this.pointTexture);
this.left.cursor = 'ew-resize';
this.left.anchor.set(0.5);
this.addChild(this.left);
this.left.interactive = true;
this.left.on('pointerdown', event => {
this.leftDrag = true;
this.image.anchor.set(1, 0.5);
this.image.position.set(this.image.position.x + (this.image.width / 2), this.image.position.y);
event.stopPropagation();
});
this.left.on('pointermove', event => {
// 移动时调整形状大小,然后重绘边框
// 检查右下角距离鼠标的位置,
if (this.leftDrag) {
var pos = this.toLocal(event.data.global);
var dX = Math.abs(pos.x - this.image.x);
this.assetData.Width = Math.abs(dX);
this.refresh();
AxMessageSystem.send(EVENT_IMAGE_RESIZE, this.assetData);
}
});
this.left.on('pointerup', event => {
if (this.leftDrag) {
this.leftDrag = false;
this.image.anchor.set(0.5);
this.image.position.set(this.image.position.x - (this.image.width / 2), this.image.position.y);
}
});
this.left.on('pointerupoutside', event => {
if (this.leftDrag) {
this.leftDrag = false;
this.image.anchor.set(0.5);
this.image.position.set(this.image.position.x - (this.image.width / 2), this.image.position.y);
}
});
this.left.visible = false;
// right
this.right = new PIXI.Sprite(this.pointTexture);
this.right.cursor = 'ew-resize';
this.right.anchor.set(0.5);
this.addChild(this.right);
this.right.interactive = true;
this.right.on('pointerdown', event => {
this.rightDrag = true;
this.image.anchor.set(0, 0.5);
this.image.position.set(this.image.position.x - (this.image.width / 2), this.image.position.y);
event.stopPropagation();
});
this.right.on('pointermove', event => {
// 移动时调整形状大小,然后重绘边框
// 检查右下角距离鼠标的位置,
if (this.rightDrag) {
var pos = this.toLocal(event.data.global);
var dX = Math.abs(pos.x - this.image.x);
this.assetData.Width = Math.abs(dX);
this.refresh();
AxMessageSystem.send(EVENT_IMAGE_RESIZE, this.assetData);
}
});
this.right.on('pointerup', event => {
if (this.rightDrag) {
this.rightDrag = false;
this.image.anchor.set(0.5);
this.image.position.set(this.image.position.x + (this.image.width / 2), this.image.position.y);
}
});
this.right.on('pointerupoutside', event => {
if (this.rightDrag) {
this.rightDrag = false;
this.image.anchor.set(0.5);
this.image.position.set(this.image.position.x + (this.image.width / 2));
}
});
this.right.visible = false;
// up-left // up-left
this.upLeft = new PIXI.Sprite(this.pointTexture); this.upLeft = new PIXI.Sprite(this.pointTexture);
this.upLeft.cursor = 'nwse-resize';
this.upLeft.anchor.set(0.5); this.upLeft.anchor.set(0.5);
this.addChild(this.upLeft); this.addChild(this.upLeft);
this.upLeft.interactive = true; this.upLeft.interactive = true;
this.upLeft.on('pointerdown', event => {
this.upLeftDrag = true;
this.image.anchor.set(1);
this.image.position.set(this.image.position.x + (this.image.width / 2), this.image.position.y + (this.image.height / 2));
event.stopPropagation();
});
this.upLeft.on('pointermove', event => {
// 移动时调整形状大小,然后重绘边框
// 检查右下角距离鼠标的位置,
if (this.upLeftDrag) {
var pos = this.toLocal(event.data.global);
var dX = Math.abs(pos.x - this.image.x);
var dY = Math.abs(pos.y - this.image.y);
var result = dX > dY ? dX : dY;
this.assetData.Width = Math.abs(result);
this.assetData.Height = Math.abs(result);
this.refresh();
AxMessageSystem.send(EVENT_IMAGE_RESIZE, this.assetData);
}
});
this.upLeft.on('pointerup', event => {
if (this.upLeftDrag) {
this.upLeftDrag = false;
this.image.anchor.set(0.5);
this.image.position.set(this.image.position.x - (this.image.width / 2), this.image.position.y - (this.image.height / 2));
}
});
this.upLeft.on('pointerupoutside', event => {
if (this.upLeftDrag) {
this.upLeftDrag = false;
this.image.anchor.set(0.5);
this.image.position.set(this.image.position.x - (this.image.width / 2), this.image.position.y - (this.image.height / 2));
}
});
this.upLeft.visible = false; this.upLeft.visible = false;
// up-right // up-right
this.upRight = new PIXI.Sprite(this.pointTexture); this.upRight = new PIXI.Sprite(this.pointTexture);
this.upRight.cursor = 'nesw-resize';
this.upRight.anchor.set(0.5); this.upRight.anchor.set(0.5);
this.addChild(this.upRight); this.addChild(this.upRight);
this.upRight.interactive = true; this.upRight.interactive = true;
this.upRight.on('pointerdown', event => {
this.upRightDrag = true;
this.image.anchor.set(0, 1);
this.image.position.set(this.image.position.x - (this.image.width / 2), this.image.position.y + (this.image.height / 2));
event.stopPropagation();
});
this.upRight.on('pointermove', event => {
// 移动时调整形状大小,然后重绘边框
// 检查右下角距离鼠标的位置,
if (this.upRightDrag) {
var pos = this.toLocal(event.data.global);
var dX = Math.abs(pos.x - this.image.x);
var dY = Math.abs(pos.y - this.image.y);
var result = dX > dY ? dX : dY;
this.assetData.Width = Math.abs(result);
this.assetData.Height = Math.abs(result);
this.refresh();
AxMessageSystem.send(EVENT_IMAGE_RESIZE, this.assetData);
}
});
this.upRight.on('pointerup', event => {
if (this.upRightDrag) {
this.upRightDrag = false;
this.image.anchor.set(0.5);
this.image.position.set(this.image.position.x + (this.image.width / 2), this.image.position.y - (this.image.height / 2));
}
});
this.upRight.on('pointerupoutside', event => {
if (this.upRightDrag) {
this.upRightDrag = false;
this.image.anchor.set(0.5);
this.image.position.set(this.image.position.x + (this.image.width / 2), this.image.position.y - (this.image.height / 2));
}
});
this.upRight.visible = false; this.upRight.visible = false;
// down-left // down-left
this.downLeft = new PIXI.Sprite(this.pointTexture); this.downLeft = new PIXI.Sprite(this.pointTexture);
this.downLeft.cursor = 'nesw-resize';
this.downLeft.anchor.set(0.5); this.downLeft.anchor.set(0.5);
this.addChild(this.downLeft); this.addChild(this.downLeft);
this.downLeft.interactive = true; this.downLeft.interactive = true;
this.downLeft.on('pointerdown', event => {
this.downLeftDrag = true;
this.image.anchor.set(1, 0);
this.image.position.set(this.image.position.x + (this.image.width / 2), this.image.position.y - (this.image.height / 2));
event.stopPropagation();
});
this.downLeft.on('pointermove', event => {
// 移动时调整形状大小,然后重绘边框
// 检查右下角距离鼠标的位置,
if (this.downLeftDrag) {
var pos = this.toLocal(event.data.global);
var dX = Math.abs(pos.x - this.image.x);
var dY = Math.abs(pos.y - this.image.y);
var result = dX > dY ? dX : dY;
this.assetData.Width = Math.abs(result);
this.assetData.Height = Math.abs(result);
this.refresh();
AxMessageSystem.send(EVENT_IMAGE_RESIZE, this.assetData);
}
});
this.downLeft.on('pointerup', event => {
if (this.downLeftDrag) {
this.downLeftDrag = false;
this.image.anchor.set(0.5);
this.image.position.set(this.image.position.x - (this.image.width / 2), this.image.position.y + (this.image.height / 2));
}
});
this.downLeft.on('pointerupoutside', event => {
if (this.downLeftDrag) {
this.downLeftDrag = false;
this.image.anchor.set(0.5);
this.image.position.set(this.image.position.x - (this.image.width / 2), this.image.position.y + (this.image.height / 2));
}
});
this.downLeft.visible = false; this.downLeft.visible = false;
// down-right // down-right
this.downRight = new PIXI.Sprite(this.pointTexture); this.downRight = new PIXI.Sprite(this.pointTexture);
this.downRight.cursor = 'nwse-resize';
this.downRight.anchor.set(0.5); this.downRight.anchor.set(0.5);
this.addChild(this.downRight); this.addChild(this.downRight);
this.downRight.interactive = true; this.downRight.interactive = true;
this.downRight.on('pointerdown', event => {
this.downRightDrag = true;
this.image.anchor.set(0, 0);
this.image.position.set(this.image.position.x - (this.image.width / 2), this.image.position.y - (this.image.height / 2));
event.stopPropagation();
});
this.downRight.on('pointermove', event => {
// 移动时调整形状大小,然后重绘边框
// 检查右下角距离鼠标的位置,
if (this.downRightDrag) {
var pos = this.toLocal(event.data.global);
var dX = Math.abs(pos.x - this.image.x);
var dY = Math.abs(pos.y - this.image.y);
var result = dX > dY ? dX : dY;
this.assetData.Width = Math.abs(result);
this.assetData.Height = Math.abs(result);
this.refresh();
AxMessageSystem.send(EVENT_IMAGE_RESIZE, this.assetData);
}
});
this.downRight.on('pointerup', event => {
if (this.downRightDrag) {
this.downRightDrag = false;
this.image.anchor.set(0.5);
this.image.position.set(this.image.position.x + (this.image.width / 2), this.image.position.y + (this.image.height / 2));
}
});
this.downRight.on('pointerupoutside', event => {
if (this.downRightDrag) {
this.downRightDrag = false;
this.image.anchor.set(0.5);
this.image.position.set(this.image.position.x + (this.image.width / 2), this.image.position.y + (this.image.height / 2));
}
});
this.downRight.visible = false; this.downRight.visible = false;
//// ////
// if (this.assetData.CanConnect) {
// // connectPoint
// this.connectPoint = new PIXI.Sprite(this.connectPointTexture);
// this.connectPoint.anchor.set(0.5);
// this.connectPoint.x = this.image.x;
// this.connectPoint.y = this.image.y;
// this.addChild(this.connectPoint);
// this.connectPoint.interactive = true;
// this.connectPoint
// .on('pointerdown', event => {
// event.stopPropagation();
// // this.paintingPipeline(this.x, this.y);
// })
// .on('pointerover', event => {
// this.setSelectionBox(true, this.connectPoint);
// })
// .on('pointerout', event => {
// this.setSelectionBox(false);
// });
// // this.showConnectionPoint(false);
// }
this.setItemScale(1 / this.workingArea.backgroundImage.scale.x); this.setItemScale(1 / this.workingArea.backgroundImage.scale.x);
} }
// // 设置选择框
// public setSelectionBox(b: boolean, sprite?: PIXI.Sprite) {
// if (b) {
// this.selectionBox.lineStyle(2, 0x00EB00, 1);
// this.selectionBox.position = sprite.position;
// this.selectionBox.drawRect(- sprite.width / 2, - sprite.height / 2, sprite.width, sprite.height);
// } else {
// this.selectionBox.clear();
// }
// }
// 设置名称 // 设置名称
public setNameVisible(value: boolean, mode: GameMode) { public setNameVisible(value: boolean, mode: GameMode) {
if (this.assetData.GameMode === mode) { if (this.assetData.GameMode === mode) {
this.text.visible = value; this.text.visible = value;
} }
} }
// // 显示连接点
// public showConnectionPoint(b: boolean) {
// this.connectPoint.visible = b;
// }
/** /**
* *
* @param value * @param value
*/ */
public setPointVisiable(value: boolean) { public setPointVisiable(value: boolean) {
const rect = this.getLocalBounds(); const rect = this.getLocalBounds();
this.up.x = rect.right - rect.width / 2;
this.up.y = rect.top;
this.down.x = rect.right - rect.width / 2;
this.down.y = rect.bottom;
this.left.x = rect.left;
this.left.y = rect.bottom - rect.height / 2;
this.right.x = rect.right;
this.right.y = rect.bottom - rect.height / 2;
this.upLeft.x = rect.left; this.upLeft.x = rect.left;
this.upLeft.y = rect.top; this.upLeft.y = rect.top;
this.upRight.x = rect.right; this.upRight.x = rect.right;
@ -157,6 +439,10 @@ export class AxImageShape extends AxShape {
this.downLeft.y = rect.bottom; this.downLeft.y = rect.bottom;
this.downRight.x = rect.right; this.downRight.x = rect.right;
this.downRight.y = rect.bottom; this.downRight.y = rect.bottom;
this.up.visible = value;
this.down.visible = value;
this.left.visible = value;
this.right.visible = value;
this.upLeft.visible = value; this.upLeft.visible = value;
this.upRight.visible = value; this.upRight.visible = value;
this.downLeft.visible = value; this.downLeft.visible = value;
@ -172,6 +458,14 @@ export class AxImageShape extends AxShape {
super.drawBorder(scale); super.drawBorder(scale);
const rect = this.getLocalBounds(); const rect = this.getLocalBounds();
this.up.x = rect.right - rect.width / 2;
this.up.y = rect.top;
this.down.x = rect.right - rect.width / 2;
this.down.y = rect.bottom;
this.left.x = rect.left;
this.left.y = rect.bottom - rect.height / 2;
this.right.x = rect.right;
this.right.y = rect.bottom - rect.height / 2;
this.upLeft.x = rect.left; this.upLeft.x = rect.left;
this.upLeft.y = rect.top; this.upLeft.y = rect.top;
this.upRight.x = rect.right; this.upRight.x = rect.right;
@ -191,81 +485,57 @@ export class AxImageShape extends AxShape {
this.upRight.scale.set(scale); this.upRight.scale.set(scale);
this.downLeft.scale.set(scale); this.downLeft.scale.set(scale);
this.downRight.scale.set(scale); this.downRight.scale.set(scale);
this.up.scale.set(scale);
this.down.scale.set(scale);
this.left.scale.set(scale);
this.right.scale.set(scale);
} }
} }
// paintingPipeline(x: number, y: number) {
// if (this.assetData.CanConnect) {
// if (this.workingArea.getPaintMode() === PaintMode.Pipeline) {
// if (this.workingArea.paintingShape === null) {
// this.workingArea.previewLineSegment.visible = true;
// this.workingArea.currentClickPoint.position =
// new PIXI.Point(this.workingArea.circleShadow.x, this.workingArea.circleShadow.y);
// this.workingArea.paintPoints.push(new PIXI.Point(x, y));
// const json = JSON.parse(JSON.stringify(this.workingArea.canvasData.selectTemplateData.propertyInfos));
// const list = [];
// json.forEach(element => {
// const property = new PropertyInfo(element);
// list.push(property);
// });
// const tempData = {
// TemplateId: this.workingArea.canvasData.selectTemplateData.id,
// CanConnect: this.workingArea.canvasData.selectTemplateData.canConnect,
// Pipelines: new Array(),
// FloorId: this.workingArea.canvasData.selectStorey.id,
// Angle: this.workingArea.canvasData.selectTemplateData.angle,
// Color: this.workingArea.canvasData.selectTemplateData.color,
// Enabled: this.workingArea.canvasData.selectTemplateData.enabled,
// FillMode: this.workingArea.canvasData.selectTemplateData.fillMode,
// FireElementId: this.workingArea.canvasData.selectTemplateData.fireElementId,
// FixedSize: this.workingArea.canvasData.selectTemplateData.fixedSize,
// Height : 32,
// Width : 32,
// Id: ObjectID.default.generate(),
// ImageUrl: this.workingArea.canvasData.selectTemplateData.imageUrl,
// InteractiveMode: this.workingArea.canvasData.selectTemplateData.interactiveMode,
// MultiPoint : JSON.parse(JSON.stringify(this.workingArea.paintPoints)),
// Point: new PIXI.Point(0, 0),
// Name : this.workingArea.canvasData.selectTemplateData.name,
// PropertyInfos: list,
// Border : this.workingArea.canvasData.selectTemplateData.border,
// DrawMode : this.workingArea.canvasData.selectTemplateData.drawMode,
// Thickness : this.workingArea.canvasData.selectTemplateData.thickness,
// IsFromBuilding : this.workingArea.canvasData.selectTemplateData.isFromBuilding,
// GameMode: this.workingArea.canvasData.gameMode,
// LinkedObjects: new Array(this.assetData.Id),
// Tag: this.workingArea.canvasData.selectTemplateData.tag
// };
// this.workingArea.paintingShape = new AxArrowConnector(tempData, this.workingArea, false, true);
// this.assetData.Pipelines.push(this.workingArea.paintingShape.assetData.Id);
// this.workingArea.emit('createIcon', this.workingArea.paintingShape);
// } else {
// this.workingArea.previewLineSegment.visible = false;
// this.workingArea.currentClickPoint.position =
// new PIXI.Point(this.workingArea.circleShadow.x, this.workingArea.circleShadow.y);
// this.workingArea.paintPoints.push(new PIXI.Point(x, y));
// this.workingArea.paintingShape.assetData.MultiPoint =
// JSON.parse(JSON.stringify(this.workingArea.paintPoints));
// this.workingArea.paintingShape.assetData.LinkedObjects.push(this.assetData.Id);
// this.assetData.Pipelines.push(this.workingArea.paintingShape.assetData.Id);
// this.workingArea.paintingShape.redraw();
// this.workingArea.initPipelineData();
// }
// }
// }
// }
// 刷新 // 刷新
public refresh() { public refresh() {
if (this.assetData.CanConnect) {
}
this.image.width = this.assetData.Width; this.image.width = this.assetData.Width;
this.image.height = this.assetData.Height; this.image.height = this.assetData.Height;
this.image.angle = this.assetData.Angle; this.image.angle = this.assetData.Angle;
this.text.text = this.assetData.Name this.text.text = this.assetData.Name
+ '\r\n' + '\r\n'
+ this.assetData.PropertyInfos?.find(item => item.PropertyName === '名称/编号')?.PropertyValue; + this.assetData.PropertyInfos?.find(item => item.PropertyName === '名称/编号')?.PropertyValue;
this.text.x = this.image.x;
this.text.y = this.image.y - this.image.height / 2;
if (this.image.anchor.x == 0) {
if (this.image.anchor.y == 0) {
this.text.x = this.image.x + this.image.width / 2;
this.text.y = this.image.y;
} else if (this.image.anchor.y == 0.5) {
this.text.x = this.image.x + this.image.width / 2;
this.text.y = this.image.y - this.image.height / 2;
} else if (this.image.anchor.y == 1) {
this.text.x = this.image.x + this.image.width / 2;
this.text.y = this.image.y - this.image.height;
}
} else if (this.image.anchor.x == 0.5) {
if (this.image.anchor.y == 0) {
this.text.x = this.image.x;
this.text.y = this.image.y;
} else if (this.image.anchor.y == 0.5) {
} else if (this.image.anchor.y == 1) {
this.text.x = this.image.x;
this.text.y = this.image.y - this.image.height;
}
} else if (this.image.anchor.x == 1) {
if (this.image.anchor.y == 0) {
this.text.x = this.image.x - this.image.width / 2;
this.text.y = this.image.y;
} else if (this.image.anchor.y == 0.5) {
this.text.x = this.image.x - this.image.width / 2;
this.text.y = this.image.y - this.image.height / 2;
} else if (this.image.anchor.y == 1) {
this.text.x = this.image.x - this.image.width / 2;
this.text.y = this.image.y - this.image.height;
}
}
this.angle = -this.workingArea.backgroundImage.angle; this.angle = -this.workingArea.backgroundImage.angle;
this.drawBorder(1 / this.workingArea.backgroundImage.scale.x);
} }
} }

36
src/app/working-area/model/axMessageSystem.ts

@ -5,14 +5,14 @@ export class AxMessageSystem {
/** 监听数组 */ /** 监听数组 */
private static listeners = {}; private static listeners = {};
/** /**
* *
* @param name * @param name
* @param callback * @param callback
* @param context * @param context
*/ */
public static addListener(name: string, callback: () => void, context: any) { public static addListener(name: string, callback: Function, context: any) {
const observers: Observer[] = AxMessageSystem.listeners[name]; let observers: Observer[] = AxMessageSystem.listeners[name];
if (!observers) { if (!observers) {
AxMessageSystem.listeners[name] = []; AxMessageSystem.listeners[name] = [];
} }
@ -25,18 +25,18 @@ export class AxMessageSystem {
* @param callback * @param callback
* @param context * @param context
*/ */
public static removeListener(name: string, callback: () => void, context: any) { public static removeListener(name: string, callback: Function, context: any) {
const observers: Observer[] = AxMessageSystem.listeners[name]; let observers: Observer[] = AxMessageSystem.listeners[name];
if (!observers) { return; } if (!observers) return;
const length = observers.length; let length = observers.length;
for (let i = 0; i < length; i++) { for (let i = 0; i < length; i++) {
const observer = observers[i]; let observer = observers[i];
if (observer.compar(context)) { if (observer.compar(context)) {
observers.splice(i, 1); observers.splice(i, 1);
break; break;
} }
} }
if (observers.length === 0) { if (observers.length == 0) {
delete AxMessageSystem.listeners[name]; delete AxMessageSystem.listeners[name];
} }
} }
@ -46,11 +46,11 @@ export class AxMessageSystem {
* @param name * @param name
*/ */
public static send(name: string, ...args: any[]) { public static send(name: string, ...args: any[]) {
const observers: Observer[] = AxMessageSystem.listeners[name]; let observers: Observer[] = AxMessageSystem.listeners[name];
if (!observers) { return; } if (!observers) return;
const length = observers.length; let length = observers.length;
for (let i = 0; i < length; i++) { for (let i = 0; i < length; i++) {
const observer = observers[i]; let observer = observers[i];
observer.notify(name, ...args); observer.notify(name, ...args);
} }
} }
@ -61,12 +61,12 @@ export class AxMessageSystem {
*/ */
class Observer { class Observer {
/** 回调函数 */ /** 回调函数 */
private callback: () => void; private callback: Function = null;
/** 上下文 */ /** 上下文 */
private context: any = null; private context: any = null;
constructor(callback: () => void, context: any) { constructor(callback: Function, context: any) {
const self = this; let self = this;
self.callback = callback; self.callback = callback;
self.context = context; self.context = context;
} }
@ -76,7 +76,7 @@ class Observer {
* @param args * @param args
*/ */
notify(...args: any[]): void { notify(...args: any[]): void {
const self = this; let self = this;
self.callback.call(self.context, ...args); self.callback.call(self.context, ...args);
} }
@ -85,6 +85,6 @@ class Observer {
* @param context * @param context
*/ */
compar(context: any): boolean { compar(context: any): boolean {
return context === this.context; return context == this.context;
} }
} }

66
src/app/working-area/model/axShape.ts

@ -32,7 +32,7 @@ export class AxShape extends Graphics {
this.workingArea.backgroundImage.addChild(this); this.workingArea.backgroundImage.addChild(this);
this.zIndex = 200; this.zIndex = 200;
this.interactive = true; this.interactive = true;
this.buttonMode = true; // this.buttonMode = true;
this this
.on('pointerdown', event => { .on('pointerdown', event => {
event.stopPropagation(); event.stopPropagation();
@ -88,10 +88,10 @@ export class AxShape extends Graphics {
public hideBorder() { public hideBorder() {
this.border.visible = false; this.border.visible = false;
} }
/** /**
* *
* @param value * @param value
*/ */
public setPointVisiable(value: boolean) { public setPointVisiable(value: boolean) {
} }
@ -112,7 +112,7 @@ export class AxShape extends Graphics {
const spaceLength = scale * 1; const spaceLength = scale * 1;
const lineLenght = rect.width + 0.5 + 0.5; const lineLenght = rect.width + 0.5 + 0.5;
const dashLength = scale * ( lineLenght + spaceLength - Math.floor((rect.width + rect.height) / 2 / 4.1)) / Math.floor((rect.width + rect.height) / 2 / 4.1); const dashLength = scale * (lineLenght + spaceLength - Math.floor((rect.width + rect.height) / 2 / 4.1)) / Math.floor((rect.width + rect.height) / 2 / 4.1);
this.drawDash(this.border, p1.x - 0.5 * scale, p1.y, p2.x + 0.5 * scale, p2.y, dashLength, spaceLength); this.drawDash(this.border, p1.x - 0.5 * scale, p1.y, p2.x + 0.5 * scale, p2.y, dashLength, spaceLength);
this.drawDash(this.border, p2.x, p2.y - 0.5 * scale, p3.x, p3.y + 0.5 * scale, dashLength, spaceLength); this.drawDash(this.border, p2.x, p2.y - 0.5 * scale, p3.x, p3.y + 0.5 * scale, dashLength, spaceLength);
this.drawDash(this.border, p3.x + 0.5 * scale, p3.y, p4.x - 0.5 * scale, p4.y, dashLength, spaceLength); this.drawDash(this.border, p3.x + 0.5 * scale, p3.y, p4.x - 0.5 * scale, p4.y, dashLength, spaceLength);
@ -126,36 +126,36 @@ export class AxShape extends Graphics {
this.border.lineTo(p4.x, p4.y); this.border.lineTo(p4.x, p4.y);
this.border.closePath(); this.border.closePath();
// this.border.endFill(); // this.border.endFill();
} }
// 画虚线 // 画虚线
drawDash(target, x1, y1, x2, y2, dashLength = 5, spaceLength = 1) { drawDash(target, x1, y1, x2, y2, dashLength = 5, spaceLength = 1) {
const x = x2 - x1; const x = x2 - x1;
const y = y2 - y1; const y = y2 - y1;
let hyp = Math.sqrt((x) * (x) + (y) * (y)); let hyp = Math.sqrt((x) * (x) + (y) * (y));
const units = hyp / (dashLength + spaceLength); const units = hyp / (dashLength + spaceLength);
const dashSpaceRatio = dashLength / (dashLength + spaceLength); const dashSpaceRatio = dashLength / (dashLength + spaceLength);
const dashX = (x / units) * dashSpaceRatio; const dashX = (x / units) * dashSpaceRatio;
const spaceX = (x / units) - dashX; const spaceX = (x / units) - dashX;
const dashY = (y / units) * dashSpaceRatio; const dashY = (y / units) * dashSpaceRatio;
const spaceY = (y / units) - dashY; const spaceY = (y / units) - dashY;
target.moveTo(x1, y1); target.moveTo(x1, y1);
while (hyp > 0) { while (hyp > 0) {
x1 += dashX; x1 += dashX;
y1 += dashY; y1 += dashY;
hyp -= dashLength; hyp -= dashLength;
if (hyp < 0) { if (hyp < 0) {
x1 = x2; x1 = x2;
y1 = y2; y1 = y2;
}
target.lineTo(x1, y1);
x1 += spaceX;
y1 += spaceY;
target.moveTo(x1, y1);
hyp -= spaceLength;
} }
target.lineTo(x1, y1); target.moveTo(x2, y2);
x1 += spaceX;
y1 += spaceY;
target.moveTo(x1, y1);
hyp -= spaceLength;
}
target.moveTo(x2, y2);
} }
// 计算多边形重心 // 计算多边形重心
public calculatePolygonGravityCenter(points: PIXI.Point[]) { public calculatePolygonGravityCenter(points: PIXI.Point[]) {

9
src/app/working-area/model/configuration.ts

@ -45,7 +45,7 @@ export const VIEW_RIGHT = 'rightview';
export const VIEW_LEFT = 'leftview'; export const VIEW_LEFT = 'leftview';
export const VIEW_ISOMETRY = 'isometryview'; export const VIEW_ISOMETRY = 'isometryview';
export enum WallTypes{ export enum WallTypes {
STRAIGHT, STRAIGHT,
CURVED CURVED
} }
@ -77,7 +77,8 @@ export var config = {
directionalDrag: true, directionalDrag: true,
boundsX: 500, boundsX: 500,
boundsY: 500, boundsY: 500,
viewBounds: 20000 }; viewBounds: 60000
};
export var wallInformation = { exterior: false, interior: false, midline: true, labels: true, exteriorlabel: 'e:', interiorlabel: 'i:', midlinelabel: 'm:' }; export var wallInformation = { exterior: false, interior: false, midline: true, labels: true, exteriorlabel: 'e:', interiorlabel: 'i:', midlinelabel: 'm:' };
@ -99,7 +100,7 @@ export class Configuration extends EventDispatcher {
static getInstance() { static getInstance() {
if (this.instance === undefined if (this.instance === undefined
|| this.instance === null) { || this.instance === null) {
this.instance = new Configuration(); this.instance = new Configuration();
} }
return this.instance; return this.instance;
@ -115,7 +116,7 @@ export class Configuration extends EventDispatcher {
// this.data[key] = value; // this.data[key] = value;
config[key] = value; config[key] = value;
// if(key !== viewBounds){ // if(key !== viewBounds){
Configuration.getInstance().dispatchEvent({ type: EVENT_CHANGED, item: Configuration.getInstance(), 'key': key, 'value': value }); Configuration.getInstance().dispatchEvent({ type: EVENT_CHANGED, item: Configuration.getInstance(), 'key': key, 'value': value });
// } // }
} }

2
src/app/working-area/model/events.ts

@ -67,3 +67,5 @@ export const EVENT_MODIFY_TEXTURE_ATTRIBUTE = 'MODIFY_TEXTURE_ATTRIBUTE_EVENT';
export const EVENT_PARAMETRIC_GEOMETRY_UPATED = 'PARAMETRIC_GEOMETRY_UPATED_EVENT'; export const EVENT_PARAMETRIC_GEOMETRY_UPATED = 'PARAMETRIC_GEOMETRY_UPATED_EVENT';
export const EVENT_SELECTION_CHANGED = 'selectionChanged'; export const EVENT_SELECTION_CHANGED = 'selectionChanged';
export const EVENT_IMAGE_RESIZE = 'imageResize';

16
src/app/working-area/model/grid2D.ts

@ -33,8 +33,8 @@ export class Grid2D extends Graphics {
let spacing = Dimensioning.cmToPixel(spacingCMS); let spacing = Dimensioning.cmToPixel(spacingCMS);
let totalLines = gridSize / spacing; let totalLines = gridSize / spacing;
let halfSize = gridSize * 0.5; let halfSize = gridSize * 0.5;
let linewidth = Math.max(1.0 / this.gridScale, 1.0) * 1/this.canvas.scale.x;// 增加缩放系数 let linewidth = Math.max(1.0 / this.gridScale, 1.0) * 1 / this.canvas.scale.x;// 增加缩放系数
let highlightLineWidth = Math.max(1 / this.gridScale, 1.0) * 1/this.canvas.scale.x;// 增加缩放系数 let highlightLineWidth = Math.max(1 / this.gridScale, 1.0) * 1 / this.canvas.scale.x;// 增加缩放系数
let normalColor = 0xE0E0E0; let normalColor = 0xE0E0E0;
let highlightColor = 0xD0D0D0; let highlightColor = 0xD0D0D0;
const cellSize = 5; const cellSize = 5;
@ -52,10 +52,10 @@ export class Grid2D extends Graphics {
this.endFill(); this.endFill();
this.beginFill(0xFF0000, 1.0); this.beginFill(0xFF0000, 1.0);
this.drawCircle(-halfSize, -halfSize,5); this.drawCircle(-halfSize, -halfSize, 5);
this.drawCircle(halfSize, -halfSize,5); this.drawCircle(halfSize, -halfSize, 5);
this.drawCircle(halfSize, halfSize,5); this.drawCircle(halfSize, halfSize, 5);
this.drawCircle(-halfSize, halfSize,5); this.drawCircle(-halfSize, halfSize, 5);
this.drawCircle(0, 0, 5); this.drawCircle(0, 0, 5);
this.endFill(); this.endFill();
} }
@ -80,8 +80,8 @@ export class Grid2D extends Graphics {
let spacing = Dimensioning.cmToPixel(spacingCMS); let spacing = Dimensioning.cmToPixel(spacingCMS);
let halfSize = gridSize * 0.5; let halfSize = gridSize * 0.5;
return { return {
x: Math.floor((x - -halfSize) / spacing), x: Math.floor((x - -halfSize) / spacing),
y: Math.floor((y - -halfSize) / spacing), y: Math.floor((y - -halfSize) / spacing),
}; };
} }
} }

21
src/app/working-area/working-area.component.ts

@ -21,7 +21,9 @@ import { AxSelection } from './model/axSelection';
import { AxMessageSystem } from './model/axMessageSystem'; import { AxMessageSystem } from './model/axMessageSystem';
import { Grid2D } from './model/grid2D'; import { Grid2D } from './model/grid2D';
import { Viewport } from 'pixi-viewport'; import { Viewport } from 'pixi-viewport';
import { EVENT_SELECTION_CHANGED } from './model/events'; import { EVENT_IMAGE_RESIZE, EVENT_SELECTION_CHANGED } from './model/events';
import { Dimensioning } from './model/dimensioning';
import { Configuration, viewBounds } from './model/configuration';
@Component({ @Component({
@ -164,8 +166,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
* - * -
* - * -
*/ */
// todo shift绘制垂直线段 public VERSION = '1.4.1.20210303_rc';
public VERSION = '1.3.0.20210220_beta';
/** /**
* *
*/ */
@ -208,7 +209,6 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
this.camera2D.destroy(); this.camera2D.destroy();
this.app.destroy(); this.app.destroy();
} }
public setMulitSelect(b: boolean) { public setMulitSelect(b: boolean) {
if (b) { if (b) {
this.isCtrlKeyClicked = true; this.isCtrlKeyClicked = true;
@ -366,11 +366,12 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
* 2D相机 * 2D相机
*/ */
private createViewport(): void { private createViewport(): void {
var gridSize = Dimensioning.cmToPixel(Configuration.getNumericValue(viewBounds) * 1);
this.camera2D = new Viewport({ this.camera2D = new Viewport({
screenWidth: this.app.view.width, screenWidth: this.app.view.width,
screenHeight: this.app.view.height, screenHeight: this.app.view.height,
worldWidth: 20000, worldWidth: gridSize,
worldHeight: 20000, worldHeight: gridSize,
interaction: this.app.renderer.plugins.interaction, interaction: this.app.renderer.plugins.interaction,
}); });
this.camera2D.pivot.set(0.5); this.camera2D.pivot.set(0.5);
@ -379,10 +380,10 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
this.camera2D this.camera2D
.clamp({ .clamp({
left: -10000, left: -gridSize / 2,
right: 10000, right: gridSize / 2,
top: -10000, top: -gridSize / 2,
bottom: 10000, bottom: gridSize / 2,
}) })
.drag() .drag()
.pinch() .pinch()

BIN
src/assets/images/箭头.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 296 B

BIN
src/assets/images/箭头2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 316 B

BIN
src/assets/images/箭头3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 274 B

Loading…
Cancel
Save