From b035823c711d43902a06838065598f4f805ab408 Mon Sep 17 00:00:00 2001 From: Surpriseplus <845948745@qq.com> Date: 星期二, 06 六月 2023 14:23:42 +0800 Subject: [PATCH] 菜单修改 --- src/assets/img/leftBtn/形状 6 拷贝 2.png | 0 src/assets/img/leftBtn/箭头-左 拷贝 4.png | 0 src/assets/js/Map/index.js | 34 +++++ src/components/menus.vue | 2 src/assets/img/2D.png | 0 public/CIMSDK/Assets/Textures/SkyBox/new.zip | 0 public/CIMSDK/Assets/Textures/SkyBox/skyBox_px.jpg | 0 public/CIMSDK/Assets/Textures/SkyBox/skyBox_mx.jpg | 0 public/CIMSDK/Assets/Textures/SkyBox/SkyBox.zip | 0 public/CIMSDK/Assets/Textures/SkyBox/skyBox_my.jpg | 0 src/views/Index.vue | 5 src/main.ts | 7 + src/assets/js/Map/server.js | 16 ++ src/assets/img/leftBtn/矩形 8 拷贝 3.png | 0 public/CIMSDK/Assets/Textures/SkyBox/skyBox_mz.jpg | 0 src/assets/img/3D.png | 0 package.json | 1 src/assets/img/leftBtn/箭头-左 拷贝.png | 0 src/components/topBtn.vue | 2 src/assets/js/Map/menuTool.js | 76 +++++++++++- src/views/layer/layerManage.vue | 132 +++++++++++++++++++++ src/assets/js/Map/config.js | 13 + src/components/bottomBtn.vue | 59 ++++++--- 23 files changed, 304 insertions(+), 43 deletions(-) diff --git a/package.json b/package.json index f9e0f10..94c12a8 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "publish": "vue-cli-service serve --mode production" }, "dependencies": { + "@element-plus/icons-vue": "^2.1.0", "amfe-flexible": "^2.2.1", "axios": "^1.3.4", "default-passive-events": "^2.0.0", diff --git a/public/CIMSDK/Assets/Textures/SkyBox/SkyBox.zip b/public/CIMSDK/Assets/Textures/SkyBox/SkyBox.zip new file mode 100644 index 0000000..923bec3 --- /dev/null +++ b/public/CIMSDK/Assets/Textures/SkyBox/SkyBox.zip Binary files differ diff --git a/public/CIMSDK/Assets/Textures/SkyBox/new.zip b/public/CIMSDK/Assets/Textures/SkyBox/new.zip new file mode 100644 index 0000000..94569f4 --- /dev/null +++ b/public/CIMSDK/Assets/Textures/SkyBox/new.zip Binary files differ diff --git a/public/CIMSDK/Assets/Textures/SkyBox/skyBox_mx.jpg b/public/CIMSDK/Assets/Textures/SkyBox/skyBox_mx.jpg index a69ba19..3e937d3 100644 --- a/public/CIMSDK/Assets/Textures/SkyBox/skyBox_mx.jpg +++ b/public/CIMSDK/Assets/Textures/SkyBox/skyBox_mx.jpg Binary files differ diff --git a/public/CIMSDK/Assets/Textures/SkyBox/skyBox_my.jpg b/public/CIMSDK/Assets/Textures/SkyBox/skyBox_my.jpg index efd3cc1..dd1ec4a 100644 --- a/public/CIMSDK/Assets/Textures/SkyBox/skyBox_my.jpg +++ b/public/CIMSDK/Assets/Textures/SkyBox/skyBox_my.jpg Binary files differ diff --git a/public/CIMSDK/Assets/Textures/SkyBox/skyBox_mz.jpg b/public/CIMSDK/Assets/Textures/SkyBox/skyBox_mz.jpg index c5deef3..164dc5b 100644 --- a/public/CIMSDK/Assets/Textures/SkyBox/skyBox_mz.jpg +++ b/public/CIMSDK/Assets/Textures/SkyBox/skyBox_mz.jpg Binary files differ diff --git a/public/CIMSDK/Assets/Textures/SkyBox/skyBox_px.jpg b/public/CIMSDK/Assets/Textures/SkyBox/skyBox_px.jpg index e445163..306b8fd 100644 --- a/public/CIMSDK/Assets/Textures/SkyBox/skyBox_px.jpg +++ b/public/CIMSDK/Assets/Textures/SkyBox/skyBox_px.jpg Binary files differ diff --git a/src/assets/img/2D.png b/src/assets/img/2D.png new file mode 100644 index 0000000..6c33ac6 --- /dev/null +++ b/src/assets/img/2D.png Binary files differ diff --git a/src/assets/img/3D.png b/src/assets/img/3D.png new file mode 100644 index 0000000..f8c347d --- /dev/null +++ b/src/assets/img/3D.png Binary files differ diff --git "a/src/assets/img/leftBtn/\345\275\242\347\212\266 6 \346\213\267\350\264\235 2.png" "b/src/assets/img/leftBtn/\345\275\242\347\212\266 6 \346\213\267\350\264\235 2.png" new file mode 100644 index 0000000..beb82a7 --- /dev/null +++ "b/src/assets/img/leftBtn/\345\275\242\347\212\266 6 \346\213\267\350\264\235 2.png" Binary files differ diff --git "a/src/assets/img/leftBtn/\347\237\251\345\275\242 8 \346\213\267\350\264\235 3.png" "b/src/assets/img/leftBtn/\347\237\251\345\275\242 8 \346\213\267\350\264\235 3.png" new file mode 100644 index 0000000..ee1f202 --- /dev/null +++ "b/src/assets/img/leftBtn/\347\237\251\345\275\242 8 \346\213\267\350\264\235 3.png" Binary files differ diff --git "a/src/assets/img/leftBtn/\347\256\255\345\244\264-\345\267\246 \346\213\267\350\264\235 4.png" "b/src/assets/img/leftBtn/\347\256\255\345\244\264-\345\267\246 \346\213\267\350\264\235 4.png" new file mode 100644 index 0000000..1c795fb --- /dev/null +++ "b/src/assets/img/leftBtn/\347\256\255\345\244\264-\345\267\246 \346\213\267\350\264\235 4.png" Binary files differ diff --git "a/src/assets/img/leftBtn/\347\256\255\345\244\264-\345\267\246 \346\213\267\350\264\235.png" "b/src/assets/img/leftBtn/\347\256\255\345\244\264-\345\267\246 \346\213\267\350\264\235.png" new file mode 100644 index 0000000..2462f8c --- /dev/null +++ "b/src/assets/img/leftBtn/\347\256\255\345\244\264-\345\267\246 \346\213\267\350\264\235.png" Binary files differ diff --git a/src/assets/js/Map/config.js b/src/assets/js/Map/config.js index 8cfac00..30957fd 100644 --- a/src/assets/js/Map/config.js +++ b/src/assets/js/Map/config.js @@ -1,8 +1,15 @@ //閰嶇疆鏂囦欢鍦板潃 const config = { - imgUrl: "Workers/image/earth.jpg",//妞悆浣撳垵濮嬪寲鍔犺浇鍥剧墖 - licenseServer: "http://183.162.245.49:18080",//license璁稿彲 - moonTms: "http://192.168.20.39:9055/gisserver/tmsserver/moondom",// 鏈堢悆鍒囩墖鏈嶅姟 + //妞悆浣撳垵濮嬪寲鍔犺浇鍥剧墖 + imgUrl: "Workers/image/earth.jpg", + //license璁稿彲 + licenseServer: "http://183.162.245.49:18080", + //tmsserver + moonTms: "http://192.168.20.39:9055/gisserver/tmsserver/moondom", + //Wmtsserver + moonWmts: 'http://172.16.2.10:50001/sj_raster/v6/wmts/service/system/10000101/5?ak=mf72ff9295c740ec0f37e61433e8a3ad8d&srs=ESRI:104903', + //鍦板舰 + moonTerrain: 'http://172.16.2.10:50001/sj_raster/v6/terrain_mesh/10002301/21', } export default config; \ No newline at end of file diff --git a/src/assets/js/Map/index.js b/src/assets/js/Map/index.js index 9943b91..0e4e025 100644 --- a/src/assets/js/Map/index.js +++ b/src/assets/js/Map/index.js @@ -23,10 +23,38 @@ this.Viewer = this.earthCtrl._Viewer; window.earthCtrl = this.earthCtrl; window.Viewer = this.earthCtrl._Viewer; - // //鏄剧ずfps - // sgworld._Viewer.scene.debugShowFramesPerSecond = false; - //娣诲姞鏈堢悆鍒濆鍖栧垏鐗囨湇鍔� + + Viewer.imageryLayers.removeAll(); + + Viewer.scene.globe.showGroundAtmosphere = false; + + // var terrain = new SmartEarth.Cesium.CesiumTerrainProvider({ + // url: config.moonTerrain, + // tilingScheme: new SmartEarth.Cesium.GeographicTilingScheme({ + // ellipsoid: SmartEarth.Cesium.Ellipsoid.MOON, + // }), + // }); + // Viewer.terrainProvider = terrain; + // Viewer.scene.globe.terrainExaggeration = 5; + // server.AddWmtesLayer(config.moonWmts); + // var param = { + // name: labelName, + // id: earthCtrl.factory.createUUID(), + // text: "鏂囧瓧宸ュ叿", + // font: '50pt monospace', + // outlineWidth: 2, + // fillColor: SmartEarth.Cesium.Color.RED, + // lon: 47.5087, + // lat: 23.6963, + // alt: 10 + // }; + // labelEntity = earthCtrl.factory.createLabel(param); server.AddTmsLayer(config.moonTms); + + // server.AddTmsLayer('http://localhost:8080/abc'); + + // earthCtrl.camera.flyTo(47.5087, 23.6963, 300, 9.5, -45, 0.0, 5); + // //娣诲姞榧犳爣宸﹀嚮浜嬩欢 // this.addMouseLeftClickEvents(); // this.addMouseMouseMoveEvents(); diff --git a/src/assets/js/Map/menuTool.js b/src/assets/js/Map/menuTool.js index e7ae2df..642b8f4 100644 --- a/src/assets/js/Map/menuTool.js +++ b/src/assets/js/Map/menuTool.js @@ -3,8 +3,12 @@ toolFlag: null, colorAll: { }, - menuTools(res) { - this.clearTools(); + topTools(res) { + this.clearTopTools(); + if (res.id == this.toolFlag) { + this.toolFlag = null; + return + } this.toolFlag = res.id; switch (res.id) { case 'a2'://鐐规极娓� @@ -25,23 +29,73 @@ case 'b5'://鍨傜洿楂樺害 this.verticalHeight(); break; + case 'd4'://鍦熸柟閲忚绠� + this.Volumetric(); + break; + case 'd5'://褰卞儚瀵规瘮 + this.CurtainContrast(); + break; + case 'g1'://鍧愭爣瀹氫綅 + this.Coordposition(); + break; } + }, + leftTools(res) { + this.clearLeftTools() + switch (res.id) { + case 'l1': + break; + case 'l2': + break; + case 'l3'://鍦ㄧ嚎鍒跺浘 + this.setThematicMap(); + break; + case 'l4': + break; + case 'l5': + break; + case 'l6': + break; + } + }, + + //鍦ㄧ嚎鍒跺浘 + setThematicMap() { + // earthCtrl.coreMap.scene.mode = SmartEarth.Cesium.SceneMode.SCENE2D; + // var handle = new SmartEarth.Cesium.ScreenSpaceEventHandler(earthCtrl.viewer.scene.canvas); + + }, + + //鍧愭爣瀹氫綅 + Coordposition() { + + }, + //褰卞儚瀵规瘮 + CurtainContrast() { + this.toolMenu = earthCtrl.analysis.createCurtainContrast({ leftIndex: 0, rightIndex: 1 }) + }, + //鍦熸柟閲忚绠� + Volumetric() { + const Volumetric = earthCtrl.analysis.createVolumetricMeasure({}); + Volumetric.startDrawing(); }, //鍨傜洿楂樺害 verticalHeight() { - + earthCtrl.measure.measureHeight(function (e) { + }) }, //楂樼▼娴嬮噺 heightMeasure() { - }, //骞抽潰闈㈢Н planeDistance() { - + earthCtrl.analysis.getPlaneArea(function (e) { + }) }, //琛ㄩ潰璺濈 surfaceDistance() { - + earthCtrl.measure.lineLength(function (e) { + }) }, //鐐规极娓� pointRoam() { @@ -54,7 +108,7 @@ }, //娓呴櫎鏂规硶 - clearTools() { + clearTopTools() { if (this.toolFlag) { switch (this.toolFlag) { case 'a2': @@ -69,12 +123,18 @@ case 'b5': break; + case 'd5': + debugger + this.toolMenu.removeFromMap() + break; } - this.toolFlag = null; + // this.toolFlag = null; this.toolMenu = null; } }, + clearLeftTools() { + }, } export default menuTool; \ No newline at end of file diff --git a/src/assets/js/Map/server.js b/src/assets/js/Map/server.js index 64aba2c..fce49f4 100644 --- a/src/assets/js/Map/server.js +++ b/src/assets/js/Map/server.js @@ -12,5 +12,21 @@ }); window.Viewer.imageryLayers.addImageryProvider(urlTemplateImageryProvider); }, + AddWmtesLayer(url) { + var urlTemplateImageryProvider = earthCtrl.factory.createImageryLayer({ + sourceType: "wmts", + url: url, + layer: "", + format: "image/jpeg", + tileMatrixSetID: "GoogleCRS84Quad01", + minimumLevel: 0, + maximumLevel: 18, + style: "", + tilingScheme: new SmartEarth.Cesium.GeographicTilingScheme({ + ellipsoid: SmartEarth.Cesium.Ellipsoid.MOON, + }), + }) + }, + } export default server; \ No newline at end of file diff --git a/src/components/bottomBtn.vue b/src/components/bottomBtn.vue index 3b79854..e7173c5 100644 --- a/src/components/bottomBtn.vue +++ b/src/components/bottomBtn.vue @@ -1,6 +1,17 @@ <template> <div class="bottom_btn"> - + <div + v-show="mapFlag == '2D'" + class="ChangeMap twoImg" + @click="setMapImg('2D')" + > + </div> + <div + v-show="mapFlag != '2D'" + class="ChangeMap threeImg" + @click="setMapImg('3D')" + > + </div> </div> </template> @@ -13,31 +24,35 @@ defineProps, defineEmits, } from "vue"; -const lng = ref(null); -const lat = ref(null); -const alt = ref(null); -const setMouseEvents = (res) => {}; -onMounted(() => { - window.addMouseEvents = setMouseEvents; -}); +const mapFlag = ref("2D"); + +const setMapImg = (res) => { + if (res == "2D") { + mapFlag.value = "3D"; + earthCtrl.coreMap.scene.mode = SmartEarth.Cesium.SceneMode.SCENE2D; + } else if (res == "3D") { + mapFlag.value = "2D"; + earthCtrl.coreMap.scene.mode = SmartEarth.Cesium.SceneMode.SCENE3D; + } +}; +onMounted(() => {}); </script> <style lang="less" scoped> .bottom_btn { position: absolute; - bottom: 15px; - left: 75px; - display: flex; - .btn_box { - margin-right: 10px; - background-size: 100% 100%; - font-size: 16px; - cursor: pointer; - display: flex; - justify-content: center; - align-items: center; - span { - color: #fff; - } + bottom: 68px; + right: 70px; + + .ChangeMap { + width: 30px; + height: 30px; + border: 1px solid rgba(255, 255, 255, 0.1); + } + .twoImg { + background: url("../assets/img/2D.png") no-repeat; + } + .threeImg { + background: url("../assets/img/3D.png") no-repeat; } } </style> diff --git a/src/components/menus.vue b/src/components/menus.vue index fb946b4..253d2b3 100644 --- a/src/components/menus.vue +++ b/src/components/menus.vue @@ -46,6 +46,7 @@ defineEmits, } from "vue"; import menuData from "@/assets/js/Map/menuData"; +import menuTool from "@/assets/js/Map/menuTool"; const menuOptions = ref([]); const checkMenuFlag = ref(""); const setMenuClick = (res) => { @@ -53,6 +54,7 @@ checkMenuFlag.value = null; } else { checkMenuFlag.value = res.id; + menuTool.leftTools(res); } }; onMounted(() => { diff --git a/src/components/topBtn.vue b/src/components/topBtn.vue index f4dc141..e51214e 100644 --- a/src/components/topBtn.vue +++ b/src/components/topBtn.vue @@ -77,7 +77,7 @@ checkFlag.value = res.id; } menuFlag.value = null; - menuTool.menuTools(res); + menuTool.topTools(res); } }; onMounted(() => { diff --git a/src/main.ts b/src/main.ts index 8c72bb5..5e5ee19 100644 --- a/src/main.ts +++ b/src/main.ts @@ -5,6 +5,7 @@ import ElementPlus from "element-plus"; import "element-plus/dist/index.css"; import "default-passive-events"; +import * as ElementPlusIconsVue from "@element-plus/icons-vue"; //base css鏍峰紡 import "./assets/css/global.css"; //鑷�傚簲 @@ -12,7 +13,11 @@ //绮掑瓙鐗规晥 import VueParticles from "vue-particles"; import Drag from "./utils/drag"; -createApp(App) +const app = createApp(App); +for (const [key, component] of Object.entries(ElementPlusIconsVue)) { + app.component(key, component); +} +app .use(ElementPlus) .use(store) .use(router) diff --git a/src/views/Index.vue b/src/views/Index.vue index d466975..7bd0519 100644 --- a/src/views/Index.vue +++ b/src/views/Index.vue @@ -4,12 +4,11 @@ id="cesiumContainer" style="width: 100%; height: 100%; position: absolute;" ></div> + <menus></menus> <bottom-btn></bottom-btn> <top-btn></top-btn> - <layer-manage> - - </layer-manage> + <layer-manage> </layer-manage> </div> </template> diff --git a/src/views/layer/layerManage.vue b/src/views/layer/layerManage.vue index 8af9544..92b0bef 100644 --- a/src/views/layer/layerManage.vue +++ b/src/views/layer/layerManage.vue @@ -4,9 +4,49 @@ class="layerBox" > <div class="layerTitle"> - + <div class="tileLeft"> + <div class="titleImg"> + <ArrowLeft /> + </div> + <div class="titleLable"> + 鍥惧眰绠$悊 + </div> + </div> + <div class="titleImg"> + <Setting /> + </div> </div> - + <div> + <div + class="contentBox" + v-for="(item,i) in menuOption" + > + <div class="contentTile"> + <div class="contentLeft"> + <div class="contentImg"></div> + <div class="contentLabel">{{ item.name }}</div> + </div> + <div class="contentRight"> + <div class="contentCheck"><el-checkbox + @change="handlCheckAllChange(item)" + v-model="item.checkedAll" + >鍏ㄩ儴閫変腑</el-checkbox></div> + <div> + <div + @click="handlIsShow(item,1)" + v-show="item.isShow" + class="contentUP" + ></div> + <div + @click="handlIsShow(item,2)" + v-show="!item.isShow" + class="contentDown" + ></div> + </div> + </div> + </div> + </div> + </div> </div> </template> @@ -19,6 +59,20 @@ defineProps, defineEmits, } from "vue"; +const menuOption = [ + { + name: "娴嬭瘯", + isShow: true, + checkedAll: false, + }, + { + name: "娴嬭瘯1", + isShow: true, + checkedAll: true, + }, +]; +const handlCheckAllChange = (res) => {}; +const handlIsShow = (res, boolean) => {}; </script> <style lang="less" scoped> @@ -30,8 +84,82 @@ height: 680px; background: rgba(7, 8, 14, 0.8); .layerTitle { + width: calc(100% - 27px); + height: 42px; + background: #0e151f; + box-shadow: 0px 0px 6px 0px #080c13, + 0px 14px 16px 0px rgba(38, 47, 71, 0.68); + display: flex; + justify-content: space-between; + padding-left: 7px; + padding-right: 20px; + color: white; + .tileLeft { + height: 100%; + display: flex; + align-items: center; + + .titleLable { + font-size: 24px; + font-family: Source Han Sans CN; + font-weight: 400; + color: #ffffff; + } + } + .titleImg { + width: 20px; + height: 100%; + display: flex; + align-items: center; + } + } + .contentBox { + margin-top: 3px; + } + .contentTile { width: 100%; height: 42px; + background: #0d131d; + display: flex; + justify-content: space-between; + align-items: center; + + .contentLeft { + display: flex; + justify-content: center; + align-items: center; + .contentImg { + width: 22px; + height: 22px; + background: url("../../assets/img/leftBtn/鐭╁舰 8 鎷疯礉 3.png") no-repeat; + margin-left: 16px; + } + .contentLabel { + font-size: 20px; + font-family: Source Han Sans CN; + font-weight: 300; + color: #ffffff; + margin-left: 7px; + } + } + .contentRight { + margin-right: 32px; + display: flex; + align-items: center; + .contentCheck { + margin-right: 12px; + } + .contentUP { + width: 18px; + height: 11px; + background: url("../../assets/img/leftBtn/绠ご-宸� 鎷疯礉.png"); + } + .contentDown { + width: 18px; + height: 11px; + background: url("../../assets/img/leftBtn/绠ご-宸� 鎷疯礉 4.png"); + } + } } } </style> \ No newline at end of file -- Gitblit v1.9.3