From a0df78ed8e965a38bdea2e8334e337231f4bc2f2 Mon Sep 17 00:00:00 2001 From: Paolo Possanzini Date: Fri, 30 Nov 2018 16:57:04 +0100 Subject: [PATCH] fix rotte --- .../src/{app.routes.js => app.routes.ts} | 93 ++++++++++--------- Step/wwwroot/src/app_modules/depot/index.ts | 4 - Step/wwwroot/src/app_modules/jobs/route.js | 7 +- Step/wwwroot/src/app_modules/machine/index.ts | 4 +- .../components/depot-action-generic.ts | 2 +- .../components/depot-action-loading.ts | 2 +- .../components/depot-action-transfer.ts | 2 +- .../components/depot-action-unloading.ts | 2 +- .../components/load-depot.ts | 0 .../components/load-depot.vue | 2 +- .../tooling}/components/summary-depot.vue | 0 .../tooling/components/tooling-depot.ts | 2 +- Step/wwwroot/src/app_modules/tooling/index.ts | 4 +- Step/wwwroot/src/app_modules/tooling/route.js | 19 ++-- Step/wwwroot/src/main.js | 64 ++++++------- Step/wwwroot/src/modules/app-header.ts | 4 +- 16 files changed, 107 insertions(+), 104 deletions(-) rename Step/wwwroot/src/{app.routes.js => app.routes.ts} (54%) delete mode 100644 Step/wwwroot/src/app_modules/depot/index.ts rename Step/wwwroot/src/app_modules/{depot => tooling}/components/load-depot.ts (100%) rename Step/wwwroot/src/app_modules/{depot => tooling}/components/load-depot.vue (96%) rename Step/wwwroot/src/{ => app_modules/tooling}/components/summary-depot.vue (100%) diff --git a/Step/wwwroot/src/app.routes.js b/Step/wwwroot/src/app.routes.ts similarity index 54% rename from Step/wwwroot/src/app.routes.js rename to Step/wwwroot/src/app.routes.ts index 35b2e533..77c53175 100644 --- a/Step/wwwroot/src/app.routes.js +++ b/Step/wwwroot/src/app.routes.ts @@ -1,54 +1,54 @@ import { Home, - Tooling, - Depot, - SummaryDepot, + // Tooling, + // Depot, + // SummaryDepot, - ToolingEquipment, - InfoEquipment, + // ToolingEquipment, + // InfoEquipment, Utilities, CardUtilities, - Maintenance, + // Maintenance, MaintenanceProgress, - MaintenanceCard, - ToolingFamilies, - ToolingShanks, - ToolingMagPos, + // MaintenanceCard, + // ToolingFamilies, + // ToolingShanks, + // ToolingMagPos, CardAssistedTooling, CardToolDepot, - MaintenanceWizard, + // MaintenanceWizard, CreateMaintenance, - LoadDepot, - DepotActionLoading, - DepotActionTransfer, - DepotActionUnloading, - DepotActionGeneric, - Production, + // LoadDepot, + // DepotActionLoading, + // DepotActionTransfer, + // DepotActionUnloading, + // DepotActionGeneric, + // Production, SoftKeysPrefered, CreateQueue, - HeadSpindle, - HeadProduction, - CardAxesProduction, + // HeadSpindle, + // HeadProduction, + // CardAxesProduction, CardFolderPath, ModalIframe, - CardElementQueue, - CardProductionCms, - CardQueueProduction, - CardJobProduction, - CardProductionSectionFile, + // CardElementQueue, + // CardProductionCms, + // CardQueueProduction, + // CardJobProduction, + // CardProductionSectionFile, ModalLoadProgram, ProgramManagement, ModalJobAddParameter, ModalEditJob, - JobEditor, - ObjectsJob, + // JobEditor, + // ObjectsJob, MissingTool, ModalMissingTools, ModalAddOffsetTool, - Scada + // Scada } from "./app.modules"; @@ -63,26 +63,26 @@ export let routes = [ { path: "", component: Home, name: "home", meta: { title: "Dashboard" } }, - { name: "tooling-depot", path: "/tooling-depot/:id", component: Depot, meta: { title: "Depot", area: "depot" } }, - { path: "/summary-depot", component: SummaryDepot, meta: { title: "Summary-Depot", area: "summary-depot" } }, + + // { path: "/summary-depot", component: SummaryDepot, meta: { title: "Summary-Depot", area: "summary-depot" } }, { path: "/utilities", component: Utilities, meta: { title: "Utilities", area: "utilities" } }, { path: "/card-utilities", component: CardUtilities, meta: { title: "Card-Utilities", area: "card-utilities" } }, { path: "/card-tool-depot", component: CardToolDepot, meta: { title: "Card-Tool-Depot", area: "card-tool-depot" } }, - { path: "/load-depot", component: LoadDepot, meta: { title: "Load-Depot", area: "loaddepot" } }, + // { path: "/load-depot", component: LoadDepot, meta: { title: "Load-Depot", area: "loaddepot" } }, { path: "/softkeys-prefered", component: SoftKeysPrefered, meta: { title: "Softkeys-Prefered", area: "softkeys-prefered" } }, { path: "/create-queue", component: CreateQueue, meta: { title: "Create-Queue", area: "create-queue" } }, - { path: "/head-spindle", component: HeadSpindle, meta: { title: "Head-Spindle", area: "head-spindle" } }, - { path: "/head-production", component: HeadProduction, meta: { title: "Head-Production", area: "head-production" } }, - { path: "/card-axes-production", component: CardAxesProduction, meta: { title: "Card-Axes-Production", area: "card-axes-production" } }, - { path: "/card-production-cms", component: CardProductionCms, meta: { title: "Card-Production-Cms", area: "card-production-cms" } }, - { path: "/card-queue-production", component: CardQueueProduction, meta: { title: "Card-Queue-Production", area: "card-queue-production" } }, - { path: "/card-job-production", component: CardJobProduction, meta: { title: "Card-Job-Production", area: "card-job-production" } }, - { path: "/card-production-section-file", component: CardProductionSectionFile, meta: { title: "Card-Production-Section-File", area: "card-production-section-file" } }, + // { path: "/head-spindle", component: HeadSpindle, meta: { title: "Head-Spindle", area: "head-spindle" } }, + // { path: "/head-production", component: HeadProduction, meta: { title: "Head-Production", area: "head-production" } }, + // { path: "/card-axes-production", component: CardAxesProduction, meta: { title: "Card-Axes-Production", area: "card-axes-production" } }, + // { path: "/card-production-cms", component: CardProductionCms, meta: { title: "Card-Production-Cms", area: "card-production-cms" } }, + // { path: "/card-queue-production", component: CardQueueProduction, meta: { title: "Card-Queue-Production", area: "card-queue-production" } }, + // { path: "/card-job-production", component: CardJobProduction, meta: { title: "Card-Job-Production", area: "card-job-production" } }, + // { path: "/card-production-section-file", component: CardProductionSectionFile, meta: { title: "Card-Production-Section-File", area: "card-production-section-file" } }, { path: "/modal-load-program", component: ModalLoadProgram, meta: { title: "Modal-Load-Program", area: "modal-load-program" } }, { path: "/modal-job-add-parameter", component: ModalJobAddParameter, meta: { title: "Modal-Job-Add-Parameter", area: "modal-job-add-parameter" } }, @@ -91,7 +91,7 @@ export let routes = [ { path: "/modal-add-offset-tool", component: ModalAddOffsetTool, meta: { title: "Modal-Add-Offset-Tool", area: "modal-add-offset-tool" } }, { path: "/card-folder-path", component: CardFolderPath, meta: { title: "Card-Folder-Path", area: "card-folder-path" } }, - { path: "/card-element-queue", component: CardElementQueue, meta: { title: "Card-Element-Queue", area: "card-element-queue" } }, + // { path: "/card-element-queue", component: CardElementQueue, meta: { title: "Card-Element-Queue", area: "card-element-queue" } }, { path: "/card-assisted-tooling", component: CardAssistedTooling, meta: { title: "Card-Assisted-Tooling", area: "card-assisted-tooling" } }, @@ -99,8 +99,7 @@ export let routes = [ - { path: "/job-editor", component: JobEditor, meta: { title: "Job-Editor", area: "jobeditor" } }, - { path: "/objects-job", component: ObjectsJob, meta: { title: "Objects Job", area: "objects-jobs" } }, + // { path: "/objects-job", component: ObjectsJob, meta: { title: "Objects Job", area: "objects-jobs" } }, { path: "/missing-tool", component: MissingTool, meta: { title: "Missing Tool", area: "missing-tool" } }, @@ -109,22 +108,26 @@ export let routes = [ { path: "/program-management", component: ProgramManagement, meta: { title: "Program-Management", area: "program-management" } }, { path: "/maintenance-progress", component: MaintenanceProgress, meta: { title: "Maintenance-Progress", area: "maintenance-progress" } }, - { path: "/maintenance-card", component: MaintenanceCard, meta: { title: "Maintenance-Card", area: "maintenance-card" } }, - { path: "/card-maintenance-wizard", component: MaintenanceWizard, meta: { title: "Maintenance-Wizard", area: "card-maintenance-wizard" } }, + // { path: "/maintenance-card", component: MaintenanceCard, meta: { title: "Maintenance-Card", area: "maintenance-card" } }, + // { path: "/card-maintenance-wizard", component: MaintenanceWizard, meta: { title: "Maintenance-Wizard", area: "card-maintenance-wizard" } }, { path: "/create-maintenance", component: CreateMaintenance, meta: { title: "Create-Maintenance", area: "create-maintenance" } }, { path: "/create-maintenance", component: CreateMaintenance, meta: { title: "Create-Maintenance", area: "create-maintenance" } }, { path: "/modal-iframe", component: ModalIframe, meta: { title: "Modal-Iframe", area: "modal-iframe" } }, - { path: "/maintenance/:id?", name: "maintenance", component: Maintenance, meta: { title: "Maintenance", area: "maintenance" } }, + // { path: "/maintenance/:id?", name: "maintenance", component: Maintenance, meta: { title: "Maintenance", area: "maintenance" } }, /* path precedente cosa fare? Non ha il component */ // { path: "/utilities", meta: { title: "Utility", area: "utilities" } }, - { path: "/scada", component: Scada, meta: { title: "", area: "scada" } }, + // { path: "/scada", component: Scada, meta: { title: "", area: "scada" } }, ]; import { routes as alarmRoutes } from "./app_modules/alarms/route"; import { routes as productionRoutes } from "./app_modules/production/route"; +import { routes as jobEditorRoutes } from "./app_modules/jobs/route"; +import { routes as toolingRoutes} from "./app_modules/tooling/route"; injectRoutes(routes, alarmRoutes); injectRoutes(routes, productionRoutes); +injectRoutes(routes, jobEditorRoutes); +injectRoutes(routes, toolingRoutes); diff --git a/Step/wwwroot/src/app_modules/depot/index.ts b/Step/wwwroot/src/app_modules/depot/index.ts deleted file mode 100644 index 608006b9..00000000 --- a/Step/wwwroot/src/app_modules/depot/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -import LoadDepot from "./components/load-depot.vue"; -export { - LoadDepot -} diff --git a/Step/wwwroot/src/app_modules/jobs/route.js b/Step/wwwroot/src/app_modules/jobs/route.js index b3222fef..99e414e7 100644 --- a/Step/wwwroot/src/app_modules/jobs/route.js +++ b/Step/wwwroot/src/app_modules/jobs/route.js @@ -2,9 +2,6 @@ export const JobEditor = () => import("./components/job-editor.vue"); export const routes = [ - { - name: 'alarms', path: "/alarms", - meta: { title: "Alarms", area: "alarms" }, - component: AlarmHistory - }]; + { path: "/job-editor", component: JobEditor, meta: { title: "Job-Editor", area: "jobeditor" } }, +]; diff --git a/Step/wwwroot/src/app_modules/machine/index.ts b/Step/wwwroot/src/app_modules/machine/index.ts index 2825c2b8..e404389c 100644 --- a/Step/wwwroot/src/app_modules/machine/index.ts +++ b/Step/wwwroot/src/app_modules/machine/index.ts @@ -2,10 +2,12 @@ import Login from "./components/login.vue"; import AxesCalibration from "./components/axes-calibration-dialog.vue"; import MachineInfoDialog from "./components/machine-info-dialog.vue"; import UserInfoDialog from "./components/user-info-dialog.vue"; +import UserInfo from "./components/user-info.vue"; export { Login, AxesCalibration, MachineInfoDialog, - UserInfoDialog + UserInfoDialog, + UserInfo } diff --git a/Step/wwwroot/src/app_modules/tooling/components/depot-action-generic.ts b/Step/wwwroot/src/app_modules/tooling/components/depot-action-generic.ts index ee3ca5a4..b1e285ad 100644 --- a/Step/wwwroot/src/app_modules/tooling/components/depot-action-generic.ts +++ b/Step/wwwroot/src/app_modules/tooling/components/depot-action-generic.ts @@ -1,7 +1,7 @@ import Vue from "vue"; import Component from "vue-class-component"; import { Watch, Prop } from "vue-property-decorator"; -import Modal from "src/modules/base-components/modal.vue"; +import Modal from "src/components/modals/modal.vue"; @Component({ components: { modal: Modal } }) export default class DepotActionGeneric extends Vue { diff --git a/Step/wwwroot/src/app_modules/tooling/components/depot-action-loading.ts b/Step/wwwroot/src/app_modules/tooling/components/depot-action-loading.ts index 360417b8..d3ae1f26 100644 --- a/Step/wwwroot/src/app_modules/tooling/components/depot-action-loading.ts +++ b/Step/wwwroot/src/app_modules/tooling/components/depot-action-loading.ts @@ -1,7 +1,7 @@ import Vue from "vue"; import Component from "vue-class-component"; import { Watch, Prop } from "vue-property-decorator"; -import Modal from "src/modules/base-components/modal.vue"; +import Modal from "src/components/modals/modal.vue"; import { cardAssistedTooling } from "src/modules/base-components/cards"; @Component({ components: { cardAssistedTooling, modal: Modal } }) diff --git a/Step/wwwroot/src/app_modules/tooling/components/depot-action-transfer.ts b/Step/wwwroot/src/app_modules/tooling/components/depot-action-transfer.ts index 89920830..a18b0867 100644 --- a/Step/wwwroot/src/app_modules/tooling/components/depot-action-transfer.ts +++ b/Step/wwwroot/src/app_modules/tooling/components/depot-action-transfer.ts @@ -1,7 +1,7 @@ import Vue from "vue"; import Component from "vue-class-component"; import { Watch, Prop } from "vue-property-decorator"; -import Modal from "src/modules/base-components/modal.vue"; +import Modal from "src/components/modals/modal.vue"; import { cardAssistedTooling } from "src/modules/base-components/cards"; @Component({ components: { cardAssistedTooling, modal: Modal } }) diff --git a/Step/wwwroot/src/app_modules/tooling/components/depot-action-unloading.ts b/Step/wwwroot/src/app_modules/tooling/components/depot-action-unloading.ts index ac354b0c..4ea3041c 100644 --- a/Step/wwwroot/src/app_modules/tooling/components/depot-action-unloading.ts +++ b/Step/wwwroot/src/app_modules/tooling/components/depot-action-unloading.ts @@ -1,7 +1,7 @@ import Vue from "vue"; import Component from "vue-class-component"; import { Watch, Prop } from "vue-property-decorator"; -import Modal from "src/modules/base-components/modal.vue"; +import Modal from "src/components/modals/modal.vue"; import { cardAssistedTooling } from "src/modules/base-components/cards"; @Component({ components: { cardAssistedTooling, modal: Modal } }) diff --git a/Step/wwwroot/src/app_modules/depot/components/load-depot.ts b/Step/wwwroot/src/app_modules/tooling/components/load-depot.ts similarity index 100% rename from Step/wwwroot/src/app_modules/depot/components/load-depot.ts rename to Step/wwwroot/src/app_modules/tooling/components/load-depot.ts diff --git a/Step/wwwroot/src/app_modules/depot/components/load-depot.vue b/Step/wwwroot/src/app_modules/tooling/components/load-depot.vue similarity index 96% rename from Step/wwwroot/src/app_modules/depot/components/load-depot.vue rename to Step/wwwroot/src/app_modules/tooling/components/load-depot.vue index 8e94c145..d4c658c9 100644 --- a/Step/wwwroot/src/app_modules/depot/components/load-depot.vue +++ b/Step/wwwroot/src/app_modules/tooling/components/load-depot.vue @@ -26,4 +26,4 @@ - + diff --git a/Step/wwwroot/src/components/summary-depot.vue b/Step/wwwroot/src/app_modules/tooling/components/summary-depot.vue similarity index 100% rename from Step/wwwroot/src/components/summary-depot.vue rename to Step/wwwroot/src/app_modules/tooling/components/summary-depot.vue 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 7eef4f60..1d4ce1b6 100644 --- a/Step/wwwroot/src/app_modules/tooling/components/tooling-depot.ts +++ b/Step/wwwroot/src/app_modules/tooling/components/tooling-depot.ts @@ -9,7 +9,7 @@ import { mapGetters } from 'vuex' import { depotBL } from "src/business-logic/depot-bl"; import { ToolingService } from "src/services/toolingService"; import { ToolingGetters } from "src/store/tooling.store"; -import { LoadDepot } from "src/app_modules/depot" +import LoadDepot from "./load-depot.vue"; import { MessageService, Factory, awaiter } from "src/_base"; import { Container, Draggable } from "vue-smooth-dnd"; diff --git a/Step/wwwroot/src/app_modules/tooling/index.ts b/Step/wwwroot/src/app_modules/tooling/index.ts index b8180505..03a5da24 100644 --- a/Step/wwwroot/src/app_modules/tooling/index.ts +++ b/Step/wwwroot/src/app_modules/tooling/index.ts @@ -8,6 +8,7 @@ import DepotActionLoading from "./components/depot-action-loading.vue"; import DepotActionUnloading from "./components/depot-action-unloading.vue"; import DepotActionTransfer from "./components/depot-action-transfer.vue"; import DepotActionGeneric from "./components/depot-action-generic.vue"; +import LoadDepot from "./components/load-depot.vue"; export { assistedTooling1, @@ -19,5 +20,6 @@ export { DepotActionLoading, DepotActionUnloading, DepotActionTransfer, - DepotActionGeneric + DepotActionGeneric, + LoadDepot } diff --git a/Step/wwwroot/src/app_modules/tooling/route.js b/Step/wwwroot/src/app_modules/tooling/route.js index 5172d81c..7ede569c 100644 --- a/Step/wwwroot/src/app_modules/tooling/route.js +++ b/Step/wwwroot/src/app_modules/tooling/route.js @@ -1,19 +1,20 @@ export const Tooling = () => import("./components/tooling.vue"); -export const ToolingEquipment = () => import("./components/tooling/tooling-equipment.vue"); +export const ToolingEquipment = () => import("./components/tooling-equipment.vue"); export const InfoEquipment = () => import("./components/info-equipment.vue"); -export const ToolingFamilies = () => import("./components/tooling/tooling-families.vue"); -export const ToolingShanks = () => import("./components/tooling/tooling-shanks.vue"); -export const ToolingMagPos = () => import("./components/tooling/tooling-magpos.vue"); +export const ToolingFamilies = () => import("./components/tooling-families.vue"); +export const ToolingShanks = () => import("./components/tooling-shanks.vue"); +export const ToolingMagPos = () => import("./components/tooling-magpos.vue"); -export const DepotActionLoading = () => import("./components/tooling/depot-action-loading.vue"); -export const DepotActionTransfer = () => import("./components/tooling/depot-action-transfer.vue"); -export const DepotActionUnloading = () => import("./components/tooling/depot-action-unloading.vue"); -export const DepotActionGeneric = () => import("./components/tooling/depot-action-generic.vue"); -export const Depot = () => import("./components/tooling/tooling-depot.vue"); +export const DepotActionLoading = () => import("./components/depot-action-loading.vue"); +export const DepotActionTransfer = () => import("./components/depot-action-transfer.vue"); +export const DepotActionUnloading = () => import("./components/depot-action-unloading.vue"); +export const DepotActionGeneric = () => import("./components/depot-action-generic.vue"); +export const Depot = () => import("./components/tooling-depot.vue"); export const SummaryDepot = () => import("./components/summary-depot.vue"); export const routes = [ { path: "/tooling", component: Tooling, meta: { title: "Tools", area: "tooling" } }, + { name: "tooling-depot", path: "/tooling-depot/:id", component: Depot, meta: { title: "Depot", area: "depot" } }, { path: "/info-equipment", component: InfoEquipment, meta: { title: "Info-Equipment", area: "info-equipment" } }, { path: "/tooling-equipment/:id?", component: ToolingEquipment, meta: { title: "Tooling-Equipment", area: "tooling-equipment" } }, { path: "/tooling-families", component: ToolingFamilies, meta: { title: "Tooling-Families", area: "tooling-families" } }, diff --git a/Step/wwwroot/src/main.js b/Step/wwwroot/src/main.js index 2785423f..66ba1ad0 100644 --- a/Step/wwwroot/src/main.js +++ b/Step/wwwroot/src/main.js @@ -12,9 +12,9 @@ import "./app.modules"; const App = () => - import ("./App.vue"); + import("./App.vue"); -import { routes } from "./app.routes.js"; +import { routes } from "./app.routes"; Vue.use(VueRouter); @@ -29,23 +29,25 @@ let developerMode = true; // manipulate the title page router.beforeEach((to, from, next) => { - if (to.meta && to.meta.area) { - // Check if area is enabled - if (!developerMode && !machineStatusActions.isAreaEnabled(store, to.meta.area)) { - next({ - path: '/' - }) - return; - } + console.log("Navigate To:", to); + if (to.meta && to.meta.area) { + // Check if area is enabled + if (!developerMode && !machineStatusActions.isAreaEnabled(store, to.meta.area)) { + debugger + next({ + path: '/' + }) + return; } - if (to.meta && to.meta.title) { - - if (typeof cmsClient == "undefined") - window.document.title = "CMS Active - " + to.meta.title; - else - window.document.title = to.meta.title; - } - next(); + } + if (to.meta && to.meta.title) { + + if (typeof cmsClient == "undefined") + window.document.title = "CMS Active - " + to.meta.title; + else + window.document.title = to.meta.title; + } + next(); }); @@ -55,10 +57,10 @@ new LocalizationService().init(); let v = new Vue({ - router: router, - store, - el: "app", - render: (h) => h(App), + router: router, + store, + el: "app", + render: (h) => h(App), }); @@ -73,12 +75,12 @@ import "./filters/isValidMixin"; // polyfills !! if (!String.prototype.format) { - String.prototype.format = function() { - var args = arguments; - return this.replace(/{(\d+)}/g, function(match, number) { - return typeof args[number] != 'undefined' ? - args[number] : - match; - }); - }; -} \ No newline at end of file + String.prototype.format = function () { + var args = arguments; + return this.replace(/{(\d+)}/g, function (match, number) { + return typeof args[number] != 'undefined' ? + args[number] : + match; + }); + }; +} diff --git a/Step/wwwroot/src/modules/app-header.ts b/Step/wwwroot/src/modules/app-header.ts index 8c9363c4..3f241075 100644 --- a/Step/wwwroot/src/modules/app-header.ts +++ b/Step/wwwroot/src/modules/app-header.ts @@ -6,11 +6,11 @@ import { Factory, MessageService } from "src/_base"; import { Hub } from "src/services/hub"; import { Watch } from "vue-property-decorator"; import AppRibbon from "src/components/app-ribbon.vue"; -import { UserInfoDialog } from "src/app_modules/machine" +import userInfo from "src/app_modules/machine/components/user-info.vue" declare let $: any; -@Component({ name: "app-header", components: { appRibbon: AppRibbon, userInfo: UserInfoDialog, processInfo: ProcessInfo }, props: { modalOpened: Boolean, showHeaderOnBlur: Boolean } }) +@Component({ name: "app-header", components: { appRibbon: AppRibbon, userInfo: userInfo, processInfo: ProcessInfo }, props: { modalOpened: Boolean, showHeaderOnBlur: Boolean } }) export default class AppHeader extends Vue { $store: any;