刘向辉 3 years ago
parent
commit
e89dc72520
  1. 12
      src/app/pages/left-domain/left-domain.component.html
  2. 6
      src/app/pages/left-domain/left-domain.component.scss
  3. 11
      src/app/pages/left-domain/left-domain.component.ts
  4. 20
      src/app/pages/plan/plan.component.html
  5. 10
      src/app/pages/plan/plan.component.scss
  6. 23
      src/app/pages/plan/plan.component.ts
  7. 19
      src/app/pages/plan/publicPop.scss

12
src/app/pages/left-domain/left-domain.component.html

@ -138,7 +138,11 @@
<div class="propertyImage" id="pipelineViewer{{item.getID()}}">
<p class="imgTitle">设计图纸</p>
<img [hidden]="!item.getPropertyData().img" [src]="item.getPropertyData().img" [attr.data-original]="item.getPropertyData().img">
<a href="javascript:;" class="bottomPlanUpload uploadImgBox" *ngIf="editMode"><input type="file" accept="image/*" (change)='uploadLeftDomainImg($event, item)'><i nz-icon nzType="plus" nzTheme="outline"></i></a>
<div class="positionHandleImgVideo" style="width: 120px;" *ngIf="editMode && item.getPropertyData().img">
<a href="javascript:;" class="imgAndVideoUpload"><input type="file" accept="image/*" (change)='uploadLeftDomainImg($event, item)'><i nz-icon nzType="upload" nzTheme="outline"></i></a>
<i nz-icon nzType="delete" nzTheme="outline" (click)="deleteImg(item)"></i>
</div>
<a href="javascript:;" class="bottomPlanUpload uploadImgBox" *ngIf="editMode && !item.getPropertyData().img"><input type="file" accept="image/*" (change)='uploadLeftDomainImg($event, item)'><i nz-icon nzType="plus" nzTheme="outline"></i></a>
</div>
</div>
</div>
@ -169,7 +173,11 @@
<div class="propertyImage" id="orvrViewer{{item.getID()}}">
<p class="imgTitle">设计图纸</p>
<img [hidden]="!item.getPropertyData().img" [src]="item.getPropertyData().img" [attr.data-original]="item.getPropertyData().img">
<a href="javascript:;" class="bottomPlanUpload uploadImgBox" *ngIf="editMode"><input type="file" accept="image/*" (change)='uploadLeftDomainImg($event, item)'><i nz-icon nzType="plus" nzTheme="outline"></i></a>
<div class="positionHandleImgVideo" style="width: 120px;" *ngIf="editMode && item.getPropertyData().img">
<a href="javascript:;" class="imgAndVideoUpload"><input type="file" accept="image/*" (change)='uploadLeftDomainImg($event, item)'><i nz-icon nzType="upload" nzTheme="outline"></i></a>
<i nz-icon nzType="delete" nzTheme="outline" (click)="deleteImg(item)"></i>
</div>
<a href="javascript:;" class="bottomPlanUpload uploadImgBox" *ngIf="editMode && !item.getPropertyData().img"><input type="file" accept="image/*" (change)='uploadLeftDomainImg($event, item)'><i nz-icon nzType="plus" nzTheme="outline"></i></a>
</div>
</div>
</div>

6
src/app/pages/left-domain/left-domain.component.scss

@ -38,9 +38,9 @@
.tableInput{ border: none; outline: none; background-color: transparent; width: 100%; height: 100%; }
.tableSelect{ width: 100%; height: 100%; color: #fff; }
.propertyImage{
padding-left: 15px;
img{ width: auto; max-height: 130px; display: block; margin-bottom: 10px; }
.imgTitle{ font-size: 14px; height: 20px; line-height: 20px; margin: 10px 0; }
position: relative;
.imgTitle{ font-size: 14px; height: 20px; line-height: 20px; margin: 10px 0; padding-left: 10px; }
img{ width: 120px; height: auto; max-height: 100px; display: block; margin-bottom: 10px; }
.uploadImgBox{ margin: 0; width: 50px; height: 50px; line-height: 50px; text-align: center; }
}

11
src/app/pages/left-domain/left-domain.component.ts

@ -140,6 +140,17 @@ export class LeftDomainComponent implements OnInit {
}
}
//删除设备 图片
deleteImg(item: FacilityInfoUIItem) {
let isDelete = confirm("您确定要删除吗?")
if (isDelete) {
this.http.delete(`${item.getPropertyData().img}`).subscribe(data=>{
item.getPropertyData().img = ""
this.message.info("删除成功!");
})
}
}
@ViewChild('nzTreeComponent', { static: false }) nzTreeComponent!: NzTreeComponent;
treeData: NzTreeNodeOptions[] = []; //tree data

