dapingmu.html 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523
  1. <!DOCTYPE html>
  2. <html style="height: 100%">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=Edge">
  6. <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
  7. <title>流水线管理页</title>
  8. <!-- Favicon-->
  9. <link rel="icon" href="favicon.ico" type="image/x-icon">
  10. <!-- Google Fonts -->
  11. <link href="https://fonts.googleapis.com/css?family=Roboto:400,700&subset=latin,cyrillic-ext" rel="stylesheet" type="text/css">
  12. <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" type="text/css">
  13. <!-- Bootstrap Core Css -->
  14. <link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
  15. <!-- Waves Effect Css -->
  16. <link href="plugins/node-waves/waves.css" rel="stylesheet" />
  17. <!-- Animation Css -->
  18. <link href="plugins/animate-css/animate.css" rel="stylesheet" />
  19. <!-- Morris Chart Css-->
  20. <link href="plugins/morrisjs/morris.css" rel="stylesheet" />
  21. <!-- Custom Css -->
  22. <link href="css/style.css" rel="stylesheet">
  23. <!-- AdminBSB Themes. You can choose a theme from css/themes instead of get all themes -->
  24. <link href="css/themes/all-themes.css" rel="stylesheet" />
  25. <script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
  26. <script src="https://cdn.bootcss.com/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
  27. <script src="https://cdn.bootcss.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
  28. <link rel="icon" href="https://static.jianshukeji.com/highcharts/images/favicon.ico">
  29. <meta name="viewport" content="width=device-width, initial-scale=1">
  30. <style>
  31. /* css 代码 */
  32. </style>
  33. <script src="https://img.hcharts.cn/highcharts/highcharts.js"></script>
  34. <script src="https://img.hcharts.cn/highcharts/modules/exporting.js"></script>
  35. <script src="https://img.hcharts.cn/highcharts-plugins/highcharts-zh_CN.js"></script>
  36. <script language="JavaScript">
  37. function startTime()
  38. {
  39. var today=new Date();//定义日期对象
  40. var yyyy = today.getFullYear();//通过日期对象的getFullYear()方法返回年
  41. var MM = today.getMonth()+1;//通过日期对象的getMonth()方法返回年
  42. var dd = today.getDate();//通过日期对象的getDate()方法返回年
  43. var hh=today.getHours();//通过日期对象的getHours方法返回小时
  44. var mm=today.getMinutes();//通过日期对象的getMinutes方法返回分钟
  45. var ss=today.getSeconds();//通过日期对象的getSeconds方法返回秒
  46. // 如果分钟或小时的值小于10,则在其值前加0,比如如果时间是下午3点20分9秒的话,则显示15:20:09
  47. MM=checkTime(MM);
  48. dd=checkTime(dd);
  49. mm=checkTime(mm);
  50. ss=checkTime(ss);
  51. var day; //用于保存星期(getDay()方法得到星期编号)
  52. if(today.getDay()==0) day = "星期日 "
  53. if(today.getDay()==1) day = "星期一 "
  54. if(today.getDay()==2) day = "星期二 "
  55. if(today.getDay()==3) day = "星期三 "
  56. if(today.getDay()==4) day = "星期四 "
  57. if(today.getDay()==5) day = "星期五 "
  58. if(today.getDay()==6) day = "星期六 "
  59. document.getElementById('nowDateTimeSpan').innerHTML=yyyy+"-"+MM +"-"+ dd +" " + day+" " + hh+":"+mm+":"+ss;
  60. setTimeout('startTime()',1000);//每一秒中重新加载startTime()方法
  61. }
  62. function checkTime(i)
  63. {
  64. if (i<10){
  65. i="0" + i;
  66. }
  67. return i;
  68. }
  69. </script>
  70. </head>
  71. <body class="theme-red" style="height: 100%;background-color: #17253f !important;" onload="startTime()">
  72. <section class="content" style="margin: 0 auto;height: 100%">
  73. <nav class="navbar" style="background-color: red">
  74. <div class="container-fluid">
  75. <div class="navbar-header">
  76. <a class="navbar-brand" href="index.html">工厂产能监控系统</a>
  77. </div>
  78. <div style="color: #ffffff"><img src="images/logo.jpg" style="width: 10%"> 深圳市度彼电子有限公司——</div>
  79. <font color="#ffffff"><span id="nowDateTimeSpan"></span></font>
  80. </div>
  81. </nav>
  82. <!-- #END# CPU Usage -->
  83. <section style="margin-top: 100px;color: #ffffff" >
  84. <div style="width: 38%;float: left">
  85. <div class="text-center">全厂产能统计</div>
  86. <table class="table table-bordered text-center" style="color: #ffffff">
  87. <thead>
  88. <tr>
  89. <th scope="col">时间</th>
  90. <th scope="col">良品数</th>
  91. <th scope="col">不良品数</th>
  92. <th scope="col">堆积数</th>
  93. <th scope="col">不良率</th>
  94. </tr>
  95. </thead>
  96. <tbody id="rank-one">
  97. </tbody>
  98. </table>
  99. </div>
  100. <div style="width: 60%;float: right">
  101. <div class="text-center">本厂今日生产能手榜</div>
  102. <table class="table table-bordered text-center" style="color: #ffffff;width: 50%;float: left" >
  103. <thead>
  104. <tr >
  105. <th scope="col" colspan="4">红榜</th>
  106. </tr>
  107. <tr >
  108. <th >人员</th>
  109. <th >良品数</th>
  110. <th >人员</th>
  111. <th >不良率</th>
  112. </tr>
  113. </thead>
  114. <tbody id="rank-two">
  115. <tr>
  116. <th scope="row">1</th>
  117. <td>Mark</td>
  118. <td>Otto</td>
  119. <td>@mdo</td>
  120. </tr>
  121. <tr>
  122. <th scope="row">2</th>
  123. <td>Jacob</td>
  124. <td>Thornton</td>
  125. <td>@fat</td>
  126. </tr>
  127. <tr>
  128. <th scope="row">2</th>
  129. <td>Jacob</td>
  130. <td>Thornton</td>
  131. <td>@fat</td>
  132. </tr>
  133. <tr>
  134. <th scope="row">3</th>
  135. <td>Larry</td>
  136. <td>the Bird</td>
  137. <td>@twitter</td>
  138. </tr>
  139. </tbody>
  140. </table>
  141. <table class="table table-bordered text-center" style="color: #ffffff;width: 50%;float: right" >
  142. <thead>
  143. <tr >
  144. <th scope="col" colspan="4">黑榜</th>
  145. </tr>
  146. <tr >
  147. <th >人员</th>
  148. <th >良品数</th>
  149. <th >人员</th>
  150. <th >不良率</th>
  151. </tr>
  152. </thead>
  153. <tbody id="rank-three">
  154. <tr>
  155. <th scope="row">1</th>
  156. <td>Mark</td>
  157. <td>Otto</td>
  158. <td>@mdo</td>
  159. </tr>
  160. <tr>
  161. <th scope="row">2</th>
  162. <td>Jacob</td>
  163. <td>Thornton</td>
  164. <td>@fat</td>
  165. </tr>
  166. <tr>
  167. <th scope="row">2</th>
  168. <td>Jacob</td>
  169. <td>Thornton</td>
  170. <td>@fat</td>
  171. </tr>
  172. <tr>
  173. <th scope="row">3</th>
  174. <td>Larry</td>
  175. <td>the Bird</td>
  176. <td>@twitter</td>
  177. </tr>
  178. </tbody>
  179. </table>
  180. </div>
  181. </section>
  182. <section style="margin-top: 5em" >
  183. <div id="graph-1" ></div>
  184. <div class="row" style="height: 6em"></div>
  185. <div id="graph-2" ></div>
  186. </section>
  187. </section>
  188. <!-- Jquery Core Js -->
  189. <script src="plugins/jquery/jquery.min.js"></script>
  190. <!-- Bootstrap Core Js -->
  191. <script src="plugins/bootstrap/js/bootstrap.js"></script>
  192. <!-- Select Plugin Js -->
  193. <script src="plugins/bootstrap-select/js/bootstrap-select.js"></script>
  194. <!-- Slimscroll Plugin Js -->
  195. <script src="plugins/jquery-slimscroll/jquery.slimscroll.js"></script>
  196. <!-- Waves Effect Plugin Js -->
  197. <script src="plugins/node-waves/waves.js"></script>
  198. <!-- Jquery CountTo Plugin Js -->
  199. <script src="plugins/jquery-countto/jquery.countTo.js"></script>
  200. <!-- Morris Plugin Js -->
  201. <script src="plugins/raphael/raphael.min.js"></script>
  202. <script src="plugins/morrisjs/morris.js"></script>
  203. <!-- ChartJs -->
  204. <script src="plugins/chartjs/Chart.bundle.js"></script>
  205. <!-- Flot Charts Plugin Js -->
  206. <script src="plugins/flot-charts/jquery.flot.js"></script>
  207. <script src="plugins/flot-charts/jquery.flot.resize.js"></script>
  208. <script src="plugins/flot-charts/jquery.flot.pie.js"></script>
  209. <script src="plugins/flot-charts/jquery.flot.categories.js"></script>
  210. <script src="plugins/flot-charts/jquery.flot.time.js"></script>
  211. <!-- Sparkline Chart Plugin Js -->
  212. <script src="plugins/jquery-sparkline/jquery.sparkline.js"></script>
  213. <script src="js/admin.js"></script>
  214. <!--<script src="js/pages/index.js"></script>-->
  215. <!-- Demo Js -->
  216. <script src="js/demo.js"></script>
  217. <!--<script src="js/demo.js"></script> -->
  218. <script src="js/basic1.js"></script>
  219. <script>
  220. var timeday=new Array("今日" ,"昨日" ,"本周" ,"本月");
  221. function getSpotHtml(htmlbody, i) {
  222. htmlbody += "<tr>";
  223. htmlbody += `<tr>
  224. <td>${timeday[i]}</td>
  225. <td>${hispass[i]}</td>
  226. <td>${hisfail[i]}</td>
  227. <td>${hisstack[i]}</td>
  228. <td>${hisrate[i]}</td>
  229. </tr>`;
  230. htmlbody += "</tr>";
  231. return htmlbody;
  232. }
  233. function getSpotHtml1(htmlbody, i) {
  234. htmlbody += "<tr>";
  235. htmlbody += `<tr>
  236. <td>${goodid[i]}</td>
  237. <td>${goodpass[i]}</td>
  238. <td>${goodid[i]}</td>
  239. <td>${goodfailrate[i]}</td>
  240. </tr>`;
  241. htmlbody += "</tr>";
  242. return htmlbody;
  243. }
  244. function getSpotHtml2(htmlbody, i) {
  245. htmlbody += "<tr>";
  246. htmlbody += `<tr>
  247. <td>${badid[i]}</td>
  248. <td>${badpass[i]}</td>
  249. <td>${badid[i]}</td>
  250. <td>${badfailrate[i]}</td>
  251. </tr>`;
  252. htmlbody += "</tr>";
  253. return htmlbody;
  254. }
  255. function showEachSpot() {
  256. var htmlbody = "", one_person = "";
  257. var i = 0;
  258. var triGap = 4;
  259. htmlbody = "";
  260. for (i = 0; i < triGap; i++) {
  261. htmlbody = getSpotHtml(htmlbody, i);
  262. }
  263. $("#rank-one").html(htmlbody);
  264. console.log(htmlbody);
  265. }
  266. function showEachSpot1() {
  267. var htmlbody = "", one_person = "";
  268. var i = 0;
  269. var triGap = 3;
  270. htmlbody = "";
  271. for (i = 0; i < triGap; i++) {
  272. htmlbody = getSpotHtml1(htmlbody, i);
  273. }
  274. $("#rank-two").html(htmlbody);
  275. console.log(htmlbody);
  276. }
  277. function showEachSpot2() {
  278. var htmlbody = "", one_person = "";
  279. var i = 0;
  280. var triGap = 3;
  281. htmlbody = "";
  282. for (i = 0; i < triGap; i++) {
  283. htmlbody = getSpotHtml2(htmlbody, i);
  284. }
  285. $("#rank-three").html(htmlbody);
  286. console.log(htmlbody);
  287. }
  288. var i =0,j=0;
  289. function showChart() {
  290. var stackdata = [];
  291. var passdata=[];
  292. var faildata=[];
  293. var ratedata=[];
  294. var failmax=0;
  295. for (i = 0; i < passeverynum.length; i++) {
  296. passdata.push(passeverynum[i]);
  297. faildata.push(faileverynum[i]);
  298. stackdata.push(0);
  299. ratedata.push(failrate[i])
  300. if (failmax < ratedata[i]) {
  301. failmax = ratedata[i];
  302. }
  303. }
  304. showEachSpot();
  305. showEachSpot1();
  306. showEachSpot2();
  307. stackAndFailChart = Highcharts.chart('graph-1', {
  308. chart: {
  309. zoomType: 'xy',
  310. height: (4 / 16 * 100) + '%' // 16:9 ratio
  311. },
  312. title: {
  313. text: '各产线今日产能'
  314. },
  315. credits: {
  316. enabled: false // 禁用版权信息
  317. },
  318. exporting: {
  319. enabled: false
  320. },
  321. xAxis: [{
  322. crosshair: true,
  323. labels: {
  324. style: {
  325. fontSize: '1.5em'
  326. }
  327. }
  328. }],
  329. yAxis: [{ // Primary yAxis
  330. labels: {
  331. format: '{value}',
  332. style: {
  333. color: Highcharts.getOptions().colors[0],
  334. fontSize: '1.5em'
  335. }
  336. },
  337. min: 0,
  338. max: 10000,
  339. title: {
  340. style: {
  341. color: Highcharts.getOptions().colors[0],
  342. fontSize: '1em'
  343. }
  344. }
  345. },
  346. ],
  347. tooltip: {
  348. shared: true
  349. },
  350. legend: {
  351. layout: 'vertical',
  352. align: 'right',
  353. x: -100,
  354. verticalAlign: 'top',
  355. y: 0,
  356. floating: true,
  357. backgroundColor: (Highcharts.theme && Highcharts.theme.legendBackgroundColor) || '#FFFFFF'
  358. },
  359. series: [{
  360. name: '良品数',
  361. type: 'column',
  362. data: passdata,
  363. }, {
  364. name: '不良品数',
  365. type: 'column',
  366. data: faildata,
  367. },
  368. {
  369. name: '堆积数',
  370. type: 'column',
  371. data: stackdata,
  372. },]
  373. });
  374. FailChart = Highcharts.chart('graph-2', {
  375. chart: {
  376. height: (4 / 16 * 100) + '%' // 16:9 ratio
  377. },
  378. title: {
  379. text: '各产线今日不良率'
  380. },
  381. credits: {
  382. enabled: false // 禁用版权信息
  383. },
  384. exporting: {
  385. enabled: false
  386. },
  387. xAxis: [{
  388. crosshair: true,
  389. labels: {
  390. style: {
  391. fontSize: '1.5em'
  392. }
  393. }
  394. }],
  395. yAxis: [ { // Secondary yAxis
  396. title: {
  397. text: '不良率',
  398. style: {
  399. color: 'red',
  400. fontSize: '1em'
  401. }
  402. },
  403. min: 0,
  404. max: 1.5 * failmax,
  405. labels: {
  406. formatter: function () {
  407. return Math.floor(this.value) + "%";
  408. },
  409. style: {
  410. color: 'red',
  411. fontSize: '20px'
  412. }
  413. },
  414. }],
  415. tooltip: {
  416. shared: true
  417. },
  418. legend: {
  419. layout: 'vertical',
  420. align: 'right',
  421. x: -120,
  422. verticalAlign: 'top',
  423. y: 0,
  424. floating: true,
  425. backgroundColor: (Highcharts.theme && Highcharts.theme.legendBackgroundColor) || '#FFFFFF'
  426. },
  427. series: [{
  428. name: '不良率',
  429. type: 'spline',
  430. data: ratedata,
  431. color: 'red',
  432. tooltip: {
  433. valueSuffix: '%'
  434. }
  435. }]
  436. });
  437. }
  438. function updateChart() {
  439. var stackdata = [];
  440. var passdata=[];
  441. var faildata=[];
  442. var ratedata=[];
  443. for (i = 0; i < passeverynum.length; i++) {
  444. passdata.push(passeverynum[i]);
  445. faildata.push(faileverynum[i]);
  446. stackdata.push(0);
  447. ratedata.push(failrate[i])
  448. }
  449. // https://api.hcharts.cn/highcharts#Series.addPoint;
  450. stackAndFailChart.series[0].setData(passdata);
  451. stackAndFailChart.series[1].setData(faildata);
  452. stackAndFailChart.series[2].setData(stackdata);
  453. FailChart.series[0].setData(ratedata);
  454. showEachSpot();
  455. showEachSpot1();
  456. showEachSpot2();
  457. }
  458. var stackAndFailChart = null;
  459. var FailChart = null;
  460. $(document).ready(on_document_load);
  461. </script>
  462. </body>
  463. </html>