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.
45 lines
1.4 KiB
45 lines
1.4 KiB
import { Component, OnInit, Input } from "@angular/core"; |
|
import Viewer from "viewerjs"; |
|
import { NzMessageService } from "ng-zorro-antd/message"; |
|
@Component({ |
|
selector: "app-oil-unloading-process", |
|
templateUrl: "./oil-unloading-process.component.html", |
|
styleUrls: ["./oil-unloading-process.component.scss"], |
|
}) |
|
export class OilUnloadingProcessComponent implements OnInit { |
|
@Input() stationName: any; |
|
@Input() data: any; |
|
constructor(private message: NzMessageService) {} |
|
|
|
isSuperAdmin = false; |
|
ngOnInit(): void { |
|
let userName = JSON.parse(sessionStorage.getItem("userdata")).userName; |
|
if (userName === "superadmin") { |
|
this.isSuperAdmin = true; |
|
} |
|
} |
|
lookImg(item) { |
|
console.log(item) |
|
if (item && item.violateImage) { |
|
console.log(item.violateImage); |
|
let dom = document.getElementById(`viewerjs`); |
|
let pObjs = dom.childNodes; |
|
let node = document.createElement("img"); |
|
node.style.display = "none"; |
|
node.src = item.violateImage; |
|
node.id = "img"; |
|
dom.appendChild(node); |
|
setTimeout(() => { |
|
let viewer = new Viewer(document.getElementById(`viewerjs`), { |
|
hidden: () => { |
|
dom.removeChild(pObjs[0]); |
|
viewer.destroy(); |
|
}, |
|
}); |
|
node.click(); |
|
}, 0); |
|
} else { |
|
this.message.create("warning", `该节点没有图片`); |
|
} |
|
} |
|
}
|
|
|