Sfoglia il codice sorgente

Change stuff and realtime JS made

Guichuan Yu 6 anni fa
parent
commit
85f3cf5d9c
4 ha cambiato i file con 62 aggiunte e 64 eliminazioni
  1. 27 22
      js/common.js
  2. 15 0
      js/lazhang-data.js
  3. 6 7
      js/lazhang-display.js
  4. 14 35
      lazhang.html

+ 27 - 22
js/common.js

@@ -240,22 +240,24 @@ function getSpotHtml1(htmlbody, i) {
         htmlbody += `<tr>
                     <td> - </td>
                     <td> - </td>
-                    
+                    <td> - </td>
+                    <td> - </td>
                 </tr>`;
         htmlbody += "</tr>";
         return htmlbody;
     }
     htmlbody += "<tr>";
-    htmlbody += `<tr style="background-color: ${goodColor[i]}">
-                    <td>${goodid[i]}</td>
-                    <td>${goodpass[i]}</td>
-                    
+    htmlbody += `<tr ">
+                    <td style="background-color: ${goodColor[i]}">${goodid[i]}</td>
+                    <td style="background-color: ${goodColor[i]}">${goodpass[i]}</td>
+                    <td style="background-color: ${goodColor1[i]}">${goodid1[i]}</td>
+                    <td style="background-color: ${goodColor1[i]}">${goodfailrate1[i] + '%'}</td>
                 </tr>`;
     htmlbody += "</tr>";
     return htmlbody;
 }
 
-function getSpotHtml3(htmlbody, i) {
+/*function getSpotHtml3(htmlbody, i) {
     if(typeof goodid1[i] === "undefined"){
         htmlbody += "<tr>";
         htmlbody += `<tr>
@@ -273,7 +275,7 @@ function getSpotHtml3(htmlbody, i) {
                 </tr>`;
     htmlbody += "</tr>";
     return htmlbody;
-}
+}*/
 
 function getSpotHtml2(htmlbody, i) {
     if(typeof badid[i] === "undefined"){
@@ -281,29 +283,32 @@ function getSpotHtml2(htmlbody, i) {
         htmlbody += `<tr>
                     <td> - </td>
                     <td> - </td>
-                    
+                    <td> - </td>
+                    <td> - </td>
                 </tr>`;
         htmlbody += "</tr>";
         return htmlbody;
     }
     htmlbody += "<tr>";
     if(typeof badColor[i] === "undefined"){
-        htmlbody += `<tr style="background-color: ${badColor[i]}">
-                    <td>${badid[i]}</td>
-                    <td>${badpass[i]}</td>
-                    
+        htmlbody += `<tr>
+                    <td style="background-color: ${badColor[i]}">${badid[i]}</td>
+                    <td style="background-color: ${badColor[i]}">${badpass[i]}</td>
+                    <td style="background-color: ${badColor1[i]}">${badid1[i]}</td>
+                    <td style="background-color: ${badColor1[i]}">${badfailrate1[i] + '%'}</td>
                 </tr>`;
     }else {
-        htmlbody += `<tr style="background-color: ${badColor[i]}">
-                    <td>${badid[i]}</td>
-                    <td>${badpass[i]}</td>
-                    
+        htmlbody += `<tr >
+                    <td style="background-color: ${badColor[i]}">${badid[i]}</td>
+                    <td style="background-color: ${badColor[i]}">${badpass[i]}</td>
+                    <td style="background-color: ${badColor1[i]}">${badid1[i]}</td>
+                    <td style="background-color: ${badColor1[i]}">${badfailrate1[i] + '%'}</td>
                 </tr>`;
     }
     htmlbody += "</tr>";
     return htmlbody;
 }
-function getSpotHtml4(htmlbody, i) {
+/*function getSpotHtml4(htmlbody, i) {
     if(typeof badid1[i] === "undefined"){
         htmlbody += "<tr>";
         htmlbody += `<tr>
@@ -329,7 +334,7 @@ function getSpotHtml4(htmlbody, i) {
     }
     htmlbody += "</tr>";
     return htmlbody;
-}
+}*/
 
 var lastTimeRank0 = "";
 var lastTimeRank1 = "";
@@ -369,7 +374,7 @@ function showEachSpot1() {
     }
     //console.log(htmlbody);
 }
