Fix - removed focus from inputs after enter button press

Fix setup bug, it didn't write the configuration after the first installation
This commit is contained in:
Lucio Maranta
2019-07-08 16:37:48 +02:00
parent 613222acae
commit 2c8fecb926
5 changed files with 14 additions and 8 deletions
+2 -1
View File
@@ -257,8 +257,9 @@ var
Result:= false;
Exit;
end;
Result:= True;
end;
Result:= True;
end;
function GetOverwriteConfig: Boolean;
@@ -80,12 +80,14 @@ export default class CardScadaProduction extends Vue {
await scadaService.SendButtonValue(this.scadaId, itemId);
}
async sendInputValue(item:any, value: any) {
async sendInputValue($event, item:any, value: any) {
item.value.notUpdated = true;
item.value.oldVal = item.value.value;
await scadaService.SendInputValue(this.scadaId, item.id, value);
item.value.notUpdated = false;
// Remove focus from input
if($event)
$event.target.blur()
}
mounted() {
@@ -86,7 +86,7 @@
:disabled="!item.value.isEnabled"
@focus="onFocus(item)"
@blur="onBlur(item)"
@keyup.enter="sendInputValue(item, item.value.value)"
@keyup.enter="sendInputValue($event, item, item.value.value);"
:style="{
top: `${item.position.y + topShift}px`,
left: `${item.position.x + leftShift}px`,
@@ -104,7 +104,7 @@
class="input-group-append">
<button class="appended-btn"
:disabled="!item.value.isEnabled"
@mousedown="sendInputValue(item, item.value.value)"
@mousedown="sendInputValue(null, item, item.value.value)"
:style="{
width: `${item.size.y + 3}px`,
height: `${item.size.y + 3}px`}">
@@ -99,11 +99,14 @@ export default class Scada extends Vue {
await scadaService.SendButtonValue(this.currentScadaId, itemId);
}
async sendInputValue(item: any, value: any) {
async sendInputValue($event, item: any, value: any) {
item.value.updated = false;
item.value.oldVal = item.value.value;
await scadaService.SendInputValue(this.currentScadaId, item.id, value);
item.value.updated = true;
// Remove focus from input
if($event)
$event.target.blur()
}
async mounted() {
@@ -101,7 +101,7 @@
:disabled="!item.value.isEnabled"
@focus="onFocus(item)"
@blur="onBlur(item)"
@keyup.enter="sendInputValue(item, item.value.value)"
@keyup.enter="sendInputValue($event, item, item.value.value)"
:style="{
top: `${item.position.y + topShift}px`,
left: `${item.position.x + leftShift}px`,
@@ -119,7 +119,7 @@
class="input-group-append">
<button class="appended-btn"
:disabled="!item.value.isEnabled"
@mousedown="sendInputValue(item, item.value.value)"
@mousedown="sendInputValue(null, item, item.value.value)"
:style="{
width: `${item.size.y + 3}px`,
height: `${item.size.y + 3}px`}">