123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <meta http-equiv="X-UA-Compatible" content="IE=Edge">
- <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
- <title>流水线管理页</title>
- <!-- Favicon-->
- <link rel="icon" href="favicon.ico" type="image/x-icon">
- <!-- Google Fonts -->
- <link href="css/cyllic.css" rel="stylesheet" type="text/css">
- <link href="css/mateial.css" rel="stylesheet" type="text/css">
- <!-- Bootstrap Core Css -->
- <link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/4.0.0/css/bootstrap.min.css"
- integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
- <!-- Waves Effect Css -->
- <link href="plugins/node-waves/waves.css" rel="stylesheet"/>
- <!-- Animation Css -->
- <link href="plugins/animate-css/animate.css" rel="stylesheet"/>
- <!-- Morris Chart Css-->
- <link href="plugins/morrisjs/morris.css" rel="stylesheet"/>
- <!-- Custom Css -->
- <link href="css/style.css" rel="stylesheet">
- <!-- AdminBSB Themes. You can choose a theme from css/themes instead of get all themes -->
- <link href="css/themes/all-themes.css" rel="stylesheet"/>
- <script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
- <script src="https://cdn.bootcss.com/popper.js/1.12.9/umd/popper.min.js"
- integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q"
- crossorigin="anonymous"></script>
- <script src="https://cdn.bootcss.com/bootstrap/4.0.0/js/bootstrap.min.js"
- integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl"
- crossorigin="anonymous"></script>
- <link rel="icon" href="https://static.jianshukeji.com/highcharts/images/favicon.ico">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <style>
- /* css 代码 */
- </style>
- <script src="https://img.hcharts.cn/highcharts/highcharts.js"></script>
- <script src="https://img.hcharts.cn/highcharts/modules/exporting.js"></script>
- <script src="https://img.hcharts.cn/highcharts-plugins/highcharts-zh_CN.js"></script>
- <script>
- var timer = null;
- function displayClock(num) {//num是传入的startClock中的动态值
- if (num < 10) {
- return "0" + num;
- }
- else {
- return num;
- }
- }
- //停止计时
- function stopClock() {
- clearTimeout(timer);
- }
- //开始计时
- function startClock() {
- var time = new Date();
- var hours = displayClock(time.getHours()) + ":";
- var minutes = displayClock(time.getMinutes()) + ":";
- var seconds = displayClock(time.getSeconds());
- //显示时间
- show.innerHTML = hours + minutes + seconds;//在id为show的块区域显示
- timer = setTimeout("startClock()", 1000);//延时器
- }
- </script>
- </head>
- <style>
- #show1 {
- font-size: 30px;
- color: black;
- text-align: center;
- }
- </style>
- <body>
- <nav class="navbar navbar-expand-lg navbar-light bg-light" style-height="10">
- <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent"
- aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
- <span class="navbar-toggler-icon"></span>
- </button>
- <div class="collapse navbar-collapse" id="navbarSupportedContent">
- <ul class="navbar-nav mr-auto">
- <li class="nav-item active navbar-brand">
- <h1 class="navbar-brand" href="#">生产线<span>1</span>号</h1>
- </li>
- <li class="nav-item btn navbar-nav" id="show">
- </li>
- </ul>
- <ul style="margin: 0">
- <button type="button" class="btn btn-danger btn-lg" style="width:100% ;background: red;font-size: 2em">
- 下班
- </button>
- </ul>
- <div class="dropdown" style="font-size: 2em">
- <button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu2" data-toggle="dropdown"
- aria-haspopup="true" aria-expanded="false" style="font-size: 0.5em">
- <div class="row">
- <div class="col-4">
- 拉长
- </div>
- <div class="col-5">
- 张三
- </div>
- </div>
- </button>
- <ul class="dropdown-menu" aria-labelledby="dropdownMenu2">
- <li><a href="#">更改密码</a></li>
- <li><a href="#">退出登录</a></li>
- </ul>
- </div>
- </div>
- </nav>
- <section class="content" style="margin: 0 auto;">
- <div class="row" style-height="10"></div>
- <div class="container-fluid " style="margin-bottom: 1em">
- <div style-height="20" class="row text-center">
- <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
- <div class="info-box bg-green hover-expand-effect" style="margin: 0;">
- <div class="icon">
- <i class="material-icons">equalizer</i>
- </div>
- <div class="content">
- <div class="row text-center" style="margin: 0 auto">
- <div class="text" style="font-size: 1.5em;padding-top: 0.2em">合格数:</div>
- <div class="number" style="font-size: 3em">555</div>
- </div>
- </div>
- </div>
- </div>
- <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
- <div class="info-box bg-red hover-expand-effect" style="margin: 0;">
- <div class="icon">
- <i class="material-icons">equalizer</i>
- </div>
- <div class="content">
- <div class="row text-center" style="margin: 0 auto">
- <div class="text" style="font-size: 1.5em;padding-top: 0.2em">不合格数:</div>
- <div class="number" style="font-size: 3em">5255</div>
- </div>
- </div>
- </div>
- </div>
- <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
- <div class="info-box bg-lime hover-expand-effect" style="margin: 0;">
- <div class="icon">
- <i class="material-icons">brightness_low</i>
- </div>
- <div class="content">
- <div class="row text-center" style="margin: 0 auto">
- <div class="text" style="font-size: 1.5em;padding-top: 0.2em">合格率:</div>
- <div class="number" style="font-size: 3em">55%</div>
- </div>
- </div>
- </div>
- </div>
- <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
- <div class="info-box bg-cyan hover-zoom-effect" style="margin: 0; ">
- <div class="icon">
- <i class="material-icons">access_alarm</i>
- </div>
- <div class="content">
- <div class="row text-center" style="margin: 0 auto">
- <div class="text" style="font-size: 1.5em;padding-top: 0.2em">堆积数:</div>
- <div class="number" style="font-size: 3em">235</div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="container-fluid" style="margin-top: 0.5em;padding-top: 1em">
- <div id="graph-1" style-height="30"></div>
- <div class="card" style-height="40" style="margin: 0 auto;">
- <div>
- <div class="" style="">
- <div class="table-responsive" style="width: 30%;float: left">
- <table class="table table-hover dashboard-task-infos">
- <thead>
- <tr style="border-bottom:3px solid black;">
- <th>姓名(工号)</th>
- <th>合格数</th>
- <th>不合格数</th>
- </tr>
- </thead>
- <tbody id="rank-one">
- </tbody>
- </table>
- </div>
- <div class="table-responsive" style="width: 30%;float: left;padding-left: 5em">
- <table class="table table-hover dashboard-task-infos">
- <thead>
- <tr style="border-bottom:3px solid black;">
- <th>姓名(工号)</th>
- <th>合格数</th>
- <th>不合格数</th>
- </tr>
- </thead>
- <tbody id="rank-two">
- </tbody>
- </table>
- </div>
- <div class="table-responsive" style="width: 30%;float: right">
- <table class="table table-hover dashboard-task-infos">
- <thead>
- <tr style="border-bottom:3px solid black;">
- <th>姓名(工号)</th>
- <th>合格数</th>
- <th>不合格数</th>
- </tr>
- </thead>
- <tbody id="rank-three">
- </tbody>
- </table>
- </div>
- </div>
- </div>
- </div>
- <!-- #END# Answered Tickets -->
- </div>
- </section>
- <!-- Jquery Core Js -->
- <script src="plugins/jquery/jquery.min.js"></script>
- <!-- Bootstrap Core Js -->
- <script src="plugins/bootstrap/js/bootstrap.js"></script>
- <!-- Select Plugin Js -->
- <script src="plugins/bootstrap-select/js/bootstrap-select.js"></script>
- <!-- Slimscroll Plugin Js -->
- <script src="plugins/jquery-slimscroll/jquery.slimscroll.js"></script>
- <!-- Waves Effect Plugin Js -->
- <script src="plugins/node-waves/waves.js"></script>
- <!-- Jquery CountTo Plugin Js -->
- <script src="plugins/jquery-countto/jquery.countTo.js"></script>
- <!-- Morris Plugin Js -->
- <script src="plugins/raphael/raphael.min.js"></script>
- <script src="plugins/morrisjs/morris.js"></script>
- <!-- ChartJs -->
- <script src="plugins/chartjs/Chart.bundle.js"></script>
- <!-- Flot Charts Plugin Js -->
- <script src="plugins/flot-charts/jquery.flot.js"></script>
- <script src="plugins/flot-charts/jquery.flot.resize.js"></script>
- <script src="plugins/flot-charts/jquery.flot.pie.js"></script>
- <script src="plugins/flot-charts/jquery.flot.categories.js"></script>
- <script src="plugins/flot-charts/jquery.flot.time.js"></script>
- <!-- Sparkline Chart Plugin Js -->
- <script src="plugins/jquery-sparkline/jquery.sparkline.js"></script>
- <!-- Custom Js -->
- <script src="js/admin.js"></script>
- <!--<script src="js/pages/index.js"></script>-->
- <!-- Demo Js -->
- <script src="js/demo.js"></script>
- <script src="js/basic.js"></script>
- <script>
- function getSpotHtml(htmlbody, one_person, i) {
- htmlbody += "<tr>";
- htmlbody += `<tr>
- <td>${one_person.spotName}(${one_person.id})</td>
- <td>${passNumber[i]}</td>
- <td>${failNumber[i]}</td>
- </tr>`;
- htmlbody += "</tr>";
- return htmlbody;
- }
- function showEachSpot() {
- var htmlbody = "", one_person = "";
- var i = 0;
- var triGap = Math.fround(sID.length / 3);
- var remain = sID.length - triGap * 2;
- for (i = 0; i < triGap; i++) {
- one_person = namedata[i];
- htmlbody = getSpotHtml(htmlbody, one_person, i);
- $("#rank-one").html(htmlbody);
- }
- for (i = 0; i < triGap; i++) {
- one_person = namedata[i+triGap];
- htmlbody = getSpotHtml(htmlbody, one_person, i+triGap);
- $("#rank-two").html(htmlbody);
- }
- for (i = 0; i < remain; i++) {
- one_person = namedata[i+triGap*2];
- htmlbody = getSpotHtml(htmlbody, one_person, i+triGap*2);
- $("#rank-three").html(htmlbody);
- }
- }
- var thisPageFlow = 1;
- function showChart() {
- var data = [];
- var ratedata = [];
- var stackmax = 0;
- var failmax=0;
- for (i = 0; i < passNumber.length; i++) {
- if (stackmax < stackeverynum[i]) {
- stackmax = stackeverynum[i];
- }
- if (failmax < failrate[i]) {
- failmax = failrate[i];
- }
- data.push(stackeverynum[i]);
- ratedata.push(Math.floor(failrate[i]));
- }
- stackmax = Math.max(stackmax,5);
- failmax =Math.max(failmax,5);
- stackAndFailChart = Highcharts.chart('graph-1', {
- chart: {
- zoomType: 'xy'
- },
- title: {
- text: null
- },
- credits: {
- enabled: false // 禁用版权信息
- },
- exporting: {
- enabled: false
- },
- xAxis: [{
- categories: namedata,
- crosshair: true,
- title: {
- text: '员工',
- style: {
- fontSize: '15px'
- }
- },
- labels: {
- style: {
- fontSize: '20px'
- }
- }
- }],
- yAxis: [{ // Primary yAxis
- labels: {
- format: '{value}',
- style: {
- color: Highcharts.getOptions().colors[0],
- fontSize: '20px'
- }
- },
- min: 0,
- max: 1.5 * stackmax,
- title: {
- text: '堆积数',
- style: {
- color: Highcharts.getOptions().colors[0],
- fontSize: '15px'
- }
- }
- }, { // Secondary yAxis
- title: {
- text: '不良率',
- style: {
- color: 'red',
- fontSize: '15px'
- }
- },
- min: 0,
- max: 1.5 * failmax,
- labels: {
- formatter: function() {
- return Math.floor(this.value) + "%";
- },
- style: {
- color: 'red',
- fontSize: '20px'
- }
- },
- opposite: true
- }],
- tooltip: {
- shared: true
- },
- legend: {
- layout: 'vertical',
- align: 'right',
- x: -120,
- verticalAlign: 'top',
- y: 0,
- floating: true,
- backgroundColor: (Highcharts.theme && Highcharts.theme.legendBackgroundColor) || '#FFFFFF'
- },
- series: [{
- name: '堆积数',
- type: 'column',
- data: data,
- tooltip: {
- valueSuffix: ' mm'
- }
- }, {
- name: '不良率',
- type: 'spline',
- yAxis: 1,
- data: ratedata,
- color: 'red',
- tooltip: {
- valueSuffix: '%'
- }
- }]
- });
- }
- function updateChart(){
- var data = [];
- var ratedata = [];
- var stackmax = 0;
- var failmax=0;
- for (i = 0; i < passNumber.length; i++) {
- if (stackmax < stackeverynum[i]) {
- stackmax = stackeverynum[i];
- }
- if (failmax < failrate[i]) {
- failmax = failrate[i];
- }
- data.push(stackeverynum[i]);
- ratedata.push(Math.floor(failrate[i]));
- }
- stackmax = Math.max(stackmax,5);
- failmax =Math.max(failmax,5);
- // https://api.hcharts.cn/highcharts#Series.addPoint;
- stackAndFailChart.series[0].setData(data);
- stackAndFailChart.series[1].setData(ratedata);
- }
- var stackAndFailChart = null;
- $(document).ready(on_document_load);
- window.onresize = resizeAll;
- function resizeAll(){
- $('[style-height="10"]').height(window.innerHeight / 10);
- $('[style-height="20"]').height(window.innerHeight / 5);
- $('[style-height="30"]').height(window.innerHeight / 3.33333);
- $('[style-height="40"]').height(window.innerHeight / 2.5);
- var graph = $("#graph-1");
- graph.width(window.innerWidth);
- graph.height(window.innerHeight / 3.333);
- if(graph.highcharts !== undefined) {
- graph.highcharts().reflow();
- }
- }
- setInterval(function(){
- resizeAll();
- },5000);
- resizeAll();
- startClock();
- </script>
- </body>
- </html>
- <!---
- ### SVR_BASE 类似 "http://127.0.0.1:8803" 实际上线之后是确定值,写死在HTML里的JS里面
- ### 各个拉实时产量数据接口地址
- SVR_BASE + "/server/fcWorkRaw/allFlows"
- ### 单个拉内,所有工位实时产量数据接口地址 e.g. 拉线ID = 2
- SVR_BASE + "/server/fcWorkRaw/allSpots" + "?" + "flowId=2"
- ### 员工上班记录API e.g. 拉线ID = 2 工位顺序 = 1 员工ID = 33404
- SVR_BASE + "/server/fcWorkStartend/goOnline" + "?" + "flowId=2&sequence=1&workerId=33404"
- ### 查询已上班员工 e.g. 拉线ID = 2
- SVR_BASE + "/server/fcWorkRaw/getAll" + "?" + "flowId=2"
- -->
|