徐振升 5 years ago
parent
commit
66e94f64b6
  1. 38
      src/app/ui/collection-tools/addPlaneFigure.html
  2. 80
      src/app/ui/collection-tools/collection-tools.component.html
  3. 38
      src/app/ui/collection-tools/collection-tools.component.scss
  4. 359
      src/app/ui/collection-tools/collection-tools.component.ts
  5. 39
      src/app/ui/collection-tools/editPlaneFigure.html
  6. 73
      src/app/ui/collection-tools/leftFunctionalDomain.ts
  7. 85
      src/app/ui/collection-tools/panel.scss
  8. 14
      src/app/ui/collection-tools/viewdetails.html
  9. 5
      src/app/ui/ui.module.ts
  10. 1
      src/index.html

38
src/app/ui/collection-tools/addPlaneFigure.html

@ -0,0 +1,38 @@
<div class="functionalDomainContent">
<div mat-dialog-title>
<label *ngIf="!data.isBuilding">新建平面图</label>
<label *ngIf="data.isBuilding">新建楼层/区域</label>
</div>
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm" class="example-container">
<div class="keyMargin">
<mat-form-field>
<input matInput name="name" required ngModel placeholder="名称">
</mat-form-field>
</div>
<div class="keyMargin" *ngIf="data.isBuilding">
<mat-checkbox name="isRefugeStorey" [(ngModel)]="checked">是否为避难层</mat-checkbox>
</div>
<div class="keyMargin">
<mat-form-field>
<input matInput name="area" type="number" required ngModel placeholder="面积 (平方米)">
</mat-form-field>
</div>
<div class="keyMargin">
<textarea name="details" required ngModel placeholder="详情"></textarea>
</div>
<div class="submitBottom">
<button mat-raised-button color="primary" type="submit" [disabled]="!form.form.valid">
确定
</button>
<button mat-raised-button mat-dialog-close>取消</button>
</div>
</form>
</div>

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

