Remove unused DESC1-4 from front

This commit is contained in:
Michał Zieliski
2024-07-03 19:27:05 +02:00
parent 17037a1a3d
commit fe8118c42a
3 changed files with 11 additions and 42 deletions

View File

@@ -35,10 +35,6 @@ export class Record extends Base {
value31?: number;
value32?: number;
desc1?: string;
desc2?: string;
desc3?: string;
desc4?: string;
desc5?: string;
constructor(data: Partial<Record> = {}) {
super();

View File

@@ -250,30 +250,6 @@
<td mat-footer-cell *matFooterCellDef></td>
</ng-container>
<ng-container matColumnDef="desc2">
<th mat-header-cell *matHeaderCellDef mat-sort-header>Description2</th>
<td mat-cell *matCellDef="let row"> {{row.desc2}} </td>
<td mat-footer-cell *matFooterCellDef></td>
</ng-container>
<ng-container matColumnDef="desc3">
<th mat-header-cell *matHeaderCellDef mat-sort-header>Description3</th>
<td mat-cell *matCellDef="let row"> {{row.desc3}} </td>
<td mat-footer-cell *matFooterCellDef></td>
</ng-container>
<ng-container matColumnDef="desc4">
<th mat-header-cell *matHeaderCellDef mat-sort-header>Description4</th>
<td mat-cell *matCellDef="let row"> {{row.desc4}} </td>
<td mat-footer-cell *matFooterCellDef></td>
</ng-container>
<ng-container matColumnDef="desc5">
<th mat-header-cell *matHeaderCellDef mat-sort-header>Description5</th>
<td mat-cell *matCellDef="let row"> {{row.desc5}} </td>
<td mat-footer-cell *matFooterCellDef></td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns, sticky: true"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
<tr mat-footer-row *matFooterRowDef="displayedColumns"></tr>

View File

@@ -80,13 +80,11 @@ export class LayerDetailComponent implements OnInit {
}
}
}
for (let i = 1; i < 6; i++) {
for (const record of this.document.records) {
const propertyName = `desc${i}` as keyof typeof record;
if (record[propertyName] !== null) {
this.displayedColumns.push(`desc${i}`);
break;
}
for (const record of this.document.records) {
if (record.desc1 !== null) {
this.displayedColumns.push(`desc1`);
break;
}
}
}
@@ -143,7 +141,6 @@ export class LayerDetailComponent implements OnInit {
//= codes.map(code => this.getRecordValue(this.document.records.find(x => x.code === code)!, i+1));
this.shortRecords.push(res);
}
console.log('shortRecords', this.shortRecords);
});
}