dapingmu.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338
  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: 5em" >
  84. <div id="graph-1" ></div>
  85. <div class="row" style="height: 6em"></div>
  86. <div id="graph-2" ></div>
  87. </section>
  88. </section>
  89. <!-- Jquery Core Js -->
  90. <script src="plugins/jquery/jquery.min.js"></script>
  91. <!-- Bootstrap Core Js -->
  92. <script src="plugins/bootstrap/js/bootstrap.js"></script>
  93. <!-- Select Plugin Js -->
  94. <script src="plugins/bootstrap-select/js/bootstrap-select.js"></script>
  95. <!-- Slimscroll Plugin Js -->
  96. <script src="plugins/jquery-slimscroll/jquery.slimscroll.js"></script>
  97. <!-- Waves Effect Plugin Js -->
  98. <script src="plugins/node-waves/waves.js"></script>
  99. <!-- Jquery CountTo Plugin Js -->
  100. <script src="plugins/jquery-countto/jquery.countTo.js"></script>
  101. <!-- Morris Plugin Js -->
  102. <script src="plugins/raphael/raphael.min.js"></script>
  103. <script src="plugins/morrisjs/morris.js"></script>
  104. <!-- ChartJs -->
  105. <script src="plugins/chartjs/Chart.bundle.js"></script>
  106. <!-- Flot Charts Plugin Js -->
  107. <script src="plugins/flot-charts/jquery.flot.js"></script>
  108. <script src="plugins/flot-charts/jquery.flot.resize.js"></script>
  109. <script src="plugins/flot-charts/jquery.flot.pie.js"></script>
  110. <script src="plugins/flot-charts/jquery.flot.categories.js"></script>
  111. <script src="plugins/flot-charts/jquery.flot.time.js"></script>
  112. <!-- Sparkline Chart Plugin Js -->
  113. <script src="plugins/jquery-sparkline/jquery.sparkline.js"></script>
  114. <script src="js/admin.js"></script>
  115. <!--<script src="js/pages/index.js"></script>-->
  116. <!-- Demo Js -->
  117. <script src="js/demo.js"></script>
  118. <!--<script src="js/demo.js"></script> -->
  119. <script src="js/basic1.js"></script>
  120. <script>
  121. var i =0,j=0;
  122. function showChart() {
  123. var stackdata = [];
  124. var passdata=[];
  125. var faildata=[];
  126. var ratedata=[];
  127. var failmax=0;
  128. for (i = 0; i < passeverynum.length; i++) {
  129. passdata.push(passeverynum[i]);
  130. faildata.push(faileverynum[i]);
  131. stackdata.push(0);
  132. ratedata.push(failrate[i])
  133. if (failmax < ratedata[i]) {
  134. failmax = ratedata[i];
  135. }
  136. }
  137. //showEachSpot();
  138. stackAndFailChart = Highcharts.chart('graph-1', {
  139. chart: {
  140. zoomType: 'xy',
  141. height: (4 / 16 * 100) + '%' // 16:9 ratio
  142. },
  143. title: {
  144. text: '各产线今日产能'
  145. },
  146. credits: {
  147. enabled: false // 禁用版权信息
  148. },
  149. exporting: {
  150. enabled: false
  151. },
  152. xAxis: [{
  153. crosshair: true,
  154. labels: {
  155. style: {
  156. fontSize: '1.5em'
  157. }
  158. }
  159. }],
  160. yAxis: [{ // Primary yAxis
  161. labels: {
  162. format: '{value}',
  163. style: {
  164. color: Highcharts.getOptions().colors[0],
  165. fontSize: '1.5em'
  166. }
  167. },
  168. min: 0,
  169. max: 10000,
  170. title: {
  171. style: {
  172. color: Highcharts.getOptions().colors[0],
  173. fontSize: '1em'
  174. }
  175. }
  176. },
  177. ],
  178. tooltip: {
  179. shared: true
  180. },
  181. legend: {
  182. layout: 'vertical',
  183. align: 'right',
  184. x: -100,
  185. verticalAlign: 'top',
  186. y: 0,
  187. floating: true,
  188. backgroundColor: (Highcharts.theme && Highcharts.theme.legendBackgroundColor) || '#FFFFFF'
  189. },
  190. series: [{
  191. name: '良品数',
  192. type: 'column',
  193. data: passdata,
  194. }, {
  195. name: '不良品数',
  196. type: 'column',
  197. data: faildata,
  198. },
  199. {
  200. name: '堆积数',
  201. type: 'column',
  202. data: stackdata,
  203. },]
  204. });
  205. FailChart = Highcharts.chart('graph-2', {
  206. chart: {
  207. height: (4 / 16 * 100) + '%' // 16:9 ratio
  208. },
  209. title: {
  210. text: '各产线今日不良率'
  211. },
  212. credits: {
  213. enabled: false // 禁用版权信息
  214. },
  215. exporting: {
  216. enabled: false
  217. },
  218. xAxis: [{
  219. crosshair: true,
  220. labels: {
  221. style: {
  222. fontSize: '1.5em'
  223. }
  224. }
  225. }],
  226. yAxis: [ { // Secondary yAxis
  227. title: {
  228. text: '不良率',
  229. style: {
  230. color: 'red',
  231. fontSize: '1em'
  232. }
  233. },
  234. min: 0,
  235. max: 1.5 * failmax,
  236. labels: {
  237. formatter: function () {
  238. return Math.floor(this.value) + "%";
  239. },
  240. style: {
  241. color: 'red',
  242. fontSize: '20px'
  243. }
  244. },
  245. }],
  246. tooltip: {
  247. shared: true
  248. },
  249. legend: {
  250. layout: 'vertical',
  251. align: 'right',
  252. x: -120,
  253. verticalAlign: 'top',
  254. y: 0,
  255. floating: true,
  256. backgroundColor: (Highcharts.theme && Highcharts.theme.legendBackgroundColor) || '#FFFFFF'
  257. },
  258. series: [{
  259. name: '不良率',
  260. type: 'spline',
  261. data: ratedata,
  262. color: 'red',
  263. tooltip: {
  264. valueSuffix: '%'
  265. }
  266. }]
  267. });
  268. }
  269. function updateChart() {
  270. var stackdata = [];
  271. var passdata=[];
  272. var faildata=[];
  273. var ratedata=[];
  274. for (i = 0; i < passeverynum.length; i++) {
  275. passdata.push(passeverynum[i]);
  276. faildata.push(faileverynum[i]);
  277. stackdata.push(0);
  278. ratedata.push(failrate[i])
  279. }
  280. // https://api.hcharts.cn/highcharts#Series.addPoint;
  281. stackAndFailChart.series[0].setData(passdata);
  282. stackAndFailChart.series[1].setData(faildata);
  283. stackAndFailChart.series[2].setData(stackdata);
  284. FailChart.series[0].setData(ratedata);
  285. // showEachSpot();
  286. }
  287. var stackAndFailChart = null;
  288. var FailChart = null;
  289. $(document).ready(on_document_load);
  290. </script>
  291. </body>
  292. </html>