|
@@ -23,7 +23,7 @@ var lazhang = {};
|
|
var scheduleId = utils_get_param("scheduleId");
|
|
var scheduleId = utils_get_param("scheduleId");
|
|
var flowId = utils_get_param("flowId");
|
|
var flowId = utils_get_param("flowId");
|
|
|
|
|
|
-if(flowId == null || scheduleId == null){
|
|
|
|
|
|
+if (flowId == null || scheduleId == null) {
|
|
alert("出错啦!请检查参数完整性");
|
|
alert("出错啦!请检查参数完整性");
|
|
}
|
|
}
|
|
|
|
|
|
@@ -37,60 +37,64 @@ function first_success(obj, sta) {
|
|
failnum = 0;
|
|
failnum = 0;
|
|
let x = 0;
|
|
let x = 0;
|
|
let worksum = [];
|
|
let worksum = [];
|
|
- sectorID[0] = output.list[0].sectorId;
|
|
|
|
z = 0;
|
|
z = 0;
|
|
- if(output.list == undefined || output.list.length == 0){
|
|
|
|
- alert("没有数据,请稍候刷新页面");
|
|
|
|
|
|
+
|
|
|
|
+ if (output.list == undefined || output.list.length == 0) {
|
|
|
|
+ send_alert("没有数据");
|
|
}
|
|
}
|
|
|
|
|
|
- for (i = 1; i < output.list.length; i++) {
|
|
|
|
- var thisUid = output.list[i].sectorId;
|
|
|
|
- x = 0;
|
|
|
|
- for (j = 0; j < sectorID.length; j++) {
|
|
|
|
- if (sectorID[j] === thisUid) {
|
|
|
|
- x = 1;
|
|
|
|
- break;
|
|
|
|
|
|
+ if (output.list.length > 0) {
|
|
|
|
+ sectorID[0] = output.list[0].sectorId;
|
|
|
|
+
|
|
|
|
+ for (i = 1; i < output.list.length; i++) {
|
|
|
|
+ var thisUid = output.list[i].sectorId;
|
|
|
|
+ x = 0;
|
|
|
|
+ for (j = 0; j < sectorID.length; j++) {
|
|
|
|
+ if (sectorID[j] === thisUid) {
|
|
|
|
+ x = 1;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (x === 0) {
|
|
|
|
+ sectorID.push(thisUid);
|
|
}
|
|
}
|
|
- }
|
|
|
|
- if (x === 0) {
|
|
|
|
- sectorID.push(thisUid);
|
|
|
|
- }
|
|
|
|
|
|
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
|
|
|
- j = 0;
|
|
|
|
- for (k = 0; k < sectorID.length; k++) {
|
|
|
|
- var uid = sectorID[k];
|
|
|
|
- z = 0;
|
|
|
|
- passNumber[k] = 0;
|
|
|
|
- failNumber[k] = 0;
|
|
|
|
- stackeverynum[k] = 0;
|
|
|
|
- for (i = 0; i < output.list.length; i++) {
|
|
|
|
- if (uid === output.list[i].sectorId) {
|
|
|
|
- passNumber[k] = output.list[i].passNum + passNumber[j];
|
|
|
|
- failNumber[k] = output.list[i].failNum + failNumber[j];
|
|
|
|
- stackeverynum[k] = output.list[i].due + stackeverynum[j];
|
|
|
|
- z++;
|
|
|
|
|
|
+ j = 0;
|
|
|
|
+ for (k = 0; k < sectorID.length; k++) {
|
|
|
|
+ var uid = sectorID[k];
|
|
|
|
+ z = 0;
|
|
|
|
+ passNumber[k] = 0;
|
|
|
|
+ failNumber[k] = 0;
|
|
|
|
+ stackeverynum[k] = 0;
|
|
|
|
+ for (i = 0; i < output.list.length; i++) {
|
|
|
|
+ if (uid === output.list[i].sectorId) {
|
|
|
|
+ passNumber[k] = output.list[i].passNum + passNumber[j];
|
|
|
|
+ failNumber[k] = output.list[i].failNum + failNumber[j];
|
|
|
|
+ stackeverynum[k] = output.list[i].due + stackeverynum[j];
|
|
|
|
+ z++;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- }
|
|
|
|
- if (failNumber[k] + passNumber[k] == 0) {
|
|
|
|
- failrate[k] = 0;
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- failrate[k] = failNumber[k] / (failNumber[k] + passNumber[k]) * 100;
|
|
|
|
|
|
+ if (failNumber[k] + passNumber[k] == 0) {
|
|
|
|
+ failrate[k] = 0;
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ failrate[k] = failNumber[k] / (failNumber[k] + passNumber[k]) * 100;
|
|
|
|
|
|
- }
|
|
|
|
- /*stackeverynum[k]=stackeverynum[k]/z;*/
|
|
|
|
|
|
+ }
|
|
|
|
+ /*stackeverynum[k]=stackeverynum[k]/z;*/
|
|
|
|
|
|
- ///
|
|
|
|
|
|
+ ///
|
|
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
for (i = 1; i <= 3; i++) {
|
|
for (i = 1; i <= 3; i++) {
|
|
load_flows_history_data(i);
|
|
load_flows_history_data(i);
|
|
}
|
|
}
|
|
showChart();
|
|
showChart();
|
|
-
|
|
|
|
lazhang.timer = setInterval(request_data_realtime, 1000);
|
|
lazhang.timer = setInterval(request_data_realtime, 1000);
|
|
|
|
|
|
}
|
|
}
|
|
@@ -119,11 +123,11 @@ function load_table_black_rank() {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
-function get_stop_scheudle(){
|
|
|
|
|
|
+function get_stop_scheudle() {
|
|
get_data("fcWorkSchedule/stopSchedule?scheduleId=" + scheduleId, stopSuccess);
|
|
get_data("fcWorkSchedule/stopSchedule?scheduleId=" + scheduleId, stopSuccess);
|
|
}
|
|
}
|
|
|
|
|
|
-function stopSuccess(obj, sta){
|
|
|
|
|
|
+function stopSuccess(obj, sta) {
|
|
alert("下班操作成功!");
|
|
alert("下班操作成功!");
|
|
}
|
|
}
|
|
|
|
|
|
@@ -132,17 +136,17 @@ function history_success(obj, sta) {
|
|
var i, j, t;
|
|
var i, j, t;
|
|
console.log(" history : ");
|
|
console.log(" history : ");
|
|
console.log(history);
|
|
console.log(history);
|
|
- if(this.url.indexOf("type=1") >= 0){
|
|
|
|
|
|
+ if (this.url.indexOf("type=1") >= 0) {
|
|
t = 1;
|
|
t = 1;
|
|
- }else if(this.url.indexOf("type=2") >= 0){
|
|
|
|
|
|
+ } else if (this.url.indexOf("type=2") >= 0) {
|
|
t = 2;
|
|
t = 2;
|
|
- }else if(this.url.indexOf("type=3") >= 0) {
|
|
|
|
|
|
+ } else if (this.url.indexOf("type=3") >= 0) {
|
|
t = 3;
|
|
t = 3;
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
t = 0;
|
|
t = 0;
|
|
}
|
|
}
|
|
|
|
|
|
- if(t == 2 || t == 3) {
|
|
|
|
|
|
+ if (t == 2 || t == 3) {
|
|
hispass[t] = 0;
|
|
hispass[t] = 0;
|
|
hisfail[t] = 0;
|
|
hisfail[t] = 0;
|
|
hisstack[t] = 0;
|
|
hisstack[t] = 0;
|
|
@@ -159,7 +163,7 @@ function history_success(obj, sta) {
|
|
hisrate[t] = Math.floor(hisfail[t] / (hispass[t] + hisfail[t]) * 10000) / 100;
|
|
hisrate[t] = Math.floor(hisfail[t] / (hispass[t] + hisfail[t]) * 10000) / 100;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- }else if(t == 1){
|
|
|
|
|
|
+ } else if (t == 1) {
|
|
hispass[1] = history[0].passNum;
|
|
hispass[1] = history[0].passNum;
|
|
hisfail[1] = history[0].failNum;
|
|
hisfail[1] = history[0].failNum;
|
|
hisstack[1] = history[0].avgDue;
|
|
hisstack[1] = history[0].avgDue;
|
|
@@ -247,71 +251,76 @@ function realtime_success(obj, sta) {
|
|
failnum = 0;
|
|
failnum = 0;
|
|
var x = 0;
|
|
var x = 0;
|
|
var worksum = [];
|
|
var worksum = [];
|
|
- sectorID[0] = output.list[0].sectorId;
|
|
|
|
- passNumber[0] = 0;
|
|
|
|
- failNumber[0] = 0;
|
|
|
|
- stackeverynum[0] = 0;
|
|
|
|
- z = 0;
|
|
|
|
- for (i = 1; i < output.list.length; i++) {
|
|
|
|
- var thisUid = output.list[i].sectorId;
|
|
|
|
- x = 0;
|
|
|
|
- for (j = 0; j < sectorID.length; j++) {
|
|
|
|
- if (sectorID[j] === thisUid) {
|
|
|
|
- x = 1;
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if (x === 0) {
|
|
|
|
- sectorID.push(thisUid);
|
|
|
|
- }
|
|
|
|
|
|
+ var hhp = 0, hhf = 0, hhs = 0;
|
|
|
|
|
|
- }
|
|
|
|
- j = 0;
|
|
|
|
- for (k = 0; k < sectorID.length; k++) {
|
|
|
|
- var uid = sectorID[k];
|
|
|
|
|
|
+
|
|
|
|
+ if (output.list.length > 0) {
|
|
|
|
+ sectorID[0] = output.list[0].sectorId;
|
|
|
|
+ passNumber[0] = 0;
|
|
|
|
+ failNumber[0] = 0;
|
|
|
|
+ stackeverynum[0] = 0;
|
|
z = 0;
|
|
z = 0;
|
|
- passNumber[k] = 0;
|
|
|
|
- failNumber[k] = 0;
|
|
|
|
- stackeverynum[k] = 0;
|
|
|
|
- for (i = 0; i < output.list.length; i++) {
|
|
|
|
- if (uid === output.list[i].sectorId) {
|
|
|
|
- passNumber[k] = output.list[i].passNum + passNumber[k];
|
|
|
|
- failNumber[k] = output.list[i].failNum + failNumber[k];
|
|
|
|
- stackeverynum[k] = output.list[i].due + stackeverynum[k];
|
|
|
|
- z++;
|
|
|
|
|
|
+ for (i = 1; i < output.list.length; i++) {
|
|
|
|
+ var thisUid = output.list[i].sectorId;
|
|
|
|
+ x = 0;
|
|
|
|
+ for (j = 0; j < sectorID.length; j++) {
|
|
|
|
+ if (sectorID[j] === thisUid) {
|
|
|
|
+ x = 1;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+ if (x === 0) {
|
|
|
|
+ sectorID.push(thisUid);
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
- if (failNumber[k] + passNumber[k] == 0) {
|
|
|
|
- failrate[k] = 0;
|
|
|
|
- } else {
|
|
|
|
- failrate[k] = failNumber[k] / (failNumber[k] + passNumber[k]) * 100;
|
|
|
|
- }
|
|
|
|
- /*stackeverynum[k]=stackeverynum[k]/z;*/
|
|
|
|
- ///
|
|
|
|
|
|
+ j = 0;
|
|
|
|
+ for (k = 0; k < sectorID.length; k++) {
|
|
|
|
+ var uid = sectorID[k];
|
|
|
|
+ z = 0;
|
|
|
|
+ passNumber[k] = 0;
|
|
|
|
+ failNumber[k] = 0;
|
|
|
|
+ stackeverynum[k] = 0;
|
|
|
|
+ for (i = 0; i < output.list.length; i++) {
|
|
|
|
+ if (uid === output.list[i].sectorId) {
|
|
|
|
+ passNumber[k] = output.list[i].passNum + passNumber[k];
|
|
|
|
+ failNumber[k] = output.list[i].failNum + failNumber[k];
|
|
|
|
+ stackeverynum[k] = output.list[i].due + stackeverynum[k];
|
|
|
|
+ z++;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (failNumber[k] + passNumber[k] == 0) {
|
|
|
|
+ failrate[k] = 0;
|
|
|
|
+ } else {
|
|
|
|
+ failrate[k] = failNumber[k] / (failNumber[k] + passNumber[k]) * 100;
|
|
|
|
+ }
|
|
|
|
+ /*stackeverynum[k]=stackeverynum[k]/z;*/
|
|
|
|
+ ///
|
|
|
|
|
|
|
|
+ }
|
|
|
|
+ output.list.forEach(function (val, fid, arr) {
|
|
|
|
+ hhp += val.passNum;
|
|
|
|
+ hhf += val.failNum;
|
|
|
|
+ hhs += val.due;
|
|
|
|
+ })
|
|
}
|
|
}
|
|
- updateChart();
|
|
|
|
-
|
|
|
|
- var hhp = 0, hhf = 0, hhs = 0;
|
|
|
|
- output.list.forEach(function (val,fid,arr){
|
|
|
|
- hhp += val.passNum;
|
|
|
|
- hhf += val.failNum;
|
|
|
|
- hhs += val.due;
|
|
|
|
- })
|
|
|
|
|
|
|
|
hispass[0] = hhp;
|
|
hispass[0] = hhp;
|
|
hisfail[0] = hhf;
|
|
hisfail[0] = hhf;
|
|
|
|
|
|
- if(output.list.length > 0) {
|
|
|
|
|
|
+ if (output.list.length > 0) {
|
|
hisstack[0] = hhs / output.list.length;
|
|
hisstack[0] = hhs / output.list.length;
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
hisstack[0] = 0;
|
|
hisstack[0] = 0;
|
|
}
|
|
}
|
|
|
|
|
|
- if (hispass[0] + hisfail[0] == 0) {
|
|
|
|
|
|
+ if (hispass[0] + hisfail[0] <= 0) {
|
|
hisrate[0] = 0;
|
|
hisrate[0] = 0;
|
|
} else {
|
|
} else {
|
|
hisrate[0] = Math.floor(hisfail[0] / (hispass[0] + hisfail[0]) * 10000) / 100;
|
|
hisrate[0] = Math.floor(hisfail[0] / (hispass[0] + hisfail[0]) * 10000) / 100;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+ updateChart();
|
|
|
|
+
|
|
}
|
|
}
|