@ -40,12 +40,12 @@
<!-- 头部操作栏 -->
<div class="headerOperate">
<button mat-button (click)="checkedBuilding({name:'总平面图'})"
[ngClass]="{'buildingbtnchecked': '总平面图' == checkedBuildingDate}">
<button mat-button (click)="checkedBuilding({name:'总平面图'},-1)"
[ngClass]="{'buildingbtnchecked': checkedBuildingIndex==-1}">
<span>总平面图</span>
</button>
<button mat-button *ngFor="let item of allBuildings" (click)="checkedBuilding(item)" class="bigeditdeletebtn"
[ngClass]="{'buildingbtnchecked': item.name == checkedBuildingDate}">
<button mat-button *ngFor="let item of allBuildings;let key = index" (click)="checkedBuilding(item,key)" class="bigeditdeletebtn"
[ngClass]="{'buildingbtnchecked': checkedBuildingIndex==key}">
<span>{{item.name}}</span>
<span class="editdeletebtn">
<mat-icon (click)="editBuilding($event,item)"
@ -63,8 +63,8 @@
<div class="functionalDomain">
<div class='functionalDomainContent'>
<!-- H5Canvas -->
<app-working-area></app-working-area>
<!-- H5Canvas -->
<app-working-area></app-working-area>
<!-- H5Canvas -->
<div class='functionalDomainLeft publicCss' [ngClass]="{'togglePanel': toggleExpandPanel==true}">
@ -80,17 +80,24 @@
</div>
<div [hidden]="!togglePlane">
<div class="sitePlanContent" *ngFor="let item of sitePlanData;let key = index"
[ngClass]="{'selectSitePlan': selectSitePlanIndex==key}" (click)='selectSitePlan(item,key)'>
[ngClass]="{'isRefugeStorey':item.isRefugeStorey==true,'selectSitePlan': selectSitePlanIndex==key}" (click)='selectSitePlan(item,key)'>
<mat-icon *ngIf="!item.imageUrl" class="matIcons">broken_image</mat-icon>
<label class="overflowText">{{item.name}}</label>
<mat-icon title="替换底图" class="matIcons replaceBaseMap" *ngIf="selectSitePlanIndex==key">photo_size_select_actual</mat-icon>
<a href="javascript:;" class="a-upload" *ngIf="selectSitePlanIndex==key" title="替换底图" >
<input type="file" (change)='replaceBaseMap($event,item)'>
<mat-icon class="matIcons">photo_size_select_actual</mat-icon>
</a>
<a href="javascript:;" id="a-uploadImg" *ngIf="selectSitePlanIndex==key && !item.imageUrl" title="上传底图" >
<input type="file" (change)='replaceBaseMap($event,item)'>
<img src="../../../assets/images/upload.jpg">
</a>
<!-- 右边定位操作栏 -->
<div id="rightOperate" *ngIf="selectSitePlanIndex==key">
<div id="rightOperate" *ngIf="selectSitePlanIndex==key && item.imageUrl" (click)="$event.stopPropagation();">
<p class="functionButton">
<mat-icon class="functionIcon bigFunctionIcon" title="上移">keyboard_arrow_up</mat-icon>
</p>
<p class="functionButton">
<mat-icon class="functionIcon" title="编辑属性">edit</mat-icon>
<mat-icon class="functionIcon" title="编辑属性" (click)='editPlaneData(item)'>edit</mat-icon>
<mat-icon class="functionIcon" title="删除">delete</mat-icon>
</p>
<p class="functionButton">
@ -155,22 +162,56 @@
</div>
<!-- 素材属性 -->
<div class="assetsproperty">
<h3 style="text-align: center;font-weight: 900;">实景照片</h3>
<h3 style="text-align: center;font-weight: 900;">{{assetName}}</h3>
<p>宽度(像素)</p>
<input type="text" class="biginput">
<input type="text" class="biginput" [(ngModel)]="assetWidth" (input)="assetWidthIunput()">
<p>高度(像素)</p>
<input type="text" class="biginput">
<input type="text" class="biginput" [(ngModel)]="assetHeight" (input)="assetHeightIunput()">
<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;">
oninput="if(value>360)value=360;if(value<0)value=0;" (input)="assetAngleIunput()">
<mat-slider color="primary" min="0" max="360" step="1" style="bottom: 12px;left: 2px;width: 70%;"
[(ngModel)]="sliderValue"></mat-slider>
[(ngModel)]="sliderValue" (change)="assetAngleIunput()"></mat-slider>
</div>
<p>是否高亮</p>
<p style="margin-top: 4px;margin-bottom: 0px;">是否高亮</p>
<div>
<input type="checkbox"
style="width: 20px;height: 20px;vertical-align: middle;margin-left: 8px;"><span>选中高亮</span>
<input [(ngModel)]="isHighLight" type="checkbox" style="width: 18px;height: 18px;vertical-align: middle;margin-left: 9px;margin-right: 3px;">
<span style="font-size: 14px;">选中高亮</span>
</div>
<div *ngFor="let item of PropertyInfos;index as key ">
<!-- 单行文本 -->
<div *ngIf="item.PropertyType == 0">
<p>{{item.PropertyName}}</p>
<input type="text" class="biginput" [value]="item.PropertyValue">
</div>
<!-- 多行文本 -->
<div *ngIf="item.PropertyType == 1">
<p>{{item.PropertyName}}</p>
<textarea class="textarea" name="" id="" [value]="item.PropertyValue"></textarea>
</div>
<!-- 数值 -->
<div *ngIf="item.PropertyType == 2">
<p>{{item.PropertyName}}</p>
<input type="number" class="biginput" [value]="item.PropertyValue">
</div>
<!-- 图片数量 -->
<div *ngIf="item.PropertyType == 4">
<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 type="file" style="width: 33%;position: absolute;right: 10px;top: 1px;opacity: 0;z-index: 100;cursor: pointer;">
<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;">添加</div>
</div>
<div style="position: relative;;width: 89%;border:1px solid rgb(208, 211, 214);height: 100px;margin: 6px auto;" class="swiper-container">
<div class="swiper-wrapper">
<div class="swiper-slide" style="text-align: center;" *ngFor="let img of imagesArr"><img (click)="lookImg()" [src]="img.PropertyValue + '?x-oss-process=image/resize,m_fixed,h_100,w_100'" alt=""></div>
</div>
<!-- 如果需要导航按钮 -->
<div class="swiper-button-next"></div>
<div class="swiper-button-prev"></div>
</div>
</div>
</div>
</div>
@ -182,6 +223,9 @@
<span style="user-select: none">消防要素</span>
</div>
</div>
<div class="firecategoriesTree">
<!-- 消防列表树写在这里 -->
</div>
</div>
</div>

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

