From 3371d6e613d8a8f13c769e1ac77f4fa2b76ccb24 Mon Sep 17 00:00:00 2001 From: Surpriseplus <845948745@qq.com> Date: 星期六, 07 十月 2023 17:21:14 +0800 Subject: [PATCH] rpc.js修改 --- src/assets/js/rpc.js | 22 +++++++--------------- 1 files changed, 7 insertions(+), 15 deletions(-) diff --git a/src/assets/js/rpc.js b/src/assets/js/rpc.js index a216f8b..8667074 100644 --- a/src/assets/js/rpc.js +++ b/src/assets/js/rpc.js @@ -85,7 +85,7 @@ ]).then(result => { var that = this; store.queryLayer.data = []; - //浼乿涓� + //浼佷笟 var EntArr = result[0].result.filter(item => { return item.entName.includes(res); }); @@ -114,30 +114,22 @@ that.objArr.push(itemObj); }); //鍦板潡 - var LandArr = result[2].candidates.filter(item => { + var LandArr = result[2].candidates.filter((item) => { return item.attributes.QYMC.includes(res); - }); + }) // 缁撴灉鏍规嵁QYMC浠庣煭鍒伴暱鎺掑簭 - LandArr.sort((a, b) => - b.attributes.QYMC.length === a.attributes.QYMC.length - ? 0 - : a.attributes.QYMC.length > b.attributes.QYMC.length - ? 1 - : -1 - ); - - LandArr.forEach(val => { + LandArr.sort((a, b) => (b.attributes.QYMC.length === a.attributes.QYMC.length ? 0 : a.attributes.QYMC.length > b.attributes.QYMC.length ? 1 : -1)) + LandArr.forEach((val) => { let itemObj = { type: "鍦板潡", name: val.attributes.QYMC, area: val.attributes.area, code: val.attributes["鍦板潡缂�"], lon: val.location.x, - lat: val.location.y + lat: val.location.y, }; - that.objArr.push(itemObj); + objArr.push(itemObj); }); - if (index == length) { if (that.objArr.length <= 0) { -- Gitblit v1.9.3