Browse Source

[完善]上传CAD完成, 基本信息完成部分

develop
陈鹏飞 5 years ago
parent
commit
e0ef86425b
  1. 2
      src/app/pages/login/login.component.scss
  2. 2
      src/app/pages/register/register.component.scss
  3. 2
      src/app/ui/basicinfo/addhouseinfo.component.html
  4. 19
      src/app/ui/basicinfo/addhouseinfo.component.ts
  5. 890
      src/app/ui/basicinfo/basicinfo.component.html
  6. 42
      src/app/ui/basicinfo/basicinfo.component.scss
  7. 1234
      src/app/ui/basicinfo/basicinfo.component.ts
  8. 13
      src/app/ui/function-division/function-division.component.ts
  9. 15
      src/app/ui/uploading-cad/editFile.html
  10. 6
      src/app/ui/uploading-cad/uploading-cad.component.html
  11. 8
      src/app/ui/uploading-cad/uploading-cad.component.scss
  12. 90
      src/app/ui/uploading-cad/uploading-cad.component.ts
  13. BIN
      src/assets/images/bg_login.jpg
  14. BIN
      src/assets/images/caiji.jpg
  15. BIN
      src/assets/images/login.gif

2
src/app/pages/login/login.component.scss

@ -1,7 +1,7 @@
.login {
width: 100%;
height: 100%;
background: url('../../../assets/images/bg_login.jpg');
background: url('../../../assets/images/caiji.jpg');
}
.loginBox {
width: 100%;

2
src/app/pages/register/register.component.scss

@ -1,7 +1,7 @@
.login {
width: 100%;
height: 100%;
background: url('../../../assets/images/bg_login.jpg');
background: url('../../../assets/images/caiji.jpg');
}
.loginBox {
width: 100%;

2
src/app/ui/basicinfo/addhouseinfo.component.html

@ -9,7 +9,7 @@
<mat-form-field>
<mat-select required name="unittype" ngModel #unittype="ngModel" placeholder="建筑类型">
<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-form-field>

19
src/app/ui/basicinfo/addhouseinfo.component.ts

@ -24,12 +24,27 @@ import { MatSnackBar } from '@angular/material/snack-bar';
this.getallunittype()
}
getallunittype(){
this.http.get("/api/BuildingTypes").subscribe(data=>{
this.http.get("/api/BuildingTypes/Simple").subscribe(data=>{
this.allunittype = data
})
}
onSubmit(value){
// console.log(value)
this.http.post("/api/CompanyAccount/Buildings",{
id: "",
name: value.name,
order: 0,
enabled: true,
companyId: this.data.unitinfo.id,
buildingTypes: [
{
id: value.unittype,
name: ""
}
]
}).subscribe(data=>{
this.dialogRef.close('ooo');
})
}
}

890
src/app/ui/basicinfo/basicinfo.component.html

@ -7,15 +7,15 @@
<mat-form-field>
<input matInput id="creditcode" name="creditcode" type='text'
required minlength="1" maxlength="18"
ngModel #creditcode="ngModel"
[(ngModel)]="unitinfo.usci"
(focus)="closeorganizationbox()">
</mat-form-field>
</div>
<div class="inputbox">
<span>单位类型:</span>
<mat-form-field (click)="closeorganizationbox()">
<mat-select required name="unittype" ngModel #unittype="ngModel">
<mat-option value="item.id" *ngFor="let item of allunittype" (click)="selectunittype(item)">{{item.name}}</mat-option>
<mat-select required name="unittype" [(ngModel)]="defaultbuildingTypes">
<mat-option [value]="item.id" *ngFor="let item of allunittype">{{item.name}}</mat-option>
</mat-select>
</mat-form-field>
</div>
@ -25,7 +25,7 @@
<mat-form-field>
<input matInput id="linkman" name="linkman" type='text'
required minlength="1"
ngModel #linkman="ngModel"
[(ngModel)]="unitinfo.contacts"
(focus)="closeorganizationbox()">
</mat-form-field>
</div>
@ -34,7 +34,7 @@
<mat-form-field>
<input matInput id="linkphone" name="linkphone" type='text'
required minlength="1"
ngModel #linkphone="ngModel"
[(ngModel)]="unitinfo.phone"
(focus)="closeorganizationbox()">
</mat-form-field>
</div>
@ -70,7 +70,7 @@
<mat-form-field>
<input matInput id="unitaddress" name="unitaddress" type='text'
required minlength="1"
ngModel #unitaddress="ngModel"
[(ngModel)]="unitinfo.address"
(focus)="closeorganizationbox()">
</mat-form-field>
</div>
@ -80,8 +80,9 @@
<div class="uploadingimg">
<img [src]="imgsrc" alt="" style="width: 299px; height: 170px;" >
</div>
<mat-spinner *ngIf="isspinner"></mat-spinner>
<!-- <mat-progress-bar mode="determinate" [value]="p" *ngIf="p == 0 || p ==100"></mat-progress-bar> -->
<mat-spinner *ngIf="isspinner" diameter= 50></mat-spinner>
</div>
<div class="image" (click)="closeorganizationbox()">
@ -109,18 +110,16 @@
</div> -->
<div class="houseinfobox">
<button mat-icon-button (click)="addhouseinfo()" class="addhouseinfo"><mat-icon style="font-size: 38px;">add_circle_outline</mat-icon></button>
<mat-tab-group >
<mat-tab [label]="item.name" *ngFor="let item of houses" (click)="selecttab(item)">
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm" class="example-container">
<!-- 高层建筑 -->
<div class="highinfo" *ngIf="item.gaoceng">
<h1 class="infotitle">高层信息</h1>
<button type="button" mat-icon-button (click)="addhouseinfo()" class="addhouseinfo"><mat-icon style="font-size: 38px;">add_circle_outline</mat-icon></button>
<mat-tab-group (focusChange)="selecttab($event)">
<mat-tab [label]="item.name" *ngFor="let item of houses;let key = index">
<form (ngSubmit)="onSubmit2(form.value,item,key)" #form="ngForm" class="example-container">
<div class="highinfo" *ngIf="item.tongyong">
<div class="houseinfoinput" >
<span>建筑名称:</span>
<mat-form-field>
<input matInput id="housename" name="housename" type='text'
required minlength="1" [(ngModel)]="item.name"
minlength="1" [(ngModel)]="item.name"
>
</mat-form-field>
<span style="color: red;">*</span>
@ -128,556 +127,359 @@
<div class="houseinfoinput">
<span>建筑类型:</span>
<mat-form-field>
<mat-select required name="unittype" ngModel #unittype="ngModel">
<mat-option value="item.id" *ngFor="let item of allunittype">{{item.name}}</mat-option>
<mat-select name="unittype" [(ngModel)]="item.buildtype">
<mat-option [value]="item.name" *ngFor="let item of allunittype" (click)="templatebuildtype(item)">{{item.name}}</mat-option>
</mat-select>
</mat-form-field>
<span style="color: red;">*</span>
</div>
<div class="houseinfoinput">
<span>占地面积(m²):</span>
<mat-form-field>
<input matInput id="floorspace" name="floorspace" type='text'
required minlength="1"
ngModel #floorspace="ngModel">
</mat-form-field>
<span style="color: red;">*</span>
</div>
<div class="houseinfoinput">
<span>建筑面积(m²):</span>
<mat-form-field>
<input matInput id="areaofstructure" name="areaofstructure" type='text'
required minlength="1"
ngModel #areaofstructure="ngModel">
</mat-form-field>
<span style="color: red;">*</span>
</div>
<div class="houseinfoinput">
<span>标准层面积(m²):</span>
<mat-form-field>
<input matInput id="standardspace" name="standardspace" type='text'
required minlength="1"
ngModel #standardspace="ngModel">
</mat-form-field>
<span style="color: red;">*</span>
</div>
<div class="houseinfoinput">
<span>最大防火分区面积(m²):</span>
<mat-form-field>
<input matInput id="firearea" name="firearea" type='text'
required minlength="1"
ngModel #firearea="ngModel">
</mat-form-field>
<span style="color: red;">*</span>
</div>
<div class="houseinfoinput">
<span>建筑高度(地上)(m):</span>
<mat-form-field>
<input matInput id="househeightup" name="househeightup" type='text'
required minlength="1"
ngModel #househeightup="ngModel">
</mat-form-field>
<span style="color: red;">*</span>
</div>
<div class="houseinfoinput">
<span>建筑高度(地下)(m):</span>
<mat-form-field>
<input matInput id="househeightdown" name="househeightdown" type='text'
required minlength="1"
ngModel #househeightdown="ngModel">
</mat-form-field>
<span style="color: red;">*</span>
</div>
<div class="houseinfoinput">
<span>层数(地上)(层):</span>
<mat-form-field>
<input matInput id="numberofpliesup" name="numberofpliesup" type='text'
required minlength="1"
ngModel #numberofpliesup="ngModel">
</mat-form-field>
<span style="color: red;">*</span>
</div>
<div class="houseinfoinput">
<span>层数(地下)(层):</span>
<mat-form-field>
<input matInput id="numberofpliesdown" name="numberofpliesdown" type='text'
required minlength="1"
ngModel #numberofpliesdown="ngModel">
</mat-form-field>
<span style="color: red;">*</span>
</div>
<div class="houseinfoinput">
<span>建筑长度(m):</span>
<mat-form-field>
<input matInput id="houselong" name="houselong" type='text'
minlength="1"
ngModel #houselong="ngModel">
</mat-form-field>
</div>
<div class="houseinfoinput">
<span>建筑宽度(m):</span>
<mat-form-field>
<input matInput id="housewide" name="housewide" type='text'
minlength="1"
ngModel #housewide="ngModel">
</mat-form-field>
</div>
<div class="houseinfoinput">
<span>裙房层数(层):</span>
<mat-form-field>
<input matInput id="podium" name="podium" type='text'
minlength="1"
ngModel #podium="ngModel">
</mat-form-field>
</div>
<div class="houseinfoinput">
<span>耐火等级(级):</span>
<mat-form-field>
<input matInput id="fireresistancerating" name="fireresistancerating" type='text'
required minlength="1"
ngModel #fireresistancerating="ngModel">
</mat-form-field>
<span style="color: red;">*</span>
</div>
<div class="houseinfoinput">
<span>建筑外壳:</span>
<mat-form-field>
<input matInput id="buildingshell" name="buildingshell" type='text'
minlength="1"
ngModel #buildingshell="ngModel">
</mat-form-field>
</div>
<div class="houseinfoinput">
<span>建筑结构:</span>
<h1 style="font-size: 26px;">{{item.buildingBasicGroups[0].name}}</h1>
<div class="houseinfoinput" *ngFor="let i of item.buildingBasicGroups[0].propertyInfos;let key = index">
<span>{{i.propertyName}}:</span>
<mat-form-field>
<input matInput id="buildingstructure" name="buildingstructure" type='text'
minlength="1"
ngModel #buildingstructure="ngModel">
<input matInput id="floorspace" name="{{i.propertyName}}" type='text'
required="{{ i.required==true ? 'true' : 'false' }}"
[(ngModel)]="i.propertyValue">
</mat-form-field>
</div>
<div class="houseinfoinput">
<span>最高人流量(人次):</span>
<mat-form-field>
<input matInput id="peoplenumber" name="peoplenumber" type='text'
minlength="1"
ngModel #peoplenumber="ngModel">
</mat-form-field>
</div>
<div class="houseinfoinput">
<span>内部员工人数(个):</span>
<mat-form-field>
<input matInput id="employeesnumber" name="employeesnumber" type='text'
minlength="1"
ngModel #employeesnumber="ngModel">
</mat-form-field>
</div>
<div class="houseinfoinput">
<span>使用性质:</span>
<mat-form-field>
<input matInput id="function" name="function" type='text'
required minlength="1"
ngModel #function="ngModel">
</mat-form-field>
<span style="color: red;">*</span>
<span style="color: red;" *ngIf="i.required">*</span>
</div>
</div>
<!-- 隧道 -->
<div class="highinfo" *ngIf="item.huo">
<h1 class="infotitle">隧道信息</h1>
<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 #unittype="ngModel">
<mat-option value="item.id" *ngFor="let item of allunittype">{{item.name}}</mat-option>
</mat-select>
</mat-form-field>
<span style="color: red;">*</span>
</div>
<div class="houseinfoinput">
<span>隧道形式:</span>
<mat-form-field>
<input matInput id="tunneltype" name="tunneltype" type='text'
required minlength="1"
ngModel #tunneltype="ngModel">
</mat-form-field>
<span style="color: red;">*</span>
</div>
<div class="houseinfoinput">
<span>隧道距离:</span>
<mat-form-field>
<input matInput id="tunneldistance" name="tunneldistance" type='text'
required minlength="1"
ngModel #tunneldistance="ngModel">
</mat-form-field>
<span style="color: red;">*</span>
</div>
<div class="houseinfoinput">
<span>隧道走向:</span>
<mat-form-field>
<input matInput id="tunnelgoto" name="tunnelgoto" type='text'
required minlength="1"
ngModel #tunnelgoto="ngModel">
</mat-form-field>
<span style="color: red;">*</span>
</div>
<div class="houseinfoinput">
<span>隧道长度(m):</span>
<mat-form-field>
<input matInput id="tunnellong" name="tunnellong" type='text'
required minlength="1"
ngModel #tunnellong="ngModel">
</mat-form-field>
<span style="color: red;">*</span>
</div>
<div class="houseinfoinput">
<span>隧道出口位置:</span>
<mat-form-field>
<input matInput id="tunnelexit" name="tunnelexit" type='text'
required minlength="1"
ngModel #tunnelexit="ngModel">
</mat-form-field>
<span style="color: red;">*</span>
</div>
<div class="houseinfoinput">
<span>隧道平均海拔:</span>
<mat-form-field>
<input matInput id="tunnelelevation" name="tunnelelevation" type='text'
minlength="1"
ngModel #tunnelelevation="ngModel">
</mat-form-field>
</div>
<div class="houseinfoinput">
<span>隧道走势:</span>
<mat-form-field>
<input matInput id="tunneltrend" name="tunneltrend" type='text'
minlength="1"
ngModel #tunneltrend="ngModel">
</mat-form-field>
</div>
<div class="houseinfoinput">
<span>隧道极端最高温度(℃):</span>
<mat-form-field>
<input matInput id="tunnelmaxT" name="tunnelmaxT" type='text'
required minlength="1"
ngModel #tunnelmaxT="ngModel">
</mat-form-field>
<span style="color: red;">*</span>
</div>
<div class="houseinfoinput">
<span>隧道极端最低温度(℃):</span>
<mat-form-field>
<input matInput id="tunnelminT" name="tunnelminT" type='text'
required minlength="1"
ngModel #tunnelminT="ngModel">
</mat-form-field>
<span style="color: red;">*</span>
</div>
<div class="houseinfoinput">
<span>隧道平均温度(℃):</span>
<mat-form-field>
<input matInput id="tunnelaverT" name="tunnelaverT" type='text'
required minlength="1"
ngModel #tunnelaverT="ngModel">
</mat-form-field>
<span style="color: red;">*</span>
</div>
<div class="houseinfoinput">
<span>主导风向:</span>
<mat-form-field>
<input matInput id="mainwind" name="mainwind" type='text'
required minlength="1"
ngModel #mainwind="ngModel">
</mat-form-field>
<span style="color: red;">*</span>
</div>
<div class="houseinfoinput">
<span>隧道净高(m):</span>
<mat-form-field>
<input matInput id="tunnelheight" name="tunnelheight" type='text'
required minlength="1"
ngModel #tunnelheight="ngModel">
</mat-form-field>
<span style="color: red;">*</span>
</div>
<div class="houseinfoinput">
<span>隧道净宽(m):</span>
<mat-form-field>
<input matInput id="tunnelweight" name="tunnelweight" type='text'
required minlength="1"
ngModel #tunnelweight="ngModel">
</mat-form-field>
<span style="color: red;">*</span>
</div>
<div class="houseinfoinput">
<span>行车道宽度(m):</span>
<mat-form-field>
<input matInput id="roadweight" name="roadweight" type='text'
required minlength="1"
ngModel #roadweight="ngModel">
</mat-form-field>
<span style="color: red;">*</span>
</div>
<div class="houseinfoinput">
<span>路缘带宽度(m):</span>
<mat-form-field>
<input matInput id="sidestrip" name="sidestrip" type='text'
required minlength="1"
ngModel #sidestrip="ngModel">
</mat-form-field>
<span style="color: red;">*</span>
</div>
<div class="houseinfoinput">
<span>路面余宽(m):</span>
<mat-form-field>
<input matInput id="roadmorewide" name="roadmorewide" type='text'
minlength="1"
ngModel #roadmorewide="ngModel">
</mat-form-field>
</div>
<div class="houseinfoinput">
<span>检修道宽度(m):</span>
<mat-form-field>
<input matInput id="maintainingroadway" name="maintainingroadway" type='text'
minlength="1"
ngModel #maintainingroadway="ngModel">
</mat-form-field>
</div>
<div class="houseinfoinput">
<span>紧急停车带有效长度(m):</span>
<mat-form-field>
<input matInput id="emergencystopareaL" name="emergencystopareaL" type='text'
minlength="1"
ngModel #emergencystopareaL="ngModel">
</mat-form-field>
</div>
<div class="houseinfoinput">
<span>紧急停车带有效宽度(m):</span>
<mat-form-field>
<input matInput id="emergencystopareaW " name="emergencystopareaW" type='text'
minlength="1"
ngModel #emergencystopareaW="ngModel">
</mat-form-field>
</div>
<div class="houseinfoinput">
<span>紧急停车带间距(m):</span>
<mat-form-field>
<input matInput id="emergencystopareaS" name="emergencystopareaS" type='text'
minlength="1"
ngModel #emergencystopareaS="ngModel">
</mat-form-field>
</div>
<div class="houseinfoinput">
<span>车行横洞净宽(m):</span>
<mat-form-field>
<input matInput id="thecarcrossholeW" name="thecarcrossholeW" type='text'
minlength="1"
ngModel #thecarcrossholeW="ngModel">
</mat-form-field>
</div>
<div class="houseinfoinput">
<span>车行横洞净高(m):</span>
<mat-form-field>
<input matInput id="thecarcrossholeH" name="thecarcrossholeH" type='text'
minlength="1"
ngModel #thecarcrossholeH="ngModel">
</mat-form-field>
</div>
<div class="houseinfoinput">
<span>车行横洞与隧道中线夹角:</span>
<mat-form-field>
<input matInput id="thecarcrossholeA" name="thecarcrossholeA" type='text'
minlength="1"
ngModel #thecarcrossholeA="ngModel">
</mat-form-field>
</div>
<div class="houseinfoinput">
<span>车行横洞间距(m):</span>
<mat-form-field>
<input matInput id="thecarcrossholeS" name="thecarcrossholeS" type='text'
minlength="1"
ngModel #thecarcrossholeS="ngModel">
</mat-form-field>
</div>
<div class="houseinfoinput">
<span>人行横道净宽(m):</span>
<mat-form-field>
<input matInput id="pedestriancrossingW" name="pedestriancrossingW" type='text'
minlength="1"
ngModel #pedestriancrossingW="ngModel">
<!-- 石油化工 -->
<div class="highinfo" *ngIf="item.isshiyou;let bigkey = index">
<h1 style="font-size: 26px;">{{item.buildingBasicGroups[0].name}}</h1>
<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]="item.name" *ngFor="let item of allunittype">{{item.name}}</mat-option>
</mat-select>
</mat-form-field>
<span style="color: red;">*</span>
</div>
</mat-form-field>
<div class="houseinfoinput" *ngFor="let i of item.buildingBasicGroups[0].propertyInfos;let smkey = index">
<span>{{i.propertyName}}:</span>
<mat-form-field>
<input matInput id="floorspace" name="{{i.propertyName}}" type='text'
required="{{ i.required==true ? 'true' : 'false' }}"
[(ngModel)]="i.propertyValue">
</mat-form-field>
<span style="color: red;" *ngIf="i.required">*</span>
</div>
</div>
<div class="houseinfoinput">
<span>人行横道净高(m):</span>
<mat-form-field>
<input matInput id="pedestriancrossingH" name="pedestriancrossingH" type='text'
minlength="1"
ngModel #pedestriancrossingH="ngModel">
</mat-form-field>
<h1 style="font-size: 26px;">{{item.buildingBasicGroups[1].name}}</h1>
<div class="deviceinfo">
<table mat-table [dataSource]="devicedataSourcebox[item.buildingId]" class="mat-elevation-z8">
<ng-container matColumnDef="name">
<th mat-header-cell *matHeaderCellDef>
<button type="button" mat-icon-button class="adddeviceinfo" (click)="adddeviceinfo(item)"><mat-icon>add_circle_outline</mat-icon></button>
装置区名称</th>
<td mat-cell *matCellDef="let element;let key = index">
<mat-form-field>
<input matInput id="floorspace" name="{{key}}1" type='text'
minlength="1"
[(ngModel)]="element.name">
</mat-form-field>
</td>
</ng-container>
<ng-container matColumnDef="flow">
<th mat-header-cell *matHeaderCellDef>工艺流程</th>
<td mat-cell *matCellDef="let element;let key = index">
<mat-form-field>
<input matInput id="floorspace" name="{{key}}2" type='text'
minlength="1"
[(ngModel)]="element.flow">
</mat-form-field>
</td>
</ng-container>
<ng-container matColumnDef="danger">
<th mat-header-cell *matHeaderCellDef>火灾危险性</th>
<td mat-cell *matCellDef="let element;let key = index">
<mat-form-field>
<input matInput id="floorspace" name="{{key}}3" type='text'
minlength="1"
[(ngModel)]="element.danger">
</mat-form-field>
</td>
</ng-container>
<ng-container matColumnDef="payattentionto">
<th mat-header-cell *matHeaderCellDef>灭火注意事项</th>
<td mat-cell *matCellDef="let element;let key = index">
<mat-form-field>
<input matInput id="floorspace" name="{{key}}4" type='text'
minlength="1"
[(ngModel)]="element.payattentionto">
</mat-form-field>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
</div>
<div class="houseinfoinput">
<span>人行横道间距(m):</span>
<mat-form-field>
<input matInput id="pedestriancrossingS" name="pedestriancrossingS" type='text'
minlength="1"
ngModel #pedestriancrossingS="ngModel">
</mat-form-field>
</div>
<div class="houseinfoinput">
<span>备注:</span>
<mat-form-field>
<input matInput id="remark" name="remark" type='text'
minlength="1"
ngModel #remark="ngModel">
</mat-form-field>
</div>
</div>
<!-- 石油化工 -->
<div class="highinfo" *ngIf="item.lei">
<h1 class="infotitle">石油化工</h1>
<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 #unittype="ngModel">
<mat-option value="item.id" *ngFor="let item of allunittype">{{item.name}}</mat-option>
</mat-select>
</mat-form-field>
<span style="color: red;">*</span>
</div>
<div class="houseinfoinput">
<span>总占地面积(m²):</span>
<mat-form-field>
<input matInput id="floorspace" name="floorspace" type='text'
required minlength="1"
ngModel #floorspace="ngModel">
</mat-form-field>
<span style="color: red;">*</span>
</div>
<div class="houseinfoinput">
<span>生产装置区(m²):</span>
<mat-form-field>
<input matInput id="processunits" name="processunits" type='text'
minlength="1"
ngModel #processunits="ngModel">
</mat-form-field>
</div>
<div class="houseinfoinput">
<span>储运区(m²):</span>
<mat-form-field>
<input matInput id="storagearea" name="storagearea" type='text'
minlength="1"
ngModel #storagearea="ngModel">
</mat-form-field>
</div>
<div class="houseinfoinput">
<span>总建筑面积(m²):</span>
<mat-form-field>
<input matInput id="overallfloorage" name="overallfloorage" type='text'
required minlength="1"
ngModel #overallfloorage="ngModel">
</mat-form-field>
<span style="color: red;">*</span>
</div>
<div class="houseinfoinput">
<span>固定资产(万元):</span>
<mat-form-field>
<input matInput id="fixedassets" name="fixedassets" type='text'
required minlength="1"
ngModel #fixedassets="ngModel">
</mat-form-field>
<span style="color: red;">*</span>
</div>
<div class="houseinfoinput">
<span>年产值(万元):</span>
<mat-form-field>
<input matInput id="annualvalueofprod" name="annualvalueofprod" type='text'
minlength="1"
ngModel #annualvalueofprod="ngModel">
</mat-form-field>
</div>
<div class="houseinfoinput">
<span>年加工能力(万吨):</span>
<mat-form-field>
<input matInput id="workingability" name="workingability" type='text'
minlength="1"
ngModel #workingability="ngModel">
</mat-form-field>
</div>
<div class="houseinfoinput">
<span>装置数量(套):</span>
<mat-form-field>
<input matInput id="devicenum" name="devicenum" type='text'
required minlength="1"
ngModel #devicenum="ngModel">
</mat-form-field>
<span style="color: red;">*</span>
</div>
<div class="houseinfoinput">
<span>最大储量(m²):</span>
<mat-form-field>
<input matInput id="largreserves" name="largreserves" type='text'
minlength="1"
ngModel #largreserves="ngModel">
</mat-form-field>
</div>
<div class="houseinfoinput">
<span>储罐总数(个):</span>
<mat-form-field>
<input matInput id="storagenum" name="storagenum" type='text'
minlength="1"
ngModel #storagenum="ngModel">
</mat-form-field>
</div>
<div class="houseinfoinput">
<span>最大储罐(m²):</span>
<mat-form-field>
<input matInput id="maxstorage" name="maxstorage" type='text'
minlength="1"
ngModel #maxstorage="ngModel">
</mat-form-field>
</div>
<div class="houseinfoinput">
<span>道路宽度(m):</span>
<mat-form-field>
<input matInput id="loadW" name="loadW" type='text'
required minlength="1"
ngModel #loadW="ngModel">
</mat-form-field>
<span style="color: red;">*</span>
<button type="button" mat-raised-button (click)="addtankbox(item,bigkey)" style="margin-top: 30px;">添加储罐</button>
<div class="tankinfo" *ngFor="let x of bigfor;let www = index">
<p>{{x[0].name}}</p>
<!-- <p>储罐信息</p> -->
<div class="basicinfobox">
<div class="houseinfoinput" *ngFor="let i of x[0].propertyInfos;let key = index">
<span>{{i.propertyName}}:</span>
<mat-form-field>
<input matInput id="floorspace" name="{{www+2}}-tanker-{{key}}" type='text'
required="{{ i.required==true ? 'true' : 'false' }}"
[(ngModel)]="i.propertyValue"
>
</mat-form-field>
<span style="color: red;" *ngIf="i.required">*</span>
</div>
</div>
<p>{{x[1].name}}</p>
<!-- <p>储罐信息/罐区情况</p> -->
<!-- <div class="tankdetailinfo">
<table mat-table [dataSource]="dataSourceArr[www]" class="mat-elevation-z8" >
<ng-container matColumnDef="tank" >
<th mat-header-cell *matHeaderCellDef>
<button type="button" mat-icon-button class="adddeviceinfo" (click)="adddeviceinfo2(www)"><mat-icon>add_circle_outline</mat-icon></button>
罐区</th>
<td mat-cell *matCellDef="let element;let key = index">
<mat-form-field>
<input matInput id="floorspace" name="{{element.tank}}tank{{key}}" type='text'
required
[(ngModel)]="element.tank">
</mat-form-field>
</td>
</ng-container>
<ng-container matColumnDef="tankid">
<th mat-header-cell *matHeaderCellDef>罐区编号</th>
<td mat-cell *matCellDef="let element;let key = index">
<mat-form-field>
<input matInput id="floorspace" name="{{element.tankid}}tank{{key}}" type='text'
required
[(ngModel)]="element.tankid">
</mat-form-field>
</td>
</ng-container>
<ng-container matColumnDef="tankmedium">
<th mat-header-cell *matHeaderCellDef>储存介质</th>
<td mat-cell *matCellDef="let element;let key = index">
<mat-form-field>
<input matInput id="floorspace" name="{{element.tankmedium}}tank{{key}}" type='text'
required
[(ngModel)]="element.tankmedium">
</mat-form-field>
</td>
</ng-container>
<ng-container matColumnDef="tanktype">
<th mat-header-cell *matHeaderCellDef>储罐类型</th>
<td mat-cell *matCellDef="let element;let key = index">
<mat-form-field>
<input matInput id="floorspace" name="{{element.tanktype}}tank{{key}}" type='text'
required
[(ngModel)]="element.tanktype">
</mat-form-field>
</td>
</ng-container>
<ng-container matColumnDef="tankcapacity">
<th mat-header-cell *matHeaderCellDef>容量</th>
<td mat-cell *matCellDef="let element;let key = index">
<mat-form-field>
<input matInput id="floorspace" name="{{element.tankcapacity}}tank{{key}}" type='text'
required
[(ngModel)]="element.tankcapacity">
</mat-form-field>
</td>
</ng-container>
<ng-container matColumnDef="tankdiameter">
<th mat-header-cell *matHeaderCellDef>直径</th>
<td mat-cell *matCellDef="let element;let key = index">
<mat-form-field>
<input matInput id="floorspace" name="{{element.tankdiameter}}tank{{key}}" type='text'
required
[(ngModel)]="element.tankdiameter">
</mat-form-field>
</td>
</ng-container>
<ng-container matColumnDef="tankheight">
<th mat-header-cell *matHeaderCellDef>高度</th>
<td mat-cell *matCellDef="let element;let key = index">
<mat-form-field>
<input matInput id="floorspace" name="{{element.tankheight}}tank{{key}}" type='text'
required
[(ngModel)]="element.tankheight">
</mat-form-field>
</td>
</ng-container>
<ng-container matColumnDef="tanktectum">
<th mat-header-cell *matHeaderCellDef>顶盖形式</th>
<td mat-cell *matCellDef="let element;let key = index">
<mat-form-field>
<input matInput id="floorspace" name="{{element.tanktectum}}tank{{key}}" type='text'
[(ngModel)]="element.tanktectum">
</mat-form-field>
</td>
</ng-container>
<ng-container matColumnDef="tanktexture">
<th mat-header-cell *matHeaderCellDef>浮盘材质</th>
<td mat-cell *matCellDef="let element;let key = index">
<mat-form-field>
<input matInput id="floorspace" name="{{element.tanktexture}}tank{{key}}" type='text'
[(ngModel)]="element.tanktexture">
</mat-form-field>
</td>
</ng-container>
<ng-container matColumnDef="platetype">
<th mat-header-cell *matHeaderCellDef>浮盘类型</th>
<td mat-cell *matCellDef="let element;let key = index">
<mat-form-field>
<input matInput id="floorspace" name="{{element.platetype}}tank{{key}}" type='text'
[(ngModel)]="element.platetype">
</mat-form-field>
</td>
</ng-container>
<ng-container matColumnDef="foamgeneratorid">
<th mat-header-cell *matHeaderCellDef>泡沫产生器型号</th>
<td mat-cell *matCellDef="let element;let key = index">
<mat-form-field>
<input matInput id="floorspace" name="{{element.foamgeneratorid}}tank{{key}}" type='text'
[(ngModel)]="element.foamgeneratorid">
</mat-form-field>
</td>
</ng-container>
<ng-container matColumnDef="foamgeneratortype">
<th mat-header-cell *matHeaderCellDef>泡沫产生器形式</th>
<td mat-cell *matCellDef="let element;let key = index">
<mat-form-field>
<input matInput id="floorspace" name="{{element.foamgeneratortype}}tank{{key}}" type='text'
[(ngModel)]="element.foamgeneratortype">
</mat-form-field>
</td>
</ng-container>
<ng-container matColumnDef="isprotect">
<th mat-header-cell *matHeaderCellDef>是否设置氮封惰化保护装置</th>
<td mat-cell *matCellDef="let element;let key = index">
<mat-form-field>
<input matInput id="floorspace" name="{{element.isprotect}}tank{{key}}" type='text'
[(ngModel)]="element.isprotect">
</mat-form-field>
</td>
</ng-container>
<ng-container matColumnDef="fendinggroyneheight">
<th mat-header-cell *matHeaderCellDef>防护堤高度</th>
<td mat-cell *matCellDef="let element;let key = index">
<mat-form-field>
<input matInput id="floorspace" name="{{element.fendinggroyneheight}}tank{{key}}" type='text'
required
[(ngModel)]="element.fendinggroyneheight">
</mat-form-field>
</td>
</ng-container>
<ng-container matColumnDef="portnum">
<th mat-header-cell *matHeaderCellDef>半固定泡沫灭火接口数量</th>
<td mat-cell *matCellDef="let element;let key = index">
<mat-form-field>
<input matInput id="floorspace" name="{{element.portnum}}tank{{key}}" type='text'
required
[(ngModel)]="element.portnum">
</mat-form-field>
</td>
</ng-container>
<ng-container matColumnDef="else">
<th mat-header-cell *matHeaderCellDef>其他设施</th>
<td mat-cell *matCellDef="let element;let key = index">
<mat-form-field>
<input matInput id="floorspace" name="{{element.else}}tank{{key}}" type='text'
required
[(ngModel)]="element.else">
</mat-form-field>
</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="highinfo" *ngIf="item.ditie">
<h1 class="infotitle">地铁信息</h1>
<p>基本信息</p>
<div class="subwayinfo">
<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]="item.name" *ngFor="let item of allunittype">{{item.name}}</mat-option>
</mat-select>
</mat-form-field>
<span style="color: red;">*</span>
</div>
<div class="houseinfoinput" *ngFor="let i of item.buildingBasicGroups[0].propertyInfos;let key = index">
<span>{{i.propertyName}}:</span>
<mat-form-field>
<input matInput id="tunneltype" name="{{key}}" type='text'
required="{{ i.required==true ? 'true' : 'false' }}"
[(ngModel)]="i.propertyValue">
</mat-form-field>
<span style="color: red;" *ngIf="i.required">*</span>
</div>
</div>
<p>基本信息/路线信息</p>
<!-- <button type="button" mat-raised-button (click)="addloadgroup()">增加线路分组</button> -->
<div class="roadinfo" *ngFor="let g of ggg">
<div class="houseinfoinput" *ngFor="let i of item.buildingBasicGroups[1].propertyInfos;let key = index">
<span>{{i.propertyName}}:</span>
<mat-form-field>
<input matInput id="tunneltype" name="{{key}}" type='text'
required="{{ i.required==true ? 'true' : 'false' }}"
[(ngModel)]="i.propertyValue">
</mat-form-field>
<span style="color: red;" *ngIf="i.required">*</span>
</div>
</div>
</div>
<!-- -->
<div class="infobtnbox">
<button type="button" mat-raised-button>编辑</button>
<button type="submit" mat-button mat-raised-button>保存</button>
<button type="button" mat-raised-button>删除</button>
<button type="button" color="primary" mat-raised-button>编辑</button>
<button type="submit()" mat-button mat-raised-button color="primary" [disabled]='form.invalid'>保存</button>
<button type="button" mat-raised-button (click)="deletedbuilding(item)" color="warn">删除</button>
</div>
</form>

