Added softey preferred actions

This commit is contained in:
Nicola Carminati
2018-07-30 16:38:01 +02:00
parent 167fb83113
commit 861726005d
2 changed files with 14 additions and 7 deletions
+8 -1
View File
@@ -1,7 +1,7 @@
import Vue from "vue";
import Componet from "vue-class-component";
import { onOffSoftKey, procedureSoftKey, groupSoftKey } from "./under-the-hood"
import { AppModel, machineInfoActions, store } from "../store";
import { AppModel, machineInfoActions, store,appModelActions } from "../store";
import {SoftKeysConfigurationModel} from "../store/machineInfo.store"
import { Hub } from "src/services/hub";
import { mapGetters } from 'vuex'
@@ -21,6 +21,7 @@ export default class softKeys extends Vue {
public waitingForStart: boolean = false;
public disabled: boolean = false;
public enableSelected: boolean = false;
public startedFromProduction: boolean = false;
public indexArray: number = 0;
public get arrayItemPrefered(): Array<SoftKeysConfigurationModel>{
@@ -45,6 +46,7 @@ export default class softKeys extends Vue {
this.enableSelected = args[0];
else
this.enableSelected = false;
this.startedFromProduction = true;
});
Factory.Get(MessageService).subscribeToChannel("update-softkeys-favorite", args => {
awaiter (new DataService().GetUserSoftkeyFavorite());
@@ -145,10 +147,12 @@ export default class softKeys extends Vue {
public enableSelect(){
this.enableSelected = true;
this.startedFromProduction = false;
}
public disableSelect(){
this.enableSelected = false;
this.startedFromProduction = false;
}
public addItemSelectPrefered(b){
@@ -176,7 +180,10 @@ export default class softKeys extends Vue {
array.push(element.id);
});
await awaiter(new DataService().AddUserSoftkeyFavorite(array, this.arrayItemPrefered));
if(this.startedFromProduction)
appModelActions.MainViewLiftDown(this.$store);
this.enableSelected = false;
this.startedFromProduction = false;
}
public isSelected(b){
+6 -6
View File
@@ -14,16 +14,16 @@
<i class="fa fa-arrow-down"></i>
</div>
</button>
<button v-if="!enableSelected" @click="enableSelect()" class="btn-star">
<div class="fa-icons">
<img src="assets/icons/under-hood-png/preferiti-not-sel.png" />
</div>
</button>
<button v-if="enableSelected" @click="addItemsToFavorites()" class="btn-star">
<button v-if="!enableSelected" @click="enableSelect()" class="btn-star" >
<div class="fa-icons">
<img src="assets/icons/under-hood-png/preferiti-sel.png" />
</div>
</button>
<button v-if="enableSelected" @click="addItemsToFavorites()" class="btn-star" disabled >
<div class="fa-icons">
<img src="assets/icons/under-hood-png/preferiti-not-sel.png" />
</div>
</button>
</header>
<div class="title" >{{'sfk_category_' + selectedSection | localize('sfk_category_' + selectedSection) }}</div>
<section class="scrollable" ref="scrollable">