Browse Source

[新增]在线输入网址app开头启动本地程序;完善重点图示

tangshan
邵佳豪 4 years ago
parent
commit
46a6b15857
  1. 36
      src/app/gis-management/realistic-picture-look/realistic-picture.component.html
  2. 142
      src/app/plan-management/create-plan-online-five/create-plan-online-five.component.html
  3. 130
      src/app/plan-management/create-plan-online-five/create-plan-online-five.component.scss
  4. 201
      src/app/plan-management/create-plan-online-five/create-plan-online-five.component.ts
  5. 3
      src/app/plan-management/create-plan-online-five/openPlanTool.html
  6. 16
      src/app/plan-management/create-plan-online-five/openPlanTool.scss
  7. 41
      src/app/plan-management/entry-plan-look/entry-plan-look.component.html
  8. 118
      src/app/plan-management/entry-plan-look/entry-plan-look.component.ts
  9. 9
      src/app/plan-management/plan-management.module.ts
  10. 7
      src/app/ui/collection-tools-plan/collection-tools.component.ts

36
src/app/gis-management/realistic-picture-look/realistic-picture.component.html

@ -7,26 +7,28 @@
* @LastEditTime: 2020-11-27 16:19:50
-->
<div class="content" id="realisticpicture">
<mat-accordion class="tableContent" >
<mat-expansion-panel *ngFor="let item of allRealPicture,let key=index" (opened)="changeReal(item,key)">
<mat-expansion-panel-header class="panelhead" collapsedHeight ='40px' expandedHeight='40px'>
<mat-panel-title style="font-size: 14px;" >
<mat-accordion class="tableContent">
<mat-expansion-panel *ngFor="let item of allRealPicture,let key=index" (opened)="changeReal(item,key)">
<mat-expansion-panel-header class="panelhead" collapsedHeight='40px' expandedHeight='40px'>
<mat-panel-title style="font-size: 14px;">
{{item.name}}
</mat-panel-title>
</mat-expansion-panel-header >
<div class="colum" >
<div class="imghe" *ngFor="let items of allImages;let key = index">
<div *ngIf="allImages.length!=0"><img [src]="items.newImageUrl" (click)='operation(items,key)' [ngClass]="{'selectImg': items.checked}"></div>
<label style="margin-left: 6%;"><input type="text" style="margin-left: 6px;" [(ngModel)]="items.nameStart" readonly></label>
</div>
<div class="zanwu" *ngIf="allImages.length==0">
<span>暂无数据</span>
</mat-expansion-panel-header>
<div class="colum">
<div class="imghe" *ngFor="let items of allImages;let key = index">
<div *ngIf="allImages.length!=0"><img [src]="items.newImageUrl" (click)='operation(items,key)'
[ngClass]="{'selectImg': items.checked}"></div>
<label style="margin-left: 6%;"><input type="text" style="margin-left: 6px;" [(ngModel)]="items.nameStart"
readonly></label>
</div>
<div class="zanwu" *ngIf="allImages.length==0">
<span>暂无数据</span>
</div>
</div>
</mat-expansion-panel>
</mat-accordion>
</div>
</div>

142
src/app/plan-management/create-plan-online-five/create-plan-online-five.component.html