20
src/app/pages/plan/plan.component.html

@ -67,8 +67,14 @@
</div>
<div class="natureContent" *ngIf="beforeOnePropertyData.getPropertyData().img != undefined" id="propertyImg">
<div class="natureTitle">图片</div>
<div class="natureImg" *ngIf="beforeOnePropertyData.getPropertyData().img"><img [src]="beforeOnePropertyData.getPropertyData().img" [attr.data-original]="beforeOnePropertyData.getPropertyData().img"></div>
<div *ngIf="editMode"><a href="javascript:;" class="bottomPlanUpload natureUpload"><input type="file" accept="image/*" (change)='uploadPropertyImg($event)'><i nz-icon nzType="plus" nzTheme="outline"></i></a></div>
<div class="natureImg" *ngIf="beforeOnePropertyData.getPropertyData().img">
<img [src]="beforeOnePropertyData.getPropertyData().img" [attr.data-original]="beforeOnePropertyData.getPropertyData().img">
<div class="positionHandleImgVideo" style="width: 120px;" *ngIf="editMode && beforeOnePropertyData.getPropertyData().img">
<a href="javascript:;" class="imgAndVideoUpload"><input type="file" accept="image/*" (change)='uploadPropertyImg($event)'><i nz-icon nzType="upload" nzTheme="outline"></i></a>
<i nz-icon nzType="delete" nzTheme="outline" (click)="deleteImgVideo(1)"></i>
</div>
</div>
<div *ngIf="editMode && !beforeOnePropertyData.getPropertyData().img"><a href="javascript:;" class="bottomPlanUpload natureUpload"><input type="file" accept="image/*" (change)='uploadPropertyImg($event)'><i nz-icon nzType="plus" nzTheme="outline"></i></a></div>
</div>
</div>
<div class="nature natureLook" *ngIf="isShowNature && (selectFence === 1 || selectFence === 2) && beforeOnePropertyData" [ngStyle]="{'top': naturePosition.top,'right': naturePosition.right}">
@ -149,12 +155,18 @@
</div>
<div class="planHeaderImg" id="planNodeImg">
<img class="imgSrc" [src]="beforePlanNode.texture" [hidden]="!beforePlanNode.texture" [attr.data-original]="beforePlanNode.texture">
<a href="javascript:;" class="imgAndVideoUpload uploadImage" *ngIf="editMode && beforePlanNode.texture"><input type="file" accept="image/*" (change)='uploadImgVideo($event, false)'><i nz-icon nzType="border-inner" nzTheme="outline"></i></a>
<div class="positionHandleImgVideo" style="width: 100px;" *ngIf="editMode && beforePlanNode.texture">
<a href="javascript:;" class="imgAndVideoUpload"><input type="file" accept="image/*" (change)='uploadImgVideo($event, false)'><i nz-icon nzType="upload" nzTheme="outline"></i></a>
<i nz-icon nzType="delete" nzTheme="outline" (click)="deleteImgVideo(2)"></i>
</div>
<a href="javascript:;" class="bottomPlanUpload" *ngIf="editMode && !beforePlanNode.texture"><input type="file" accept="image/*" (change)='uploadImgVideo($event, false)'><img src="../../../assets/images/uploadImg.png"></a>
</div>
<div class="planHeaderVideo">
<video [src]="beforePlanNode.video" [hidden]="!beforePlanNode.video" (click)="openVideo(beforePlanNode.video)"></video>
<a href="javascript:;" class="imgAndVideoUpload uploadVideo" *ngIf="editMode && beforePlanNode.video"><input type="file" accept="video/*" (change)='uploadImgVideo($event, true)'><i nz-icon nzType="border-inner" nzTheme="outline"></i></a>
<div class="positionHandleImgVideo" style="width: 120px;" *ngIf="editMode && beforePlanNode.video">
<a href="javascript:;" class="imgAndVideoUpload"><input type="file" accept="video/*" (change)='uploadImgVideo($event, true)'><i nz-icon nzType="upload" nzTheme="outline"></i></a>
<i nz-icon nzType="delete" nzTheme="outline" (click)="deleteImgVideo(3)"></i>
</div>
<a href="javascript:;" class="bottomPlanUpload" style="width: 100px;" *ngIf="editMode && !beforePlanNode.video"><input type="file" accept="video/*" (change)='uploadImgVideo($event, true)'><img src="../../../assets/images/uploadVideo.png"></a>
</div>
</div>

