lazhang.html 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518
  1. <!DOCTYPE html>
  2. <html>
  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="css/cyllic.css" rel="stylesheet" type="text/css">
  12. <link href="css/mateial.css" 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"
  15. integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
  16. <!-- Waves Effect Css -->
  17. <link href="plugins/node-waves/waves.css" rel="stylesheet"/>
  18. <!-- Animation Css -->
  19. <link href="plugins/animate-css/animate.css" rel="stylesheet"/>
  20. <!-- Morris Chart Css-->
  21. <link href="plugins/morrisjs/morris.css" rel="stylesheet"/>
  22. <!-- Custom Css -->
  23. <link href="css/style.css" rel="stylesheet">
  24. <!-- AdminBSB Themes. You can choose a theme from css/themes instead of get all themes -->
  25. <link href="css/themes/all-themes.css" rel="stylesheet"/>
  26. <script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
  27. <script src="https://cdn.bootcss.com/popper.js/1.12.9/umd/popper.min.js"
  28. integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q"
  29. crossorigin="anonymous"></script>
  30. <script src="https://cdn.bootcss.com/bootstrap/4.0.0/js/bootstrap.min.js"
  31. integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl"
  32. crossorigin="anonymous"></script>
  33. <link rel="icon" href="https://static.jianshukeji.com/highcharts/images/favicon.ico">
  34. <meta name="viewport" content="width=device-width, initial-scale=1">
  35. <style>
  36. /* css 代码 */
  37. </style>
  38. <script src="https://img.hcharts.cn/highcharts/highcharts.js"></script>
  39. <script src="https://img.hcharts.cn/highcharts/modules/exporting.js"></script>
  40. <script src="https://img.hcharts.cn/highcharts-plugins/highcharts-zh_CN.js"></script>
  41. <script>
  42. var timer = null;
  43. function displayClock(num) {//num是传入的startClock中的动态值
  44. if (num < 10) {
  45. return "0" + num;
  46. }
  47. else {
  48. return num;
  49. }
  50. }
  51. //停止计时
  52. function stopClock() {
  53. clearTimeout(timer);
  54. }
  55. //开始计时
  56. function startClock() {
  57. var time = new Date();
  58. var hours = displayClock(time.getHours()) + ":";
  59. var minutes = displayClock(time.getMinutes()) + ":";
  60. var seconds = displayClock(time.getSeconds());
  61. //显示时间
  62. show.innerHTML = hours + minutes + seconds;//在id为show的块区域显示
  63. timer = setTimeout("startClock()", 1000);//延时器
  64. }
  65. </script>
  66. </head>
  67. <style>
  68. #show1 {
  69. font-size: 30px;
  70. color: black;
  71. text-align: center;
  72. }
  73. </style>
  74. <body>
  75. <nav class="navbar navbar-expand-lg navbar-light bg-light" style-height="10">
  76. <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent"
  77. aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
  78. <span class="navbar-toggler-icon"></span>
  79. </button>
  80. <div class="collapse navbar-collapse" id="navbarSupportedContent">
  81. <ul class="navbar-nav mr-auto">
  82. <li class="nav-item active navbar-brand">
  83. <h1 class="navbar-brand" href="#">生产线<span>1</span>号</h1>
  84. </li>
  85. <li class="nav-item btn navbar-nav" id="show">
  86. </li>
  87. </ul>
  88. <ul style="margin: 0">
  89. <button type="button" class="btn btn-danger btn-lg" style="width:100% ;background: red;font-size: 2em">
  90. 下班
  91. </button>
  92. </ul>
  93. <div class="dropdown" style="font-size: 2em">
  94. <button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu2" data-toggle="dropdown"
  95. aria-haspopup="true" aria-expanded="false" style="font-size: 0.5em">
  96. <div class="row">
  97. <div class="col-4">
  98. 拉长
  99. </div>
  100. <div class="col-5">
  101. 张三
  102. </div>
  103. </div>
  104. </button>
  105. <ul class="dropdown-menu" aria-labelledby="dropdownMenu2">
  106. <li><a href="#">更改密码</a></li>
  107. <li><a href="#">退出登录</a></li>
  108. </ul>
  109. </div>
  110. </div>
  111. </nav>
  112. <section class="content" style="margin: 0 auto;">
  113. <div class="row" style-height="10"></div>
  114. <div class="container-fluid " style="margin-bottom: 1em">
  115. <div style-height="20" class="row text-center">
  116. <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
  117. <div class="info-box bg-green hover-expand-effect" style="margin: 0;">
  118. <div class="icon">
  119. <i class="material-icons">equalizer</i>
  120. </div>
  121. <div class="content">
  122. <div class="row text-center" style="margin: 0 auto">
  123. <div class="text" style="font-size: 1.5em;padding-top: 0.2em">合格数:</div>
  124. <div class="number" style="font-size: 3em">555</div>
  125. </div>
  126. </div>
  127. </div>
  128. </div>
  129. <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
  130. <div class="info-box bg-red hover-expand-effect" style="margin: 0;">
  131. <div class="icon">
  132. <i class="material-icons">equalizer</i>
  133. </div>
  134. <div class="content">
  135. <div class="row text-center" style="margin: 0 auto">
  136. <div class="text" style="font-size: 1.5em;padding-top: 0.2em">不合格数:</div>
  137. <div class="number" style="font-size: 3em">5255</div>
  138. </div>
  139. </div>
  140. </div>
  141. </div>
  142. <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
  143. <div class="info-box bg-lime hover-expand-effect" style="margin: 0;">
  144. <div class="icon">
  145. <i class="material-icons">brightness_low</i>
  146. </div>
  147. <div class="content">
  148. <div class="row text-center" style="margin: 0 auto">
  149. <div class="text" style="font-size: 1.5em;padding-top: 0.2em">合格率:</div>
  150. <div class="number" style="font-size: 3em">55%</div>
  151. </div>
  152. </div>
  153. </div>
  154. </div>
  155. <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
  156. <div class="info-box bg-cyan hover-zoom-effect" style="margin: 0; ">
  157. <div class="icon">
  158. <i class="material-icons">access_alarm</i>
  159. </div>
  160. <div class="content">
  161. <div class="row text-center" style="margin: 0 auto">
  162. <div class="text" style="font-size: 1.5em;padding-top: 0.2em">堆积数:</div>
  163. <div class="number" style="font-size: 3em">235</div>
  164. </div>
  165. </div>
  166. </div>
  167. </div>
  168. </div>
  169. </div>
  170. <div class="container-fluid" style="margin-top: 0.5em;padding-top: 1em">
  171. <div id="graph-1" style-height="30"></div>
  172. <div class="card" style-height="40" style="margin: 0 auto;">
  173. <div>
  174. <div class="" style="">
  175. <div class="table-responsive" style="width: 30%;float: left">
  176. <table class="table table-hover dashboard-task-infos">
  177. <thead>
  178. <tr style="border-bottom:3px solid black;">
  179. <th>姓名(工号)</th>
  180. <th>合格数</th>
  181. <th>不合格数</th>
  182. </tr>
  183. </thead>
  184. <tbody id="rank-one">
  185. </tbody>
  186. </table>
  187. </div>
  188. <div class="table-responsive" style="width: 30%;float: left;padding-left: 5em">
  189. <table class="table table-hover dashboard-task-infos">
  190. <thead>
  191. <tr style="border-bottom:3px solid black;">
  192. <th>姓名(工号)</th>
  193. <th>合格数</th>
  194. <th>不合格数</th>
  195. </tr>
  196. </thead>
  197. <tbody id="rank-two">
  198. </tbody>
  199. </table>
  200. </div>
  201. <div class="table-responsive" style="width: 30%;float: right">
  202. <table class="table table-hover dashboard-task-infos">
  203. <thead>
  204. <tr style="border-bottom:3px solid black;">
  205. <th>姓名(工号)</th>
  206. <th>合格数</th>
  207. <th>不合格数</th>
  208. </tr>
  209. </thead>
  210. <tbody id="rank-three">
  211. </tbody>
  212. </table>
  213. </div>
  214. </div>
  215. </div>
  216. </div>
  217. <!-- #END# Answered Tickets -->
  218. </div>
  219. </section>
  220. <!-- Jquery Core Js -->
  221. <script src="plugins/jquery/jquery.min.js"></script>
  222. <!-- Bootstrap Core Js -->
  223. <script src="plugins/bootstrap/js/bootstrap.js"></script>
  224. <!-- Select Plugin Js -->
  225. <script src="plugins/bootstrap-select/js/bootstrap-select.js"></script>
  226. <!-- Slimscroll Plugin Js -->
  227. <script src="plugins/jquery-slimscroll/jquery.slimscroll.js"></script>
  228. <!-- Waves Effect Plugin Js -->
  229. <script src="plugins/node-waves/waves.js"></script>
  230. <!-- Jquery CountTo Plugin Js -->
  231. <script src="plugins/jquery-countto/jquery.countTo.js"></script>
  232. <!-- Morris Plugin Js -->
  233. <script src="plugins/raphael/raphael.min.js"></script>
  234. <script src="plugins/morrisjs/morris.js"></script>
  235. <!-- ChartJs -->
  236. <script src="plugins/chartjs/Chart.bundle.js"></script>
  237. <!-- Flot Charts Plugin Js -->
  238. <script src="plugins/flot-charts/jquery.flot.js"></script>
  239. <script src="plugins/flot-charts/jquery.flot.resize.js"></script>
  240. <script src="plugins/flot-charts/jquery.flot.pie.js"></script>
  241. <script src="plugins/flot-charts/jquery.flot.categories.js"></script>
  242. <script src="plugins/flot-charts/jquery.flot.time.js"></script>
  243. <!-- Sparkline Chart Plugin Js -->
  244. <script src="plugins/jquery-sparkline/jquery.sparkline.js"></script>
  245. <!-- Custom Js -->
  246. <script src="js/admin.js"></script>
  247. <!--<script src="js/pages/index.js"></script>-->
  248. <!-- Demo Js -->
  249. <script src="js/demo.js"></script>
  250. <script src="js/basic.js"></script>
  251. <script>
  252. function getSpotHtml(htmlbody, one_person, i) {
  253. htmlbody += "<tr>";
  254. htmlbody += `<tr>
  255. <td>${one_person.spotName}(${one_person.id})</td>
  256. <td>${passNumber[i]}</td>
  257. <td>${failNumber[i]}</td>
  258. </tr>`;
  259. htmlbody += "</tr>";
  260. return htmlbody;
  261. }
  262. function showEachSpot() {
  263. var htmlbody = "", one_person = "";
  264. var i = 0;
  265. var triGap = Math.fround(sID.length / 3);
  266. var remain = sID.length - triGap * 2;
  267. for (i = 0; i < triGap; i++) {
  268. one_person = namedata[i];
  269. htmlbody = getSpotHtml(htmlbody, one_person, i);
  270. $("#rank-one").html(htmlbody);
  271. }
  272. for (i = 0; i < triGap; i++) {
  273. one_person = namedata[i+triGap];
  274. htmlbody = getSpotHtml(htmlbody, one_person, i+triGap);
  275. $("#rank-two").html(htmlbody);
  276. }
  277. for (i = 0; i < remain; i++) {
  278. one_person = namedata[i+triGap*2];
  279. htmlbody = getSpotHtml(htmlbody, one_person, i+triGap*2);
  280. $("#rank-three").html(htmlbody);
  281. }
  282. }
  283. var thisPageFlow = 1;
  284. function showChart() {
  285. var data = [];
  286. var ratedata = [];
  287. var stackmax = 0;
  288. var failmax=0;
  289. for (i = 0; i < passNumber.length; i++) {
  290. if (stackmax < stackeverynum[i]) {
  291. stackmax = stackeverynum[i];
  292. }
  293. if (failmax < failrate[i]) {
  294. failmax = failrate[i];
  295. }
  296. data.push(stackeverynum[i]);
  297. ratedata.push(Math.floor(failrate[i]));
  298. }
  299. stackmax = Math.max(stackmax,5);
  300. failmax =Math.max(failmax,5);
  301. stackAndFailChart = Highcharts.chart('graph-1', {
  302. chart: {
  303. zoomType: 'xy'
  304. },
  305. title: {
  306. text: null
  307. },
  308. credits: {
  309. enabled: false // 禁用版权信息
  310. },
  311. exporting: {
  312. enabled: false
  313. },
  314. xAxis: [{
  315. categories: namedata,
  316. crosshair: true,
  317. title: {
  318. text: '员工',
  319. style: {
  320. fontSize: '15px'
  321. }
  322. },
  323. labels: {
  324. style: {
  325. fontSize: '20px'
  326. }
  327. }
  328. }],
  329. yAxis: [{ // Primary yAxis
  330. labels: {
  331. format: '{value}',
  332. style: {
  333. color: Highcharts.getOptions().colors[0],
  334. fontSize: '20px'
  335. }
  336. },
  337. min: 0,
  338. max: 1.5 * stackmax,
  339. title: {
  340. text: '堆积数',
  341. style: {
  342. color: Highcharts.getOptions().colors[0],
  343. fontSize: '15px'
  344. }
  345. }
  346. }, { // Secondary yAxis
  347. title: {
  348. text: '不良率',
  349. style: {
  350. color: 'red',
  351. fontSize: '15px'
  352. }
  353. },
  354. min: 0,
  355. max: 1.5 * failmax,
  356. labels: {
  357. formatter: function() {
  358. return Math.floor(this.value) + "%";
  359. },
  360. style: {
  361. color: 'red',
  362. fontSize: '20px'
  363. }
  364. },
  365. opposite: true
  366. }],
  367. tooltip: {
  368. shared: true
  369. },
  370. legend: {
  371. layout: 'vertical',
  372. align: 'right',
  373. x: -120,
  374. verticalAlign: 'top',
  375. y: 0,
  376. floating: true,
  377. backgroundColor: (Highcharts.theme && Highcharts.theme.legendBackgroundColor) || '#FFFFFF'
  378. },
  379. series: [{
  380. name: '堆积数',
  381. type: 'column',
  382. data: data,
  383. tooltip: {
  384. valueSuffix: ' mm'
  385. }
  386. }, {
  387. name: '不良率',
  388. type: 'spline',
  389. yAxis: 1,
  390. data: ratedata,
  391. color: 'red',
  392. tooltip: {
  393. valueSuffix: '%'
  394. }
  395. }]
  396. });
  397. }
  398. function updateChart(){
  399. var data = [];
  400. var ratedata = [];
  401. var stackmax = 0;
  402. var failmax=0;
  403. for (i = 0; i < passNumber.length; i++) {
  404. if (stackmax < stackeverynum[i]) {
  405. stackmax = stackeverynum[i];
  406. }
  407. if (failmax < failrate[i]) {
  408. failmax = failrate[i];
  409. }
  410. data.push(stackeverynum[i]);
  411. ratedata.push(Math.floor(failrate[i]));
  412. }
  413. stackmax = Math.max(stackmax,5);
  414. failmax =Math.max(failmax,5);
  415. // https://api.hcharts.cn/highcharts#Series.addPoint;
  416. stackAndFailChart.series[0].setData(data);
  417. stackAndFailChart.series[1].setData(ratedata);
  418. }
  419. var stackAndFailChart = null;
  420. $(document).ready(on_document_load);
  421. window.onresize = resizeAll;
  422. function resizeAll(){
  423. $('[style-height="10"]').height(window.innerHeight / 10);
  424. $('[style-height="20"]').height(window.innerHeight / 5);
  425. $('[style-height="30"]').height(window.innerHeight / 3.33333);
  426. $('[style-height="40"]').height(window.innerHeight / 2.5);
  427. var graph = $("#graph-1");
  428. graph.width(window.innerWidth);
  429. graph.height(window.innerHeight / 3.333);
  430. if(graph.highcharts !== undefined) {
  431. graph.highcharts().reflow();
  432. }
  433. }
  434. setInterval(function(){
  435. resizeAll();
  436. },5000);
  437. resizeAll();
  438. startClock();
  439. </script>
  440. </body>
  441. </html>
  442. <!---
  443. ### SVR_BASE 类似 "http://127.0.0.1:8803" 实际上线之后是确定值,写死在HTML里的JS里面
  444. ### 各个拉实时产量数据接口地址
  445. SVR_BASE + "/server/fcWorkRaw/allFlows"
  446. ### 单个拉内,所有工位实时产量数据接口地址 e.g. 拉线ID = 2
  447. SVR_BASE + "/server/fcWorkRaw/allSpots" + "?" + "flowId=2"
  448. ### 员工上班记录API e.g. 拉线ID = 2 工位顺序 = 1 员工ID = 33404
  449. SVR_BASE + "/server/fcWorkStartend/goOnline" + "?" + "flowId=2&sequence=1&workerId=33404"
  450. ### 查询已上班员工 e.g. 拉线ID = 2
  451. SVR_BASE + "/server/fcWorkRaw/getAll" + "?" + "flowId=2"
  452. -->