Ver código fonte

Merge remote-tracking branch 'origin/master'

Guichuan Yu 6 anos atrás
pai
commit
ca39a38441
1 arquivos alterados com 26 adições e 0 exclusões
  1. 26 0
      js/basic.js

+ 26 - 0
js/basic.js

@@ -18,6 +18,8 @@ function reloadPage(){
 
 let Queue = {THRESHOLD: 1000, IS_LOADED : false, nowuse : 0, SVR_URL:"http://localhost:8803/server/", groupsCount : 0, groups:[], shouldStop : false, backup:["http://localhost:8803/server/","/server/","http://172.30.84.3:8803/server/","https://1.niimei.com/server/"] ,list:[]};
 let Users = {list : []};
+let Sectors = {list : []};
+
 function get_server_url() {
     let output = $.ajax({url: Queue.SVR_URL + "/fcWorker/list?userId=1", timeout:1000 }).fail(on_check_fail).done(function(){
         Queue.IS_LOADED = true;
@@ -256,7 +258,31 @@ function on_username_retn(obj, sta) {
     }
 }
 
+function getSectorName(sectorId){
+    var secName = null;
+    Sectors.list.forEach(function(val, aid, arr){
+        if(val.sector.sectorId === sectorId){
+            secName = val.sector.sectorName;
+        }
+    });
+    if(secName == null) {
+        get_data("fcSector/list?sectorId=" + sectorId, on_secname_retn);
+        return "[工位:"+sectorId+"]";
+    }else{
+        return secName;
+    }
+}
 
+function on_secname_retn(obj, sta) {
+    var secid = this.url.substring(this.url.indexOf("sectorId=") + 9);
+    let rsecid = parseInt(secid);
+    var out = first_parse(this, obj);
+    if(out.list.length > 0){
+        Sectors.list.push({
+            secid : rsecid, sector: out.list[0]
+        });
+    }
+}
 
 $(document).ready(on_document_load);
 get_server_url();