From dfea192cf22215084765abf16a0686b2d73be5fe Mon Sep 17 00:00:00 2001 From: Lucio Maranta Date: Fri, 18 Oct 2019 12:10:32 +0200 Subject: [PATCH] First commit of NewContact --- Step.Config/Config/maintenancesConfig.xml | 172 ++---------------- .../Config/maintenancesConfigValidator.xsd | 25 ++- Step.Config/ServerConfig.cs | 3 + Step.Config/ServerConfigController.cs | 37 +++- .../WebApi/ConfigurationController.cs | 7 +- Step/wwwroot/assets/styles/base/modals.less | 19 +- Step/wwwroot/assets/styles/style.css | 14 +- .../machine/components/contact-info-dialog.ts | 30 ++- .../components/contact-info-dialog.vue | 20 +- Step/wwwroot/src/services/machineService.ts | 8 +- 10 files changed, 155 insertions(+), 180 deletions(-) diff --git a/Step.Config/Config/maintenancesConfig.xml b/Step.Config/Config/maintenancesConfig.xml index 2decfae8..948f9e20 100644 --- a/Step.Config/Config/maintenancesConfig.xml +++ b/Step.Config/Config/maintenancesConfig.xml @@ -3,8 +3,24 @@ CMS cms@cms.it - 034564111 + + + backOffice + cms@cms.it + 333333333 + + + Spare part + cms@cms.it + 333333333 + + + retrofit + cms@cms.it + 333333333 + + www.google.it 1 @@ -22,159 +38,5 @@ mm 0 - - - 2 - - Transmission member check - Gestione Organi di trasmissione - - 2000 - 15/07/2018 13:00 - MACHINE_INTERVAL - - Transmission members check - Necessary control of all transmission system - - mm - 1 - - - - 3 - - Mechanical/electrical safety systems - Sistemi di sicurezza meccanici/elettrici - - 2000 - 15/07/2018 13:00 - MACHINE_INTERVAL - - Necessary control of mechanical/electrical safety systems - Necessario controllo di tutti i sistemi di sicurezza meccanici/elettrici presenti in macchina - - mm - 1 - - - - 4 - - Check of axis geometry - Controllo geometria assi - - 2000 - 15/07/2018 13:00 - MACHINE_INTERVAL - - Necessary control of axis geometry - Necessario controllo della corretta geometria assi - - mm - 1 - - - - 5 - - Machine System check - Controllo impianti macchina necessario - - 2000 - 15/07/2018 13:00 - MACHINE_INTERVAL - - Necessary control Electric / Mechanical / Pneumatic Systems - Necessario controllo impianti Elettrico / Meccanico / Pneumatico - - mm - 1 - - - - 6 - - Tool holder clamps management - Gestione manine portautensili - - 4000 - 15/07/2018 13:00 - MACHINE_INTERVAL - - Replace composite material tool holder clamps - Sostituire manine portautensili in materiale composito - - mm - 1 - - - - 7 - - Balancing cylinders management - Gestione cilindri di bilanciamento - - 4000 - 15/07/2018 13:00 - MACHINE_INTERVAL - - Replace seals on balancing cylinders - Sostituire tenute su cilindri di bilanciamento - - mm - 1 - - - - 8 - - Lower-grinder servicing necessary - Revisione mola inferiore necessaria - - 4000 - 15/07/2018 13:00 - MACHINE_INTERVAL - - Execute spindle service of Lower-grinder - Eseguire revisione al mandrino della mola inferiore - - mm - 2 - - - - 9 - - Upper-grinder servicing necessary - Revisione mola superiore necessaria - - 4000 - 15/07/2018 13:00 - MACHINE_INTERVAL - - Execute spindle service of Upper-grinder - Eseguire revisione al mandrino della mola superiore - - mm - 3 - - - - 10 - - Drill servicing necessary - Revisione foratore necessario - - 4000 - 15/07/2018 13:00 - MACHINE_INTERVAL - - Execute spindle service of the driller - Eseguire revisione al mandrino del foratore - - mm - 4 - - \ No newline at end of file diff --git a/Step.Config/Config/maintenancesConfigValidator.xsd b/Step.Config/Config/maintenancesConfigValidator.xsd index 63b4f966..2aa608af 100644 --- a/Step.Config/Config/maintenancesConfigValidator.xsd +++ b/Step.Config/Config/maintenancesConfigValidator.xsd @@ -3,16 +3,11 @@ - - - - - - - - - - + + + + + @@ -76,6 +71,16 @@ + + + + + + + + + + diff --git a/Step.Config/ServerConfig.cs b/Step.Config/ServerConfig.cs index c60ffd61..e5812098 100644 --- a/Step.Config/ServerConfig.cs +++ b/Step.Config/ServerConfig.cs @@ -15,6 +15,9 @@ namespace Step.Config public static MachineModel MachineConfig; public static List MaintenancesConfig; public static ContactModel ContactConfig; + public static ContactModel SparePartConfig; + public static ContactModel BackOfficeConfig; + public static ContactModel RetrofitConfig; public static List FunctionsAccessConfig; public static List AllFunctionalityDisabled; diff --git a/Step.Config/ServerConfigController.cs b/Step.Config/ServerConfigController.cs index 1421909c..f7c7c1f9 100644 --- a/Step.Config/ServerConfigController.cs +++ b/Step.Config/ServerConfigController.cs @@ -12,7 +12,7 @@ using System.Xml.Linq; using System.Xml.Schema; using System.Xml.Serialization; using static Step.Config.ServerConfig; -using static Step.Model.Constants; +using static Step.Model.Constants; using static Step.Utils.SupportFunctions; namespace Step.Config @@ -356,7 +356,40 @@ namespace Step.Config PhoneNumber = x.Element("phoneNumber").Value }) .FirstOrDefault(); - + + BackOfficeConfig = xmlConfigFile + .Descendants("backOfficeContact") + .Select(x => + new ContactModel() + { + Name = x.Element("name").Value, + Email = x.Element("email").Value, + PhoneNumber = x.Element("phoneNumber").Value + }) + .FirstOrDefault(); + + SparePartConfig = xmlConfigFile + .Descendants("sparePartsContact") + .Select(x => + new ContactModel() + { + Name = x.Element("name").Value, + Email = x.Element("email").Value, + PhoneNumber = x.Element("phoneNumber").Value + }) + .FirstOrDefault(); + + RetrofitConfig = xmlConfigFile + .Descendants("retrofitContact") + .Select(x => + new ContactModel() + { + Name = x.Element("name").Value, + Email = x.Element("email").Value, + PhoneNumber = x.Element("phoneNumber").Value + }) + .FirstOrDefault(); + var ci = new CultureInfo("en-US"); var formats = new[] { "M-d-yyyy HH:mm", "dd-MM-yyyy HH:mm", "MM-dd-yyyy HH:mm", "M/d/yyyy HH:mm", "dd/MM/yyyy HH:mm", "MM/dd/yyyy HH:mm" } .ToArray(); diff --git a/Step/Controllers/WebApi/ConfigurationController.cs b/Step/Controllers/WebApi/ConfigurationController.cs index ec8934f8..49b37bf3 100644 --- a/Step/Controllers/WebApi/ConfigurationController.cs +++ b/Step/Controllers/WebApi/ConfigurationController.cs @@ -142,7 +142,12 @@ namespace Step.Controllers.WebApi [Route("contact"), HttpGet] public IHttpActionResult GetContact() { - return Ok(ContactConfig); + return Ok(new { + ContactConfig, + SparePartConfig, + RetrofitConfig, + BackOfficeConfig + }); } } } \ No newline at end of file diff --git a/Step/wwwroot/assets/styles/base/modals.less b/Step/wwwroot/assets/styles/base/modals.less index 20c9b0d6..23062c05 100644 --- a/Step/wwwroot/assets/styles/base/modals.less +++ b/Step/wwwroot/assets/styles/base/modals.less @@ -594,10 +594,10 @@ } .@{modal}.contact-info { - width: @modal-login-width; - height: @modal-concact-info-height; - top: calc(~"50%" - @modal-concact-info-height / 2); - left: calc(~"50%" - @modal-login-width / 2); + width: @modal-machine-width; + height: @modal-machine-height; + top: calc(~"50%" - @modal-machine-height / 2); + left: calc(~"50%" - @modal-machine-width / 2); header { background-color: @color-darkish-blue; color: @color-white; @@ -618,6 +618,7 @@ .details { text-align: center; color: @color-greyish-brown; + margin-bottom: 30px; & > * { display: block; margin-bottom: 5px; @@ -637,6 +638,16 @@ border: none; } } + .contactInfo { + margin-bottom: 75px; + } + + .btn-success { + height: 30px; + font-size: 17px; + margin: 0 auto; + display: block; + } } .@{modal}.self-adaptive { diff --git a/Step/wwwroot/assets/styles/style.css b/Step/wwwroot/assets/styles/style.css index 4df9dc35..bab7fd40 100644 --- a/Step/wwwroot/assets/styles/style.css +++ b/Step/wwwroot/assets/styles/style.css @@ -516,8 +516,8 @@ } .modal.contact-info { width: 600px; - height: 375px; - top: calc(50% - 187.5px); + height: 730px; + top: calc(50% - 365px); left: calc(50% - 300px); } .modal.contact-info header { @@ -540,6 +540,7 @@ .modal.contact-info .details { text-align: center; color: #4b4b4b; + margin-bottom: 30px; } .modal.contact-info .details > * { display: block; @@ -558,6 +559,15 @@ .modal.contact-info .details > hr { border: none; } +.modal.contact-info .contactInfo { + margin-bottom: 75px; +} +.modal.contact-info .btn-success { + height: 30px; + font-size: 17px; + margin: 0 auto; + display: block; +} .modal.self-adaptive { width: 750px; height: 350px; diff --git a/Step/wwwroot/src/app_modules/machine/components/contact-info-dialog.ts b/Step/wwwroot/src/app_modules/machine/components/contact-info-dialog.ts index 40aad79d..ec52b261 100644 --- a/Step/wwwroot/src/app_modules/machine/components/contact-info-dialog.ts +++ b/Step/wwwroot/src/app_modules/machine/components/contact-info-dialog.ts @@ -1,19 +1,43 @@ import Vue from "vue"; import { Modal, ModalHelper } from "src/components/modals"; -import { machineService, ContactConfigurationModel } from "src/services/machineService"; +import { machineService, ContactConfigurationModel, ContactModel } from "src/services/machineService"; import { Factory, messageService, awaiter } from "src/_base"; import Component from "vue-class-component"; @Component({ components: { modal: Modal } }) export default class ContactInfoDialog extends Vue { - public contactInfo: ContactConfigurationModel = { + public contactInfo: ContactModel = { name:"", phoneNumber: "", email: "" }; + public retrofitConfig: ContactModel = { + name:"", + phoneNumber: "", + email: "" + }; + + public sparePartConfig: ContactModel = { + name:"", + phoneNumber: "", + email: "" + }; + + public backOfficeConfig: ContactModel = { + name:"", + phoneNumber: "", + email: "" + }; + + + async beforeMount() { - this.contactInfo = await awaiter(new machineService().getContactConfiguration()); + var contact = await awaiter(new machineService().getContactConfiguration()); + this.contactInfo = contact.contactConfig + this.retrofitConfig = contact.retrofitConfig + this.sparePartConfig = contact.sparePartConfig + this.backOfficeConfig = contact.backOfficeConfig messageService.subscribeToChannel("esc_pressed", args => { this.close(); }); diff --git a/Step/wwwroot/src/app_modules/machine/components/contact-info-dialog.vue b/Step/wwwroot/src/app_modules/machine/components/contact-info-dialog.vue index 74de54c9..2f225544 100644 --- a/Step/wwwroot/src/app_modules/machine/components/contact-info-dialog.vue +++ b/Step/wwwroot/src/app_modules/machine/components/contact-info-dialog.vue @@ -2,13 +2,29 @@
- -
+
+

{{'assistance_name' | localize('Informazioni assistenza:').toUpperCase()}}

+
+

{{backOfficeConfig.name.toUpperCase()}}

+ + +
+
+

{{sparePartConfig.name.toUpperCase()}}

+ + +
+
+

{{retrofitConfig.name.toUpperCase()}}

+ + +
+
diff --git a/Step/wwwroot/src/services/machineService.ts b/Step/wwwroot/src/services/machineService.ts index 7e709672..4d3b5af7 100644 --- a/Step/wwwroot/src/services/machineService.ts +++ b/Step/wwwroot/src/services/machineService.ts @@ -20,7 +20,6 @@ export class machineService extends baseRestService { async getMachineCNInfo(): Promise { let result = await this.Get("/api/nc/generic_data", true).catch(r => { - console.debug(r); }); if (result) { @@ -57,6 +56,13 @@ export interface ClientConfigurationModel { } export interface ContactConfigurationModel { + contactConfig: ContactModel, + backOfficeConfig: ContactModel, + retrofitConfig: ContactModel, + sparePartConfig: ContactModel +} + +export interface ContactModel{ name: string, email: string, phoneNumber: string