index2.html 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490
  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. <title>东科软件</title>
  12. </head>
  13. <body style="background-color:black;">
  14. <div class="box_1920_1080">
  15. <div class="box_title" onclick="showHelp()" style="cursor:pointer">
  16. 烘干房&nbsp;&nbsp;<span class="box_title_arrow">>>></span><span class="box_title_loading" id="报表加载"></span>
  17. </div>
  18. <div class="box_body" style="display: flex; flex-direction: column;">
  19. <div style="width:1840px;height:480px;display:flex;flex-direction:row;">
  20. <div style="width: 50%;height:480px;">
  21. <!--烘干房(1号)-->
  22. <canvas id="canvasDry1" style="-moz-user-select: none;-webkit-user-select: none;-ms-user-select: none; height:480px;width:100%"></canvas>
  23. </div>
  24. <div style="width: 50%; height: 480px; padding-left:20px;">
  25. <!--烘干房(2号)-->
  26. <canvas id="canvasDry2" style="-moz-user-select: none;-webkit-user-select: none;-ms-user-select: none; height:480px;width:100%"></canvas>
  27. </div>
  28. </div>
  29. <div style="width:1840px;height:480px;display:flex;flex-direction:row;">
  30. <div style="width: 50%;height:480px;">
  31. <!--烘干房(3号)-->
  32. <canvas id="canvasDry3" style="-moz-user-select: none;-webkit-user-select: none;-ms-user-select: none; height:480px;width:100%"></canvas>
  33. </div>
  34. <div style="width: 50%; height: 480px; ">
  35. <!--烘干房(4号)-->
  36. <canvas id="canvasDry4" style="-moz-user-select: none;-webkit-user-select: none;-ms-user-select: none; height:480px;width:100%"></canvas>
  37. </div>
  38. </div>
  39. </div>
  40. </div>
  41. <script>
  42. //缺陷统计刷新时间
  43. var refreshTime1 = 120000;
  44. var currentTime1 = 0;
  45. var doGetData;
  46. var doGetTime;
  47. var frameHeight;
  48. var tableHeight;
  49. var offsetHeight = 20;
  50. $(document).ready(function () {
  51. initData();
  52. doGetData = setInterval(function () { timeUpdate(); }, 1000);
  53. });
  54. //帮助说明
  55. function showHelp() {
  56. var message = "统计说明:" + "\n";
  57. message += "这是文字说明这是文字说明这是文字说明这是文字说明这是文字说明这是文字说明这是文字说明" + "\n";
  58. message += "这是文字说明这是文字说明这是文字说明这是文字说明这是文字说明这是文字说明这是文字说明" + "\n";
  59. message += "这是文字说明这是文字说明这是文字说明这是文字说明这是文字说明这是文字说明这是文字说明" + "\n";
  60. alert(message);
  61. }
  62. function timeUpdate() {
  63. if (currentTime1 <= 0) {
  64. //clearData();
  65. setTimeout(loadData(), 10000);
  66. //loadData();
  67. currentTime1 = refreshTime1;
  68. }
  69. else {
  70. if (currentTime1 > 0) {
  71. $('#报表加载').html('刷新:' + currentTime1 / 1000 + ' 秒');
  72. currentTime1 = currentTime1 - 1000;
  73. }
  74. }
  75. }
  76. function clearData() {
  77. //清除数据
  78. //window.Dry1.data.labels = [];
  79. window.Dry1.data.datasets[0].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];
  80. window.Dry1.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];
  81. //window.Dry1.optins.title.text = "";
  82. window.Dry1.update();
  83. //window.Dry2.data.labels = [];
  84. window.Dry2.data.datasets[0].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];
  85. window.Dry2.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];
  86. //window.Dry2.optins.title.text = "";
  87. window.Dry2.update();
  88. //window.Dry3.data.labels = [];
  89. window.Dry3.data.datasets[0].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];
  90. window.Dry3.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];
  91. //window.Dry3.optins.title.text = "";
  92. window.Dry3.update();
  93. //window.Dry4.data.labels = [];
  94. window.Dry4.data.datasets[0].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];
  95. window.Dry4.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];
  96. //window.Dry4.optins.title.text = "";
  97. window.Dry4.update();
  98. }
  99. function loadData() {
  100. $.get("rpt.ashx?m=master", function (data) {
  101. var jsondata = JSON.parse(data);
  102. if (jsondata["success"] == true) {
  103. for (var i = 1; i < jsondata["total"]; i++) {
  104. window.Dry1.data.datasets[0].data[i] = jsondata["rows"][i]["WD1"];
  105. window.Dry1.data.datasets[1].data[i] = jsondata["rows"][i]["SD1"];
  106. window.Dry1.data.datasets[2].data[i] = jsondata["rows"][i]["WD1_SD"];
  107. window.Dry1.data.datasets[3].data[i] = jsondata["rows"][i]["SD1_SD"];
  108. window.Dry2.data.datasets[0].data[i] = jsondata["rows"][i]["WD2"];
  109. window.Dry2.data.datasets[1].data[i] = jsondata["rows"][i]["SD2"];
  110. window.Dry2.data.datasets[2].data[i] = jsondata["rows"][i]["WD2_SD"];
  111. window.Dry2.data.datasets[3].data[i] = jsondata["rows"][i]["SD2_SD"];
  112. window.Dry3.data.datasets[0].data[i] = jsondata["rows"][i]["WD3"];
  113. window.Dry3.data.datasets[1].data[i] = jsondata["rows"][i]["SD3"];
  114. window.Dry3.data.datasets[2].data[i] = jsondata["rows"][i]["WD3_SD"];
  115. window.Dry3.data.datasets[3].data[i] = jsondata["rows"][i]["SD3_SD"];
  116. window.Dry4.data.datasets[0].data[i] = jsondata["rows"][i]["WD4"];
  117. window.Dry4.data.datasets[1].data[i] = jsondata["rows"][i]["SD4"];
  118. window.Dry4.data.datasets[2].data[i] = jsondata["rows"][i]["WD4_SD"];
  119. window.Dry4.data.datasets[3].data[i] = jsondata["rows"][i]["SD4_SD"];
  120. }
  121. //清除未发生的数据===================================
  122. var myDate = new Date();
  123. for (var j = myDate.getHours() + 1; j < 24; j++) {
  124. window.Dry1.data.datasets[0].data[j] = null;
  125. window.Dry1.data.datasets[1].data[j] = null;
  126. window.Dry1.data.datasets[2].data[j] = null;
  127. window.Dry1.data.datasets[3].data[j] = null;
  128. window.Dry2.data.datasets[0].data[j] = null;
  129. window.Dry2.data.datasets[1].data[j] = null;
  130. window.Dry2.data.datasets[2].data[j] = null;
  131. window.Dry2.data.datasets[3].data[j] = null;
  132. window.Dry3.data.datasets[0].data[j] = null;
  133. window.Dry3.data.datasets[1].data[j] = null;
  134. window.Dry3.data.datasets[2].data[j] = null;
  135. window.Dry3.data.datasets[3].data[j] = null;
  136. window.Dry4.data.datasets[0].data[j] = null;
  137. window.Dry4.data.datasets[1].data[j] = null;
  138. window.Dry4.data.datasets[2].data[j] = null;
  139. window.Dry4.data.datasets[3].data[j] = null;
  140. }
  141. //===================================================
  142. window.Dry1.update();
  143. window.Dry2.update();
  144. window.Dry3.update();
  145. window.Dry4.update();
  146. }
  147. });
  148. }
  149. function initData() {
  150. window.chartColors = {
  151. red: 'rgb(255, 99, 132)',
  152. orange: 'rgb(255, 159, 64)',
  153. yellow: 'rgb(255, 250, 86)',
  154. green: 'rgb(75, 192, 192)',
  155. blue: 'rgb(54, 162, 250)',
  156. purple: 'rgb(153, 102, 255)',
  157. grey: 'rgb(231,233,237)'
  158. };
  159. var color = Chart.helpers.color;
  160. window.randomScalingFactor = function (num) {
  161. return Math.round(Math.random() * num);
  162. }
  163. Chart.defaults.global.defaultFontColor = 'white';
  164. Chart.defaults.global.defaultFontSize = 24;
  165. Chart.defaults.global.legend.display = false;
  166. //烘干房1===========================================
  167. window.configDry1 = {
  168. data: {
  169. 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'],
  170. datasets: [{
  171. label: '温度',
  172. backgroundColor: color(window.chartColors.blue).alpha(0.6).rgbString(),
  173. fill: false,
  174. borderColor: window.chartColors.blue,
  175. borderWidth: 2,
  176. pointRadius: 10,
  177. data: []
  178. }, {
  179. label: '湿度',
  180. backgroundColor: color(window.chartColors.green).alpha(0.6).rgbString(),
  181. fill: false,
  182. borderColor: window.chartColors.green,
  183. borderWidth: 2,
  184. pointRadius: 10,
  185. data: []
  186. }, {
  187. label: '设定温度',
  188. backgroundColor: color(window.chartColors.red).alpha(0.6).rgbString(),
  189. fill: false,
  190. borderColor: window.chartColors.red,
  191. borderWidth: 2,
  192. pointRadius: 10,
  193. data: []
  194. }, {
  195. label: '设定湿度',
  196. backgroundColor: color(window.chartColors.yellow).alpha(0.6).rgbString(),
  197. fill: false,
  198. borderColor: window.chartColors.yellow,
  199. borderWidth: 2,
  200. pointRadius: 10,
  201. data: []
  202. }]
  203. },
  204. type: 'line',
  205. options: {
  206. legend: {
  207. display: true
  208. },
  209. title: {
  210. display: true,
  211. text: "烘干房(1号)当日温湿度曲线图(每小时)"
  212. },
  213. tooltips: {
  214. mode: 'point',
  215. intersect: false
  216. },
  217. responsive: true,
  218. scales: {
  219. xAxes: [{
  220. stacked: false
  221. }],
  222. yAxes: [{
  223. display: true,
  224. stacked: false,
  225. ticks: {
  226. min: 0,
  227. stepSize: 10,
  228. max: 100
  229. }
  230. }]
  231. }
  232. }
  233. };
  234. var ctxDry1 = document.getElementById("canvasDry1").getContext("2d");
  235. window.Dry1 = new Chart(ctxDry1, configDry1);
  236. //===================================================
  237. //烘干房2===========================================
  238. window.configDry2 = {
  239. data: {
  240. 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'],
  241. datasets: [{
  242. label: '温度',
  243. backgroundColor: color(window.chartColors.blue).alpha(0.6).rgbString(),
  244. fill: false,
  245. borderColor: window.chartColors.blue,
  246. borderWidth: 2,
  247. pointRadius: 10,
  248. data: []
  249. }, {
  250. label: '湿度',
  251. backgroundColor: color(window.chartColors.green).alpha(0.6).rgbString(),
  252. fill: false,
  253. borderColor: window.chartColors.green,
  254. borderWidth: 2,
  255. pointRadius: 10,
  256. data: []
  257. }, {
  258. label: '设定温度',
  259. backgroundColor: color(window.chartColors.red).alpha(0.6).rgbString(),
  260. fill: false,
  261. borderColor: window.chartColors.red,
  262. borderWidth: 2,
  263. pointRadius: 10,
  264. data: []
  265. }, {
  266. label: '设定湿度',
  267. backgroundColor: color(window.chartColors.yellow).alpha(0.6).rgbString(),
  268. fill: false,
  269. borderColor: window.chartColors.yellow,
  270. borderWidth: 2,
  271. pointRadius: 10,
  272. data: []
  273. }]
  274. },
  275. type: 'line',
  276. options: {
  277. legend: {
  278. display: true
  279. },
  280. title: {
  281. display: true,
  282. text: "烘干房(2号)当日温湿度曲线图(每小时)"
  283. },
  284. tooltips: {
  285. mode: 'point',
  286. intersect: false
  287. },
  288. responsive: true,
  289. scales: {
  290. xAxes: [{
  291. stacked: false
  292. }],
  293. yAxes: [{
  294. display: true,
  295. stacked: false,
  296. ticks: {
  297. min: 0,
  298. stepSize: 10,
  299. max: 100
  300. }
  301. }]
  302. }
  303. }
  304. };
  305. var ctxDry2 = document.getElementById("canvasDry2").getContext("2d");
  306. window.Dry2 = new Chart(ctxDry2, configDry2);
  307. //===================================================
  308. //烘干房1===========================================
  309. window.configDry3 = {
  310. data: {
  311. 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'],
  312. datasets: [{
  313. label: '温度',
  314. backgroundColor: color(window.chartColors.blue).alpha(0.6).rgbString(),
  315. fill: false,
  316. borderColor: window.chartColors.blue,
  317. borderWidth: 2,
  318. pointRadius: 10,
  319. data: []
  320. }, {
  321. label: '湿度',
  322. backgroundColor: color(window.chartColors.green).alpha(0.6).rgbString(),
  323. fill: false,
  324. borderColor: window.chartColors.green,
  325. borderWidth: 2,
  326. pointRadius: 10,
  327. data: []
  328. }, {
  329. label: '设定温度',
  330. backgroundColor: color(window.chartColors.red).alpha(0.6).rgbString(),
  331. fill: false,
  332. borderColor: window.chartColors.red,
  333. borderWidth: 2,
  334. pointRadius: 10,
  335. data: []
  336. }, {
  337. label: '设定湿度',
  338. backgroundColor: color(window.chartColors.yellow).alpha(0.6).rgbString(),
  339. fill: false,
  340. borderColor: window.chartColors.yellow,
  341. borderWidth: 2,
  342. pointRadius: 10,
  343. data: []
  344. }]
  345. },
  346. type: 'line',
  347. options: {
  348. legend: {
  349. display: true
  350. },
  351. title: {
  352. display: true,
  353. text: "烘干房(3号)当日温湿度曲线图(每小时)"
  354. },
  355. tooltips: {
  356. mode: 'point',
  357. intersect: false
  358. },
  359. responsive: true,
  360. scales: {
  361. xAxes: [{
  362. stacked: false
  363. }],
  364. yAxes: [{
  365. display: true,
  366. stacked: false,
  367. ticks: {
  368. min: 0,
  369. stepSize: 10,
  370. max: 100
  371. }
  372. }]
  373. }
  374. }
  375. };
  376. var ctxDry3 = document.getElementById("canvasDry3").getContext("2d");
  377. window.Dry3 = new Chart(ctxDry3, configDry3);
  378. //===================================================
  379. //烘干房4===========================================
  380. window.configDry4 = {
  381. data: {
  382. 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'],
  383. datasets: [{
  384. label: '温度',
  385. backgroundColor: color(window.chartColors.blue).alpha(0.6).rgbString(),
  386. fill: false,
  387. borderColor: window.chartColors.blue,
  388. borderWidth: 2,
  389. pointRadius: 10,
  390. data: []
  391. }, {
  392. label: '湿度',
  393. backgroundColor: color(window.chartColors.green).alpha(0.6).rgbString(),
  394. fill: false,
  395. borderColor: window.chartColors.green,
  396. borderWidth: 2,
  397. pointRadius: 10,
  398. data: []
  399. }, {
  400. label: '设定温度',
  401. backgroundColor: color(window.chartColors.red).alpha(0.6).rgbString(),
  402. fill: false,
  403. borderColor: window.chartColors.red,
  404. borderWidth: 2,
  405. pointRadius: 10,
  406. data: []
  407. }, {
  408. label: '设定湿度',
  409. backgroundColor: color(window.chartColors.yellow).alpha(0.6).rgbString(),
  410. fill: false,
  411. borderColor: window.chartColors.yellow,
  412. borderWidth: 2,
  413. pointRadius: 10,
  414. data: []
  415. }]
  416. },
  417. type: 'line',
  418. options: {
  419. legend: {
  420. display: true
  421. },
  422. title: {
  423. display: true,
  424. text: "烘干房(4号)当日温湿度曲线图(每小时)"
  425. },
  426. tooltips: {
  427. mode: 'point',
  428. intersect: false
  429. },
  430. responsive: true,
  431. scales: {
  432. xAxes: [{
  433. stacked: false
  434. }],
  435. yAxes: [{
  436. display: true,
  437. stacked: false,
  438. ticks: {
  439. min: 0,
  440. stepSize: 10,
  441. max: 100
  442. }
  443. }]
  444. }
  445. }
  446. };
  447. var ctxDry4 = document.getElementById("canvasDry4").getContext("2d");
  448. window.Dry4 = new Chart(ctxDry4, configDry4);
  449. //===================================================
  450. }
  451. </script>
  452. <script src="/Plugins/chartjs-2.8.0/chart-2.8.min.js"></script>
  453. <!--<script src="/Plugins/chartjs-2.8.0/chartjs-plugin-datalabels.js"></script>-->
  454. <script src="/Plugins/chartjs-2.8.0/utils.js"></script>
  455. <script src="/Plugins/circleChart/circleChart.min.js"></script>
  456. </body>
  457. </html>