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 @@