fix dashboar

This commit is contained in:
=
2020-09-10 10:12:14 +02:00
parent b135f017d5
commit 002b235d76
4 changed files with 26 additions and 8 deletions
@@ -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) {
@@ -112,14 +112,14 @@
<div class="setpoint">
<img src="assets/icons/png/inv.png" />
<label>{{panel.tempAct}}°C</label>
<button @click="sendSoftKey(37)">
<button @click="sendSoftKey('dash_setpoint_minus')">
<i class="fa fa-minus"></i>
</button>
<div>
<small>{{'dashboard-setpoint' | localize('set point')}}</small>
<span>{{panel.tempSetpoint}}°C</span>
</div>
<button @click="sendSoftKey(36)">
<button @click="sendSoftKey('dash_setpoint_plus')">
<i class="fa fa-plus"></i>
</button>
</div>
@@ -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);
});
@@ -44,6 +44,7 @@ export interface SoftKeysConfigurationModel {
category: number,
operatorConfirmationNeeded: boolean,
type: 2,
refCallParam: string,
subKeys: Object
}