From 861726005db512381e026feec70feb32e3428a64 Mon Sep 17 00:00:00 2001 From: Nicola Carminati Date: Mon, 30 Jul 2018 16:38:01 +0200 Subject: [PATCH] Added softey preferred actions --- Step/wwwroot/src/modules/plc-softkeys.ts | 9 ++++++++- Step/wwwroot/src/modules/plc-softkeys.vue | 12 ++++++------ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/Step/wwwroot/src/modules/plc-softkeys.ts b/Step/wwwroot/src/modules/plc-softkeys.ts index 9cbf0ccb..2a4c3012 100644 --- a/Step/wwwroot/src/modules/plc-softkeys.ts +++ b/Step/wwwroot/src/modules/plc-softkeys.ts @@ -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{ @@ -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){ diff --git a/Step/wwwroot/src/modules/plc-softkeys.vue b/Step/wwwroot/src/modules/plc-softkeys.vue index 991ea990..39e2c7f1 100644 --- a/Step/wwwroot/src/modules/plc-softkeys.vue +++ b/Step/wwwroot/src/modules/plc-softkeys.vue @@ -14,16 +14,16 @@ - - +
{{'sfk_category_' + selectedSection | localize('sfk_category_' + selectedSection) }}