You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.2 KiB
52 lines
1.2 KiB
3 years ago
|
import { Component, OnInit, Input } from '@angular/core';
|
||
|
import { NzModalRef } from 'ng-zorro-antd/modal';
|
||
|
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||
|
import { HttpClient } from '@angular/common/http';
|
||
|
import { ObjectsSimpleService } from 'src/app/service/objectsSimple.service';
|
||
|
import Viewer from 'viewerjs';
|
||
|
|
||
|
|
||
|
@Component({
|
||
|
selector: 'app-audit-dispose',
|
||
|
templateUrl: './audit-dispose.component.html',
|
||
|
styleUrls: ['./audit-dispose.component.scss']
|
||
|
})
|
||
|
export class AuditDisposeComponent implements OnInit {
|
||
|
|
||
|
@Input() data?: any;
|
||
|
constructor(private modal: NzModalRef) { }
|
||
|
|
||
|
|
||
|
ngOnInit(): void {
|
||
|
}
|
||
|
|
||
|
|
||
|
destroyModal() {
|
||
|
this.modal.destroy();
|
||
|
}
|
||
|
ok() {
|
||
|
this.modal.triggerOk()
|
||
|
}
|
||
|
//查看图片
|
||
|
viewImg(url) {
|
||
|
// url.split('?')[0]
|
||
|
let dom = document.getElementById(`viewerjs`)
|
||
|
let pObjs = dom.childNodes;
|
||
|
let node = document.createElement("img")
|
||
|
node.style.display = "none";
|
||
|
node.src = url;
|
||
|
node.id = 'img'
|
||
|
dom.appendChild(node)
|
||
|
setTimeout(() => {
|
||
|
let viewer = new Viewer(document.getElementById(`viewerjs`), {
|
||
|
hidden: () => {
|
||
|
dom.removeChild(pObjs[0]);
|
||
|
viewer.destroy();
|
||
|
}
|
||
|
});
|
||
|
node.click();
|
||
|
}, 0);
|
||
|
}
|
||
|
|
||
|
}
|