From c9ab2062bbbc2f005e9cf2d1eef1675e9f7a8c2e Mon Sep 17 00:00:00 2001 From: Alessandro Francia Date: Mon, 20 Aug 2018 17:02:31 +0200 Subject: [PATCH] wp4 osai --- Step/wwwroot/src/@types/tooling.d.ts | 2 +- .../components/tooling/tooling-equipment.vue | 10 +++++++++- .../components/tooling/tooling-families.ts | 9 ++++++++- .../components/tooling/tooling-families.vue | 9 +++++---- .../src/components/tooling/tooling-shanks.ts | 9 ++++----- .../src/components/tooling/tooling-shanks.vue | 13 +++++++++++- Step/wwwroot/src/services/toolingService.ts | 6 +++--- Step/wwwroot/src/store/tooling.store.ts | 20 +++++++++++++++++-- 8 files changed, 60 insertions(+), 18 deletions(-) diff --git a/Step/wwwroot/src/@types/tooling.d.ts b/Step/wwwroot/src/@types/tooling.d.ts index 05e4e44f..ac2b8fcb 100644 --- a/Step/wwwroot/src/@types/tooling.d.ts +++ b/Step/wwwroot/src/@types/tooling.d.ts @@ -127,7 +127,7 @@ declare module server { export interface FamiliesNc{ id: number, - tools: Array, + childTools: Array, name: string, type: number, rightSize: number, diff --git a/Step/wwwroot/src/components/tooling/tooling-equipment.vue b/Step/wwwroot/src/components/tooling/tooling-equipment.vue index 5e2db8e8..4bbe3489 100644 --- a/Step/wwwroot/src/components/tooling/tooling-equipment.vue +++ b/Step/wwwroot/src/components/tooling/tooling-equipment.vue @@ -20,7 +20,7 @@ -
+
+
+ +
diff --git a/Step/wwwroot/src/components/tooling/tooling-families.ts b/Step/wwwroot/src/components/tooling/tooling-families.ts index a6e2ca35..4b01755c 100644 --- a/Step/wwwroot/src/components/tooling/tooling-families.ts +++ b/Step/wwwroot/src/components/tooling/tooling-families.ts @@ -125,6 +125,7 @@ export default class toolingFamilies extends Vue { } } this.disableList = true; + this.enableModify = true; } public selectTab(elem) { @@ -146,11 +147,17 @@ export default class toolingFamilies extends Vue { } public cancel = function () { - // this.selectedTool = null; + this.selectedTool = null; this.disableList = false; this.enableModify = false; } + // public cancelNewFamily = function(){ + // this.selectedTool = null; + // this.disableList = false; + // this.enableModify = false; + // } + async save(item) { if(this.typeNc == "Demo"){ diff --git a/Step/wwwroot/src/components/tooling/tooling-families.vue b/Step/wwwroot/src/components/tooling/tooling-families.vue index d954f1b7..db579955 100644 --- a/Step/wwwroot/src/components/tooling/tooling-families.vue +++ b/Step/wwwroot/src/components/tooling/tooling-families.vue @@ -25,7 +25,7 @@ :img-source="'../assets/icons/Tools/Families.png'" @click="selectTool(f)">
- @@ -38,7 +38,7 @@
- +
{{'tooling_families_boxright_editlabel' | localize("Modifica della famiglia %s", selectedTool.name)}}
{{'tooling_families_boxright_newlabel' | localize("Aggiunta nuova famiglia")}}
@@ -56,11 +56,12 @@
- - +
diff --git a/Step/wwwroot/src/components/tooling/tooling-shanks.ts b/Step/wwwroot/src/components/tooling/tooling-shanks.ts index 13f241b4..e5830ab5 100644 --- a/Step/wwwroot/src/components/tooling/tooling-shanks.ts +++ b/Step/wwwroot/src/components/tooling/tooling-shanks.ts @@ -91,21 +91,20 @@ export default class toolingShanks extends Vue { async mounted() { if(this.typeNc == "Demo"){ awaiter (Promise.all([ - new ToolingService().GetShanks(), - new ToolingService().GetToolsConfiguration() + await new ToolingService().GetShanks(), + await new ToolingService().GetToolsConfiguration() ])); } else{ awaiter (Promise.all([ - new ToolingService().GetNcShanks(), - new ToolingService().GetToolsConfiguration() + await new ToolingService().GetNcShanks(), + await new ToolingService().GetToolsConfiguration() ])); } this.shankConfiguration = (this.$store.state as AppModel).tooling.shankConfiguration; this.childToolsShank = (this.$store.state as AppModel).tooling.childToolsShank; - if(this.shanks.length < this.maxMultitools){ this.enableAddShank = false; } diff --git a/Step/wwwroot/src/components/tooling/tooling-shanks.vue b/Step/wwwroot/src/components/tooling/tooling-shanks.vue index 58b270e7..5b1c21ee 100644 --- a/Step/wwwroot/src/components/tooling/tooling-shanks.vue +++ b/Step/wwwroot/src/components/tooling/tooling-shanks.vue @@ -19,7 +19,7 @@
-
+
+
+ +
diff --git a/Step/wwwroot/src/services/toolingService.ts b/Step/wwwroot/src/services/toolingService.ts index 0f1a002d..79cf6662 100644 --- a/Step/wwwroot/src/services/toolingService.ts +++ b/Step/wwwroot/src/services/toolingService.ts @@ -127,7 +127,7 @@ export class ToolingService extends baseRestService { return response; } - async UpdateNcFamily(model: server.Families){ + async UpdateNcFamily(model: server.FamiliesNc){ var response = await this.Put(this.BASE_URL + "nc/family/" + model.id, model); toolingActions.updateNcFamily(store, model); return response; @@ -166,7 +166,7 @@ export class ToolingService extends baseRestService { async UpdateNcTool(model: any){ var response = await this.Put(this.BASE_URL + "nc/tool/" + model.id, model); - toolingActions.updateTool(store, model); + toolingActions.updateNcTool(store, model); return response; } @@ -233,7 +233,7 @@ export class ToolingService extends baseRestService { async UpdateNcShank(model: any){ var response = await this.Put(this.BASE_URL + "nc/shank/" + model.id, model); - toolingActions.updateShank(store, model); + toolingActions.updateNcShank(store, model); return response; } diff --git a/Step/wwwroot/src/store/tooling.store.ts b/Step/wwwroot/src/store/tooling.store.ts index 947a7ec0..a7143c0e 100644 --- a/Step/wwwroot/src/store/tooling.store.ts +++ b/Step/wwwroot/src/store/tooling.store.ts @@ -37,13 +37,15 @@ export interface ToolingGetters{ export interface ToolingActions { updateMagazine(context, model: server.MagazineModel[]); updateTool(context, model: server.Tool); + updateNcTool(context, model: server.ToolNc); updateTools(context, model: server.Tool[]); updateFamily(context, model: server.Families); - updateNcFamily(context, model: server.Families); + updateNcFamily(context, model: server.FamiliesNc); updateFamilies(context, model: server.Families[]); updateShank(context, model: server.Shanks); + updateNcShank(context, model: server.ShankNc); updateShanks(context, model: server.Shanks[]); updateMagazinePosition(context, model: server.MagazinesPositions); updateMagPos(context, model: server.MagazinesPositions[]); @@ -177,6 +179,10 @@ export const toolingStore = { store._tools.set(model.id, model); store.tools = Array.from(store._tools.values()); }, + UpdateNcTool(store, model: server.ToolNc){ + store._ncTools.set(model.id, model); + store.ncTools = Array.from(store._ncTools.values()); + }, UpdateEdgeData(store, model: server.EdgesData){ store._edgesData.set(model.id, model); store.edgesData = Array.from(store._edgesData.values()); @@ -199,6 +205,10 @@ export const toolingStore = { store._shanks.set(model.id, model); store.shanks = Array.from(store._shanks.values()); }, + UpdateNcShank(store, model: server.ShankNc) { + store._ncShanks.set(model.id, model); + store.ncShanks = Array.from(store._ncShanks.values()); + }, UpdateMagPos(store, model: server.MagazinesPositions){ store._magazinePosition.set(model.positionId, model); store.magazinePosition = Array.from(store._magazinePosition.values()); @@ -403,6 +413,9 @@ export const toolingStore = { updateTool(context, model: server.Tool) { context.commit("UpdateTool", model); }, + updateNcTool(context, model: server.ToolNc){ + context.commit("UpdateNcTool", model); + }, updateTools(context, model: server.Tool[]) { for (const key in model) { const element = model[key]; @@ -412,7 +425,7 @@ export const toolingStore = { updateFamily(context, model: server.Families) { context.commit("UpdateFamily", model); }, - updateNcFamily(context, model: server.Families){ + updateNcFamily(context, model: server.FamiliesNc){ context.commit("UpdateNcFamily", model); }, updateFamilies(context, model: server.Families[]) { @@ -424,6 +437,9 @@ export const toolingStore = { updateShank(context, model: server.Shanks) { context.commit("UpdateShank", model); }, + updateNcShank(context, model: server.ShankNc){ + context.commit("UpdateNcShank", model); + }, updateShanks(context, model: server.Shanks[]) { for (const key in model) { const element = model[key];