obj=""; obj2 = ""; get_org(); function get_org(){ var xhr = new XMLHttpRequest(); var url = "/org"; xhr.open("GET",url); xhr.onload = function(){ obj = JSON.parse(xhr.responseText); //insertHTML(); start(); onChangeColumn1(); onChangeColumn2(); onChangeColumn3(); click_button(); }; xhr.send(); } function insertHTML2(data){ //aria.innerHTML=data[0].tower_name; var inner=''; for(var i=0;i'+data[i].tower_name+''; } document.getElementById("tower").innerHTML=inner; } function click_button() { //alert("click"); companySelect=document.getElementById("company-list"); factorySelect=document.getElementById("factory-list"); departmentSelect=document.getElementById("department-list"); towerGroupSelect=document.getElementById("towerGroup-list"); if(companySelect.value!=0 && factorySelect.value!=0 && departmentSelect.value!=0 && towerGroupSelect.value!=0){ var url2 = "tower/?company="+ companySelect.value + "&factory=" + factorySelect.value + "&department=" +departmentSelect.value + "&towerGroup=" +towerGroupSelect.value ; var xhr2 = new XMLHttpRequest(); xhr2.open("GET",url2); xhr2.onload = function(){ obj2 = JSON.parse(xhr2.responseText); insertHTML2(obj2); console.log(obj2); }; xhr2.send(); } } function start(){ companySelect=document.getElementById("company-list"); factorySelect=document.getElementById("factory-list"); departmentSelect=document.getElementById("department-list"); towerGroupSelect=document.getElementById("towerGroup-list"); var inner=''; var company_arr = new Array(); for(var i=0;i公司'+obj[i].company+''; company_arr.push(obj[i].company); } } //innerHTML 賦值inner給這element屬性 companySelect.innerHTML=inner; } //製造一個字串,以html的語法填入院的陣列 function onChangeColumn1() { companySelect=document.getElementById("company-list"); factorySelect=document.getElementById("factory-list"); departmentSelect=document.getElementById("department-list"); towerGroupSelect=document.getElementById("towerGroup-list"); factorySelect.innerHTML=''; let factory_arr = new Array(); let factory_inner = ''; for(var i=0;i廠區'+obj[i].factory+''; factory_arr.push(obj[i].factory); } } //alert(companySelect.value); } factorySelect.innerHTML=factory_inner; } function onChangeColumn2() { companySelect=document.getElementById("company-list"); factorySelect=document.getElementById("factory-list"); departmentSelect=document.getElementById("department-list"); towerGroupSelect=document.getElementById("towerGroup-list"); departmentSelect.innerHTML=''; let department_arr = new Array(); let department_inner = ''; for(var i=0;i課'+obj[i].department+''; department_arr.push(obj[i].department); } } } document.getElementById("department-list").innerHTML=department_inner; } function onChangeColumn3() { companySelect=document.getElementById("company-list"); factorySelect=document.getElementById("factory-list"); departmentSelect=document.getElementById("department-list"); towerGroupSelect=document.getElementById("towerGroup-list"); towerGroupSelect.innerHTML=''; let towerGroup_inner = ''; for(var i=0;i機組'+obj[i].group[ii]+''; } } } } document.getElementById("towerGroup-list").innerHTML= towerGroup_inner; } function get_data(){ var xhr = new XMLHttpRequest(); var url = "channel/dev001/ch01"; obj3=""; xhr.open("GET",url); xhr.onload = function(){ obj3 = JSON.parse(xhr.responseText); insertHTML(obj3); console.log(obj3); }; xhr.send(); } function insertHTML(data){ console.log(data); //aria.innerHTML=data[0].tower_name; var inner=''; inner+=''; inner+=''; inner+=''; inner+=''; inner+=''; document.getElementById("channel").innerHTML=inner; } get_data(); get_chart_data(); function get_chart_data(){ var xhr = new XMLHttpRequest(); var url = "channel_chart/dev001/ch01"; obj=""; xhr.open("GET",url); xhr.onload = function(){ obj = JSON.parse(xhr.responseText); for(var i=0;i
主軸分析 軸承分析 馬達分析 齒輪分析
正常 不平衡 '+data.DW_Unbalance+'正常 油膜旋震 '+data.DW_Whirl+'正常 氣隙不均 '+data.DW_AirGap+'正常 齒輪不對中 '+data.DW_GMisalignment+'
正常 軸彎曲 '+data.DW_Unbalance+'正常 油膜晃蕩 '+data.DW_Whirl+'正常 轉子條斷裂 '+data.DW_AirGap+'正常 齒輪斷齒 '+data.DW_GMisalignment+'
正常 不對中 '+data.DW_Unbalance+'正常 內還損傷 '+data.DW_Whirl+'正常 相位問題 '+data.DW_AirGap+'正常 齒輪磨損 '+data.DW_GMisalignment+'
正常 鬆動 '+data.DW_Unbalance+'正常 外環損傷 '+data.DW_Whirl+'正常 齒輪彎曲 '+data.DW_GMisalignment+'
正常 滾珠損傷 '+data.DW_Whirl+'正常 齒輪偏心 '+data.DW_GMisalignment+'