42
src/app/ui/basicinfo/basicinfo.component.scss

@ -147,6 +147,44 @@
}
}
.mat-spinner{
margin-top: 34px;
margin-left: 178px;
margin-top: 58px;
margin-left: 203px;
}
.mat-table{
width: 100%;
}
table{
width: 1000px;
thead{
tr{
th{
width: 60px;
display: block;
float: left;
}
}
}
tbody{
tr{
td{
width: 60px;
display: block;
float: left;
}
}
}
}
.roadinfo{
border-bottom: 1px solid black;;
}
.deviceinfo{
border-bottom: 1px solid black;;
padding-bottom: 70px;
}
.tankdetailinfo{
border-bottom: 1px solid black;;
padding-bottom: 35px;
}

1234
src/app/ui/basicinfo/basicinfo.component.ts

File diff suppressed because it is too large Load Diff

13
src/app/ui/function-division/function-division.component.ts

@ -1,6 +1,7 @@
import { Component, OnInit, Inject } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
@ -11,7 +12,7 @@ import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dial
})
export class FunctionDivisionComponent implements OnInit {
constructor(private http:HttpClient,public dialog: MatDialog) { }
constructor(private http:HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar) { }
ngOnInit(): void {
this.companyId = sessionStorage.getItem('companyId')
@ -70,7 +71,10 @@ export class FunctionDivisionComponent implements OnInit {
})
}
} else if (!this.selectFunctionalZoning.length) {
alert('请选择单位功能分区')
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('请选择单位功能分区','确定',config);
}
}
@ -172,7 +176,10 @@ export class FunctionDivisionComponent implements OnInit {
})
}
} else if (!this.selectBuildingFunctionalZoning[index].length) {
alert('请选择建筑功能分区')
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('请选择建筑功能分区','确定',config);
}
}

