fix button modal and binding for modal options

This commit is contained in:
francesco.guerrieri
2020-05-07 11:55:31 +02:00
parent cf240405a5
commit 9c1928c7ae
11 changed files with 210 additions and 148 deletions
+10 -10
View File
@@ -178,25 +178,25 @@ declare module Recipe{
options_undercutupperplate_10_delay_acti?:IValue,
options_undercutupperplate_10_delay_dis?:IValue,
options_thermoregulator_1_enabled?:IStatus,
options_thermoregulator_1_enabled?:IValue,
options_thermoregulator_1_setpoint?:IValue,
options_thermoregulator_2_enabled?:IStatus,
options_thermoregulator_2_enabled?:IValue,
options_thermoregulator_2_setpoint?:IValue,
options_thermoregulator_3_enabled?:IStatus,
options_thermoregulator_3_enabled?:IValue,
options_thermoregulator_3_setpoint?:IValue,
options_thermoregulator_4_enabled?:IStatus,
options_thermoregulator_4_enabled?:IValue,
options_thermoregulator_4_setpoint?:IValue,
options_thermoregulator_5_enabled?:IStatus,
options_thermoregulator_5_enabled?:IValue,
options_thermoregulator_5_setpoint?:IValue,
options_thermoregulator_6_enabled?:IStatus,
options_thermoregulator_6_enabled?:IValue,
options_thermoregulator_6_setpoint?:IValue,
options_thermoregulator_7_enabled?:IStatus,
options_thermoregulator_7_enabled?:IValue,
options_thermoregulator_7_setpoint?:IValue,
options_thermoregulator_8_enabled?:IStatus,
options_thermoregulator_8_enabled?:IValue,
options_thermoregulator_8_setpoint?:IValue,
options_thermoregulator_9_enabled?:IStatus,
options_thermoregulator_9_enabled?:IValue,
options_thermoregulator_9_setpoint?:IValue,
options_thermoregulator_10_enabled?:IStatus,
options_thermoregulator_10_enabled?:IValue,
options_thermoregulator_10_setpoint?:IValue,
}
@@ -18,10 +18,12 @@ export default class ShowEstrazioneInfo extends Vue{
annulla(){
ModalHelper.HideModal();
messageService.publishToChannel('show-vuoto-info');
};
conferma(){
ModalHelper.HideModal();
messageService.publishToChannel('show-opzioni-info');
};
async beforeMount() {
@@ -9,28 +9,33 @@ export default class inputTermo extends Vue{
@Prop()
value:number;
@Prop({default:0})
min:number;
@Prop({default:0})
max:number;
// @Prop({default:0})
// min:number;
// @Prop({default:0})
// max:number;
@Prop({default:""})
unitMeasure:string;
@Prop({default:false})
visible_abilitazione: boolean;
@Prop({default:false})
enabled_abilitazione: boolean;
@Prop({default:false})
hasError_abilitazione: boolean;
@Prop({})
abilitazione:Recipe.IValue;
@Prop({})
setpoint:Recipe.IValue;
// @Prop({default:false})
// visible_abilitazione: boolean;
// @Prop({default:false})
// enabled_abilitazione: boolean;
// @Prop({default:false})
// hasError_abilitazione: boolean;
abilit:boolean=this.enabled_abilitazione;
// mockSet:number=this.setpoint;
// abilit:boolean=this.enabled_abilitazione;
// // mockSet:number=this.setpoint;
get mockSet() {
return this.value;
};
// get mockSet() {
// return this.value;
// };
set mockSet(v: number) {
this.$emit('input', v);
};
// set mockSet(v: number) {
// this.$emit('input', v);
// };
}
@@ -2,13 +2,13 @@
<div>
<div class="input-area">
<label>Abilitazione</label>
<toggle-button v-model="abilit" v-if="visible_abilitazione"></toggle-button>
<toggle-button v-model="abilitazione.status.enabled" v-if="abilitazione.status.visible"></toggle-button>
</div>
<div class="input-area">
<label>Setpoint</label>
<input class="rect" v-model="mockSet">
<input class="rect" v-model="setpoint.valueAct">
</div>
<slider :min="min" :max="max" v-model="mockSet" :unit-of-measure="'°C'"></slider>
<slider :min="setpoint.range.min" :max="setpoint.range.max" v-model="setpoint.valueAct" :unit-of-measure="unitMeasure"></slider>
</div>
</template>
<script src="./inputTermo.ts" />
@@ -8,9 +8,9 @@ export default class setupTermo extends Vue {
@Prop({default:""})
numTermo: string;
@Prop({default:false})
status: boolean;
@Prop()
status: Recipe.IValue;
@Prop({default:0})
setpoint: number;
@Prop()
setpoint: Recipe.IValue;
}
@@ -1,8 +1,8 @@
<template>
<div class="section">
<label>{{numTermo}}</label>
<label>{{status}}</label>
<label>{{setpoint}} °C</label>
<label>{{status.enabled}}</label>
<label>{{setpoint.valueAct}} °C</label>
</div>
</template>
<script src="./setupTermo.ts" lang="ts"></script>
@@ -15,9 +15,17 @@ export default class Termoragolatori extends Vue {
recipe:Recipe.IRecipe={
options_thermoregulator_1_enabled:{
visible:true,
enabled:true,
hasError:false
range:{
min:5,
max:171
},
status:{
visible:true,
enabled:true,
hasError:false
},
unitMeasure:"",
valueAct:132
},
options_thermoregulator_1_setpoint:{
range:{
@@ -34,9 +42,17 @@ export default class Termoragolatori extends Vue {
},
options_thermoregulator_2_enabled:{
visible:true,
enabled:true,
hasError:false
range:{
min:8,
max:107
},
status:{
visible:true,
enabled:true,
hasError:false
},
unitMeasure:"",
valueAct:53
},
options_thermoregulator_2_setpoint:{
range:{
@@ -53,9 +69,17 @@ export default class Termoragolatori extends Vue {
},
options_thermoregulator_3_enabled:{
visible:true,
enabled:true,
hasError:false
range:{
min:7,
max:112
},
status:{
visible:true,
enabled:true,
hasError:false
},
unitMeasure:"",
valueAct:30
},
options_thermoregulator_3_setpoint:{
range:{
@@ -72,9 +96,17 @@ export default class Termoragolatori extends Vue {
},
options_thermoregulator_4_enabled:{
visible:true,
enabled:true,
hasError:false
range:{
min:1,
max:166
},
status:{
visible:true,
enabled:true,
hasError:false
},
unitMeasure:"",
valueAct:148
},
options_thermoregulator_4_setpoint:{
range:{
@@ -91,9 +123,17 @@ export default class Termoragolatori extends Vue {
},
options_thermoregulator_5_enabled:{
visible:true,
enabled:true,
hasError:false
range:{
min:3,
max:134
},
status:{
visible:true,
enabled:true,
hasError:false
},
unitMeasure:"",
valueAct:42
},
options_thermoregulator_5_setpoint:{
range:{
@@ -110,9 +150,17 @@ export default class Termoragolatori extends Vue {
},
options_thermoregulator_6_enabled:{
visible:true,
enabled:true,
hasError:false
range:{
min:0,
max:178
},
status:{
visible:true,
enabled:true,
hasError:false
},
unitMeasure:"",
valueAct:130
},
options_thermoregulator_6_setpoint:{
range:{
@@ -129,9 +177,17 @@ export default class Termoragolatori extends Vue {
},
options_thermoregulator_7_enabled:{
visible:true,
enabled:true,
hasError:false
range:{
min:3,
max:163
},
status:{
visible:true,
enabled:true,
hasError:false
},
unitMeasure:"",
valueAct:120
},
options_thermoregulator_7_setpoint:{
range:{
@@ -148,9 +204,17 @@ export default class Termoragolatori extends Vue {
},
options_thermoregulator_8_enabled:{
visible:true,
enabled:true,
hasError:false
range:{
min:9,
max:158
},
status:{
visible:true,
enabled:true,
hasError:false
},
unitMeasure:"",
valueAct:101
},
options_thermoregulator_8_setpoint:{
range:{
@@ -167,9 +231,17 @@ export default class Termoragolatori extends Vue {
},
options_thermoregulator_9_enabled:{
visible:true,
enabled:true,
hasError:false
range:{
min:6,
max:112
},
status:{
visible:true,
enabled:true,
hasError:false
},
unitMeasure:"",
valueAct:43
},
options_thermoregulator_9_setpoint:{
range:{
@@ -186,9 +258,17 @@ export default class Termoragolatori extends Vue {
},
options_thermoregulator_10_enabled:{
visible:true,
enabled:true,
hasError:false
range:{
min:7,
max:147
},
status:{
visible:true,
enabled:true,
hasError:false
},
unitMeasure:"",
valueAct:8
},
options_thermoregulator_10_setpoint:{
range:{
@@ -4,71 +4,71 @@
<button :class="{'active':showTermo == 'termo-1'}" @click="showTermo='termo-1'">
<setup-termo
:numTermo="1"
:status="recipe.options_thermoregulator_1_enabled.enabled"
:setpoint="recipe.options_thermoregulator_1_setpoint.valueAct"
:status="recipe.options_thermoregulator_1_enabled.status"
:setpoint="recipe.options_thermoregulator_1_setpoint"
></setup-termo>
</button>
<button :class="{'active':showTermo == 'termo-2'}" @click="showTermo='termo-2'" class="box-color">
<setup-termo
:numTermo="2"
:status="recipe.options_thermoregulator_2_enabled.enabled"
:setpoint="recipe.options_thermoregulator_2_setpoint.valueAct"
:status="recipe.options_thermoregulator_2_enabled.status"
:setpoint="recipe.options_thermoregulator_2_setpoint"
></setup-termo>
</button>
<button :class="{'active':showTermo == 'termo-3'}" @click="showTermo='termo-3'">
<setup-termo
:numTermo="3"
:status="recipe.options_thermoregulator_3_enabled.enabled"
:setpoint="recipe.options_thermoregulator_3_setpoint.valueAct"
:status="recipe.options_thermoregulator_3_enabled.status"
:setpoint="recipe.options_thermoregulator_3_setpoint"
></setup-termo>
</button>
<button :class="{'active':showTermo == 'termo-4'}" @click="showTermo='termo-4'" class="box-color">
<setup-termo
:numTermo="4"
:status="recipe.options_thermoregulator_4_enabled.enabled"
:setpoint="recipe.options_thermoregulator_4_setpoint.valueAct"
:status="recipe.options_thermoregulator_4_enabled.status"
:setpoint="recipe.options_thermoregulator_4_setpoint"
></setup-termo>
</button>
<button :class="{'active':showTermo == 'termo-5'}" @click="showTermo='termo-5'">
<setup-termo
:numTermo="5"
:status="recipe.options_thermoregulator_5_enabled.enabled"
:setpoint="recipe.options_thermoregulator_5_setpoint.valueAct"
:status="recipe.options_thermoregulator_5_enabled.status"
:setpoint="recipe.options_thermoregulator_5_setpoint"
></setup-termo>
</button>
<button :class="{'active':showTermo == 'termo-6'}" @click="showTermo='termo-6'" class="box-color">
<setup-termo
:numTermo="6"
:status="recipe.options_thermoregulator_6_enabled.enabled"
:setpoint="recipe.options_thermoregulator_6_setpoint.valueAct"
:status="recipe.options_thermoregulator_6_enabled.status"
:setpoint="recipe.options_thermoregulator_6_setpoint"
></setup-termo>
</button>
<button :class="{'active':showTermo == 'termo-7'}" @click="showTermo='termo-7'">
<setup-termo
:numTermo="7"
:status="recipe.options_thermoregulator_7_enabled.enabled"
:setpoint="recipe.options_thermoregulator_7_setpoint.valueAct"
:status="recipe.options_thermoregulator_7_enabled.status"
:setpoint="recipe.options_thermoregulator_7_setpoint"
></setup-termo>
</button>
<button :class="{'active':showTermo == 'termo-8'}" @click="showTermo='termo-8'" class="box-color">
<setup-termo
:numTermo="8"
:status="recipe.options_thermoregulator_8_enabled.enabled"
:setpoint="recipe.options_thermoregulator_8_setpoint.valueAct"
:status="recipe.options_thermoregulator_8_enabled.status"
:setpoint="recipe.options_thermoregulator_8_setpoint"
></setup-termo>
</button>
<button :class="{'active':showTermo == 'termo-9'}" @click="showTermo='termo-9'">
<setup-termo
:numTermo="9"
:status="recipe.options_thermoregulator_9_enabled.enabled"
:setpoint="recipe.options_thermoregulator_9_setpoint.valueAct"
:status="recipe.options_thermoregulator_9_enabled.status"
:setpoint="recipe.options_thermoregulator_9_setpoint"
></setup-termo>
</button>
<button :class="{'active':showTermo == 'termo-10'}" @click="showTermo='termo-10'" class="box-color">
<setup-termo
:numTermo="10"
:status="recipe.options_thermoregulator_10_enabled.enabled"
:setpoint="recipe.options_thermoregulator_10_setpoint.valueAct"
:status="recipe.options_thermoregulator_10_enabled.status"
:setpoint="recipe.options_thermoregulator_10_setpoint"
></setup-termo>
</button>
</div>
@@ -78,111 +78,81 @@
<div class="specific">
<div v-if="showTermo=='termo-1'">
<input-termo
v-model="recipe.options_thermoregulator_1_setpoint.valueAct"
:min="recipe.options_thermoregulator_1_setpoint.range.min"
:max="recipe.options_thermoregulator_1_setpoint.range.max"
:visible_abilitazione="recipe.options_thermoregulator_1_enabled.visible"
:enabled_abilitazione="recipe.options_thermoregulator_1_enabled.enabled"
:hasError_abilitazione="recipe.options_thermoregulator_1_enabled.hasError"
:setpoint="recipe.options_thermoregulator_1_setpoint"
:abilitazione="recipe.options_thermoregulator_1_enabled"
:unitMeasure="recipe.options_thermoregulator_1_setpoint.unitMeasure"
>
</input-termo>
</div>
<div v-if="showTermo=='termo-2'">
<input-termo
v-model="recipe.options_thermoregulator_2_setpoint.valueAct"
:min="recipe.options_thermoregulator_2_setpoint.range.min"
:max="recipe.options_thermoregulator_2_setpoint.range.max"
:visible_abilitazione="recipe.options_thermoregulator_2_enabled.visible"
:enabled_abilitazione="recipe.options_thermoregulator_2_enabled.enabled"
:hasError_abilitazione="recipe.options_thermoregulator_2_enabled.hasError"
:setpoint="recipe.options_thermoregulator_2_setpoint"
:abilitazione="recipe.options_thermoregulator_2_enabled"
:unitMeasure="recipe.options_thermoregulator_2_setpoint.unitMeasure"
>
</input-termo>
</div>
<div v-if="showTermo=='termo-3'">
<input-termo
v-model="recipe.options_thermoregulator_3_setpoint.valueAct"
:min="recipe.options_thermoregulator_3_setpoint.range.min"
:max="recipe.options_thermoregulator_3_setpoint.range.max"
:visible_abilitazione="recipe.options_thermoregulator_3_enabled.visible"
:enabled_abilitazione="recipe.options_thermoregulator_3_enabled.enabled"
:hasError_abilitazione="recipe.options_thermoregulator_3_enabled.hasError"
:setpoint="recipe.options_thermoregulator_3_setpoint"
:abilitazione="recipe.options_thermoregulator_3_enabled"
:unitMeasure="recipe.options_thermoregulator_3_setpoint.unitMeasure"
>
</input-termo>
</div>
<div v-if="showTermo=='termo-4'">
<input-termo
v-model="recipe.options_thermoregulator_4_setpoint.valueAct"
:min="recipe.options_thermoregulator_4_setpoint.range.min"
:max="recipe.options_thermoregulator_4_setpoint.range.max"
:visible_abilitazione="recipe.options_thermoregulator_4_enabled.visible"
:enabled_abilitazione="recipe.options_thermoregulator_4_enabled.enabled"
:hasError_abilitazione="recipe.options_thermoregulator_4_enabled.hasError"
:setpoint="recipe.options_thermoregulator_4_setpoint"
:abilitazione="recipe.options_thermoregulator_4_enabled"
:unitMeasure="recipe.options_thermoregulator_4_setpoint.unitMeasure"
>
</input-termo>
</div>
<div v-if="showTermo=='termo-5'">
<input-termo
v-model="recipe.options_thermoregulator_5_setpoint.valueAct"
:min="recipe.options_thermoregulator_5_setpoint.range.min"
:max="recipe.options_thermoregulator_5_setpoint.range.max"
:visible_abilitazione="recipe.options_thermoregulator_5_enabled.visible"
:enabled_abilitazione="recipe.options_thermoregulator_5_enabled.enabled"
:hasError_abilitazione="recipe.options_thermoregulator_5_enabled.hasError"
:setpoint="recipe.options_thermoregulator_5_setpoint"
:abilitazione="recipe.options_thermoregulator_5_enabled"
:unitMeasure="recipe.options_thermoregulator_5_setpoint.unitMeasure"
>
</input-termo>
</div>
<div v-if="showTermo=='termo-6'">
<input-termo
v-model="recipe.options_thermoregulator_6_setpoint.valueAct"
:min="recipe.options_thermoregulator_6_setpoint.range.min"
:max="recipe.options_thermoregulator_6_setpoint.range.max"
:visible_abilitazione="recipe.options_thermoregulator_6_enabled.visible"
:enabled_abilitazione="recipe.options_thermoregulator_6_enabled.enabled"
:hasError_abilitazione="recipe.options_thermoregulator_6_enabled.hasError"
:setpoint="recipe.options_thermoregulator_6_setpoint"
:abilitazione="recipe.options_thermoregulator_6_enabled"
:unitMeasure="recipe.options_thermoregulator_6_setpoint.unitMeasure"
>
</input-termo>
</div>
<div v-if="showTermo=='termo-7'">
<input-termo
v-model="recipe.options_thermoregulator_7_setpoint.valueAct"
:min="recipe.options_thermoregulator_7_setpoint.range.min"
:max="recipe.options_thermoregulator_7_setpoint.range.max"
:visible_abilitazione="recipe.options_thermoregulator_7_enabled.visible"
:enabled_abilitazione="recipe.options_thermoregulator_7_enabled.enabled"
:hasError_abilitazione="recipe.options_thermoregulator_7_enabled.hasError"
:setpoint="recipe.options_thermoregulator_7_setpoint"
:abilitazione="recipe.options_thermoregulator_7_enabled"
:unitMeasure="recipe.options_thermoregulator_7_setpoint.unitMeasure"
>
</input-termo>
</div>
<div v-if="showTermo=='termo-8'">
<input-termo
v-model="recipe.options_thermoregulator_8_setpoint.valueAct"
:min="recipe.options_thermoregulator_8_setpoint.range.min"
:max="recipe.options_thermoregulator_8_setpoint.range.max"
:visible_abilitazione="recipe.options_thermoregulator_8_enabled.visible"
:enabled_abilitazione="recipe.options_thermoregulator_8_enabled.enabled"
:hasError_abilitazione="recipe.options_thermoregulator_8_enabled.hasError"
:setpoint="recipe.options_thermoregulator_8_setpoint"
:abilitazione="recipe.options_thermoregulator_8_enabled"
:unitMeasure="recipe.options_thermoregulator_8_setpoint.unitMeasure"
>
</input-termo>
</div>
<div v-if="showTermo=='termo-9'">
<input-termo
v-model="recipe.options_thermoregulator_9_setpoint.valueAct"
:min="recipe.options_thermoregulator_9_setpoint.range.min"
:max="recipe.options_thermoregulator_9_setpoint.range.max"
:visible_abilitazione="recipe.options_thermoregulator_9_enabled.visible"
:enabled_abilitazione="recipe.options_thermoregulator_9_enabled.enabled"
:hasError_abilitazione="recipe.options_thermoregulator_9_enabled.hasError"
:setpoint="recipe.options_thermoregulator_9_setpoint"
:abilitazione="recipe.options_thermoregulator_9_enabled"
:unitMeasure="recipe.options_thermoregulator_9_setpoint.unitMeasure"
>
</input-termo>
</div>
<div v-if="showTermo=='termo-10'">
<input-termo
v-model="recipe.options_thermoregulator_10_setpoint.valueAct"
:min="recipe.options_thermoregulator_10_setpoint.range.min"
:max="recipe.options_thermoregulator_10_setpoint.range.max"
:visible_abilitazione="recipe.options_thermoregulator_10_enabled.visible"
:enabled_abilitazione="recipe.options_thermoregulator_10_enabled.enabled"
:hasError_abilitazione="recipe.options_thermoregulator_10_enabled.hasError"
:setpoint="recipe.options_thermoregulator_10_setpoint"
:abilitazione="recipe.options_thermoregulator_10_enabled"
:unitMeasure="recipe.options_thermoregulator_10_setpoint.unitMeasure"
>
</input-termo>
</div>
@@ -20,6 +20,7 @@ export default class ShowOpzioniInfo extends Vue {
annulla() {
ModalHelper.HideModal();
messageService.publishToChannel('show-estrazione-info');
};
conferma() {
@@ -18,11 +18,13 @@ export default class Raffreddamento extends Vue{
show: string = "ventilatori";
annulla(){
ModalHelper.HideModal();
ModalHelper.HideModal();
messageService.publishToChannel('show-controstampo-info');
};
conferma(){
ModalHelper.HideModal();
messageService.publishToChannel('show-vuoto-info');
};
async beforeMount() {
@@ -13,10 +13,12 @@ export default class ShowVuotoInfo extends Vue {
annulla(){
ModalHelper.HideModal();
messageService.publishToChannel('show-raffreddamento-info');
};
conferma(){
ModalHelper.HideModal();
messageService.publishToChannel('show-estrazione-info');
};
async beforeMount() {