Added softey preferred actions
This commit is contained in:
@@ -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){
|
||||
|
||||
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user