Merge remote-tracking branch 'origin/develop' into develop
This commit is contained in:
@@ -439,18 +439,19 @@ fieldset[disabled] .form-group.is-focused .togglebutton label {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.togglebutton.big {
|
||||
.togglebutton.big,
|
||||
.togglebutton.big[disabled] {
|
||||
span.toggle {
|
||||
height: 40px;
|
||||
width: 112px;
|
||||
border-radius: 20px;
|
||||
font-size: 17px;
|
||||
line-height: 40px;
|
||||
font-weight: bold;
|
||||
height: 40px !important;
|
||||
width: 112px !important;
|
||||
border-radius: 20px !important;
|
||||
font-size: 17px !important;
|
||||
line-height: 40px !important;
|
||||
font-weight: bold !important;
|
||||
|
||||
&:after {
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
width: 36px !important;
|
||||
height: 36px !important;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -143,6 +143,60 @@
|
||||
margin-left: 5px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.context-menu {
|
||||
position: relative;
|
||||
|
||||
.context-area {
|
||||
top: 50px;
|
||||
display: none;
|
||||
background-color: #fff;
|
||||
box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
|
||||
position: absolute;
|
||||
width: 300px;
|
||||
left: -150px + 24px;
|
||||
padding-inline-start: 0;
|
||||
padding-inline-end: 0;
|
||||
|
||||
|
||||
&.show {
|
||||
display: block !important;
|
||||
}
|
||||
|
||||
li {
|
||||
list-style-type: none;
|
||||
height: 62px;
|
||||
border-bottom: 1px solid rgba(0, 0, 0, 0.5);
|
||||
color: #545454;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
padding: 0 28px;
|
||||
font-weight: 500;
|
||||
font-size: 18px;
|
||||
|
||||
cursor: pointer;
|
||||
|
||||
&:last-of-type {
|
||||
border-bottom: none;
|
||||
}
|
||||
}
|
||||
|
||||
&:before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: -15px;
|
||||
left: calc(~'50% - 8px');
|
||||
display: block;
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-left: 15px solid transparent;
|
||||
border-right: 15px solid transparent;
|
||||
border-bottom: 15px solid #fff;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.colorWhite {
|
||||
|
||||
@@ -51,6 +51,7 @@
|
||||
@import "report.less";
|
||||
@import "users.less";
|
||||
@import "tooltip.less";
|
||||
@import "saveas.less";
|
||||
|
||||
|
||||
@background-color: rgb(216, 216, 216);
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
// out: false, sourceMap: false, main: ../style.less
|
||||
.modal.save-as {
|
||||
width: 500px;
|
||||
height: 300px;
|
||||
top: calc(~'50% - 200px');
|
||||
|
||||
article {
|
||||
|
||||
label {
|
||||
color: #002680;
|
||||
font-size: 24px;
|
||||
font-weight: 500;
|
||||
overflow: hidden;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
input {
|
||||
padding: 5px;
|
||||
font-size: 18px;
|
||||
font-weight: 500;
|
||||
color: #6d6d6d;
|
||||
width: 100%;
|
||||
height: 48px;
|
||||
border-radius: 2px;
|
||||
box-shadow: inset 0 1px 3px 0 rgba(0, 0, 0, 0.5);
|
||||
border: none;
|
||||
display: flex;
|
||||
flex-flow: row nowrap;
|
||||
padding: 0 4px;
|
||||
align-items: center;
|
||||
justify-content: stretch;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6032,19 +6032,22 @@ fieldset[disabled] .form-group.is-focused .togglebutton label {
|
||||
background-image: linear-gradient(to bottom, #3fa4ff, #1791ff);
|
||||
color: #fff;
|
||||
}
|
||||
.togglebutton.big span.toggle {
|
||||
height: 40px;
|
||||
width: 112px;
|
||||
border-radius: 20px;
|
||||
font-size: 17px;
|
||||
line-height: 40px;
|
||||
font-weight: bold;
|
||||
.togglebutton.big span.toggle,
|
||||
.togglebutton.big[disabled] span.toggle {
|
||||
height: 40px !important;
|
||||
width: 112px !important;
|
||||
border-radius: 20px !important;
|
||||
font-size: 17px !important;
|
||||
line-height: 40px !important;
|
||||
font-weight: bold !important;
|
||||
}
|
||||
.togglebutton.big span.toggle:after {
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
.togglebutton.big span.toggle:after,
|
||||
.togglebutton.big[disabled] span.toggle:after {
|
||||
width: 36px !important;
|
||||
height: 36px !important;
|
||||
}
|
||||
.togglebutton.big input[type=checkbox]:checked + .toggle:after {
|
||||
.togglebutton.big input[type=checkbox]:checked + .toggle:after,
|
||||
.togglebutton.big[disabled] input[type=checkbox]:checked + .toggle:after {
|
||||
left: 74px;
|
||||
}
|
||||
.custom-checkbox {
|
||||
@@ -6284,6 +6287,57 @@ fieldset[disabled] .form-group.is-focused .togglebutton label {
|
||||
margin-left: 5px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
#app > header .context-menu,
|
||||
.dashboard > header .context-menu {
|
||||
position: relative;
|
||||
}
|
||||
#app > header .context-menu .context-area,
|
||||
.dashboard > header .context-menu .context-area {
|
||||
top: 50px;
|
||||
display: none;
|
||||
background-color: #fff;
|
||||
box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
|
||||
position: absolute;
|
||||
width: 300px;
|
||||
left: -126px;
|
||||
padding-inline-start: 0;
|
||||
padding-inline-end: 0;
|
||||
}
|
||||
#app > header .context-menu .context-area.show,
|
||||
.dashboard > header .context-menu .context-area.show {
|
||||
display: block !important;
|
||||
}
|
||||
#app > header .context-menu .context-area li,
|
||||
.dashboard > header .context-menu .context-area li {
|
||||
list-style-type: none;
|
||||
height: 62px;
|
||||
border-bottom: 1px solid rgba(0, 0, 0, 0.5);
|
||||
color: #545454;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
padding: 0 28px;
|
||||
font-weight: 500;
|
||||
font-size: 18px;
|
||||
cursor: pointer;
|
||||
}
|
||||
#app > header .context-menu .context-area li:last-of-type,
|
||||
.dashboard > header .context-menu .context-area li:last-of-type {
|
||||
border-bottom: none;
|
||||
}
|
||||
#app > header .context-menu .context-area:before,
|
||||
.dashboard > header .context-menu .context-area:before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: -15px;
|
||||
left: calc(50% - 8px);
|
||||
display: block;
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-left: 15px solid transparent;
|
||||
border-right: 15px solid transparent;
|
||||
border-bottom: 15px solid #fff;
|
||||
}
|
||||
.colorWhite {
|
||||
color: #fff !important;
|
||||
}
|
||||
@@ -23739,6 +23793,34 @@ footer .container button.big:before {
|
||||
text-align: center;
|
||||
color: #4b4b4b;
|
||||
}
|
||||
.modal.save-as {
|
||||
width: 500px;
|
||||
height: 300px;
|
||||
top: calc(50% - 200px);
|
||||
}
|
||||
.modal.save-as article label {
|
||||
color: #002680;
|
||||
font-size: 24px;
|
||||
font-weight: 500;
|
||||
overflow: hidden;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.modal.save-as article input {
|
||||
padding: 5px;
|
||||
font-size: 18px;
|
||||
font-weight: 500;
|
||||
color: #6d6d6d;
|
||||
width: 100%;
|
||||
height: 48px;
|
||||
border-radius: 2px;
|
||||
box-shadow: inset 0 1px 3px 0 rgba(0, 0, 0, 0.5);
|
||||
border: none;
|
||||
display: flex;
|
||||
flex-flow: row nowrap;
|
||||
padding: 0 4px;
|
||||
align-items: center;
|
||||
justify-content: stretch;
|
||||
}
|
||||
a,
|
||||
a:visited,
|
||||
a:hover,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"env": "development",
|
||||
"api": {
|
||||
"enabled": true,
|
||||
"apiServerUrl": "http://localhost:9000/"
|
||||
"apiServerUrl": "http://seriate.steamware.net:9000/"
|
||||
},
|
||||
"allUIVisible": true
|
||||
}
|
||||
@@ -13,7 +13,7 @@
|
||||
<script src="Scripts/jquery.mousewheel.js"></script>
|
||||
<script src="Scripts/jquery.signalR-2.2.2.min.js"></script>
|
||||
<script src="Scripts/raphael-2.1.4.min.js"></script>
|
||||
<script src="http://localhost:9000/signalr/hubs" async></script>
|
||||
<script src="http://seriate.steamware.net:9000/signalr/hubs" async></script>
|
||||
|
||||
<link href="assets/styles/style.css" rel="stylesheet" />
|
||||
</head>
|
||||
|
||||
@@ -9,6 +9,7 @@ import { UserInfoDialog, MachineInfoDialog, ContactInfoDialog } from "@/app_modu
|
||||
import { ModalHelper } from "./components/modals/ModalHelper";
|
||||
import Vue from "vue";
|
||||
import { loginService, machineService, localizationService } from "./services";
|
||||
import { prodService } from "./services/prodService";
|
||||
|
||||
// import { UsersService } from "./services/usersService";
|
||||
|
||||
@@ -61,6 +62,8 @@ async function loadMachineConfig() {
|
||||
|
||||
let mcresult = await machine.getMachineConfiguration();
|
||||
|
||||
await prodService.GetProdPanel();
|
||||
|
||||
// load default language
|
||||
if (!(store.state as AppModel).localization.currentLanguage) {
|
||||
localizationService.changeCurrentLanguage(mcresult.defaultLanguage);
|
||||
|
||||
@@ -48,9 +48,10 @@ export default class Numeric extends Vue {
|
||||
KeyboardHelper.showKeyboard(x, y, this.value);
|
||||
|
||||
let textBox = (this.$refs.input as any);
|
||||
textBox.SelectionStart = textBox.value.length;
|
||||
textBox.SelectionLength = 0;
|
||||
this.$nextTick(() => { this.focused = true; })
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.focused = true;
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import Vue from "vue";
|
||||
import Component from "vue-class-component";
|
||||
import { Prop } from 'vue-property-decorator';
|
||||
import { debounce } from "@/_base/debounce";
|
||||
|
||||
import { Hub } from "@/services";
|
||||
import Numeric from "./numeric";
|
||||
@Component({ name: "slider" })
|
||||
export default class Slider extends Vue {
|
||||
|
||||
@@ -17,6 +18,8 @@ export default class Slider extends Vue {
|
||||
@Prop({ default: 1 })
|
||||
decimal: number;
|
||||
|
||||
incrementing: number = 0;
|
||||
tempValue: number = null;
|
||||
|
||||
get actualvalue() {
|
||||
return this.value.setpointHMI;
|
||||
@@ -27,11 +30,9 @@ export default class Slider extends Vue {
|
||||
}
|
||||
|
||||
set actualvalue(v: number) {
|
||||
this.debouncedActualValue(v)
|
||||
this.value.setpointHMI = v;
|
||||
}
|
||||
|
||||
debouncedActualValue = debounce((v: number) => this.value.setpointHMI = v, 200);
|
||||
|
||||
get step() {
|
||||
// var s = ((this.value.range.max - this.value.range.min) / (this.lines + 1));
|
||||
// var m = Math.pow(10, this.decimal);
|
||||
@@ -39,31 +40,43 @@ export default class Slider extends Vue {
|
||||
return 1;
|
||||
};
|
||||
|
||||
increment() {
|
||||
startIncrement() {
|
||||
if (!this.value.status.enabled) return;
|
||||
this.incrementing = setInterval(() => {
|
||||
var v = this.value.setpointHMI;
|
||||
if (v < this.value.range.max) {
|
||||
v += this.step;
|
||||
}
|
||||
if (v > this.value.range.max) {
|
||||
v = this.value.range.max;
|
||||
}
|
||||
this.actualvalue = v;
|
||||
}, 50);
|
||||
}
|
||||
|
||||
startDecrement() {
|
||||
if (!this.value.status.enabled) return;
|
||||
this.incrementing = setInterval(() => {
|
||||
var v = this.value.setpointHMI;
|
||||
if (v > this.value.range.min) {
|
||||
v -= this.step;
|
||||
}
|
||||
if (v < this.value.range.min) {
|
||||
v = this.value.range.min;
|
||||
}
|
||||
this.actualvalue = v;
|
||||
}, 50);
|
||||
}
|
||||
|
||||
confirm() {
|
||||
if (!this.value.status.enabled) return;
|
||||
if (this.incrementing)
|
||||
clearInterval(this.incrementing);
|
||||
|
||||
this.incrementing = 0;
|
||||
|
||||
var v = this.value.setpointHMI;
|
||||
if (v < this.value.range.max) {
|
||||
v += this.step;
|
||||
}
|
||||
if (v > this.value.range.max) {
|
||||
v = this.value.range.max;
|
||||
}
|
||||
this.actualvalue = v;
|
||||
};
|
||||
|
||||
decrement() {
|
||||
if (!this.value.status.enabled) return;
|
||||
|
||||
var v = this.value.setpointHMI;
|
||||
if (v > this.value.range.min) {
|
||||
v -= this.step;
|
||||
}
|
||||
if (v < this.value.range.min) {
|
||||
v = this.value.range.min;
|
||||
}
|
||||
this.actualvalue = v;
|
||||
};
|
||||
|
||||
doSoftKeyClick() {
|
||||
Hub.Current.sendUserSoftKey(this.softKey.id);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="slider-container">
|
||||
<div class="slider">
|
||||
<button @click="decrement()">
|
||||
<button @mousedown="startDecrement()" @mouseup="confirm()" @mouseout="confirm()">
|
||||
<img src="assets/icons/png/min.png" />
|
||||
</button>
|
||||
<div class="control">
|
||||
@@ -21,7 +21,7 @@
|
||||
<small>{{`${this.value.range.max} ${this.value.unitMeasure}`}}</small>
|
||||
</div>
|
||||
</div>
|
||||
<button @click="increment()">
|
||||
<button @mousedown="startIncrement()" @mouseup="confirm()" @mouseout="confirm()">
|
||||
<img src="assets/icons/png/max.png" />
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -56,11 +56,11 @@
|
||||
</div>
|
||||
<div class="col">
|
||||
<small>{{'history-item_mouldEnergyIN' | localize("energia utilizzata in")}}</small>
|
||||
<span>{{value.mouldEnergyIN | round(1)}}kW</span>
|
||||
<span>{{value.mouldEnergyIN | round(1)}}kWh</span>
|
||||
</div>
|
||||
<div class="col">
|
||||
<small>{{'history-item_mouldEnergyOUT' | localize("energia utilizzata out")}}</small>
|
||||
<span>{{value.mouldEnergyOUT | round(1)}}kW</span>
|
||||
<span>{{value.mouldEnergyOUT | round(1)}}kWh</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
import Vue from "vue";
|
||||
import Component from "vue-class-component";
|
||||
import { Prop } from "vue-property-decorator";
|
||||
import { Deferred } from "@/services";
|
||||
import { Modal, ModalHelper } from "@/components/modals";
|
||||
import { messageService } from "@/_base";
|
||||
|
||||
@Component({ components: { modal: Modal } })
|
||||
export default class Notes extends Vue {
|
||||
@Prop()
|
||||
deferred: Deferred<string>;
|
||||
|
||||
@Prop()
|
||||
value: string;
|
||||
|
||||
note: string = null;
|
||||
get Note() {
|
||||
return this.note || this.value;
|
||||
}
|
||||
set Note(value: string) {
|
||||
this.note = value;
|
||||
}
|
||||
|
||||
save(value: string) {
|
||||
this.deferred.resolve(this.Note);
|
||||
ModalHelper.HideModal();
|
||||
}
|
||||
|
||||
close() {
|
||||
messageService.deleteChannel("esc_pressed");
|
||||
this.deferred.reject();
|
||||
ModalHelper.HideModal();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<template>
|
||||
<div class="setup">
|
||||
<modal type="save-as" :title="'save-as' | localize('Salva con nome')">
|
||||
<div slot="header-buttons">
|
||||
<button class="modal-close" @click="close()">
|
||||
<i class="fa fa-remove"></i>
|
||||
</button>
|
||||
</div>
|
||||
<section>
|
||||
<article>
|
||||
<label>{{'recipe_note' | localize('Note della ricetta')}}</label>
|
||||
<textarea
|
||||
rows="3"
|
||||
v-model="Note"
|
||||
:placeholder="'recipe_note' | localize('Note della ricetta')"
|
||||
/>
|
||||
</article>
|
||||
</section>
|
||||
<footer>
|
||||
<button class="btn" @click="annulla()">{{'cancel' | localize("Annulla")}}</button>
|
||||
<button class="btn btn-success" @click="save()">{{'confirm' | localize("Conferma")}}</button>
|
||||
</footer>
|
||||
</modal>
|
||||
</div>
|
||||
</template>
|
||||
<script src="./changeNotes.ts" lang="ts"></script>
|
||||
@@ -1,7 +1,36 @@
|
||||
import Vue from "vue";
|
||||
import Component from "vue-class-component";
|
||||
import modal from "@/components/modals/modal.vue";
|
||||
import { Deferred } from "@/services";
|
||||
import { Prop } from "vue-property-decorator";
|
||||
import { messageService } from "@/_base";
|
||||
import { Modal, ModalHelper } from "@/components/modals";
|
||||
|
||||
@Component({})
|
||||
@Component({ components: { modal: Modal } })
|
||||
export default class SaveAs extends Vue {
|
||||
|
||||
@Prop()
|
||||
deferred: Deferred<string>;
|
||||
|
||||
@Prop()
|
||||
value: string;
|
||||
|
||||
recipeName: string = null;
|
||||
get RecipeName() {
|
||||
return this.recipeName || this.value;
|
||||
}
|
||||
set RecipeName(value: string) {
|
||||
this.recipeName = value;
|
||||
}
|
||||
|
||||
save(value: string) {
|
||||
this.deferred.resolve(this.RecipeName);
|
||||
ModalHelper.HideModal();
|
||||
}
|
||||
|
||||
close() {
|
||||
messageService.deleteChannel("esc_pressed");
|
||||
this.deferred.reject();
|
||||
ModalHelper.HideModal();
|
||||
}
|
||||
}
|
||||
@@ -8,18 +8,12 @@
|
||||
</div>
|
||||
<section>
|
||||
<article>
|
||||
<div class="input-area mb-10">
|
||||
<label>{{'recipe_name' | localize('Nome della ricetta')}}</label>
|
||||
<input
|
||||
class="custom"
|
||||
v-model="searchText"
|
||||
:placeholder="'recipe_name' | localize('Nome della ricetta')"
|
||||
/>
|
||||
</div>
|
||||
<label>{{'recipe_name' | localize('Nome della ricetta')}}</label>
|
||||
<input v-model="RecipeName" :placeholder="'recipe_name' | localize('Nome della ricetta')" />
|
||||
</article>
|
||||
</section>
|
||||
<footer>
|
||||
<button class="btn" @click="annulla()">{{'cancel' | localize("Annulla")}}</button>
|
||||
<button class="btn" @click="close()">{{'cancel' | localize("Annulla")}}</button>
|
||||
<button class="btn btn-success" @click="save()">{{'confirm' | localize("Conferma")}}</button>
|
||||
</footer>
|
||||
</modal>
|
||||
|
||||
+18
-6
@@ -10,6 +10,7 @@ import { recipeActions } from "@/store/recipe.store";
|
||||
import { store } from "@/store";
|
||||
import { Deferred } from '@/services';
|
||||
import { recipeService } from "@/services/recipeService";
|
||||
import { debounce } from '@/_base/debounce';
|
||||
|
||||
@Component({ components: { modal: Modal, stepfooter: StepFooter, caricatore: Caricatore, cicloformatura: CicloFormatura } })
|
||||
export default class ShowCicloInfo extends Vue {
|
||||
@@ -27,7 +28,7 @@ export default class ShowCicloInfo extends Vue {
|
||||
};
|
||||
|
||||
|
||||
preparePayload() {
|
||||
get payload() {
|
||||
return {
|
||||
cycle_forming_type: this.recipe.cycle_forming_type,
|
||||
cycle_forming_pause_cycle: this.recipe.cycle_forming_pause_cycle,
|
||||
@@ -57,19 +58,30 @@ export default class ShowCicloInfo extends Vue {
|
||||
|
||||
@Watch('recipe', { deep: true })
|
||||
async recipeChanged(n, o) {
|
||||
await recipeService.Update(this.preparePayload());
|
||||
this.debouncedRecipeSave()
|
||||
};
|
||||
|
||||
debouncedRecipeSave = debounce(async () => await recipeService.Update(this.payload), 200);
|
||||
|
||||
hasErrors() {
|
||||
let payload = this.preparePayload();
|
||||
let payload = this.recipe;
|
||||
let errors = false;
|
||||
for (const key in this.preparePayload()) {
|
||||
for (const key in this.recipe) {
|
||||
const el = payload[key] as Recipe.IValue;
|
||||
if (el.status.hasError) errors = true;
|
||||
}
|
||||
return errors;
|
||||
}
|
||||
|
||||
hasChanges() {
|
||||
let result = false;
|
||||
for (const key in this.payload) {
|
||||
const el = this.payload[key] as Recipe.IValue;
|
||||
if (el.setpointHMI != el.setpointPLC) result = true;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
hasEnabledFields(...fields: string[]) {
|
||||
let result = false;
|
||||
for (const field of fields) {
|
||||
@@ -114,8 +126,8 @@ export default class ShowCicloInfo extends Vue {
|
||||
// recipeActions.setCurrent(store, this.recipe);
|
||||
|
||||
await recipeService.Confirm('Cycle');
|
||||
ModalHelper.HideModal();
|
||||
this.deferred.resolve(1);
|
||||
// ModalHelper.HideModal();
|
||||
// this.deferred.resolve(1);
|
||||
};
|
||||
|
||||
goTo(step) {
|
||||
|
||||
+6
-2
@@ -17,11 +17,15 @@
|
||||
<cicloformatura v-if="show==0" :recipe="recipe"></cicloformatura>
|
||||
<caricatore v-if="show==1" :recipe="recipe"></caricatore>
|
||||
<footer>
|
||||
<button class="btn" @click="annulla()">{{'cancel' | localize('Annulla')}}</button>
|
||||
<button
|
||||
class="btn"
|
||||
@click="annulla()"
|
||||
:disabled="!hasChanges()"
|
||||
>{{'cancel' | localize('Annulla')}}</button>
|
||||
<button
|
||||
class="btn btn-success"
|
||||
@click="conferma()"
|
||||
:disabled="hasErrors()"
|
||||
:disabled="hasErrors() || !hasChanges()"
|
||||
>{{'confirm' | localize('Conferma')}}</button>
|
||||
</footer>
|
||||
</modal>
|
||||
|
||||
+19
-7
@@ -12,6 +12,7 @@ import { recipeActions } from "@/store/recipe.store";
|
||||
import { store } from "@/store";
|
||||
import { Deferred } from '@/services';
|
||||
import { recipeService } from "@/services/recipeService";
|
||||
import { debounce } from '@/_base/debounce';
|
||||
|
||||
@Component({
|
||||
components: {
|
||||
@@ -39,10 +40,12 @@ export default class ShowControstampoInfo extends Vue {
|
||||
|
||||
@Watch('recipe', { deep: true })
|
||||
async recipeChanged(n, o) {
|
||||
await recipeService.Update(this.preparePayload());
|
||||
}
|
||||
this.debouncedRecipeSave()
|
||||
};
|
||||
|
||||
preparePayload() {
|
||||
debouncedRecipeSave = debounce(async () => await recipeService.Update(this.payload), 200);
|
||||
|
||||
get payload() {
|
||||
return {
|
||||
upperplate_cycle_type: this.recipe.upperplate_cycle_type,
|
||||
upperplate_cycle_delay: this.recipe.upperplate_cycle_delay,
|
||||
@@ -76,15 +79,24 @@ export default class ShowControstampoInfo extends Vue {
|
||||
}
|
||||
|
||||
hasErrors() {
|
||||
let payload = this.preparePayload();
|
||||
let payload = this.recipe;
|
||||
let errors = false;
|
||||
for (const key in this.preparePayload()) {
|
||||
for (const key in this.recipe) {
|
||||
const el = payload[key] as Recipe.IValue;
|
||||
if (el.status.hasError) errors = true;
|
||||
}
|
||||
return errors;
|
||||
}
|
||||
|
||||
hasChanges() {
|
||||
let result = false;
|
||||
for (const key in this.payload) {
|
||||
const el = this.payload[key] as Recipe.IValue;
|
||||
if (el.setpointHMI != el.setpointPLC) result = true;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
hasEnabledFields(...fields: string[]) {
|
||||
let result = false;
|
||||
for (const field of fields) {
|
||||
@@ -146,8 +158,8 @@ export default class ShowControstampoInfo extends Vue {
|
||||
// recipeActions.setCurrent(store, this.recipe);
|
||||
|
||||
await recipeService.Confirm('UpperPlate');
|
||||
ModalHelper.HideModal();
|
||||
this.deferred.resolve(1);
|
||||
// ModalHelper.HideModal();
|
||||
// this.deferred.resolve(1);
|
||||
};
|
||||
|
||||
goTo(step) {
|
||||
|
||||
+6
-2
@@ -33,11 +33,15 @@
|
||||
<vuotocontrostampo v-if="show==2" :recipe="recipe"></vuotocontrostampo>
|
||||
<estrazionecontrostampo v-if="show==3" :recipe="recipe"></estrazionecontrostampo>
|
||||
<footer>
|
||||
<button class="btn" @click="annulla()">{{'cancel' | localize('Annulla')}}</button>
|
||||
<button
|
||||
class="btn"
|
||||
@click="annulla()"
|
||||
:disabled="!hasChanges()"
|
||||
>{{'cancel' | localize('Annulla')}}</button>
|
||||
<button
|
||||
class="btn btn-success"
|
||||
@click="conferma()"
|
||||
:disabled="hasErrors()"
|
||||
:disabled="hasErrors() || !hasChanges()"
|
||||
>{{'confirm' | localize('Conferma')}}</button>
|
||||
</footer>
|
||||
</modal>
|
||||
|
||||
+18
-7
@@ -10,6 +10,7 @@ import { recipeActions } from "@/store/recipe.store";
|
||||
import { store } from "@/store";
|
||||
import { Deferred } from '@/services';
|
||||
import { recipeService } from "@/services/recipeService";
|
||||
import { debounce } from '@/_base/debounce';
|
||||
|
||||
@Component({
|
||||
components:
|
||||
@@ -36,11 +37,12 @@ export default class ShowEstrazioneInfo extends Vue {
|
||||
|
||||
@Watch('recipe', { deep: true })
|
||||
async recipeChanged(n, o) {
|
||||
this.debouncedRecipeSave()
|
||||
};
|
||||
|
||||
await recipeService.Update(this.preparePayload());
|
||||
}
|
||||
debouncedRecipeSave = debounce(async () => await recipeService.Update(this.payload), 200);
|
||||
|
||||
preparePayload() {
|
||||
get payload() {
|
||||
return {
|
||||
extraction_main_type: this.recipe.extraction_main_type,
|
||||
extraction_main_mould_dw_delay: this.recipe.extraction_main_mould_dw_delay,
|
||||
@@ -57,15 +59,24 @@ export default class ShowEstrazioneInfo extends Vue {
|
||||
}
|
||||
|
||||
hasErrors() {
|
||||
let payload = this.preparePayload();
|
||||
let payload = this.recipe;
|
||||
let errors = false;
|
||||
for (const key in this.preparePayload()) {
|
||||
for (const key in this.recipe) {
|
||||
const el = payload[key] as Recipe.IValue;
|
||||
if (el.status.hasError) errors = true;
|
||||
}
|
||||
return errors;
|
||||
}
|
||||
|
||||
hasChanges() {
|
||||
let result = false;
|
||||
for (const key in this.payload) {
|
||||
const el = this.payload[key] as Recipe.IValue;
|
||||
if (el.setpointHMI != el.setpointPLC) result = true;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
hasEnabledFields(...fields: string[]) {
|
||||
let result = false;
|
||||
for (const field of fields) {
|
||||
@@ -98,8 +109,8 @@ export default class ShowEstrazioneInfo extends Vue {
|
||||
// recipeActions.setCurrent(store, this.recipe);
|
||||
|
||||
await recipeService.Confirm('Extraction');
|
||||
ModalHelper.HideModal();
|
||||
this.deferred.resolve(1);
|
||||
// ModalHelper.HideModal();
|
||||
// this.deferred.resolve(1);
|
||||
};
|
||||
|
||||
goTo(step) {
|
||||
|
||||
+6
-2
@@ -21,11 +21,15 @@
|
||||
<estrprincipale v-if="show==0" :recipe="recipe"></estrprincipale>
|
||||
<estrsecondaria v-if="show==1" :recipe="recipe"></estrsecondaria>
|
||||
<footer>
|
||||
<button class="btn" @click="annulla()">{{'cancel' | localize('Annulla')}}</button>
|
||||
<button
|
||||
class="btn"
|
||||
@click="annulla()"
|
||||
:disabled="!hasChanges()"
|
||||
>{{'cancel' | localize('Annulla')}}</button>
|
||||
<button
|
||||
class="btn btn-success"
|
||||
@click="conferma()"
|
||||
:disabled="hasErrors()"
|
||||
:disabled="hasErrors() || !hasChanges()"
|
||||
>{{'confirm' | localize('Conferma')}}</button>
|
||||
</footer>
|
||||
</modal>
|
||||
|
||||
+19
-7
@@ -19,6 +19,7 @@ import { recipeActions } from "@/store/recipe.store";
|
||||
import { store } from "@/store";
|
||||
import { Deferred } from "@/services";
|
||||
import { recipeService } from "@/services/recipeService";
|
||||
import { debounce } from "@/_base/debounce";
|
||||
|
||||
@Component({
|
||||
components: {
|
||||
@@ -57,10 +58,12 @@ export default class ShowFormatoInfo extends Vue {
|
||||
|
||||
@Watch('recipe', { deep: true })
|
||||
async recipeChanged(n, o) {
|
||||
await recipeService.Update(this.preparePayload());
|
||||
}
|
||||
this.debouncedRecipeSave()
|
||||
};
|
||||
|
||||
preparePayload() {
|
||||
debouncedRecipeSave = debounce(async () => await recipeService.Update(this.payload), 200);
|
||||
|
||||
get payload() {
|
||||
return {
|
||||
general_sizes_mould_dim_x: this.recipe.general_sizes_mould_dim_x,
|
||||
general_sizes_mould_dim_y: this.recipe.general_sizes_mould_dim_y,
|
||||
@@ -83,21 +86,30 @@ export default class ShowFormatoInfo extends Vue {
|
||||
}
|
||||
|
||||
hasErrors() {
|
||||
let payload = this.preparePayload();
|
||||
let payload = this.recipe;
|
||||
let errors = false;
|
||||
for (const key in this.preparePayload()) {
|
||||
for (const key in this.recipe) {
|
||||
const el = payload[key] as Recipe.IValue;
|
||||
if (el.status.hasError) errors = true;
|
||||
}
|
||||
return errors;
|
||||
}
|
||||
|
||||
hasChanges() {
|
||||
let result = false;
|
||||
for (const key in this.payload) {
|
||||
const el = this.payload[key] as Recipe.IValue;
|
||||
if (el.setpointHMI != el.setpointPLC) result = true;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
async conferma() {
|
||||
// recipeActions.setCurrent(store, this.recipe);
|
||||
|
||||
await recipeService.Confirm('General');
|
||||
ModalHelper.HideModal();
|
||||
this.deferred.resolve(1);
|
||||
// ModalHelper.HideModal();
|
||||
// this.deferred.resolve(1);
|
||||
};
|
||||
|
||||
goTo(step) {
|
||||
|
||||
+6
-2
@@ -70,11 +70,15 @@
|
||||
</article>
|
||||
</section>
|
||||
<footer>
|
||||
<button class="btn" @click="annulla()">{{'cancel' | localize('Annulla')}}</button>
|
||||
<button
|
||||
class="btn"
|
||||
@click="annulla()"
|
||||
:disabled="!hasChanges()"
|
||||
>{{'cancel' | localize('Annulla')}}</button>
|
||||
<button
|
||||
class="btn btn-success"
|
||||
@click="conferma()"
|
||||
:disabled="hasErrors()"
|
||||
:disabled="hasErrors() || !hasChanges()"
|
||||
>{{'confirm' | localize('Conferma')}}</button>
|
||||
</footer>
|
||||
</modal>
|
||||
|
||||
+19
-7
@@ -11,6 +11,7 @@ import { store } from "@/store";
|
||||
import { Deferred } from "@/services";
|
||||
import { recipeService } from "@/services/recipeService";
|
||||
import svgChart from "@/app_modules_thermo/components/svgChart.vue";
|
||||
import { debounce } from "@/_base/debounce";
|
||||
|
||||
@Component({
|
||||
components: {
|
||||
@@ -47,10 +48,12 @@ export default class ShowImbutituraInfo extends Vue {
|
||||
|
||||
@Watch('recipe', { deep: true })
|
||||
async recipeChanged(n, o) {
|
||||
await recipeService.Update(this.preparePayload());
|
||||
}
|
||||
this.debouncedRecipeSave()
|
||||
};
|
||||
|
||||
preparePayload() {
|
||||
debouncedRecipeSave = debounce(async () => await recipeService.Update(this.payload), 200);
|
||||
|
||||
get payload() {
|
||||
return {
|
||||
drawing_type: this.recipe.drawing_type,
|
||||
drawing_height: this.recipe.drawing_height,
|
||||
@@ -65,19 +68,28 @@ export default class ShowImbutituraInfo extends Vue {
|
||||
}
|
||||
|
||||
hasErrors() {
|
||||
let payload = this.preparePayload();
|
||||
let payload = this.recipe;
|
||||
let errors = false;
|
||||
for (const key in this.preparePayload()) {
|
||||
for (const key in this.recipe) {
|
||||
const el = payload[key] as Recipe.IValue;
|
||||
if (el.status.hasError) errors = true;
|
||||
}
|
||||
return errors;
|
||||
}
|
||||
|
||||
hasChanges() {
|
||||
let result = false;
|
||||
for (const key in this.payload) {
|
||||
const el = this.payload[key] as Recipe.IValue;
|
||||
if (el.setpointHMI != el.setpointPLC) result = true;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
async conferma(name: string) {
|
||||
await recipeService.Confirm('Drawing');
|
||||
ModalHelper.HideModal();
|
||||
this.deferred.resolve(1);
|
||||
// ModalHelper.HideModal();
|
||||
// this.deferred.resolve(1);
|
||||
};
|
||||
|
||||
goTo(step) {
|
||||
|
||||
+6
-2
@@ -80,11 +80,15 @@
|
||||
</article>
|
||||
</section>
|
||||
<footer>
|
||||
<button class="btn" @click="annulla()">{{'cancel' | localize('Annulla')}}</button>
|
||||
<button
|
||||
class="btn"
|
||||
@click="annulla()"
|
||||
:disabled="!hasChanges()"
|
||||
>{{'cancel' | localize('Annulla')}}</button>
|
||||
<button
|
||||
class="btn btn-success"
|
||||
@click="conferma()"
|
||||
:disabled="hasErrors()"
|
||||
:disabled="hasErrors() || !hasChanges()"
|
||||
>{{'confirm' | localize('Conferma')}}</button>
|
||||
</footer>
|
||||
</modal>
|
||||
|
||||
@@ -11,6 +11,7 @@ import { store } from "@/store";
|
||||
import { Prop, Watch } from "vue-property-decorator";
|
||||
import { Deferred } from "@/services";
|
||||
import { recipeService } from "@/services/recipeService";
|
||||
import { debounce } from "@/_base/debounce";
|
||||
|
||||
@Component({
|
||||
components: {
|
||||
@@ -38,10 +39,12 @@ export default class ShowOpzioniInfo extends Vue {
|
||||
|
||||
@Watch('recipe', { deep: true })
|
||||
async recipeChanged(n, o) {
|
||||
await recipeService.Update(this.preparePayload());
|
||||
}
|
||||
this.debouncedRecipeSave()
|
||||
};
|
||||
|
||||
preparePayload() {
|
||||
debouncedRecipeSave = debounce(async () => await recipeService.Update(this.payload), 200);
|
||||
|
||||
get payload() {
|
||||
return {
|
||||
options_undercutmould_1_mode: this.recipe.options_undercutmould_1_mode,
|
||||
options_undercutmould_1_position: this.recipe.options_undercutmould_1_position,
|
||||
@@ -147,21 +150,30 @@ export default class ShowOpzioniInfo extends Vue {
|
||||
}
|
||||
|
||||
hasErrors() {
|
||||
let payload = this.preparePayload();
|
||||
let payload = this.recipe;
|
||||
let errors = false;
|
||||
for (const key in this.preparePayload()) {
|
||||
for (const key in this.recipe) {
|
||||
const el = payload[key] as Recipe.IValue;
|
||||
if (el.status.hasError) errors = true;
|
||||
}
|
||||
return errors;
|
||||
}
|
||||
|
||||
hasChanges() {
|
||||
let result = false;
|
||||
for (const key in this.payload) {
|
||||
const el = this.payload[key] as Recipe.IValue;
|
||||
if (el.setpointHMI != el.setpointPLC) result = true;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
async conferma() {
|
||||
// recipeActions.setCurrent(store, this.recipe);
|
||||
|
||||
await recipeService.Confirm('Options');
|
||||
ModalHelper.HideModal();
|
||||
this.deferred.resolve(1);
|
||||
// ModalHelper.HideModal();
|
||||
// this.deferred.resolve(1);
|
||||
};
|
||||
|
||||
goTo(step) {
|
||||
|
||||
@@ -18,11 +18,15 @@
|
||||
<sottosquadracontrostampo v-if="showOpzioni==2" :recipe="recipe"></sottosquadracontrostampo>
|
||||
</section>
|
||||
<footer>
|
||||
<button class="btn" @click="annulla()">{{'cancel' | localize('Annulla')}}</button>
|
||||
<button
|
||||
class="btn"
|
||||
@click="annulla()"
|
||||
:disabled="!hasChanges()"
|
||||
>{{'cancel' | localize('Annulla')}}</button>
|
||||
<button
|
||||
class="btn btn-success"
|
||||
@click="conferma()"
|
||||
:disabled="hasErrors()"
|
||||
:disabled="hasErrors() || !hasChanges()"
|
||||
>{{'confirm' | localize('Conferma')}}</button>
|
||||
</footer>
|
||||
</modal>
|
||||
|
||||
+19
-7
@@ -11,6 +11,7 @@ import { recipeActions } from "@/store/recipe.store";
|
||||
import { store } from "@/store";
|
||||
import { Deferred } from "@/services";
|
||||
import { recipeService } from "@/services/recipeService";
|
||||
import { debounce } from "@/_base/debounce";
|
||||
|
||||
@Component({ components: { modal: Modal, pirometro: Pirometro, stepfooter: StepFooter, termosuperiore: TermoregolazioneSuperiore, termoinferiore: TermoregolazioneInferiore } })
|
||||
export default class ShowPirometroInfo extends Vue {
|
||||
@@ -29,10 +30,12 @@ export default class ShowPirometroInfo extends Vue {
|
||||
|
||||
@Watch('recipe', { deep: true })
|
||||
async recipeChanged(n, o) {
|
||||
await recipeService.Update(this.preparePayload());
|
||||
}
|
||||
this.debouncedRecipeSave()
|
||||
};
|
||||
|
||||
preparePayload() {
|
||||
debouncedRecipeSave = debounce(async () => await recipeService.Update(this.payload), 200);
|
||||
|
||||
get payload() {
|
||||
return {
|
||||
pyrometer_pyrometer_enabled: this.recipe.pyrometer_pyrometer_enabled,
|
||||
pyrometer_pyrometer_setpoint: this.recipe.pyrometer_pyrometer_setpoint,
|
||||
@@ -57,15 +60,24 @@ export default class ShowPirometroInfo extends Vue {
|
||||
}
|
||||
|
||||
hasErrors() {
|
||||
let payload = this.preparePayload();
|
||||
let payload = this.recipe;
|
||||
let errors = false;
|
||||
for (const key in this.preparePayload()) {
|
||||
for (const key in this.recipe) {
|
||||
const el = payload[key] as Recipe.IValue;
|
||||
if (el.status.hasError) errors = true;
|
||||
}
|
||||
return errors;
|
||||
}
|
||||
|
||||
hasChanges() {
|
||||
let result = false;
|
||||
for (const key in this.payload) {
|
||||
const el = this.payload[key] as Recipe.IValue;
|
||||
if (el.setpointHMI != el.setpointPLC) result = true;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
hasEnabledFields(...fields: string[]) {
|
||||
let result = false;
|
||||
for (const field of fields) {
|
||||
@@ -103,8 +115,8 @@ export default class ShowPirometroInfo extends Vue {
|
||||
// recipeActions.setCurrent(store, this.recipe);
|
||||
|
||||
await recipeService.Confirm('Pyrometer');
|
||||
ModalHelper.HideModal();
|
||||
this.deferred.resolve(1);
|
||||
// ModalHelper.HideModal();
|
||||
// this.deferred.resolve(1);
|
||||
};
|
||||
|
||||
goTo(step) {
|
||||
|
||||
+6
-2
@@ -23,11 +23,15 @@
|
||||
<termosuperiore v-if="show==1" :recipe="recipe"></termosuperiore>
|
||||
<termoinferiore v-if="show==2" :recipe="recipe"></termoinferiore>
|
||||
<footer>
|
||||
<button class="btn" @click="annulla()">{{'cancel' | localize('Annulla')}}</button>
|
||||
<button
|
||||
class="btn"
|
||||
@click="annulla()"
|
||||
:disabled="!hasChanges()"
|
||||
>{{'cancel' | localize('Annulla')}}</button>
|
||||
<button
|
||||
class="btn btn-success"
|
||||
@click="conferma()"
|
||||
:disabled="hasErrors()"
|
||||
:disabled="hasErrors() || !hasChanges()"
|
||||
>{{'confirm' | localize('Conferma')}}</button>
|
||||
</footer>
|
||||
</modal>
|
||||
|
||||
+19
-7
@@ -11,6 +11,7 @@ import { store } from "@/store";
|
||||
import { Prop, Watch } from "vue-property-decorator";
|
||||
import { Deferred } from "@/services";
|
||||
import { recipeService } from "@/services/recipeService";
|
||||
import { debounce } from "@/_base/debounce";
|
||||
|
||||
@Component({
|
||||
components: {
|
||||
@@ -37,10 +38,12 @@ export default class ShowQuoteVelocitaInfo extends Vue {
|
||||
|
||||
@Watch('recipe', { deep: true })
|
||||
async recipeChanged(n, o) {
|
||||
await recipeService.Update(this.preparePayload());
|
||||
}
|
||||
this.debouncedRecipeSave()
|
||||
};
|
||||
|
||||
preparePayload() {
|
||||
debouncedRecipeSave = debounce(async () => await recipeService.Update(this.payload), 200);
|
||||
|
||||
get payload() {
|
||||
return {
|
||||
positions_mould_lower_position: this.recipe.positions_mould_lower_position,
|
||||
positions_mould_lower_speed: this.recipe.positions_mould_lower_speed,
|
||||
@@ -70,15 +73,24 @@ export default class ShowQuoteVelocitaInfo extends Vue {
|
||||
}
|
||||
|
||||
hasErrors() {
|
||||
let payload = this.preparePayload();
|
||||
let payload = this.recipe;
|
||||
let errors = false;
|
||||
for (const key in this.preparePayload()) {
|
||||
for (const key in this.recipe) {
|
||||
const el = payload[key] as Recipe.IValue;
|
||||
if (el.status.hasError) errors = true;
|
||||
}
|
||||
return errors;
|
||||
}
|
||||
|
||||
hasChanges() {
|
||||
let result = false;
|
||||
for (const key in this.payload) {
|
||||
const el = this.payload[key] as Recipe.IValue;
|
||||
if (el.setpointHMI != el.setpointPLC) result = true;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
hasEnabledFields(...fields: string[]) {
|
||||
let result = false;
|
||||
for (const field of fields) {
|
||||
@@ -130,8 +142,8 @@ export default class ShowQuoteVelocitaInfo extends Vue {
|
||||
// recipeActions.setCurrent(store, this.recipe);
|
||||
|
||||
await recipeService.Confirm('Positions');
|
||||
ModalHelper.HideModal();
|
||||
this.deferred.resolve(1);
|
||||
// ModalHelper.HideModal();
|
||||
// this.deferred.resolve(1);
|
||||
};
|
||||
|
||||
goTo(step) {
|
||||
|
||||
+6
-2
@@ -27,11 +27,15 @@
|
||||
<discesacornice v-if="show==1" :recipe="recipe"></discesacornice>
|
||||
<controstampo v-if="show==2" :recipe="recipe"></controstampo>
|
||||
<footer>
|
||||
<button class="btn" @click="annulla()">{{'cancel' | localize('Annulla')}}</button>
|
||||
<button
|
||||
class="btn"
|
||||
@click="annulla()"
|
||||
:disabled="!hasChanges()"
|
||||
>{{'cancel' | localize('Annulla')}}</button>
|
||||
<button
|
||||
class="btn btn-success"
|
||||
@click="conferma()"
|
||||
:disabled="hasErrors()"
|
||||
:disabled="hasErrors() || !hasChanges()"
|
||||
>{{'confirm' | localize('Conferma')}}</button>
|
||||
</footer>
|
||||
</modal>
|
||||
|
||||
+19
-7
@@ -13,6 +13,7 @@ import { recipeActions } from "@/store/recipe.store";
|
||||
import { store } from "@/store";
|
||||
import { Deferred } from '@/services';
|
||||
import { recipeService } from "@/services/recipeService";
|
||||
import { debounce } from '@/_base/debounce';
|
||||
|
||||
@Component({
|
||||
components: {
|
||||
@@ -41,11 +42,13 @@ export default class Raffreddamento extends Vue {
|
||||
|
||||
@Watch('recipe', { deep: true })
|
||||
async recipeChanged(n, o) {
|
||||
await recipeService.Update(this.preparePayload());
|
||||
}
|
||||
this.debouncedRecipeSave()
|
||||
};
|
||||
|
||||
debouncedRecipeSave = debounce(async () => await recipeService.Update(this.payload), 200);
|
||||
|
||||
|
||||
preparePayload() {
|
||||
get payload() {
|
||||
return {
|
||||
cooling_blowing_type: this.recipe.cooling_blowing_type,
|
||||
cooling_blowing_delay: this.recipe.cooling_blowing_delay,
|
||||
@@ -80,15 +83,24 @@ export default class Raffreddamento extends Vue {
|
||||
}
|
||||
|
||||
hasErrors() {
|
||||
let payload = this.preparePayload();
|
||||
let payload = this.recipe;
|
||||
let errors = false;
|
||||
for (const key in this.preparePayload()) {
|
||||
for (const key in this.recipe) {
|
||||
const el = payload[key] as Recipe.IValue;
|
||||
if (el.status.hasError) errors = true;
|
||||
}
|
||||
return errors;
|
||||
}
|
||||
|
||||
hasChanges() {
|
||||
let result = false;
|
||||
for (const key in this.payload) {
|
||||
const el = this.payload[key] as Recipe.IValue;
|
||||
if (el.setpointHMI != el.setpointPLC) result = true;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
hasEnabledFields(...fields: string[]) {
|
||||
let result = false;
|
||||
@@ -150,8 +162,8 @@ export default class Raffreddamento extends Vue {
|
||||
// recipeActions.setCurrent(store, this.recipe);
|
||||
|
||||
await recipeService.Confirm('Cooling');
|
||||
ModalHelper.HideModal();
|
||||
this.deferred.resolve(1);
|
||||
// ModalHelper.HideModal();
|
||||
// this.deferred.resolve(1);
|
||||
};
|
||||
|
||||
goTo(step) {
|
||||
|
||||
+6
-2
@@ -39,11 +39,15 @@
|
||||
<telescopi v-if="show==3" :recipe="recipe"></telescopi>
|
||||
<otturatori v-if="show==4" :recipe="recipe"></otturatori>
|
||||
<footer>
|
||||
<button class="btn" @click="annulla()">{{'cancel' | localize('Annulla')}}</button>
|
||||
<button
|
||||
class="btn"
|
||||
@click="annulla()"
|
||||
:disabled="!hasChanges()"
|
||||
>{{'cancel' | localize('Annulla')}}</button>
|
||||
<button
|
||||
class="btn btn-success"
|
||||
@click="conferma()"
|
||||
:disabled="hasErrors()"
|
||||
:disabled="hasErrors() || !hasChanges()"
|
||||
>{{'confirm' | localize('Conferma')}}</button>
|
||||
</footer>
|
||||
</modal>
|
||||
|
||||
+19
-7
@@ -12,6 +12,7 @@ import { store } from "@/store";
|
||||
import { Deferred } from "@/services";
|
||||
import { recipeService } from "@/services/recipeService";
|
||||
import { warmersService } from "@/services/warmersService";
|
||||
import { debounce } from "@/_base/debounce";
|
||||
|
||||
@Component({ components: { modal: Modal, stepfooter: StepFooter, riscaldiinf: RiscaldiInf, riscaldisup: RiscaldiSup, sostdecomp: SostDecomp } })
|
||||
export default class ShowRiscaldamentoSuperioreInfo extends Vue {
|
||||
@@ -30,10 +31,12 @@ export default class ShowRiscaldamentoSuperioreInfo extends Vue {
|
||||
|
||||
@Watch('recipe', { deep: true })
|
||||
async recipeChanged(n, o) {
|
||||
await recipeService.Update(this.preparePayload());
|
||||
}
|
||||
this.debouncedRecipeSave()
|
||||
};
|
||||
|
||||
preparePayload() {
|
||||
debouncedRecipeSave = debounce(async () => await recipeService.Update(this.payload), 200);
|
||||
|
||||
get payload() {
|
||||
return {
|
||||
heats_lowerheaters_max_time: this.recipe.heats_lowerheaters_max_time,
|
||||
heats_lowerheaters_movement_enabled: this.recipe.heats_lowerheaters_movement_enabled,
|
||||
@@ -54,15 +57,24 @@ export default class ShowRiscaldamentoSuperioreInfo extends Vue {
|
||||
}
|
||||
|
||||
hasErrors() {
|
||||
let payload = this.preparePayload();
|
||||
let payload = this.recipe;
|
||||
let errors = false;
|
||||
for (const key in this.preparePayload()) {
|
||||
for (const key in this.recipe) {
|
||||
const el = payload[key] as Recipe.IValue;
|
||||
if (el.status.hasError) errors = true;
|
||||
}
|
||||
return errors;
|
||||
}
|
||||
|
||||
hasChanges() {
|
||||
let result = false;
|
||||
for (const key in this.payload) {
|
||||
const el = this.payload[key] as Recipe.IValue;
|
||||
if (el.setpointHMI != el.setpointPLC) result = true;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
hasEnabledFields(...fields: string[]) {
|
||||
let result = false;
|
||||
for (const field of fields) {
|
||||
@@ -107,8 +119,8 @@ export default class ShowRiscaldamentoSuperioreInfo extends Vue {
|
||||
await warmersService.Update(store.state.warmers.channels.reduce((p, c) => { p[c.idChannel] = c.setpointHMI; return p; }, {}));
|
||||
await warmersService.Confirm();
|
||||
await recipeService.Confirm('Heats');
|
||||
ModalHelper.HideModal();
|
||||
this.deferred.resolve(1);
|
||||
// ModalHelper.HideModal();
|
||||
// this.deferred.resolve(1);
|
||||
};
|
||||
|
||||
goTo(step) {
|
||||
|
||||
+7
-3
@@ -26,12 +26,16 @@
|
||||
<riscaldiinf v-if="show == 1" :recipe="recipe"></riscaldiinf>
|
||||
<riscaldisup v-if="show == 0" :recipe="recipe"></riscaldisup>
|
||||
<sostdecomp v-if="show == 2" :recipe="recipe"></sostdecomp>
|
||||
<footer>
|
||||
<button class="btn" @click="annulla()">{{'cancel' | localize('Annulla')}}</button>
|
||||
<footer>
|
||||
<button
|
||||
class="btn"
|
||||
@click="annulla()"
|
||||
:disabled="!hasChanges()"
|
||||
>{{'cancel' | localize('Annulla')}}</button>
|
||||
<button
|
||||
class="btn btn-success"
|
||||
@click="conferma()"
|
||||
:disabled="hasErrors()"
|
||||
:disabled="hasErrors() || !hasChanges()"
|
||||
>{{'confirm' | localize('Conferma')}}</button>
|
||||
</footer>
|
||||
</modal>
|
||||
|
||||
@@ -12,6 +12,7 @@ import { recipeActions } from "@/store/recipe.store";
|
||||
import { store } from "@/store";
|
||||
import { Deferred } from "@/services";
|
||||
import { recipeService } from "@/services/recipeService";
|
||||
import { debounce } from "@/_base/debounce";
|
||||
|
||||
@Component({
|
||||
components:
|
||||
@@ -41,10 +42,12 @@ export default class ShowVuotoInfo extends Vue {
|
||||
|
||||
@Watch('recipe', { deep: true })
|
||||
async recipeChanged(n, o) {
|
||||
await recipeService.Update(this.preparePayload());
|
||||
}
|
||||
this.debouncedRecipeSave()
|
||||
};
|
||||
|
||||
preparePayload() {
|
||||
debouncedRecipeSave = debounce(async () => await recipeService.Update(this.payload), 200);
|
||||
|
||||
get payload() {
|
||||
return {
|
||||
vacuum_main_start: this.recipe.vacuum_main_start,
|
||||
vacuum_main_delay: this.recipe.vacuum_main_delay,
|
||||
@@ -82,15 +85,24 @@ export default class ShowVuotoInfo extends Vue {
|
||||
}
|
||||
|
||||
hasErrors() {
|
||||
let payload = this.preparePayload();
|
||||
let payload = this.recipe;
|
||||
let errors = false;
|
||||
for (const key in this.preparePayload()) {
|
||||
for (const key in this.recipe) {
|
||||
const el = payload[key] as Recipe.IValue;
|
||||
if (el.status.hasError) errors = true;
|
||||
}
|
||||
return errors;
|
||||
}
|
||||
|
||||
hasChanges() {
|
||||
let result = false;
|
||||
for (const key in this.payload) {
|
||||
const el = this.payload[key] as Recipe.IValue;
|
||||
if (el.setpointHMI != el.setpointPLC) result = true;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
hasEnabledFields(...fields: string[]) {
|
||||
let result = false;
|
||||
for (const field of fields) {
|
||||
@@ -154,8 +166,8 @@ export default class ShowVuotoInfo extends Vue {
|
||||
// recipeActions.setCurrent(store, this.recipe);
|
||||
|
||||
await recipeService.Confirm('Vacuum');
|
||||
ModalHelper.HideModal();
|
||||
this.deferred.resolve(1);
|
||||
// ModalHelper.HideModal();
|
||||
// this.deferred.resolve(1);
|
||||
};
|
||||
|
||||
goTo(step) {
|
||||
|
||||
@@ -33,11 +33,15 @@
|
||||
<vuotoausiliario v-if="show==2" :recipe="recipe"></vuotoausiliario>
|
||||
<prevuoto v-if="show==3" :recipe="recipe"></prevuoto>
|
||||
<footer>
|
||||
<button class="btn" @click="annulla()">{{'cancel' | localize('Annulla')}}</button>
|
||||
<button
|
||||
class="btn"
|
||||
@click="annulla()"
|
||||
:disabled="!hasChanges()"
|
||||
>{{'cancel' | localize('Annulla')}}</button>
|
||||
<button
|
||||
class="btn btn-success"
|
||||
@click="conferma()"
|
||||
:disabled="hasErrors()"
|
||||
:disabled="hasErrors() || !hasChanges()"
|
||||
>{{'confirm' | localize('Conferma')}}</button>
|
||||
</footer>
|
||||
</modal>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Vue from "vue";
|
||||
import Component from "vue-class-component";
|
||||
import ProcessInfo from "@/modules/base-components/process-info.vue";
|
||||
import { AppModel, buttonStatus } from "@/store";
|
||||
import { AppModel, buttonStatus, store } from "@/store";
|
||||
import { /*Factory,*/ messageService } from "@/_base";
|
||||
//import { Hub } from "src/services/hub";
|
||||
//import { Watch } from "vue-property-decorator";
|
||||
@@ -11,6 +11,11 @@ import { Prop } from "vue-property-decorator";
|
||||
import Archinterface from "@/app_modules_thermo/components/arch-interface/arch-interface.vue";
|
||||
import { recipeService } from "@/services/recipeService";
|
||||
|
||||
import saveAsModal from "@/app_modules_thermo/save/save.vue";
|
||||
import changeNotesModal from "@/app_modules_thermo/save/changeNotes.vue";
|
||||
import { ModalHelper } from "@/components/modals";
|
||||
import { recipeStore } from "@/store/recipe.store";
|
||||
|
||||
|
||||
declare let $: any;
|
||||
|
||||
@@ -23,6 +28,8 @@ declare let $: any;
|
||||
export default class AppHeader extends Vue {
|
||||
$store: any;
|
||||
|
||||
showSaveAsMenu: boolean = false;
|
||||
|
||||
public get state() { return this.$store.state.machineStatus; };
|
||||
public get isMainViewLiftedUp() { return this.$store.state.isMainViewLiftedUp; }
|
||||
public get mainStatus() { return this.$store.getters.mainStatus; };
|
||||
@@ -84,6 +91,16 @@ export default class AppHeader extends Vue {
|
||||
}
|
||||
}
|
||||
|
||||
public async showSaveAsModal() {
|
||||
let result = await ModalHelper.ShowModalAsync(saveAsModal, (this.$store.state as AppModel).prod.panel.nomeRicetta);
|
||||
await recipeService.SaveAs(result);
|
||||
}
|
||||
|
||||
public async showChangeNoteModal() {
|
||||
let result = await ModalHelper.ShowModalAsync(changeNotesModal, "");
|
||||
await recipeService.UpdateNotes(result);
|
||||
}
|
||||
|
||||
public get ribbonStatus(): ribbonStatusEnum {
|
||||
|
||||
// Controllo se ci sono allarmi
|
||||
@@ -93,7 +110,6 @@ export default class AppHeader extends Vue {
|
||||
if (s.alarms.warnings.length > 0) return ribbonStatusEnum.Warning;
|
||||
if (s.process.running) return ribbonStatusEnum.Working;
|
||||
return ribbonStatusEnum.Idle;
|
||||
|
||||
}
|
||||
|
||||
public get serviceRequired() {
|
||||
@@ -113,7 +129,6 @@ export default class AppHeader extends Vue {
|
||||
// Hub.Current.sendPowerCommand(btn.id);
|
||||
}
|
||||
|
||||
|
||||
async saveRecipe() {
|
||||
await recipeService.Save();
|
||||
}
|
||||
|
||||
@@ -159,6 +159,24 @@
|
||||
<button class="over blue" :title="'recipe_save' | localize('save')" @click="saveRecipe()">
|
||||
<i class="fa fa-save"></i>
|
||||
</button>
|
||||
<div class="context-menu">
|
||||
<button
|
||||
class="over blue"
|
||||
:title="'recipe_saveas_button' | localize('saveas-button')"
|
||||
@click="showSaveAsMenu = !showSaveAsMenu"
|
||||
>
|
||||
<i class="fa fa-ellipsis-h"></i>
|
||||
</button>
|
||||
<ul class="context-area" :class="{'show': showSaveAsMenu}">
|
||||
<li
|
||||
@click="showSaveAsMenu = false; showSaveAsModal()"
|
||||
>{{'recipe_saveas' | localize('Salva con nome')}}</li>
|
||||
<li
|
||||
@click="showSaveAsMenu = false; showChangeNoteModal()"
|
||||
>{{'recipe_change_note' | localize('Modifica nota')}}</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<archinterface></archinterface>
|
||||
<user-info></user-info>
|
||||
</header>
|
||||
|
||||
@@ -86,5 +86,10 @@ export class RecipeService extends baseRestService {
|
||||
return result;
|
||||
}
|
||||
|
||||
async UpdateNotes(note: string) {
|
||||
let result = await this.Post<any>((await this.BASE_URL()) + `updateNote?recipeNotes=${note}`, null, true);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
export const recipeService = new RecipeService();
|
||||
|
||||
Reference in New Issue
Block a user