From bc9913b5abd7166fbb38f575060e9f3be4596835 Mon Sep 17 00:00:00 2001 From: lixuliang <lixuliang_hd@126.com> Date: 星期六, 07 十月 2023 16:41:06 +0800 Subject: [PATCH] 地块排序 --- src/assets/js/rpc.js | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/src/assets/js/rpc.js b/src/assets/js/rpc.js index 163c5fc..c01bffd 100644 --- a/src/assets/js/rpc.js +++ b/src/assets/js/rpc.js @@ -116,12 +116,14 @@ 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) => { let itemObj = { type: "鍦板潡", name: val.attributes.QYMC, area: val.attributes.area, + code: val.attributes["鍦板潡缂�"], lon: val.location.x, lat: val.location.y, }; -- Gitblit v1.9.3