chenjingyu 3 years ago
parent
commit
c02deebb95
  1. 25
      src/app/plan-management/create-plan-online-five/create-plan-online-five.component.html
  2. 39
      src/app/plan-management/create-plan-online-five/create-plan-online-five.component.ts

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

@ -85,17 +85,19 @@
实景图
</mat-panel-title>
</mat-expansion-panel-header>
<div class="content">
<div class="realPictureItem" *ngFor="let item of allRealPicture">
<div class="content" id="viewer">
<div class="realPictureItem" *ngFor="let item of allRealPicture;let key1 = index">
<div class="realPictureTitle">{{item.name}}</div>
<div class="contentitem" *ngFor="let i of item.realityImages">
<div class="contentitem" *ngFor="let i of item.realityImages;let key2 = index">
<div class="realPictureImgItem">
<img [src]="i.newImageUrl" alt="">
<div class="realPictureImgItemBtn realPictureImgItemBtn1">
<img [src]="i.newImageUrl" alt=""
[attr.data-original]="'/api/Objects/PlanPlatform/' + i.imageUrl">
<div class="realPictureImgItemBtn realPictureImgItemBtn1"
(click)="lookkeyImgItemLeft(key1,key2,i)">
查看图片
</div>
<div class="realPictureImgItemBtn realPictureImgItemBtn2"
(click)="addkeyImgItemLeft(i)">
(click)="addkeyImgItemLeft(item,i)">
增加分组
</div>
</div>
@ -234,7 +236,8 @@
<thead>
<th *ngFor="let itemth of element.tableth;let tablethi=index;TrackBy:trackByFn">
<input type="text" placeholder="请输入内容"
[(ngModel)]="element.tableth[tablethi]"></th>
[(ngModel)]="element.tableth[tablethi]">
</th>
</thead>
<tbody>
<!-- <tr>
@ -303,6 +306,9 @@
</button>
</div>
</div>
<div class="disposalPoint" *ngIf="item.groupName == '预案附件'">
处置要点
</div>
</div>
</div>
</div>
@ -310,4 +316,9 @@
</div>
</div>
</div>
<div id="viewerjs" style="display:none">
</div>

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

@ -11,7 +11,7 @@ import { Component, Inject, OnInit, Renderer2, ViewChild, Input } from '@angular
import { ActivatedRoute } from '@angular/router';
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
import Viewer from 'viewerjs';
@Component({
selector: 'app-create-plan-online-five',
templateUrl: './create-plan-online-five.component.html',
@ -142,9 +142,42 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
addkeyImgItem(item) {
item.attribute.push({ name: '', imgArr: [] })
}
//通过左侧查看实景图
gallery
lookkeyImgItemLeft(key1, key2,i) {
// setTimeout(() => {
// if (document.getElementById('viewerjs')) {
// this.gallery = new Viewer(document.getElementById('viewerjs'), {
// url: 'data-original'
// });
// console.log('这个号甲就',document.getElementById('viewerjs'))
// }
// }, 0);
let dom = document.getElementById(`viewerjs`)
let pObjs = dom.childNodes;
let node = document.createElement("img")
node.style.display = "none";
node.src = '/api/Objects/PlanPlatform/' + i.imageUrl;
node.id = 'img'
dom.appendChild(node)
setTimeout(() => {
let viewer = new Viewer(document.getElementById(`viewerjs`), {
hidden: () => {
dom.removeChild(pObjs[0]);
viewer.destroy();
}
});
node.click();
}, 0);
}
//通过左侧实景图增加分组
addkeyImgItemLeft(i) {
console.log(i)
addkeyImgItemLeft(item, i) {
this.planTemplateData.forEach(element => {
if (element.groupName == '重点图示') {
element.attribute.push({ name: item.name + '-' + i.name, imgArr: ['/api/Objects/PlanPlatform/' + i.imageUrl] })
}
});
}
//重点图示删除指定分组
deleteItem(item, key) {

Loading…
Cancel
Save