From a4dbd46f61459d4fd1079558bec8032e057bfe27 Mon Sep 17 00:00:00 2001 From: lixuliang <lixuliang_hd@126.com> Date: 星期三, 17 四月 2024 20:36:33 +0800 Subject: [PATCH] Merge branch 'master' of http://103.135.160.14:9034/r/wxdDemo --- src/components/viewer.vue | 304 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 304 insertions(+), 0 deletions(-) diff --git a/src/components/viewer.vue b/src/components/viewer.vue new file mode 100644 index 0000000..c85fdf2 --- /dev/null +++ b/src/components/viewer.vue @@ -0,0 +1,304 @@ +<template> + <div> + <div id="app1"></div> + </div> +</template> + +<script> +import { + loadBaimo, + loadLW, + loaddian, + addMouseEvent, + addRightMouseEvent, + loadYH, + juhe, + addMpt, + SPPM, + light, +} from "@/utils/work"; +import bus from "@/utils/bus"; +import { getVectorList, getRadio } from "@/api/http"; +export default { + name: "App", + data() { + return {}; + }, + methods: { + init() { + const that = this; + window.currentsubindex = 1; + let _core = new SmartEarth.Core(); + window.tedp = new this.$trame({ + elem: "app1", + width: 4992, + prop: [0, 0], + height: 2560, + navtop: 300, + gisType: "hf", + gisrefer: { + //聽configLink:聽"/static/sceneConfig_arcgis.json", + //聽gisserver:聽"http://172.82.4.53:8080/", + cesium: Cesium, + options: { + // // 鑵捐鍦板浘 + // imageryProvider: new Cesium.ArcGisMapServerImageryProvider({ + // url: + // "https://map.geoq.cn/ArcGIS/rest/services/ChinaOnlineCommunity/MapServer", + // enablePickFeatures: false, + // usePreCachedTilesIfAvailable: false, + // tilingScheme: _core.getOffsetTilingScheme() // 鍋忕Щ绾犳 + // }), + scene3DOnly: false, + sceneModePicker: false, + }, + tree: null, + }, + gisInit: (webgis) => { + //杩斿洖鍦板浘瀵硅薄 + window.Sgworld = webgis; + window.sgworld = webgis; + window.Viewer = webgis.Viewer; + window.viewer = webgis.Viewer; + window.Cesium = Cesium; + + window.layers = window.sgworld.Viewer.scene.imageryLayers; + // const blackMarble = layers.addImageryProvider( + // new Cesium.IonImageryProvider({ assetId: 3812 }) + // ); + + // blackMarble.alpha = 0.0; + // blackMarble.brightness = 2.0; + // 鍦扮悆棰滆壊 + Viewer.scene.globe.baseColor = + Cesium.Color.fromCssColorString("#272d39"); + // //椋炲悜骞垮窞 + // window.Viewer.camera.flyTo({ + // destination: Cesium.Cartesian3.fromDegrees( + // 113.29503528791071, + // 23.104708355136264, + // 4109.8492337442767 + // ), + // orientation: { + // heading: 0.8349372341578318, + // pitch: -0.85222154573481174, + // roll: 0, + // }, + // }); + window.Viewer.camera.flyTo({ + destination: Cesium.Cartesian3.fromDegrees( + 120.37492388223879, + 30.91054534935262, + 97611.15133443385 + ), + orientation: { + heading: 1.249372341578318, + pitch: -0.7222154573481174, + roll: 0, + }, + }); + let urldian1 = + "http://183.162.245.49:8099/geoserver/SHwuxiandian/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=SHwuxiandian:1GZ_POI&maxFeatures=50&outputFormat=application%2Fjson"; + let urldian = + "http://183.162.245.49:8099/geoserver/SHP/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=SHP:SH_POI1&maxFeatures=50&outputFormat=application%2Fjson"; + try { + loaddian(urldian1, "[TE_DESC]", "[height]"); + loaddian(urldian, "[name]", "[Height]"); + loadBaimo(1); + loadLW(); + addRightMouseEvent(); + SPPM(); + loadYH(); + juhe(true, "鐩戞祴绔�"); + addMpt(true); + } catch (error) {} + //寮�鍚棩鐓� + viewer.scene.globe.enableLighting = false; + viewer.shadows = false; + addMouseEvent(); + light(); + getVectorList().then((res) => { + if (res.message === "Success") { + let region = res.rows; + region.forEach((item) => { + let arr = []; + JSON.parse(item.vlatlngs).forEach((item2) => { + arr.push([item2[1], item2[0]]); + }); + item.vlatlngs = JSON.stringify(arr); + }); + bus.$emit("areaData", region); + } + }); + //鑾峰彇鏃犵嚎鐢垫暟鎹� + getRadio().then((res) => { + if (res.message === "Success") { + let radio = res.rows; + bus.$emit("radioData", radio); + console.log(radio); + } + }); + // window.Viewer.shadows = false; + //娣卞害妫�娴� + window.Sgworld.Analysis.depthTestAgainstTerrain(true); + /* + * 鎷惧彇鐐瑰嚮浜嬩欢 + */ + // window.Viewer.scene.primitives.add(baimo); + //鍘垮煙杈圭晫,缃戞牸 + }, + subClick(index) { + let showindex; + switch (index) { + case 0: + showindex = 1; + break; + case 1: + showindex = 2; + break; + case 2: + showindex = 3; + break; + case 3: + showindex = 4; + break; + case 4: + showindex = 5; + break; + default: + break; + } + bus.$emit("showindex", showindex); + }, + prop: [970, 970], + nav: { + navTop: () => import("@/components/top/navTop"), + }, + showSub: true, + compss: [ + { + sub: "棰戣氨鎬佸娍鍒嗘瀽", //缃戞牸绠$悊 + left: { + wgglleft: () => import("@/components/wggl/left/index"), + }, + right: { + wgglright: () => import("@/components/wggl/right/index"), + }, + }, + { + sub: "棰戣氨浣跨敤璇勪及", //缃戞牸绠$悊 + left: { + wgglleft: () => import("@/components/wggl/left/index"), + }, + right: { + wgglright: () => import("@/components/wggl/right/index"), + }, + }, + { + sub: "瑕嗙洊鑳藉姏璇勪及", //缃戞牸绠$悊 + left: { + wgglleft: () => import("@/components/wggl/left/index"), + }, + right: { + wgglright: () => import("@/components/wggl/right/index"), + }, + }, + { + sub: "鏁版嵁绠$悊", //缃戞牸绠$悊 + left: { + wgglleft: () => import("@/components/wggl/left/index"), + }, + right: { + wgglright: () => import("@/components/wggl/right/index"), + }, + }, + { + sub: "鎶ュ憡搴�", //缃戞牸绠$悊 + left: { + wgglleft: () => import("@/components/wggl/left/index"), + }, + right: { + wgglright: () => import("@/components/wggl/right/index"), + }, + }, + ], + module: { + menubtns: () => import("@/components/props/btns"), //搴曢儴5鏍忔寜閽� + showmodule: () => import("@/components/props/showmodule"), //姘撮潰妯″瀷鍒犲噺 + showtuli: () => import("@/components/props/tuli"), //姘撮潰妯″瀷鍒犲噺 + + fieldStrength: () => import("@/components/props/fieldStrength"), //鍦哄己瑕嗙洊璇勪及 + situationAnalysis: () => + import("@/components/props/situationAnalysis"), //鐢电鐜鎬佸娍 + jcz: () => import("@/components/props/jczBox"), //鐩戞祴绔� + jcw: () => import("@/components/props/jcwBox"), //鐩戞祴缃� + FreefrequencyAnalysis: () => + import("@/components/props/FreefrequencyAnalysis"), //绌洪棽棰戠巼璧勬簮鍒嗘瀽 + FrequencyBand: () => import("@/components/props/FrequencyBand"), //棰戞鍗犵敤搴﹀垎鏋� + DynamicMap: () => import("@/components/props/bottom"), //鎬佸娍鍥惧姩鎬佹挱鏀� + freeAnalyse: () => import("@/components/props/freeAnalyse"), //绌洪棽璧勬簮灞曠ず + moreTZ: () => import("@/components/props/moreTZ"), //绌洪棽璧勬簮灞曠ず + }, + }); + }, + }, + mounted() { + this.init(); + }, +}; +</script> + +<style> +#app1 { + font-family: "Avenir", Helvetica, Arial, sans-serif; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + text-align: center; + color: #2c3e50; + margin-top: 60px; + user-select: none; +} +#toolTip { + padding: 13px !important; + background: url("../../static/img/gridManagement/杈规3.png") !important; + background-repeat: no-repeat; + background-size: 100% 100% !important; +} + +.toolitem { + width: 100%; + height: 32px; + line-height: 32px; + font-size: 14px; +} +.toolitem span + span { + color: #f7f330; +} +.nav { + background: url() !important; +} +/* 鐩掑瓙鍏ㄥ眬鏍峰紡 */ +.divPoint-custom { + text-align: center; + padding: 5px 30px; + margin: 0; + color: #fff; + background: linear-gradient(rgb(7 10 203 / 75%), rgb(16 238 220)); + border-radius: 5px; + max-height: 130px; + user-select: none; +} +.divPoint-custom:after { + content: ""; + position: absolute; + bottom: -60px; + left: calc(50% - 3px); + display: block; + width: 3px; + height: 60px; + border-right: 3px solid #2bcdbb; +} +.te-right .te-left { + width: 0px !important; +} +</style> -- Gitblit v1.9.3