Fruit of Eden 6 年 前
コミット
6d3b462cb6
8 ファイル変更56 行追加44 行削除
  1. 1 0
      dapingmu.html
  2. 1 1
      js/basic.js
  3. 30 14
      js/common.js
  4. 0 1
      js/dapingmu-display.js
  5. 12 14
      js/dapingmu.js
  6. 1 1
      js/entrance.js
  7. 9 12
      js/lazhang-data.js
  8. 2 1
      lazhang.html

+ 1 - 0
dapingmu.html

@@ -39,6 +39,7 @@
         /* css 代码  */
         th, td{
             color:white;
+            font-size:2em;
         }
     </style>
     <script src="https://img.hcharts.cn/highcharts/highcharts.js"></script>

+ 1 - 1
js/basic.js

@@ -86,7 +86,7 @@ function group_get_data(groupName, url, callback){
 
 function parse_queue(){
     console.log("Queue Length : " + Queue.list.length);
-    if(Queue.list.length > 5){
+    if(Queue.list.length > 15){
         for(i = 0; i < Queue.list.length; i++) {
             Queue.list.pop();
         }

+ 30 - 14
js/common.js

@@ -7,13 +7,20 @@ function load_table_black_rank() {
 
 }
 
+
+var goodColor = [];
+var badColor = [];
+var userIDs = [];
+var schedulepass = 0, schedulefail = 0, schedulestack = 0;
+var todayotherpass = 0, todayotherfail = 0, todayotherstack = 0;
 var lastTimeHistory = "";
+var histoires = [];
 
 function history_success(obj, sta) {
-    var history = first_parse(this, obj);
+    var histoire = first_parse(this, obj);
     var i, j, t;
-    console.log(" history : ");
-    console.log(history);
+    console.log(" histoire : ");
+    console.log(histoire);
     if (this.url.indexOf("type=1") >= 0) {
         t = 1;
     } else if (this.url.indexOf("type=2") >= 0) {
@@ -24,15 +31,16 @@ function history_success(obj, sta) {
         t = 0;
         return;
     }
+    histoires[t] = histoire;
     if (t === 2 || t === 3) {
         hispass[t] = 0;
         hisfail[t] = 0;
         hisstack[t] = 0;
         hisrate[t] = 0;
-        for (i = 0; i < history.length - 1; i++) { //除了今日
-            hispass[t] = history[i].passNum + hispass[t];
-            hisfail[t] = history[i].failNum + hisfail[t];
-            hisstack[t] = history[i].avgDue + hisstack[t];
+        for (i = 0; i < histoire.length - 1; i++) { //除了今日
+            hispass[t] = histoire[i].passNum + hispass[t];
+            hisfail[t] = histoire[i].failNum + hisfail[t];
+            hisstack[t] = histoire[i].avgDue + hisstack[t];
         }
         orighispass[t] = hispass[t];
         orighisfail[t] = hisfail[t];
@@ -42,15 +50,15 @@ function history_success(obj, sta) {
         hisstack[t] += hisstack[0];
         hisrate[t] = get_factor(hispass[t], hisfail[t]);
     } else if (t === 1) {
-        hispass[1] = history[0].passNum;
-        hisfail[1] = history[0].failNum;
-        hisstack[1] = history[0].avgDue;
+        hispass[1] = histoire[0].passNum;
+        hisfail[1] = histoire[0].failNum;
+        hisstack[1] = histoire[0].avgDue;
         hisrate[t] = get_factor(hispass[1], hisfail[1]);
     }
 
-    todayotherpass = history[history.length - 1].passNum;
-    todayotherfail = history[history.length - 1].failNum;
-    todayotherstack = history[history.length - 1].avgDue;
+    todayotherpass = histoire[histoire.length - 1].passNum;
+    todayotherfail = histoire[histoire.length - 1].failNum;
+    todayotherstack = histoire[histoire.length - 1].avgDue;
 
     update_all_history();
 }
@@ -188,11 +196,19 @@ function getSpotHtml2(htmlbody, i) {
         return htmlbody;
     }
     htmlbody += "<tr>";
-    htmlbody += `<tr style="background-color: ${badColor[i]}">
+    if(typeof badColor[i] === "undefined"){
+        htmlbody += `<tr style="background-color: ${badColor[i]}">
+                    <td>${badid[i]}</td>
+                    <td>${badpass[i]}</td>
+                    <td>${badfailrate[i] + '%'}</td>
+                </tr>`;
+    }else {
+        htmlbody += `<tr style="background-color: ${badColor[i]}">
                     <td>${badid[i]}</td>
                     <td>${badpass[i]}</td>
                     <td>${badfailrate[i] + '%'}</td>
                 </tr>`;
+    }
     htmlbody += "</tr>";
     return htmlbody;
 }

+ 0 - 1
js/dapingmu-display.js

@@ -212,7 +212,6 @@ function updateChart() {
     stackAndFailChart.series[2].setData(stackdata);
     FailChart.series[0].setData(ratedata);
 
-
     showEachSpot();
     showEachSpot1();
     showEachSpot2();

+ 12 - 14
js/dapingmu.js

@@ -41,10 +41,10 @@ function first_success(obj, sta) {
     }
 
     if (output.list.length > 0) {
-        flowIds[0] = output.list[0].sectorId;
+        flowIds[0] = output.list[0].scheduleId;
 
         for (i = 1; i < output.list.length; i++) {
-            var thisUid = output.list[i].flowId;
+            var thisUid = output.list[i].scheduleId;
             x = 0;
             for (j = 0; j < flowIds.length; j++) {
                 if (flowIds[j] === thisUid) {
@@ -65,7 +65,7 @@ function first_success(obj, sta) {
             failNumber[k] = 0;
             stackeverynum[k] = 0;
             for (i = 0; i < output.list.length; i++) {
-                if (uid === output.list[i].flowId) {
+                if (uid === output.list[i].scheduleId) {
                     passNumber[k] = output.list[i].passNum + passNumber[j];
                     failNumber[k] = output.list[i].failNum + failNumber[j];
                     stackeverynum[k] = output.list[i].due + stackeverynum[j];
@@ -79,8 +79,6 @@ function first_success(obj, sta) {
             }
         }
     }
-
-
     for (i = 1; i <= 3; i++) {
         load_flows_history_data(i);
     }
@@ -123,13 +121,13 @@ function realtime_success(obj, sta) {
 
 
     if (output.list.length > 0) {
-        flowIds[0] = output.list[0].flowId;
+        flowIds[0] = output.list[0].scheduleId;
         passNumber[0] = 0;
         failNumber[0] = 0;
         stackeverynum[0] = 0;
         z = 0;
         for (i = 1; i < output.list.length; i++) {
-            var thisUid = output.list[i].flowId;
+            var thisUid = output.list[i].scheduleId;
             x = 0;
             for (j = 0; j < flowIds.length; j++) {
                 if (flowIds[j] === thisUid) {
@@ -150,7 +148,7 @@ function realtime_success(obj, sta) {
             failNumber[k] = 0;
             stackeverynum[k] = 0;
             for (i = 0; i < output.list.length; i++) {
-                if (uid === output.list[i].flowId) {
+                if (uid === output.list[i].scheduleId) {
                     passNumber[k] = output.list[i].passNum + passNumber[k];
                     failNumber[k] = output.list[i].failNum + failNumber[k];
                     stackeverynum[k] = output.list[i].due + stackeverynum[k];
@@ -175,20 +173,20 @@ function realtime_success(obj, sta) {
 
     hispass[0] = hhp;
     hisfail[0] = hhf;
-
     if (output.list.length > 0) {
         hisstack[0] = hhs / output.list.length;
     } else {
         hisstack[0] = 0;
     }
 
-    if (hispass[0] + hisfail[0] <= 0) {
-        hisrate[0] = 0;
+    schedulepass = hhp;
+    schedulefail = hhf;
+    if (output.list.length > 0) {
+        schedulestack = hhs / output.list.length;
     } else {
-        hisrate[0] = Math.floor(hisfail[0] / (hispass[0] + hisfail[0]) * 10000) / 100;
+        schedulestack = 0;
     }
-
-
+    update_all_history();
     updateChart();
 
 }

+ 1 - 1
js/entrance.js

@@ -28,7 +28,7 @@ function first_success(obj, sta) {
     j = 0;
     k = 0;
     for (i = 0; i < output.list.length; i++) {
-        if (userId === output.list[i].flowMasterId) {
+        if (userId === ""+output.list[i].flowMasterId) {
             flowID[j] = output.list[i].flowId;
             flowname[j] = output.list[i].flowName + "(负责人)";
             j++;

+ 9 - 12
js/lazhang-data.js

@@ -18,11 +18,8 @@ var n = 0;
 var sectorID = [];
 var namedata = [];
 var lazhang = {};
-var goodColor = [];
-var badColor = [];
 var scheduleId = utils_get_param("scheduleId");
 var flowId = utils_get_param("flowId");
-var userIDs = [];
 
 function first_success(obj, sta) {
     let output = first_parse(this, obj);
@@ -47,10 +44,10 @@ function first_success(obj, sta) {
     });
 
     if (output.list.length > 0) {
-        sectorID[0] = output.list[0].sectorId;
+        sectorID[0] = getSectorId(output.list[0].spotId);
 
         for (i = 1; i < output.list.length; i++) {
-            var thisUid = output.list[i].sectorId;
+            var thisUid = getSectorId(output.list[i].spotId);
             x = 0;
             for (j = 0; j < sectorID.length; j++) {
                 if (sectorID[j] === thisUid) {
@@ -72,7 +69,7 @@ function first_success(obj, sta) {
             failNumber[k] = 0;
             stackeverynum[k] = 0;
             for (i = 0; i < output.list.length; i++) {
-                if (uid === output.list[i].sectorId) {
+                if (uid === getSectorId(output.list[i].spotId)) {
                     passNumber[k] = output.list[i].passNum + passNumber[j];
                     failNumber[k] = output.list[i].failNum + failNumber[j];
                     stackeverynum[k] = output.list[i].due + stackeverynum[j];
@@ -110,11 +107,13 @@ function request_data_realtime() {
 }
 
 function load_flows_history_data(nnm) {
-    get_data("fcBiFlowDaily/list?scheduleId="+scheduleId+"&type=" + nnm + "&flowId=" + flowId, history_success);
+    // 请注意type必须在结尾
+    get_data("fcBiFlowDaily/list?scheduleId="+scheduleId+ "&flowId=" + flowId+"&type=" + nnm , history_success);
 }
 
 function load_flows_history_realtime_data() {
-    get_data("fcBiFlowDaily/list?type=1&flowId=" + flowId, history_success);
+    // 请注意type必须在结尾
+    get_data("fcBiFlowDaily/list?flowId=" + flowId +"&type=1", history_success);
 }
 function get_stop_scheudle1() {
     var out = confirm("真的要下班吗?");
@@ -174,7 +173,7 @@ function realtime_success(obj, sta) {
 
 
     if (output.list.length > 0) {
-        sectorID[0] = output.list[0].sectorId;
+        sectorID[0] = getSectorId(output.list[0].spotId);
         passNumber[0] = 0;
         failNumber[0] = 0;
         stackeverynum[0] = 0;
@@ -201,7 +200,7 @@ function realtime_success(obj, sta) {
             failNumber[k] = 0;
             stackeverynum[k] = 0;
             for (i = 0; i < output.list.length; i++) {
-                if (uid === output.list[i].sectorId) {
+                if (uid === getSectorId(output.list[i].spotId)) {
                     passNumber[k] = output.list[i].passNum + passNumber[k];
                     failNumber[k] = output.list[i].failNum + failNumber[k];
                     stackeverynum[k] = output.list[i].due + stackeverynum[k];
@@ -229,5 +228,3 @@ function realtime_success(obj, sta) {
 
 }
 
-var schedulepass = 0, schedulefail = 0, schedulestack = 0;
-

+ 2 - 1
lazhang.html

@@ -44,6 +44,7 @@
         /* css 代码  */
         th, td{
             color:#fff;
+            font-size:2em;
         }
     </style>
     <script src="https://img.hcharts.cn/highcharts/highcharts.js"></script>
@@ -101,7 +102,7 @@
 <div class="container" style="max-width:none; !important; padding-top:100px;">
     <div class="alert alert-warning" id="mpAlert" style="display:none">
     </div>
-    <div class="text-white row">
+    <div class="text-white row" style="font-size:2em;">
         <div class="col-md-5">
             <div class="text-center">本拉产能统计</div>
             <table class="table table-bordered text-center" style="color: #ffffff">