primi bugfix

This commit is contained in:
Paolo Possanzini
2018-10-17 12:39:26 +02:00
parent 29c4747785
commit 3474dd6017
9 changed files with 739 additions and 682 deletions
+640 -614
View File
File diff suppressed because it is too large Load Diff
+10 -10
View File
@@ -7,7 +7,7 @@
display: flex;
justify-content: center;
padding-top: 104px;
.job-editor-box{
width: 1808px;
height: 872px;
@@ -42,7 +42,7 @@
// border-radius: 2px;
// font-size: 20px;
// }
.job-name-box{
.job-name-box{
font-size: 18px;
line-height: 1.11;
color: #4b4b4b;
@@ -53,11 +53,11 @@
}
.btn{
width: 70px;
}
}
.fa{
font-size: 24px;
cursor: pointer;
cursor: pointer;
}
span{
@@ -110,7 +110,7 @@
}
}
.job-editor-body-box{
width: 1320px;
width: 100%;
height: 711px;
display: flex;
justify-content: flex-end;
@@ -522,25 +522,25 @@
margin-top: 14px;
.tool{
cursor: pointer;
img{
img{
background-color: #DDD;
}
}
.tool.selected{
background-color: rgba(23, 145, 255, 0.75);
color: white !important;
img{
img{
background-color: #FFF;
}
}
.notfound{
color: @color-scarlet;
.selected img{
.selected img{
background-color: @color-scarlet !important;
}
}
.notfound.selected{
img{
img{
background-color: @color-scarlet !important;
}
}
+1 -1
View File
@@ -12974,7 +12974,7 @@ footer .container button.big:before {
margin: 8px 0;
}
.job-editor-container .job-editor-box .job-editor-body .job-editor-body-box {
width: 1320px;
width: 100%;
height: 711px;
display: flex;
justify-content: flex-end;
+44 -44
View File
@@ -5,12 +5,12 @@ import { objectsJob } from "src/modules/base-components/cards";
import { tool } from "src/modules/base-components/cards";
import { inputBox } from "src/modules/base-components/cards";
import jobEditorDetail from "./job-editor-detail.vue";
import { store, AppModel } from "../store";
import { store, AppModel, jobEditorStoreActions } from "../store";
import { ToolingService } from "../services/toolingService";
import { ModalHelper, ModalMissingTools, ModalJobAddParameter } from "../modules/base-components";
import * as iziToast from "izitoast";
import { awaiter } from "src/_base";
import { ModalImage} from "src/modules/base-components/index";
import { ModalImage } from "src/modules/base-components/index";
import { Watch } from "vue-property-decorator";
declare let $: any;
@@ -20,7 +20,8 @@ export default class JobEditor extends Vue {
programName: string = null;
editing: boolean = false;
currentJob: server.Job = null;
get currentJob(): server.Job { return this.$store.state.jobEditor.currentJob; }
set currentJob(value: server.Job) { jobEditorStoreActions.setCurrentJob(this.$store, value); }
limitationList: number = 3;
selectedParam = null;
@@ -36,26 +37,25 @@ export default class JobEditor extends Vue {
get jobTools() {
var $this = this;
return this.currentJob.metadata.tools.map(t =>
{
var tool = $this.ncTools.find(i => i.id == t);
if(tool)
return tool
else
return t
});
return this.currentJob.metadata.tools.map(t => {
var tool = $this.ncTools.find(i => i.id == t);
if (tool)
return tool
else
return t
});
}
public get familyOptionActive(): boolean {
return (this.$store.state as AppModel).tooling.familyOptionActive;
}
}
get jobGenerics() {
return this.currentJob ? this.currentJob.metadata.generics : null;
}
async mounted(){
awaiter (Promise.all([
async mounted() {
awaiter(Promise.all([
await new ToolingService().GetNcTools(),
await new ToolingService().GetNcFamilies(),
await new ToolingService().GetToolsConfiguration()
@@ -78,17 +78,17 @@ export default class JobEditor extends Vue {
}
deleteImageFromJob(image) {
ModalHelper.AskConfirm(this.$options.filters.localize("modal_delete_image_job", "Richiesta di conferma"),
this.$options.filters.localize("modal_delete_image_job_confirm", "Sei sicuro di voler eliminare l'immagine?"),
() => {
var res = cmsClient.delImageFromJob(image.name);
if (this.currentJob) {
var images = this.currentJob.metadata.generics.images;
images.splice(images.indexOf(image), 1);
}
}, null);
this.$options.filters.localize("modal_delete_image_job_confirm", "Sei sicuro di voler eliminare l'immagine?"),
() => {
var res = cmsClient.delImageFromJob(image.name);
if (this.currentJob) {
var images = this.currentJob.metadata.generics.images;
images.splice(images.indexOf(image), 1);
}
}, null);
}
openImage(image){
openImage(image) {
ModalHelper.modalImage.content = image.base64;
ModalHelper.modalImage.title = image.name;
ModalHelper.ShowModal(ModalImage);
@@ -100,14 +100,14 @@ export default class JobEditor extends Vue {
this.$options.filters.localize("modal_open_job_body", "Sei sicuro di aver salvato il Job?"),
() => {
var res = cmsClient.newJob();
if(res){
if (res) {
var obj = JSON.parse(res);
if(obj.error)
if (obj.error)
this.showError(obj.error);
else
this.currentJob = obj;
}
}, null);
else
this.currentJob = JSON.parse(cmsClient.newJob());
@@ -133,11 +133,11 @@ export default class JobEditor extends Vue {
async loadJob() {
var res = cmsClient.openJob();
if(res){
if (res) {
var obj = JSON.parse(res);
if(obj.error)
if (obj.error)
this.showError(obj.error);
else{
else {
this.currentJob = obj;
}
}
@@ -146,9 +146,9 @@ export default class JobEditor extends Vue {
saveJobNewPath() {
if (this.currentJob) {
var res = cmsClient.saveJobNewPath(JSON.stringify(this.currentJob));
if(res){
if (res) {
var obj = JSON.parse(res);
if(obj.error)
if (obj.error)
this.showError(obj.error);
else
this.currentJob.name = obj.name;
@@ -159,9 +159,9 @@ export default class JobEditor extends Vue {
saveJob() {
if (this.currentJob) {
var res = cmsClient.saveJob(JSON.stringify(this.currentJob));
if(res){
if (res) {
var obj = JSON.parse(res);
if(obj.error)
if (obj.error)
this.showError(obj.error);
else
this.currentJob.name = obj.name;
@@ -176,9 +176,9 @@ export default class JobEditor extends Vue {
this.$options.filters.localize("modal_open_job_body", "Sei sicuro di aver salvato il Job?"),
() => {
var res = cmsClient.closeJob();
if(res){
if (res) {
var obj = JSON.parse(res);
if(obj.error)
if (obj.error)
this.showError(obj.error);
}
else
@@ -233,7 +233,7 @@ export default class JobEditor extends Vue {
showError(error) {
(iziToast as any).error({
title: "Error",
message: error,
@@ -244,19 +244,19 @@ export default class JobEditor extends Vue {
})
}
familyNameFromId(id): any{
familyNameFromId(id): any {
var found = this.ncFamilies.find(k => k.id == id);
if(found)
if (found)
return found.name;
return '';
}
calcFamilyName(id): any{
if(this.familyOptionActive)
return this.$options.filters.localize("tooling_family_abbreviation", 'F%d',id) + ' - ' + this.familyNameFromId(id);
calcFamilyName(id): any {
if (this.familyOptionActive)
return this.$options.filters.localize("tooling_family_abbreviation", 'F%d', id) + ' - ' + this.familyNameFromId(id);
else
return this.familyNameFromId(id);
}
}
getToolIcon = function (id) {
if (id == 9999)
@@ -266,7 +266,7 @@ export default class JobEditor extends Vue {
else
return "../assets/icons/Tools/Tools.png"
}
}
+2 -2
View File
@@ -15,9 +15,9 @@
<button class="btn" :disabled="!currentJob" @click="closeJob()" :title="'job_editor_btn_close' | localize('Chiudi Job')"><i class="fa fa-window-close"></i></button>
</div>
</div>
<div class="job-editor-body">
<div class="job-editor-body" >
<!-- Lista degli elementi disponibili -->
<div class="job-editor-column-left" >
<div class="job-editor-column-left" v-show="currentJob">
<Container :group-name="'commands'" :get-child-payload="getChildPayload" >
<div class="column-left-title">
<span>{{'drag_job_items_to_compose_job' | localize('Trascina nella parte centrale della pagina gli oggetti che desideri aggiungere al job')}}</span>
@@ -8,7 +8,7 @@
<select class="arrow" v-model="bindingValue" v-if="type=='select'" :disabled="readOnly">
<slot></slot>
</select>
<input v-if="type=='int' || type=='double'" v-model.number="bindingValue" type="number"
<input v-if="type=='int' || type=='double'" v-model="bindingValue" type="number"
:min="minValue" :max="maxValue" v-validate.initial="{min_value:minValue, max_value: maxValue || 9999999}"
:readonly="readOnly">
<div class="togglebutton" v-if="type=='boolean'">
@@ -52,7 +52,7 @@ export default {
return this.value;
},
set(v) {
this.$emit("input", v);
}
}
+9 -7
View File
@@ -6,13 +6,13 @@ import { machineStatusStore, MachineStatusModel } from "./machineStatus.store";
import { alarmsStore, AlarmsModel } from "./alarms.store";
import { processStore, RunningProcessModel } from "./runningProcess.store";
import { localizationStore, LocalizationModel, localizationModelActions } from "./localization.store";
import { toolingStore , ToolingStoreModel } from "./tooling.store";
import { depotStore, DepotStoreModel} from "./depot.store";
import { maintenanceStore, MaintenanceStoreModel} from "./maintenance.store";
import { toolingStore, ToolingStoreModel } from "./tooling.store";
import { depotStore, DepotStoreModel } from "./depot.store";
import { maintenanceStore, MaintenanceStoreModel } from "./maintenance.store";
import { LocalizationService, localizationService } from "src/services/localizationService";
import { ProductionStoreModel, productionStore } from "./production.store";
import { jobEditorStore } from "./jobEditor.store";
Vue.use(Vuex);
@@ -31,6 +31,7 @@ export interface AppModel {
depot: DepotStoreModel;
production: ProductionStoreModel;
maintenance: MaintenanceStoreModel;
}
// Mutations Name
@@ -65,7 +66,8 @@ const _store = {
tooling: toolingStore,
depot: depotStore,
production: productionStore,
maintenance: maintenanceStore
maintenance: maintenanceStore,
jobEditor: jobEditorStore
},
mutations: {
@@ -98,10 +100,10 @@ const _store = {
// change the current language according to user's preferences.
if (userinfo)
localizationService.changeCurrentLanguage(userinfo.language);
// localizationModelActions.changeCurrentLanguage(context, userinfo.language);
// localizationModelActions.changeCurrentLanguage(context, userinfo.language);
else
localizationService.changeCurrentLanguage((context.state as AppModel).machineInfo.defaultLanguage || (context.state as AppModel).machineInfo.clientDefaultLanguage);
// localizationModelActions.changeCurrentLanguage(context, (context.state as AppModel).machineInfo.defaultLanguage || (context.state as AppModel).machineInfo.clientDefaultLanguage);
// localizationModelActions.changeCurrentLanguage(context, (context.state as AppModel).machineInfo.defaultLanguage || (context.state as AppModel).machineInfo.clientDefaultLanguage);
},
CheckLogoff(context, userid) {
if ((context.state as AppModel).currentUser && (context.state as AppModel).currentUser.id == userid)
+4 -2
View File
@@ -4,6 +4,7 @@ import { machineStatusActions, MachineStatusModel, buttonStatus } from "./machin
import { AlarmsModel, alarmsModelActions, alarmsStore, AlarmModel } from "./alarms.store";
import { processModelActions, processStore, RunningProcessModel } from "./runningProcess.store";
import { LocalizationModel, languageModel, localizationModelActions } from "./localization.store";
import { jobEditorStoreActions } from "./jobEditor.store";
export {
store,
@@ -21,5 +22,6 @@ export {
languageModel,
localizationModelActions,
AlarmModel,
buttonStatus
}
buttonStatus,
jobEditorStoreActions
}
+27
View File
@@ -0,0 +1,27 @@
export interface JobEditorStoreActions {
setCurrentJob(context, job: any);
clearCurrentJob(context);
}
export const jobEditorStore = {
state: {
currentJob: null
},
mutations: {
setCurrentJob(state, job: any) {
state.currentJob = job;
}
},
actions: {
setCurrentJob(context, job: any) {
context.commit("setCurrentJob", job);
},
clearCurrentJob(context) {
context.commit("setCurrentJob", null);
}
}
}
export const jobEditorStoreActions = jobEditorStore.actions;