From dbb352c9d988dfac83da979023fe81a0a02f88e9 Mon Sep 17 00:00:00 2001 From: lixuliang <lixuliang_hd@126.com> Date: 星期五, 12 四月 2024 16:34:20 +0800 Subject: [PATCH] 与数字人合并 --- src/components/map/viewer.vue | 63 +++++++++++++++++++++++++++++-- 1 files changed, 59 insertions(+), 4 deletions(-) diff --git a/src/components/map/viewer.vue b/src/components/map/viewer.vue index 1a7c8e9..bd20cd5 100644 --- a/src/components/map/viewer.vue +++ b/src/components/map/viewer.vue @@ -1,6 +1,34 @@ <template> <div> <div id="sdkContainer"></div> + <!-- <iframe + id="digital_page" + v-if="isShowDigitalPerson" + src="https://iframetester.com/" + height="450" + width="600" + frameborder="no" + border="0" + marginwidth="0" + marginheight="0" + scrolling="no" + allowtransparency="yes" + ></iframe> --> + <iframe + v-if="isShowDigitalPerson" + id="digital_page" + allow="microphone;" + :src="digitalHuman" + :height="digitalSize.height" + :width="digitalSize.width" + frameborder="no" + border="0" + marginwidth="0" + marginheight="0" + scrolling="no" + allowtransparency="yes" + ></iframe> + <div class="listBox" v-show="viewer1Show && !isLand"> <ul id="viewer_lsyx"> <li @@ -12,6 +40,7 @@ </li> </ul> </div> + <layerTreeTwoScreen v-if="layerTreeTwoScreen" /> <!-- <div id="bottomInfo" v-html="bottomInfo"></div> --> <div @@ -67,6 +96,10 @@ import "animate.css"; import Bus from "@tools/Bus"; +import mapData from "../../../static/mapData"; +import mapMsg from "../../assets/js/mapMsg"; +import vueEvents from "@/utils/vueEvent.js"; + let activeLi, nLayer, LWLayer; export default { name: "viewer", @@ -88,6 +121,8 @@ scale: "1", offset: "0%", radio: 3, + digitalHuman: null, + digitalSize: {}, arr: [ 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, @@ -96,6 +131,9 @@ }, computed: { ...mapState(["viewer1Show", "isLand", "layerTreeTwoScreen", "cesiumInit"]), + isShowDigitalPerson() { + return this.$store.state.isShowDigitalPerson; + }, }, watch: { viewer1Show(newvalue, oldvalue) { @@ -116,15 +154,22 @@ }, }, mounted() { + this.digitalHuman = window.digitalHumanURL; + this.digitalSize = window.digitalSize; + let pathName = window.location.pathname.split("/"); + let StaticFileBaseUrl; + if (pathName.length != 2) { + StaticFileBaseUrl = `../../../${pathName[1]}/static/CimSDK/`; + } else { + StaticFileBaseUrl = `../../../static/CimSDK/`; + } this.$nextTick(function () { let that = this; //*********鍖椾含sdk************ window.sgworld = new SmartEarth.EarthCtrl( "sdkContainer", { - StaticFileBaseUrl: "../../../static/CimSDK/", - // StaticFileBaseUrl: "../../../SW/static/CimSDK/", - // StaticFileBaseUrl: "../../../YZXNCS/static/CimSDK/", + StaticFileBaseUrl: StaticFileBaseUrl, }, {}, {}, @@ -164,6 +209,7 @@ }, duration: 5, //椋炶鏃堕棿8s }); + // console.log("鍔犺浇瀹屾垚"); }, 14000); that.setCesiumInit(true); } @@ -179,6 +225,10 @@ // Viewer.scene.screenSpaceCameraController.enableCollisionDetection = false; Viewer.scene.globe.translucency.frontFaceAlpha = 0.5; Viewer.scene.globe.undergroundColor = undefined; + + mapMsg.init(); + // rpc.clickToCoordinates(); + // mapMsg.setTime(); //寮�鍚紪杈戝苟鍚敤灞炴�у脊绐� sgworld.Creator.SimpleGraphic.setEdit(true, { editProp: true, @@ -594,7 +644,12 @@ border-radius: 10px; /* box-shadow: 0px 0px 5px 3px #fff; */ } - +#digital_page { + position: absolute; + left: 0; + bottom: 120px; + z-index: 10; +} /* #switchImagerLayer:before { content: ""; position: absolute; -- Gitblit v1.9.3