10
src/app/pages/plan/plan.component.scss

@ -192,11 +192,11 @@
.natureContent{
box-sizing: border-box;
padding: 0 20px;
margin-bottom: 5px;
margin: 5px 0;
.natureTitle{ margin-bottom: 5px; height: 20px; line-height: 20px; }
input{ width: 100%; height: 28px; background: rgba(145, 204, 255, 0.41); border: 1px solid #91CCFF; padding: 0; resize: none; outline: none; }
textarea{ width: 100%; height: 75px; background: rgba(145, 204, 255, 0.41); border: 1px solid #91CCFF; padding: 0; resize: none; outline: none; }
.natureImg{ margin-bottom: 5px; img{ width: auto; height: auto; max-height: 120px; } }
.natureImg{ margin-bottom: 5px; position: relative; img{ width: 120px; height: auto; max-height: 100px; } }
.natureUpload{ margin: 0; text-align: center; width: 50px; height: 50px; line-height: 50px; }
}
}
@ -336,10 +336,8 @@
input{ border: none; outline: none; background-color: transparent; width: 100%; height: 100%; }
textarea{ width: 100%; height: 50px; background: rgba(145, 204, 255, 0.41); border: 1px solid #91CCFF; padding: 0; resize: none; outline: none; }
}
.planHeaderImg{ width: 140px; height: 100%; text-align: center; line-height: 80px; .imgSrc{ width: 100px; height: auto; max-height: 100%; } }
.uploadImage{ width: 20px; height: 20px; line-height: 20px; float: right; margin-top: 30px; }
.planHeaderVideo{ width: 180px; height: 100%; text-align: center; line-height: 80px; video{ width: 120px; height: auto; max-height: 100%; } }
.uploadVideo{ width: 30px; height: 30px; line-height: 30px; float: right; margin-top: 25px; }
.planHeaderImg{ width: 100px; height: 100%; text-align: center; position: relative; margin: 0 30px; .imgSrc{ width: 100%; height: 100%; } }
.planHeaderVideo{ width: 120px; height: 100%; text-align: center; position: relative; video{ width: 100%; height: 100%; } }
}
.bottomPlanCenter{
height: 35px;

23
src/app/pages/plan/plan.component.ts

@ -673,6 +673,29 @@ export class PlanComponent implements OnInit {
}
}
//删除 图片/视频
deleteImgVideo(type: number) {
let isDelete = confirm("您确定要删除吗?")
if (isDelete) {
if (type === 1) {
this.http.delete(`${this.beforeOnePropertyData.getPropertyData().img}`).subscribe(data=>{
this.beforeOnePropertyData.getPropertyData().img = ""
this.message.info("删除成功!");
})
} else if (type === 2) {
this.http.delete(`${this.beforePlanNode.texture}`).subscribe(data=>{
this.beforePlanNode.texture = ""
this.message.info("删除成功!");
})
} else if (type === 3) {
this.http.delete(`${this.beforePlanNode.video}`).subscribe(data=>{
this.beforePlanNode.video = ""
this.message.info("删除成功!");
})
}
}
}
//打开视频弹窗
openVideo(src: string) {
this.videoDialogType.isVideo = true

19
src/app/pages/plan/publicPop.scss

@ -27,10 +27,12 @@
display: inline-block;
}
.imgAndVideoUpload{
width: 20px;
height: 20px;
margin-right: 10px;
vertical-align: top;
position: relative;
cursor: pointer;
background: rgba(145, 204, 255, 0.41);
border: 1px dashed #91CCFF;
overflow: hidden;
display: inline-block;
}
@ -41,5 +43,16 @@
right: 0;
top: 0;
opacity: 0;
cursor: pointer
cursor: pointer;
}
//绝对定位 上传/删除 图片/视频弹窗
.positionHandleImgVideo {
position: absolute;
left: 0;
bottom: 0px;
height: 20px;
text-align: center;
background: rgba(0, 0, 0, 0.7);
.anticon { font-size: 20px; color: #fff; cursor: pointer; }
}
Loading…
Cancel
Save