From bba17012aeedf087e50b71defe8acde45ab1ccca Mon Sep 17 00:00:00 2001 From: Lucio Maranta Date: Tue, 19 Feb 2019 14:05:38 +0100 Subject: [PATCH] Fix frontend --- Step/wwwroot/src/@types/tooling.d.ts | 3 ++- .../tooling/components/tooling-depot.ts | 24 +++++++++++++------ 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/Step/wwwroot/src/@types/tooling.d.ts b/Step/wwwroot/src/@types/tooling.d.ts index 962b9d55..a46a983c 100644 --- a/Step/wwwroot/src/@types/tooling.d.ts +++ b/Step/wwwroot/src/@types/tooling.d.ts @@ -141,7 +141,8 @@ declare module server { balluf: number, magazinePositionType: number, maxLeft: number, - maxRight: number + maxRight: number, + childsTools: Array } export interface FamiliesNc{ diff --git a/Step/wwwroot/src/app_modules/tooling/components/tooling-depot.ts b/Step/wwwroot/src/app_modules/tooling/components/tooling-depot.ts index 3bafdc6d..4e7cafe7 100644 --- a/Step/wwwroot/src/app_modules/tooling/components/tooling-depot.ts +++ b/Step/wwwroot/src/app_modules/tooling/components/tooling-depot.ts @@ -511,13 +511,23 @@ export default class depot extends Vue { } public dataForOpenInfoNcShank(id) { - let shank = (this.$store.state as AppModel).tooling.ncShanks.find(s => s.id == id); - - ModalHelper.infoEquipmentModal.enableModalShank = true; - ModalHelper.infoEquipmentModal.enableModalTool = false; - ModalHelper.infoEquipmentModal.currentShank = shank; - ModalHelper.infoEquipmentModal.editEnabled = !this.editable; - ModalHelper.ShowModal(InfoEquipment); + let shank = (this.$store.state as AppModel).tooling.ncShanks.find(t => t.id == id); + console.log(shank) + if (shank.childsTools.length == 1) { + ModalHelper.infoEquipmentModal.enableModalShank = false; + ModalHelper.infoEquipmentModal.enableModalTool = true; + ModalHelper.infoEquipmentModal.currentEquipment = shank.childsTools[0]; + ModalHelper.infoEquipmentModal.editEnabled = !this.editable; + ModalHelper.ShowModal(InfoEquipment); + } + else { + let shank = (this.$store.state as AppModel).tooling.ncShanks.find(s => s.id == id); + ModalHelper.infoEquipmentModal.enableModalShank = true; + ModalHelper.infoEquipmentModal.enableModalTool = false; + ModalHelper.infoEquipmentModal.currentShank = shank; + ModalHelper.infoEquipmentModal.editEnabled = !this.editable; + ModalHelper.ShowModal(InfoEquipment); + } }