Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div class="row">
- <div class="box box-primary">
- <div class="box-header">
- <i class="fa fa-cogs"></i>
- <h3 class="box-title">Eficiencia por equipo</h3>
- <div class="box-tools">
- <button type="button" class="btn btn-box-tool" data-widget="collapse">
- <i class="fa fa-minus"></i>
- </button>
- </div>
- <div class="box-body">
- <div class="jumbotron" id="body">
- <img src="~/Content/img/EficienciaByConveyor.jpg" />
- <div class="card text-white" id="popover-content-MyConveyr" style="display: none;">
- <div class="row">
- <div class="col-md-2">
- <img src="~/Content/img/Conveyor.PNG" class="card-img" alt="Card " />
- </div>
- <div class="col-md-10">
- <div class="card-body">
- <div class="row no-padding no-border no-border no-margin mrg">
- <div class="col-md-1 mrg"></div>
- <div class="col-md-7 no-padding no-border no-border no-margin mrg">
- <h6 class="text-muted pdd"> Id Equipo</h6>
- </div>
- <div class="col-md-2 no-padding no-border no-border no-margin mrg">
- <h6 class="text-muted pdd" id="Equipo"></h6>
- </div>
- </div>
- <div class="row no-padding no-border no-border no-margin mrg">
- <div class="col-md-1 mrg"></div>
- <div class="col-md-7 no-padding no-border no-border no-margin mrg">
- <h6 class="text-muted pdd">Estado</h6>
- </div>
- <div class="col-md-2 no-padding no-border no-border no-margin mrg">
- <h6 class="text-muted pdd" id="Estado"></h6>
- </div>
- </div>
- <div class="row no-padding no-border no-border no-margin mrg">
- <div class="col-md-1 mrg"></div>
- <div class="col-md-7 no-padding no-border no-border no-margin mrg">
- <h6 class="text-muted pdd"> consumo KWH</h6>
- </div>
- <div class="col-md-2 no-padding no-border no-border no-margin mrg">
- <h6 class="text-muted pdd" id="Potencia"></h6>
- </div>
- </div>
- <div class="row no-padding no-border no-border no-margin mrg">
- <div class="col-md-1 mrg"></div>
- <div class="col-md-7 no-padding no-border no-border no-margin mrg">
- <h6 class="text-muted pdd"> Tiempo on(h)</h6>
- </div>
- <div class="col-md-2 no-padding no-border no-border no-margin mrg">
- <h6 class="text-muted pdd" id="timeon"></h6>
- </div>
- </div>
- <div class="row no-padding no-border no-border no-margin mrg">
- <div class="col-md-1 mrg"></div>
- <div class="col-md-7 no-padding no-border no-border no-margin mrg">
- <h6 class="text-muted pdd">Tiempo off(h)</h6>
- </div>
- <div class="col-md-2 no-padding no-border no-border no-margin mrg">
- <h6 class="text-muted pdd" id="timeoff"></h6>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="card text-white" id="popover-content-MyATR" style="display: none;">
- <div class="row">
- <div class="col-md-2">
- <img src="~/Content/img/ATR.PNG" class="card-img" alt="Card" />
- </div>
- <div class="col-md-10">
- <div class="card-body">
- <div class="row no-padding no-border no-border no-margin mrg">
- <div class="col-md-1 mrg"></div>
- <div class="col-md-7 no-padding no-border no-border no-margin mrg">
- <h6 class="text-muted pdd"> Id Equipo</h6>
- </div>
- <div class="col-md-2 no-padding no-border no-border no-margin mrg">
- <h6 class="text-muted pdd" id="ATR"></h6>
- </div>
- </div>
- <div class="row no-padding no-border no-border no-margin mrg">
- <div class="col-md-1 mrg"></div>
- <div class="col-md-7 no-padding no-border no-border no-margin mrg">
- <h6 class="text-muted pdd">Estado</h6>
- </div>
- <div class="col-md-2 no-padding no-border no-border no-margin mrg">
- <h6 class="text-muted pdd" id="EstadoATR"></h6>
- </div>
- </div>
- <div class="row no-padding no-border no-border no-margin mrg">
- <div class="col-md-1 mrg"></div>
- <div class="col-md-7 no-padding no-border no-border no-margin mrg">
- <h6 class="text-muted pdd">Lecturas</h6>
- </div>
- <div class="col-md-2 no-padding no-border no-border no-margin mrg">
- <h6 class="text-muted pdd" id="Lecturas"></h6>
- </div>
- </div>
- <div class="row no-padding no-border no-border no-margin mrg">
- <div class="col-md-1 mrg"></div>
- <div class="col-md-7 no-padding no-border no-border no-margin mrg">
- <h6 class="text-muted pdd">No Lecturas</h6>
- </div>
- <div class="col-md-2 no-padding no-border no-border no-margin mrg">
- <h6 class="text-muted pdd" id="NoLecturas"></h6>
- </div>
- </div>
- <div class="row no-padding no-border no-border no-margin mrg">
- <div class="col-md-1 mrg"></div>
- <div class="col-md-7 no-padding no-border no-border no-margin mrg">
- <h6 class="text-muted pdd">Efectividad</h6>
- </div>
- <div class="col-md-2 no-padding no-border no-border no-margin mrg">
- <h6 class="text-muted pdd" id="Efectividad"></h6>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- var idold;
- var ATR;
- var Conveyor
- var Eficiencia;
- var NoLeidos;
- var Leidos;
- var EstadoATR;
- var Estado;
- var Potencia;
- var TimeOn;
- var TimeOff;
- function getdata(id) {
- if (id != idold) {
- idold = id;
- ClearCards(id);
- if (id == 3 || id == 4 || id == 5 || id == 6) {
- $.ajax({ cache: false });
- $.ajax({
- type: "GET",
- contentType: 'application/html ; charset:utf-8',
- url: '@Url.Action("GetCardsDataConveyorsATR", "DashboardV2")',
- data: { IdATR: id, },
- success: function (response) {
- console.log(response);
- let cualquiera = response.data;
- cualquiera.forEach(function () {
- ATR = cualquiera[0].Description;
- Eficiencia = cualquiera[0].Eficiency;
- NoLeidos = cualquiera[0].NoReads;
- Leidos = cualquiera[0].Reads;
- EstadoATR = cualquiera[0].State;
- document.getElementById("ATR").innerText = ATR;
- document.getElementById("Efectividad").innerText = Eficiencia;
- document.getElementById("NoLecturas").innerText = NoLeidos;
- document.getElementById("Lecturas").innerText = Leidos;
- document.getElementById("EstadoATR").innerText = EstadoATR;
- });
- },
- error: function (error) {
- console.log(error);
- }
- });
- }
- else {
- $.ajax({ cache: false });
- $.ajax({
- type: 'GET',
- contentType: 'application/html; charset: utf-8',
- url: '',
- data: { IdConv: id, },
- success: function (response) {
- let ConvARRAY = response.data;
- ConvARRAY.forEach(function () {
- Conveyor = ConvARRAY[0].Description;
- Potencia = ConvARRAY[0].Potencia;
- Estado = ConvARRAY[0].State;
- TimeOn = ConvARRAY[0].TimeOn;
- TimeOff = ConvARRAY[0].TimeOff;
- document.getElementById("Equipo").innerText = Conveyor;
- document.getElementById("timeon").innerText = TimeOn;
- document.getElementById("timeoff").innerText = TimeOff;
- document.getElementById("Estado").innerText = Estado;
- document.getElementById("Potencia").innerText = Potencia;
- });
- console.log(response);
- },
- error: function (error) {
- console.log(error);
- }
- });
- }
- }
- }
- var dot;
- let cvyr = [];
- for (var i = 1; i <= 82; i++) {
- cvyr[i] = i;
- if (cvyr[i] == 3 || cvyr[i] == 4 || cvyr[i] == 5 || cvyr[i] == 6) {
- dot = '<a class="cvy' + cvyr[i] + '" data-toggle="popover" data-container="body" data-placement="right" data-html="true" id="MyATR" onclick="getdata(' + cvyr[i] + ')" title=""><i class="fa fa-bars"></i></a>'
- }
- else {
- dot = '<a class="cvy' + cvyr[i] + '" data-toggle="popover" data-container="body" data-placement="right" data-html="true" id="MyConveyr" onclick="getdata(' + cvyr[i] + ')" title=""><i class="fa fa-cogs"></i></a>'
- }
- $(dot).appendTo("#body");
- }
- function ClearCards(id) {
- if (id == 3 || id == 4 || id == 5 || id == 6) {
- document.getElementById("ATR").innerText = '';
- document.getElementById("Efectividad").innerText = '';
- document.getElementById("NoLecturas").innerText = '';
- document.getElementById("Lecturas").innerText = '';
- document.getElementById("EstadoATR").innerText = '';
- } else {
- document.getElementById("Equipo").innerText = '';
- document.getElementById("timeon").innerText = '';
- document.getElementById("timeoff").innerText = '';
- document.getElementById("Estado").innerText = '';
- document.getElementById("Potencia").innerText = '';
- }
- }
- $("[data-toggle=popover]").each(function (i, obj) {
- $(this).popover({
- html: true,
- content: function () {
- var id = $(this).attr('id')
- return $('#popover-content-' + id).html();
- }
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement