Browse Source

Merge branch '王立生' of sckj/mz-cloud into master

sckj 1 year ago
parent
commit
3089aaf649
1 changed files with 27 additions and 22 deletions
  1. 27 22
      ruoyi-ui/src/views/bigScreen/resources/index.vue

+ 27 - 22
ruoyi-ui/src/views/bigScreen/resources/index.vue

@@ -310,29 +310,34 @@ export default {
       this.clearMap();
       switch (fl) {
         case 0 :
-            var xhr = new XMLHttpRequest()
-            xhr.open("get", '/getxflrdata?deptbm=' + this.xfxzqhid+"&level=3", false);
-            xhr.setRequestHeader("Content-Type","application/json;charset=utf-8");
-            xhr.send();
-            // return  JSON.parse(xhr.responseText);
-            this.querydata=JSON.parse(xhr.responseText).data;
-            if (this.deptcurrlevel<3)
-              this.setClusterMarker(this.querydata,fl);
-            else
-              this.map.add(this.setMarker(this.querydata,fl));
-            if(this.pattern==1)
-            {
-              this.clearMap();
-              this.setheat();
-            }
-            if(this.pattern==2)
-            {
-              this.setTimeCircle();
-            }
-            if(this.pattern==3)
-            {
-              this.clearMap();
+          var xhr = new XMLHttpRequest();
+          xhr.open('GET', '/getxflrdata?deptbm=' + this.xfxzqhid+"&level=3", true);
+          xhr.setRequestHeader("Content-Type","application/json;charset=utf-8");
+          xhr.onreadystatechange = function() {
+            if (xhr.readyState === XMLHttpRequest.DONE && xhr.status === 200) {
+              this.querydata=JSON.parse(xhr.responseText).data;
+              if (this.deptcurrlevel<3)
+                this.setClusterMarker(this.querydata,fl);
+              else
+                this.map.add(this.setMarker(this.querydata,fl));
+              if(this.pattern==1)
+              {
+                this.clearMap();
+                this.setheat();
+              }
+              if(this.pattern==2)
+              {
+                this.setTimeCircle();
+              }
+              if(this.pattern==3)
+              {
+                this.clearMap();
+              }
             }
+          }.bind(this);
+          xhr.send();
+
+
 
           break
         case 2 :