@ -20,7 +20,96 @@
</div>
<div class="contentbox">
<div class="leftbox">
<div *ngIf="selectedItem == '重点图示'" class="leftKeyImg">
<div class="keyImgTitle">
重点图示
</div>
<div class="planlist" id="planlist">
<!-- 总平面图 -->
<div style="margin: 10px 0;">
<mat-accordion>
<mat-expansion-panel expanded style="box-shadow: 0 0 black;border: 1px solid #EEF1F5;">
<mat-expansion-panel-header collapsedHeight='33px' expandedHeight='33px'
style="position: relative;padding-left:20px;background: #F2F9FF;">
<mat-panel-title>
总平面图
</mat-panel-title>
</mat-expansion-panel-header>
<div class="content">
<div class="contentitem" *ngFor="let item of sitePlanItems">
<div>
<img (click)="openPlan(item,-1)"
[src]="item.imageUrl ? item.imageUrl+'?x-oss-process=image/resize,m_fill,h_100,w_100' : '../../../assets/images/noImg.png'"
alt="">
</div>
<p>{{item.name}}</p>
</div>
</div>
</mat-expansion-panel>
</mat-accordion>
</div>
<!-- 建筑平面图 -->
<div>
<div *ngFor="let item of allBuildings;let key=index" style="margin-bottom: 10px;">
<mat-accordion>
<mat-expansion-panel style="box-shadow: 0 0 black;border: 1px solid #EEF1F5;">
<mat-expansion-panel-header collapsedHeight='33px' expandedHeight='33px'
style="position: relative;padding-left:20px;background: #F2F9FF;">
<mat-panel-title>
{{item.name}}
</mat-panel-title>
</mat-expansion-panel-header>
<ng-template matExpansionPanelContent>
<div class="content">
<div class="contentitem" *ngFor="let i of item.plandata">
<div>
<img (click)="openPlan(i,key)"
[src]="i.imageUrl ? i.imageUrl+'?x-oss-process=image/resize,m_fill,h_100,w_100' : '../../../assets/images/noImg.png'"
alt="">
</div>
<p>{{i.name}}</p>
</div>
</div>
</ng-template>
</mat-expansion-panel>
</mat-accordion>
</div>
</div>
<!-- 实景图 -->
<div style="margin: 10px 0;">
<mat-accordion>
<mat-expansion-panel style="box-shadow: 0 0 black;border: 1px solid #EEF1F5;">
<mat-expansion-panel-header collapsedHeight='33px' expandedHeight='33px'
style="position: relative;padding-left:20px;background: #F2F9FF;">
<mat-panel-title>
实景图
</mat-panel-title>
</mat-expansion-panel-header>
<div class="content">
<div class="realPictureItem" *ngFor="let item of allRealPicture">
<div class="realPictureTitle">{{item.name}}</div>
<div class="contentitem"
*ngFor="let i of item.realityImages">
<div class="realPictureImgItem">
<img [src]="i.newImageUrl" alt="">
<div class="realPictureImgItemBtn realPictureImgItemBtn1">
查看图片
</div>
<div class="realPictureImgItemBtn realPictureImgItemBtn2" (click)="addkeyImgItemLeft(i)">
增加分组
</div>
</div>
<p>{{i.name}}</p>
</div>
</div>
</div>
</mat-expansion-panel>
</mat-accordion>
</div>
</div>
</div>
</div>
<div class="mainbox">
<!-- 封面 -->
@ -126,7 +215,8 @@
<div *ngFor="let item of planTemplateData;let key = index">
<div *ngIf="selectedItem == item.groupName">
<!-- <p>{{item.groupName}}</p> -->
<div class="centerBox" *ngIf="item.groupName!='单位概况'&&item.groupName!='交通水源'&&item.groupName!='重点图示'&&item.groupName!='预案附件'">
<div class="centerBox"
*ngIf="item.groupName!='单位概况'&&item.groupName!='交通水源'&&item.groupName!='重点图示'&&item.groupName!='预案附件'">
<div class="boxHead">
<span>{{item.groupName}}</span>
</div>
@ -137,25 +227,30 @@
<div class="body">
<!--表格类型-->
<table *ngIf="element.level==1">
<thead>
<th *ngFor="let itemth of element.tableth;let tablethi=index;TrackBy:trackByFn"><input type="text"
placeholder="请输入内容" [(ngModel)]="element.tableth[tablethi]"></th>
</thead>
<thead>
<th *ngFor="let itemth of element.tableth;let tablethi=index;TrackBy:trackByFn">
<input type="text" placeholder="请输入内容"
[(ngModel)]="element.tableth[tablethi]">
</th>
</thead>
</table>
<!--文本区域-->
<textarea style="width: 100%;height: 100px;" *ngIf="element.level==3" [(ngModel)]="element.tableth"></textarea>
<textarea style="width: 100%;height: 100px;" *ngIf="element.level==3"
[(ngModel)]="element.tableth"></textarea>
<!--输入框-->
<div class="inputtext" *ngIf="element.level==2">
<div class="inputj" style="height: 100%;width: 100%;"
*ngFor="let itemth of element.tableth;let tablethi=index;TrackBy:trackByFn">
<div style="height: 100%;width: 100%;"
*ngFor="let itemthj of element.tableth[tablethi];let tablethj=index;TrackBy:trackByFn">
<input type="text" placeholder="请输入内容" style="background-color: #E8E9E9;width: 40%;"
[(ngModel)]="itemthj.head">
<input type="text" placeholder="请输入内容" style="width: 60%;" [(ngModel)]="itemthj.body">
<div class="inputtext" *ngIf="element.level==2">
<div class="inputj" style="height: 100%;width: 100%;"
*ngFor="let itemth of element.tableth;let tablethi=index;TrackBy:trackByFn">
<div style="height: 100%;width: 100%;"
*ngFor="let itemthj of element.tableth[tablethi];let tablethj=index;TrackBy:trackByFn">
<input type="text" placeholder="请输入内容"
style="background-color: #E8E9E9;width: 40%;"
[(ngModel)]="itemthj.head">
<input type="text" placeholder="请输入内容" style="width: 60%;"
[(ngModel)]="itemthj.body">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@ -163,23 +258,26 @@
<div class="keyImgItem" *ngFor="let i of item.attribute;let key = index">
<div class="keyImgTitle">
<input type="text" placeholder="请输入分组名称" [(ngModel)]="i.name">
<mat-icon class="deleteItem" *ngIf="key != 0" (click)="deleteItem(key)">delete</mat-icon>
<mat-icon class="deleteItem" *ngIf="key != 0" (click)="deleteItem(item,key)">delete
</mat-icon>
</div>
<div class="keyImgImg">
<div class="imgbox" *ngFor="let imgUrl of i.imgArr;let imgkey = index">
<mat-icon class="deleteImg" (click)="deleteImgItem(i.imgArr,imgkey)">delete
</mat-icon>
<img [src]="imgUrl" alt="">
</div>
<div class="uploadBtn">
<button mat-stroked-button>
<mat-icon>add</mat-icon>上传图片
</button>
<input (change)="filechange($event)" type="file" name="" id="">
<input (change)="filechange($event,i)" type="file" name="" id="">
</div>
</div>
</div>
<!-- 增加分组 -->
<div class="addkeyImgItem">
<button mat-flat-button color="primary" (click)="addkeyImgItem()">
<button mat-flat-button color="primary" (click)="addkeyImgItem(item)">
增加分组
</button>
</div>

