Browse Source

[完善]处理卸油节点为空时报错

beijing
邵佳豪 2 years ago
parent
commit
d7519790d5
  1. 4
      proxy.config.json
  2. 128
      src/app/pages/oil-unloading-process/oil-unloading-process.component.html
  3. 9
      src/app/pages/oil-unloading-process/oil-unloading-process.component.ts
  4. 2
      src/app/pages/records/oil-unloading-process-list/oil-unloading-process-list.component.ts

4
proxy.config.json

@ -1,6 +1,6 @@
{
"/api": {
"target": "https://znaq.sinochemoilmarketing.com/",
"target": "http://121.36.37.70:8906/",
"测试1": "http://121.36.37.70:8906/",
"测试2": "https://znaq.sinochemoilmarketing.com/",
"测试3": "https://gas.anxincloud.cn/",
@ -8,7 +8,7 @@
"changeOrigin": true
},
"/signalr": {
"target": "https://znaq.sinochemoilmarketing.com/",
"target": "http://121.36.37.70:8906/",
"secure": false,
"ws": true,
"logLevel": "debug"

128
src/app/pages/oil-unloading-process/oil-unloading-process.component.html

@ -14,55 +14,55 @@
</div>
<div class="content content1">
<div class="imgbox">
<span class="timespan" [ngClass]="{'timespanerr': !data[0].isCorrect}"><i nz-icon
nzType="clock-circle" nzTheme="outline"></i>{{data[0].violateTime
? (data[0].violateTime | date:"MM-dd HH:mm:ss") : '/'}}</span>
<div class="img" (click)="lookImg(data[0].violateImage)"
[ngClass]="{'selectedimg': !data[0].violateImage}">
<img [src]="data[0].violateImage ? data[0].violateImage : '../../../../assets/images/nopng.png'"
<span class="timespan" [ngClass]="{'timespanerr': !data[0]?.isCorrect}"><i nz-icon
nzType="clock-circle" nzTheme="outline"></i>{{data[0]?.violateTime
? (data[0]?.violateTime | date:"MM-dd HH:mm:ss") : '/'}}</span>
<div class="img" (click)="lookImg(data[0])"
[ngClass]="{'selectedimg': !data[0]?.violateImage}">
<img [src]="data[0]?.violateImage ? data[0]?.violateImage : '../../../../assets/images/nopng.png'"
alt="">
<img *ngIf="!data[0].isCorrect" class="err" src="../../../../assets/images/err.png" alt="">
<img *ngIf="!data[0]?.isCorrect" class="err" src="../../../../assets/images/err.png" alt="">
</div>
<span class="name" [ngClass]="{'isForceMake': data[0].isForceMake && isSuperAdmin}">油罐车进场</span>
<span class="name" [ngClass]="{'isForceMake': data[0]?.isForceMake && isSuperAdmin}">油罐车进场</span>
</div>
<img class="rightArrow" src="../../../assets/images/rightArrow.png" alt="">
<div class="imgbox">
<span class="timespan" [ngClass]="{'timespanerr': !data[1].isCorrect}"><i nz-icon
nzType="clock-circle" nzTheme="outline"></i>{{data[1].violateTime
? (data[1].violateTime | date:"MM-dd HH:mm:ss") : '/'}}</span>
<div class="img" (click)="lookImg(data[1].violateImage)"
[ngClass]="{'selectedimg': !data[1].violateImage}">
<img [src]="data[1].violateImage ? data[1].violateImage : '../../../../assets/images/nopng.png'"
<span class="timespan" [ngClass]="{'timespanerr': !data[1]?.isCorrect}"><i nz-icon
nzType="clock-circle" nzTheme="outline"></i>{{data[1]?.violateTime
? (data[1]?.violateTime | date:"MM-dd HH:mm:ss") : '/'}}</span>
<div class="img" (click)="lookImg(data[1])"
[ngClass]="{'selectedimg': !data[1]?.violateImage}">
<img [src]="data[1]?.violateImage ? data[1]?.violateImage : '../../../../assets/images/nopng.png'"
alt="">
<img *ngIf="!data[1].isCorrect" class="err" src="../../../../assets/images/err.png" alt="">
<img *ngIf="!data[1]?.isCorrect" class="err" src="../../../../assets/images/err.png" alt="">
</div>
<span class="name" [ngClass]="{'isForceMake': data[1].isForceMake && isSuperAdmin}">设置隔离区域</span>
<span class="name" [ngClass]="{'isForceMake': data[1]?.isForceMake && isSuperAdmin}">设置隔离区域</span>
</div>
<img class="rightArrow" src="../../../assets/images/rightArrow.png" alt="">
<div class="imgbox">
<span class="timespan" [ngClass]="{'timespanerr': !data[2].isCorrect}"><i nz-icon
nzType="clock-circle" nzTheme="outline"></i>{{data[2].violateTime
? (data[2].violateTime | date:"MM-dd HH:mm:ss") : '/'}}</span>
<div class="img" (click)="lookImg(data[2].violateImage)"
[ngClass]="{'selectedimg': !data[2].violateImage}">
<img [src]="data[2].violateImage ? data[2].violateImage : '../../../../assets/images/nopng.png'"
<span class="timespan" [ngClass]="{'timespanerr': !data[2]?.isCorrect}"><i nz-icon
nzType="clock-circle" nzTheme="outline"></i>{{data[2]?.violateTime
? (data[2]?.violateTime | date:"MM-dd HH:mm:ss") : '/'}}</span>
<div class="img" (click)="lookImg(data[2])"
[ngClass]="{'selectedimg': !data[2]?.violateImage}">
<img [src]="data[2]?.violateImage ? data[2]?.violateImage : '../../../../assets/images/nopng.png'"
alt="">
<img *ngIf="!data[2].isCorrect" class="err" src="../../../../assets/images/err.png" alt="">
<img *ngIf="!data[2]?.isCorrect" class="err" src="../../../../assets/images/err.png" alt="">
</div>
<span class="name" [ngClass]="{'isForceMake': data[2].isForceMake && isSuperAdmin}">连接静电接地</span>
<span class="name" [ngClass]="{'isForceMake': data[2]?.isForceMake && isSuperAdmin}">连接静电接地</span>
</div>
<img class="rightArrow" src="../../../assets/images/rightArrow.png" alt="">
<div class="imgbox">
<span class="timespan" [ngClass]="{'timespanerr': !data[3].isCorrect}"><i nz-icon
nzType="clock-circle" nzTheme="outline"></i>{{data[3].violateTime
? (data[3].violateTime | date:"MM-dd HH:mm:ss") : '/'}}</span>
<div class="img" (click)="lookImg(data[3].violateImage)"
[ngClass]="{'selectedimg': !data[3].violateImage}">
<img [src]="data[3].violateImage ? data[3].violateImage : '../../../../assets/images/nopng.png'"
<span class="timespan" [ngClass]="{'timespanerr': !data[3]?.isCorrect}"><i nz-icon
nzType="clock-circle" nzTheme="outline"></i>{{data[3]?.violateTime
? (data[3]?.violateTime | date:"MM-dd HH:mm:ss") : '/'}}</span>
<div class="img" (click)="lookImg(data[3])"
[ngClass]="{'selectedimg': !data[3]?.violateImage}">
<img [src]="data[3]?.violateImage ? data[3]?.violateImage : '../../../../assets/images/nopng.png'"
alt="">
<img *ngIf="!data[3].isCorrect" class="err" src="../../../../assets/images/err.png" alt="">
<img *ngIf="!data[3]?.isCorrect" class="err" src="../../../../assets/images/err.png" alt="">
</div>
<span class="name" [ngClass]="{'isForceMake': data[3].isForceMake && isSuperAdmin}">放置消防器材</span>
<span class="name" [ngClass]="{'isForceMake': data[3]?.isForceMake && isSuperAdmin}">放置消防器材</span>
</div>
</div>
</div>
@ -79,55 +79,55 @@
<div class="colimglist">
<div class="imgbox">
<span class="timespan" [ngClass]="{'timespanerr': !data[4].isCorrect}"><i nz-icon
nzType="clock-circle" nzTheme="outline"></i>{{data[4].violateTime ?
(data[4].violateTime | date:"MM-dd HH:mm:ss") : '/'}}</span>
<div class="img" (click)="lookImg(data[4].violateImage)"
[ngClass]="{'selectedimg': !data[4].violateImage}">
<img [src]="data[4].violateImage ? data[4].violateImage : '../../../../assets/images/nopng.png'"
<span class="timespan" [ngClass]="{'timespanerr': !data[4]?.isCorrect}"><i nz-icon
nzType="clock-circle" nzTheme="outline"></i>{{data[4]?.violateTime ?
(data[4]?.violateTime | date:"MM-dd HH:mm:ss") : '/'}}</span>
<div class="img" (click)="lookImg(data[4])"
[ngClass]="{'selectedimg': !data[4]?.violateImage}">
<img [src]="data[4]?.violateImage ? data[4]?.violateImage : '../../../../assets/images/nopng.png'"
alt="">
<img *ngIf="!data[4].isCorrect" class="err" src="../../../../assets/images/err.png" alt="">
<img *ngIf="!data[4]?.isCorrect" class="err" src="../../../../assets/images/err.png" alt="">
</div>
<span class="name" [ngClass]="{'isForceMake': data[4].isForceMake && isSuperAdmin}">连接卸油管</span>
<span class="name" [ngClass]="{'isForceMake': data[4]?.isForceMake && isSuperAdmin}">连接卸油管</span>
</div>
<img class="rightArrow" src="../../../assets/images/rightArrow.png" alt="">
<div class="imgbox">
<span class="timespan" [ngClass]="{'timespanerr': !data[5].isCorrect}"><i nz-icon
nzType="clock-circle" nzTheme="outline"></i>{{data[5].violateTime ?
(data[5].violateTime | date:"MM-dd HH:mm:ss") : '/'}}</span>
<div class="img" (click)="lookImg(data[5].violateImage)"
[ngClass]="{'selectedimg': !data[5].violateImage}">
<img [src]="data[5].violateImage ? data[5].violateImage : '../../../../assets/images/nopng.png'"
<span class="timespan" [ngClass]="{'timespanerr': !data[5]?.isCorrect}"><i nz-icon
nzType="clock-circle" nzTheme="outline"></i>{{data[5]?.violateTime ?
(data[5]?.violateTime | date:"MM-dd HH:mm:ss") : '/'}}</span>
<div class="img" (click)="lookImg(data[5])"
[ngClass]="{'selectedimg': !data[5]?.violateImage}">
<img [src]="data[5]?.violateImage ? data[5]?.violateImage : '../../../../assets/images/nopng.png'"
alt="">
<img *ngIf="!data[5].isCorrect" class="err" src="../../../../assets/images/err.png" alt="">
<img *ngIf="!data[5]?.isCorrect" class="err" src="../../../../assets/images/err.png" alt="">
</div>
<span class="name" [ngClass]="{'isForceMake': data[5].isForceMake && isSuperAdmin}">全程监卸</span>
<span class="name" [ngClass]="{'isForceMake': data[5]?.isForceMake && isSuperAdmin}">全程监卸</span>
</div>
<img class="rightArrow" src="../../../assets/images/rightArrow.png" alt="">
<div class="imgbox">
<span class="timespan" [ngClass]="{'timespanerr': !data[6].isCorrect}"><i nz-icon
nzType="clock-circle" nzTheme="outline"></i>{{data[6].violateTime ?
(data[6].violateTime | date:"MM-dd HH:mm:ss") : '/'}}</span>
<div class="img" (click)="lookImg(data[6].violateImage)"
[ngClass]="{'selectedimg': !data[6].violateImage}">
<img [src]="data[6].violateImage ? data[6].violateImage : '../../../../assets/images/nopng.png'"
<span class="timespan" [ngClass]="{'timespanerr': !data[6]?.isCorrect}"><i nz-icon
nzType="clock-circle" nzTheme="outline"></i>{{data[6]?.violateTime ?
(data[6]?.violateTime | date:"MM-dd HH:mm:ss") : '/'}}</span>
<div class="img" (click)="lookImg(data[6])"
[ngClass]="{'selectedimg': !data[6]?.violateImage}">
<img [src]="data[6]?.violateImage ? data[6]?.violateImage : '../../../../assets/images/nopng.png'"
alt="">
<img *ngIf="!data[6].isCorrect" class="err" src="../../../../assets/images/err.png" alt="">
<img *ngIf="!data[6]?.isCorrect" class="err" src="../../../../assets/images/err.png" alt="">
</div>
<span class="name" [ngClass]="{'isForceMake': data[6].isForceMake && isSuperAdmin}">拆除卸油管</span>
<span class="name" [ngClass]="{'isForceMake': data[6]?.isForceMake && isSuperAdmin}">拆除卸油管</span>
</div>
<img class="rightArrow" src="../../../assets/images/rightArrow.png" alt="">
<div class="imgbox">
<span class="timespan" [ngClass]="{'timespanerr': !data[7].isCorrect}"><i nz-icon
nzType="clock-circle" nzTheme="outline"></i>{{data[7].violateTime ?
(data[7].violateTime | date:"MM-dd HH:mm:ss") : '/'}}</span>
<div class="img" (click)="lookImg(data[7].violateImage)"
[ngClass]="{'selectedimg': !data[7].violateImage}">
<img [src]="data[7].violateImage ? data[7].violateImage : '../../../../assets/images/nopng.png'"
<span class="timespan" [ngClass]="{'timespanerr': !data[7]?.isCorrect}"><i nz-icon
nzType="clock-circle" nzTheme="outline"></i>{{data[7]?.violateTime ?
(data[7]?.violateTime | date:"MM-dd HH:mm:ss") : '/'}}</span>
<div class="img" (click)="lookImg(data[7])"
[ngClass]="{'selectedimg': !data[7]?.violateImage}">
<img [src]="data[7]?.violateImage ? data[7]?.violateImage : '../../../../assets/images/nopng.png'"
alt="">
<img *ngIf="!data[7].isCorrect" class="err" src="../../../../assets/images/err.png" alt="">
<img *ngIf="!data[7]?.isCorrect" class="err" src="../../../../assets/images/err.png" alt="">
</div>
<span class="name" [ngClass]="{'isForceMake': data[7].isForceMake && isSuperAdmin}">油罐车离场</span>
<span class="name" [ngClass]="{'isForceMake': data[7]?.isForceMake && isSuperAdmin}">油罐车离场</span>
</div>
</div>

9
src/app/pages/oil-unloading-process/oil-unloading-process.component.ts

@ -18,14 +18,15 @@ export class OilUnloadingProcessComponent implements OnInit {
this.isSuperAdmin = true;
}
}
lookImg(url) {
if (url) {
console.log(url);
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 = url;
node.src = item.violateImage;
node.id = "img";
dom.appendChild(node);
setTimeout(() => {

2
src/app/pages/records/oil-unloading-process-list/oil-unloading-process-list.component.ts

@ -870,7 +870,7 @@ export class OilUnloadingProcessListComponent implements OnInit {
console.log(item);
let arr = [];
let arr1 = item.oilUnloadingNodes.find((item) => {
return item.nodeName == "车辆进场" || item.nodeName == "油罐车进场";
return item.nodeName == "车辆进场" || item.nodeName == "油罐车进场";
});
let arr2 = item.oilUnloadingNodes.find((item) => {
return (

Loading…
Cancel
Save