compila - inizio il bugfixing dopo il refactoring

This commit is contained in:
Paolo Possanzini
2018-11-21 12:35:25 +01:00
parent ecf9b331ee
commit 672cc9c670
17 changed files with 503 additions and 528 deletions
+2 -2
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<serverConfig>
<ncConfig>
<ncVendor>SIEMENS</ncVendor> <!-- NO_NC/DEMO/FANUC/SIEMENS/OSAI -->
<ncVendor>DEMO</ncVendor> <!-- NO_NC/DEMO/FANUC/SIEMENS/OSAI -->
<showNcHMI>true</showNcHMI>
<ncIpAddress>localhost</ncIpAddress>
<ncPort>8080</ncPort>
@@ -15,6 +15,6 @@
<language>en</language>
<enableDirectoryBrowsing>true</enableDirectoryBrowsing>
<databaseAddress>localhost</databaseAddress>
<autoOpenCmsClient>true</autoOpenCmsClient>
<autoOpenCmsClient>false</autoOpenCmsClient>
</serverConfig>
</serverConfig>
+209
View File
@@ -0,0 +1,209 @@
import Vue from "vue";
import { Hub } from "./services/hub";
import { Header, Footer } from "./app.modules";
import { Login } from "src/app_modules/machine";
import { alarmList } from "src/app_modules/alarms";
import { LoginService } from "src/services/loginService";
import { DataService } from "src/services/dataService";
import { Factory, MessageService } from "./_base";
import { ModalContainer } from "./modules/base-components";
import { ModalHelper } from "src/components/modals"
import { appModelActions } from "src/store";
import { underTheHood } from "src/app_modules/under-the-hood";
import * as iziToast from "izitoast";
import moment from "moment";
import Component from "vue-class-component";
import { Watch } from "vue-property-decorator";
declare var cmsClient;
@Component({
name: "app",
components: {
appHeader: Header,
appFooter: Footer,
modalContainer: ModalContainer,
alarmList,
underTheHood
}
})
export default class app extends Vue {
$route: any;
state = this.$store.state;
applyBlur = false;
showHeaderOnBlur = false;
applyBlurInternal = false;
showHMIinProduction = false;
loadingOperations = 0;
HMIsrc = null;
hub: Hub = null;
beforeMount() {
moment.locale((window.navigator as any).userLanguage || window.navigator.language);
}
mounted() {
let ms = Factory.Get(MessageService);
// if cms is connected
if (typeof cmsClient != "undefined")
this.HMIsrc = cmsClient.getScreenBase64();
ms.subscribeToChannel("show-modal", args => {
this.applyBlur = true;
this.showHeaderOnBlur = false;
if (args[3]) this.showHeaderOnBlur = args[3];
});
ms.subscribeToChannel("hide-modal", args => {
this.applyBlur = false;
});
ms.subscribeToChannel("show-modal2", args => {
this.applyBlurInternal = true;
});
ms.subscribeToChannel("hide-modal2", args => {
this.applyBlurInternal = false;
});
ms.subscribeToChannel("show-loading", args => {
this.loadingOperations++;
});
ms.subscribeToChannel("hide-loading", args => {
this.loadingOperations--;
});
ms.subscribeToChannel("force-ui-update", args => {
this.$forceUpdate();
});
ms.subscribeToChannel("HMI-production-show-state", args => {
this.showHMIinProduction = true;
});
ms.subscribeToChannel("HMI-production-hide-state", args => {
this.showHMIinProduction = false;
});
let $this = this;
Factory.Get(LoginService)
.getUserInfo()
.then(() => {
if (!$this.isAuthenticated)
$this.$nextTick(() => ModalHelper.ShowModal(Login));
});
this.$store.watch(
s => s.currentUser,
(n, o) => {
if (!n) {
this.$nextTick(() => ModalHelper.ShowModal(Login));
} else
new DataService().SetCurrentNcLanguage(
this.$store.state.currentUser.language
);
}
);
this.hub = new Hub();
window.addEventListener("keyup", function (event) {
// If down arrow was pressed...
if (event.keyCode == 27) {
Factory.Get(MessageService).publishToChannel("esc_pressed");
}
});
}
get isAuthenticated() {
return this.$store.state.currentUser != null;
}
get debugStore() {
return this.$store.state;
}
get isMainViewLiftedUp() {
return this.$store.state.isMainViewLiftedUp;
}
@Watch("isMainViewLiftedUp")
isMainViewLiftedUpChanged() {
if (this.state.isMainViewLiftedUp) {
//Setup the Position of the View
this.applyViewPosition(-window.innerHeight + 84);
//Hide the HMI if is showed (in production)
Factory.Get(MessageService).publishToChannel("HMI-production-hide");
//Show the HMI with delay (For the animation)
Factory.Get(MessageService).publishToChannel("HMI-show", 500);
} else {
//Setup the Position of the View
this.applyViewPosition(0);
//Hide the HMI
Factory.Get(MessageService).publishToChannel("HMI-hide");
//Launche the show in delay if we are in production
if (this.showHMIinProduction && this.$route.path.includes("production"))
Factory.Get(MessageService).publishToChannel(
"HMI-production-show",
700
);
}
}
@Watch("loadingOperations")
loadingOperationsChanged(n, o) {
if (o == 0 && n > 0) {
(iziToast as any).show({
id: "loader",
class: "t-loading",
theme: "dark",
icon: "fa fa-refresh fa-spin fa-2x fa-fw",
position: "bottomLeft",
animateInside: false,
timeout: false,
transitionIn: "fadeIn",
transitionOut: "fadeOut",
toastOnce: true
});
}
if (n == 0 || n < 0) {
this.loadingOperations = 0;
let element = document.querySelector(".t-loading");
if (element) (iziToast as any).hide(element, { transitionOut: "fadeOut" });
}
}
callHub() {
this.hub.Hello();
}
onstartdrag() {
Factory.Get(MessageService).publishToChannel("HMI-start-drag");
}
onstopdrag() {
Factory.Get(MessageService).publishToChannel("HMI-stop-drag", 600);
}
toggleMainView(direction) {
if (!direction || direction == "down" || direction == "none")
appModelActions.MainViewToggle(this.$store);
else {
this.applyViewPosition(-window.innerHeight + 84);
}
}
sendMessage(name) {
Factory.Get(MessageService).publishToChannel(name);
}
movepanel(e) {
if (e && e.touches && e.touches[0]) {
this.applyViewPosition(
-window.innerHeight + 84 + e.touches[0].screenY,
true
);
}
}
applyViewPosition(position, removetransition?) {
(this.$refs["main-view"] as any).style = (this.$refs["main-view-handler"] as any).style =
"transform:translateY(" +
position +
"px);" +
(removetransition ? "transition:unset;" : "");
}
};
+1 -204
View File
@@ -27,209 +27,6 @@
</div>
</div>
</template>
<script>
import Vue from "vue";
import { Hub } from "./services/hub";
import { Header, Footer, Login } from "./app.modules";
import { alarmList } from "src/app_modules/alarms";
import { LoginService } from "src/services/loginService";
import { DataService } from "src/services/dataService";
import { Factory, MessageService } from "./_base";
import { ModalContainer, ModalHelper } from "./modules/base-components";
import { appModelActions } from "src/store";
import { underTheHood } from "src/app_modules/under-the-hood";
import * as iziToast from "izitoast";
import moment from "moment";
export default {
name: "app",
components: {
appHeader: Header,
appFooter: Footer,
modalContainer: ModalContainer,
alarmList,
underTheHood
},
beforeMount: function() {
moment.locale(window.navigator.userLanguage || window.navigator.language);
},
mounted: function() {
let ms = Factory.Get(MessageService);
// if cms is connected
if (typeof cmsClient != "undefined")
this.HMIsrc = cmsClient.getScreenBase64();
ms.subscribeToChannel("show-modal", args => {
this.applyBlur = true;
this.showHeaderOnBlur = false;
if (args[3]) this.showHeaderOnBlur = args[3];
});
ms.subscribeToChannel("hide-modal", args => {
this.applyBlur = false;
});
ms.subscribeToChannel("show-modal2", args => {
this.applyBlurInternal = true;
});
ms.subscribeToChannel("hide-modal2", args => {
this.applyBlurInternal = false;
});
ms.subscribeToChannel("show-loading", args => {
this.loadingOperations++;
});
ms.subscribeToChannel("hide-loading", args => {
this.loadingOperations--;
});
ms.subscribeToChannel("force-ui-update", args => {
this.$forceUpdate();
});
ms.subscribeToChannel("HMI-production-show-state", args => {
this.showHMIinProduction = true;
});
ms.subscribeToChannel("HMI-production-hide-state", args => {
this.showHMIinProduction = false;
});
let _this = this;
Factory.Get(LoginService)
.getUserInfo()
.then(() => {
if (!_this.isAuthenticated)
_this.$nextTick(() => ModalHelper.ShowModal(Login));
});
this.$store.watch(
s => s.currentUser,
(n, o) => {
if (!n) {
this.$nextTick(() => ModalHelper.ShowModal(Login));
} else
new DataService().SetCurrentNcLanguage(
this.$store.state.currentUser.language
);
}
);
this.hub = new Hub();
window.addEventListener("keyup", function(event) {
// If down arrow was pressed...
if (event.keyCode == 27) {
Factory.Get(MessageService).publishToChannel("esc_pressed");
}
});
},
computed: {
isAuthenticated: function() {
return this.$store.state.currentUser != null;
},
debugStore: function() {
return this.$store.state;
},
isMainViewLiftedUp: function() {
return this.$store.state.isMainViewLiftedUp;
}
},
watch: {
isMainViewLiftedUp: function() {
if (this.state.isMainViewLiftedUp) {
//Setup the Position of the View
this.applyViewPosition(-window.innerHeight + 84);
//Hide the HMI if is showed (in production)
Factory.Get(MessageService).publishToChannel("HMI-production-hide");
//Show the HMI with delay (For the animation)
Factory.Get(MessageService).publishToChannel("HMI-show", 500);
} else {
//Setup the Position of the View
this.applyViewPosition(0);
//Hide the HMI
Factory.Get(MessageService).publishToChannel("HMI-hide");
//Launche the show in delay if we are in production
if (this.showHMIinProduction && this.$route.path.includes("production"))
Factory.Get(MessageService).publishToChannel(
"HMI-production-show",
700
);
}
},
loadingOperations: function(n, o) {
if (o == 0 && n > 0) {
iziToast.show({
id: "loader",
class: "t-loading",
theme: "dark",
icon: "fa fa-refresh fa-spin fa-2x fa-fw",
position: "bottomLeft",
animateInside: false,
timeout: false,
transitionIn: "fadeIn",
transitionOut: "fadeOut",
toastOnce: true
});
}
if (n == 0 || n < 0) {
this.loadingOperations = 0;
let element = document.querySelector(".t-loading");
if (element) iziToast.hide(element, { transitionOut: "fadeOut" });
}
}
},
methods: {
callHub: function() {
this.hub.Hello();
},
onstartdrag: function() {
Factory.Get(MessageService).publishToChannel("HMI-start-drag");
},
onstopdrag: function() {
Factory.Get(MessageService).publishToChannel("HMI-stop-drag", 600);
},
toggleMainView(direction) {
if (!direction || direction == "down" || direction == "none")
appModelActions.MainViewToggle(this.$store);
else {
this.applyViewPosition(-window.innerHeight + 84);
}
},
sendMessage(name) {
Factory.Get(MessageService).publishToChannel(name);
},
movepanel(e) {
if (e && e.touches && e.touches[0]) {
this.applyViewPosition(
-window.innerHeight + 84 + e.touches[0].screenY,
true
);
}
},
applyViewPosition(position, removetransition) {
this.$refs["main-view"].style = this.$refs["main-view-handler"].style =
"transform:translateY(" +
position +
"px);" +
(removetransition ? "transition:unset;" : "");
}
},
data: function() {
return {
state: this.$store.state,
applyBlur: false,
showHeaderOnBlur: false,
applyBlurInternal: false,
showHMIinProduction: false,
loadingOperations: 0
};
}
};
</script>
<script src="./App.ts" lang="ts"></script>
-107
View File
@@ -1,107 +0,0 @@
// GLobal services
import { LoginService } from "./services/loginService";
import { LocalizationService } from "./services/localizationService";
// Page and modules
import Header from "./modules/app-header.vue";
import Footer from "./modules/app-footer.vue";
import Utilities from "./components/utilities.vue";
export {
LoginService,
LocalizationService,
Header,
Footer,
Utilities,
Tooling
}
export const Home = () =>
import("./components/Home.vue");
export const ModalIframe = () =>
import("./modules/base-components/modal-iframe.vue");
export const ModalImage = () =>
import("./modules/base-components/modal-image.vue");
export const CreateQueue = () =>
import("./components/create-queue.vue");
export const SoftKeysPrefered = () =>
import("./modules/base-components/cards/softkeys-prefered.vue");
/* Da cancellare dopo sviluppo */
export const MaintenanceProgress = () =>
import("./modules/base-components/maintenance-progress.vue");
export const CreateMaintenance = () =>
import("./modules/create-maintenance.vue");
export const LoadDepot = () =>
import("./modules/base-components/load-depot.vue");
// export const Utilities = () =>
// import ("./components/utilities.vue");
export const MissingTool = () =>
import("./modules/base-components/cards/missing-tool.vue");
export const CardUtilities = () =>
import("./modules/base-components/cards/card-utilities.vue");
export const CardToolDepot = () =>
import("./modules/base-components/cards/card-tool-depot.vue");
export const CardAssistedTooling = () =>
import("./modules/base-components/cards/card-assisted-tooling.vue");
export const CardFolderPath = () =>
import("./modules/base-components/cards/card-folder-path.vue");
export const ModalLoadProgram = () =>
import("./modules/base-components/modal-load-program.vue");
export const ModalJobAddParameter = () =>
import("./modules/base-components/modal-job-add-parameter.vue");
export const ModalEditJob = () =>
import("./modules/base-components/modal-edit-job.vue");
export const ModalAddOffsetTool = () =>
import("./modules/base-components/modal-add-offset-tool.vue");
export const ModalMissingTools = () =>
import("./modules/base-components/modal-missing-tools.vue");
export const ProgramManagement = () =>
import("./modules/program-management.vue");
+84
View File
@@ -0,0 +1,84 @@
// GLobal services
import { LoginService } from "./services/loginService";
import { LocalizationService } from "./services/localizationService";
// Page and modules
import Header from "./modules/app-header.vue";
import Footer from "./modules/app-footer.vue";
import Utilities from "./components/utilities.vue";
import Home from "./components/Home.vue";
import ModalIframe from "./modules/base-components/modal-iframe.vue";
import ModalImage from "./modules/base-components/modal-image.vue";
import CreateQueue from "./components/create-queue.vue";
import SoftKeysPrefered from "./modules/base-components/cards/softkeys-prefered.vue";
/* Da cancellare dopo sviluppo */
import MaintenanceProgress from "./modules/base-components/maintenance-progress.vue";
import CreateMaintenance from "./modules/create-maintenance.vue";
import MissingTool from "./modules/base-components/cards/missing-tool.vue";
import CardUtilities from "./modules/base-components/cards/card-utilities.vue";
import CardToolDepot from "./modules/base-components/cards/card-tool-depot.vue";
import CardAssistedTooling from "./modules/base-components/cards/card-assisted-tooling.vue";
import CardFolderPath from "./modules/base-components/cards/card-folder-path.vue";
import ModalLoadProgram from "./modules/base-components/modal-load-program.vue";
import ModalJobAddParameter from "./modules/base-components/modal-job-add-parameter.vue";
import ModalEditJob from "./modules/base-components/modal-edit-job.vue";
import ModalAddOffsetTool from "./modules/base-components/modal-add-offset-tool.vue";
import ModalMissingTools from "./modules/base-components/modal-missing-tools.vue";
import ProgramManagement from "./modules/program-management.vue";
export {
LoginService,
LocalizationService,
Header,
Footer,
Utilities,
Home,
ModalIframe,
ModalImage,
ProgramManagement,
ModalMissingTools,
ModalAddOffsetTool,
ModalEditJob,
ModalJobAddParameter,
ModalLoadProgram,
CardFolderPath,
CardAssistedTooling,
CardToolDepot,
CardUtilities,
MissingTool,
CreateMaintenance,
MaintenanceProgress,
SoftKeysPrefered,
CreateQueue
}
@@ -0,0 +1,77 @@
import { ModalHelper, Modal } from "src/components/modals"
import { DepotService } from 'src/services/depotService';
import { Factory, MessageService } from 'src/_base';
import { inputBox } from "src/modules/base-components/cards";
export default {
name: "loaddepot",
components: { modal: Modal, inputBox },
data: function () {
return {
toolSelected: {},
positionId: null,
magazineId: null
}
},
computed: {
availableMultiTools: function () {
return this.$store.state.depot.availableMultiTool;
},
availableTools: function () {
if (this.isSiemens())
return this.$store.state.depot.availableTool;
else
return this.$store.state.depot.ncAvailableShank;
}
},
mounted: function () {
this.$nextTick(function () {
if (this.isSiemens())
new DepotService().GetToolAvailable();
else
new DepotService().GetNcToolAvailable();
})
},
methods: {
close() {
Factory.Get(MessageService).deleteChannel("esc_pressed");
ModalHelper.HideModal();
},
isSiemens: function () {
return this.$store.state.machineInfo.isSiemens;
},
isPositionCompatible(tool) {
return (this.$store.getters).positionCompatible(tool.id, ModalHelper.loadDepotModal.positionType);
},
save() {
this.magazineId = ModalHelper.loadDepotModal.magazineId;
this.positionId = ModalHelper.loadDepotModal.positionId;
new DepotService().AddToolToDepot(this.magazineId, this.positionId, { toolId: this.toolSelected.id }).then(response => {
Factory.Get(MessageService).deleteChannel("esc_pressed");
ModalHelper.HideModal();
});
console.log(this.toolSelected);
},
calcItemName(shank) {
if (shank.childsTools && shank.childsTools.length > 1)
return this.$options.filters.localize("tooling_shank_abbreviation", 'S%d', shank.id);
else
return this.$options.filters.localize("tooling_tool_abbreviation", 'T%d', shank.childsTools[0].id) + " - " + this.calcFamilyName(shank.childsTools[0].id);
},
familyNameFromId(id) {
var found = this.$store.state.tooling.ncFamilies.find(k => k.id == id);
if (found)
return found.name;
return '';
},
calcFamilyName(id) {
if (this.$store.state.tooling.familyOptionActive)
return this.$options.filters.localize("tooling_family_abbreviation", 'F%d', id) + ' - ' + this.familyNameFromId(id);
else
return this.familyNameFromId(id);
}
}
};
@@ -0,0 +1,29 @@
<template>
<modal type="load-depot" :title="'load_depot_lbl_title' | localize('Carica utensile')">
<button class="close" slot="header-buttons" @click="close()"><i class="fa fa-remove"></i></button>
<div class="load-depot-box">
<label>{{'load_depot_lbl_select' | localize("Seleziona l'utensile da aggiungere")}}</label>
<div class="load-depot-box-select">
<input-box type="select" :title="'load_depot_select_title' | localize('Utensile')" v-model="toolSelected">
<option v-if="isSiemens()" v-for="s in availableMultiTools" :key="s.id" :value="s">{{s.name}} - {{'tooling_shank_abbreviation' | localize('S%d',s.id)}}</option>
<option v-if="isSiemens() && isPositionCompatible(s)" v-for="s in availableTools" :key="s.id" :value="s">
{{s.familyName}} - {{'tooling_tool_abbreviation' | localize('T%d',s.id)}}
</option>
<option v-if="!isSiemens() && isPositionCompatible(s)" v-for="s in availableTools" :key="s.id" :value="s">
{{calcItemName(s)}}
</option>
</input-box>
<!-- <select>
</select> -->
</div>
</div>
<footer>
<div class="pull-right">
<button class="btn" @click="close()">{{'load_depot_btn_cancel' | localize("Annulla")}}</button>
<button class="btn btn-success" @click="save()" :disabled="!toolSelected.id">{{'load_depot_btn_confirm' | localize("Conferma")}}</button>
</div>
</footer>
</modal>
</template>
<script lang="ts" src="load-depot.ts"></script>
@@ -0,0 +1,4 @@
import LoadDepot from "./components/load-depot.vue";
export {
LoadDepot
}
@@ -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/modules/base-components";
import { LoadDepot } from "src/app_modules/depot"
import { MessageService, Factory, awaiter } from "src/_base";
import { Container, Draggable } from "vue-smooth-dnd";
@@ -6,9 +6,9 @@ import { Hub } from "src/services/hub";
import { Factory, MessageService, awaiter } from "src/_base";
import { DataService } from "src/services/dataService";
import onOffSoftKey from "./components/soft-key2.vue";
import procedureSoftKey from "./components/soft-key3.vue";
import groupSoftKey from "./components/soft-key1.vue";
import onOffSoftKey from "./soft-key2.vue";
import procedureSoftKey from "./soft-key3.vue";
import groupSoftKey from "./soft-key1.vue";
@Componet({
+45 -45
View File
@@ -1,13 +1,13 @@
import Vue from "vue";
import Component from "vue-class-component";
import { Modal } from "src/modules/base-components/components.js";
import { Modal } from "src/components/modals"
@Component({
name: "loader",
components: { Modal },
components: { Modal },
props: ["title", "message", "percent", "isVisible"],
computed: {
isCompleted: function() {
isCompleted: function () {
return this.percent == 100;
}
}
@@ -18,61 +18,61 @@ export default class Loader extends Vue {
public percent: number;
public followAxesNumber: boolean = true;
mounted() {}
mounted() { }
get nameAxes(){
return this.$store.state.process.axes;
get nameAxes() {
return this.$store.state.process.axes;
}
get axesInterpoleted(){
return this.$store.state.process.valueAxisSelected.interpolated;
get axesInterpoleted() {
return this.$store.state.process.valueAxisSelected.interpolated;
}
get axesMachine(){
return this.$store.state.process.valueAxisSelected.machine;
get axesMachine() {
return this.$store.state.process.valueAxisSelected.machine;
}
get axesProgrammePos(){
return this.$store.state.process.valueAxisSelected.programmePos;
get axesProgrammePos() {
return this.$store.state.process.valueAxisSelected.programmePos;
}
get axesToGo(){
return this.$store.state.process.valueAxisSelected.toGo;
get axesToGo() {
return this.$store.state.process.valueAxisSelected.toGo;
}
get numAxes(){
get numAxes() {
if (!this.followAxesNumber)
return null;
var n = this.$store.state.process.axes.length;
if(n == 7)
return '_7';
else if(n == 8)
return '_8';
else if(n == 9)
return '_9';
else if(n > 9)
return '_9 more9';
return null;
var n = this.$store.state.process.axes.length;
if (n == 7)
return '_7';
else if (n == 8)
return '_8';
else if (n == 9)
return '_9';
else if (n > 9)
return '_9 more9';
return null;
}
axes(name,value) {
var nameAxes;
var valueAxes;
var newAxis = [];
nameAxes = name;
valueAxes = value;
var keys = Object.keys(valueAxes);
nameAxes.forEach(element => {
for(var key in valueAxes){
if(element.id == key){
var axesElement = {
name: element.name,
value: valueAxes[key]
};
newAxis.push(axesElement);
}
}
axes(name, value) {
var nameAxes;
var valueAxes;
var newAxis = [];
nameAxes = name;
valueAxes = value;
var keys = Object.keys(valueAxes);
nameAxes.forEach(element => {
for (var key in valueAxes) {
if (element.id == key) {
var axesElement = {
name: element.name,
value: valueAxes[key]
};
newAxis.push(axesElement);
}
}
});
return newAxis;
});
return newAxis;
}
}
+4 -2
View File
@@ -1,14 +1,16 @@
import Vue from "vue";
import Component from "vue-class-component";
import { AppRibbon, UserInfo, ProcessInfo } from "./base-components";
import { ProcessInfo } from "./base-components";
import { AppModel, buttonStatus } from "src/store";
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"
declare let $: any;
@Component({ name: "app-header", components: { appRibbon: AppRibbon, userInfo: UserInfo, processInfo: ProcessInfo }, props: {modalOpened: Boolean, showHeaderOnBlur:Boolean} })
@Component({ name: "app-header", components: { appRibbon: AppRibbon, userInfo: UserInfoDialog, processInfo: ProcessInfo }, props: { modalOpened: Boolean, showHeaderOnBlur: Boolean } })
export default class AppHeader extends Vue {
$store: any;
@@ -1,4 +0,0 @@
import Modal from "./modal.vue";
import Loader from "./loader.vue";
export { Loader, Modal };
@@ -1,7 +1,5 @@
import Popup from "./popup.vue";
import AppRibbon from "./ribbons/app-ribbon.vue";
import UserInfo from "./user-info.vue";
import ModalContainer from "./modal-container.vue";
import ProcessInfo from "./process-info.vue";
@@ -10,9 +8,8 @@ import Accordion from "./accordion.vue";
import Keypad from "./keypad.vue";
import cardutilities from "./cards/card-utilities.vue";
import card from "./cards/card.vue";
import ConfirmModal from "./modal-confirm.vue";
import MaintenanceProgress from "./maintenance-progress.vue";
import LoadDepot from "./load-depot.vue";
import CreateMaintenance from "../create-maintenance.vue";
import ModalIframe from "./modal-iframe.vue";
import ModalImage from "./modal-image.vue";
@@ -24,8 +21,6 @@ import ModalJobAddParameter from "./modal-job-add-parameter.vue";
export {
Popup,
AppRibbon,
UserInfo,
ModalContainer,
ProcessInfo,
@@ -34,9 +29,8 @@ export {
cardutilities,
card,
ConfirmModal,
MaintenanceProgress,
LoadDepot,
CreateMaintenance,
ModalIframe,
ModalImage,
@@ -1,108 +0,0 @@
<template>
<modal type="load-depot" :title="'load_depot_lbl_title' | localize('Carica utensile')">
<button class="close" slot="header-buttons" @click="close()"><i class="fa fa-remove"></i></button>
<div class="load-depot-box">
<label>{{'load_depot_lbl_select' | localize("Seleziona l'utensile da aggiungere")}}</label>
<div class="load-depot-box-select">
<input-box type="select" :title="'load_depot_select_title' | localize('Utensile')" v-model="toolSelected">
<option v-if="isSiemens()" v-for="s in availableMultiTools" :key="s.id" :value="s">{{s.name}} - {{'tooling_shank_abbreviation' | localize('S%d',s.id)}}</option>
<option v-if="isSiemens() && isPositionCompatible(s)" v-for="s in availableTools" :key="s.id" :value="s">
{{s.familyName}} - {{'tooling_tool_abbreviation' | localize('T%d',s.id)}}
</option>
<option v-if="!isSiemens() && isPositionCompatible(s)" v-for="s in availableTools" :key="s.id" :value="s">
{{calcItemName(s)}}
</option>
</input-box>
<!-- <select>
</select> -->
</div>
</div>
<footer>
<div class="pull-right">
<button class="btn" @click="close()">{{'load_depot_btn_cancel' | localize("Annulla")}}</button>
<button class="btn btn-success" @click="save()" :disabled="!toolSelected.id">{{'load_depot_btn_confirm' | localize("Conferma")}}</button>
</div>
</footer>
</modal>
</template>
<script>
import Modal from "./modal.vue";
import { ModalHelper } from "./ModalHelper.ts";
import { store, AppModel } from "src/store";
import { DepotService } from 'src/services/depotService';
import { Factory, MessageService } from 'src/_base';
import { inputBox } from "src/modules/base-components/cards";
export default {
name: "loaddepot",
components: { modal: Modal, inputBox },
data: function(){
return {
toolSelected: {},
positionId: null,
magazineId: null
}
},
computed: {
availableMultiTools: function(){
return this.$store.state.depot.availableMultiTool;
},
availableTools: function(){
if(this.isSiemens())
return this.$store.state.depot.availableTool;
else
return this.$store.state.depot.ncAvailableShank;
}
},
mounted: function(){
this.$nextTick(function(){
if(this.isSiemens())
new DepotService().GetToolAvailable();
else
new DepotService().GetNcToolAvailable();
})
},
methods: {
close() {
Factory.Get(MessageService).deleteChannel("esc_pressed");
ModalHelper.HideModal();
},
isSiemens: function(){
return this.$store.state.machineInfo.isSiemens;
},
isPositionCompatible(tool){
return (this.$store.getters).positionCompatible(tool.id,ModalHelper.loadDepotModal.positionType);
},
save(){
this.magazineId = ModalHelper.loadDepotModal.magazineId;
this.positionId = ModalHelper.loadDepotModal.positionId;
new DepotService().AddToolToDepot(this.magazineId, this.positionId,{ toolId: this.toolSelected.id}).then(response =>{
Factory.Get(MessageService).deleteChannel("esc_pressed");
ModalHelper.HideModal();
});
console.log(this.toolSelected);
},
calcItemName(shank){
if(shank.childsTools && shank.childsTools.length > 1)
return this.$options.filters.localize("tooling_shank_abbreviation", 'S%d', shank.id);
else
return this.$options.filters.localize("tooling_tool_abbreviation", 'T%d',shank.childsTools[0].id) + " - " + this.calcFamilyName(shank.childsTools[0].id);
},
familyNameFromId(id){
var found = this.$store.state.tooling.ncFamilies.find(k => k.id == id);
if(found)
return found.name;
return '';
},
calcFamilyName(id){
if(this.$store.state.tooling.familyOptionActive)
return this.$options.filters.localize("tooling_family_abbreviation", 'F%d',id) + ' - ' + this.familyNameFromId(id);
else
return this.familyNameFromId(id);
}
}
};
</script>
@@ -4,32 +4,31 @@
<!-- <object data="/api/maintenance_manager/attachment/2" type="application/pdf"> -->
<iframe id="iframe-attachment" frameborder="0" :src="content" ></iframe>
<!-- </object> -->
</modal>
</template>
<script>
import Modal from "./modal.vue";
import { ModalHelper } from "./ModalHelper.ts";
import { Factory, MessageService } from '../../_base';
<script lang="ts">
import { ModalHelper, Modal } from "src/components/modals";
import { Factory, MessageService } from "../../_base";
import { MaintenanceService } from "src/services/maintenanceService";
export default {
components: { modal: Modal },
data: function(){
return{
content: "",
title: ""
}
},
mounted(){
this.content = ModalHelper.modalIframe.content;
this.title = ModalHelper.modalIframe.title;
},
methods:{
close(){
Factory.Get(MessageService).deleteChannel("esc_pressed");
ModalHelper.HideModal();
}
components: { modal: Modal },
data: function() {
return {
content: "",
title: ""
};
},
mounted() {
this.content = ModalHelper.modalIframe.content;
this.title = ModalHelper.modalIframe.title;
},
methods: {
close() {
Factory.Get(MessageService).deleteChannel("esc_pressed");
ModalHelper.HideModal();
}
}
};
</script>
<!--<script src="./create-maintenance.ts" lang="ts"></script>-->
<!--<script src="./create-maintenance.ts" lang="ts"></script>-->
@@ -3,32 +3,31 @@
<button class="close" slot="header-buttons" @click="close()"><i class="fa fa-remove"></i></button>
<img id="imagecontainer" :src="this.content" />
<!-- <img :src="content" /> -->
</modal>
</template>
<script>
import Modal from "./modal.vue";
import { ModalHelper } from "./ModalHelper.ts";
import { Factory, MessageService } from '../../_base';
<script lang="ts">
import { Modal, ModalHelper } from "src/components/modals";
import { Factory, MessageService } from "../../_base";
export default {
components: { modal: Modal },
data: function(){
return{
content: "",
title: ""
}
},
mounted(){
this.content = ModalHelper.modalImage.content;
this.title = ModalHelper.modalImage.title;
},
methods:{
close(){
Factory.Get(MessageService).deleteChannel("esc_pressed");
ModalHelper.HideModal();
}
components: { modal: Modal },
data: function() {
return {
content: "",
title: ""
};
},
mounted() {
this.content = ModalHelper.modalImage.content;
this.title = ModalHelper.modalImage.title;
},
methods: {
close() {
Factory.Get(MessageService).deleteChannel("esc_pressed");
ModalHelper.HideModal();
}
}
};
</script>
<!--<script src="./create-maintenance.ts" lang="ts"></script>-->
<!--<script src="./create-maintenance.ts" lang="ts"></script>-->