北京经济技术开发区经开区虚拟城市项目-【前端】--政府服务中心-1号屏Web
Surpriseplus
2023-10-07 3371d6e613d8a8f13c769e1ac77f4fa2b76ccb24
src/assets/js/rpc.js
@@ -85,7 +85,7 @@
        ]).then(result => {
            var that = this;
            store.queryLayer.data = [];
            //企v业
            //企业
            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) {