From e12b136b83bc0b266bbfb888708fcb2b718c6d01 Mon Sep 17 00:00:00 2001 From: Paolo Possanzini Date: Tue, 24 Apr 2018 11:13:30 +0200 Subject: [PATCH] depot --- Step/wwwroot/src/app.routes.js | 5 ++-- Step/wwwroot/src/components/depot.ts | 24 +++++++++++++++++++ Step/wwwroot/src/components/depot.vue | 21 +++++++--------- Step/wwwroot/src/components/tooling.ts | 7 ++++-- Step/wwwroot/src/components/tooling.vue | 2 +- .../modules/base-components/cards/index.js | 5 ++++ 6 files changed, 47 insertions(+), 17 deletions(-) create mode 100644 Step/wwwroot/src/components/depot.ts create mode 100644 Step/wwwroot/src/modules/base-components/cards/index.js diff --git a/Step/wwwroot/src/app.routes.js b/Step/wwwroot/src/app.routes.js index 6701b094..69aba130 100644 --- a/Step/wwwroot/src/app.routes.js +++ b/Step/wwwroot/src/app.routes.js @@ -20,9 +20,10 @@ import { export let routes = [ { path: "", component: Home, name: "home", meta: { title: "Step - Dashboard" } }, { path: "/production", meta: { title: "Step - Production", area: "production" } }, - { path: "/tooling", component: Tooling, meta: { title: "Step - Tools", area: "tooling" } }, - { path: "/depot", component: Depot, meta: { title: "Step - Depot", area: "depot" } }, + { path: "/tooling", component: Tooling, meta: { title: "Step - Tools", area: "tooling" } }, + { name: "depot", path: "/depot/:id", component: Depot, meta: { title: "Step - Depot", area: "depot" } }, + { path: "/summary-depot", component: SummaryDepot, meta: { title: "Step - Summary-Depot", area: "summary-depot" } }, { path: "/assisted-tooling", component: AssistedTooling, meta: { title: "Step - Assisted-Tooling", area: "assisted-tooling" } }, { path: "/tooling-equipment", component: ToolingEquipment, meta: { title: "Step - Tooling-Equipment", area: "tooling-equipment" } }, diff --git a/Step/wwwroot/src/components/depot.ts b/Step/wwwroot/src/components/depot.ts new file mode 100644 index 00000000..5614b60f --- /dev/null +++ b/Step/wwwroot/src/components/depot.ts @@ -0,0 +1,24 @@ +import Vue from "vue"; +import Component from "vue-class-component"; +import { tool, detailCard } from "src/modules/base-components/cards" + +@Component({ components: { tool, detailCard } }) +export default class depot extends Vue { + + $route: any; + + depotId: number = 0; + + editable: boolean = false; + + mounted() { + this.depotId = this.$route.params.id; + } + + toggleEdit(){ + this.editable = !this.editable; + } + + + +} diff --git a/Step/wwwroot/src/components/depot.vue b/Step/wwwroot/src/components/depot.vue index bca86325..35b2ae1e 100644 --- a/Step/wwwroot/src/components/depot.vue +++ b/Step/wwwroot/src/components/depot.vue @@ -3,14 +3,17 @@
- Magazzino 1 - Lineare + + + + {{'depot_title' | localize("Magazzino")}} {{depotId}} - Lineare
-
+
{{'depot_label_search' | localize("Seleziona un utensile e posizionalo nel magazzino corrispondente:")}}
- + diff --git a/Step/wwwroot/src/components/tooling.ts b/Step/wwwroot/src/components/tooling.ts index 98a75d38..71919c13 100644 --- a/Step/wwwroot/src/components/tooling.ts +++ b/Step/wwwroot/src/components/tooling.ts @@ -3,10 +3,13 @@ import Component from "vue-class-component"; import { card } from "../modules/base-components"; import { AppModel, store } from "../store"; + @Component({ name: "tooling", components: { card: card } }) export default class Tooling extends Vue { + $route: any; + public magazines: server.MagazineModel[] = (this.$store.state as AppModel).tooling.magazines; // public get magazines(): server.MagazineModel[] { @@ -21,7 +24,7 @@ export default class Tooling extends Vue { } - public archiveClick = function (val) { - console.log(val); + public goToDepot = function (item:server.MagazineModel) { + this.$router.push({ name: 'depot', params:{id: item.id} }); } } diff --git a/Step/wwwroot/src/components/tooling.vue b/Step/wwwroot/src/components/tooling.vue index ae409234..77bc4473 100644 --- a/Step/wwwroot/src/components/tooling.vue +++ b/Step/wwwroot/src/components/tooling.vue @@ -7,7 +7,7 @@
+ :title="getStoreTitle(t.type) + t.id" img-source="../assets/images/image_tooling.PNG" @click="goToDepot(t)">
diff --git a/Step/wwwroot/src/modules/base-components/cards/index.js b/Step/wwwroot/src/modules/base-components/cards/index.js new file mode 100644 index 00000000..22953555 --- /dev/null +++ b/Step/wwwroot/src/modules/base-components/cards/index.js @@ -0,0 +1,5 @@ +import cardUtilities from "./card-utilities.vue"; +import tool from "./tool.vue"; +import detailCard from "./detail-card.vue"; + +export { cardUtilities, tool, detailCard }; \ No newline at end of file