Browse Source

大屏图标

skcj 1 year ago
parent
commit
5675b6ebc2
2 changed files with 77 additions and 15 deletions
  1. 9 0
      ruoyi-ui/src/api/bigScreen.js
  2. 68 15
      ruoyi-ui/src/views/bigScreen/resources/index.vue

+ 9 - 0
ruoyi-ui/src/api/bigScreen.js

@@ -125,3 +125,12 @@ export function getSqxq(params) {
     params: params
   })
 }
+
+// 机构下社区
+export function getXfxzqhid(params) {
+  return request({
+    url: '/system/xzqhWl/xfId',
+    method: 'get',
+    params: params
+  })
+}

+ 68 - 15
ruoyi-ui/src/views/bigScreen/resources/index.vue

@@ -102,7 +102,16 @@
 import AMapLoader from '@amap/amap-jsapi-loader'
 import { mapState } from 'vuex'
 import { getstatisticaldata } from '@/api/system/dict/type'
-import { getOldmanMarkers, getOrgMarkers, getServiceMarkers, getMonitorMarkers, getSmartMarkers, getRegion,getSqxq } from '@/api/bigScreen'
+import {
+  getOldmanMarkers,
+  getOrgMarkers,
+  getServiceMarkers,
+  getMonitorMarkers,
+  getSmartMarkers,
+  getRegion,
+  getSqxq,
+  getXfxzqhid
+} from '@/api/bigScreen'
 
 
 import Oldman from './components/Oldman.vue'
@@ -185,6 +194,7 @@ export default {
       deptcurrxzqh:'',
       deptcurrlevel:0,
       locationCode:'',
+      xfxzqhid:'',
       currsqData:[],
     }
   },
@@ -222,6 +232,7 @@ export default {
     this.clickScreen()
     this.getMarkerList()
     this.getSqxqa()
+    this.getXfxzqhida()
   },
   methods: {
     async getTotalList() {
@@ -231,6 +242,13 @@ export default {
         this.totalObj = data[0].vales[0]
       }
     },
+    getXfxzqhida()
+    {
+      getXfxzqhid({code:this.locationcurrCode}).then(({ code, msg }) => {
+        if (code !== 200) return
+        this.xfxzqhid=msg;
+      })
+    },
     async getSqxqa() {
       const retdata = await getSqxq({code:this.locationcurrCode})
       if (retdata.code === 200) {
@@ -244,6 +262,31 @@ export default {
         })
       }
     },
+    getheatdata(fl) {
+        this.heatmapData=[];
+        this.currsqData.forEach((item) => {
+          let coluts = Math.floor(Math.random() * 101) + 1;
+          if (fl==0)
+          {
+            coluts=parseInt(item.sixtym)+parseInt(item.sixtyw);
+          }
+
+          if (fl==1)
+          {  coluts=parseInt(item.yljg)+parseInt(item.sqyljg);}
+
+          if (fl==2)
+          {  coluts=parseInt(item.wlfws);}
+
+          if (fl==3)
+          {  coluts=parseInt(item.jklx);}
+
+          if (fl==4)
+          {  coluts=parseInt(item.znsb);}
+
+          this.heatmapData.push({"lng": item.lng, "lat": item.lat, "count": coluts})
+        })
+
+    },
     clearMap()
     {
       this.map.clearMap();
@@ -263,12 +306,16 @@ export default {
     },
 
     getMarkerByFl(fl) {
+      this.getheatdata(fl);
       this.clearMap();
       switch (fl) {
         case 0 :
-          getOldmanMarkers(this.PTParams).then(({ code, data }) => {
-            if (code !== 200) return
-            this.querydata=data;
+            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
@@ -286,7 +333,7 @@ export default {
             {
               this.clearMap();
             }
-          })
+
           break
         case 2 :
           getServiceMarkers(this.PTParams).then(({ code, data }) => {
@@ -689,19 +736,23 @@ export default {
         let coluts= Math.floor(Math.random() * 101)+1;
        // this.heatmapData.push({"lng": item.lng,"lat": item.lat,"count":coluts})
         if (fl == 0) { //老人
+          if (item.photoAndLocation && item.photoAndLocation.split("/").length==3) {
+
+
           markeroption= {
-            position: new AMap.LngLat(item.lng, item.lat),
+            position: new AMap.LngLat(item.photoAndLocation.split("/")[0], item.photoAndLocation.split("/")[1]),
             icon:  this.Icons.oldman,
             label: {
-              content: item.mc,
+              content: item.name,
               direction: 'bottom',
-              extData: item.id
+              extData: item._id
             },
             anchor: 'bottom-center'
           }
           markerExtData={
             style:  this.Icons.oldman._opts.image
           }
+          }
         }
         if (fl == 1) {//养老机构
           markeroption= {
@@ -712,7 +763,7 @@ export default {
               direction: 'bottom',
               extData: item.id
             },
-            anchor: 'bottom-center'
+            //anchor: 'bottom-center'
           }
           markerExtData={
             style: item.lb === 'yljg' ? this.Icons.yljg._opts.image : this.Icons.sqyljg._opts.image
@@ -785,12 +836,14 @@ export default {
           let coluts= Math.floor(Math.random() * 101)+1;
          // this.heatmapData.push({"lng": item.lng,"lat": item.lat,"count":coluts});
           if (fl == 0) { //老人
-            this.latdata.push({
-              lnglat: [item.lng, item.lat],
-              name: item.mc,
-              id: item.id,
-              style: this.Icons.oldman._opts.image,
-            });
+            if (item.photoAndLocation && item.photoAndLocation.split("/").length==3) {
+              this.latdata.push({
+                lnglat: [item.photoAndLocation.split("/")[0], item.photoAndLocation.split("/")[1]],
+                name: item.name,
+                id: item._id,
+                style: this.Icons.oldman._opts.image,
+              });
+            }
           }
           if (fl == 1) {//养老机构
             this.latdata.push({