From 8ca7f7c74de140b79ea7dd821ca0236b11ce7551 Mon Sep 17 00:00:00 2001 From: yxl <584911253@qq.com> Date: 星期五, 03 一月 2025 18:13:20 +0800 Subject: [PATCH] 修改提交 --- src/assets/js/mapSetFunc.js | 23 ++++++++++- vue.config.js | 11 ++++- src/assets/js/map/mapServer.js | 6 ++- public/config/config.js | 6 +- src/views/chartView/index.vue | 46 +++++++++++++++++++--- 5 files changed, 75 insertions(+), 17 deletions(-) diff --git a/public/config/config.js b/public/config/config.js index e1ea279..ddf5f8b 100644 --- a/public/config/config.js +++ b/public/config/config.js @@ -9,8 +9,8 @@ // apiUrl: "/api/", // apiUrl: "http://192.168.11.95:7777/api/", // wsHost: "ws://192.168.11.194/ws/asset", - // wsHost: "ws://103.135.160.14:7800/ws/asset", - wsHost: "ws://103.135.160.14:7777/ws/asset", + wsHost: "ws://103.135.160.14:7800/ws/asset", + // wsHost: "ws://103.135.160.14:7777/ws/asset", localUrl: "http://192.168.112.13:12315", // apiUrl: "http://192.168.11.125:7777", // apiUrl: "http://103.135.160.14:5381/",0 @@ -21,7 +21,7 @@ imgUrl: webHost + "/image/", reportMd: "/Data/Report.md", reportDocx: "/Data/Report.docx", - modelLayer:"FW21", + modelLayer:"鍐涗簨璁炬柦",//"FW21", modelBase: { url: "http://106.120.22.26:8013", account: "/account-service", diff --git a/src/assets/js/map/mapServer.js b/src/assets/js/map/mapServer.js index cfcac83..01e8a3e 100644 --- a/src/assets/js/map/mapServer.js +++ b/src/assets/js/map/mapServer.js @@ -104,15 +104,16 @@ } } }, - addTileSetLayer(res) { + async addTileSetLayer(res) { // const tileset = earthCtrl.factory.create3DTilesets({ // url: res.url // }); - var tileset = Viewer.scene.primitives.add( + var tileset = await Viewer.scene.primitives.add( new Cesium.Cesium3DTileset({ url: res.url }) ); + // console.log(" res.name", res); tileset.name = res.name; // const tileset = new Cesium.Cesium3DTileset({ // url: res.url @@ -124,6 +125,7 @@ layerId: res.id, name: res.name }); + console.log(" this.listData", this.listData); // console.log('tileset',tileset); // earthCtrl.userScene.flyTo(tileset); }, diff --git a/src/assets/js/mapSetFunc.js b/src/assets/js/mapSetFunc.js index 34152f7..f3d9807 100644 --- a/src/assets/js/mapSetFunc.js +++ b/src/assets/js/mapSetFunc.js @@ -37,16 +37,19 @@ this.setModelChangeColor(colors); }, setModelChangeColor(res) { - const modelLayer = mapServer.listData.filter((res) => { - if (res.name == config.modelLayer) { - return res; + console.log('mapServer.listData',mapServer.listData,config.modelLayer); + const modelLayer = mapServer.listData.filter((obj) => { + if (obj.name == config.modelLayer) { + return obj; } }); if (modelLayer.length <= 0) return; + earthCtrl.userScene.flyTo(modelLayer[0].layer); modelLayer[0].layer.style = new Cesium.Cesium3DTileStyle({ color: { evaluateColor: (feature) => { const id = feature.getProperty("id"); + console.log("id**********", id); const color = res.filter((item) => { if (item.ids.indexOf(id) > -1) { return item; @@ -225,6 +228,20 @@ return name; }, creatAroundPoi(res) { + let colors = []; + res.data.forEach((element) => { + colors.push({ + name: element.type, + color: element.color, + ids: element.list + }); + }) + console.log('colors----',colors); + store.state.setListColor = colors; + store.state.showLenged = true; + this.setModelChangeColor(colors); + }, + creatAroundPoi1111(res) { const poi = res.data; var std = []; var feature = { diff --git a/src/views/chartView/index.vue b/src/views/chartView/index.vue index d6299d3..0c46f68 100644 --- a/src/views/chartView/index.vue +++ b/src/views/chartView/index.vue @@ -259,7 +259,6 @@ }, setMapfunc(res, obj) { this.$store.state.showLenged = false; - switch (res.func) { case "queryRelationship": var roleMsg = null; @@ -318,16 +317,49 @@ this.refashMsg(roleMsg.list); break; case "aroundPoi": - mapSetFunc.init(res); - this.setUpdateHistoryInFor(obj, res.msg); - var roleMsg = msgData.getAffairsData([ - { type: "text", val: res.msg }, - ]); + let dataList = [ + { + type: "鍙墦鍑荤洰鏍�", + color:'#FF3366', + list: [], + }, + { + type: "涓嶅彲鎵撳嚮鐩爣", + color:'#33FF66', + list: [], + }, + { + type: "鍏朵粬", + color:'#3366FF', + list: [], + }, + ]; + res.data.forEach((item) => { + if (item.ifstrike === "1") { + dataList[0].list.push(item.seid); + } else if (item.ifstrike === "2") { + dataList[1].list.push(item.seid); + } else { + dataList[2].list.push(item.seid); + } + }); + const resultData = dataList + .map((item) => `| ${item.type} | ${item.list.length} |`) + .join("\n"); + var a = `| 鏁版嵁绫诲瀷 | 鏁版嵁閲� |\n|------|------|\n`+resultData; + console.log("aaa", a); + this.setUpdateHistoryInFor(obj, a); + var roleMsg = msgData.getMdData("markdown", a); this.refashMsg(roleMsg.list); + const finalData = { + func: "aroundPoi", + data: dataList, + } + mapSetFunc.init(finalData); break; case "getParam": mapSetFunc.init(res); - console.log('res.data.targetinfo',res); + console.log("res.data.targetinfo", res); this.setUpdateHistoryInFor(obj, res.msg); var roleMsg = msgData.getAffairsData([ { type: "text", val: res.data[0].targetinfo }, diff --git a/vue.config.js b/vue.config.js index 6bf2bde..2e16b8c 100644 --- a/vue.config.js +++ b/vue.config.js @@ -10,13 +10,20 @@ open: true, proxy: { "/dev-api": { - // target: 'http://103.135.160.14:7800', - target: 'http://103.135.160.14:7777', + target: 'http://103.135.160.14:7800', + // target: 'http://103.135.160.14:7777', changeOrigin: true, pathRewrite: { '^/dev-api': '' } }, + "/data-api": { + target: 'https://cim.smartearth.cn', + changeOrigin: true, + pathRewrite: { + '^/data-api': '' + } + }, }, }, -- Gitblit v1.9.3