From cfc1abd6b855c3575d5d20646bb4dd97d8601469 Mon Sep 17 00:00:00 2001 From: surprise <15810472099@163.com> Date: 星期一, 16 十月 2023 10:51:06 +0800 Subject: [PATCH] 钻孔柱状图修改 --- src/components/MapView/mapSpacePop.vue | 334 +++++++++++++++++++++++++++++++++++++----------------- 1 files changed, 227 insertions(+), 107 deletions(-) diff --git a/src/components/MapView/mapSpacePop.vue b/src/components/MapView/mapSpacePop.vue index 359ce56..ceb8d8c 100644 --- a/src/components/MapView/mapSpacePop.vue +++ b/src/components/MapView/mapSpacePop.vue @@ -9,7 +9,7 @@ <el-form-item> <el-input size="small" - style="width:47vh" + style="width:30vh" v-model="ruleForm.fileName" disabled placeholder="璇疯緭鍏�..." @@ -20,7 +20,7 @@ @click="conditionVisible = true" size="small" type="success" - >鏂板</el-button> + >{{$t('common.lable6')}}</el-button> <el-button size="small" @click="resetForm" @@ -218,7 +218,10 @@ </el-select> </el-form-item> <el-form-item v-show="!fromSqlflag"> - <el-input v-model="formSql.value"></el-input> + <el-input + v-model="formSql.value" + :placeholder="$t('shuJuGuanLi.shuJuJianSuo.queryContent')" + > </el-input> </el-form-item> <el-form-item v-show="fromSqlflag"> <el-date-picker @@ -359,7 +362,9 @@ { 'name': '鍗电煶', 'color': 'rgba(54,83,173,1)' }, { 'name': '娉ュ博', 'color': 'rgba(47,30,13,1)' }, { 'name': '缁嗙爞', 'color': 'rgba(93,88,15,1)' }, - { 'name': '涓爞', 'color': 'rgba(164,140,21,1)' } + { 'name': '涓爞', 'color': 'rgba(164,140,21,1)' }, + { 'name': '娣ゆ偿璐ㄥ湡', 'color': 'rgba(75,74,78,1)' }, + { 'name': '鍏朵粬', 'color': 'rgba(225,225,225,1)' }, ] } }, @@ -461,8 +466,14 @@ this.formInline.region = this.options[0].value }, setListDataStart() { - this.listdata.pageSize = 10 - this.listdata.pageIndex = 1 + this.listdata = { + pageIndex: 1, + pageSize: 10, + name: null, + srid: 4326, + wkt: null, + filter: null, + } this.tableData = [] }, //鍒濆鍖栨煡璇㈡潯浠� @@ -496,8 +507,12 @@ async getTableselectFields() { const data = await inquiry_selectFields({ name: this.spaceLayer }) if (data.code != 200) { - this.$message.error("鍒楄〃璋冪敤澶辫触") + this.$message.error("鍒楄〃璋冪敤瀛楁澶辫触") } + if (data.result.length == 0) { + this.$message("鍒楄〃璋冪敤瀛楁鏌ユ棤鏁版嵁") + } + this.filedsOption = []; this.optionx = [] var valadata = data.result @@ -579,10 +594,14 @@ }, //鍒濆鍖栨煡璇㈤槇鍊艰〃 async getDomainsLayer() { + this.$store.state.loading = true; const data = await inquiry_selectDomains({ name: this.spaceLayer }) if (data.code != 200) { - this.$message.error("鍒楄〃璋冪敤澶辫触") + this.$message.error("鍒楄〃闃堝�艰皟鐢ㄥけ璐�") } + // if (data.result.length == 0) { + // this.$message("鍒楄〃闃堝�兼煡鏃犳暟鎹�") + // } this.domainsLayer = data.result this.setListDataStart() @@ -608,12 +627,22 @@ } else { this.listdata.filter = null; } + if (this.$store.state.pigCode) { + this.listdata.dirs = this.$store.state.pigCode; + } const data = await dataQuerySelectByPage(this.listdata) + this.$store.state.loading = false; if (data.code != 200) { - this.$message.error("鍒楄〃璋冪敤澶辫触") + return this.$message.error("鍒楄〃璋冪敤澶辫触") } + if (data.result.length == 0) { + return this.$message("鍒楄〃鏌ユ棤鏁版嵁") + } + + + var val = data.result; val = val.filter((res) => { @@ -660,7 +689,7 @@ this.tableData = val - this.$refs.filterTable.doLayout() + // this.$refs.filterTable.doLayout() }, async setCartesianToEightFour(entities) { @@ -749,19 +778,27 @@ ) window.histogramHandler.setInputAction((event) => { var pick = sgworld.Viewer.scene.pick(event.endPosition); + if (pick) { - var propertiesFlag = that.$store.state.propertiesFlag + var propertiesFlag = that.$store.state.propertiesFlag - if (Cesium.defined(pick)) { - if (pick && pick.id && pick.id.tag && pick.id.tag == "Histogram") { - that.$store.state.propertiesInfo = { - title: pick.id.properties._exppointid._value, - name: pick.id.properties._geoname._value, - type: pick.id.properties.geotype._value, - botdepth: pick.id.properties._botdepth._value, - describe: pick.id.properties._describe._value, + if (Cesium.defined(pick)) { + if (pick && pick.id && pick.id.tag && pick.id.tag == "Histogram") { + that.$store.state.propertiesInfo = { + title: pick.id.properties._exppointid._value, + name: pick.id.properties._geoname._value, + type: pick.id.properties.geotype._value, + botdepth: pick.id.properties._botdepth._value, + describe: pick.id.properties._describe._value, + } + that.$store.state.propertiesFlag = "2" + } else { + if (propertiesFlag == 1) { + that.$store.state.propertiesFlag = propertiesFlag + } else { + that.$store.state.propertiesFlag = null + } } - that.$store.state.propertiesFlag = "2" } else { if (propertiesFlag == 1) { that.$store.state.propertiesFlag = propertiesFlag @@ -769,13 +806,8 @@ that.$store.state.propertiesFlag = null } } - } else { - if (propertiesFlag == 1) { - that.$store.state.propertiesFlag = propertiesFlag - } else { - that.$store.state.propertiesFlag = null - } } + }, Cesium.ScreenSpaceEventType.MOUSE_MOVE) }, 500); } @@ -787,73 +819,149 @@ pageIndex: 1, pageSize: res, wkt: this.listdata.wkt, - name: this.listdata.name + name: this.listdata.name, + hasGeom: 1, } const data = await dataQuerySelectByPage(obj) if (data.code != 200) { return } var val = data.result; - for (var i in val) { - this.setShowHistogramLayer(val[i]) - } + // for (var i in val) { + this.setShowHistogramLayer(val) + // } }, async setShowHistogramLayer(res) { - var param = { - gid: res.gid, - name: this.spaceLayer, - } + var gid = []; + for (var i in res) { - const data1 = await dataQuerySelectWktById(param) - if (data1.code != 200) { - this.$message.error("鍒楄〃璋冪敤澶辫触") + gid.push(res[i].exppointid) } - var val1 = decr(data1.result) - var wkt = this.$wkt.parse(val1) - var coord = wkt.coordinates + // var param = { + // gid: res.gid, + // name: this.spaceLayer, + // } + + + // const data1 = await dataQuerySelectWktById(param) + // if (data1.code != 200) { + // this.$message.error("鍒楄〃璋冪敤澶辫触") + // } + // var val1 = decr(data1.result) + // var wkt = this.$wkt.parse(val1) + // var coord = wkt.coordinates var obj = { pageIndex: 1, - pageSize: 10, + pageSize: 100000000, name: 'sexplorationpointstratum', - filter: "exppointid = '" + res.exppointid + "'" + filter: "exppointid in '" + gid.toString() + "'" } var data = await dataQuerySelectByPage(obj) if (data.code != 200) { return } + if (data.result.length == 0) { + return this.$message('鏌ユ棤鏁版嵁'); + } + for (var i in res) { + this.setHistogramLayer(res[i], data.result) + } + // if (data.result.length != 0) { + // var val = data.result; + // //鍐掓场鎺掑簭 + // for (var i = 0; i < val.length; i++) { + // for (var u = i + 1; u < val.length; u++) { + // if (val[i].botdepth > val[u].botdepth) { + // var num = val[i]; + // val[i] = val[u]; + // val[u] = num; + // } + // } + // } - if (data.result.length != 0) { - var val = data.result; - // //鍐掓场鎺掑簭 - // for (var i = 0; i < val.length; i++) { - // for (var u = i + 1; u < val.length; u++) { - // if (val[i].botdepth > val[u].botdepth) { - // var num = val[i]; - // val[i] = val[u]; - // val[u] = num; - // } - // } - // } - var outlineList = this.outlineList - var num = res.elev; - var height = 0; - for (var i = 0; i < val.length; i++) { + // var num = res.elev; + // var height = 0; + // for (var i = 0; i < val.length; i++) { + // var line; + + // var geoname = val[i].geoname; + // var col = outlineList.filter((res) => { + // if (res.name == geoname) { + // return res + // } + // }) + // line = col[0].color + // var height = num - val[i].botdepth + // var layer = Viewer.entities.add({ + // position: Cesium.Cartesian3.fromDegrees(coord[0], coord[1]), + // tag: 'Histogram', + // properties: val[i], + // ellipse: { + // semiMinorAxis: 1.0, //鐭酱 + // semiMajorAxis: 1.0, //闀胯酱 + // height: height, //鎷変几楂樺害 elev gwaterdep + // extrudedHeight: num, //绂诲湴楂樺害 + // rotation: Cesium.Math.toRadians(0), //鏃嬭浆 + // fill: true, //鏄惁鏄剧ず鍦嗙殑濉厖 + // material: Cesium.Color.fromCssColorString(line), //鍦嗙殑棰滆壊, + // outline: false, //鏄惁鏄剧ず鍦嗚疆寤� + + // }, + // }); + // num -= val[i].botdepth; + // this.$store.state.histogramLayer.push(layer) + // } + // } else { + // + // } + // + }, + setHistogramLayer(res, data) { + + var exppointid = res.exppointid; + + var val1 = decr(res.geom) + var wkt = this.$wkt.parse(val1) + var coord = wkt.coordinates; + + var std = []; + var num = res.elev == null ? 0 : res.elev; + + var height = 0; + for (var i in data) { + if (data[i].exppointid == exppointid) { + std.push(data[i]) + } + } + + var outlineList = this.outlineList; + if (std.length > 0) { + for (var i in std) { var line; - - var geoname = val[i].geoname; - var col = outlineList.filter((res) => { - if (res.name == geoname) { + var geoname = std[i].geoname; + var col = outlineList.filter((ste) => { + if (ste.name == geoname) { return res } }) + + if (col.length == 0) { + col = outlineList.filter((ste) => { + if (ste.name == '鍏朵粬') { + return res + } + }) + } line = col[0].color - var height = num - val[i].botdepth + + var height = num - std[i].botdepth + // console.log(num, std[i].botdepth) var layer = Viewer.entities.add({ position: Cesium.Cartesian3.fromDegrees(coord[0], coord[1]), tag: 'Histogram', - properties: val[i], + properties: std[i], ellipse: { - semiMinorAxis: 1.0, //鐭酱 - semiMajorAxis: 1.0, //闀胯酱 + semiMinorAxis: 2.0, //鐭酱 + semiMajorAxis: 2.0, //闀胯酱 height: height, //鎷変几楂樺害 elev gwaterdep extrudedHeight: num, //绂诲湴楂樺害 rotation: Cesium.Math.toRadians(0), //鏃嬭浆 @@ -863,15 +971,15 @@ }, }); - num -= val[i].botdepth; + num -= std[i].botdepth; this.$store.state.histogramLayer.push(layer) } - } else { - return this.$message('鏌ユ棤鏁版嵁'); + this.$store.state.histLenged = true; } - this.$store.state.histLenged = true; - }, + + + }, @@ -918,47 +1026,53 @@ pageIndex: 1, pageSize: this.geobodyCount, wkt: this.listdata.wkt, - name: this.listdata.name + name: this.listdata.name, + hasGeom: 1, } const data = await dataQuerySelectByPage(obj) + if (data.code != 200) { return } + var gid = []; var val = data.result; - var std = []; for (var i in val) { - var param = { - gid: val[i].gid, - name: this.spaceLayer, - } + gid.push(val[i].exppointid) + } + var obj = { + pageIndex: 1, + pageSize: 100000000, + name: 'sexplorationpointstratum', + filter: "exppointid in '" + gid.toString() + "'" + } + var data2 = await dataQuerySelectByPage(obj) - const data1 = await dataQuerySelectWktById(param) - if (data1.code != 200) { - this.$message.error("鍒楄〃璋冪敤澶辫触") - } - var val1 = decr(data1.result) - var wkt = this.$wkt.parse(val1) - var coord = wkt.coordinates - var obj = { - pageIndex: 1, - pageSize: 10, - name: 'sexplorationpointstratum', - filter: "exppointid = '" + val[i].exppointid + "'" - } - var data2 = await dataQuerySelectByPage(obj) + if (data2.code == 200) { + var val2 = data2.result; + var std = []; + for (var i in val) { + var soilLayers = []; - if (data2.code == 200) { - + for (var j in val2) { + if (val2[j].exppointid == val[i].exppointid) { + soilLayers.push(val2[j]) + } + } + var val1 = decr(val[i].geom) + var wkt = this.$wkt.parse(val1) + var coord = wkt.coordinates + var alt = val[i].elev == null ? 0 : val[i].elev; std.push({ bh: val[i].exppointid, X: coord[0], Y: coord[1], - Z: val[i].elev, - soilLayers: data2.result + Z: alt, + soilLayers: soilLayers }) } + this.setLayerByZFBH(std); } - this.setLayerByZFBH(std); + } else { return this.$message('鏈煡璇㈠埌杞瓟鐐规暟鎹�,鏃犳硶鐢熸垚鍦拌川浣�'); } @@ -971,7 +1085,9 @@ { 'name': '鍗电煶', 'color': [54, 83, 173, 1] }, { 'name': '娉ュ博', 'color': [47, 30, 13, 1] }, { 'name': '缁嗙爞', 'color': [93, 88, 15, 1] }, - { 'name': '涓爞', 'color': [164, 140, 21, 1] } + { 'name': '涓爞', 'color': [164, 140, 21, 1] }, + { 'name': '娣ゆ偿璐ㄥ湡', 'color': [75, 74, 78, 1] }, + { 'name': '鍏朵粬', 'color': [225, 225, 225, 1] } ] for (var i = 0; i < list.length; i++) { var out_color = list[i].color @@ -991,18 +1107,16 @@ for (let i = 0; i < jsonObj.length; i++) { var p = jsonObj[i]; var layers = p.soilLayers; - points.features.push(turf.point([parseFloat(p.X), parseFloat(p.Y)], { alt: p.Z })); + var alHeight = p.Z; + points.features.push(turf.point([parseFloat(p.X), parseFloat(p.Y)], { alt: alHeight })); for (let j = 0; j < layers.length; j++) { let obj = layers[j]; - if (obj.geoname == zfbh) { if (j == 0) { - - featurePoints.push(...[parseFloat(p.X), parseFloat(p.Y), parseFloat(p.Z)]); - featurePoints1.push(...[parseFloat(p.X), parseFloat(p.Y), (parseFloat(p.Z) - parseFloat(obj.botdepth))]); + featurePoints.push(...[parseFloat(p.X), parseFloat(p.Y), parseFloat(alHeight)]); + featurePoints1.push(...[parseFloat(p.X), parseFloat(p.Y), (parseFloat(alHeight) - parseFloat(obj.botdepth))]); } else { - let obj_height = this.GetRealHeight(j, layers, p.Z); - + let obj_height = this.GetRealHeight(j, layers, alHeight); featurePoints.push(...[parseFloat(p.X), parseFloat(p.Y), parseFloat(obj_height.topHeight)]); featurePoints1.push(...[parseFloat(p.X), parseFloat(p.Y), parseFloat(obj_height.bottomHeight)]); @@ -1030,6 +1144,7 @@ //缁勮椤跺簳闈㈠洓涓《鐐� this.CreateRoundMian(aboveTin, aboveHull, underTin, underHull, materialColor); //鍒涘缓闈� + this.CreateTin(aboveTin, materialColor); this.CreateTin(underTin, materialColor); }, @@ -1102,7 +1217,6 @@ CreateTin(tin, materialColor) { for (let n = 0; n < tin.features.length; n++) { let geoms = tin.features[n].geometry.coordinates[0]; - let points = []; let p1 = new Cesium.Cartesian3.fromDegrees(geoms[0][0], geoms[0][1], tin.features[n].properties.a); let p2 = new Cesium.Cartesian3.fromDegrees(geoms[1][0], geoms[1][1], tin.features[n].properties.b); @@ -1238,7 +1352,6 @@ this.$store.state.queryInfo.push(point) sgworld.Navigate.flyToObj(point) this.$store.state.primitLayer = point - break case "LineString": case "MultiLineString": @@ -1298,6 +1411,13 @@ pick.id.tag && pick.id.tag.includes("properties_") ) { + if (this.spaceLayer == 'msurfacedeformationdata') { + this.$store.state.surfaceDeForm.flag = true; + this.$store.state.surfaceDeForm.gid = pick.id.properties.gid._value; + } else { + this.$store.state.surfaceDeForm.flag = false; + this.$store.state.surfaceDeForm.gid = null; + } this.$store.state.propertiesFlag = "1" let properties = pick.id.properties let propertyNames = pick.id.properties.propertyNames @@ -1380,7 +1500,7 @@ } .bottomPage { position: absolute; - bottom: 3%; + bottom: 10px; } /deep/.el-form-item { margin-bottom: 0px; -- Gitblit v1.9.3