index_split.html 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400
  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 rel="stylesheet" href="../DashBoard.css?v3" />
  9. <script src="/Plugins/jquery-3.4.1/jquery-3.4.1.min.js"></script>
  10. <script src="/Plugins/xrequest/xrequest.min.js"></script>
  11. <script src="/Plugins/xcountto/xcountTo2.js"></script>
  12. <title>东科软件</title>
  13. </head>
  14. <body style="background-color: #122a3c">
  15. <div class="m4_box_1920_1080">
  16. <div class="m4_box_title" onclick="showHelp()" style="cursor:pointer">
  17. <div class="m4_box_title_arrow"></div><div class="m4_box_title_arrow2"></div> <div>施釉工艺</div><span class="m4_box_title_loading" id="报表加载"></span>
  18. </div>
  19. <div class="m4_box_body">
  20. <div style="width:1720px;height:410px;display:flex;flex-direction:row;">
  21. <div style="width: 1335px;height:410px;">
  22. <!--1号机器人流量-->
  23. <canvas id="canvasRobot1" style="-moz-user-select: none;-webkit-user-select: none;-ms-user-select: none; height:410px;width:100%"></canvas>
  24. </div>
  25. <div style="width: 385px; height: 390px; padding-left:20px;">
  26. <!--流量-->
  27. <table cellspacing="0" cellpadding="0" border="0" style="width:100%;">
  28. <tr class="tr_title_warning">
  29. <td>平均流量 l/h</td>
  30. <td>累计流量 l </td>
  31. </tr>
  32. <tr class="tr_bg_light_warning" style="height:140px;">
  33. <td id="agv1" data-decimals="2" data-speed="2000" style="font-size: 40px; width: 50%"></td>
  34. <td id="sum1" data-speed="2000" style="font-size: 40px; width: 50%"></td>
  35. </tr>
  36. </table>
  37. </div>
  38. </div>
  39. <div style="width:1720px;height:410px;display:flex;flex-direction:row;">
  40. <div style="width: 1335px;height:410px;">
  41. <!--2号机器人流量-->
  42. <canvas id="canvasRobot2" style="-moz-user-select: none;-webkit-user-select: none;-ms-user-select: none; height:410px;width:100%"></canvas>
  43. </div>
  44. <div style="width: 385px; height: 390px; padding-left:20px;">
  45. <!--流量-->
  46. <table cellspacing="0" cellpadding="0" border="0" style="width:100%;">
  47. <tr class="tr_title_warning">
  48. <td>平均流量 l/h</td>
  49. <td>累计流量 l </td>
  50. </tr>
  51. <tr class="tr_bg_light_warning" style="height:140px;">
  52. <td id="agv2" data-decimals="2" data-speed="2000" style="font-size: 40px; width: 50%"></td>
  53. <td id="sum2" data-speed="2000" style="font-size: 40px; width: 50%"></td>
  54. </tr>
  55. </table>
  56. </div>
  57. </div>
  58. </div>
  59. </div>
  60. <script>
  61. //缺陷统计刷新时间
  62. var refreshTime1 = 60000;
  63. var currentTime1 = 0;
  64. var doGetData;
  65. var doGetTime;
  66. var frameHeight;
  67. var tableHeight;
  68. var offsetHeight = 20;
  69. $(document).ready(function () {
  70. initData();
  71. doGetData = setInterval(function () { timeUpdate(); }, 1000);
  72. });
  73. //帮助说明
  74. function showHelp() {
  75. var message = "统计说明:" + "\n";
  76. message += "施釉机器人1号平均流量:喷釉房号是1#,在3#施釉工序的平均流量" + "\n";
  77. message += "施釉机器人1号累计流量:喷釉房号是1#,在3#施釉工序的累计流量" + "\n";
  78. message += "施釉机器人2号平均流量:喷釉房号是2#,在3#施釉工序的平均流量" + "\n";
  79. message += "施釉机器人2号累计流量:喷釉房号是2#,在3#施釉工序的累计流量" + "\n";
  80. alert(message);
  81. }
  82. function timeUpdate() {
  83. if (currentTime1 <= 0) {
  84. //clearData();
  85. loadData();
  86. currentTime1 = refreshTime1;
  87. }
  88. else {
  89. if (currentTime1 > 0) {
  90. $('#报表加载').html('刷新:' + currentTime1 / 1000 + ' 秒');
  91. currentTime1 = currentTime1 - 1000;
  92. }
  93. }
  94. }
  95. function clearData() {
  96. //清除数据
  97. //工序产量===================================
  98. //window.Robot1.data.labels = ['', '', '', '', '', '', ''];
  99. window.Robot1.data.datasets[1].data = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
  100. window.Robot1.update();
  101. //===================================================
  102. //window.Robot2.data.labels = ['', '', '', '', '', '', ''];
  103. window.Robot2.data.datasets[1].data = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
  104. window.Robot2.update();
  105. }
  106. function loadData() {
  107. $.get("rpt.ashx?m=1", function (data) {
  108. var jsondata = JSON.parse(data);
  109. if (jsondata["success"] == true) {
  110. for (var i = 0; i < jsondata["rows"].length; i++) {
  111. window.Robot1.data.labels[i] = jsondata["rows"][i]["时间"];
  112. window.Robot1.data.datasets[0].data[i] = 1.00;
  113. console.log(i, jsondata["rows"][i]["流量"])
  114. window.Robot1.data.datasets[1].data[i] = jsondata["rows"][i]["流量"];
  115. window.Robot1.data.datasets[2].data[i] = 1.60;
  116. }
  117. var myDate = new Date();
  118. for (var j = myDate.getHours()+1; j < 24; j++) {
  119. window.Robot1.data.datasets[1].data[j] = null;
  120. }
  121. window.Robot1.update();
  122. }
  123. });
  124. $.get("rpt.ashx?m=2", function (data) {
  125. var jsondata = JSON.parse(data);
  126. if (jsondata["success"] == true) {
  127. for (var i = 0; i < jsondata["rows"].length; i++) {
  128. window.Robot2.data.labels[i] = jsondata["rows"][i]["时间"];
  129. window.Robot2.data.datasets[0].data[i] = 1.00;
  130. window.Robot2.data.datasets[1].data[i] = jsondata["rows"][i]["流量"];
  131. window.Robot2.data.datasets[2].data[i] = 1.60;
  132. }
  133. var myDate = new Date();
  134. for (var j = myDate.getHours() + 1; j < 24; j++) {
  135. window.Robot2.data.datasets[1].data[j] = null;
  136. }
  137. window.Robot2.update();
  138. }
  139. });
  140. $.get("rpt.ashx?m=table1", function (data) {
  141. var jsondata = JSON.parse(data);
  142. if (jsondata["success"] == true) {
  143. $("#agv1").attr('data-to', jsondata["rows"][0]["平均流量"]);
  144. $("#agv1").countTo();
  145. $("#sum1").attr('data-to', jsondata["rows"][0]["累计流量"]);
  146. $("#sum1").countTo();
  147. }
  148. });
  149. $.get("rpt.ashx?m=table2", function (data) {
  150. var jsondata = JSON.parse(data);
  151. if (jsondata["success"] == true) {
  152. $("#agv2").attr('data-to', jsondata["rows"][0]["平均流量"]);
  153. $("#agv2").countTo();
  154. $("#sum2").attr('data-to', jsondata["rows"][0]["累计流量"]);
  155. $("#sum2").countTo();
  156. }
  157. });
  158. ////机器人1=========================================
  159. //window.Robot1.data.datasets[0].data = [
  160. // 50,
  161. // 50,
  162. // 50,
  163. // 50,
  164. // 50,
  165. // 50,
  166. // 50
  167. //];
  168. //window.Robot1.data.datasets[1].data = [
  169. // randomScalingFactor(200) + 110,
  170. // randomScalingFactor(200) + 110,
  171. // randomScalingFactor(200) + 110,
  172. // randomScalingFactor(200) + 110,
  173. // randomScalingFactor(200) + 110,
  174. // randomScalingFactor(200) + 110,
  175. // randomScalingFactor(200) + 110
  176. //];
  177. //window.Robot1.data.datasets[2].data = [
  178. // 350,
  179. // 350,
  180. // 350,
  181. // 350,
  182. // 350,
  183. // 350,
  184. // 350
  185. //];
  186. //window.Robot1.update();
  187. ////===================================================
  188. ////机器人2=========================================
  189. //window.Robot2.data.datasets[0].data = [
  190. // 50,
  191. // 50,
  192. // 50,
  193. // 50,
  194. // 50,
  195. // 50,
  196. // 50
  197. //];
  198. //window.Robot2.data.datasets[1].data = [
  199. // randomScalingFactor(200) + 110,
  200. // randomScalingFactor(200) + 110,
  201. // randomScalingFactor(200) + 110,
  202. // randomScalingFactor(200) + 110,
  203. // randomScalingFactor(200) + 110,
  204. // randomScalingFactor(200) + 110,
  205. // randomScalingFactor(200) + 110
  206. //];
  207. //window.Robot2.data.datasets[2].data = [
  208. // 350,
  209. // 350,
  210. // 350,
  211. // 350,
  212. // 350,
  213. // 350,
  214. // 350
  215. //];
  216. //window.Robot2.update();
  217. ////===================================================
  218. }
  219. function initData() {
  220. window.chartColors = {
  221. red: 'rgb(255, 99, 132)',
  222. orange: 'rgb(255, 159, 64)',
  223. yellow: 'rgb(255, 250, 86)',
  224. green: 'rgb(75, 192, 192)',
  225. blue: 'rgb(54, 162, 250)',
  226. purple: 'rgb(153, 102, 255)',
  227. grey: 'rgb(231,233,237)'
  228. };
  229. var color = Chart.helpers.color;
  230. window.randomScalingFactor = function (num) {
  231. return Math.round(Math.random() * num);
  232. }
  233. Chart.defaults.global.defaultFontColor = 'white';
  234. Chart.defaults.global.defaultFontSize = 24;
  235. Chart.defaults.global.legend.display = false;
  236. //机器人1===========================================
  237. window.configRobot1 = {
  238. data: {
  239. labels: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23'],
  240. datasets: [{
  241. label: '最低预警线',
  242. backgroundColor: color(window.chartColors.orange).alpha(0.6).rgbString(),
  243. fill: false,
  244. borderColor: window.chartColors.orange,
  245. borderWidth: 2,
  246. pointRadius: 10,
  247. data: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
  248. },
  249. {
  250. label: '施釉机器人(1号)',
  251. backgroundColor: color(window.chartColors.blue).alpha(0.6).rgbString(),
  252. fill: false,
  253. borderColor: window.chartColors.blue,
  254. borderWidth: 2,
  255. pointRadius: 15,
  256. data: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
  257. },
  258. {
  259. label: '最高预警线',
  260. backgroundColor: color(window.chartColors.red).alpha(0.6).rgbString(),
  261. fill: false,
  262. borderColor: window.chartColors.red,
  263. borderWidth: 2,
  264. pointRadius: 10,
  265. data: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
  266. }
  267. ]
  268. },
  269. type: 'line',
  270. options: {
  271. legend: {
  272. display: true
  273. },
  274. title: {
  275. display: true,
  276. text: "施釉机器人(1号)流量统计"
  277. },
  278. tooltips: {
  279. mode: 'point',
  280. intersect: false
  281. },
  282. responsive: true,
  283. scales: {
  284. xAxes: [{
  285. stacked: false
  286. }],
  287. yAxes: [{
  288. display: true,
  289. stacked: false,
  290. ticks: {
  291. min: 1.0,
  292. stepSize: 0.1,
  293. max: 1.8
  294. }
  295. }]
  296. }
  297. }
  298. };
  299. var ctxRobot1 = document.getElementById("canvasRobot1").getContext("2d");
  300. window.Robot1 = new Chart(ctxRobot1, configRobot1);
  301. //===================================================
  302. //机器人2===========================================
  303. window.configRobot2 = {
  304. data: {
  305. labels: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23'],
  306. datasets: [{
  307. label: '最低预警线',
  308. backgroundColor: color(window.chartColors.orange).alpha(0.6).rgbString(),
  309. fill: false,
  310. borderColor: window.chartColors.orange,
  311. borderWidth: 2,
  312. pointRadius: 10,
  313. data: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
  314. },
  315. {
  316. label: '施釉机器人(2号)',
  317. backgroundColor: color(window.chartColors.blue).alpha(0.6).rgbString(),
  318. fill: false,
  319. borderColor: window.chartColors.blue,
  320. borderWidth: 2,
  321. pointRadius: 15,
  322. data: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
  323. },
  324. {
  325. label: '最高预警线',
  326. backgroundColor: color(window.chartColors.red).alpha(0.6).rgbString(),
  327. fill: false,
  328. borderColor: window.chartColors.red,
  329. borderWidth: 2,
  330. pointRadius: 10,
  331. data: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
  332. }
  333. ]
  334. },
  335. type: 'line',
  336. options: {
  337. legend: {
  338. display: true
  339. },
  340. title: {
  341. display: true,
  342. text: "施釉机器人(2号)流量统计"
  343. },
  344. tooltips: {
  345. mode: 'point',
  346. intersect: false
  347. },
  348. responsive: true,
  349. scales: {
  350. xAxes: [{
  351. stacked: false
  352. }],
  353. yAxes: [{
  354. display: true,
  355. stacked: false,
  356. ticks: {
  357. min: 1.0,
  358. stepSize: 0.1,
  359. max: 1.8
  360. }
  361. }]
  362. }
  363. }
  364. };
  365. var ctxRobot2 = document.getElementById("canvasRobot2").getContext("2d");
  366. window.Robot2 = new Chart(ctxRobot2, configRobot2);
  367. //===================================================
  368. }
  369. </script>
  370. <script src="/Plugins/chartjs-2.8.0/chart-2.8.min.js"></script>
  371. <!--<script src="/Plugins/chartjs-2.8.0/chartjs-plugin-datalabels.js"></script>-->
  372. <script src="/Plugins/chartjs-2.8.0/utils.js"></script>
  373. <script src="/Plugins/circleChart/circleChart.min.js"></script>
  374. </body>
  375. </html>