From 1ce1b525e7470ebaaeb0d5cd1e59bd905c1a7114 Mon Sep 17 00:00:00 2001 From: surprise <15810472099@163.com> Date: 星期二, 05 三月 2024 18:07:32 +0800 Subject: [PATCH] 代码更新 --- src/components/MapView/mapSpacePop.vue | 238 ++++++++++++++++++----------------------------------------- 1 files changed, 74 insertions(+), 164 deletions(-) diff --git a/src/components/MapView/mapSpacePop.vue b/src/components/MapView/mapSpacePop.vue index ceb8d8c..7f5fdab 100644 --- a/src/components/MapView/mapSpacePop.vue +++ b/src/components/MapView/mapSpacePop.vue @@ -1,42 +1,17 @@ <template> <div class="menuPop"> <div style="padding: 5px"> - <el-form - :inline="true" - :model="ruleForm" - class="demo-form-inline" - > + <el-form :inline="true" :model="ruleForm" class="demo-form-inline"> <el-form-item> - <el-input - size="small" - style="width:30vh" - v-model="ruleForm.fileName" - disabled - placeholder="璇疯緭鍏�..." - ></el-input> + <el-input size="small" style="width:30vh" v-model="ruleForm.fileName" placeholder="璇疯緭鍏�..."></el-input> </el-form-item> <el-form-item> - <el-button - @click="conditionVisible = true" - size="small" - type="success" - >{{$t('common.lable6')}}</el-button> - <el-button - size="small" - @click="resetForm" - >閲嶇疆</el-button> + <el-button @click="getDomainsLayer" size="small" type="success">鏌ヨ</el-button> + <el-button size="small" @click="resetForm">閲嶇疆</el-button> </el-form-item> <el-form-item v-if="spaceLayer == 'sexplorationpoint'"> - <el-button - size="small" - @click="spaceHistogram()" - plain - >鏌辩姸鍥�</el-button> - <el-button - plain - size="small" - @click="spaceGeobody()" - >鍦拌川浣�</el-button> + <el-button size="small" @click="spaceHistogram()" plain>鏌辩姸鍥�</el-button> + <el-button plain size="small" @click="spaceGeobody()">鍦拌川浣�</el-button> </el-form-item> </el-form> <!-- <el-form @@ -108,32 +83,18 @@ </el-form-item> </el-form> --> <div class="centTable"> - <el-table - :data="tableData" - border - height="100%" - ref="filterTable" - style="width: 100%" - > - <el-table-column - align="center" - type="index" - label="搴忓彿" - width="50" - /> - <el-table-column - label="瀹氫綅" - width="100" - align="center" - > + <el-table :data="tableData" border height="100%" ref="filterTable" style="width: 100%"> + <el-table-column align="center" type="index" label="搴忓彿" width="50" /> + <el-table-column label="瀹氫綅" width="100" align="center"> <template slot-scope="scope"> - <el-button - icon="el-icon-map-location" - size="small" - @click="spaceLocation(scope.$index, scope.row)" - ></el-button> + <el-button icon="el-icon-map-location" size="small" + @click="spaceLocation(scope.$index, scope.row)"></el-button> </template> </el-table-column> + <el-table-column label="鍚嶇О" prop="name" align="center"></el-table-column> + <el-table-column label="鐜嚎" prop="line" align="center"></el-table-column> + <el-table-column label="绫诲瀷" prop="type" align="center"></el-table-column> + <el-table-column label="浣嶇疆" prop="geom" align="center"></el-table-column> <!-- <el-table-column label="鏌辩姸鍥�" width="100" @@ -148,106 +109,46 @@ ></el-button> </template> </el-table-column> --> - <el-table-column - v-for="(item, index) in attributeData" - :key="index" - :label="item.alias" - :prop="item.field" - show-overflow-tooltip - align="center" - :fit="true" - ></el-table-column> + </el-table> </div> <div class="bottomPage pagination_box"> - <el-pagination - @size-change="handleSizeChange" - @current-change="handleCurrentChange" - :current-page="listdata.pageIndex" - :page-sizes="[10, 20, 50, 100]" - :page-size="listdata.pageSize" - layout="total, sizes, prev, pager, next, jumper" - :total="count" - > + <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" + :current-page="listdata.pageIndex" :page-sizes="[10, 20, 50, 100]" :page-size="listdata.pageSize" + layout="total, sizes, prev, pager, next, jumper" :total="count"> </el-pagination> </div> </div> - <el-dialog - :visible.sync="conditionVisible" - title="楂樼骇鏌ヨ" - width="44%" - :close-on-click-modal="false" - :modal="false" - > + <el-dialog :visible.sync="conditionVisible" title="楂樼骇鏌ヨ" width="44%" :close-on-click-modal="false" :modal="false"> - <el-form - :inline=" true" - :model="formSql" - class="demo-form-inline" - label-position="top" - > + <el-form :inline="true" :model="formSql" class="demo-form-inline" label-position="top"> <el-form-item> - <el-select - @change="fieldChange($event)" - v-model="formSql.field" - :popper-append-to-body="false" - > - <el-option - v-for="item in filedsOption" - :key="item.field" - :label="item.alias" - :value="item.field" - > + <el-select @change="fieldChange($event)" v-model="formSql.field" :popper-append-to-body="false"> + <el-option v-for="item in filedsOption" :key="item.field" :label="item.alias" :value="item.field"> </el-option> </el-select> </el-form-item> <el-form-item> - <el-select - :popper-append-to-body="false" - v-model="formSql.condition" - > - <el-option - v-for="item in condOption" - :key="item.value" - :label="item.label" - :value="item.value" - > + <el-select :popper-append-to-body="false" v-model="formSql.condition"> + <el-option v-for="item in condOption" :key="item.value" :label="item.label" :value="item.value"> </el-option> </el-select> </el-form-item> <el-form-item v-show="!fromSqlflag"> - <el-input - v-model="formSql.value" - :placeholder="$t('shuJuGuanLi.shuJuJianSuo.queryContent')" - > </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 - v-model="formSql.date" - type="date" - placeholder="閫夋嫨鏃ユ湡" - value-format="yyyy-MM-dd" - > + <el-date-picker v-model="formSql.date" type="date" placeholder="閫夋嫨鏃ユ湡" value-format="yyyy-MM-dd"> </el-date-picker> </el-form-item> </el-form> - <span - slot="footer" - class="dialog-footer" - > - <el-button - size="small" - @click="startFiledAndcondition" - >鍙� 娑�</el-button> - <el-button - class="primaries" - size="small" - @click="appendQueryFilter" - >纭� 瀹�</el-button> + <span slot="footer" class="dialog-footer"> + <el-button size="small" @click="startFiledAndcondition">鍙� 娑�</el-button> + <el-button class="primaries" size="small" @click="appendQueryFilter">纭� 瀹�</el-button> </span> </el-dialog> @@ -256,12 +157,7 @@ <script> import { - dataQuerySelectByPage, - dataQuerySelectWktById, - inquiry_selectFields, - inquiry_selectDomains, - decr, - encr, + zhangzitou_selectAll } from "../../api/api.js" import * as turf from "@turf/turf" import { conditions } from "../../views/Archive/Archive.js"; @@ -594,18 +490,24 @@ }, //鍒濆鍖栨煡璇㈤槇鍊艰〃 async getDomainsLayer() { - this.$store.state.loading = true; - const data = await inquiry_selectDomains({ name: this.spaceLayer }) - if (data.code != 200) { - this.$message.error("鍒楄〃闃堝�艰皟鐢ㄥけ璐�") - } - // if (data.result.length == 0) { - // this.$message("鍒楄〃闃堝�兼煡鏃犳暟鎹�") + const data = await zhangzitou_selectAll(this.listdata) + + if (data.code != 200) return + + this.count = data.result.total + this.tableData =data.result.pois; + // this.$store.state.loading = true; + // const data = await inquiry_selectDomains({ name: this.spaceLayer }) + // if (data.code != 200) { + // this.$message.error("鍒楄〃闃堝�艰皟鐢ㄥけ璐�") // } - this.domainsLayer = data.result + // // if (data.result.length == 0) {showLayerAttribute + // // this.$message("鍒楄〃闃堝�兼煡鏃犳暟鎹�") + // // } + // this.domainsLayer = data.result - this.setListDataStart() - this.getTableselectFields() + // this.setListDataStart() + // this.getTableselectFields() }, @@ -1030,7 +932,7 @@ hasGeom: 1, } const data = await dataQuerySelectByPage(obj) - + if (data.code != 200) { return } @@ -1107,7 +1009,7 @@ for (let i = 0; i < jsonObj.length; i++) { var p = jsonObj[i]; var layers = p.soilLayers; - var alHeight = 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]; @@ -1144,7 +1046,7 @@ //缁勮椤跺簳闈㈠洓涓《鐐� this.CreateRoundMian(aboveTin, aboveHull, underTin, underHull, materialColor); //鍒涘缓闈� - + this.CreateTin(aboveTin, materialColor); this.CreateTin(underTin, materialColor); }, @@ -1284,34 +1186,35 @@ }; }, async spaceLocation(index, row) { - var param = { - gid: row.gid, - name: this.spaceLayer, - } - const data = await dataQuerySelectWktById(param) - if (data.code != 200) { - this.$message.error("鍒楄〃璋冪敤澶辫触") - } + // var param = { + // gid: row.gid, + // name: this.spaceLayer, + // } + // const data = await dataQuerySelectWktById(param) + // if (data.code != 200) { + // this.$message.error("鍒楄〃璋冪敤澶辫触") + // } - var val1 = decr(data.result) - if (val1) { + // var val1 = decr(row.geom) + + if (row) { if (this.$store.state.primitLayer != null) { sgworld.Viewer.entities.remove(this.$store.state.primitLayer) sgworld.Creator.DeleteObject(this.$store.state.primitLayer) this.$store.state.primitLayer = null } - var wkt = this.$wkt.parse(val1) + var wkt = this.$wkt.parse(row.geom) this.setMapLoaction(wkt, row) } }, handleSizeChange(val) { - this.listdata.pageSize = val - this.getSpaceTableLayer() + this.listdata.limit = val + this.getDomainsLayer() }, handleCurrentChange(val) { - this.listdata.pageIndex = val - this.getSpaceTableLayer() + this.listdata.page = val + this.getDomainsLayer() }, setMapLoaction(res, properties) { if (this.$store.state.primitLayer != null) { @@ -1324,6 +1227,7 @@ switch (res.type) { case "Point": + console.log(res) var val = Cesium.Cartesian3.fromDegrees( res.coordinates[0], res.coordinates[1] @@ -1348,9 +1252,10 @@ show: true, }, }) + console.log(point) point.billboard.disableDepthTestDistance = Number.POSITIVE_INFINITY this.$store.state.queryInfo.push(point) - sgworld.Navigate.flyToObj(point) + Viewer.flyTo(point) this.$store.state.primitLayer = point break case "LineString": @@ -1484,24 +1389,29 @@ overflow: hidden; border: 1px solid gray; float: left; + .centTable { position: absolute; height: 66%; width: 98%; } + .rightTitle { padding: 5px; width: 100%; + .boxClose { float: right; margin-right: 20px; } } + .bottomPage { position: absolute; bottom: 10px; } + /deep/.el-form-item { margin-bottom: 0px; } -- Gitblit v1.9.3