| | |
| | | import * as turf from "@turf/turf"; |
| | | |
| | | import wqJosn from "./json/wq.json"; |
| | | const json2md = require("json2md"); |
| | | const mapConfig = { |
| | | flyToImageryLayer(res) { |
| | |
| | | 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 = []; |
| | |
| | | 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('"', "") |
| | | }); |
| | | } |
| | | } |