| | |
| | | ]).then(result => { |
| | | var that = this; |
| | | store.queryLayer.data = []; |
| | | //企v业 |
| | | //企业 |
| | | var EntArr = result[0].result.filter(item => { |
| | | return item.entName.includes(res); |
| | | }); |
| | |
| | | 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) { |
| | | |