| | |
| | | >确 定</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | import { |
| | | inquiry_SelectTabs, |
| | | inquiry_uploadShp, |
| | | decr, |
| | | encr, |
| | | dataLib_selectTabs, |
| | | pipelines_selectSegNames, |
| | |
| | | analyGid: null, |
| | | dialogFormVisible: false, |
| | | bufferLinePosition: [], |
| | | dialogExtentVisible: false, |
| | | setExtent: 10, |
| | | wktExtent: null, |
| | | } |
| | | }, |
| | | |
| | |
| | | this.menuTopFrom.queryType = "rectangle" |
| | | this.getAllTable() |
| | | this.getPipelineData() |
| | | this.$bus.$on("setExtentBUff", res => { |
| | | this.setExtentBuffer(res); |
| | | }) |
| | | }, |
| | | watch: { |
| | | analyGid(newVal, oldVal) { |
| | |
| | | }, |
| | | }, |
| | | methods: { |
| | | setExtentBuffer(res) { |
| | | // var wkt = this.$wkt.parse(this.wktExtent) |
| | | // var wkt = encr(this.wktExtent) |
| | | var wkt1 = decr(this.wktExtent) |
| | | |
| | | var wkt = this.$wkt.parse(wkt1) |
| | | |
| | | var restVal = turf.buffer(wkt, res, { units: "meters", steps: 64 }) |
| | | |
| | | var options = { precision: 6, coordinates: 2 }; |
| | | |
| | | var truncated = turf.truncate(restVal, options); |
| | | |
| | | var options1 = { tolerance: 0.01, highQuality: false }; |
| | | var simplified = turf.simplify(truncated, options1); |
| | | |
| | | var wkt2 = this.$wkt.convert(simplified.geometry) |
| | | var wkt3 = encr(wkt2) |
| | | |
| | | this.$store.state.mapMenuShpFile = wkt3 |
| | | |
| | | var points = simplified.geometry.coordinates[0] |
| | | var degreesArray = this.pointsToDegreesArray(points) |
| | | let array = Cesium.Cartesian3.fromDegreesArray(degreesArray) |
| | | const hierarchy = new Cesium.PolygonHierarchy(array) |
| | | const bufferPolygon = sgworld.Viewer.entities.add({ |
| | | polygon: { |
| | | hierarchy: hierarchy, |
| | | material: Cesium.Color.RED.withAlpha(0.5), |
| | | classificationType: Cesium.ClassificationType.BOTH, |
| | | }, |
| | | }) |
| | | this.bufferEntities.push(bufferPolygon) |
| | | sgworld.Navigate.flyToObj(bufferPolygon) |
| | | |
| | | this.showMapMenuPop() |
| | | |
| | | }, |
| | | getDownLoadExtent(res) { |
| | | this.wktExtent = res.result.wkt |
| | | |
| | | this.$bus.$emit('showExtentLayer', true); |
| | | |
| | | |
| | | // this.dialogExtentVisible = true |
| | | // this.$store.state.mapMenuShpFile = rs.result.wkt |
| | | // |
| | | }, |
| | | |
| | | changeValue(value) { |
| | | var obj = {} |
| | | obj = this.queryOption.find(function (item) { |
| | |
| | | }, |
| | | //清空树选中的节点 |
| | | resetCheckedNodes() { |
| | | |
| | | this.layerData = [] |
| | | this.getAllTable() |
| | | this.$refs.tree.setCheckedKeys([]); |
| | | this.treeChange = [] |
| | | this.menuTopFrom.queryLayer = null |
| | |
| | | }) |
| | | return |
| | | } |
| | | var that = this; |
| | | $.ajax(BASE_URL + "/inquiry/uploadShp?token=" + getToken(), { |
| | | type: "post", |
| | | data: formData, |
| | |
| | | contentType: false, |
| | | success: rs => { |
| | | if (rs.code !== 200) { |
| | | return this.$message.error("用户角色请求错误") |
| | | return this.$message.error("数据解析失败") |
| | | } |
| | | |
| | | this.$store.state.mapMenuShpFile = rs.result.wkt |
| | | this.showMapMenuPop() |
| | | that.getDownLoadExtent(rs); |
| | | |
| | | }, |
| | | error: e => { |
| | | console.log(e) |
| | |
| | | }, |
| | | clearQuery() { |
| | | // 清楚buffer |
| | | this.layerData = []; |
| | | this.getAllTable(); |
| | | this.clearBufferEntities() |
| | | this.$refs.pathClear.value = "" |
| | | this.treeChange = [] |