15
src/app/ui/uploading-cad/editFile.html

@ -1,22 +1,17 @@
<!-- <div mat-dialog-title>上传CAD图纸</div>
<div mat-dialog-title>编辑CAD图纸</div>
<div>
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm" class="example-container">
<mat-form-field>
<input matInput placeholder="请输入CAD图纸名称" required ngModel name="name">
<input matInput placeholder="请输入CAD图纸名称" required [(ngModel)]="CADname" name="name">
</mat-form-field>
<div>
<a href="javascript:;" class="a-upload">
<input type="file" (change)='selectFile($event)'>点击这里上传文件
</a>
</div>
<p *ngIf="file" style="font-size: 14px; width: 180px; overflow: hidden; margin-top: 10px;">{{file.name}}</p>
<p style="font-size: 14px; color: red; margin-bottom: 15px;">*注: XX建筑-XX系统-XX某层</p>
<div mat-dialog-actions>
<button mat-raised-button color="primary" type="submit"
[disabled]="!form.form.valid">
上传
确定
</button>
<button mat-raised-button mat-dialog-close>取消</button>
</div>
</form>
</div> -->
</div>

6
src/app/ui/uploading-cad/uploading-cad.component.html

@ -2,7 +2,7 @@
<button mat-raised-button color="primary" (click)="openReadFile()" *ngIf="!uploadisLoading">上传</button>
<button mat-raised-button color="primary" (click)='readFile()' *ngIf="!downloadisLoading">下载</button>
<button mat-raised-button color="primary" (click)='editFile()'>编辑</button>
<button mat-raised-button color="primary" style="margin-right: 25px;">删除</button>
<button mat-raised-button color="primary" (click)='deleteCAD()' style="margin-right: 25px;">删除</button>
<div class="progressBox" *ngIf="uploadisLoading">
<button mat-raised-button style="margin-right: 5px;" (click)="cancel()">取消上传</button>
@ -23,14 +23,14 @@
<ng-container matColumnDef="checked">
<th mat-header-cell *matHeaderCellDef></th>
<td mat-cell *matCellDef="let element">
<mat-checkbox></mat-checkbox>
<mat-checkbox (change)='checkedCAD($event,element)'></mat-checkbox>
</td>
</ng-container>
<ng-container matColumnDef="name">
<th mat-header-cell *matHeaderCellDef>名称</th>
<td mat-cell *matCellDef="let element">
{{element.name}}
<mat-icon style="color: #FFC122;">insert_drive_file</mat-icon>{{element.name}}
</td>
</ng-container>

