From 002b235d76b2bf65af8d2c1be584d5ed1eafe067 Mon Sep 17 00:00:00 2001 From: = Date: Thu, 10 Sep 2020 10:12:14 +0200 Subject: [PATCH] fix dashboar --- .../app_modules_thermo/dashboard/dashboard.ts | 23 ++++++++++++++++--- .../dashboard/dashboard.vue | 4 ++-- .../wwwroot/src/filters/localizeFilter.ts | 6 ++--- .../wwwroot/src/store/machineInfo.store.ts | 1 + 4 files changed, 26 insertions(+), 8 deletions(-) diff --git a/Thermo.Active/wwwroot/src/app_modules_thermo/dashboard/dashboard.ts b/Thermo.Active/wwwroot/src/app_modules_thermo/dashboard/dashboard.ts index 8c6cbc48..50588d81 100644 --- a/Thermo.Active/wwwroot/src/app_modules_thermo/dashboard/dashboard.ts +++ b/Thermo.Active/wwwroot/src/app_modules_thermo/dashboard/dashboard.ts @@ -4,7 +4,7 @@ import { Prop, Watch } from 'vue-property-decorator'; import { messageService } from '@/_base'; import AppRibbon from "@/components/app-ribbon.vue"; import { alarmList } from "@/app_modules/alarms"; -import { AppModel, appModelActions } from '@/store'; +import { AppModel, appModelActions, store } from '@/store'; import { getColorFromName, isDarkColor } from "@/_base/utils"; import ArchInterface from "../components/arch-interface/arch-interface.vue"; import gauge from "./base-components/gauge.vue"; @@ -13,6 +13,7 @@ import moment from 'moment'; import stats from "./base-components/stats.vue"; import hitem from "./base-components/item.vue"; import { Hub } from '@/services'; +import { SoftKeysConfigurationModel } from '@/store/machineInfo.store'; @Component({ components: { @@ -65,6 +66,19 @@ export default class Dashboard extends Vue { return (this.$store.state as AppModel).machineInfo.cmsConnectReady; } + get softKeys(): { [id: number]: SoftKeysConfigurationModel[] } { + return store.state.machineInfo.softKeys as { [id: number]: SoftKeysConfigurationModel[] }; + } + + get allSoftKeys(): SoftKeysConfigurationModel[] { + var result = []; + for (const key in this.softKeys) { + const element = this.softKeys[key]; + result.push(...element); + } + return result; + } + loading = false; async loadMore() { if (this.loading) return; @@ -144,8 +158,11 @@ export default class Dashboard extends Vue { } } - sendSoftKey(id: number) { - Hub.Current.sendUserSoftKey(id); + sendSoftKey(id: string) { + debugger + var sk = this.allSoftKeys.find(s => s.refCallParam == id); + if (sk) + Hub.Current.sendUserSoftKey(sk.id); } public sendMessage(name: string) { diff --git a/Thermo.Active/wwwroot/src/app_modules_thermo/dashboard/dashboard.vue b/Thermo.Active/wwwroot/src/app_modules_thermo/dashboard/dashboard.vue index d53c0104..61b12591 100644 --- a/Thermo.Active/wwwroot/src/app_modules_thermo/dashboard/dashboard.vue +++ b/Thermo.Active/wwwroot/src/app_modules_thermo/dashboard/dashboard.vue @@ -112,14 +112,14 @@
-
{{'dashboard-setpoint' | localize('set point')}} {{panel.tempSetpoint}}°C
-
diff --git a/Thermo.Active/wwwroot/src/filters/localizeFilter.ts b/Thermo.Active/wwwroot/src/filters/localizeFilter.ts index d44f32d3..b9de7eba 100644 --- a/Thermo.Active/wwwroot/src/filters/localizeFilter.ts +++ b/Thermo.Active/wwwroot/src/filters/localizeFilter.ts @@ -17,9 +17,9 @@ Vue.filter("localize", function (key: string, defaultValue: string, ...args): st if (!value) dvalue = labels[key]; - if (!value && !dvalue) { - console.debug("missing localization key:", key); - } + // if (!value && !dvalue) { + // console.debug("missing localization key:", key); + // } return pf.vsprintf(value || dvalue || defaultValue, args); }); diff --git a/Thermo.Active/wwwroot/src/store/machineInfo.store.ts b/Thermo.Active/wwwroot/src/store/machineInfo.store.ts index e10c7a1f..bfd0b6e0 100644 --- a/Thermo.Active/wwwroot/src/store/machineInfo.store.ts +++ b/Thermo.Active/wwwroot/src/store/machineInfo.store.ts @@ -44,6 +44,7 @@ export interface SoftKeysConfigurationModel { category: number, operatorConfirmationNeeded: boolean, type: 2, + refCallParam: string, subKeys: Object }