From b648d41ee798e9377da78f0f9a5b5a024ab5ff0c Mon Sep 17 00:00:00 2001 From: Alessandro Francia Date: Tue, 15 May 2018 16:57:57 +0200 Subject: [PATCH] get magazine --- Step/wwwroot/assets/styles/base/tooling.less | 2 +- Step/wwwroot/assets/styles/style.css | 2 +- Step/wwwroot/src/@types/depot.d.ts | 17 ++++++ Step/wwwroot/src/app.business-logic.ts | 5 +- Step/wwwroot/src/components/depot.ts | 10 ++- Step/wwwroot/src/components/depot.vue | 27 ++------ .../modules/base-components/cards/tool.vue | 4 +- Step/wwwroot/src/services/depotService.ts | 13 +++- Step/wwwroot/src/store/depot.store.ts | 61 ++++++++++--------- 9 files changed, 82 insertions(+), 59 deletions(-) diff --git a/Step/wwwroot/assets/styles/base/tooling.less b/Step/wwwroot/assets/styles/base/tooling.less index 9a46ae0d..4a4e6832 100644 --- a/Step/wwwroot/assets/styles/base/tooling.less +++ b/Step/wwwroot/assets/styles/base/tooling.less @@ -91,7 +91,7 @@ // flex-flow: column; // align-self: center; text-align: left; - width:145px; + width: calc(~'100% - 159px'); margin-top: 11px; } diff --git a/Step/wwwroot/assets/styles/style.css b/Step/wwwroot/assets/styles/style.css index 356d2890..e20fa307 100644 --- a/Step/wwwroot/assets/styles/style.css +++ b/Step/wwwroot/assets/styles/style.css @@ -2671,7 +2671,7 @@ footer .container button.big:before { } .tool .text-body { text-align: left; - width: 145px; + width: calc(100% - 159px); margin-top: 11px; } .tool .text-right { diff --git a/Step/wwwroot/src/@types/depot.d.ts b/Step/wwwroot/src/@types/depot.d.ts index e8f5c268..da79dbd3 100644 --- a/Step/wwwroot/src/@types/depot.d.ts +++ b/Step/wwwroot/src/@types/depot.d.ts @@ -18,4 +18,21 @@ declare module server { toolType: number } + export interface AvailableToolModel{ + multiTools: MultiTools, + tools: Tools + } + + export interface MultiTools{ + id: number, + name: string, + childsTools: Array + } + + export interface Tools{ + id: number, + familyName: string, + toolType: number + } + } \ No newline at end of file diff --git a/Step/wwwroot/src/app.business-logic.ts b/Step/wwwroot/src/app.business-logic.ts index 27be37d2..47763524 100644 --- a/Step/wwwroot/src/app.business-logic.ts +++ b/Step/wwwroot/src/app.business-logic.ts @@ -60,14 +60,13 @@ async function loadMachineConfig() { let ds = new DataService(); let ts = new ToolingService(); - - let des = new DepotService(); + + // let des = new DepotService(); ds.GetSoftKeysConfiguration(); ds.GetNcSoftKeysConfiguration(); ds.GetHeadsConfiguration(); ts.GetToolTableConfiguration(); - des.GetMagazine(1); // load default language if ((store.state as AppModel).localization.currentLanguage == "") diff --git a/Step/wwwroot/src/components/depot.ts b/Step/wwwroot/src/components/depot.ts index 36b2423d..ef0c122b 100644 --- a/Step/wwwroot/src/components/depot.ts +++ b/Step/wwwroot/src/components/depot.ts @@ -1,11 +1,17 @@ import Vue from "vue"; import Component from "vue-class-component"; import { tool, detailCard, cardToolDepot } from "src/modules/base-components/cards"; +import { store, AppModel } from "src/store"; import { DepotService } from "../services/depotService"; @Component({ components: { tool, detailCard, cardToolDepot } }) export default class depot extends Vue { + public get depot(): server.DepotModel[] { return (this.$store.state as AppModel).depot.depot; } + public get availableMultiTools(): server.MultiTools[] { return (this.$store.state as AppModel).depot.availableMultiTool; } + public get availableTools(): server.Tools[] { return (this.$store.state as AppModel).depot. availableTool; } + + $route: any; depotId: number = 0; @@ -14,7 +20,9 @@ export default class depot extends Vue { mounted() { new DepotService().GetMagazine(this.$route.params.id); - // this.depotId = this.$route.params.id; + new DepotService().GetMultiToolAvailable(); + new DepotService().GetToolAvailable(); + this.depotId = this.$route.params.id; } toggleEdit(){ diff --git a/Step/wwwroot/src/components/depot.vue b/Step/wwwroot/src/components/depot.vue index b90cc40b..fb132e66 100644 --- a/Step/wwwroot/src/components/depot.vue +++ b/Step/wwwroot/src/components/depot.vue @@ -21,20 +21,8 @@
- - - - - - - - - - - - - - + +
@@ -45,13 +33,10 @@
- - Inserisci - Inserisci - Inserisci - Inserisci - Inserisci - Inserisci + + + +
diff --git a/Step/wwwroot/src/modules/base-components/cards/tool.vue b/Step/wwwroot/src/modules/base-components/cards/tool.vue index 1e86b4a4..51302650 100644 --- a/Step/wwwroot/src/modules/base-components/cards/tool.vue +++ b/Step/wwwroot/src/modules/base-components/cards/tool.vue @@ -8,8 +8,8 @@
{{code}}
{{title}}
- -
{{store}}
+ +