保安监管系统-验收版本
liuyg
2021-11-26 e7e22c7db2d75969b986a512047ae345e97ad9d7
Merge branch 'master' of http://s16s652780.51mypc.cn:49896/r/zhba_regulatory_ys
1 files modified
102 ■■■■ changed files
src/views/home/index.vue 102 ●●●● patch | view | raw | blame | history
src/views/home/index.vue
@@ -714,6 +714,9 @@
  getSubstationWarnInfoPage
} from "../../api/index/index";
import { getPosition, getNewPeople } from "@/api/map/people";
import { getNewPosition } from "@/api/map/car";
import car from "@/assets/img/car.png";
import peo from "@/assets/img/people.png";
import gun from "@/assets/img/gun.png";
@@ -792,7 +795,9 @@
      },
      node1: {}, //选中的记录
      node2: {},
      params: null
      params: null,
      peopleGps: {},
      carGps: {}
    };
  },
  computed: {
@@ -804,6 +809,36 @@
    }
  },
  methods: {
    getPeoplePosition() {
      getPosition({ type: 1, workerId: "1432897970143014913" }).then(result => {
        getNewPeople().then(res => {
          if (JSON.stringify(res.data) != "{}") {
            var arr = res.data.sort(function(a, b) {
              return a["date"] < b["date"] ? 1 : -1;
            });
            this.peopleGps = {
              LGTD: arr[0].gis_jd,
              LTTD: arr[0].gis_wd
            };
          }
          this.getCarPosition();
        });
      });
    },
    getCarPosition() {
      getNewPosition({ imei: "861636056082414" }).then(result => {
        var res = result.data.data;
        if (JSON.stringify(res) != "{}") {
          this.carGps = {
            LGTD: res.x,
            LTTD: res.y
          };
        }
        this.getTableData(0);
      });
    },
    //点击节点
    handleNodeClick1(data) {
      this.value1 = data;
@@ -1155,26 +1190,56 @@
              carNum: m.carNum,
              id: m.id
            };
            if (
              m.longitude &&
              m.latitude &&
              m.longitude !== "0" &&
              m.latitude !== "0"
            ) {
              middleData[m.type]["geoData"].push([
                m.id,
                Number(m.longitude),
                Number(m.latitude)
              ]);
            }
            middleData[m.type]["table"].push(obj);
            // if (
            //   m.longitude &&
            //   m.latitude &&
            //   m.longitude !== "0" &&
            //   m.latitude !== "0"
            // ) {
              if (m.type === 1) {
                middleData[m.type]["geoData"].push([
                  m.id,
                  Number(this.peopleGps.LGTD),
                  Number(this.peopleGps.LTTD)
                ]);
                middleData[m.type]["table"].push(obj);
              } else if (m.type === 2) {
                middleData[m.type]["geoData"].push([
                  m.id,
                  Number(this.carGps.LGTD),
                  Number(this.carGps.LTTD)
                ]);
                middleData[m.type]["table"].push(obj);
              } else {
                middleData[m.type]["geoData"].push([
                  m.id,
                  Number(m.longitude),
                  Number(m.latitude)
                ]);
                middleData[m.type]["table"].push(obj);
              }
            // }
            // if (
            //   m.longitude &&
            //   m.latitude &&
            //   m.longitude !== "0" &&
            //   m.latitude !== "0"
            // ) {
            //   middleData[m.type]["geoData"].push([
            //     m.id,
            //     Number(m.longitude),
            //     Number(m.latitude)
            //   ]);
            // }
            // middleData[m.type]["table"].push(obj);
          });
          this.carNum = middleData[2]["table"].length;
          this.peoNum = middleData[1]["table"].length;
          this.gunNum = middleData[3]["table"].length;
          this.mapData = middleData;
          this.setMapData(2);
          // this.getCompanyMap();
        } else {
          this.$message.error(res.msg);
        }
@@ -1214,6 +1279,7 @@
            obj["table"].push(item);
          });
          this.companyNum = obj["table"].length;
          this.mapData["4"] = {};
          this.mapData["4"] = obj;
        }
      });
@@ -1245,7 +1311,6 @@
      this.gridData.total = 0;
      this.dialogTableVisible = true;
      if (type === "zg") {
        // debugger;
        this.gridData.title = "资格异常人员清单";
        this.getQualificationPages(1);
      } else if (type === "wg") {
@@ -1507,9 +1572,12 @@
    }
  },
  mounted() {
    this.getPeoplePosition();
    // this.getCarPosition();
    this.initEchart();
    this.getHolderNum(0);
    this.getTableData(0);
    // this.getTableData(0);
    this.getCompanyMap();
    this.getOfficeData();
  }