| | |
| | | <script> |
| | | import queryinfo from "../../views/Tools/queryinfo.vue" |
| | | import $ from 'jquery'; |
| | | import { inquiry_SelectTabs, inquiry_uploadShp, encr } from '../../api/api.js'; |
| | | import { inquiry_SelectTabs, inquiry_uploadShp, encr, dataLib_selectTabs } from '../../api/api.js'; |
| | | import { getToken } from '@/utils/auth'; |
| | | import * as turf from '@turf/turf'; |
| | | export default { |
| | |
| | | }, |
| | | |
| | | mounted() { |
| | | // sgworld.Creator.SimpleGraphic.edit(false, { editProp: false }); |
| | | |
| | | this.menuTopFrom.queryType = 'rectangle'; |
| | | this.getAllTable(); |
| | | }, |
| | | methods: { |
| | | flyRemove() { |
| | | |
| | | }, |
| | | flyQuery() { |
| | | // Viewer.flyTo( sgworld.Creator.SimpleGraphic._viewer.entities._entities._array[0]) |
| | | // switch (this.menuTopFrom.queryType) { |
| | | // case 'point': //点 |
| | | // Viewer.camera.flyTo({ |
| | | // destination: Cesium.Cartesian3.fromDegrees(this.flyEntity.lng, this.flyEntity.lat, 3000), |
| | | |
| | | // }); |
| | | |
| | | // break; |
| | | // case 'polyline': //线 |
| | | // debugger |
| | | // break; |
| | | // case 'rectangle': //矩形 |
| | | |
| | | // debugger |
| | | // break; |
| | | // case 'circle': //圆 |
| | | // debugger |
| | | // break; |
| | | // case 'polygon': //多边形 |
| | | // debugger |
| | | // break; |
| | | // } |
| | | }, |
| | | changeValue(value) { |
| | | // var obj = {}; |
| | | // obj = this.queryOption.find(function (item) { |
| | | // return item.value === value; |
| | | // }); |
| | | // if (obj.value == 'inputFile') { |
| | | // this.getMenuTopFile(); |
| | | // } |
| | | var obj = {}; |
| | | obj = this.queryOption.find(function (item) { |
| | | return item.value === value; |
| | | }); |
| | | if (obj.value == 'inputFile') { |
| | | this.getMenuTopFile(); |
| | | } |
| | | }, |
| | | async getAllTable() { |
| | | const data = await inquiry_SelectTabs(); |
| | | const data = await dataLib_selectTabs({ |
| | | pageIndex: 1, |
| | | pageSize: 500 |
| | | }); |
| | | if (data.code != 200) { |
| | | this.$message.error('列表调用失败'); |
| | | } |
| | | var option = data.result; |
| | | |
| | | var option = data.result.filter((res) => { |
| | | if (res.rows != 0) { |
| | | return res; |
| | | } |
| | | }) |
| | | for (var i in option) { |
| | | var val_Data = option[i]; |
| | | val_Data.id = '1' + i; |
| | |
| | | formData.append(val[i].name, val[i]); // fs.files[i].name,file |
| | | } |
| | | } |
| | | |
| | | if (count != 4) { |
| | | |
| | | this.$message({ |
| | |
| | | if (rs.code !== 200) { |
| | | return this.$message.error('用户角色请求错误'); |
| | | } |
| | | this.$store.state.mapMenuShpFile = rs.result; |
| | | |
| | | this.$store.state.mapMenuShpFile = rs.result.wkt; |
| | | this.showMapMenuPop(); |
| | | }, |
| | | error: (e) => { |
| | |
| | | //清空标绘 |
| | | sgworld.Creator.SimpleGraphic.edit(false, { editProp: false }); |
| | | sgworld.Creator.SimpleGraphic.clear(); |
| | | |
| | | if (this.$store.state.queryInfo.length != 0) { |
| | | for (var i in this.$store.state.queryInfo) { |
| | | sgworld.Viewer.entities.remove(this.$store.state.queryInfo[i]); |
| | | } |
| | | this.$store.state.queryInfo = []; |
| | | } |
| | | if (this.$store.state.primitLayer != null) { |
| | | sgworld.Creator.DeleteObject(this.$store.state.primitLayer); |
| | | this.$store.state.primitLayer = null; |
| | | } |
| | | if (this.treeChange.length == 0) { |
| | | this.$message.error('请选择要查询的数据'); |
| | | return; |
| | |
| | | setTurfCircle(position, radius) { |
| | | var options = { |
| | | steps: 10, |
| | | units: 'miles', |
| | | units: 'meters', |
| | | properties: { foo: 'bar' }, |
| | | }; |
| | | var circle = turf.circle(position, radius, options); |
| | | |
| | | this.setJonToWKT(circle); |
| | | }, |
| | | setTurfPolyOrLine(res, type) { |
| | |
| | | } |
| | | if (type == 'polyline') { |
| | | var line = turf.lineString(std, { name: 'polyline' }); |
| | | restVal = turf.buffer(line, 10, { units: 'miles' }); |
| | | restVal = turf.buffer(line, 10, { units: 'meters' }); |
| | | } else if (type == 'rectangle') { |
| | | var ste = this.setCartesianToEightFour(res[0]); |
| | | std.push([ste.lng, ste.lat]); |
| | |
| | | showMapMenuPop() { |
| | | this.$store.state.mapSpaceQueryLayer = this.treeChange; |
| | | this.$store.state.mapPopBoxFlag = '1'; |
| | | // this.$refs && this.$refs.queryinfo && this.$refs.queryinfo.close(); |
| | | this.$refs && this.$refs.queryinfo && this.$refs.queryinfo.close(); |
| | | this.$refs && this.$refs.queryinfo && this.$refs.queryinfo.open("空间查询", null, { |
| | | close: () => { |
| | | |
| | | if (this.$store.state.primitLayer != null) { |
| | | // sgworld.Creator.DeleteObject(this.$store.state.primitLayer); |
| | | this.$store.state.primitLayer = null; |
| | | } |
| | | // if (this.$store.state.primitLayer != null) { |
| | | // // sgworld.Creator.DeleteObject(this.$store.state.primitLayer); |
| | | // this.$store.state.primitLayer = null; |
| | | // } |
| | | |
| | | if (window.Viewer.scene.primitives.length != 0) { |
| | | window.Viewer.scene.primitives.removeAll() |
| | | } |
| | | // if (window.Viewer.scene.primitives.length != 0) { |
| | | // window.Viewer.scene.primitives.removeAll() |
| | | // } |
| | | } |
| | | }); |
| | | this.$bus.$emit('changeMapMenuTop', 'true'); |
| | | sgworld.Creator.SimpleGraphic.edit(false, { editProp: false }); |
| | | // this.$bus.$emit('changeMapMenuTop', 'true'); |
| | | |
| | | // sgworld.Creator.SimpleGraphic.clear(); |
| | | //清空inputFile |
| | | // var file = document.getElementById('getMenuTopFile'); |
| | |
| | | this.menuTopFrom.queryLayer = null; |
| | | this.menuTopFrom.queryType = 'rectangle'; |
| | | this.$refs.tree.setCheckedKeys([]); |
| | | //清空标绘 |
| | | //清空标绘 |
| | | sgworld.Creator.SimpleGraphic.edit(false, { editProp: false }); |
| | | sgworld.Creator.SimpleGraphic.clear(); |
| | | |
| | | // //清除对象 |
| | | // if (window.Viewer.scene.primitives.length != null) { |
| | | // window.Viewer.scene.primitives.removeAll(); |
| | | // } |
| | | // if (this.$store.state.primitLayer != null) { |
| | | // sgworld.Creator.DeleteObject(this.$store.state.primitLayer); |
| | | // this.$store.state.primitLayer = null; |
| | | // } |
| | | if (this.$store.state.queryInfo.length != 0) { |
| | | for (var i in this.$store.state.queryInfo) { |
| | | sgworld.Viewer.entities.remove(this.$store.state.queryInfo[i]); |
| | | } |
| | | this.$store.state.queryInfo = []; |
| | | } |
| | | //关闭窗口 |
| | | this.$refs && this.$refs.queryinfo && this.$refs.queryinfo.close("queryinfo"); |
| | | |
| | | |
| | | |
| | | |
| | | if (this.$store.state.primitLayer != null) { |
| | | sgworld.Creator.DeleteObject(this.$store.state.primitLayer); |
| | | this.$store.state.primitLayer = null; |
| | | } |
| | | }, |
| | | setCartesianToEightFour(res) { |
| | | var std = {}; |