邵佳豪 3 years ago
parent
commit
81e85cafc7
  1. 4
      src/app/pages/left-domain/left-domain.component.html
  2. 20
      src/app/pages/left-domain/left-domain.component.ts

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

@ -74,7 +74,7 @@
<p [title]="item.getPropertyData().brand"><input type="text" class="tableInput" [disabled]="!editMode" [(ngModel)]="item.getPropertyData().brand" (click)="stopBubbling($event)"></p>
<p [title]="item.getPropertyData().oilGunNum"><input type="text" class="tableInput" [disabled]="!editMode" [(ngModel)]="item.getPropertyData().oilGunNum" (click)="stopBubbling($event)"></p>
<p [title]="item.getPropertyData().oilProductNo"><input type="text" class="tableInput" [disabled]="!editMode" [(ngModel)]="item.getPropertyData().oilProductNo" (click)="stopBubbling($event)"></p>
<p [title]="item.getPropertyData().oilGunNo" class="overflowP"><textarea [disabled]="!editMode" [(ngModel)]="item.getPropertyData().oilGunNo" (click)="stopBubbling($event)"></textarea></p>
<p [title]="item.getPropertyData().oilGunNo" class="overflowP"><textarea [disabled]="!editMode" [(ngModel)]="item.getPropertyData().oilGunNo" (click)="stopBubbling($event)" [ngStyle]="{'line-height': isLineFeed(item.getPropertyData().oilGunNo)? '48px' : '24px'}"></textarea></p>
<p style="padding-left: 8px;" (click)="stopBubbling($event)">
<nz-select class="tableSelect" [nzBorderless]="true" [nzDisabled]="!editMode" [(ngModel)]="item.getPropertyData().oilPumpType">
<nz-option nzValue="zxb" nzLabel="自吸泵"></nz-option>
@ -101,7 +101,7 @@
</div>
<div class="tableContent">
<p [title]="item.getPropertyData().oilProductNo"><input type="text" class="tableInput" [disabled]="!editMode" [(ngModel)]="item.getPropertyData().oilProductNo" (click)="stopBubbling($event)"></p>
<p [title]="item.getPropertyData().oilGunNo" class="overflowP"><textarea [disabled]="!editMode" [(ngModel)]="item.getPropertyData().oilGunNo" (click)="stopBubbling($event)"></textarea></p>
<p [title]="item.getPropertyData().oilGunNo" class="overflowP"><textarea [disabled]="!editMode" [(ngModel)]="item.getPropertyData().oilGunNo" (click)="stopBubbling($event)" [ngStyle]="{'line-height': isLineFeed(item.getPropertyData().oilGunNo)? '48px' : '24px'}"></textarea></p>
<p [title]="item.getPropertyData().oilTankVolume"><input type="text" class="tableInput" [disabled]="!editMode" [(ngModel)]="item.getPropertyData().oilTankVolume" (click)="stopBubbling($event)"></p>
<p [title]="item.getPropertyData().safeVolume"><input type="text" class="tableInput" [disabled]="!editMode" [(ngModel)]="item.getPropertyData().safeVolume" (click)="stopBubbling($event)"></p>
<p [title]="item.getPropertyData().tankFarm"><input type="text" class="tableInput" [disabled]="!editMode" [(ngModel)]="item.getPropertyData().tankFarm" (click)="stopBubbling($event)"></p>

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

@ -207,6 +207,26 @@ export class LeftDomainComponent implements OnInit {
//编辑模式
}
//是否换行
isLineFeed(str: string):boolean {
if (str) {
let strlen = 0;
for (var i = 0;i < str.length; i++) {
if(str.charCodeAt(i) > 255) //如果是汉字,则字符串长度加2
strlen += 2;
else
strlen++;
}
if (strlen >= 16) {
return false
} else {
return true
}
} else {
return true
}
}
//获取设备 数量
getFacilityNum(type: string): string {
let num = 0

Loading…
Cancel
Save