-function showEachSpot3() {
+/*function showEachSpot3() {
 
     var htmlbody = "", one_person = "";
     var i = 0;
@@ -384,7 +389,7 @@ function showEachSpot3() {
         lastTimeRank3 = htmlbody;
     }
     //console.log(htmlbody);
-}
+}*/
 
 function showEachSpot2() {
     var htmlbody = "", one_person = "";
@@ -402,7 +407,7 @@ function showEachSpot2() {
     }
     //console.log(htmlbody);
 }
-function showEachSpot4() {
+/*function showEachSpot4() {
     var htmlbody = "", one_person = "";
     var i = 0;
     var triGap = 3;
@@ -417,4 +422,4 @@ function showEachSpot4() {
         lastTimeRank4 = htmlbody;
     }
     //console.log(htmlbody);
-}
+}*/

+ 15 - 0
js/lazhang-data.js

@@ -10,6 +10,7 @@ var namedata = [];
 var lazhang = {};
 var scheduleId = utils_get_param("scheduleId");
 var flowId = utils_get_param("flowId");
+var name1,name2;
 
 function first_success(obj, sta) {
     let output = first_parse(this, obj);
@@ -79,6 +80,7 @@ function first_success(obj, sta) {
 
         }
     }
+    get_data("fcFlow/list?flowId="+ flowId,name_Success);
 
 
     for (i = 1; i <= 3; i++) {
@@ -86,6 +88,17 @@ function first_success(obj, sta) {
     }
     showChart();
     lazhang.timer = setInterval(request_data_realtime, 1000);
+    document.getElementById("test1").innerHTML = name1;
+
+}
+function name_Success(obj, sta) {
+    var factory = first_parse(this, obj);
+    var i, j, t;
+    console.log(" factory : ");
+    console.log(factory);
+
+    name1=factory.list.flowPlace;
+    name2=factory.list.flowName;
 
 }
 
@@ -121,12 +134,14 @@ function get_stop_scheudle1() {
 
 function get_stop_scheudle() {
     get_data("fcWorkSchedule/stopSchedule?scheduleId=" + scheduleId, stopSuccess);
+
 }
 
 function stopSuccess(obj, sta) {
     send_alert("下班操作成功! <a href='denglu.html'> 点击这里返回控制主页 </a>");
 }
 
+
 function add_success(obj, sta) {
     var history1 = first_parse(this, obj);
     var i, j;

+ 6 - 7
js/lazhang-display.js

@@ -5,7 +5,8 @@ if (flowId == null || scheduleId == null) {
 }
 
 function page_document_load() {
-    get_data("fcWorkScheduleLoad/list?scheduleId=" + scheduleId, first_success)
+    get_data("fcWorkScheduleLoad/list?scheduleId=" + scheduleId, first_success);
+
 }
 
 var compAxis = {
@@ -58,8 +59,7 @@ function showChart() {
     showEachSpot();
     showEachSpot1();
     showEachSpot2();
-    showEachSpot3();
-    showEachSpot4();
+
 
     failratemax = Math.max(failratemax, 5);
     stackmax = Math.max(stackmax, 5);
@@ -97,7 +97,7 @@ function showChart() {
         legend: {
             layout: 'vertical',
             align: 'right',
-            x: -100,
+            x: 0,
             verticalAlign: 'top',
             y: 0,
             floating: true,
@@ -162,7 +162,7 @@ function showChart() {
         legend: {
             layout: 'vertical',
             align: 'right',
-            x: -120,
+            x: 0,
             verticalAlign: 'top',
             y: 0,
             floating: true,
@@ -232,8 +232,7 @@ function updateChart() {
     showEachSpot();
     showEachSpot1();
     showEachSpot2();
-    showEachSpot3();
-    showEachSpot4();
+
 
     var secNames = [];
 

+ 14 - 35
lazhang.html

@@ -92,13 +92,13 @@
     </script>
 </head>
 
-<body class="theme-black" style="background-color: #2d2d2d !important;" onload="startTime()">
+<body class="theme-black" style="background-color: #2d2d2d !important;overflow: hidden" onload="startTime()">
 <nav class="navbar" style="background-color: red">
     <div class="container-fluid">
         <div class="navbar-header">
-            <a class="navbar-brand" href="#" onclick="location.href='denglu.html'">工厂产能监控系统</a>
+            <a class="navbar-brand" href="#" onclick="location.href='denglu.html'" >工厂产能监控系统</a>
         </div>
-        <div style="color:#fff" class="text-center"><img src="images/logo.jpg" style="width: 10%;"> 深圳市度彼电子有限公司——激光厂产线1</div>
+        <div style="color:#fff" class="text-center" id="test1"> 深圳市度彼电子有限公司——激光厂产线1</div>
 
         <font color="#ffffff"><span id="nowDateTimeSpan"></span></font>
         <div onclick="get_stop_scheudle1()" class="btn btn-warning"> 下班 </div>
@@ -129,16 +129,17 @@
         <div class="col-md-7 text-white">
             <div class="text-center text-lg big-letter">本厂今日生产能手榜</div>
             <div class="row">
-                <div class="col-6 text-center big-letter">红榜</div>
-                <div class="col-6 text-center big-letter">黑榜</div>
-            </div>
-            <div class="row">
-                <div class="col-md-3">
+                <div class="col-md-6">
                     <table class="table table-bordered text-center table-striped">
                         <thead>
                         <tr>
+                            <th scope="col" colspan="4">红榜</th>
+                        </tr>
+                        <tr>
                             <th>人员</th>
                             <th>良品数</th>
+                            <th>人员</th>
+                            <th>不良率</th>
 
                         </tr>
                         </thead>
@@ -147,25 +148,18 @@
 
                     </table>
                 </div>
-                <div class="col-md-3">
+
+                <div class="col-md-6">
                     <table class="table table-bordered text-center table-striped">
                         <thead>
                         <tr>
-                            <th>人员</th>
-                            <th>不良率</th>
-
+                            <th scope="col" colspan="4">黑榜</th>
                         </tr>
-                        </thead>
-                        <tbody id="rank-four">
-                        </tbody>
-                    </table>
-                </div>
-                <div class="col-md-3">
-                    <table class="table table-bordered text-center table-striped">
-                        <thead>
                         <tr>
                             <th>人员</th>
                             <th>良品数</th>
+                            <th>人员</th>
+                            <th>不良率</th>
 
                         </tr>
                         </thead>
@@ -173,22 +167,7 @@
                         </tbody>
                     </table>
                 </div>
-                <div class="col-md-3">
-                    <table class="table table-bordered text-center table-striped">
-                        <thead>
-                        <tr>
 
-                        </tr>
-                        <tr>
-                            <th>人员</th>
-
-                            <th>不良率</th>
-                        </tr>
-                        </thead>
-                        <tbody id="rank-five">
-                        </tbody>
-                    </table>
-                </div>
             </div>
         </div>
     </div>