|
@@ -1,7 +1,13 @@
|
|
|
function load_table_red_rank() {
|
|
|
- get_data("fcBiWorkerDaily/get?type=0&limit=3", on_red_rank_success);
|
|
|
+ get_data("fcBiWorkerDaily/get?type=1&limit=3", on_red_rank_success);
|
|
|
}
|
|
|
+function load_table_red_rank1() {
|
|
|
+ get_data("fcBiWorkerDaily/get?type=2&limit=3", on_red_rank_success1);
|
|
|
+}
|
|
|
+function load_table_black_rank1() {
|
|
|
+ get_data("fcBiWorkerDaily/get?type=0&limit=3", on_black_rank_success1);
|
|
|
|
|
|
+}
|
|
|
function load_table_black_rank() {
|
|
|
get_data("fcBiWorkerDaily/get?type=4&limit=3", on_black_rank_success);
|
|
|
|
|
@@ -10,6 +16,8 @@ function load_table_black_rank() {
|
|
|
|
|
|
var goodColor = [];
|
|
|
var badColor = [];
|
|
|
+var goodColor1 = [];
|
|
|
+var badColor1 = [];
|
|
|
var userIDs = [];
|
|
|
var schedulepass = 0, schedulefail = 0, schedulestack = 0;
|
|
|
var todayotherpass = 0, todayotherfail = 0, todayotherstack = 0;
|
|
@@ -112,6 +120,28 @@ function on_red_rank_success(obj, sta) {
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+function on_red_rank_success1(obj, sta) {
|
|
|
+ var redchart = first_parse(this, obj);
|
|
|
+ var i, j;
|
|
|
+ i = j = 0;
|
|
|
+ console.log(" redchart : ");
|
|
|
+ console.log(redchart);
|
|
|
+ for (i = 0; i < redchart.list.length; i++) {
|
|
|
+ goodid1[i] = getUserName(redchart.list[i].workerId);
|
|
|
+ goodpass1[i] = redchart.list[i].passNum;
|
|
|
+ if(redchart.list[i].passNum + redchart.list[i].failNum > 0) {
|
|
|
+ goodfailrate1[i] = Math.floor(redchart.list[i].failNum * 10000 / (redchart.list[i].passNum + redchart.list[i].failNum)) / 100;
|
|
|
+ }else{
|
|
|
+ goodfailrate1[i] = 0;
|
|
|
+ }
|
|
|
+ if(isUserOfThisFlow(redchart.list[i].workerId)){
|
|
|
+ goodColor1[i] = 'red';
|
|
|
+ }else{
|
|
|
+ goodColor1[i] = '';
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
|
|
|
function on_black_rank_success(obj, sta) {
|
|
|
var blackchart = first_parse(this, obj);
|
|
@@ -137,6 +167,30 @@ function on_black_rank_success(obj, sta) {
|
|
|
|
|
|
|
|
|
}
|
|
|
+function on_black_rank_success1(obj, sta) {
|
|
|
+ var blackchart = first_parse(this, obj);
|
|
|
+ var i, j;
|
|
|
+ i = j = 0;
|
|
|
+ console.log(" black chart : ");
|
|
|
+ console.log(blackchart);
|
|
|
+ for (i = 0; i < blackchart.list.length; i++) {
|
|
|
+ badid1[i] = getUserName(blackchart.list[i].workerId);
|
|
|
+ badpass1[i] = blackchart.list[i].passNum;
|
|
|
+ //badfailrate[i] = blackchart.list[i].failRate / 100;
|
|
|
+ if(blackchart.list[i].passNum + blackchart.list[i].failNum > 0) {
|
|
|
+ badfailrate1[i] = Math.floor(blackchart.list[i].failNum * 10000 / (blackchart.list[i].passNum + blackchart.list[i].failNum)) / 100;
|
|
|
+ }else{
|
|
|
+ badfailrate1[i] = 0;
|
|
|
+ }
|
|
|
+ if(isUserOfThisFlow(blackchart.list[i].workerId)){
|
|
|
+ badColor1[i] = 'green';
|
|
|
+ }else{
|
|
|
+ badColor1[i] = '';
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+}
|
|
|
|
|
|
function getSpotHtml(htmlbody, i) {
|
|
|
if(typeof hispass[i] === "undefined"){
|
|
@@ -169,7 +223,7 @@ function getSpotHtml1(htmlbody, i) {
|
|
|
htmlbody += `<tr>
|
|
|
<td> - </td>
|
|
|
<td> - </td>
|
|
|
- <td> - </td>
|
|
|
+
|
|
|
</tr>`;
|
|
|
htmlbody += "</tr>";
|
|
|
return htmlbody;
|
|
@@ -178,7 +232,27 @@ function getSpotHtml1(htmlbody, i) {
|
|
|
htmlbody += `<tr style="background-color: ${goodColor[i]}">
|
|
|
<td>${goodid[i]}</td>
|
|
|
<td>${goodpass[i]}</td>
|
|
|
- <td>${goodfailrate[i] + '%'}</td>
|
|
|
+
|
|
|
+ </tr>`;
|
|
|
+ htmlbody += "</tr>";
|
|
|
+ return htmlbody;
|
|
|
+}
|
|
|
+
|
|
|
+function getSpotHtml3(htmlbody, i) {
|
|
|
+ if(typeof goodid1[i] === "undefined"){
|
|
|
+ htmlbody += "<tr>";
|
|
|
+ htmlbody += `<tr>
|
|
|
+ <td> - </td>
|
|
|
+ <td> - </td>
|
|
|
+
|
|
|
+ </tr>`;
|
|
|
+ htmlbody += "</tr>";
|
|
|
+ return htmlbody;
|
|
|
+ }
|
|
|
+ htmlbody += "<tr>";
|
|
|
+ htmlbody += `<tr style="background-color: ${goodColor1[i]}">
|
|
|
+ <td>${goodid1[i]}</td>
|
|
|
+ <td>${goodfailrate1[i] + '%'}</td>
|
|
|
</tr>`;
|
|
|
htmlbody += "</tr>";
|
|
|
return htmlbody;
|
|
@@ -190,7 +264,7 @@ function getSpotHtml2(htmlbody, i) {
|
|
|
htmlbody += `<tr>
|
|
|
<td> - </td>
|
|
|
<td> - </td>
|
|
|
- <td> - </td>
|
|
|
+
|
|
|
</tr>`;
|
|
|
htmlbody += "</tr>";
|
|
|
return htmlbody;
|
|
@@ -200,19 +274,46 @@ function getSpotHtml2(htmlbody, i) {
|
|
|
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;
|
|
|
+}
|
|
|
+function getSpotHtml4(htmlbody, i) {
|
|
|
+ if(typeof badid1[i] === "undefined"){
|
|
|
+ htmlbody += "<tr>";
|
|
|
+ htmlbody += `<tr>
|
|
|
+ <td> - </td>
|
|
|
+ <td> - </td>
|
|
|
+
|
|
|
+ </tr>`;
|
|
|
+ htmlbody += "</tr>";
|
|
|
+ return htmlbody;
|
|
|
+ }
|
|
|
+ htmlbody += "<tr>";
|
|
|
+ if(typeof badColor1[i] === "undefined"){
|
|
|
+ htmlbody += `<tr style="background-color: ${badColor1[i]}">
|
|
|
+ <td>${badid1[i]}</td>
|
|
|
+
|
|
|
+ <td>${badfailrate1[i] + '%'}</td>
|
|
|
+ </tr>`;
|
|
|
+ }else {
|
|
|
+ htmlbody += `<tr style="background-color: ${badColor1[i]}">
|
|
|
+ <td>${badid1[i]}</td>
|
|
|
+
|
|
|
+ <td>${badfailrate1[i] + '%'}</td>
|
|
|
</tr>`;
|
|
|
}
|
|
|
htmlbody += "</tr>";
|
|
|
return htmlbody;
|
|
|
}
|
|
|
-
|
|
|
|
|
|
var lastTimeRank1 = "";
|
|
|
var lastTimeRank2 = "";
|
|
@@ -250,6 +351,22 @@ function showEachSpot1() {
|
|
|
}
|
|
|
//console.log(htmlbody);
|
|
|
}
|
|
|
+function showEachSpot3() {
|
|
|
+
|
|
|
+ var htmlbody = "", one_person = "";
|
|
|
+ var i = 0;
|
|
|
+ var triGap = 3;
|
|
|
+ htmlbody = "";
|
|
|
+ for (i = 0; i < triGap; i++) {
|
|
|
+
|
|
|
+ htmlbody = getSpotHtml3(htmlbody, i);
|
|
|
+ }
|
|
|
+ if(lastTimeRank2 !== htmlbody){
|
|
|
+ $("#rank-four").html(htmlbody);
|
|
|
+ lastTimeRank2 = htmlbody;
|
|
|
+ }
|
|
|
+ //console.log(htmlbody);
|
|
|
+}
|
|
|
|
|
|
function showEachSpot2() {
|
|
|
var htmlbody = "", one_person = "";
|
|
@@ -262,6 +379,22 @@ function showEachSpot2() {
|
|
|
htmlbody = getSpotHtml2(htmlbody, i);
|
|
|
}
|
|
|
if(lastTimeRank3 !== htmlbody){
|
|
|
+ $("#rank-five").html(htmlbody);
|
|
|
+ lastTimeRank3 = htmlbody;
|
|
|
+ }
|
|
|
+ //console.log(htmlbody);
|
|
|
+}
|
|
|
+function showEachSpot4() {
|
|
|
+ var htmlbody = "", one_person = "";
|
|
|
+ var i = 0;
|
|
|
+ var triGap = 3;
|
|
|
+
|
|
|
+ htmlbody = "";
|
|
|
+ for (i = 0; i < triGap; i++) {
|
|
|
+
|
|
|
+ htmlbody = getSpotHtml4(htmlbody, i);
|
|
|
+ }
|
|
|
+ if(lastTimeRank3 !== htmlbody){
|
|
|
$("#rank-three").html(htmlbody);
|
|
|
lastTimeRank3 = htmlbody;
|
|
|
}
|