fix Entities Table widget column order
This commit is contained in:
parent
1bfb969245
commit
3f83e26d07
@ -57,7 +57,7 @@
|
|||||||
<mat-option *ngFor="let column of configuredColumns; let $index = index"
|
<mat-option *ngFor="let column of configuredColumns; let $index = index"
|
||||||
[value]="$index"
|
[value]="$index"
|
||||||
[disabled]="usedCellClickColumns.includes($index)">
|
[disabled]="usedCellClickColumns.includes($index)">
|
||||||
{{ getCellClickColumnInfo($index, column) }}
|
{{ getCellClickColumnInfo($index, column) | customTranslate }}
|
||||||
</mat-option>
|
</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
<mat-icon matSuffix
|
<mat-icon matSuffix
|
||||||
|
|||||||
@ -926,7 +926,26 @@ export class WidgetConfigComponent extends PageComponent implements OnInit, OnDe
|
|||||||
if (this.modelValue) {
|
if (this.modelValue) {
|
||||||
const configuredColumns = new Array<CellClickColumnInfo>();
|
const configuredColumns = new Array<CellClickColumnInfo>();
|
||||||
if (this.modelValue.config?.datasources[0]?.dataKeys?.length) {
|
if (this.modelValue.config?.datasources[0]?.dataKeys?.length) {
|
||||||
configuredColumns.push(...this.keysToCellClickColumns(this.modelValue.config.datasources[0].dataKeys));
|
const {
|
||||||
|
displayEntityLabel,
|
||||||
|
displayEntityName,
|
||||||
|
displayEntityType,
|
||||||
|
entityNameColumnTitle,
|
||||||
|
entityLabelColumnTitle
|
||||||
|
} = this.modelValue.config.settings;
|
||||||
|
const displayEntitiesArray = [];
|
||||||
|
if (isDefined(displayEntityName)) {
|
||||||
|
const displayName = entityNameColumnTitle ? entityNameColumnTitle : 'entityName';
|
||||||
|
displayEntitiesArray.push({name: displayName, label: displayName});
|
||||||
|
}
|
||||||
|
if (isDefined(displayEntityLabel)) {
|
||||||
|
const displayLabel = entityLabelColumnTitle ? entityLabelColumnTitle : 'entityLabel';
|
||||||
|
displayEntitiesArray.push({name: displayLabel, label: displayLabel});
|
||||||
|
}
|
||||||
|
if (isDefined(displayEntityType)) {
|
||||||
|
displayEntitiesArray.push({name: 'entityType', label: 'entityType'});
|
||||||
|
}
|
||||||
|
configuredColumns.push(...displayEntitiesArray, ...this.keysToCellClickColumns(this.modelValue.config.datasources[0].dataKeys));
|
||||||
}
|
}
|
||||||
if (this.modelValue.config?.alarmSource?.dataKeys?.length) {
|
if (this.modelValue.config?.alarmSource?.dataKeys?.length) {
|
||||||
configuredColumns.push(...this.keysToCellClickColumns(this.modelValue.config.alarmSource.dataKeys));
|
configuredColumns.push(...this.keysToCellClickColumns(this.modelValue.config.alarmSource.dataKeys));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user