From 28bd61701bb409257ea0dd3c78f32bd0b45ebbd5 Mon Sep 17 00:00:00 2001 From: Surpriseplus <845948745@qq.com> Date: 星期一, 06 三月 2023 09:16:35 +0800 Subject: [PATCH] Merge branch 'master' of http://192.168.20.39:8989/r/LFWEB_NEW --- src/components/mapsdk.vue | 522 +++++++++++++++++++++++++++++++++++++++++++++++++-------- 1 files changed, 447 insertions(+), 75 deletions(-) diff --git a/src/components/mapsdk.vue b/src/components/mapsdk.vue index ccab4d6..f6c03dd 100644 --- a/src/components/mapsdk.vue +++ b/src/components/mapsdk.vue @@ -8,7 +8,6 @@ <map-menu-top v-if="$store.state.mapMenuBoxFlag == '1'" /> <map-space-top v-if="$store.state.mapMenuBoxFlag == '2'" /> </div> - <div class="bufferBox" v-if="showBufferBoxDialog" @@ -97,6 +96,44 @@ </el-card> </div> <div + class="terrainLevelBox" + v-if="showTerrainLevelDialog" + > + <el-card class="box-card"> + <div slot="header"> + <span>鍦板舰骞虫暣</span> + <div style="float: right; cursor: pointer"> + <i + class="el-icon-close" + @click="closeBufferBox(5)" + ></i> + </div> + </div> + <div class="box-body"> + <el-form + ref="form" + :model="terrainFrom" + label-width="100px" + > + <el-form-item label="骞虫暣楂樺害:"> + <el-input v-model="terrainFrom.height"></el-input> + </el-form-item> + + <el-form-item> + <el-button + @click="drawTerrainLevel" + type="parmary" + >缁樺埗</el-button> + <el-button + @click="clearTerrainLevel" + type="info" + >娓呴櫎</el-button> + </el-form-item> + </el-form> + </div> + </el-card> + </div> + <div class="toponymicLocalBox" v-if="showToponymicLocalBoxDialog" > @@ -134,6 +171,7 @@ <el-table :data="tableData" height="200px" + border style="width: 100%" > <el-table-column @@ -141,33 +179,40 @@ type="index" label="搴忓彿" /> - <el-table-column prop="name" align="center" label="鍦板悕"> + <el-table-column + prop="name" + align="center" + label="鍦板悕" + > <template slot-scope="scope"> <el-button - @click="handleLocation(scope.$index, scope.row)" - size="small" - >{{scope.row.name}}<i class="el-icon-place" style="padding-left: 5px"></i></el-button> + @click="handleLocation(scope.$index, scope.row)" + size="small" + >{{scope.row.name}}<i + class="el-icon-place" + style="padding-left: 5px" + ></i></el-button> </template> </el-table-column> -<!-- <el-table-column--> -<!-- prop="name"--> -<!-- align="center"--> -<!-- label="瀹氫綅"--> -<!-- >--> -<!-- <template slot-scope="scope">--> -<!-- <el-button--> -<!-- @click="handleLocation(scope.$index, scope.row)"--> -<!-- size="small"--> -<!-- icon="el-icon-place"--> -<!-- ></el-button>--> -<!-- </template>--> -<!-- </el-table-column>--> -<!-- <el-table-column--> -<!-- prop="name"--> -<!-- align="center"--> -<!-- label="鍦板悕"--> -<!-- >--> -<!-- </el-table-column>--> + <!-- <el-table-column--> + <!-- prop="name"--> + <!-- align="center"--> + <!-- label="瀹氫綅"--> + <!-- >--> + <!-- <template slot-scope="scope">--> + <!-- <el-button--> + <!-- @click="handleLocation(scope.$index, scope.row)"--> + <!-- size="small"--> + <!-- icon="el-icon-place"--> + <!-- ></el-button>--> + <!-- </template>--> + <!-- </el-table-column>--> + <!-- <el-table-column--> + <!-- prop="name"--> + <!-- align="center"--> + <!-- label="鍦板悕"--> + <!-- >--> + <!-- </el-table-column>--> </el-table> <div class="pagination_box"> <el-pagination @@ -175,7 +220,7 @@ @current-change="handleCurrentChange" :current-page="listData.pageIndex" :page-sizes="[10, 20, 50, 100]" - :pager-count = "3" + :pager-count="3" :page-size="listData.pageSize" layout="total, prev, pager, next" :total="count" @@ -251,29 +296,168 @@ </div> <div style="display: flex"> <div - @click="changeMenulayer" - class="center CenDiv" - :class="{ center1: centerFlag }" + @click="changeMenulayer" + class="center CenDiv" + :class="{ center1: centerFlag }" > <div - id="cenBg" - v-bind:class="{ active: isActive, menuLayer: isMenuLayer }" + id="cenBg" + v-bind:class="{ active: isActive, menuLayer: isMenuLayer }" ></div> </div> - <div @click="changeMapType" class="changeMapType"> - <div id="cenBg" :class="show2DMap ? 'mapTypeTwo' : 'mapTypeThree'"></div> + <div + @click="changeMapType" + class="changeMapType" + > + <div + id="cenBg" + :class="show2DMap ? 'mapTypeTwo' : 'mapTypeThree'" + ></div> </div> </div> -<!-- <div--> -<!-- @click="changeMenulayer"--> -<!-- class="center CenDiv"--> -<!-- :class="{ center1: centerFlag }"--> -<!-- >--> -<!-- <div--> -<!-- id="cenBg"--> -<!-- v-bind:class="{ active: isActive, menuLayer: isMenuLayer }"--> -<!-- ></div>--> -<!-- </div>--> + <div + class="lengend" + v-show="showLengendDialog" + > + <el-card class="box-card"> + <!-- <div + class="lengend_color" + style="height:205px" + > + + </div> --> + <div class="lengendBox"> + + <div> + <img + class="lengendImg" + src="../assets/img/colors.png" + /> + </div> + <div class="lengendSpan"> + <div>0掳</div> + <div>17.5掳</div> + <div>35掳</div> + <div>52.5掳</div> + <div>70掳</div> + </div> + + </div> + </el-card> + </div> + <div + class="propertiesPop" + v-if="$store.state.propertiesFlag == '1'" + > + <el-card class="box-card"> + <div slot="header"> + <span>{{$store.state.propertiesName.tabDesc || '灞炴�т俊鎭�'}}</span> + <div style="float: right; cursor: pointer"> + <el-link type="primary" :underline="false" @click="getAttatchList" style="margin-right: 10px">鏌ョ湅闄勪欢</el-link> + <i + class="el-icon-close" + @click="closeBufferBox(6)" + ></i> + </div> + </div> + <div + class="pointInfoBoxContext" + style="height:250px;overflow-y: auto" + > + <div + style="line-height: 20px" + v-for="(value, key) in $store.state.propertiesInfo" + :key="key" + > + <span v-if="key != 'eventid'" style="font-size: 14px;font-weight: bold;margin-right: 5px">{{key}}:</span> + <span v-if="key != 'eventid'">{{value}}</span> + </div> + </div> + </el-card> + </div> + <!--闄勪欢鍒楄〃寮圭獥--> + <el-dialog + title="闄勪欢鍒楄〃" + :append-to-body="false" + :visible.sync="showAttach" + width="35%" + :close-on-click-modal="false" + > + <div> + <el-table + :data="attachList" + height="100%" + style="width: 100%" + border + > + <el-table-column + align="center" + type="index" + label="搴忓彿" + width="50" + /> + <el-table-column + prop="name" + label="鍚嶇О"> + </el-table-column> + <el-table-column + label="鏃堕棿" + width="180"> + <template slot-scope="scope"> + <span>{{format(scope.row.createTime)}}</span> + </template> + </el-table-column> + <el-table-column + label="鎿嶄綔" + width="100"> + <template slot-scope="scope"> + <el-button v-if="showAttachDetailBtn(scope.row)" @click="showAttachDetail(scope.row)" type="text" size="small">鏌ョ湅</el-button> + </template> + </el-table-column> + </el-table> + </div> + </el-dialog> + <!--闄勪欢寮圭獥--> + <el-dialog + title="棰勮" + :append-to-body="false" + :visible.sync="dialog.dialogVisible" + width="70%" + :close-on-click-modal="false" + > + <div + v-if="dialog.isPdf" + class="pdfClass" + > + <iframe + :src="dialog.src" + type="application/x-google-chrome-pdf" + width="100%" + height="100%" + > + </iframe> + </div> + <div + v-if="dialog.isJpg" + class="pdfClass" + > + <img + style="width:100%; height:100%;" + :src="dialog.src" + alt="" + /> + </div> + </el-dialog> + <!-- <div--> + <!-- @click="changeMenulayer"--> + <!-- class="center CenDiv"--> + <!-- :class="{ center1: centerFlag }"--> + <!-- >--> + <!-- <div--> + <!-- id="cenBg"--> + <!-- v-bind:class="{ active: isActive, menuLayer: isMenuLayer }"--> + <!-- ></div>--> + <!-- </div>--> </div> </div> </template> @@ -281,20 +465,19 @@ <script> import $ from "jquery"; import mapMenuTop from "./MapView/mapMenuTop.vue"; - import mapSpaceTop from "./MapView/mapSpaceTop.vue"; - import { select_Comprehensive_ByPageAndCount, select_Comprehensive_SelectWktById, comprehensive_selectRoute, + dataLib_selectFiles } from "../api/api"; +import {getToken} from '@/utils/auth' export default { name: "", components: { mapMenuTop, - mapSpaceTop, }, data() { @@ -328,7 +511,6 @@ lon: "", lat: "", }, - rules: { lon: [ { required: true, message: "璇疯緭鍏ヨ捣鐐圭粡绾害鍧愭爣", trigger: "blur" }, @@ -373,15 +555,26 @@ layer3: null, isActive: false, isMenuLayer: true, - selFrom: {}, selectTree: null, - + showTerrainLevelDialog: false, menuList: [], defaultProps: { children: "children", label: "label", }, //鏍戠粦瀹氬璞� - show2DMap:false, + show2DMap: false, + terrainFrom: { + height: '10' + }, + showLengendDialog: false, + showAttach:false, + attachList:[], + dialog: { + dialogVisible: false, + isPdf: false, + isJpg: false, + src: '' + } }; }, mounted() { @@ -394,6 +587,28 @@ }); }, methods: { + drawTerrainLevel() { + this.clearTerrainLevel() + var deep = parseFloat(this.terrainFrom.height) + sgworld.Creator.createSimpleGraphic( + 'polygon', + { + clampToGround: true, + }, + function (entity) { + + var positions = entity.polygon.hierarchy.getValue().positions; + sgworld.Creator.SimpleGraphic.remove(entity.id); + + window.TerrainFlattening = sgworld.Creator.createTerrainModifier("鍦板舰鍘嬪钩", positions, deep, {}); + } + ); + }, + clearTerrainLevel() { + if (window.TerrainFlattening) { + window.TerrainFlattening && window.TerrainFlattening.remove(); + } + }, init3DMap() { var webKey = "94a34772eb88317fcbf8428e10448561"; @@ -544,6 +759,23 @@ this.closeBufferBox(4); } } + } else if (res.name == "Trrain") { + switch (res.id) { + case "d10": + this.showTerrainLevelDialog = !this.showTerrainLevelDialog; + this.clearTerrainLevel(); + break; + } + + } else if (res.name == "Lengend") { + switch (res.id) { + case "d2": + + this.showLengendDialog = res.vshow; + + break; + } + } }, handleSizeChange(val) { @@ -628,7 +860,13 @@ case 4: this.showPathAnalysisBoxDialog = false; this.clearPathAll(3); - + break; + case 5: + this.showTerrainLevelDialog = false; + this.clearTerrainLevel() + break; + case 6: + this.$store.state.propertiesFlag = null; break; } }, @@ -643,23 +881,23 @@ Altitude: 2000, }; this.imagePoint = sgworld.Creator.CreateLabel( - position, - "", - SmartEarthRootUrl + "Workers/image/mark.png", - { - disableDepthTestDistance: Infinity, - scale: 0.8, - }, - 0, - "宸℃鐐�" + position, + "", + SmartEarthRootUrl + "Workers/image/mark.png", + { + disableDepthTestDistance: Infinity, + scale: 0.8, + }, + 0, + "宸℃鐐�" ); sgworld.Navigate.jumpTo({ //璺宠浆瑙嗚 destination: new Cesium.Cartesian3.fromDegrees( - lon, - lat, - height + lon, + lat, + height ), }); // sgworld.Navigate.jumpTo({ @@ -910,11 +1148,11 @@ } }, //浜岀淮/涓夌淮鍦板浘鍒囨崲 - changeMapType(){ - // debugger + changeMapType() { + // this.show2DMap = !this.show2DMap; //浜岀淮 - if (this.show2DMap){ + if (this.show2DMap) { this.$bus.$emit("changemap", 2); } //涓夌淮 @@ -922,6 +1160,86 @@ this.$bus.$emit("changemap", 3); } this.$bus.$emit("changemapType", this.show2DMap); + }, + //鑾峰彇闄勪欢鍒楄〃 + async getAttatchList() { + let tabName = this.$store.state.propertiesName.ns+'.'+this.$store.state.propertiesName.tab; + let eventid = this.$store.state.propertiesInfo.eventid; + var obj = { + eventid:eventid, + tabName:tabName, + }; + const res = await dataLib_selectFiles(obj); + if (res.code != 200) { + this.$message.error('闄勪欢鏌ヨ澶辫触'); + return + } + if (res.result.length <= 0) { + this.$message.error('鏆傛棤闄勪欢'); + return + } + this.attachList = res.result; + this.showAttach = true; + }, + //鏄惁鏄剧ず鏌ョ湅鎸夐挳 + showAttachDetailBtn(row){ + var name = row.name; + if (name.indexOf('.pdf') != -1 || name.indexOf('.jpg') != -1 || name.indexOf('.gif') != -1 || name.indexOf('.png') != -1 || name.indexOf('.jpeg') != -1) { + return true; + } + return false; + }, + //鏁版嵁鍒濆鍖� + refreshAttatchDetail() { + this.dialog.src = ""; + this.dialog.dialogVisible = false; + this.dialog.isPdf = false; + this.dialog.isJpg = false; + }, + //鏌ョ湅闄勪欢 + showAttachDetail(row){ + this.refreshAttatchDetail(); + var name = row.name; + if (name.indexOf('.pdf') != -1) { + this.dialog.dialogVisible = true; + this.dialog.isPdf = true; + var url = BASE_URL + "/res/downloadForView?guid=" + row.guid + "&token=" + getToken(); + this.dialog.src = url + } + else if (name.indexOf('.jpg') != -1 || name.indexOf('.gif') != -1 || name.indexOf('.png') != -1 || name.indexOf('.jpeg') != -1) { + this.dialog.dialogVisible = true; + this.dialog.isJpg = true; + var url = BASE_URL + "/res/downloadForView?guid=" + row.guid + "&token=" + getToken(); + this.dialog.src = url + } + }, + //鏍煎紡鍖栨椂闂� + format(shijianchuo) { + //shijianchuo鏄暣鏁帮紝鍚﹀垯瑕乸arseInt杞崲 + var time = new Date(shijianchuo); + var y = time.getFullYear(); + var m = time.getMonth() + 1; + var d = time.getDate(); + var h = time.getHours(); + var mm = time.getMinutes(); + var s = time.getSeconds(); + return ( + y + + '-' + + this.add0(m) + + '-' + + this.add0(d) + + ' ' + + h + + ':' + + mm + + ':' + + s + ); + }, + //鏍煎紡鍖栨椂闂� + add0(m) { + return m < 10 ? '0' + m : m; }, }, }; @@ -944,7 +1262,7 @@ height: 450x; z-index: 40; position: absolute; - right: 6%; + right: 8%; bottom: 1%; } .bufferBox { @@ -960,15 +1278,37 @@ height: 370px; z-index: 40; position: absolute; - right: 6%; + right: 8%; bottom: 1%; + } + .propertiesPop { + width: 350px; + height: 370px; + z-index: 40; + position: absolute; + right: 8%; + bottom: 1%; + /deep/ .el-card__header { + padding: 10px 20px; + } + /deep/ .el-card__body { + padding: 10px 20px; + } + } + .terrainLevelBox { + width: 350px; + height: 370px; + z-index: 40; + position: absolute; + right: 8%; + bottom: -11%; } .pathAnalysisBox { width: 412px; z-index: 40; position: absolute; - right: 6%; + right: 8%; bottom: 1%; } @@ -995,6 +1335,32 @@ bottom: 5%; position: absolute; z-index: 40; + } + + .lengend { + width: 300px; + z-index: 40; + position: absolute; + right: 1%; + bottom: 13%; + transform: rotate(90deg); + .lengendBox { + .lengendSpan { + display: flex; + justify-content: space-between; + margin-top: 10px; + div { + transform: rotate(-90deg); + } + } + .lengendImg { + -ms-transform: rotate(180deg); /* IE 9 */ + -webkit-transform: rotate(180deg); /* Safari and Chrome */ + transform: rotate(180deg); + width: 100%; + height: 30px; + } + } } } } @@ -1094,7 +1460,7 @@ border-radius: 5px; } -.changeMapType{ +.changeMapType { position: absolute; bottom: 1%; left: calc(1% + 75px); @@ -1104,29 +1470,35 @@ display: flex; justify-content: center; align-items: center; - box-shadow: 3px 3px 6px #666; + // box-shadow: 3px 3px 6px #666; //border: 1px solid rgba(204, 204, 204, 0.76); border-radius: 5px; - background: #fff; + cursor: pointer; } -.mapTypeTwo{ +.mapTypeTwo { width: 100%; height: 100%; margin-left: 10px; - background-image: url("../assets/img/3dmap.png"); + background-image: url("../assets/img/synthesis/3D.png"); background-repeat: no-repeat; background-size: contain; } -.mapTypeThree{ +.mapTypeThree { width: 100%; height: 100%; margin-left: 10px; - background-image: url("../assets/img/2dmap.png"); + background-image: url("../assets/img/synthesis/2D 鎷疯礉 2.png"); background-repeat: no-repeat; background-size: contain; } +.pdfClass { + height: 70vh; + width: 100%; + position: relative; +} + // .menuSelect .el-input__inner { // background: rgba(255, 255, 255, 0.2) !important; // color: white !important; -- Gitblit v1.9.3