@ -111,6 +111,7 @@
//右边操作栏
.title{
width: 100%;
height: 35px;
background-color: #464646;
div{
@ -129,8 +130,10 @@
}
//右侧属性
.property{
display: flex;
flex-flow: column;
.siteproperty{
height: 100%;
p{
@ -154,10 +157,12 @@
}
}
.assetsproperty{
overflow-y: auto;
height: 100%;
p{
color: #9c9fa5;
margin:1px 0 3px 8px;
font-size: 14px;
}
input{
height: 18px;
@ -172,5 +177,36 @@
width: 19%;
margin-left: 8px;
}
.textarea{
display: block;
width: 88%;
height: 50px;
margin: 0 auto;
}
.swiper-button-next{
right: 6px;
}
.swiper-button-next:after{
font-size: 20px;
}
.swiper-button-prev{
left: 6px;
}
.swiper-button-prev:after{
font-size: 20px;
}
}
}
//右侧消防要素
.firecategories{
display: flex;
flex-flow: column;
.firecategoriesTree{
overflow-y: auto;
height: 100%;
}
}
div:focus {
outline: none;
}

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

@ -2,6 +2,10 @@ import { Component, OnInit, Inject } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
import {leftFunctionalDomainComponent,editPlaneFigureComponent} from './leftFunctionalDomain'
import Swiper from 'swiper';
@Component({
selector: 'app-collection-tools',
@ -11,19 +15,182 @@ import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
export class CollectionToolsComponent implements OnInit {
constructor(private http:HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar) { }
selected = 'option1' //图标大小选择框
basicInfo:boolean = true //基本信息名称显隐
wantToWork:boolean = true //想定作业名称显隐
allBuildings //该单位所有建筑
checkedBuildingDate //当前点击选择的建筑
beforeOneCheckedBuilding:any = {name:"总平面图"}; //当前点击选择的建筑
checkedBuildingIndex:number = -1 //当前点击选择的建筑index
isEditPat:boolean = true //当前是否是编辑模式
sliderValue:String = "30"//滑竿的值
proObject = {
"Id": "6856647621407145995",
"Name": "实景照片",
"Angle": 104.0,
"Color": "#FFFFFFFF",
"Point": {
"x": -45.2675133,
"y": 26.3694324
},
"Width": 66,
"Border": {
"w": 0.0,
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"Height": 66,
"Enabled": true,
"FloorId": "5e902b399f45957cf4387616",
"DrawMode": 0,
"FillMode": 1,
"GameMode": 0,
"ImageUrl": "/api/Objects/PlanPlatform/5e7c13e9bb3cf106508afafc.png",
"CompanyId": null,
"FixedSize": true,
"FloorName": null,
"Thickness": 0,
"BuildingId": null,
"MultiPoint": null,
"TemplateId": "5e7c13ef61550e2754d461c8",
"FireElementId": "5e796f040814180f1c1ecaf5",
"PropertyInfos": [{
"Tag": "",
"Order": 0,
"Enabled": true,
"Visible": true,
"Required": false,
"RuleName": "",
"RuleValue": "",
"PhysicalUnit": "",
"PropertyName": "名称/编号",
"PropertyType": 0,
"PropertyValue": "99999"
}, {
"Tag": "",
"Order": 0,
"Enabled": true,
"Visible": true,
"Required": false,
"RuleName": "",
"RuleValue": "",
"PhysicalUnit": "张",
"PropertyName": "图片",
"PropertyType": 4,
"PropertyValue": "5"
}, {
"Tag": null,
"Order": 0,
"Enabled": false,
"Visible": false,
"Required": false,
"RuleName": null,
"RuleValue": null,
"PhysicalUnit": null,
"PropertyName": "图片",
"PropertyType": 3,
"PropertyValue": "/api/Objects/WebPlan2D/5e8ed394aaca5f7c102530ad/5f27b4c15ba53b1bc0ae312e.png"
}, {
"Tag": null,
"Order": 0,
"Enabled": false,
"Visible": false,
"Required": false,
"RuleName": null,
"RuleValue": null,
"PhysicalUnit": null,
"PropertyName": "图片",
"PropertyType": 3,
"PropertyValue": "/api/Objects/PlanPlatform/5e7c0ff1bb3cf106508afaed.png"
}],
"IsFromBuilding": false,
"InteractiveMode": 0
}
assetName:String//素材名称
assetWidth:number//素材宽度
assetHeight:number//素材高度
sliderValue:number = 0//滑竿的值
isHighLight:boolean = false//是否高亮选择框
PropertyInfos = [] //去除图片链接真正用于循环的内容
imagesArr = [] //属性中的图片链接集合
clickedIndex //点击图片的索引值
//传入素材对象,设置右侧属性栏内容
setAssetsProperty(obj){
let _this = this
this.assetName = obj.Name
this.assetWidth = obj.Width
this.assetHeight = obj.Height
this.sliderValue = obj.Angle
obj.PropertyInfos.forEach(item => {
if(item.PropertyType == 3){ //如果是图片链接类型
this.imagesArr.push(item)
}else{
this.PropertyInfos.push(item)
}
})
//如果存在图片则加载轮播图
if(this.imagesArr.length){
setTimeout(() => {
var mySwiper = new Swiper('.swiper-container',{
loop: false,
grabCursor: true,
// 如果需要前进后退按钮
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
},
on:{
click: function(){
_this.clickedIndex = this.clickedIndex
},
}
});
}, 0);
}
}
//素材宽度输入框改变
assetWidthIunput(){
this.proObject.Width = this.assetWidth
}
//素材高度输入框改变
assetHeightIunput(){
this.proObject.Height = this.assetHeight
}
//素材角度输入框改变
assetAngleIunput(){
this.proObject.Angle = this.sliderValue
}
//素材是否高亮改变
assetHighLightIunput(){
}
//查看图片详情
lookImg(){
const dialogRef = this.dialog.open(ViewDetails, {//调用open方法打开对话框并且携带参数过去
data: {imagesArr:this.imagesArr,index:this.clickedIndex}
});
}
ngOnInit(): void {
this.getAllLibrary()
this.getSitePlan()
this.checkedBuildingDate = "总平面图"
this.getAllBuildings()
this.setAssetsProperty(this.proObject) //测试
}
//点击基本信息名称
basicInfoClick(){
this.basicInfo = !this.basicInfo
@ -78,8 +245,16 @@ export class CollectionToolsComponent implements OnInit {
});
}
//选择建筑
checkedBuilding(item){
this.checkedBuildingDate = item.name
checkedBuilding(item,index){
if (this.checkedBuildingIndex!=index) {
this.beforeOneCheckedBuilding = item
this.checkedBuildingIndex = index
if (index==-1) { //总平面图数据
this.getSitePlan()
} else { //建筑楼层/区域数据
this.getBuildingSitePlan(item)
}
}
}
//编辑建筑
editBuilding(e,item){
@ -109,7 +284,12 @@ export class CollectionToolsComponent implements OnInit {
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('删除成功','确定',config);
this.getAllBuildings()
this.http.get("/api/CompanyAccount/Buildings").subscribe(data=>{
this.allBuildings = data
this.beforeOneCheckedBuilding = {name:"总平面图"}
this.checkedBuildingIndex = -1
this.getSitePlan()
})
},err=>{
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
@ -121,7 +301,6 @@ export class CollectionToolsComponent implements OnInit {
}
//陈鹏飞↓↓↓
//陈鹏飞↓↓↓
//陈鹏飞↓↓↓
@ -142,30 +321,132 @@ export class CollectionToolsComponent implements OnInit {
this.toggleMaterialBank = !this.toggleMaterialBank
}
sitePlanData:any = []; //总平面图数据
selectingSitePlan:any; //选中的平面图
selectSitePlanIndex:number; //选中的平面图index
sitePlanData:any = []; //总平面图 楼层/区域 数据
selectingSitePlan:any; //选中的 平面图 楼层/区域
selectSitePlanIndex:number; //选中的 平面图 楼层/区域 index
//获取总平面图
getSitePlan () {
this.http.get('/api/CompanyAccount/SitePlans').subscribe(data=>{
this.sitePlanData = data
if (this.sitePlanData.length) { //数据不为空时
this.selectingSitePlan = this.sitePlanData[0]
this.selectSitePlanIndex = 0
}
this.selectingSitePlan = this.sitePlanData[0] || ''
this.selectSitePlanIndex = 0
})
}
//新增平面图
//获取建筑 楼层/区域
getBuildingSitePlan (item) {
let params = {
buildingId: item.id
}
this.http.get('/api/CompanyAccount/BuildingAreas',{params}).subscribe(data=>{
this.sitePlanData = data
this.selectingSitePlan = this.sitePlanData[0] || ''
this.selectSitePlanIndex = 0
})
}
//新增平面图 楼层/区域
foundPanel (e) {
e.stopPropagation()
let data = {
isBuilding: this.checkedBuildingIndex==-1? false:true,
Panel: this.beforeOneCheckedBuilding,
order: this.sitePlanData.length? this.sitePlanData[this.sitePlanData.length-1].order+1:0,
}
let dialogRef = this.dialog.open(leftFunctionalDomainComponent,{data});
dialogRef.afterClosed().subscribe(data=>{
if (data =='总平面图') {
this.renovateLeftMenu(-1,this.beforeOneCheckedBuilding)
} else if (data =='建筑') {
this.renovateLeftMenu(0,this.beforeOneCheckedBuilding)
}
})
}
//点击选中平面图时
//编辑平面图 楼层/区域
editPlaneData (e) {
console.log(e)
let dialogRef = this.dialog.open(editPlaneFigureComponent);
}
//封装 统一刷新 左侧菜单栏数据
renovateLeftMenu (index,item) {
if (index==-1) { //总平面图数据
this.getSitePlan()
} else { //建筑楼层/区域数据
this.getBuildingSitePlan(item)
}
}
//点击选中 平面图 楼层/区域 时
selectSitePlan (item,index) {
this.selectingSitePlan = item
this.selectSitePlanIndex = index
if (this.selectSitePlanIndex != index) {
this.selectingSitePlan = item
this.selectSitePlanIndex = index
}
}
//平面图 楼层/区域 替换底图
replaceBaseMap (e,item) {
e.stopPropagation();
let file = e.target.files[0] || null //获取上传的文件
let fileSize = file.size || null //上传文件的总大小
let maxSize = 5 * 1024 * 1024 //5MB一个分片
if (file && fileSize<=maxSize) { //上传文件<=5MB时
let formData = new FormData()
formData.append("file",file)
this.http.post(`/api/Objects/WebPlan2D/${sessionStorage.getItem('companyId')}`,formData).subscribe((data:any)=>{
this.renovateBaseMap(data.objectName,item)
})
} else {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('上传底图需小于5MB','确定',config);
}
}
//封装 替换底图 function
renovateBaseMap (e,item) {
item.imageUrl = '/api/Objects/WebPlan2D/' + e
if (this.checkedBuildingIndex ==-1) { //总平面图
this.http.put(`/api/CompanyAccount/SitePlans/${item.id}`,item).subscribe(data=>{
this.renovateSitePlan()
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('上传底图成功','确定',config);
})
} else { //楼层/区域
this.http.put(`/api/CompanyAccount/BuildingAreas/${item.id}`,item).subscribe(data=>{
this.renovateBuilding()
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('上传底图成功','确定',config);
})
}
}
//封装 刷新总平面图 数据
renovateSitePlan () {
this.http.get('/api/CompanyAccount/SitePlans').subscribe(data=>{
this.sitePlanData = data
this.selectingSitePlan = this.sitePlanData[this.selectSitePlanIndex]
})
}
//封装 刷新 楼层/区域 数据
renovateBuilding () {
let params = {
buildingId: this.beforeOneCheckedBuilding.id
}
this.http.get('/api/CompanyAccount/BuildingAreas',{params}).subscribe(data=>{
this.sitePlanData = data
this.selectingSitePlan = this.sitePlanData[this.selectSitePlanIndex]
})
}
allLibrary:any = []; //所有素材库 + 素材
@ -187,9 +468,6 @@ export class CollectionToolsComponent implements OnInit {
opened (e) {
if (!e.images.length) { //当前素材库没加载素材时
this.http.get(`/api/Assets?libraryId=${e.id}`).subscribe((data:any)=>{
data.forEach(element => {
element.imageUrl = element.imageUrl + '?x-oss-process=image/auto-orient,1' //压缩图片
});
e.images = data
})
}
@ -201,7 +479,7 @@ export class CollectionToolsComponent implements OnInit {
this.selectImage = items
this.selectImageIndex = index
}
}
@ -306,4 +584,41 @@ export class EditBuilding {
this.dialogRef.close("修改失败");
})
}
}
//查看图片大图
//查看图片大图和视频
@Component({
selector: 'viewdetails',
templateUrl: './viewdetails.html',
styleUrls: ['./collection-tools.component.scss']
})
export class ViewDetails {
// myControl = new FormControl();
//注入MatDialogRef,可以用来关闭对话框
//要访问对话框组件中的数据,必须使用MAT_DIALOG_DATA注入令牌
constructor(private http: HttpClient,public dialogRef: MatDialogRef<ViewDetails>,@Inject(MAT_DIALOG_DATA) public data) {}
imagesArr = this.data.imagesArr
onNoClick(): void {
this.dialogRef.close();
}
ngOnInit(): void {
setTimeout(() => {
var mySwiper = new Swiper('.swiper-container',{
loop: false,
grabCursor: true,
initialSlide :this.data.index,//默认索引
// 如果需要前进后退按钮
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
}
//其他设置
});
}, 0);
}
closeDialog(){
this.dialogRef.close();
}
}

39
src/app/ui/collection-tools/editPlaneFigure.html

@ -0,0 +1,39 @@
<div class="functionalDomainContent">
1
<!-- <div mat-dialog-title>
<label *ngIf="!data.isBuilding">编辑平面图</label>
<label *ngIf="data.isBuilding">编辑楼层/区域</label>
</div>
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm" class="example-container">
<div class="keyMargin">
<mat-form-field>
<input matInput name="name" required ngModel placeholder="名称">
</mat-form-field>
</div>
<div class="keyMargin" *ngIf="data.isBuilding">
<mat-checkbox name="isRefugeStorey" [(ngModel)]="checked">是否为避难层</mat-checkbox>
</div>
<div class="keyMargin">
<mat-form-field>
<input matInput name="area" type="number" required ngModel placeholder="面积 (平方米)">
</mat-form-field>
</div>
<div class="keyMargin">
<textarea name="details" required ngModel placeholder="详情"></textarea>
</div>
<div class="submitBottom">
<button mat-raised-button color="primary" type="submit" [disabled]="!form.form.valid">
确定
</button>
<button mat-raised-button mat-dialog-close>取消</button>
</div>
</form> -->
</div>

73
src/app/ui/collection-tools/leftFunctionalDomain.ts

@ -0,0 +1,73 @@
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';
@Component({
selector: 'app-leftFunctionalDomain',
templateUrl: './addPlaneFigure.html',
styleUrls: ['./panel.scss']
})
export class leftFunctionalDomainComponent implements OnInit {
constructor(private http:HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,public dialogRef: MatDialogRef<any>,@Inject(MAT_DIALOG_DATA) public data) { }
ngOnInit(): void {
}
checked:boolean = false;//是否为避难层
//提交表单创建平面图
onSubmit (e) {
if (!this.data.isBuilding) { //总平面图 创建平面图
let data = {
companyId: sessionStorage.getItem('companyId'),
name: e.name,
order: this.data.order,
area:e.area,
details:e.details,
enabled: true,
modifiedTime: new Date(),
}
this.http.post('/api/CompanyAccount/SitePlans',data).subscribe(data=>{
this.dialogRef.close('总平面图');
})
} else { //建筑 创建楼层/区域
let data = {
isRefugeStorey: e.isRefugeStorey,
buildingId: this.data.Panel.id,
name: e.name,
order: this.data.order,
area:e.area,
details:e.details,
enabled: true,
modifiedTime: new Date(),
}
this.http.post('/api/CompanyAccount/BuildingAreas',data).subscribe(data=>{
this.dialogRef.close('建筑');
})
}
}
}
//编辑平面图 楼层/区域
@Component({
selector: 'app-editPlaneFigure',
templateUrl: './editPlaneFigure.html',
styleUrls: ['./panel.scss']
})
export class editPlaneFigureComponent implements OnInit {
constructor(private http:HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,public dialogRef: MatDialogRef<any>,@Inject(MAT_DIALOG_DATA) public data) { }
ngOnInit(): void {
}
}

85
src/app/ui/collection-tools/panel.scss

@ -45,13 +45,61 @@
font-size: 20px;
}
}
.replaceBaseMap {
//替换底图 inputfile
.a-upload {
display: block;
float: right;
margin-top: 8px;
margin: 8px 5px 0 0;
width: 20px;
height: 20px;
line-height: 20px;
text-align: center;
position: relative;
overflow: hidden;
input {
position: absolute;
width: 20px;
height: 20px;
left: 0;
top: 0;
opacity: 0;
}
}
.replaceBaseMap:hover {
color: #fff;
.a-upload:hover {
.mat-icon {
color: #fff;
}
}
//上传底图 inputfile
#a-uploadImg {
display: block;
width: 300px;
height: 170px;
position: fixed;
top: 40%;
left: 48%;
overflow: hidden;
border-radius: 5px;
border: 1px solid #999;
z-index: 999;
input {
position: absolute;
width: 300px;
height: 170px;
left: 0;
top: 0;
opacity: 0;
}
img {
width: 100%;
height: auto;
}
}
#a-uploadImg:hover {
border: 5px solid skyblue;
}
//hover时显示右边操作栏
.sitePlanContent:hover {
#rightOperate {
@ -125,6 +173,11 @@
text-overflow:ellipsis;
white-space: nowrap;
}
// 楼层/区域 是避难层时
.isRefugeStorey {
color: #fff;
background-color: rgb(238, 186, 186);
}
//选中平面图时
.selectSitePlan {
color: #fff;
@ -135,3 +188,27 @@
color: #fff;
background-color: #4DA5FA;
}
//左侧功能区弹出框样式
.keyMargin {
margin: 5px 0;
}
.submitBottom {
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: space-between; /* 水平居中 */
}
.functionalDomainContent {
width: 100%;
height: 100%;
textarea {
border-radius: 5px;
border: 1px solid #999;
width: 180px;
height: 120px;
resize:none;
}
}

14
src/app/ui/collection-tools/viewdetails.html

@ -0,0 +1,14 @@
<div style="position: relative;width: 1400px;height: 800px;line-height: 800px;" class="swiper-container">
<div style="position: absolute;right: -2px;top: -392px;cursor: pointer;z-index: 999;width: 24px;height: 24px;" (click)="closeDialog()">
<span><mat-icon>clear</mat-icon></span>
</div>
<div class="swiper-wrapper">
<div class="swiper-slide" style="text-align: center;" *ngFor="let img of imagesArr">
<img style="max-width: 96%;max-height: 100%;" [src]="img.PropertyValue" alt="">
</div>
</div>
<!-- 如果需要导航按钮 -->
<div class="swiper-button-next"></div>
<div class="swiper-button-prev"></div>
</div>

5
src/app/ui/ui.module.ts

@ -95,11 +95,12 @@ import { ImgsDataDetail } from './fire-fighting-device/addGrouping.component';
import { KeySiteImgs } from './key-site/keysiteimgs.component';
import { KeyImgDetail } from './key-site/keyimgdetail.component';
import { LookMaster } from './basicinfo/lookmaster.component';
import { CollectionToolsComponent, CreateBuilding, EditBuilding } from './collection-tools/collection-tools.component';
import { CollectionToolsComponent, CreateBuilding, EditBuilding, ViewDetails } from './collection-tools/collection-tools.component';
import { WorkingAreaComponent } from '../working-area/working-area.component';
import {leftFunctionalDomainComponent,editPlaneFigureComponent} from './collection-tools/leftFunctionalDomain'
@NgModule({
declarations: [UiComponent, CardComponent, StepperComponent, TabgroupComponent, ProgressComponent, SnackbarComponent, PersonaldataComponent, UserdataComponent, ChangepasswordComponent, OrganizationComponent, UnittypeComponent, AuthorityComponent, RoleComponent, UsermanagementComponent, IsnoPipe, ConfirmpswDirective, DialogOverviewExampleDialog, CreateAuthority, CreateRole, EditRole, TimePipe, CreateNewUser, EditNewUser, allRoles, SharePower, CreateOrganization, EditOrganization, seeInformation, EditUser, editorialUnit, FireProtectionElementsComponent, Establish, EditingFireControl, FireFightingTemplateComponent, NavmenusComponent, CreateMenus, EditMenus, NewFireFighting, EditFireClassification, MaterialBankComponent, UnitInformationComponent, AddMatLibrary, EditMatLibrary, attributeComponent, AddOriginalCopy, addAttributeComponent, editAttribute, EditOriginalCopy, SelectOriginalCopy, EditUnitInfo, AddUnitInfo, AddGroups, EditGroup, BasicinfoComponent, PlanComponent, AllaroundComponent, FireFightingDeviceComponent, KeySiteComponent, FunctionDivisionComponent, RealisticPictureComponent, UploadingCADComponent, AddHouseInfo, ImgDetails, ImagesData, ImgsDataDetail, KeySiteImgs, KeyImgDetail, addPartition, addPartitionAttribute, previewImg, addRealPicture, editRealPicture, readFile, editFile, LookMaster, previewBigImg, CollectionToolsComponent, WorkingAreaComponent,CreateBuilding,EditBuilding
declarations: [UiComponent, CardComponent, StepperComponent, TabgroupComponent, ProgressComponent, SnackbarComponent, PersonaldataComponent, UserdataComponent, ChangepasswordComponent, OrganizationComponent, UnittypeComponent, AuthorityComponent, RoleComponent, UsermanagementComponent, IsnoPipe, ConfirmpswDirective, DialogOverviewExampleDialog, CreateAuthority, CreateRole, EditRole, TimePipe, CreateNewUser, EditNewUser, allRoles, SharePower, CreateOrganization, EditOrganization, seeInformation, EditUser, editorialUnit, FireProtectionElementsComponent, Establish, EditingFireControl, FireFightingTemplateComponent, NavmenusComponent, CreateMenus, EditMenus, NewFireFighting, EditFireClassification, MaterialBankComponent, UnitInformationComponent, AddMatLibrary, EditMatLibrary, attributeComponent, AddOriginalCopy, addAttributeComponent, editAttribute, EditOriginalCopy, SelectOriginalCopy, EditUnitInfo, AddUnitInfo, AddGroups, EditGroup, BasicinfoComponent, PlanComponent, AllaroundComponent, FireFightingDeviceComponent, KeySiteComponent, FunctionDivisionComponent, RealisticPictureComponent, UploadingCADComponent, AddHouseInfo, ImgDetails, ImagesData, ImgsDataDetail, KeySiteImgs, KeyImgDetail, addPartition, addPartitionAttribute, previewImg, addRealPicture, editRealPicture, readFile, editFile, LookMaster, previewBigImg, CollectionToolsComponent, WorkingAreaComponent,CreateBuilding,EditBuilding,leftFunctionalDomainComponent,editPlaneFigureComponent,ViewDetails
],
imports: [

1
src/index.html

@ -6,7 +6,6 @@
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
<!-- <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> -->
<link href='./assets/icon/material-icons.css' rel="stylesheet">
</head>
<body>

Loading…
Cancel
Save