Browse Source

[合并] 合并代码

develop
陈鹏飞 4 years ago
parent
commit
ce54ee63f1
  1. 2
      proxy.config.json
  2. 5
      src/app/app.component.html
  3. 12
      src/app/app.component.scss
  4. 9
      src/app/app.component.ts
  5. 4
      src/app/app.module.ts
  6. 18
      src/app/mask-layer.service.ts
  7. 13
      src/app/ui/basicinfo/basicinfo.component.ts
  8. 502
      src/app/ui/collection-tools/collection-tools.component.html
  9. 2
      src/app/ui/collection-tools/collection-tools.component.scss
  10. 17
      src/app/ui/collection-tools/collection-tools.component.ts
  11. 1
      src/app/ui/ui.component.html

2
proxy.config.json

@ -1,6 +1,6 @@
{
"/api": {
"target": "http://39.106.78.171:8000",
"target": "http://121.37.20.190:8000/",
"secure": false,
"changeOrigin": true
}

5
src/app/app.component.html

@ -1 +1,4 @@
<router-outlet></router-outlet>
<router-outlet></router-outlet>
<div class="maskLayer" *ngIf="isMaskLayerShow">
<mat-spinner [diameter]='50'></mat-spinner>
</div>

12
src/app/app.component.scss

@ -0,0 +1,12 @@
.maskLayer{
position: absolute;
left: 0;
top: 0;
z-index: 2000;
width: 100%;
height: 100%;
background: rgba(0,0,0,0.2);
display: flex;
justify-content: center;
align-items: center;
}

9
src/app/app.component.ts

@ -4,6 +4,7 @@ import { Data } from './interface'
import { Router,ActivatedRoute } from '@angular/router'
import {CacheTokenService} from './http-interceptors/cache-token.service'//引入服务
import { CookieService } from 'ngx-cookie-service';
import { MaskLayerService } from './mask-layer.service';
@ -14,9 +15,15 @@ import { CookieService } from 'ngx-cookie-service';
})
export class AppComponent {
constructor(private http:HttpClient,private router:Router,public token:CacheTokenService,private cookieService: CookieService) { }
constructor(private maskLayerService:MaskLayerService, private http:HttpClient,private router:Router,public token:CacheTokenService,private cookieService: CookieService) { }
isMaskLayerShow:boolean = false
ngOnInit(): void {
//监听遮罩层
this.maskLayerService.getMessage().subscribe((message: any)=>{
this.isMaskLayerShow = message
});
var token = this.cookieService.get("token")
var refreshToken = this.cookieService.get("refreshToken");
if(token && refreshToken) {

4
src/app/app.module.ts

@ -20,6 +20,7 @@ import { TreeService } from'./http-interceptors/tree.service'
import { CookieService } from 'ngx-cookie-service';//cookie插件
import { CountdownModule } from 'ngx-countdown'; //倒计时插件
import { MTokenK1Component } from './m-token-k1/m-token-k1.component';
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
@NgModule({
declarations: [
@ -39,7 +40,8 @@ import { MTokenK1Component } from './m-token-k1/m-token-k1.component';
PagesModule,
FormsModule,
HttpClientModule,
CountdownModule
CountdownModule,
MatProgressSpinnerModule
],
providers: [httpInterceptorProviders, CacheTokenService,TreeService,CookieService],
bootstrap: [AppComponent]

18
src/app/mask-layer.service.ts

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

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

@ -148,8 +148,8 @@ export class BasicinfoComponent implements OnInit {
var auto = new AMap.AutoComplete(autoOptions);
this.placeSearch = new AMap.PlaceSearch(); //构造地点查询类
auto.on("select", (e)=>{
console.log(e)
console.log( this.newPositionMarker)
// console.log(e)
// console.log( this.newPositionMarker)
this.newPositionMarker.setPosition([e.poi.location.lng,e.poi.location.lat])
this.markerPosition2 = {x: e.poi.location.lng, y: e.poi.location.lat}
this.map.setCenter([e.poi.location.lng,e.poi.location.lat]); //设置地图中心点
@ -158,7 +158,7 @@ export class BasicinfoComponent implements OnInit {
});
if(this.isMapLabel){//如果已经标注单位坐标
console.log('已标注单位位置')
// console.log('已标注单位位置')
this.map.setCenter([this.unitinfo.location.x,this.unitinfo.location.y]);
this.oldPositionMarker = new AMap.Marker({
position: [this.unitinfo.location.x,this.unitinfo.location.y],
@ -168,7 +168,7 @@ export class BasicinfoComponent implements OnInit {
// 将 markers 添加到地图
this.map.add(this.oldPositionMarker);
}else{
console.log('未标注单位位置')
// console.log('未标注单位位置')
this.map.setCity('广西');
}
}
@ -178,7 +178,7 @@ export class BasicinfoComponent implements OnInit {
this.isGisTopBox = false
this.isGisTopBoxTwo = true
if(this.isMapLabel){//如果已经标注单位坐标
console.log('已标注单位位置')
// console.log('已标注单位位置')
if(this.oldPositionMarker){
this.oldPositionMarker.setContent(this.oldPositionMarkerContent)
@ -232,7 +232,7 @@ export class BasicinfoComponent implements OnInit {
})
}else{
console.log('未标注单位位置')
// console.log('未标注单位位置')
if(this.newPositionMarker){
this.newPositionMarker.setContent(this.oldPositionMarkerContent)
}
@ -364,7 +364,6 @@ export class BasicinfoComponent implements OnInit {
this.unitinfo = data
resolve(this.unitinfo)
console.log(456789,this.unitinfo)
this.selectedorganizationid = data.organizationId
if(data.imageUrl){
this.imgsrc = data.imageUrl

502
src/app/ui/collection-tools/collection-tools.component.html

@ -50,287 +50,289 @@
<!--功能区 -->
<div class="functionalDomain">
<div class='functionalDomainContent' id="functionalDomainContent">
<div class='functionalDomainContent' id="functionalDomainContent">
<!-- H5Canvas -->
<app-working-area #canvas></app-working-area>
<!-- H5Canvas -->
<div id="leftDiv" class='functionalDomainLeft publicCss' [ngClass]="{'togglePanel': toggleExpandPanel==true}" style="user-select: none">
<div class="leftDragDiv" (mousedown)="leftDivMouseDown($event)"></div>
<!-- 平面图 -->
<div class="planarGraph">
<div class="planarGraphHeader" (click)='togglePlanarGraph()'>
<mat-icon *ngIf="togglePlane">keyboard_arrow_up</mat-icon>
<mat-icon *ngIf="!togglePlane">keyboard_arrow_down</mat-icon>
<label class="overflowText" style="font-weight: 550;">平面图</label>
<label class="hover" *ngIf="isEditPattern">
<mat-icon (click)='foundPanel($event)'>add</mat-icon>
</label>
</div>
<div [hidden]="!togglePlane" >
<div class="sitePlanContent" *ngFor="let item of sitePlanData;let key = index"
[ngClass]="{'isRefugeStorey':item.isRefugeStorey==true,'selectSitePlan': selectSitePlanIndex==key}" (click)='selectSitePlan(item,key)'>
<label class="overflowText planEveryRow"><mat-icon *ngIf="!item.imageUrl" class="matIcons">broken_image</mat-icon>{{item.name}}</label>
<a href="javascript:;" class="a-upload" *ngIf="selectSitePlanIndex==key && isEditPattern" title="替换底图" >
<input type="file" (change)='replaceBaseMap($event,item)' accept="image/*">
<mat-icon class="matIcons">photo_size_select_actual</mat-icon>
</a>
<a href="javascript:;" id="a-uploadImg" *ngIf="selectSitePlanIndex==key && !item.imageUrl && isEditPattern" title="上传底图" >
<input type="file" (change)='replaceBaseMap($event,item)' accept="image/*">
<img src="../../../assets/images/upload.jpg">
</a>
<!-- 右边定位操作栏 -->
<div id="rightOperate" *ngIf="selectSitePlanIndex==key && item.imageUrl && isEditPattern" (click)="$event.stopPropagation();">
<p class="functionButton">
<mat-icon class="functionIcon bigFunctionIcon" title="上移" (click)='moveUp(item,key)'>keyboard_arrow_up</mat-icon>
</p>
<p class="functionButton">
<mat-icon class="functionIcon" title="编辑属性" (click)='editPlaneData(item)'>edit</mat-icon>
<mat-icon class="functionIcon" title="删除" (click)="deletePlaneData(item)">delete</mat-icon>
</p>
<p class="functionButton">
<mat-icon class="functionIcon" title="旋转底图" (click)='revolveImg(item)'>cached</mat-icon>
<mat-icon class="functionIcon" title="复制" (click)="duplicateLayer(item)">library_books</mat-icon>
</p>
<p class="functionButton">
<mat-icon class="functionIcon bigFunctionIcon" title="下移" (click)='moveDown(item,key)'>keyboard_arrow_down</mat-icon>
</p>
<!-- H5Canvas -->
<app-working-area #canvas></app-working-area>
<!-- H5Canvas -->
<div id="leftDiv" class='functionalDomainLeft publicCss' [ngClass]="{'togglePanel': toggleExpandPanel==true}" style="user-select: none">
<div class="leftDragDiv" (mousedown)="leftDivMouseDown($event)"></div>
<!-- 平面图 -->
<div class="planarGraph">
<div class="planarGraphHeader" (click)='togglePlanarGraph()'>
<mat-icon *ngIf="togglePlane">keyboard_arrow_up</mat-icon>
<mat-icon *ngIf="!togglePlane">keyboard_arrow_down</mat-icon>
<label class="overflowText" style="font-weight: 550;">平面图</label>
<label class="hover" *ngIf="isEditPattern">
<mat-icon (click)='foundPanel($event)'>add</mat-icon>
</label>
</div>
<div [hidden]="!togglePlane" >
<div class="sitePlanContent" *ngFor="let item of sitePlanData;let key = index"
[ngClass]="{'isRefugeStorey':item.isRefugeStorey==true,'selectSitePlan': selectSitePlanIndex==key}" (click)='selectSitePlan(item,key)'>
<label class="overflowText planEveryRow"><mat-icon *ngIf="!item.imageUrl" class="matIcons">broken_image</mat-icon>{{item.name}}</label>
<a href="javascript:;" class="a-upload" *ngIf="selectSitePlanIndex==key && isEditPattern" title="替换底图" >
<input type="file" (change)='replaceBaseMap($event,item)' accept="image/*">
<mat-icon class="matIcons">photo_size_select_actual</mat-icon>
</a>
<a href="javascript:;" id="a-uploadImg" *ngIf="selectSitePlanIndex==key && !item.imageUrl && isEditPattern" title="上传底图" >
<input type="file" (change)='replaceBaseMap($event,item)' accept="image/*">
<img src="../../../assets/images/upload.jpg">
</a>
<!-- 右边定位操作栏 -->
<div id="rightOperate" *ngIf="selectSitePlanIndex==key && item.imageUrl && isEditPattern" (click)="$event.stopPropagation();">
<p class="functionButton">
<mat-icon class="functionIcon bigFunctionIcon" title="上移" (click)='moveUp(item,key)'>keyboard_arrow_up</mat-icon>
</p>
<p class="functionButton">
<mat-icon class="functionIcon" title="编辑属性" (click)='editPlaneData(item)'>edit</mat-icon>
<mat-icon class="functionIcon" title="删除" (click)="deletePlaneData(item)">delete</mat-icon>
</p>
<p class="functionButton">
<mat-icon class="functionIcon" title="旋转底图" (click)='revolveImg(item)'>cached</mat-icon>
<mat-icon class="functionIcon" title="复制" (click)="duplicateLayer(item)">library_books</mat-icon>
</p>
<p class="functionButton">
<mat-icon class="functionIcon bigFunctionIcon" title="下移" (click)='moveDown(item,key)'>keyboard_arrow_down</mat-icon>
</p>
</div>
<!-- 右边定位操作栏 -->
</div>
<!-- 右边定位操作栏 -->
</div>
</div>
</div>
<!-- 素材库 -->
<div id="materialBank" *ngIf="isEditPattern">
<div class="planarGraphHeader" (click)='toggleMaterial()'>
<mat-icon *ngIf="toggleMaterialBank">keyboard_arrow_up</mat-icon>
<mat-icon *ngIf="!toggleMaterialBank">keyboard_arrow_down</mat-icon>
<label class="overflowText" style="font-weight: 550;">素材库</label>
</div>
<div style="flex: 1;overflow-y: auto;" [hidden]="!toggleMaterialBank">
<mat-accordion *ngFor="let item of allLibrary" id="panelLibrary">
<mat-expansion-panel (opened)='opened(item)'>
<mat-expansion-panel-header>
<label class="text">{{item.name}}</label>
</mat-expansion-panel-header>
<!-- 素材库 -->
<div id="materialBank" *ngIf="isEditPattern">
<div class="planarGraphHeader" (click)='toggleMaterial()'>
<mat-icon *ngIf="toggleMaterialBank">keyboard_arrow_up</mat-icon>
<mat-icon *ngIf="!toggleMaterialBank">keyboard_arrow_down</mat-icon>
<label class="overflowText" style="font-weight: 550;">素材库</label>
</div>
<div style="flex: 1;overflow-y: auto;" [hidden]="!toggleMaterialBank">
<mat-accordion *ngFor="let item of allLibrary" id="panelLibrary">
<mat-expansion-panel (opened)='opened(item)'>
<mat-expansion-panel-header>
<label class="text">{{item.name}}</label>
</mat-expansion-panel-header>
<div class="panelLibraryFlex">
<div class="imgBox" *ngFor="let items of item.images;let key = index" [title]="items.name"
(click)='selectImg(item,items,key)'
[ngClass]="{'selectImg': selectLibrary==item.name && selectImageIndex==key}">
<img [src]="items.imageUrl" onerror="javascript:this.src='../../../assets/images/noImg.png'">
<p class="overflowText">{{items.name}}</p>
<div class="panelLibraryFlex">
<div class="imgBox" *ngFor="let items of item.images;let key = index" [title]="items.name"
(click)='selectImg(item,items,key)'
[ngClass]="{'selectImg': selectLibrary==item.name && selectImageIndex==key}">
<img [src]="items.imageUrl" onerror="javascript:this.src='../../../assets/images/noImg.png'">
<p class="overflowText">{{items.name}}</p>
</div>
</div>
</div>
</mat-expansion-panel>
</mat-accordion>
</div>
</div>
</div>
<div id="rightDiv" class="functionalDomainRight publicCss " [ngClass]="{'togglePanel2': toggleExpandPanelRight==true}" style="user-select: none">
<!-- 右侧div鼠标拖动div -->
<div style="width: 3px;height: 100%;position: absolute;left: 0;cursor: e-resize;z-index: 1000;" (mousedown)="rightDivMouseDown($event)"></div>
<!-- 属性 -->
<div [ngClass]="{'forbidden': !isEditPattern}" id="property" class="property" style="height: 50%;">
<div class="title">
<div>
<span style="user-select: none">属性</span>
</mat-expansion-panel>
</mat-accordion>
</div>
</div>
<!-- 平面图属性 -->
<div class="siteproperty" style="user-select: none" *ngIf="isShowProperty && isShowAttribute">
<p>面积(平方米)</p>
<div class="siteproperty_size">{{canvasData.selectStorey.area}}</div>
<p>详情</p>
<div class="siteproperty_size">
{{canvasData.selectStorey.details}}
</div>
</div>
<!-- 素材属性 -->
<div class="assetsproperty" style="user-select: none" *ngIf="isShowProperty && !isShowAttribute">
<h3 style="text-align: center;font-weight: 900;">{{assetName}}</h3>
<div *ngIf="canvasAssetObj.InteractiveMode == 0">
<p>宽度(像素)</p>
<input type="text" class="biginput" [(ngModel)]="assetWidth" (input)="assetWidthIunput()" [disabled]="!isEditPattern">
<p>高度(像素)</p>
<input type="text" class="biginput" [(ngModel)]="assetHeight" (input)="assetHeightIunput()" [disabled]="!isEditPattern">
<p>角度</p>
<div style="width: 100%;display: flex;vertical-align: top;height: 22px;">
<input type="number" class="smallinput" [(ngModel)]="sliderValue"
oninput="if(value>360)value=360;if(value<0)value=0;" (input)="assetAngleIunput()" [disabled]="!isEditPattern">
<mat-slider color="primary" min="0" max="360" step="1" style="bottom: 12px;left: 2px;width: 70%;"
[(ngModel)]="sliderValue" (change)="assetAngleIunput()" [disabled]="!isEditPattern"></mat-slider>
</div>
<div id="rightDiv" class="functionalDomainRight publicCss " [ngClass]="{'togglePanel2': toggleExpandPanelRight==true}" style="user-select: none">
<!-- 右侧div鼠标拖动div -->
<div style="width: 3px;height: 100%;position: absolute;left: 0;cursor: e-resize;z-index: 1000;" (mousedown)="rightDivMouseDown($event)"></div>
<!-- 属性 -->
<div [ngClass]="{'forbidden': !isEditPattern}" id="property" class="property" style="height: 50%;">
<div class="title">
<div>
<span style="user-select: none">属性</span>
</div>
</div>
<!-- 如果是多点连线 -->
<div *ngIf="canvasAssetObj.InteractiveMode == 1 || canvasAssetObj.InteractiveMode == 3">
<p>厚度</p>
<div style="width: 100%;display: flex;vertical-align: top;height: 22px;">
<input type="number" class="smallinput" [(ngModel)]="sliderValueThickness"
oninput="if(value>999)value=999;if(value<0)value=0;" (input)="assetThicknessIunput()" [disabled]="!isEditPattern">
<mat-slider color="primary" min="0" max="999" step="1" style="bottom: 12px;left: 2px;width: 70%;"
[(ngModel)]="sliderValueThickness" (change)="assetThicknessIunput()" [disabled]="!isEditPattern"></mat-slider>
<!-- 平面图属性 -->
<div class="siteproperty" style="user-select: none" *ngIf="isShowProperty && isShowAttribute">
<p>面积(平方米)</p>
<div class="siteproperty_size">{{canvasData.selectStorey.area}}</div>
<p>详情</p>
<div class="siteproperty_size">
{{canvasData.selectStorey.details}}
</div>
</div>
<!-- 素材属性 -->
<div class="assetsproperty" style="user-select: none" *ngIf="isShowProperty && !isShowAttribute">
<h3 style="text-align: center;font-weight: 900;">{{assetName}}</h3>
<p style="margin-top: 4px;margin-bottom: 0px;">是否高亮</p>
<div>
<input class="input" [(ngModel)]="isHighLight" type="checkbox" [disabled]="!isEditPattern">
<span style="font-size: 14px;">选中高亮</span>
</div>
<div class="colorBigDiv" *ngIf="canvasAssetObj.FillMode == 0">
<div class="colorBigTemplateDiv">
<span>颜色</span>
<div class="colorTemplateDiv" [style]="{'background-color':selectedcolor}">
<div *ngIf="canvasAssetObj.InteractiveMode == 0">
<p>宽度(像素)</p>
<input type="text" class="biginput" [(ngModel)]="assetWidth" (input)="assetWidthIunput()" [disabled]="!isEditPattern">
<p>高度(像素)</p>
<input type="text" class="biginput" [(ngModel)]="assetHeight" (input)="assetHeightIunput()" [disabled]="!isEditPattern">
<p>角度</p>
<div style="width: 100%;display: flex;vertical-align: top;height: 22px;">
<input type="number" class="smallinput" [(ngModel)]="sliderValue"
oninput="if(value>360)value=360;if(value<0)value=0;" (input)="assetAngleIunput()" [disabled]="!isEditPattern">
<mat-slider color="primary" min="0" max="360" step="1" style="bottom: 12px;left: 2px;width: 70%;"
[(ngModel)]="sliderValue" (change)="assetAngleIunput()" [disabled]="!isEditPattern"></mat-slider>
</div>
</div>
<div class="colorDiv" *ngIf="isEditPattern">
<ul>
<li (click)="selectcolor(item,key)" class="colorLi" *ngFor="let item of colors,let key=index" [style]="{'background-color':item}"></li>
</ul>
</div>
<span style="color: #9c9fa5;font-size: 14px;">透明度</span>
<mat-slider color="primary" min="0" max="100%" step="1" style="left: 1px; width: 55%;min-width: 90px;"
[(ngModel)]="colorDivSliderValue" (change)="colorDivSliderChange()" [disabled]="!isEditPattern"></mat-slider>
<span style="color: #9c9fa5;font-size: 12px;">{{colorDivSliderValue}}%</span>
</div>
<div *ngFor="let item of PropertyInfos;index as key ">
<!-- 单行文本 -->
<div *ngIf="item.PropertyType == 0">
<p>{{item.PropertyName}}<span style="font-size: 14px;" *ngIf="item.PhysicalUnit">({{item.PhysicalUnit}})</span></p>
<input type="text" class="biginput" [value]="item.PropertyValue" (input)="assetInputChange(item,$event)" [disabled]="!isEditPattern">
<!-- 如果是多点连线 -->
<div *ngIf="canvasAssetObj.InteractiveMode == 1 || canvasAssetObj.InteractiveMode == 3">
<p>厚度</p>
<div style="width: 100%;display: flex;vertical-align: top;height: 22px;">
<input type="number" class="smallinput" [(ngModel)]="sliderValueThickness"
oninput="if(value>999)value=999;if(value<0)value=0;" (input)="assetThicknessIunput()" [disabled]="!isEditPattern">
<mat-slider color="primary" min="0" max="999" step="1" style="bottom: 12px;left: 2px;width: 70%;"
[(ngModel)]="sliderValueThickness" (change)="assetThicknessIunput()" [disabled]="!isEditPattern"></mat-slider>
</div>
</div>
<!-- 多行文本 -->
<div *ngIf="item.PropertyType == 1">
<p>{{item.PropertyName}}<span style="font-size: 14px;" *ngIf="item.PhysicalUnit">({{item.PhysicalUnit}})</span></p>
<textarea class="textarea" name="" id="" [value]="item.PropertyValue" (input)="assetInputChange(item,$event)" [disabled]="!isEditPattern"></textarea>
<p style="margin-top: 4px;margin-bottom: 0px;">是否高亮</p>
<div>
<input class="input" [(ngModel)]="isHighLight" type="checkbox" [disabled]="!isEditPattern">
<span style="font-size: 14px;">选中高亮</span>
</div>
<!-- 数值 -->
<div *ngIf="item.PropertyType == 2">
<p>{{item.PropertyName}}<span style="font-size: 14px;" *ngIf="item.PhysicalUnit">({{item.PhysicalUnit}})</span></p>
<input type="number" class="biginput" [value]="item.PropertyValue" (input)="assetInputChange(item,$event)" [disabled]="!isEditPattern">
<div class="colorBigDiv" *ngIf="canvasAssetObj.FillMode == 0">
<div class="colorBigTemplateDiv">
<span>颜色</span>
<div class="colorTemplateDiv" [style]="{'background-color':selectedcolor}">
</div>
</div>
<div class="colorDiv" *ngIf="isEditPattern">
<ul>
<li (click)="selectcolor(item,key)" class="colorLi" *ngFor="let item of colors,let key=index" [style]="{'background-color':item}"></li>
</ul>
</div>
<span style="color: #9c9fa5;font-size: 14px;">透明度</span>
<mat-slider color="primary" min="0" max="100%" step="1" style="left: 1px; width: 55%;min-width: 90px;"
[(ngModel)]="colorDivSliderValue" (change)="colorDivSliderChange()" [disabled]="!isEditPattern"></mat-slider>
<span style="color: #9c9fa5;font-size: 12px;">{{colorDivSliderValue}}%</span>
</div>
<!-- 图片数量 -->
<div *ngIf="item.PropertyType == 4" style="height: 140px;">
<div style="position: relative;width: 100%;height: 21px;margin: 1px 0;">
<p style="width: 40%;display: inline-block;">{{item.PropertyName}}</p>
<span style="width: 26%;text-align:right;font-size: 13px;">{{imagesArr.length ? imagesArr.length : 0}} / {{item.PropertyValue}}</span>
<input id="inputimg" [disabled]="!isEditPattern" *ngIf="isImgNumCss" accept="image/*" (change)="selectFile($event)" type="file" style="width: 33%;position: absolute;right: 10px;top: 1px;opacity: 0;z-index: 100;cursor: pointer;height: 21px;">
<div style="width: 33%;height: 21px;line-height: 21px;text-align: center;position: absolute;right: 10px;top: 1px;z-index: 99;border: 1px solid rgb(208, 211, 214);border-radius: 2px;font-size: 13px;cursor: pointer;" (click)="imgNumBeyond()">添加</div>
<div style="position: relative;;width: 89%;border:1px solid rgb(208, 211, 214);height: 100px;margin: 6px auto;" class="swiper-container">
<div id="viewerjs" class="swiper-wrapper" [ngClass]="{'noImgCss': imagesArr.length == 0}">
<div class="swiper-slide" style="text-align: center;" *ngFor="let img of imagesArr"><img [src]="img.PropertyValue + '?x-oss-process=image/resize,m_fixed,h_100,w_100'" alt="" [attr.data-original]="img.PropertyValue"></div>
<div *ngFor="let item of PropertyInfos;index as key ">
<!-- 单行文本 -->
<div *ngIf="item.PropertyType == 0">
<p>{{item.PropertyName}}<span style="font-size: 14px;" *ngIf="item.PhysicalUnit">({{item.PhysicalUnit}})</span></p>
<input type="text" class="biginput" [value]="item.PropertyValue" (input)="assetInputChange(item,$event)" [disabled]="!isEditPattern">
</div>
<!-- 多行文本 -->
<div *ngIf="item.PropertyType == 1">
<p>{{item.PropertyName}}<span style="font-size: 14px;" *ngIf="item.PhysicalUnit">({{item.PhysicalUnit}})</span></p>
<textarea class="textarea" name="" id="" [value]="item.PropertyValue" (input)="assetInputChange(item,$event)" [disabled]="!isEditPattern"></textarea>
</div>
<!-- 数值 -->
<div *ngIf="item.PropertyType == 2">
<p>{{item.PropertyName}}<span style="font-size: 14px;" *ngIf="item.PhysicalUnit">({{item.PhysicalUnit}})</span></p>
<input type="number" class="biginput" [value]="item.PropertyValue" (input)="assetInputChange(item,$event)" [disabled]="!isEditPattern">
</div>
<!-- 图片数量 -->
<div *ngIf="item.PropertyType == 4" style="height: 140px;">
<div style="position: relative;width: 100%;height: 21px;margin: 1px 0;">
<p style="width: 40%;display: inline-block;">{{item.PropertyName}}</p>
<span style="width: 26%;text-align:right;font-size: 13px;">{{imagesArr.length ? imagesArr.length : 0}} / {{item.PropertyValue}}</span>
<input id="inputimg" [disabled]="!isEditPattern" *ngIf="isImgNumCss" accept="image/*" (change)="selectFile($event)" type="file" style="width: 33%;position: absolute;right: 10px;top: 1px;opacity: 0;z-index: 100;cursor: pointer;height: 21px;">
<div style="width: 33%;height: 21px;line-height: 21px;text-align: center;position: absolute;right: 10px;top: 1px;z-index: 99;border: 1px solid rgb(208, 211, 214);border-radius: 2px;font-size: 13px;cursor: pointer;" (click)="imgNumBeyond()">添加</div>
<div style="position: relative;;width: 89%;border:1px solid rgb(208, 211, 214);height: 100px;margin: 6px auto;" class="swiper-container">
<div id="viewerjs" class="swiper-wrapper" [ngClass]="{'noImgCss': imagesArr.length == 0}">
<div class="swiper-slide" style="text-align: center;" *ngFor="let img of imagesArr"><img [src]="img.PropertyValue + '?x-oss-process=image/resize,m_fixed,h_100,w_100'" alt="" [attr.data-original]="img.PropertyValue"></div>
</div>
<!-- 如果需要导航按钮 -->
<div class="swiper-button-next"></div>
<div class="swiper-button-prev"></div>
<span style="position: absolute;right: 2px;top: 2px;cursor: pointer;z-index: 200;" *ngIf="isEditPattern">
<mat-icon class="hoverred" (click)="deleteImg()">delete</mat-icon>
</span>
</div>
<!-- 如果需要导航按钮 -->
<div class="swiper-button-next"></div>
<div class="swiper-button-prev"></div>
<span style="position: absolute;right: 2px;top: 2px;cursor: pointer;z-index: 200;" *ngIf="isEditPattern">
<mat-icon class="hoverred" (click)="deleteImg()">delete</mat-icon>
</span>
</div>
</div>
</div>
<!-- 方向 -->
<div *ngIf="item.PropertyType == 5" class="selectDiv">
<p style="display: inline-block;">{{item.PropertyName}}</p>
<select (change)="direction(item,$event)" [disabled]="!isEditPattern">
<option value ="0" [selected]="item.PropertyValue ==0"></option>
<option value ="1" [selected]="item.PropertyValue ==1">西</option>
<option value ="2" [selected]="item.PropertyValue ==2"></option>
<option value ="3" [selected]="item.PropertyValue ==3"></option>
<option value ="4" [selected]="item.PropertyValue ==4">东南</option>
<option value ="5" [selected]="item.PropertyValue ==5">西南</option>
<option value ="6" [selected]="item.PropertyValue ==6">东北</option>
<option value ="7" [selected]="item.PropertyValue ==7">西北</option>
</select>
</div>
<!-- 布尔值 是1或否0 -->
<div *ngIf="item.PropertyType == 6">
<p>{{item.PropertyName}}</p>
<input [disabled]="!isEditPattern" [checked]="item.PropertyValue == 1" class="input" type="radio" name="radio" (click)="assetRadioChange(item,'1')"><span></span>
<input [disabled]="!isEditPattern" [checked]="item.PropertyValue == 0" class="input" type="radio" name="radio" (click)="assetRadioChange(item,'0')"><span></span>
</div>
<!-- 供给区域 -->
<div *ngIf="item.PropertyType == 7" class="selectDiv">
<p style="display: inline-block;">{{item.PropertyName}}</p>
<select (change)="supplyArea(item,$event)" [disabled]="!isEditPattern">
<option value ="0" [selected]="item.PropertyValue ==0">全部</option>
<option value ="1" [selected]="item.PropertyValue ==1"></option>
<option value ="2" [selected]="item.PropertyValue ==2"></option>
<option value ="3" [selected]="item.PropertyValue ==3"></option>
<option value ="4" [selected]="item.PropertyValue ==4">高中</option>
<option value ="5" [selected]="item.PropertyValue ==5">低区</option>
<option value ="6" [selected]="item.PropertyValue ==6">中低区</option>
</select>
</div>
<!-- 供给类型 -->
<div *ngIf="item.PropertyType == 8" class="selectDiv">
<p style="display: inline-block;">{{item.PropertyName}}</p>
<select (change)="supplyType(item,$event)" value="4" [disabled]="!isEditPattern">
<option value ="0" [selected]="item.PropertyValue ==0">消火栓</option>
<option value ="1" [selected]="item.PropertyValue ==1">喷淋</option>
<option value ="2" [selected]="item.PropertyValue ==2">水幕</option>
<option value ="3" [selected]="item.PropertyValue ==3">泡沫</option>
<option value ="4" [selected]="item.PropertyValue ==4">消防</option>
</select>
</div>
<!-- 方向 -->
<div *ngIf="item.PropertyType == 5" class="selectDiv">
<p style="display: inline-block;">{{item.PropertyName}}</p>
<select (change)="direction(item,$event)" [disabled]="!isEditPattern">
<option value ="0" [selected]="item.PropertyValue ==0"></option>
<option value ="1" [selected]="item.PropertyValue ==1">西</option>
<option value ="2" [selected]="item.PropertyValue ==2"></option>
<option value ="3" [selected]="item.PropertyValue ==3"></option>
<option value ="4" [selected]="item.PropertyValue ==4">东南</option>
<option value ="5" [selected]="item.PropertyValue ==5">西</option>
<option value ="6" [selected]="item.PropertyValue ==6">东北</option>
<option value ="7" [selected]="item.PropertyValue ==7">西</option>
</select>
</div>
<!-- 布尔值 是1或否0 -->
<div *ngIf="item.PropertyType == 6">
<p>{{item.PropertyName}}</p>
<input [disabled]="!isEditPattern" [checked]="item.PropertyValue == 1" class="input" type="radio" name="radio" (click)="assetRadioChange(item,'1')"><span></span>
<input [disabled]="!isEditPattern" [checked]="item.PropertyValue == 0" class="input" type="radio" name="radio" (click)="assetRadioChange(item,'0')"><span></span>
</div>
<!-- 供给区域 -->
<div *ngIf="item.PropertyType == 7" class="selectDiv">
<p style="display: inline-block;">{{item.PropertyName}}</p>
<select (change)="supplyArea(item,$event)" [disabled]="!isEditPattern">
<option value ="0" [selected]="item.PropertyValue ==0">全部</option>
<option value ="1" [selected]="item.PropertyValue ==1">高区</option>
<option value ="2" [selected]="item.PropertyValue ==2"></option>
<option value ="3" [selected]="item.PropertyValue ==3"></option>
<option value ="4" [selected]="item.PropertyValue ==4">高中</option>
<option value ="5" [selected]="item.PropertyValue ==5">高低</option>
<option value ="6" [selected]="item.PropertyValue ==6">低区</option>
</select>
</div>
<!-- 供给类型 -->
<div *ngIf="item.PropertyType == 8" class="selectDiv">
<p style="display: inline-block;">{{item.PropertyName}}</p>
<select (change)="supplyType(item,$event)" value="4" [disabled]="!isEditPattern">
<option value ="0" [selected]="item.PropertyValue ==0">消火栓</option>
<option value ="1" [selected]="item.PropertyValue ==1">喷淋</option>
<option value ="2" [selected]="item.PropertyValue ==2">水幕</option>
<option value ="3" [selected]="item.PropertyValue ==3">泡沫</option>
<option value ="4" [selected]="item.PropertyValue ==4">消防</option>
</select>
</div>
</div>
</div>
</div>
</div>
<!-- 消防要素 -->
<div id="firecategories" class="firecategories" style="height: 50%;">
<!-- 素材属性div鼠标拖动div -->
<div style="height:3px;width: 100%;position: absolute;top: 0;cursor: n-resize;z-index: 1000;" (mousedown)="firecategoriesDivMouseDown($event)"></div>
<div class="title">
<div>
<span style="user-select: none">消防要素</span>
</div>
</div>
<!-- 消防要素 -->
<div id="firecategories" class="firecategories" style="height: 50%;">
<!-- 素材属性div鼠标拖动div -->
<div style="height:3px;width: 100%;position: absolute;top: 0;cursor: n-resize;z-index: 1000;" (mousedown)="firecategoriesDivMouseDown($event)"></div>
<div class="title">
<div>
<span style="user-select: none">消防要素</span>
</div>
</div>
<div class="firecategoriesTree">
<!-- 消防列表树写在这里 -->
<mat-tree [dataSource]="dataSource" [treeControl]="treeControl" >
<div class="firecategoriesTree">
<!-- 消防列表树写在这里 -->
<mat-tree [dataSource]="dataSource" [treeControl]="treeControl" >
<mat-tree-node [ngClass]="{'isLookPattern': !node.isLookPattern && !isEditPattern}" *matTreeNodeDef="let node;" matTreeNodePadding cdkTreeNodePaddingIndent='26' (click)="clickTreeNode(node)" >
<button mat-icon-button disabled></button>
<span title="{{node.name}}" [ngClass]="{'treeText': !node.isTemplate}">
{{node.name}}
</span>
<span *ngIf="node.isTemplate">({{node.children.length}})</span>
<span class="isLookCss" (click)="clickLookItem(node)"><mat-icon [ngClass]="{'icongray': node.isLook == false}">visibility</mat-icon></span>
</mat-tree-node>
<mat-tree-node [ngClass]="{'isLookPattern': !node.isLookPattern && !isEditPattern}" *matTreeNodeDef="let node;" matTreeNodePadding cdkTreeNodePaddingIndent='26' (click)="clickTreeNode(node)" >
<button mat-icon-button disabled></button>
<span title="{{node.name}}" [ngClass]="{'treeText': !node.isTemplate}">
{{node.name}}
</span>
<span *ngIf="node.isTemplate">({{node.children.length}})</span>
<span class="isLookCss" (click)="clickLookItem(node)"><mat-icon [ngClass]="{'icongray': node.isLook == false}">visibility</mat-icon></span>
</mat-tree-node>
<mat-tree-node [ngClass]="{'isLookPattern': !node.isLookPattern && !isEditPattern}" *matTreeNodeDef="let node;when: hasChild" matTreeNodePadding (click)="clickTreeNode(node)">
<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>
<span title="{{node.name}}" [ngClass]="{'treeText': !node.isTemplate}">
{{node.name}}
</span>
<span *ngIf="node.isTemplate && node.isNewElement">({{node.children.length}})</span>
<span class="isLookCss" (click)="clickLookItem(node)"><mat-icon [ngClass]="{'icongray': node.isLook == false}">visibility</mat-icon></span>
</mat-tree-node>
</mat-tree>
<mat-tree-node [ngClass]="{'isLookPattern': !node.isLookPattern && !isEditPattern}" *matTreeNodeDef="let node;when: hasChild" matTreeNodePadding (click)="clickTreeNode(node)">
<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>
<span title="{{node.name}}" [ngClass]="{'treeText': !node.isTemplate}">
{{node.name}}
</span>
<span *ngIf="node.isTemplate && node.isNewElement">({{node.children.length}})</span>
<span class="isLookCss" (click)="clickLookItem(node)"><mat-icon [ngClass]="{'icongray': node.isLook == false}">visibility</mat-icon></span>
</mat-tree-node>
</mat-tree>
</div>
</div>
</div>
</div>
</div>
<!--功能区 -->
</div>
</div>
</div>

2
src/app/ui/collection-tools/collection-tools.component.scss

@ -332,4 +332,4 @@ div:focus {
text-overflow: ellipsis;
display: inline-block;
width: 65px;
}
}

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

@ -10,6 +10,7 @@ import {WorkingAreaComponent} from '../../working-area/working-area.component'
import {CanvasShareDataService} from '../../canvas-share-data.service' //引入服务
import Viewer from 'viewerjs';
import * as ObjectID from 'bson-objectid';
import { MaskLayerService } from 'src/app/mask-layer.service';
@Component({
selector: 'app-collection-tools',
@ -20,7 +21,7 @@ export class CollectionToolsComponent implements OnInit {
@ViewChild('canvas') canvas:WorkingAreaComponent; //父组件中获得子组件的引用
constructor(private http:HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,private element: ElementRef,public canvasData: CanvasShareDataService) { }
constructor(private maskLayerService:MaskLayerService, private http:HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,private element: ElementRef,public canvasData: CanvasShareDataService) { }
// tree配置
private _transformer = (node, level: number) => {//要给渲染节点传那些属性参数
return {
@ -296,7 +297,7 @@ export class CollectionToolsComponent implements OnInit {
formData.append("file",file)
await new Promise((resolve,reject)=>{
this.http.delete(`/api/Objects/WebPlan2D/${companyId}/${file.name}?x-oss-process=image/resize,m_fixed,h_100,w_100`).subscribe(data=>{
console.log('删除缩略图成功')
// console.log('删除缩略图成功')
resolve('删除缩略图成功')
})
})
@ -520,7 +521,7 @@ export class CollectionToolsComponent implements OnInit {
//更新用于统计的数据
this.canvasData.updateBuildingData()
this.maskLayerService.sendMessage(true)
if (this.selectingSitePlan && this.selectingSitePlan.id) {
this.saveNum = []
let SitePlanData = JSON.parse(JSON.stringify(this.canvasData.originaleveryStoreyData));
@ -555,6 +556,7 @@ export class CollectionToolsComponent implements OnInit {
this.http.post("/api/CompanyAccount/SitePlanData",SitePlanData).subscribe(data => {
this.saveNum.push("1")
if(this.saveNum.length == 5){
this.maskLayerService.sendMessage(false)
this.canvasData.isChange = false
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
@ -573,6 +575,7 @@ export class CollectionToolsComponent implements OnInit {
this.http.post("/api/CompanyAccount/CompanyData",CompanyData).subscribe(data => {
this.saveNum.push("1")
if(this.saveNum.length == 5){
this.maskLayerService.sendMessage(false)
this.canvasData.isChange = false
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
@ -592,6 +595,7 @@ export class CollectionToolsComponent implements OnInit {
this.http.post("/api/CompanyAccount/CompanyAdjoins/Batch",CompanyAdjoins).subscribe(data => {
this.saveNum.push("1")
if(this.saveNum.length == 5){
this.maskLayerService.sendMessage(false)
this.canvasData.isChange = false
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
@ -611,6 +615,7 @@ export class CollectionToolsComponent implements OnInit {
this.http.post("/api/CompanyAccount/CompanyImportantLocations/Batch",CompanyImportantLocations).subscribe(data => {
this.saveNum.push("1")
if(this.saveNum.length == 5){
this.maskLayerService.sendMessage(false)
this.canvasData.isChange = false
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
@ -630,6 +635,7 @@ export class CollectionToolsComponent implements OnInit {
this.http.post("/api/CompanyAccount/CompanyFacilityAssets/Batch",CompanyFacilityAssets).subscribe(data => {
this.saveNum.push("1")
if(this.saveNum.length == 5){
this.maskLayerService.sendMessage(false)
this.canvasData.isChange = false
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
@ -650,6 +656,7 @@ export class CollectionToolsComponent implements OnInit {
this.http.post("/api/CompanyAccount/BuildingAreaData",SitePlanData).subscribe(data => {
this.saveNum.push("1")
if(this.saveNum.length == 5){
this.maskLayerService.sendMessage(false)
this.canvasData.isChange = false
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
@ -668,6 +675,7 @@ export class CollectionToolsComponent implements OnInit {
this.http.post("/api/CompanyAccount/BuildingData",CompanyData).subscribe(data => {
this.saveNum.push("1")
if(this.saveNum.length == 5){
this.maskLayerService.sendMessage(false)
this.canvasData.isChange = false
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
@ -687,6 +695,7 @@ export class CollectionToolsComponent implements OnInit {
this.http.post(`/api/CompanyAccount/BuildingAdjoins/Batch?buildingId=${this.canvasData.selectStorey.buildingId}`,buildingAdjoins).subscribe(data => {
this.saveNum.push("1")
if(this.saveNum.length == 5){
this.maskLayerService.sendMessage(false)
this.canvasData.isChange = false
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
@ -706,6 +715,7 @@ export class CollectionToolsComponent implements OnInit {
this.http.post(`/api/CompanyAccount/BuildingImportantLocations/Batch?buildingId=${this.canvasData.selectStorey.buildingId}`,buildingImportantLocations).subscribe(data => {
this.saveNum.push("1")
if(this.saveNum.length == 5){
this.maskLayerService.sendMessage(false)
this.canvasData.isChange = false
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
@ -725,6 +735,7 @@ export class CollectionToolsComponent implements OnInit {
this.http.post(`/api/CompanyAccount/BuildingFacilityAssets/Batch?buildingId=${this.canvasData.selectStorey.buildingId}`,buildingFacilityAssets).subscribe(data => {
this.saveNum.push("1")
if(this.saveNum.length == 5){
this.maskLayerService.sendMessage(false)
this.canvasData.isChange = false
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';

1
src/app/ui/ui.component.html

@ -1 +0,0 @@
<p>ui works!</p>
Loading…
Cancel
Save