var SVR_URL = "/server/"; //http://172.30.84.3:8803 if(location.host.indexOf("niimei") === -1){ SVR_URL = "http://172.30.84.3:8803/server/"; } function get_data(url, callback) { $.ajax({ url: SVR_URL + url, apiName: url, sendTime: new Date() }).done(callback).fail(on_fail); } function on_fail(msg) { alert("很抱歉,网络错误,请查看Console"); console.log("----- 网络请求失败 ---------") console.log(JSON.stringify(this)); console.log("----------------------------") } function on_data_success(obj, status) { } function first_parse(ajax, obj) { if (typeof obj === "string") { obj = JSON.parse(obj); } if (typeof obj !== "object") { console.log(ajax); throw "Error ! Parsing JSON failed ." + JSON.stringify(obj); } if (obj.ret == "10000" || obj.ret == 10000 || obj.ret == 1000) { return obj.model; } else { console.log(ajax); throw "Error ! Server returned error." + JSON.stringify(obj); } } var flowData; var sID = []; var passNumber = []; var failNumber = []; var failrate = []; var stacknum = 0; var stackeverynum = []; var failnum=0; var passnum=0 var passdata=[]; var faildata=[]; var num=0; var hispass=[]; var hisfail=[]; var hisstack=[]; var hisrate=[]; var goodpass=[]; var goodid=[]; var goodfailrate=[]; var badpass=[]; var badid=[]; var badfailrate=[]; var t=0; var n=0; var workID=[]; function firsttime_load_spots_data() { get_data("fcWorkScheduleLoad/list?scheduleId=" + scheduleId, first_success) } function secondtime_load_spots_data() { get_data("fcBiFlowDaily/list?type=" + num +"&flowId="+flowId, second_success); num++; } function chart_load_spots_data() { get_data("fcBiWorkerDaily/get?type=0&limit=3", chart_success); } function chart1_load_spots_data() { get_data("fcBiWorkerDaily/get?type=4&limit=3", chart1_success); } function first_success(obj, sta) { var output = first_parse(this, obj); //在这里排序 spo\ console.log(" output : "); console.log(output); var i, j,k,z; failnum=0; var x=0; var worksum=[]; workID[0]=output.list[0].userId; passNumber[0]=0; failNumber[0]=0; stackeverynum[0]=0; z=0; for(i=1;i spotsList.list[j + 1].orderNum) { temp = spotsList.list[j]; spotsList.list[j] = spotsList.list[j + 1]; spotsList.list[j + 1] = temp; } } } flowData = spotsList.list; for (i = 0; i < spotsList.list.length ; i++) { sID[i] = spotsList.list[i].spotId; namedata[i] = spotsList.list[i].spotName; } firsttime_load_spots_data(); }*/ function on_document_load() { // First Step //get_data("fcSpot/list?flowId=" + scheduleId, on_load_success_spots) firsttime_load_spots_data(); } var namedata = [];