Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.26 KB | None | 0 0
  1. <div class="row">
  2. <div class="box box-primary">
  3. <div class="box-header">
  4. <i class="fa fa-cogs"></i>
  5. <h3 class="box-title">Eficiencia por equipo</h3>
  6. <div class="box-tools">
  7. <button type="button" class="btn btn-box-tool" data-widget="collapse">
  8. <i class="fa fa-minus"></i>
  9. </button>
  10. </div>
  11. <div class="box-body">
  12. <div class="jumbotron" id="body">
  13. <img src="~/Content/img/EficienciaByConveyor.jpg" />
  14.  
  15. <div class="card text-white" id="popover-content-MyConveyr" style="display: none;">
  16. <div class="row">
  17. <div class="col-md-2">
  18.  
  19. <img src="~/Content/img/Conveyor.PNG" class="card-img" alt="Card " />
  20. </div>
  21. <div class="col-md-10">
  22. <div class="card-body">
  23. <div class="row no-padding no-border no-border no-margin mrg">
  24. <div class="col-md-1 mrg"></div>
  25. <div class="col-md-7 no-padding no-border no-border no-margin mrg">
  26. <h6 class="text-muted pdd"> Id Equipo</h6>
  27. </div>
  28. <div class="col-md-2 no-padding no-border no-border no-margin mrg">
  29. <h6 class="text-muted pdd" id="Equipo"></h6>
  30. </div>
  31. </div>
  32. <div class="row no-padding no-border no-border no-margin mrg">
  33. <div class="col-md-1 mrg"></div>
  34. <div class="col-md-7 no-padding no-border no-border no-margin mrg">
  35. <h6 class="text-muted pdd">Estado</h6>
  36. </div>
  37. <div class="col-md-2 no-padding no-border no-border no-margin mrg">
  38. <h6 class="text-muted pdd" id="Estado"></h6>
  39. </div>
  40. </div>
  41. <div class="row no-padding no-border no-border no-margin mrg">
  42. <div class="col-md-1 mrg"></div>
  43. <div class="col-md-7 no-padding no-border no-border no-margin mrg">
  44. <h6 class="text-muted pdd"> consumo KWH</h6>
  45. </div>
  46. <div class="col-md-2 no-padding no-border no-border no-margin mrg">
  47. <h6 class="text-muted pdd" id="Potencia"></h6>
  48. </div>
  49. </div>
  50. <div class="row no-padding no-border no-border no-margin mrg">
  51. <div class="col-md-1 mrg"></div>
  52. <div class="col-md-7 no-padding no-border no-border no-margin mrg">
  53. <h6 class="text-muted pdd"> Tiempo on(h)</h6>
  54. </div>
  55. <div class="col-md-2 no-padding no-border no-border no-margin mrg">
  56. <h6 class="text-muted pdd" id="timeon"></h6>
  57. </div>
  58. </div>
  59. <div class="row no-padding no-border no-border no-margin mrg">
  60. <div class="col-md-1 mrg"></div>
  61. <div class="col-md-7 no-padding no-border no-border no-margin mrg">
  62. <h6 class="text-muted pdd">Tiempo off(h)</h6>
  63. </div>
  64. <div class="col-md-2 no-padding no-border no-border no-margin mrg">
  65. <h6 class="text-muted pdd" id="timeoff"></h6>
  66. </div>
  67. </div>
  68. </div>
  69. </div>
  70. </div>
  71. </div>
  72.  
  73. <div class="card text-white" id="popover-content-MyATR" style="display: none;">
  74. <div class="row">
  75. <div class="col-md-2">
  76. <img src="~/Content/img/ATR.PNG" class="card-img" alt="Card" />
  77. </div>
  78. <div class="col-md-10">
  79. <div class="card-body">
  80. <div class="row no-padding no-border no-border no-margin mrg">
  81. <div class="col-md-1 mrg"></div>
  82. <div class="col-md-7 no-padding no-border no-border no-margin mrg">
  83. <h6 class="text-muted pdd"> Id Equipo</h6>
  84. </div>
  85. <div class="col-md-2 no-padding no-border no-border no-margin mrg">
  86. <h6 class="text-muted pdd" id="ATR"></h6>
  87. </div>
  88. </div>
  89. <div class="row no-padding no-border no-border no-margin mrg">
  90. <div class="col-md-1 mrg"></div>
  91. <div class="col-md-7 no-padding no-border no-border no-margin mrg">
  92. <h6 class="text-muted pdd">Estado</h6>
  93. </div>
  94. <div class="col-md-2 no-padding no-border no-border no-margin mrg">
  95. <h6 class="text-muted pdd" id="EstadoATR"></h6>
  96. </div>
  97. </div>
  98. <div class="row no-padding no-border no-border no-margin mrg">
  99. <div class="col-md-1 mrg"></div>
  100. <div class="col-md-7 no-padding no-border no-border no-margin mrg">
  101. <h6 class="text-muted pdd">Lecturas</h6>
  102. </div>
  103. <div class="col-md-2 no-padding no-border no-border no-margin mrg">
  104. <h6 class="text-muted pdd" id="Lecturas"></h6>
  105. </div>
  106. </div>
  107. <div class="row no-padding no-border no-border no-margin mrg">
  108. <div class="col-md-1 mrg"></div>
  109. <div class="col-md-7 no-padding no-border no-border no-margin mrg">
  110. <h6 class="text-muted pdd">No Lecturas</h6>
  111. </div>
  112. <div class="col-md-2 no-padding no-border no-border no-margin mrg">
  113. <h6 class="text-muted pdd" id="NoLecturas"></h6>
  114. </div>
  115. </div>
  116. <div class="row no-padding no-border no-border no-margin mrg">
  117. <div class="col-md-1 mrg"></div>
  118. <div class="col-md-7 no-padding no-border no-border no-margin mrg">
  119. <h6 class="text-muted pdd">Efectividad</h6>
  120. </div>
  121. <div class="col-md-2 no-padding no-border no-border no-margin mrg">
  122. <h6 class="text-muted pdd" id="Efectividad"></h6>
  123. </div>
  124. </div>
  125. </div>
  126. </div>
  127. </div>
  128. </div>
  129. </div>
  130. </div>
  131. </div>
  132. </div>
  133.  
  134. var idold;
  135. var ATR;
  136. var Conveyor
  137. var Eficiencia;
  138. var NoLeidos;
  139. var Leidos;
  140. var EstadoATR;
  141. var Estado;
  142. var Potencia;
  143. var TimeOn;
  144. var TimeOff;
  145. function getdata(id) {
  146. if (id != idold) {
  147. idold = id;
  148. ClearCards(id);
  149. if (id == 3 || id == 4 || id == 5 || id == 6) {
  150. $.ajax({ cache: false });
  151. $.ajax({
  152. type: "GET",
  153. contentType: 'application/html ; charset:utf-8',
  154. url: '@Url.Action("GetCardsDataConveyorsATR", "DashboardV2")',
  155. data: { IdATR: id, },
  156. success: function (response) {
  157. console.log(response);
  158. let cualquiera = response.data;
  159. cualquiera.forEach(function () {
  160. ATR = cualquiera[0].Description;
  161. Eficiencia = cualquiera[0].Eficiency;
  162. NoLeidos = cualquiera[0].NoReads;
  163. Leidos = cualquiera[0].Reads;
  164. EstadoATR = cualquiera[0].State;
  165. document.getElementById("ATR").innerText = ATR;
  166. document.getElementById("Efectividad").innerText = Eficiencia;
  167. document.getElementById("NoLecturas").innerText = NoLeidos;
  168. document.getElementById("Lecturas").innerText = Leidos;
  169. document.getElementById("EstadoATR").innerText = EstadoATR;
  170. });
  171. },
  172. error: function (error) {
  173. console.log(error);
  174. }
  175. });
  176. }
  177. else {
  178. $.ajax({ cache: false });
  179. $.ajax({
  180. type: 'GET',
  181. contentType: 'application/html; charset: utf-8',
  182. url: '',
  183. data: { IdConv: id, },
  184. success: function (response) {
  185. let ConvARRAY = response.data;
  186. ConvARRAY.forEach(function () {
  187. Conveyor = ConvARRAY[0].Description;
  188. Potencia = ConvARRAY[0].Potencia;
  189. Estado = ConvARRAY[0].State;
  190. TimeOn = ConvARRAY[0].TimeOn;
  191. TimeOff = ConvARRAY[0].TimeOff;
  192. document.getElementById("Equipo").innerText = Conveyor;
  193. document.getElementById("timeon").innerText = TimeOn;
  194. document.getElementById("timeoff").innerText = TimeOff;
  195. document.getElementById("Estado").innerText = Estado;
  196. document.getElementById("Potencia").innerText = Potencia;
  197.  
  198. });
  199. console.log(response);
  200. },
  201. error: function (error) {
  202. console.log(error);
  203. }
  204. });
  205.  
  206. }
  207. }
  208. }
  209. var dot;
  210. let cvyr = [];
  211.  
  212. for (var i = 1; i <= 82; i++) {
  213. cvyr[i] = i;
  214. if (cvyr[i] == 3 || cvyr[i] == 4 || cvyr[i] == 5 || cvyr[i] == 6) {
  215. 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>'
  216. }
  217. else {
  218. 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>'
  219. }
  220. $(dot).appendTo("#body");
  221. }
  222.  
  223. function ClearCards(id) {
  224. if (id == 3 || id == 4 || id == 5 || id == 6) {
  225. document.getElementById("ATR").innerText = '';
  226. document.getElementById("Efectividad").innerText = '';
  227. document.getElementById("NoLecturas").innerText = '';
  228. document.getElementById("Lecturas").innerText = '';
  229. document.getElementById("EstadoATR").innerText = '';
  230. } else {
  231. document.getElementById("Equipo").innerText = '';
  232. document.getElementById("timeon").innerText = '';
  233. document.getElementById("timeoff").innerText = '';
  234. document.getElementById("Estado").innerText = '';
  235. document.getElementById("Potencia").innerText = '';
  236. }
  237.  
  238.  
  239. }
  240.  
  241.  
  242. $("[data-toggle=popover]").each(function (i, obj) {
  243. $(this).popover({
  244. html: true,
  245. content: function () {
  246. var id = $(this).attr('id')
  247. return $('#popover-content-' + id).html();
  248. }
  249. });
  250. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement