suerprisePlus
2024-07-04 81f92eb9fb83ed5d8ac0b0a5c206315416f10df0
src/assets/js/map/mapConfig.js
@@ -1,5 +1,5 @@
import * as turf from "@turf/turf";
import wqJosn from "./json/wq.json";
const json2md = require("json2md");
const mapConfig = {
  flyToImageryLayer(res) {
@@ -19,22 +19,40 @@
    buffered.geometry.coordinates[0] = std;
    return buffered;
  },
  setScanList(response, filed) {
  setScanList(response, filed, headers) {
    const obj = [];
    for (var i in response) {
      const item = response[i];
      const std = [];
      if (item[filed]) {
        const count = "count_" + filed;
        obj.push(item[filed] + " : " + item[count]);
        std.push(item[filed]);
        std.push(item[count]);
        const obj = wqJosn.features.filter((res) => {
          if (res.properties.weaponname == item[filed]) {
            return res;
          }
        });
        if (obj.length > 0) {
          std.push(obj[0].properties.time);
        }
      }
    }
    if (filed == "weaponname") {
      return "发现疑似 " + obj.toString().replaceAll(",", "个; ");
    }else if(filed==='targettype'){
      return "发现 " + obj.toString().replaceAll(",", "个; ");
    }
    return "暂无信息";
      obj.push(std);
    }
    console.log(wqJosn);
    // if (filed == "weaponname") {
    //   return "发现疑似 " + obj.toString().replaceAll(",", "个; ");
    // }else if(filed==='targettype'){
    //   return "发现 " + obj.toString().replaceAll(",", "个; ");
    // }
    return [
      {
        type: "table",
        val: [headers, obj]
      }
    ];
  },
  setArrList(list, flag) {
    var result = [];
@@ -42,13 +60,12 @@
    for (var i in item) {
      if (item[i]) {
        if (item[i].indexOf(",") > -1) {
          result.push({
            p: item[i].replaceAll('"','').replaceAll('}','')
            p: item[i].replaceAll('"', "").replaceAll("}", "")
          });
        } else {
          result.push({
            h6: item[i].replaceAll('"','')
            h6: item[i].replaceAll('"', "")
          });
        }
      }