index.html 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  6. <link rel="shortcut icon" href="/img/logo.png" />
  7. <link rel="bookmark" href="/img/logo.png" />
  8. <link href="/Plugins/animate/animate.min.css" rel="stylesheet" />
  9. <link rel="stylesheet" href="../DashBoard.css?v3" />
  10. <script src="/Plugins/jquery-3.4.1/jquery-3.4.1.min.js"></script>
  11. <script src="/Plugins/xrequest/xrequest.min.js"></script>
  12. <title>东科软件</title>
  13. </head>
  14. <body style="background-color:black;">
  15. <div class="box_1920_1080">
  16. <div class="box_title">
  17. 生产数据监控&nbsp;&nbsp;<span class="box_title_arrow">>>></span>
  18. </div>
  19. <div class="box_body" style="display: flex; flex-direction: column;">
  20. <div style="width:1840px;height:960px;display:flex;flex-direction:row;">
  21. <div style="width: 100%; padding-top:10px;">
  22. <table cellspacing="0" cellpadding="0" border="0" style="width:100%;">
  23. <tr class="tr_title">
  24. <td style="width:230px"></td>
  25. <td style="width:230px">成型</td>
  26. <td style="width:230px">一检</td>
  27. <td style="width:230px">改洗</td>
  28. <td style="width:230px">二检</td>
  29. <td style="width:230px">施釉</td>
  30. <td style="width:230px">烧成</td>
  31. <td style="width:230px">成检</td>
  32. </tr>
  33. <tr class="tr_bg_light">
  34. <td style="width:230px">今日累计</td>
  35. <td style="width:230px"><span id="cxlj_num">0</span> <span id="cxlj_add" style="color:orange"></span></td>
  36. <td style="width:230px"><span id="yjlj_num">0</span> <span id="yjlj_add" style="color:orange"></span></td>
  37. <td style="width:230px"><span id="gxlj_num">0</span> <span id="gxlj_add" style="color:orange"></span></td>
  38. <td style="width:230px"><span id="ejlj_num">0</span> <span id="ejlj_add" style="color:orange"></span></td>
  39. <td style="width:230px"><span id="sylj_num">0</span> <span id="sylj_add" style="color:orange"></span></td>
  40. <td style="width:230px"><span id="sclj_num">0</span> <span id="sclj_add" style="color:orange"></span></td>
  41. <td style="width:230px"><span id="cjlj_num">0</span> <span id="cjlj_add" style="color:orange"></span></td>
  42. </tr>
  43. <tr class="tr_bg_dark">
  44. <td style="width:230px">累计计件</td>
  45. <td style="width:230px">0</td>
  46. <td style="width:230px">0</td>
  47. <td style="width:230px">0</td>
  48. <td style="width:230px">0</td>
  49. <td style="width:230px">0</td>
  50. <td style="width:230px">0</td>
  51. <td style="width:230px">0</td>
  52. </tr>
  53. <tr class="tr_bg_light">
  54. <td style="width:230px">累计异常</td>
  55. <td style="width:230px">0</td>
  56. <td style="width:230px">0</td>
  57. <td style="width:230px">0</td>
  58. <td style="width:230px">0</td>
  59. <td style="width:230px">0</td>
  60. <td style="width:230px">0</td>
  61. <td style="width:230px">0</td>
  62. </tr>
  63. <tr class="tr_bg_dark">
  64. <td style="width:230px">生产节拍</td>
  65. <td style="width:230px">0</td>
  66. <td style="width:230px">0</td>
  67. <td style="width:230px">0</td>
  68. <td style="width:230px">0</td>
  69. <td style="width:230px">0</td>
  70. <td style="width:230px">0</td>
  71. <td style="width:230px">0</td>
  72. </tr>
  73. <tr class="tr_bg_light" style="height:40px;">
  74. <td style="width:230px">实时数据</td>
  75. <td style="width: 230px; height: 40px; display: flex; flex-direction: column; align-items: center " id="cx"></td>
  76. <td style="width:230px" id="yj"></td>
  77. <td style="width:230px" id="gx"></td>
  78. <td style="width:230px" id="ej"></td>
  79. <td style="width:230px" id="sy"></td>
  80. <td style="width:230px" id="sc"></td>
  81. <td style="width:230px" id="cj"></td>
  82. </tr>
  83. </table>
  84. </div>
  85. </div>
  86. </div>
  87. </div>
  88. <script>
  89. const animateCSS = (element, animation, prefix = 'animate__') =>
  90. new Promise((resolve, reject) => {
  91. const animationName = `${prefix}${animation}`;
  92. const node = document.querySelector(element);
  93. node.classList.add(`${prefix}animated`, animationName);
  94. function handleAnimationEnd(event) {
  95. event.stopPropagation();
  96. node.classList.remove(`${prefix}animated`, animationName);
  97. resolve('Animation ended');
  98. }
  99. node.addEventListener('animationend', handleAnimationEnd, { once: true });
  100. });
  101. $(document).ready(function () {
  102. //initData();
  103. //loadData();
  104. //barCodeSuccess("#cx", "条码:12345678901 工号:DONGKEXW");
  105. //barCodeError("#cx", "11111111111");
  106. doGetData = setInterval(function () { timeUpdate(); }, 500);
  107. });
  108. function timeUpdate() {
  109. if (Math.round(Math.random() * 2) == 1) addNum("#cxlj");
  110. if (Math.round(Math.random() * 2) == 1) addNum("#yjlj");
  111. if (Math.round(Math.random() * 2) == 1) addNum("#gxlj");
  112. if (Math.round(Math.random() * 2) == 1) addNum("#ejlj");
  113. if (Math.round(Math.random() * 2) == 1) addNum("#sylj");
  114. if (Math.round(Math.random() * 2) == 1) addNum("#sclj");
  115. if (Math.round(Math.random() * 2) == 1) addNum("#cjlj");
  116. }
  117. //产品计件成功显示
  118. function barCodeSuccess(id, title) {
  119. var num = Math.round(Math.random() * 10000);
  120. $(id).append("<div id='" + id.replace('#', '') + num + "' style='position: absolute'>" + title + "</div>");
  121. animateCSS(id + num, 'fadeInUp').then((message) => {
  122. setTimeout(function () {
  123. animateCSS(id + num, 'fadeOutUp').then((message) => {
  124. $(id + num).remove();
  125. });
  126. }, 1000);
  127. });
  128. }
  129. //产品计件失败显示
  130. function barCodeError(id, title) {
  131. var num = Math.round(Math.random() * 10000);
  132. $(id).append("<div id='" + id.replace('#', '') + num + "' style='position: absolute'>" + title + "</div>");
  133. animateCSS(id + num, 'fadeInUp').then((message) => {
  134. animateCSS(id + num, 'tada').then((message) => {
  135. animateCSS(id + num, 'fadeOutUp').then((message) => {
  136. $(id + num).remove();
  137. });
  138. });
  139. });
  140. }
  141. //数量+1
  142. function addNum(id) {
  143. $(id + '_num').text(parseInt($(id + '_num').text()) + 1);
  144. var num = Math.round(Math.random() * 10000);
  145. $(id + '_add').append("<div id='" + id.replace('#', '') + '_add' + num + "' style='position: absolute;left:" + ($(id + '_add').offset().left + 30) + "px;top:" + ($(id + '_add').offset().top - 20) + "px;'>+1</div>");
  146. animateCSS(id + '_add' + num, 'fadeInUp').then((message) => {
  147. animateCSS(id + '_add' + num, 'fadeOutUp').then((message) => {
  148. $(id + '_add' + num).remove();
  149. });
  150. });
  151. }
  152. function loadData() {
  153. //产品达成数据===================================
  154. window.GoodsCL.data.datasets[0].data = [
  155. 3000,
  156. 3000,
  157. 3000,
  158. 3000,
  159. 3000,
  160. 3000
  161. ];
  162. window.GoodsCL.data.datasets[1].data = [
  163. randomScalingFactor(1000) + 2000,
  164. randomScalingFactor(1000) + 2000,
  165. randomScalingFactor(1000) + 2000,
  166. randomScalingFactor(1000) + 2000,
  167. randomScalingFactor(1000) + 2000,
  168. randomScalingFactor(1000) + 2000
  169. ];
  170. window.GoodsCL.update();
  171. //===================================================
  172. //产量计划达成数据===================================
  173. window.ProcedureCL.data.datasets[0].data = [
  174. 3000,
  175. 3000,
  176. 3000,
  177. 3000,
  178. 3000,
  179. 3000,
  180. 3000
  181. ];
  182. window.ProcedureCL.data.datasets[1].data = [
  183. randomScalingFactor(1000) + 2000,
  184. randomScalingFactor(1000) + 2000,
  185. randomScalingFactor(1000) + 2000,
  186. randomScalingFactor(1000) + 2000,
  187. randomScalingFactor(1000) + 2000,
  188. randomScalingFactor(1000) + 2000,
  189. randomScalingFactor(1000) + 2000
  190. ];
  191. window.ProcedureCL.update();
  192. //===================================================
  193. }
  194. function initData() {
  195. window.chartColors = {
  196. red: 'rgb(255, 99, 132)',
  197. orange: 'rgb(255, 159, 64)',
  198. yellow: 'rgb(255, 250, 86)',
  199. green: 'rgb(75, 192, 192)',
  200. blue: 'rgb(54, 162, 250)',
  201. purple: 'rgb(153, 102, 255)',
  202. grey: 'rgb(231,233,237)'
  203. };
  204. var color = Chart.helpers.color;
  205. window.randomScalingFactor = function (num) {
  206. return Math.round(Math.random() * num);
  207. }
  208. Chart.defaults.global.defaultFontColor = 'white';
  209. Chart.defaults.global.defaultFontSize = 24;
  210. Chart.defaults.global.legend.display = false;
  211. //产品型号达成=======================================
  212. window.configGoodsCL = {
  213. data: {
  214. labels: ['H0962L-A', 'H0962M-A', 'H0966L-W', 'H0966M-W', 'H0967L-W', 'H0967M-W'],
  215. datasets: [{
  216. type: 'line',
  217. label: '计划产量',
  218. backgroundColor: color(window.chartColors.orange).alpha(0.35).rgbString(),
  219. fill: false,
  220. borderColor: window.chartColors.orange,
  221. borderWidth: 2,
  222. pointRadius: 30,
  223. data: [0, 0, 0, 0, 0, 0, 0]
  224. }, {
  225. label: '实际产量',
  226. backgroundColor: color(window.chartColors.blue).alpha(0.35).rgbString(),
  227. borderColor: window.chartColors.blue,
  228. borderWidth: 1,
  229. data: [0, 0, 0, 0, 0, 0, 0]
  230. }]
  231. },
  232. type: 'bar',
  233. options: {
  234. legend: {
  235. display: true
  236. },
  237. title: {
  238. display: true,
  239. text: "月度产品完工统计"
  240. },
  241. tooltips: {
  242. mode: 'point',
  243. intersect: false
  244. },
  245. responsive: true,
  246. scales: {
  247. xAxes: [{
  248. stacked: false
  249. }],
  250. yAxes: [{
  251. display: true,
  252. stacked: false,
  253. ticks: {
  254. min: 0,
  255. stepSize: 500,
  256. max: 3500
  257. }
  258. }]
  259. }
  260. }
  261. };
  262. var ctxGoodsCL = document.getElementById("canvasGoodsCL").getContext("2d");
  263. window.GoodsCL = new Chart(ctxGoodsCL, configGoodsCL);
  264. //===================================================
  265. //工序产量达成=======================================
  266. window.configProcedureCL = {
  267. data: {
  268. labels: ['成型', '一检', '改洗', '二检', '施釉', '烧成', '成检'],
  269. datasets: [{
  270. type: 'line',
  271. label: '计划产量',
  272. backgroundColor: color(window.chartColors.orange).alpha(0.35).rgbString(),
  273. fill: false,
  274. borderColor: window.chartColors.orange,
  275. borderWidth: 2,
  276. pointRadius: 30,
  277. data: [0, 0, 0, 0, 0, 0, 0]
  278. }, {
  279. label: '实际产量',
  280. backgroundColor: color(window.chartColors.blue).alpha(0.35).rgbString(),
  281. borderColor: window.chartColors.blue,
  282. borderWidth: 1,
  283. data: [0, 0, 0, 0, 0, 0, 0]
  284. }]
  285. },
  286. type: 'bar',
  287. options: {
  288. legend: {
  289. display: true
  290. },
  291. title: {
  292. display: true,
  293. text: "月度工序完工统计"
  294. },
  295. tooltips: {
  296. mode: 'point',
  297. intersect: false
  298. },
  299. responsive: true,
  300. scales: {
  301. xAxes: [{
  302. stacked: false
  303. }],
  304. yAxes: [{
  305. display: true,
  306. stacked: false,
  307. ticks: {
  308. min: 0,
  309. stepSize: 500,
  310. max: 3500
  311. }
  312. }]
  313. }
  314. }
  315. };
  316. var ctxProcedureCL = document.getElementById("canvasProcedureCL").getContext("2d");
  317. window.ProcedureCL = new Chart(ctxProcedureCL, configProcedureCL);
  318. //===================================================
  319. }
  320. </script>
  321. <script src="/Plugins/chartjs-2.8.0/chart-2.8.min.js"></script>
  322. <script src="/Plugins/chartjs-2.8.0/chartjs-plugin-datalabels.js"></script>
  323. <script src="/Plugins/chartjs-2.8.0/utils.js"></script>
  324. <script src="/Plugins/circleChart/circleChart.min.js"></script>
  325. </body>
  326. </html>