130
src/app/plan-management/create-plan-online-five/create-plan-online-five.component.scss

@ -1,3 +1,16 @@
*{
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
scrollbar-width: none; /* Firefox */
}
::-webkit-scrollbar {
display: none; /* Chrome Safari */
}
.bigbox {
width: 100%;
height: 100%;
@ -7,6 +20,7 @@
color: red;
}
.titlebox {
z-index: 100;
width: 100%;
height: 50px;
background-color: white;
@ -65,6 +79,100 @@
height: 85%;
background-color: white;
top: 66px;
min-width: 268px;
overflow-y: auto;
.leftKeyImg{
.keyImgTitle{
width: 100%;
height: 33px;
line-height: 33px;
text-align: center;
font-size: 15px;
color: #2196F3;
background: #e8f4fe;
}
.planlist{
width: 100%;
height: 100%;
overflow-y: auto;
}
.content{
box-sizing: border-box;
padding: 15px;
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
.realPictureItem{
width: 100%;
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
}
.realPictureTitle{
width: 100%;
font-size: 14px;
height: 33px;
line-height: 33px;
text-align: center;
margin-bottom: 5px;
}
.contentitem{
margin-right: 15px;
div{
width: 100px;
height: 100px;
border-radius: 10px;
border: 1px solid #2196F3;
overflow: hidden;
img{
width: 100%;
height: 100%;
cursor: pointer;
}
}
p{
text-align: center;
font-size: 13px;
margin: 5px 0;
width: 100px;
}
}
.realPictureImgItem{
position: relative;
img{
cursor: default!important;
}
.realPictureImgItemBtn{
position: absolute;
left: 50%;
transform: translateX(-50%);
width: 66px;
height: 30px;
line-height: 30px;
text-align: center;
color: white;
background: #2196f3;
display: none;
border-radius: 8px;
cursor: pointer;
font-size: 12px;
}
.realPictureImgItemBtn1{
top: 15px;
}
.realPictureImgItemBtn2{
top: 55px;
}
}
.realPictureImgItem:hover{
// background: rgba(0,0,0,0.2);
.realPictureImgItemBtn{
display: block;
}
}
}
}
}
.mainbox {
background-color: white;
@ -234,6 +342,28 @@
}
}
.keyImgImg {
.imgbox{
margin-top: 10px;
text-align: center;
position: relative;
img{
max-width: 100%;
width: auto;
height: auto;
}
.deleteImg{
display: none;
cursor: pointer;
position: absolute;
right: 0px;
top: 0px;
}
}
.imgbox:hover{
.deleteImg{
display: block;
}
}
.uploadBtn{
display: flex;
justify-content: center;

201
src/app/plan-management/create-plan-online-five/create-plan-online-five.component.ts

@ -7,8 +7,10 @@
* @LastEditTime: 2021-06-17 10:01:26
*/
import { HttpClient } from '@angular/common/http';
import { Component, OnInit } from '@angular/core';
import { Component, Inject, OnInit, Renderer2, ViewChild, Input } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { MatSnackBar } from '@angular/material/snack-bar';
@Component({
selector: 'app-create-plan-online-five',
@ -17,7 +19,7 @@ import { ActivatedRoute } from '@angular/router';
})
export class CreatePlanOnlineFiveComponent implements OnInit {
constructor(private http: HttpClient, private route: ActivatedRoute) { }
constructor(private http: HttpClient, private route: ActivatedRoute, public snackBar: MatSnackBar, public dialog: MatDialog) { }
planName: string //预案名称
@ -47,13 +49,55 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
})
}
selectedItem: string = '封面'
clickTitleItem(item) {
item == '封面' ? this.selectedItem = '封面' : this.selectedItem = item.groupName
if (this.selectedItem == '重点图示') {
this.getAllBuildings()
this.getSitePlan()
this.getRealPicture()
}
}
//获取实景图
allRealPicture
getRealPicture() {
let companyId = this.unitId
this.http.get('/api/RealityImageGroups', {
params: {
companyId: '5e9964caa760a059e84512e9'
}
}).subscribe((data: any) => {
this.allRealPicture = data
this.getAllRealPicture().then(()=>{
console.log('实景图', this.allRealPicture)
})
})
}
async getAllRealPicture() {
for (let index = 0; index < this.allRealPicture.length; index++) {
const element = this.allRealPicture[index];
let data = {
groupId: element.id,
pageSize: '999',
}
await new Promise((resolve, reject) => {
this.http.get('/api/RealityImages', { params: data }).subscribe((data: any) => {
element.realityImages = data.items
element.realityImages.forEach(item => { //每张图片设置选中状态为false
item.newImageUrl = `/api/Objects/PlanPlatform/${item.imageUrl}?x-oss-process=image/resize,m_fill,h_100,w_100` //处理图片URL地址
item.nameStart = item.name.substring(0, item.name.lastIndexOf(".")); //图片名称前缀
item.nameEnd = item.name.substring(item.name.lastIndexOf("."), item.name.length); //图片名称后缀
resolve(data)
});
})
})
}
}
planTemplateData: any
//获得模板信息
getTemplateData() {
@ -74,57 +118,100 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
//重点图示增加分组
addkeyImgItem() {
this.planTemplateData.forEach(element => {
if (element.groupName == '重点图示') {
element.attribute.push({ name: '', imgArr: [] })
}
});
addkeyImgItem(item) {
item.attribute.push({ name: '', imgArr: [] })
}
//通过左侧实景图增加分组
addkeyImgItemLeft(i){
console.log(i)
}
//重点图示删除指定分组
deleteItem(key) {
deleteItem(item, key) {
let isDelete = window.confirm('确定要删除该分组吗?分组下上传的图片将一同被删除!')
if (isDelete) {
this.planTemplateData.forEach(element => {
if (element.groupName == '重点图示') {
element.attribute.splice(key, 1)
}
});
item.attribute.splice(key, 1)
}
}
//重点图示删除指定分组里面的图片
deleteImgItem(imgArr, imgkey) {
let isDelete = window.confirm('确定要删除该图片吗?')
if (isDelete) {
imgArr.splice(imgkey, 1)
}
}
//重点图示上传图片
file: any
filechange(e) {
this.file = e.target.files[0] || null //上传的文件
filechange(e, i) {
let file = e.target.files[0] || null //获取上传的文件
let fileSize = file.size || null //上传文件的总大小
let maxSize = 5 * 1024 * 1024 //5MB一个分片
let tenSize = 100 * 1024 * 1024 //100MB限制
if (file && fileSize <= maxSize) { //上传文件<=5MB时
let upload = this.uploadFile(this.route.snapshot.queryParams.companyId, this.route.snapshot.queryParams.companyId, file)
upload.then(res => {
console.log('小于5M', res)
//图片地址 /api/Objects/PlanPlatform/res.objectName
let upload = this.uploadFile(this.route.snapshot.queryParams.companyId, this.route.snapshot.queryParams.planId, file)
upload.then((res: any) => {
i.imgArr.push('/api/Objects/PlanPlatform/' + res.objectName)
})
} else { //上传文件>5MB时
let upload = this.sectionUpload(this.route.snapshot.queryParams.companyId, this.route.snapshot.queryParams.companyId, file)
let upload = this.sectionUpload(this.route.snapshot.queryParams.companyId, this.route.snapshot.queryParams.planId, file)
upload.then(res => {
// this.renovateBaseMap('/api/Objects/PlanPlatform/' + res, item)
console.log('大于5M', res)
i.imgArr.push('/api/Objects/PlanPlatform/' + res)
})
}
// else {
// const config = new MatSnackBarConfig();
// config.verticalPosition = 'top';
// config.duration = 3000
// this.snackBar.open('上传底图需小于100MB', '确定', config);
// }
}
//单位相关数据
unitId: any = this.route.snapshot.queryParams.companyId
//获得所有的建筑物
allBuildings: any
getAllBuildings() {
this.http.get("/api/Buildings", {
params: {
companyId: this.unitId
}
}).subscribe((data: any) => {
data.forEach((item, index) => {
let params = { buildingId: item.id }
item.plandata = []
this.http.get('/api/BuildingAreas', { params }).subscribe(data => {
item.plandata = data
})
})
this.allBuildings = data
})
}
//获取总平面图
sitePlanItems: any
getSitePlan() {
let params = { companyId: this.unitId }
this.http.get('/api/SitePlans', { params: params }).subscribe(data => {
this.sitePlanItems = data
})
}
//打开采集工具
openPlan(item, index) {
sessionStorage.setItem("gisplan", 'look')
sessionStorage.setItem("companyId", this.unitId)
let data = { select: item, key: index, allBuildings: this.allBuildings }
let width = Math.round(document.body.clientWidth * 0.8) + 'px'
let height = Math.round(document.body.clientHeight * 0.9) + 'px'
// console.log('宽度',width)
let dialogRef = this.dialog.open(OpenPlanToolDialog, {//调用open方法打开对话框并且携带参数过去
id: 'openPlanToolDialog',
data,
width: width,
height: height
});
dialogRef.afterClosed().subscribe((data) => { });
}
//input key值,一个字符焦点消失问题
trackByFn(index) {
return index
}
//正常上传
async uploadFile(companyId: string, planId: string, file) {
let formData = new FormData()
formData.append("file", file)
@ -134,11 +221,6 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
})
})
}
//input key值,一个字符焦点消失问题
trackByFn(index){
return index
}
//分段上传
sectionUpload(companyId: string, planId: string, file) {
let data = { filename: file.name }
@ -193,3 +275,44 @@ export interface buildingTypes {
id: string,
name: string,
}
//查看预案
@Component({
selector: 'lookPlan-dialog',
templateUrl: './openPlanTool.html',
styleUrls: ['./openPlanTool.scss']
})
export class OpenPlanToolDialog {
constructor(public http: HttpClient, public snackBar: MatSnackBar, public dialogRef: MatDialogRef<OpenPlanToolDialog>,
@Inject(MAT_DIALOG_DATA) public data, private render2: Renderer2, public dialog: MatDialog, private route: ActivatedRoute) { }
@ViewChild('plan') plan: any //子组件
ngOnInit() {
}
ngAfterViewInit(): void {
this.noticePlan()
}
//通知 子组件 传递参数
noticePlan() {
let parameter = { //查询 节点 对应 建筑/楼层 index,id
buildingIndex: this.data.key, //总平面图/建筑 index
storeyId: this.data.select.id
}
this.http.get("/api/Buildings", { params: { companyId: this.route.snapshot.queryParams.companyId } }).subscribe((data: any) => {
this.plan.allBuildings = data
this.plan.seekPanelPoint(parameter)
})
}
//关闭弹窗
closeDiv() {
this.dialogRef.close()
}
}

3
src/app/plan-management/create-plan-online-five/openPlanTool.html

@ -0,0 +1,3 @@
<div class="divbox">
<app-collection-tools-plan #plan></app-collection-tools-plan>
</div>

16
src/app/plan-management/create-plan-online-five/openPlanTool.scss

@ -0,0 +1,16 @@
.divbox {
width: 100%;
height: 100%;
}
// @media screen and (max-width:1400px){
// .divbox{
// width: 100%;
// height: 618px;
// }
// }
// @media screen and (min-width:1400px) and (max-width:1600px){
// .divbox{
// width: 100%;
// height: 660px;
// }
// }

41
src/app/plan-management/entry-plan-look/entry-plan-look.component.html

@ -21,8 +21,9 @@
<div>
<span>单位地址:{{unitdata.unitaddress == "null" ? "无" : unitdata.unitaddress}}</span>
</div>
<span style="position: absolute;right:60px;bottom:15px;font-size: 13px;color: cornflowerblue;cursor: pointer;" (click)="lookUnitData()">查看详情</span>
<span style="position: absolute;right:60px;bottom:15px;font-size: 13px;color: cornflowerblue;cursor: pointer;"
(click)="lookUnitData()">查看详情</span>
</div>
<mat-divider style="margin-bottom: 15px;"></mat-divider>
<div class="body">
@ -30,16 +31,16 @@
<button *ngIf="isoperation == 'true'" mat-raised-button color="primary" (click)="addplan()">新建</button>
<!-- *ngIf="downloadisLoading" {{downloadFileName}}下载中...-->
<div class="progressBox" style="margin-left: 100px;" *ngIf="downloadisLoading">
<!-- <button mat-raised-button style="margin-right: 5px;" (click)="cancelDowload()">取消下载</button> -->
<span title="{{downloadFileName}}" style="font-size: 12px;" class="filename">{{downloadFileName}}</span>
<span style="font-size: 12px;position: absolute;margin-left: 8px;">下载中...</span>
<mat-progress-bar mode="determinate" [value]="downloadProgress" class="progress"></mat-progress-bar>
<mat-progress-bar mode="determinate" [value]="downloadProgress" class="progress"></mat-progress-bar>
</div>
</div>
<div class="tablebox">
<table mat-table [dataSource]="tabledataSource" class="mat-elevation-z8">
<ng-container matColumnDef="planname">
<th mat-header-cell *matHeaderCellDef>预案名称</th>
<td mat-cell *matCellDef="let element">{{element.name}}</td>
@ -58,10 +59,11 @@
<th mat-header-cell *matHeaderCellDef>预案类型</th>
<td mat-cell *matCellDef="let element">{{element.planType | plantype}}</td>
</ng-container>
<ng-container matColumnDef="auditstate">
<th mat-header-cell *matHeaderCellDef>审核状态</th>
<td mat-cell *matCellDef="let element">{{element.auditStatus=='8'?'未提交审核':element.auditStatus=='1'?'审核中':element.auditStatus=='2'?'审核通过':element.auditStatus=='4'?
<td mat-cell *matCellDef="let element">
{{element.auditStatus=='8'?'未提交审核':element.auditStatus=='1'?'审核中':element.auditStatus=='2'?'审核通过':element.auditStatus=='4'?
'审核退回':element.auditStatus=='16'?'初审通过':'初审驳回'}}</td>
</ng-container>
<ng-container matColumnDef="isopen">
@ -74,31 +76,34 @@
</ng-container>
<ng-container *ngIf="isoperation == 'true'" matColumnDef="operation">
<th mat-header-cell *matHeaderCellDef>操作</th>
<td mat-cell *matCellDef="let element">
<td mat-cell *matCellDef="let element">
<span (click)="changeName(element)" *ngIf="element.auditStatus==8">改名</span>
<span (click)="editPlan(element)" [ngClass]="{'grey': !(element.auditStatus!='16' && element.auditStatus != '1')}">编辑</span>
<span (click)="lookPlan(element)" *ngIf="element.attachmentUrls!=null">查看</span>
<span (click)="readFile(element)" [ngClass]="{'grey': element.planMode == '1' || element.planMode == '2' || element.planMode == '3'}">下载</span>
<span (click)="editPlan(element)"
[ngClass]="{'grey': !(element.auditStatus!='16' && element.auditStatus != '1')}">编辑</span>
<span (click)="lookPlan(element)" *ngIf="element.attachmentUrls!=null || element.planType == 2">查看</span>
<span (click)="readFile(element)"
[ngClass]="{'grey': element.planMode == '1' || element.planMode == '2' || element.planMode == '3'}">下载</span>
<span (click)="deletePlan(element)" *ngIf="element.auditStatus==8">删除</span>
<span (click)="auditResult(element)">审批结果</span>
<span (click)="submitAudit(element)" *ngIf="element.attachmentUrls!=null&&element.auditStatus!=1&&element.auditStatus!=16">提交审核</span>
<span (click)="submitAudit(element)"
*ngIf="element.attachmentUrls!=null&&element.auditStatus!=1&&element.auditStatus!=16">提交审核</span>
<span (click)="cancelAudit(element)" *ngIf="element.auditStatus == 1">撤销审核</span>
</td>
</ng-container>
<ng-container *ngIf="isoperation == 'false'" matColumnDef="operation">
<ng-container *ngIf="isoperation == 'false'" matColumnDef="operation">
<th mat-header-cell *matHeaderCellDef>操作</th>
<td mat-cell *matCellDef="let element">
<span (click)="lookPlan(element)">查看</span>
<span (click)="readFile(element)" [ngClass]="{'grey': element.planMode == '1' || element.planMode == '2' || element.planMode == '3'}">下载</span>
<span (click)="readFile(element)"
[ngClass]="{'grey': element.planMode == '1' || element.planMode == '2' || element.planMode == '3'}">下载</span>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
<mat-paginator [length]="length"
[pageSize]="pageSize"
[pageSizeOptions]="pageSizeOptions"
<mat-paginator [length]="length" [pageSize]="pageSize" [pageSizeOptions]="pageSizeOptions"
(page)="changePage($event)">
</mat-paginator>
</div>
</div></div>
</div>
</div>

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

@ -180,8 +180,12 @@ export class EntryPlanLookComponent implements OnInit {
window.open(`/keyUnit/viewunitinfoplan?id=${companyId}&orName=${this.route.snapshot.queryParams.orName}&orId=${this.route.snapshot.queryParams.orId}`);
}
if (e.planType == 2) { //如果是跳转网页
sessionStorage.setItem("url", e.url)
window.open(`/planManagement/webLook`)
if (e.url.indexOf('app') == 0) {
window.location.href = e.url
} else {
sessionStorage.setItem("url", e.url)
window.open(`/planManagement/webLook`)
}
}
}
//编辑预案
@ -202,10 +206,10 @@ export class EntryPlanLookComponent implements OnInit {
window.open(`/keyUnit/editunitinfo?id=${companyId}&orName=${this.route.snapshot.queryParams.orName}&orId=${this.route.snapshot.queryParams.orId}`);
}
else if (e.planType == 16) {
if(e.attachmentUrls==null){
if (e.attachmentUrls == null) {
window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}`)
}
else{
else {
let body = JSON.stringify("");
let resetAudit = true
let headers = new HttpHeaders({
@ -214,14 +218,14 @@ export class EntryPlanLookComponent implements OnInit {
let options = {
headers
};
this.http.put(`/api/PlanComponents/${e.id}?resetAudit=${resetAudit}`, body, options).subscribe(data => {
this.getAllPlanComponents()
this.lookPlan(e)
}/* ,err => {
this.http.put(`/api/PlanComponents/${e.id}?resetAudit=${resetAudit}`, body, options).subscribe(data => {
this.getAllPlanComponents()
this.lookPlan(e)
}/* ,err => {
this.snackBar.open(err,'确定',config);
} */)
}
}
else {
@ -489,10 +493,10 @@ export class EntryPlanLookComponent implements OnInit {
//新建预案弹出框
addplan() {
const dialogRef = this.dialog.open(AddPlanone, {
width:"585px",
height:"430px",
data: {companyId:this.companyId,unitType:this.unitdata.unittype,unitName:this.unitdata.unitname},
disableClose:true
width: "585px",
height: "430px",
data: { companyId: this.companyId, unitType: this.unitdata.unittype, unitName: this.unitdata.unitname },
disableClose: true
});
dialogRef.afterClosed().subscribe(
data => {
@ -546,9 +550,9 @@ export class AddPlanone {
this.dialogRef.close();
}
levels//
isup:boolean = true //上传input框是否显示
isweb:boolean = false //web输入框是否显示
isinput:boolean = false //编制按钮是否显示
isup: boolean = true //上传input框是否显示
isweb: boolean = false //web输入框是否显示
isinput: boolean = false //编制按钮是否显示
defaultisshow = '0' //默认显示上传input框
pswShow = false //是否为全景图选项默认不显示
psw//是否为全景图
@ -809,14 +813,14 @@ export class AddPlanone {
this.psw = false
this.selectedPLanName = formdata.value.firstCtrlone
this.selectedPLanType = formdata.value.firstCtrltwo
this.selectedPLanLevel= formdata.value.firstCtrlthree
if(formdata.value.firstCtrltwo=='16'&&formdata.value.firstCtrlthree=='4'){ //如果是文本预案
this.selectedPLanLevel = formdata.value.firstCtrlthree
if (formdata.value.firstCtrltwo == '16' && formdata.value.firstCtrlthree == '4') { //如果是文本预案
this.localup = true
this.inputword = false
this.onlineedit = false
this.website = false
}
if(formdata.value.firstCtrltwo=='16'&&formdata.value.firstCtrlthree!='4'){
if (formdata.value.firstCtrltwo == '16' && formdata.value.firstCtrlthree != '4') {
this.localup = true
this.inputword = true
this.onlineedit = false
@ -858,62 +862,64 @@ export class AddPlanone {
//文本预案在线编制跳转
newleftTabledata
planData
createWord(){
createWord() {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
let level = sessionStorage.getItem("level")
// console.log(level)
let PlanLevel
if(level == '0'){
PlanLevel = 1
}
if(level == '1'){
PlanLevel = 2
}
if(level == '2'){
PlanLevel = 4
}
if(level == '3'){
PlanLevel = 8
}
this.http.get("/api/PlanTemplate").subscribe((data:any)=>{
this.newleftTabledata=data
this.newleftTabledata.forEach((value,index,array)=>{
value.data= JSON.parse(value.data)
// console.log(level)
let PlanLevel
if (level == '0') {
PlanLevel = 1
}
if (level == '1') {
PlanLevel = 2
}
if (level == '2') {
PlanLevel = 4
}
if (level == '3') {
PlanLevel = 8
}
this.http.get("/api/PlanTemplate").subscribe((data: any) => {
this.newleftTabledata = data
this.newleftTabledata.forEach((value, index, array) => {
value.data = JSON.parse(value.data)
})
this.http.get("/api/BuildingTypes").subscribe((buildData:any)=>{
this.newleftTabledata.forEach((value,index,array)=>{
buildData.forEach((element,i,buildArray) => {
if(value.buildingTypeId==element.id){
array[index].unitname=buildArray[i].name
array[index].facilityCategoryId=buildArray[i].facilityCategoryId
this.http.get("/api/BuildingTypes").subscribe((buildData: any) => {
this.newleftTabledata.forEach((value, index, array) => {
buildData.forEach((element, i, buildArray) => {
if (value.buildingTypeId == element.id) {
array[index].unitname = buildArray[i].name
array[index].facilityCategoryId = buildArray[i].facilityCategoryId
}
});
})
let open=this.newleftTabledata.filter((value,index,array)=>{
return value.unitname==this.data.unitType&&value.planCategory==this.selectedPLanLevel
let open = this.newleftTabledata.filter((value, index, array) => {
return value.unitname == this.data.unitType && value.planCategory == this.selectedPLanLevel
})
if(open.length>0){
this.http.post('/api/PlanComponents',{
if (open.length > 0) {
this.http.post('/api/PlanComponents', {
id: "",
name: this.selectedPLanName,
planType:Number(this.selectedPLanType),
planType: Number(this.selectedPLanType),
planMode: Number(this.defaultisshow),
planLevel: PlanLevel,
planCategory: Number(this.selectedPLanLevel),
url: "",
//attachmentUrls: [`${this.objectName}`]
},{params:{
companyId : this.data.companyId
}}).subscribe(plandata=>{
this.planData=plandata
}, {
params: {
companyId: this.data.companyId
}
}).subscribe(plandata => {
this.planData = plandata
this.dialogRef.close(plandata);
//console.log(plandata)
window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.data.companyId}&planName=${this.planData.name}&unitName=${this.data.unitName}&planCategory=${this.selectedPLanLevel}&planId=${this.planData.id}`)
})
}else{
this.snackBar.open('请先创建模板!','确定',config);
} else {
this.snackBar.open('请先创建模板!', '确定', config);
}
})
@ -980,7 +986,7 @@ export class AddPlanone {
this.snackBar.open('请先输入网址', '确定', config);
}
if (this.defaultisshow == '3' && this.webaddress) { //如果是填写网址
var reg = new RegExp('(http|https):\/\/([\w.!@#$%^&*()_+-=])*\s*')
var reg = new RegExp('(http|https|app1|app2):\/\/([\w.!@#$%^&*()_+-=])*\s*')
if (reg.test(this.webaddress)) {
let body = {
id: "",

9
src/app/plan-management/plan-management.module.ts

@ -64,13 +64,15 @@ import { MaintainUpComponent } from './maintain-up/maintain-up.component'
import { GkPsViewer } from './pass-plan/pass-plan.component'
import { GkhtmlPsViewer } from './open-plan/open-plan.component';
import { ReinforcePlanComponent } from './reinforce-plan/reinforce-plan.component';
import { CreatePlanOnlineFiveComponent } from './create-plan-online-five/create-plan-online-five.component';
import { CreatePlanOnlineFiveComponent, OpenPlanToolDialog } from './create-plan-online-five/create-plan-online-five.component';
import { CreatePlanOnlineThreeComponent } from './create-plan-online-three/create-plan-online-three.component'
import { UiModule } from '../ui/ui.module';
@NgModule({
declarations: [EntryPlanComponent, PassPlanComponent, OpenPlanComponent, EntryPlanLookComponent, AddPlanone, PlanType, AuditSatus, PlanLevel, DownloadFile, AuditResult, ChangeName,
WebLookComponent, OnetwoEntryPlanComponent, newunitComponent, MeetPlanComponent, newunitMeet, TypePlanComponent, newunitType, PsViewer, onetwoAuditResult, meetAuditResult,
typeAuditResult, MaintainUpComponent, GkPsViewer, GkhtmlPsViewer, UnitInfo, ReinforcePlanComponent, state, ImgDetails, CreatePlanOnlineFiveComponent, CreatePlanOnlineThreeComponent],
typeAuditResult, MaintainUpComponent, GkPsViewer, GkhtmlPsViewer, UnitInfo, ReinforcePlanComponent, state, ImgDetails, CreatePlanOnlineFiveComponent, CreatePlanOnlineThreeComponent,OpenPlanToolDialog],
imports: [
CommonModule,
PlanManagementRoutingModule,
@ -117,7 +119,8 @@ import { CreatePlanOnlineThreeComponent } from './create-plan-online-three/creat
MatTabsModule,
MatToolbarModule,
MatTooltipModule,
MatTreeModule
MatTreeModule,
UiModule
],
exports: [PlanType, AuditSatus, PlanLevel, state]
})

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

@ -550,7 +550,7 @@ export class CollectionToolsPlanComponent implements OnInit {
}
//gis模块平面图
if ((this.router.url.indexOf("gis") != -1 || this.router.url.indexOf("waitexamineergis") != -1) && sessionStorage.getItem("gisplan") == "look") {
if ((this.router.url.indexOf("gis") != -1 || this.router.url.indexOf("waitexamineergis") != -1 || this.router.url.indexOf("createplanonlinefive") != -1) && sessionStorage.getItem("gisplan") == "look") {
this.isEditPattern = false
this.isediticon = false
this.canvasData.gameMode = GameMode.Assignment
@ -2535,6 +2535,7 @@ export class CollectionToolsPlanComponent implements OnInit {
seekPanelPoint(paramsData) {
this.checkedBuildingIndex = paramsData.buildingIndex
if (paramsData.buildingIndex == -1) { //总平面图时
console.log('走了1')
this.beforeOneCheckedBuilding = { name: "总平面图" }
let fireData = this.getFireElements(sessionStorage.getItem('buildingTypeId')) //获取单位下 消防要素
let planData = this.getSitePlanCompanyData() //获取 单位 数据
@ -2550,11 +2551,15 @@ export class CollectionToolsPlanComponent implements OnInit {
})
}) //get
} else { //建筑时
console.log('走了2')
console.log('allBuildings',this.allBuildings)
console.log('paramsData',paramsData)
this.beforeOneCheckedBuilding = this.allBuildings[paramsData.buildingIndex]
let params = { buildingId: this.beforeOneCheckedBuilding.id }
let fireData = this.getFireElements(this.beforeOneCheckedBuilding.buildingTypes[0].id || '') //获取建筑下 消防要素
let planData = this.getBuildingData(params) //获取 建筑 数据
this.http.get('/api/BuildingAreas', { params }).subscribe(data => {
console.log('BuildingAreas',data)
this.sitePlanData = data
let index = this.sitePlanData.findIndex(item => { return item.id === paramsData.storeyId })
this.selectingSitePlan = this.sitePlanData[index] || {}

Loading…
Cancel
Save