8
src/app/ui/uploading-cad/uploading-cad.component.scss

@ -5,6 +5,14 @@
}
}
//icon统一样式
.mat-icon {
cursor:pointer;
width: 24px;
height: 24px;
vertical-align:inherit;
margin-right: 5px;
}
//进度条
.progressBox{
position: relative;

90
src/app/ui/uploading-cad/uploading-cad.component.ts

@ -1,5 +1,5 @@
import { Component, OnInit, Inject } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { MatDialog, MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
@ -28,14 +28,22 @@ export class UploadingCADComponent implements OnInit {
getAllCAD () {
this.http.get('/api/CompanyAccount/CadData').subscribe(data=>{
this.CADList = data
this.selectCAD = []
this.CADList.forEach(element => {
element.loading = false
element.suffix = element.cadUrl.substring(element.cadUrl.lastIndexOf("."),element.cadUrl.length); //图名后缀
element.fileLength = (element.fileLength/1024/1024).toFixed(2)});
console.log(this.CADList)
})
}
//change CAD图checked
checkedCAD (e,element) {
if (e.checked) {
this.selectCAD.push(element)
} else {
this.selectCAD.splice(this.selectCAD.findIndex(item => item.id === element.id), 1)}
}
//打开上传文件窗口
openReadFile() {
let dialogRef = this.dialog.open(readFile);
@ -49,15 +57,39 @@ export class UploadingCADComponent implements OnInit {
//打开编辑文件窗口
editFile () {
let dialogRef = this.dialog.open(editFile);
dialogRef.afterClosed().subscribe(data=>{
if (data) {console.log(data)}
});
if (this.selectCAD.length===1) {
let data = this.selectCAD[0]
let dialogRef = this.dialog.open(editFile,{data});
dialogRef.afterClosed().subscribe(data=>{
if (data) {this.getAllCAD()}
});
} else if (this.selectCAD.length>1) {
alert('不支持批量编辑')
}
}
//删除CAD图
deleteCAD () {
if (this.selectCAD.length!=0) {
let isDelete = confirm('您确定要删除吗')
let arr = []
if (isDelete) {
this.selectCAD.forEach( async (element,index) => {
let result = await new Promise((result,reject)=>{
this.http.delete(`/api/CompanyAccount/CadData/${element.id}`).subscribe(data=>{result(index)})
this.http.delete(`/api/Objects/PlanPlatform/${element.cadUrl}`).subscribe(data=>{})
})
arr.push(result)
if (arr.length == this.selectCAD.length) {this.getAllCAD()}
});
}
}
}
//上传文件↓
file:any; //上传的文件
fileName:any; //上传文件name
@ -166,16 +198,20 @@ export class UploadingCADComponent implements OnInit {
//下载↓
download:any = 'PlanPlatform/YYY/5e6f10f8504aeb36d43cf5e1.jpg'; //'PlanPlatform/YYY/5e709418504aeb36d43cf5fc.jpg' 下载的文件
selectDownloadFile:any; //选择下载的文件
download:any; //下载文件元数据
downloadisLoading:boolean = false; //进度条loading加载
downloadProgress:number=0; //进度条进度
//读取下载文件信息
readFile () {
// this.http.get('/api/ObjectMetadata/'+this.download).subscribe(data=>{
// this.download = data
// this.downloadFile()
// })
if (this.selectCAD.length===1) {
this.selectDownloadFile = this.selectCAD[0]
this.http.get('/api/ObjectMetadata/PlanPlatform/'+this.selectDownloadFile.cadUrl).subscribe(data=>{
this.download = data
this.downloadFile()
})
} else if (this.selectCAD.length>1) {alert('暂时不支持批量下载')}
}
//初始化下载
@ -185,19 +221,24 @@ export class UploadingCADComponent implements OnInit {
let shardSize = 10 * 1024 * 1024 //文件大小是否大于10MB
if (file && fileSize<=shardSize) { //<=10MB时直接下载
this.downloadisLoading = true
this.setFileLoading()
this.http.get(`/api/Objects/PlanPlatform/${file.objectName}`,{responseType: 'blob'},).subscribe(data=>{
let url = window.URL.createObjectURL(new Blob([data])); //createObjectURL创建一个下载Blob的url地址
let link = document.createElement("a");
link.style.display = "none";
link.href = url;
link.setAttribute("download", '自定义名字.jpg');
link.setAttribute("download", this.selectDownloadFile.name+this.selectDownloadFile.suffix);
document.body.appendChild(link);
link.click();
this.downloadisLoading = false
this.setFileLoading()
})
} else if (file && fileSize>shardSize) { //>10MB时分块下载
this.blockingDownload() //分段下载
this.downloadisLoading = true
this.setFileLoading()
}
}
@ -226,10 +267,12 @@ export class UploadingCADComponent implements OnInit {
let link = document.createElement("a");
link.style.display = "none";
link.href = url;
link.setAttribute("download", '自定义名字.jpg');
link.setAttribute("download", this.selectDownloadFile.name+this.selectDownloadFile.suffix);
document.body.appendChild(link);
link.click();
this.downloadProgress = 0
this.downloadisLoading = false
this.setFileLoading()
}
} //for循环
@ -241,6 +284,14 @@ export class UploadingCADComponent implements OnInit {
}
//封装函数设置当前文件loading状态
setFileLoading () {
let id = this.selectDownloadFile.id
this.CADList.forEach(element => {
if (element.id === id) { element.loading = !element.loading }
});
}
@ -301,7 +352,18 @@ export class editFile {
@Inject(MAT_DIALOG_DATA) public data) { }
ngOnInit(): void {
console.log(this.data)
this.CADname = this.data.name
}
CADname:any; //name
//提交表单保存
onSubmit (e) {
let headers = new HttpHeaders({'Content-Type': 'text/json'});
let options = {headers};
this.http.put(`/api/CompanyAccount/CadData/${this.data.id}`,JSON.stringify(e.name),options).subscribe(data=>{
this.dialogRef.close('success');
})
}

BIN
src/assets/images/bg_login.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 243 KiB

BIN
src/assets/images/caiji.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

BIN
src/assets/images/login.gif

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.6 KiB

Loading…
Cancel
Save