| | |
| | | liushisijiayuanqudizhibianmafuwu, |
| | | findAddressCandidates, |
| | | getDiKuanFanWei, |
| | | ent_selectByName |
| | | ent_selectByName, |
| | | shengwuSearch |
| | | } from "../../api/api"; |
| | | import vueEvents from "@/utils/vueEvent.js"; |
| | | let PoiLayerConstructor = Vue.extend(coord); |
| | |
| | | pointerFly: null, //定点漫游 |
| | | isShow: false, |
| | | objArr: [], |
| | | pointrange: null, |
| | | |
| | | //关键字查询 |
| | | getFuzzyQuery(res) { |
| | | if(res.message.indexOf('奔驰')>-1){ |
| | | store.queryLayer.val ='奔驰公司' |
| | | } else if(res.message.indexOf('永昌')>-1){ |
| | | store.queryLayer.val ='永昌工业园' |
| | | }else if(res.message.indexOf('京东')>-1){ |
| | | store.queryLayer.val ='京东' |
| | | }else if(res.message.indexOf('小米')>-1){ |
| | | store.queryLayer.val ='小米' |
| | | }else if(res.message.indexOf('博大')>-1){ |
| | | store.queryLayer.val ='博大大厦' |
| | | }else{ |
| | | |
| | | // store.queryLayer.val = res.message; |
| | | if (res.message.indexOf('奔驰') > -1) { |
| | | store.queryLayer.val = '奔驰公司' |
| | | } else if (res.message.indexOf('京东') > -1) { |
| | | store.queryLayer.val = '京东' |
| | | } else if (res.message.indexOf('小米') > -1) { |
| | | store.queryLayer.val = '小米' |
| | | } else if (res.message.indexOf('博大') > -1) { |
| | | store.queryLayer.val = '博大大厦' |
| | | } else if (res.message.indexOf('信息技术') > -1) { |
| | | store.queryLayer.val = '信息技术' |
| | | } else if (res.message.indexOf('生物医药') > -1) { |
| | | store.queryLayer.val = '生物医药' |
| | | } else if (res.message.indexOf('机器人') > -1) { |
| | | store.queryLayer.val = '机器人' |
| | | } else if (res.message.indexOf('汽车') > -1) { |
| | | store.queryLayer.val = '汽车' |
| | | } else { |
| | | store.queryLayer.val = res.message; |
| | | } |
| | | |
| | | |
| | | this.setClearAllMsg(); |
| | | if (!res.baidu_keys) return; |
| | | var flag = true; |
| | |
| | | |
| | | this.dataQuery = []; |
| | | this.objArr = []; |
| | | this.pointrange = 2000; |
| | | for (var i = 0; i < length; i++) { |
| | | var world = keyWorld[i].word; |
| | | if(world.indexOf('奔驰')>-1){ |
| | | world ='奔驰' |
| | | } else if(world.indexOf('永昌')>-1){ |
| | | world ='永昌' |
| | | }else if(world.indexOf('京东')>-1){ |
| | | world ='京东' |
| | | }else if(world.indexOf('小米')>-1){ |
| | | world ='小米' |
| | | }else if(world.indexOf('博大')>-1){ |
| | | world ='博大' |
| | | }else{ |
| | | continue; |
| | | } |
| | | if (world.indexOf('奔驰') > -1) { |
| | | world = '奔驰'; |
| | | this.pointrange = 12000 |
| | | } else if (world.indexOf('京东') > -1) { |
| | | world = '京东' |
| | | } else if (world.indexOf('小米') > -1) { |
| | | world = '小米' |
| | | } else if (world.indexOf('博大大厦') > -1) { |
| | | world = '博大大厦' |
| | | } else if (world.indexOf('信息技术') > -1) { |
| | | world = '信息技术' |
| | | } else if (world.indexOf('生物医药') > -1) { |
| | | world = '生物医药' |
| | | } else if (world.indexOf('机器人') > -1) { |
| | | world = '机器人' |
| | | } else if (world.indexOf('汽车') > -1) { |
| | | world = '汽车' |
| | | } |
| | | this.setFuzzyQueryData(world, i, length - 1); |
| | | } |
| | | } |
| | | }, |
| | | async setFuzzyQueryData(res, index, length) { |
| | | Promise.all([ |
| | | ent_selectByName(res), //企业 |
| | | liushisijiayuanqudizhibianmafuwu(res), //园区 |
| | | findAddressCandidates(res) //地块 |
| | | ]).then(result => { |
| | | var that = this; |
| | | store.queryLayer.data = []; |
| | | //企业 |
| | | var EntArr = result[0].result.filter(item => { |
| | | return item.entName.includes(res); |
| | | }); |
| | | EntArr.forEach(val => { |
| | | let itemObj = { |
| | | type: "企业", |
| | | name: val.entName, |
| | | address: val.address, |
| | | lon: val.x, |
| | | lat: val.y |
| | | }; |
| | | that.objArr.push(itemObj); |
| | | }); |
| | | //园区 |
| | | var YQArr = result[1].features.filter(item => { |
| | | return item.properties.YQmingchen.includes(res); |
| | | }); |
| | | if (res == "信息技术" || res == "生物医药" || res == "机器人" || res == "汽车") { |
| | | shengwuSearch(res).then(result => { |
| | | var that = this; |
| | | result.features.forEach(val => { |
| | | let itemObj = { |
| | | type: "园区", |
| | | name: val.properties.YQmingchen, |
| | | address: val.properties.YQdizhi, |
| | | lon: val.properties.longtitude, |
| | | lat: val.properties.latitude, |
| | | geom: val.geometry.coordinates[0].flat() |
| | | |
| | | YQArr.forEach(val => { |
| | | let itemObj = { |
| | | type: "园区", |
| | | name: val.properties.YQmingchen, |
| | | address: val.properties.YQdizhi, |
| | | lon: val.geometry.coordinates[0], |
| | | lat: val.geometry.coordinates[1], |
| | | geom: val.properties.Coor1 + val.properties.Coor2 |
| | | |
| | | }; |
| | | that.objArr.push(itemObj); |
| | | }); |
| | | //地块 |
| | | 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, |
| | | }; |
| | | that.objArr.push(itemObj); |
| | | }); |
| | | if (index == length) { |
| | | if (that.objArr.length <= 0) { |
| | | |
| | | vueEvents.$emit("queryData", true); |
| | | return; |
| | | } |
| | | var num = that.objArr.length; |
| | | for (var i = 0; i < num; i++) { |
| | | if (i < 6) { |
| | | that.dataQuery.push(that.objArr[i]); |
| | | }; |
| | | that.objArr.push(itemObj); |
| | | }); |
| | | if (index == length) { |
| | | if (that.objArr.length <= 0) { |
| | | vueEvents.$emit("queryData", true); |
| | | return; |
| | | } |
| | | var num = that.objArr.length; |
| | | for (var i = 0; i < num; i++) { |
| | | if (i < 6) { |
| | | that.dataQuery.push(that.objArr[i]); |
| | | } |
| | | } |
| | | store.queryLayer.data = that.dataQuery; |
| | | that.setClearAllMsg(); |
| | | setTimeout(() => { |
| | | vueEvents.$emit("queryData", true); |
| | | that.setLocation(that.dataQuery[0]); |
| | | }, 1000); |
| | | } |
| | | store.queryLayer.data = that.dataQuery; |
| | | that.setClearAllMsg(); |
| | | setTimeout(() => { |
| | | vueEvents.$emit("queryData", true); |
| | | that.setLocation(that.dataQuery[0]); |
| | | }, 1000); |
| | | } |
| | | }); |
| | | }) |
| | | } else { |
| | | Promise.all([ |
| | | ent_selectByName(res), //企业 |
| | | liushisijiayuanqudizhibianmafuwu(res), //园区 |
| | | findAddressCandidates(res),//地块, |
| | | ]).then(result => { |
| | | var that = this; |
| | | store.queryLayer.data = []; |
| | | //企业 |
| | | var EntArr = result[0].result.filter(item => { |
| | | return item.entName.includes(res); |
| | | }); |
| | | EntArr.forEach(val => { |
| | | let itemObj = { |
| | | type: "企业", |
| | | name: val.entName, |
| | | address: val.address, |
| | | lon: val.x, |
| | | lat: val.y |
| | | }; |
| | | that.objArr.push(itemObj); |
| | | }); |
| | | //园区 |
| | | var YQArr = result[1].features.filter(item => { |
| | | return item.properties.YQmingchen.includes(res); |
| | | }); |
| | | |
| | | YQArr.forEach(val => { |
| | | let itemObj = { |
| | | type: "园区", |
| | | name: val.properties.YQmingchen, |
| | | address: val.properties.YQdizhi, |
| | | lon: val.properties.longtitude, |
| | | lat: val.properties.latitude, |
| | | geom: val.geometry.coordinates[0].flat() |
| | | // lon: val.geometry.coordinates[0], |
| | | // lat: val.geometry.coordinates[1], |
| | | // geom: val.properties.Coor1 + val.properties.Coor2 |
| | | |
| | | }; |
| | | that.objArr.push(itemObj); |
| | | }); |
| | | //地块 |
| | | 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, |
| | | }; |
| | | that.objArr.push(itemObj); |
| | | }); |
| | | |
| | | if (index == length) { |
| | | if (that.objArr.length <= 0) { |
| | | |
| | | vueEvents.$emit("queryData", true); |
| | | return; |
| | | } |
| | | var num = that.objArr.length; |
| | | for (var i = 0; i < num; i++) { |
| | | if (i < 6) { |
| | | that.dataQuery.push(that.objArr[i]); |
| | | } |
| | | } |
| | | store.queryLayer.data = that.dataQuery; |
| | | that.setClearAllMsg(); |
| | | setTimeout(() => { |
| | | vueEvents.$emit("queryData", true); |
| | | that.setLocation(that.dataQuery[0]); |
| | | }, 1000); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | |
| | | }, |
| | | |
| | | getFuzzyQueryData(res, index, length, flag) { |
| | |
| | | }, |
| | | // 显示地块范围 |
| | | getLandmass(res) { |
| | | |
| | | let that = this; |
| | | if (res.type == "园区") { |
| | | var geom = res.geom.split(','); |
| | | this.setDrawPolyExtent(res.geom) |
| | | |
| | | var coord = []; |
| | | for (var i in geom) { |
| | | coord.push(parseFloat(geom[i])) |
| | | } |
| | | this.setDrawPolyExtent(coord) |
| | | // var geom = res.geom.split(','); |
| | | |
| | | // var coord = []; |
| | | // for (var i in geom) { |
| | | // coord.push(parseFloat(geom[i])) |
| | | // } |
| | | // this.setDrawPolyExtent(coord) |
| | | } else if (res.type == "地块" || res.type == "企业") { |
| | | getDiKuanFanWei(res.lon, res.lat).then(response => { |
| | | let center = { lon: 0, lat: 0 }; |
| | |
| | | offset: { |
| | | heading: Cesium.Math.toRadians(-200), |
| | | pitch: Cesium.Math.toRadians(-45), |
| | | range: 4000 |
| | | range: this.pointrange |
| | | }, |
| | | duration: 3 |
| | | }); |