demo.html 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410
  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/animate/xanimate.js"></script>
  12. <script src="/Plugins/xrequest/xrequest.min.js"></script>
  13. <title>东科软件</title>
  14. </head>
  15. <body style="background-color:black;">
  16. <div class="box_1920_1080">
  17. <div class="box_title" style="display:flex;flex-direction:row;">
  18. <div style="width:30%;text-align:left;"></div>
  19. <div style="width:40%;text-align:center;">包装工序看板</div>
  20. <div style="width:30%;text-align:right;"></div>
  21. </div>
  22. <div class="box_body" style="display: flex; flex-direction: column;">
  23. <!--31天产量曲线图-->
  24. <div style="width:1840px;height:400px;display:flex;flex-direction:row;">
  25. <div style="width: 100%; height: 400px;">
  26. <div style="color:white;font-size:20px;font-weight:600; text-align:center">每日产量计划达成</div>
  27. <canvas id="canvasDayCL" style="-moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; height: 350px; width: 100%"></canvas>
  28. </div>
  29. </div>
  30. <!--表格-->
  31. <div style="width:1840px;height:530px;display:flex;flex-direction:row;">
  32. <div style="width: 50%;height:530px;padding-right:20px;">
  33. <table cellspacing="0" cellpadding="0" border="0" style="width:100%;">
  34. <tr class="tr_title_warning">
  35. <td colspan="9" style="color:white;">每日型号达成情况</td>
  36. </tr>
  37. <tr class="tr_title_warning">
  38. <td>产品型号</td>
  39. <td>计划数量</td>
  40. <td>达成数量</td>
  41. <td>达成率</td>
  42. </tr>
  43. <tr class="tr_bg_light_warning" style="height:30px;">
  44. <td style="font-size: 18px; width: 11%">H0966L-W</td>
  45. <td style="font-size: 18px; width: 11%">1314</td>
  46. <td style="font-size: 18px; width: 11%">1169</td>
  47. <td style="font-size: 18px; width: 11%">80%</td>
  48. </tr>
  49. <tr class="tr_bg_light_warning" style="height:30px;">
  50. <td style="font-size: 18px; width: 11%">H0966L-W</td>
  51. <td style="font-size: 18px; width: 11%">1314</td>
  52. <td style="font-size: 18px; width: 11%">1169</td>
  53. <td style="font-size: 18px; width: 11%">80%</td>
  54. </tr>
  55. <tr class="tr_bg_light_warning" style="height:30px;">
  56. <td style="font-size: 18px; width: 11%">H0966L-W</td>
  57. <td style="font-size: 18px; width: 11%">1314</td>
  58. <td style="font-size: 18px; width: 11%">1169</td>
  59. <td style="font-size: 18px; width: 11%">80%</td>
  60. </tr>
  61. <tr class="tr_bg_light_warning" style="height:30px;">
  62. <td style="font-size: 18px; width: 11%">H0966L-W</td>
  63. <td style="font-size: 18px; width: 11%">1314</td>
  64. <td style="font-size: 18px; width: 11%">1169</td>
  65. <td style="font-size: 18px; width: 11%">80%</td>
  66. </tr>
  67. <tr class="tr_bg_light_warning" style="height:30px;">
  68. <td style="font-size: 18px; width: 11%">H0966L-W</td>
  69. <td style="font-size: 18px; width: 11%">1314</td>
  70. <td style="font-size: 18px; width: 11%">1169</td>
  71. <td style="font-size: 18px; width: 11%">80%</td>
  72. </tr>
  73. <tr class="tr_bg_light_warning" style="height:30px;">
  74. <td style="font-size: 18px; width: 11%">H0966L-W</td>
  75. <td style="font-size: 18px; width: 11%">1314</td>
  76. <td style="font-size: 18px; width: 11%">1169</td>
  77. <td style="font-size: 18px; width: 11%">80%</td>
  78. </tr>
  79. <tr class="tr_bg_light_warning" style="height:30px;">
  80. <td style="font-size: 18px; width: 11%">H0966L-W</td>
  81. <td style="font-size: 18px; width: 11%">1314</td>
  82. <td style="font-size: 18px; width: 11%">1169</td>
  83. <td style="font-size: 18px; width: 11%">80%</td>
  84. </tr>
  85. <tr class="tr_bg_light_warning" style="height:30px;">
  86. <td style="font-size: 18px; width: 11%">H0966L-W</td>
  87. <td style="font-size: 18px; width: 11%">1314</td>
  88. <td style="font-size: 18px; width: 11%">1169</td>
  89. <td style="font-size: 18px; width: 11%">80%</td>
  90. </tr>
  91. <tr class="tr_bg_light_warning" style="height:30px;">
  92. <td style="font-size: 18px; width: 11%">H0966L-W</td>
  93. <td style="font-size: 18px; width: 11%">1314</td>
  94. <td style="font-size: 18px; width: 11%">1169</td>
  95. <td style="font-size: 18px; width: 11%">80%</td>
  96. </tr>
  97. </table>
  98. </div>
  99. <div style="width: 50%;height:530px;padding-right:20px;">
  100. <table cellspacing="0" cellpadding="0" border="0" style="width:100%;">
  101. <tr class="tr_title_warning">
  102. <td colspan="9" style="color:white;">每月型号达成情况</td>
  103. </tr>
  104. <tr class="tr_title_warning">
  105. <td>产品型号</td>
  106. <td>计划数量</td>
  107. <td>达成数量</td>
  108. <td>达成率</td>
  109. </tr>
  110. <tr class="tr_bg_light_warning" style="height:30px;">
  111. <td style="font-size: 18px; width: 11%">H0966L-W</td>
  112. <td style="font-size: 18px; width: 11%">1314</td>
  113. <td style="font-size: 18px; width: 11%">1169</td>
  114. <td style="font-size: 18px; width: 11%">80%</td>
  115. </tr>
  116. <tr class="tr_bg_light_warning" style="height:30px;">
  117. <td style="font-size: 18px; width: 11%">H0966L-W</td>
  118. <td style="font-size: 18px; width: 11%">1314</td>
  119. <td style="font-size: 18px; width: 11%">1169</td>
  120. <td style="font-size: 18px; width: 11%">80%</td>
  121. </tr>
  122. <tr class="tr_bg_light_warning" style="height:30px;">
  123. <td style="font-size: 18px; width: 11%">H0966L-W</td>
  124. <td style="font-size: 18px; width: 11%">1314</td>
  125. <td style="font-size: 18px; width: 11%">1169</td>
  126. <td style="font-size: 18px; width: 11%">80%</td>
  127. </tr>
  128. <tr class="tr_bg_light_warning" style="height:30px;">
  129. <td style="font-size: 18px; width: 11%">H0966L-W</td>
  130. <td style="font-size: 18px; width: 11%">1314</td>
  131. <td style="font-size: 18px; width: 11%">1169</td>
  132. <td style="font-size: 18px; width: 11%">80%</td>
  133. </tr>
  134. <tr class="tr_bg_light_warning" style="height:30px;">
  135. <td style="font-size: 18px; width: 11%">H0966L-W</td>
  136. <td style="font-size: 18px; width: 11%">1314</td>
  137. <td style="font-size: 18px; width: 11%">1169</td>
  138. <td style="font-size: 18px; width: 11%">80%</td>
  139. </tr>
  140. <tr class="tr_bg_light_warning" style="height:30px;">
  141. <td style="font-size: 18px; width: 11%">H0966L-W</td>
  142. <td style="font-size: 18px; width: 11%">1314</td>
  143. <td style="font-size: 18px; width: 11%">1169</td>
  144. <td style="font-size: 18px; width: 11%">80%</td>
  145. </tr>
  146. <tr class="tr_bg_light_warning" style="height:30px;">
  147. <td style="font-size: 18px; width: 11%">H0966L-W</td>
  148. <td style="font-size: 18px; width: 11%">1314</td>
  149. <td style="font-size: 18px; width: 11%">1169</td>
  150. <td style="font-size: 18px; width: 11%">80%</td>
  151. </tr>
  152. <tr class="tr_bg_light_warning" style="height:30px;">
  153. <td style="font-size: 18px; width: 11%">H0966L-W</td>
  154. <td style="font-size: 18px; width: 11%">1314</td>
  155. <td style="font-size: 18px; width: 11%">1169</td>
  156. <td style="font-size: 18px; width: 11%">80%</td>
  157. </tr>
  158. <tr class="tr_bg_light_warning" style="height:30px;">
  159. <td style="font-size: 18px; width: 11%">H0966L-W</td>
  160. <td style="font-size: 18px; width: 11%">1314</td>
  161. <td style="font-size: 18px; width: 11%">1169</td>
  162. <td style="font-size: 18px; width: 11%">80%</td>
  163. </tr>
  164. </table>
  165. </div>
  166. <!--<div style="width: 25%;height:530px;">
  167. <div style="color:white;font-size:20px;font-weight:600; text-align:center">每月产量计划达成</div>
  168. <canvas id="canvasMonthCL" style="-moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; height: 400px; width: 100%"></canvas>
  169. </div>-->
  170. </div>
  171. </div>
  172. </div>
  173. <script>
  174. $(document).ready(function () {
  175. initData();
  176. doGetData = setInterval(function () { timeUpdate(); }, 2000);
  177. });
  178. function timeUpdate() {
  179. loadData();
  180. }
  181. function loadData() {
  182. //31天产量
  183. window.DayCL.data.datasets[0].data = [
  184. randomScalingFactor(8) + 5,
  185. randomScalingFactor(8) + 5,
  186. randomScalingFactor(8) + 5,
  187. randomScalingFactor(8) + 5,
  188. randomScalingFactor(8) + 5,
  189. randomScalingFactor(8) + 5,
  190. randomScalingFactor(8) + 5,
  191. randomScalingFactor(8) + 5,
  192. randomScalingFactor(8) + 5,
  193. randomScalingFactor(8) + 5,
  194. randomScalingFactor(8) + 5,
  195. randomScalingFactor(8) + 5,
  196. randomScalingFactor(8) + 5,
  197. randomScalingFactor(8) + 5,
  198. randomScalingFactor(8) + 5,
  199. randomScalingFactor(8) + 5,
  200. randomScalingFactor(8) + 5,
  201. randomScalingFactor(8) + 5,
  202. randomScalingFactor(8) + 5,
  203. randomScalingFactor(8) + 5,
  204. randomScalingFactor(8) + 5,
  205. randomScalingFactor(8) + 5,
  206. randomScalingFactor(8) + 5,
  207. randomScalingFactor(8) + 5,
  208. randomScalingFactor(8) + 5,
  209. randomScalingFactor(8) + 5,
  210. randomScalingFactor(8) + 5,
  211. randomScalingFactor(8) + 5,
  212. randomScalingFactor(8) + 5,
  213. randomScalingFactor(8) + 5,
  214. randomScalingFactor(8) + 5
  215. ];
  216. window.DayCL.data.datasets[1].data = [
  217. randomScalingFactor(8),
  218. randomScalingFactor(8),
  219. randomScalingFactor(8),
  220. randomScalingFactor(8),
  221. randomScalingFactor(8),
  222. randomScalingFactor(8),
  223. randomScalingFactor(8),
  224. randomScalingFactor(8),
  225. randomScalingFactor(8),
  226. randomScalingFactor(8),
  227. randomScalingFactor(8),
  228. randomScalingFactor(8),
  229. randomScalingFactor(8),
  230. randomScalingFactor(8),
  231. randomScalingFactor(8),
  232. randomScalingFactor(8),
  233. randomScalingFactor(8),
  234. randomScalingFactor(8),
  235. randomScalingFactor(8),
  236. randomScalingFactor(8),
  237. randomScalingFactor(8),
  238. randomScalingFactor(8),
  239. randomScalingFactor(8),
  240. randomScalingFactor(8),
  241. randomScalingFactor(8),
  242. randomScalingFactor(8),
  243. randomScalingFactor(8),
  244. randomScalingFactor(8),
  245. randomScalingFactor(8),
  246. randomScalingFactor(8),
  247. randomScalingFactor(8)
  248. ];
  249. window.DayCL.update();
  250. //产量计划达成
  251. window.MonthCL.data.datasets[0].data = [
  252. randomScalingFactor(1000),
  253. randomScalingFactor(1000)
  254. ];
  255. window.MonthCL.update();
  256. }
  257. function initData() {
  258. window.chartColors = {
  259. red: 'rgb(255, 99, 132)',
  260. orange: 'rgb(255, 159, 64)',
  261. yellow: 'rgb(255, 250, 86)',
  262. green: 'rgb(75, 192, 192)',
  263. blue: 'rgb(54, 162, 250)',
  264. purple: 'rgb(153, 102, 255)',
  265. grey: 'rgb(231,233,237)'
  266. };
  267. var color = Chart.helpers.color;
  268. window.randomScalingFactor = function (num) {
  269. return Math.round(Math.random() * num);
  270. }
  271. Chart.defaults.global.defaultFontColor = 'white';
  272. Chart.defaults.global.defaultFontSize = 18;
  273. Chart.defaults.global.legend.display = false;
  274. //每小时产量=========================================
  275. window.configDayCL = {
  276. data: {
  277. labels: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31"],
  278. datasets: [{
  279. label: "日计划",
  280. backgroundColor: color(window.chartColors.orange).alpha(0.6).rgbString(),
  281. borderColor: window.chartColors.orange,
  282. borderWidth: 2,
  283. pointRadius: 15,
  284. 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, 0, 0, 0, 0, 0, 0, 0],
  285. fill: false,
  286. }, {
  287. label: "日达成",
  288. fill: false,
  289. backgroundColor: color(window.chartColors.blue).alpha(0.6).rgbString(),
  290. borderColor: window.chartColors.blue,
  291. borderWidth: 2,
  292. pointRadius: 15,
  293. 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, 0, 0, 0, 0, 0, 0, 0]
  294. }]
  295. },
  296. type: 'line',
  297. options: {
  298. responsive: true,
  299. legend: {
  300. display: true
  301. },
  302. title: {
  303. display: false,
  304. text: '每小时产量'
  305. },
  306. tooltips: {
  307. mode: 'index',
  308. intersect: false,
  309. },
  310. hover: {
  311. mode: 'nearest',
  312. intersect: true
  313. },
  314. scales: {
  315. xAxes: [{
  316. display: true,
  317. scaleLabel: {
  318. display: false,
  319. labelString: ''
  320. }
  321. }],
  322. yAxes: [{
  323. display: true,
  324. scaleLabel: {
  325. display: false,
  326. labelString: 'Value'
  327. }
  328. }]
  329. }
  330. }
  331. };
  332. var ctxDayCL = document.getElementById("canvasDayCL").getContext("2d");
  333. window.DayCL = new Chart(ctxDayCL, configDayCL);
  334. //===================================================
  335. ////月饼图===========================================
  336. //window.configMonthCL = {
  337. // data: {
  338. // labels: ['待达成', '月达成'],
  339. // datasets: [{
  340. // label: '工序',
  341. // backgroundColor: [
  342. // color(window.chartColors.red).alpha(0.35).rgbString(),
  343. // color(window.chartColors.blue).alpha(0.35).rgbString(),
  344. // color(window.chartColors.green).alpha(0.35).rgbString(),
  345. // color(window.chartColors.orange).alpha(0.35).rgbString(),
  346. // color(window.chartColors.purple).alpha(0.35).rgbString()
  347. // ],
  348. // fill: false,
  349. // borderColor: [
  350. // window.chartColors.red,
  351. // window.chartColors.blue,
  352. // window.chartColors.green,
  353. // window.chartColors.orange,
  354. // window.chartColors.purple
  355. // ],
  356. // borderWidth: 2,
  357. // pointRadius: 30,
  358. // data: [0, 0]
  359. // }]
  360. // },
  361. // type: 'doughnut',
  362. // options: {
  363. // legend: {
  364. // display: true
  365. // },
  366. // title: {
  367. // display: false,
  368. // text: ""
  369. // },
  370. // tooltips: {
  371. // mode: 'point',
  372. // intersect: false
  373. // },
  374. // responsive: true
  375. // }
  376. //};
  377. //var ctxMonthCL = document.getElementById("canvasMonthCL").getContext("2d");
  378. //window.MonthCL = new Chart(ctxMonthCL, configMonthCL);
  379. ////===================================================
  380. }
  381. </script>
  382. <script src="/Plugins/chartjs-2.8.0/chart-2.8.min.js"></script>
  383. <script src="/Plugins/chartjs-2.8.0/chartjs-plugin-datalabels.js"></script>
  384. <script src="/Plugins/chartjs-2.8.0/utils.js"></script>
  385. <script src="/Plugins/circleChart/circleChart.min.js"></script>
  386. </body>
  387. </html>