Fix not correct detect index to chip drag-and-drop, style for autocomplete to the long attributes and display long attributes (#1914)
This commit is contained in:
parent
6a54e2ff1e
commit
d2965be1a7
@ -192,9 +192,9 @@ function DatasourceEntity($compile, $templateCache, $q, $mdDialog, $window, $doc
|
|||||||
dataKey.color = color;
|
dataKey.color = color;
|
||||||
ngModelCtrl.$setDirty();
|
ngModelCtrl.$setDirty();
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
scope.editDataKey = function (event, dataKey, index) {
|
scope.editDataKey = function (event, dataKey) {
|
||||||
|
|
||||||
$mdDialog.show({
|
$mdDialog.show({
|
||||||
controller: 'DatakeyConfigDialogController',
|
controller: 'DatakeyConfigDialogController',
|
||||||
@ -214,11 +214,12 @@ function DatasourceEntity($compile, $templateCache, $q, $mdDialog, $window, $doc
|
|||||||
var w = angular.element($window);
|
var w = angular.element($window);
|
||||||
w.triggerHandler('resize');
|
w.triggerHandler('resize');
|
||||||
}
|
}
|
||||||
}).then(function (dataKey) {
|
}).then(function (newDataKey) {
|
||||||
if ((dataKey.type === types.dataKeyType.timeseries) || (dataKey.type === types.dataKeyType.attribute)) {
|
let index = scope.dataKeys.indexOf(dataKey);
|
||||||
scope.dataKeys[index] = dataKey;
|
if ((newDataKey.type === types.dataKeyType.timeseries) || (newDataKey.type === types.dataKeyType.attribute)) {
|
||||||
} else if (dataKey.type === types.dataKeyType.alarm) {
|
scope.dataKeys[index] = newDataKey;
|
||||||
scope.alarmDataKeys[index] = dataKey;
|
} else if (newDataKey.type === types.dataKeyType.alarm) {
|
||||||
|
scope.alarmDataKeys[index] = newDataKey;
|
||||||
}
|
}
|
||||||
ngModelCtrl.$setDirty();
|
ngModelCtrl.$setDirty();
|
||||||
}, function () {
|
}, function () {
|
||||||
|
|||||||
@ -24,6 +24,7 @@
|
|||||||
display: block;
|
display: block;
|
||||||
height: 48px;
|
height: 48px;
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
|
white-space: normal !important;
|
||||||
|
|
||||||
.tb-no-entries {
|
.tb-no-entries {
|
||||||
line-height: 48px;
|
line-height: 48px;
|
||||||
@ -32,7 +33,6 @@
|
|||||||
|
|
||||||
li {
|
li {
|
||||||
height: auto !important;
|
height: auto !important;
|
||||||
white-space: normal !important;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -76,7 +76,7 @@
|
|||||||
<div class="tb-color-preview" ng-click="showColorPicker($event, $chip, $index)" style="margin-right: 5px;">
|
<div class="tb-color-preview" ng-click="showColorPicker($event, $chip, $index)" style="margin-right: 5px;">
|
||||||
<div class="tb-color-result" ng-style="{background: $chip.color}"></div>
|
<div class="tb-color-result" ng-style="{background: $chip.color}"></div>
|
||||||
</div>
|
</div>
|
||||||
<div layout="row">
|
<div layout="row" flex>
|
||||||
<div class="tb-chip-label">
|
<div class="tb-chip-label">
|
||||||
<span ng-show="$chip.type==types.dataKeyType.attribute">
|
<span ng-show="$chip.type==types.dataKeyType.attribute">
|
||||||
<md-tooltip>{{'datakey.attributes' | translate }}</md-tooltip>
|
<md-tooltip>{{'datakey.attributes' | translate }}</md-tooltip>
|
||||||
@ -94,7 +94,7 @@
|
|||||||
<strong ng-if="$chip.postFuncBody">f({{$chip.name}})</strong>
|
<strong ng-if="$chip.postFuncBody">f({{$chip.name}})</strong>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<md-button ng-click="editDataKey($event, $chip, $index)" class="md-icon-button tb-md-32">
|
<md-button ng-click="editDataKey($event, $chip)" class="md-icon-button tb-md-32">
|
||||||
<md-icon aria-label="edit" class="material-icons tb-md-20">edit</md-icon>
|
<md-icon aria-label="edit" class="material-icons tb-md-20">edit</md-icon>
|
||||||
</md-button>
|
</md-button>
|
||||||
</div>
|
</div>
|
||||||
@ -139,7 +139,7 @@
|
|||||||
<div class="tb-color-preview" ng-click="showColorPicker($event, $chip, $index)" style="margin-right: 5px;">
|
<div class="tb-color-preview" ng-click="showColorPicker($event, $chip, $index)" style="margin-right: 5px;">
|
||||||
<div class="tb-color-result" ng-style="{background: $chip.color}"></div>
|
<div class="tb-color-result" ng-style="{background: $chip.color}"></div>
|
||||||
</div>
|
</div>
|
||||||
<div layout="row">
|
<div layout="row" flex>
|
||||||
<div class="tb-chip-label">
|
<div class="tb-chip-label">
|
||||||
{{$chip.label}}
|
{{$chip.label}}
|
||||||
</div>
|
</div>
|
||||||
@ -149,7 +149,7 @@
|
|||||||
<strong ng-if="$chip.postFuncBody">f({{$chip.name}})</strong>
|
<strong ng-if="$chip.postFuncBody">f({{$chip.name}})</strong>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<md-button ng-click="editDataKey($event, $chip, $index)" class="md-icon-button tb-md-32">
|
<md-button ng-click="editDataKey($event, $chip)" class="md-icon-button tb-md-32">
|
||||||
<md-icon aria-label="edit" class="material-icons tb-md-20">edit</md-icon>
|
<md-icon aria-label="edit" class="material-icons tb-md-20">edit</md-icon>
|
||||||
</md-button>
|
</md-button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -162,7 +162,7 @@ function DatasourceFunc($compile, $templateCache, $mdDialog, $window, $document,
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
scope.editDataKey = function (event, dataKey, index) {
|
scope.editDataKey = function (event, dataKey) {
|
||||||
|
|
||||||
$mdDialog.show({
|
$mdDialog.show({
|
||||||
controller: 'DatakeyConfigDialogController',
|
controller: 'DatakeyConfigDialogController',
|
||||||
@ -182,11 +182,12 @@ function DatasourceFunc($compile, $templateCache, $mdDialog, $window, $document,
|
|||||||
var w = angular.element($window);
|
var w = angular.element($window);
|
||||||
w.triggerHandler('resize');
|
w.triggerHandler('resize');
|
||||||
}
|
}
|
||||||
}).then(function (dataKey) {
|
}).then(function (newDataKey) {
|
||||||
if (dataKey.type === types.dataKeyType.function) {
|
let index = scope.funcDataKeys.indexOf(dataKey);
|
||||||
scope.funcDataKeys[index] = dataKey;
|
if (newDataKey.type === types.dataKeyType.function) {
|
||||||
} else if (dataKey.type === types.dataKeyType.alarm) {
|
scope.funcDataKeys[index] = newDataKey;
|
||||||
scope.alarmDataKeys[index] = dataKey;
|
} else if (newDataKey.type === types.dataKeyType.alarm) {
|
||||||
|
scope.alarmDataKeys[index] = newDataKey;
|
||||||
}
|
}
|
||||||
ngModelCtrl.$setDirty();
|
ngModelCtrl.$setDirty();
|
||||||
}, function () {
|
}, function () {
|
||||||
|
|||||||
@ -64,7 +64,7 @@
|
|||||||
<div class="tb-color-preview" ng-click="showColorPicker($event, $chip, $index)" style="margin-right: 5px;">
|
<div class="tb-color-preview" ng-click="showColorPicker($event, $chip, $index)" style="margin-right: 5px;">
|
||||||
<div class="tb-color-result" ng-style="{background: $chip.color}"></div>
|
<div class="tb-color-result" ng-style="{background: $chip.color}"></div>
|
||||||
</div>
|
</div>
|
||||||
<div layout="row">
|
<div layout="row" flex>
|
||||||
<div class="tb-chip-label">
|
<div class="tb-chip-label">
|
||||||
{{$chip.label}}
|
{{$chip.label}}
|
||||||
</div>
|
</div>
|
||||||
@ -73,7 +73,7 @@
|
|||||||
<strong>{{$chip.name}}</strong>
|
<strong>{{$chip.name}}</strong>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<md-button ng-click="editDataKey($event, $chip, $index)" class="md-icon-button tb-md-32">
|
<md-button ng-click="editDataKey($event, $chip)" class="md-icon-button tb-md-32">
|
||||||
<md-icon aria-label="edit" class="material-icons tb-md-20">edit</md-icon>
|
<md-icon aria-label="edit" class="material-icons tb-md-20">edit</md-icon>
|
||||||
</md-button>
|
</md-button>
|
||||||
</div>
|
</div>
|
||||||
@ -118,7 +118,7 @@
|
|||||||
<div class="tb-color-preview" ng-click="showColorPicker($event, $chip, $index)" style="margin-right: 5px;">
|
<div class="tb-color-preview" ng-click="showColorPicker($event, $chip, $index)" style="margin-right: 5px;">
|
||||||
<div class="tb-color-result" ng-style="{background: $chip.color}"></div>
|
<div class="tb-color-result" ng-style="{background: $chip.color}"></div>
|
||||||
</div>
|
</div>
|
||||||
<div layout="row">
|
<div layout="row" flex>
|
||||||
<div class="tb-chip-label">
|
<div class="tb-chip-label">
|
||||||
{{$chip.label}}
|
{{$chip.label}}
|
||||||
</div>
|
</div>
|
||||||
@ -128,7 +128,7 @@
|
|||||||
<strong ng-if="$chip.postFuncBody">f({{$chip.name}})</strong>
|
<strong ng-if="$chip.postFuncBody">f({{$chip.name}})</strong>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<md-button ng-click="editDataKey($event, $chip, $index)" class="md-icon-button tb-md-32">
|
<md-button ng-click="editDataKey($event, $chip)" class="md-icon-button tb-md-32">
|
||||||
<md-icon aria-label="edit" class="material-icons tb-md-20">edit</md-icon>
|
<md-icon aria-label="edit" class="material-icons tb-md-20">edit</md-icon>
|
||||||
</md-button>
|
</md-button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user