From 81f92eb9fb83ed5d8ac0b0a5c206315416f10df0 Mon Sep 17 00:00:00 2001 From: suerprisePlus <15810472099@163.com> Date: 星期四, 04 七月 2024 10:14:06 +0800 Subject: [PATCH] 系统更新 --- src/assets/js/map/mapConfig.js | 43 ++++++++++++++++++++++++++++++------------- 1 files changed, 30 insertions(+), 13 deletions(-) diff --git a/src/assets/js/map/mapConfig.js b/src/assets/js/map/mapConfig.js index cf14d5e..435e9df 100644 --- a/src/assets/js/map/mapConfig.js +++ b/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('"', "") }); } } -- Gitblit v1.9.3