example.html 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530
  1. <!DOCTYPE html>
  2. <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
  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. <meta http-equiv="Content-Type" content="text/html"/>
  8. <title>流水线管理页</title>
  9. <!-- Favicon-->
  10. <link rel="icon" href="favicon.ico" type="image/x-icon">
  11. <!-- Google Fonts -->
  12. <link href="https://fonts.googleapis.com/css?family=Roboto:400,700&subset=latin,cyrillic-ext" rel="stylesheet"
  13. type="text/css">
  14. <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" type="text/css">
  15. <!-- Bootstrap Core Css -->
  16. <link rel="stylesheet" href="css/third/bootstrap.min.css"
  17. >
  18. <!-- Waves Effect Css -->
  19. <link href="plugins/node-waves/waves.css" rel="stylesheet"/>
  20. <!-- Animation Css -->
  21. <link href="plugins/animate-css/animate.css" rel="stylesheet"/>
  22. <!-- Morris Chart Css-->
  23. <link href="plugins/morrisjs/morris.css" rel="stylesheet"/>
  24. <!-- Custom Css -->
  25. <link href="css/style-frontend.css" rel="stylesheet">
  26. <!-- AdminBSB Themes. You can choose a theme from css/themes instead of get all themes -->
  27. <link href="css/themes/all-themes.css" rel="stylesheet"/>
  28. <link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
  29. <script src="css/third/jq.3.2.1.min.js"></script>
  30. <script src="css/third/popper.1.12.9.js"
  31. ></script>
  32. <script src="css/third/boot.min.js"
  33. ></script>
  34. <link rel="stylesheet" href="http://jqueryui.com/resources/demos/style.css">
  35. <meta name="viewport" content="width=device-width, initial-scale=1">
  36. <style>
  37. /* css 代码 */
  38. </style>
  39. <script src="css/third/hchart.js"></script>
  40. <script src="css/third/exporting.js"></script>
  41. <script src="css/third/cn.js"></script>
  42. <script language="JavaScript">
  43. function startTime()
  44. {
  45. var today=new Date();//定义日期对象
  46. var yyyy = today.getFullYear();//通过日期对象的getFullYear()方法返回年
  47. var MM = today.getMonth()+1;//通过日期对象的getMonth()方法返回年
  48. var dd = today.getDate();//通过日期对象的getDate()方法返回年
  49. var hh=today.getHours();//通过日期对象的getHours方法返回小时
  50. var mm=today.getMinutes();//通过日期对象的getMinutes方法返回分钟
  51. var ss=today.getSeconds();//通过日期对象的getSeconds方法返回秒
  52. // 如果分钟或小时的值小于10,则在其值前加0,比如如果时间是下午3点20分9秒的话,则显示15:20:09
  53. MM=checkTime(MM);
  54. dd=checkTime(dd);
  55. mm=checkTime(mm);
  56. ss=checkTime(ss);
  57. var day; //用于保存星期(getDay()方法得到星期编号)
  58. if(today.getDay()==0) day = "星期日 "
  59. if(today.getDay()==1) day = "星期一 "
  60. if(today.getDay()==2) day = "星期二 "
  61. if(today.getDay()==3) day = "星期三 "
  62. if(today.getDay()==4) day = "星期四 "
  63. if(today.getDay()==5) day = "星期五 "
  64. if(today.getDay()==6) day = "星期六 "
  65. document.getElementById('nowDateTimeSpan').innerHTML=yyyy+"-"+MM +"-"+ dd +" " + hh+":"+mm+":"+ss+" " + day;
  66. setTimeout('startTime()',1000);//每一秒中重新加载startTime()方法
  67. }
  68. function checkTime(i)
  69. {
  70. if (i<10){
  71. i="0" + i;
  72. }
  73. return i;
  74. }
  75. </script>
  76. <style>
  77. .time1{width:100%; height:50px; background:#FFF000; line-height:50px; text-align:center;}
  78. </style>
  79. </head>
  80. <body onload="startTime()">
  81. 当前时间:<font color="black"><span id="nowDateTimeSpan"></span></font>
  82. <div class="row">
  83. <div class=" col-lg-3 col-md-3 col-sm-6 col-xs-12">
  84. <div class="info-box bg-pink " onclick="addContent1()">
  85. 合格数
  86. <script>
  87. function addContent1() {
  88. $('a[href="#home"]').tab('show');
  89. }
  90. </script>
  91. </div>
  92. </div>
  93. <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
  94. <div class="info-box bg-cyan " onclick="addContent2()">
  95. 不合格数
  96. <script>
  97. function addContent2() {
  98. $('a[href="#profile"]').tab('show');
  99. }
  100. </script>
  101. </div>
  102. </div>
  103. <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
  104. <div class="info-box bg-light-green " onclick="addContent3()">
  105. 堆积数
  106. <script>
  107. function addContent3() {
  108. $('a[href="#contact"]').tab('show');
  109. }
  110. </script>
  111. </div>
  112. </div>
  113. <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
  114. <div class="info-box bg-orange " onclick="addContent4()">
  115. 工作时长
  116. <script>
  117. function addContent4() {
  118. $('a[href="#time"]').tab('show');
  119. }
  120. </script>
  121. </div>
  122. </div>
  123. </div>
  124. <div>
  125. <ul class="nav nav-tabs" id="myTab" role="tablist" style="display: none">
  126. <li class="nav-item">
  127. <a class="nav-link active" id="home-tab" data-toggle="tab" href="#home" role="tab" aria-controls="home"
  128. aria-selected="true">Home</a>
  129. </li>
  130. <li class="nav-item">
  131. <a class="nav-link" id="profile-tab" data-toggle="tab" href="#profile" role="tab" aria-controls="profile"
  132. aria-selected="false">Profile</a>
  133. </li>
  134. <li class="nav-item">
  135. <a class="nav-link" id="contact-tab" data-toggle="tab" href="#contact" role="tab" aria-controls="contact"
  136. aria-selected="false">Contact</a>
  137. </li>
  138. <li class="nav-item">
  139. <a class="nav-link" id="time-tab" data-toggle="tab" href="#time" role="tab" aria-controls="time"
  140. aria-selected="false">Time</a>
  141. </li>
  142. </ul>
  143. <div class="tab-content" id="myTabContent">
  144. <div class="tab-pane fade show active" id="home" role="tabpanel" aria-labelledby="home-tab">
  145. <div id="container" class="text-center" style="width: 50%;height:400px;margin: 0 auto"></div>
  146. </div>
  147. <div class="tab-pane fade" id="profile" role="tabpanel" aria-labelledby="profile-tab">
  148. <div id="container2" style="width:50%;height:400px;margin: 0 auto"></div>
  149. </div>
  150. <div class="tab-pane fade" id="contact" role="tabpanel" aria-labelledby="contact-tab">
  151. <div id="container3" style="width:50%;height:400px;margin: 0 auto"></div>
  152. </div>
  153. <div class="tab-pane fade" id="time" role="tabpanel" aria-labelledby="contact-tab">
  154. <div id="container5" style="width:50%;height:400px;margin: 0 auto"></div>
  155. </div>
  156. </div>
  157. </div>
  158. <script>
  159. var chart = Highcharts.chart('container2', {
  160. chart: {
  161. type: 'column'
  162. },
  163. title: {
  164. text: '月平均降雨量'
  165. },
  166. subtitle: {
  167. text: '数据来源: WorldClimate.com'
  168. },
  169. xAxis: {
  170. categories: [
  171. '一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'
  172. ],
  173. crosshair: true
  174. },
  175. yAxis: {
  176. min: 0,
  177. title: {
  178. text: '降雨量 (mm)'
  179. }
  180. },
  181. tooltip: {
  182. // head + 每个 point + footer 拼接成完整的 table
  183. headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
  184. pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
  185. '<td style="padding:0"><b>{point.y:.1f} mm</b></td></tr>',
  186. footerFormat: '</table>',
  187. shared: true,
  188. useHTML: true
  189. },
  190. plotOptions: {
  191. column: {
  192. borderWidth: 0
  193. }
  194. },
  195. series: [{
  196. name: '东京',
  197. data: [49.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
  198. }, {
  199. name: '纽约',
  200. data: [83.6, 78.8, 98.5, 93.4, 106.0, 84.5, 105.0, 104.3, 91.2, 83.5, 106.6, 92.3]
  201. }, {
  202. name: '伦敦',
  203. data: [48.9, 38.8, 39.3, 41.4, 47.0, 48.3, 59.0, 59.6, 52.4, 65.2, 59.3, 51.2]
  204. }, {
  205. name: '柏林',
  206. data: [42.4, 33.2, 34.5, 39.7, 52.6, 75.5, 57.4, 60.4, 47.6, 39.1, 46.8, 51.1]
  207. }]
  208. });
  209. </script>
  210. <script>
  211. var chart = Highcharts.chart('container1', {
  212. chart: {
  213. type: 'bar'
  214. },
  215. title: {
  216. text: '堆叠条形图'
  217. },
  218. xAxis: {
  219. categories: ['苹果', '橘子', '梨', '葡萄', '香蕉']
  220. },
  221. yAxis: {
  222. min: 0,
  223. title: {
  224. text: '水果消费总量'
  225. }
  226. },
  227. legend: {
  228. /* 图例显示顺序反转
  229. * 这是因为堆叠的顺序默认是反转的,可以设置
  230. * yAxis.reversedStacks = false 来达到类似的效果
  231. */
  232. reversed: true
  233. },
  234. plotOptions: {
  235. series: {
  236. stacking: 'normal'
  237. }
  238. },
  239. series: [{
  240. name: '小张',
  241. data: [5, 3, 4, 7, 2]
  242. }, {
  243. name: '小彭',
  244. data: [2, 2, 3, 2, 1]
  245. }, {
  246. name: '小潘',
  247. data: [3, 4, 4, 2, 5]
  248. }]
  249. });
  250. </script>
  251. <script>
  252. var chart = Highcharts.chart('container3', {
  253. chart: {
  254. type: 'column'
  255. },
  256. title: {
  257. text: '全球各大城市人口排行'
  258. },
  259. subtitle: {
  260. text: '数据截止 2017-03,来源: <a href="https://en.wikipedia.org/wiki/List_of_cities_proper_by_population">Wikipedia</a>'
  261. },
  262. xAxis: {
  263. type: 'category',
  264. labels: {
  265. rotation: -45 // 设置轴标签旋转角度
  266. }
  267. },
  268. yAxis: {
  269. min: 0,
  270. title: {
  271. text: '人口 (百万)'
  272. }
  273. },
  274. legend: {
  275. enabled: false
  276. },
  277. tooltip: {
  278. pointFormat: '人口总量: <b>{point.y:.1f} 百万</b>'
  279. },
  280. series: [{
  281. name: '总人口',
  282. data: [
  283. ['上海', 24.25],
  284. ['卡拉奇', 23.50],
  285. ['北京', 21.51],
  286. ['德里', 16.78],
  287. ['拉各斯', 16.06],
  288. ['天津', 15.20],
  289. ['伊斯坦布尔', 14.16],
  290. ['东京', 13.51],
  291. ['广州', 13.08],
  292. ['孟买', 12.44],
  293. ['莫斯科', 12.19],
  294. ['圣保罗', 12.03],
  295. ['深圳', 10.46],
  296. ['雅加达', 10.07],
  297. ['拉合尔', 10.05],
  298. ['首尔', 9.99],
  299. ['武汉', 9.78],
  300. ['金沙萨', 9.73],
  301. ['开罗', 9.27],
  302. ['墨西哥', 8.87]
  303. ],
  304. dataLabels: {
  305. enabled: true,
  306. rotation: -90,
  307. color: '#FFFFFF',
  308. align: 'right',
  309. format: '{point.y:.1f}', // :.1f 为保留 1 位小数
  310. y: 10
  311. }
  312. }]
  313. });
  314. </script>
  315. <script>
  316. var chart = Highcharts.chart('container4', {
  317. chart: {
  318. type: 'line'
  319. },
  320. title: {
  321. text: '月平均气温'
  322. },
  323. subtitle: {
  324. text: '数据来源: WorldClimate.com'
  325. },
  326. xAxis: {
  327. categories: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月']
  328. },
  329. yAxis: {
  330. title: {
  331. text: '气温 (°C)'
  332. }
  333. },
  334. plotOptions: {
  335. line: {
  336. dataLabels: {
  337. // 开启数据标签
  338. enabled: true
  339. },
  340. // 关闭鼠标跟踪,对应的提示框、点击事件会失效
  341. enableMouseTracking: false
  342. }
  343. },
  344. series: [{
  345. name: '东京',
  346. data: [7.0, 6.9, 9.5, 14.5, 18.4, 21.5, 25.2, 26.5, 23.3, 18.3, 13.9, 9.6]
  347. }, {
  348. name: '伦敦',
  349. data: [3.9, 4.2, 5.7, 8.5, 11.9, 15.2, 17.0, 16.6, 14.2, 10.3, 6.6, 4.8]
  350. }]
  351. });
  352. </script>
  353. <script src="js/basic.js"></script>
  354. <script>
  355. function showChart() {
  356. var data = [];
  357. var ratedata = [];
  358. var stackmax = 0;
  359. var failmax=0;
  360. for (i = 0; i < passNumber.length; i++) {
  361. if (stackmax < stackeverynum[i]) {
  362. stackmax = stackeverynum[i];
  363. }
  364. if (failmax < failrate[i]) {
  365. failmax = failrate[i];
  366. }
  367. data.push(stackeverynum[i]);
  368. ratedata.push(Math.floor(failrate[i]));
  369. }
  370. stackmax = Math.max(stackmax,5);
  371. failmax =Math.max(failmax,5);
  372. stackAndFailChart = Highcharts.chart('container', {
  373. chart: {
  374. zoomType: 'xy'
  375. },
  376. title: {
  377. text: null
  378. },
  379. credits: {
  380. enabled: false // 禁用版权信息
  381. },
  382. exporting: {
  383. enabled: false
  384. },
  385. xAxis: [{
  386. categories: namedata,
  387. crosshair: true,
  388. title: {
  389. text: '员工',
  390. style: {
  391. fontSize: '15px'
  392. }
  393. },
  394. labels: {
  395. style: {
  396. fontSize: '20px'
  397. }
  398. }
  399. }],
  400. yAxis: [{ // Primary yAxis
  401. labels: {
  402. format: '{value}',
  403. style: {
  404. color: Highcharts.getOptions().colors[0],
  405. fontSize: '20px'
  406. }
  407. },
  408. min: 0,
  409. max: 1.5 * stackmax,
  410. title: {
  411. text: '堆积数',
  412. style: {
  413. color: Highcharts.getOptions().colors[0],
  414. fontSize: '15px'
  415. }
  416. }
  417. }, { // Secondary yAxis
  418. title: {
  419. text: '不良率',
  420. style: {
  421. color: 'red',
  422. fontSize: '15px'
  423. }
  424. },
  425. min: 0,
  426. max: 1.5 * failmax,
  427. labels: {
  428. formatter: function() {
  429. return Math.floor(this.value) + "%";
  430. },
  431. style: {
  432. color: 'red',
  433. fontSize: '20px'
  434. }
  435. },
  436. opposite: true
  437. }],
  438. tooltip: {
  439. shared: true
  440. },
  441. legend: {
  442. layout: 'vertical',
  443. align: 'right',
  444. x: -120,
  445. verticalAlign: 'top',
  446. y: 0,
  447. floating: true,
  448. backgroundColor: (Highcharts.theme && Highcharts.theme.legendBackgroundColor) || '#FFFFFF'
  449. },
  450. series: [{
  451. name: '堆积数',
  452. type: 'column',
  453. data: data,
  454. tooltip: {
  455. valueSuffix: ' mm'
  456. }
  457. }, {
  458. name: '不良率',
  459. type: 'spline',
  460. yAxis: 1,
  461. data: ratedata,
  462. color: 'red',
  463. tooltip: {
  464. valueSuffix: '%'
  465. }
  466. }]
  467. });
  468. }
  469. function updateChart(){
  470. var data = [];
  471. var ratedata = [];
  472. var stackmax = 0;
  473. var failmax=0;
  474. for (i = 0; i < passNumber.length; i++) {
  475. if (stackmax < stackeverynum[i]) {
  476. stackmax = stackeverynum[i];
  477. }
  478. if (failmax < failrate[i]) {
  479. failmax = failrate[i];
  480. }
  481. data.push(stackeverynum[i]);
  482. ratedata.push(Math.floor(failrate[i]));
  483. }
  484. stackmax = Math.max(stackmax,5);
  485. failmax =Math.max(failmax,5);
  486. // https://api.hcharts.cn/highcharts#Series.addPoint;
  487. stackAndFailChart.series[0].setData(data);
  488. stackAndFailChart.series[1].setData(ratedata);
  489. }
  490. var stackAndFailChart = null;
  491. $(document).ready(on_document_load);
  492. setInterval(function(){
  493. $("#container").width(window.innerWidth);
  494. $("#container").height(window.innerHeight);
  495. },1000);
  496. </script>
  497. </body>
  498. </html>