From bec1a5e6532575b221b24094471fce8c814fc7ae Mon Sep 17 00:00:00 2001 From: jihongshun <1151753686@qq.com> Date: 星期三, 09 七月 2025 17:26:59 +0800 Subject: [PATCH] 优化算法 --- src/js/map3d.js | 1 src/views/system/project/components/chooseDeviceDialog.vue | 2 src/views/system/shootPoint/components/shootPointDialog.vue | 3 src/views/system/project/components/chooseModelDialog.vue | 110 ++++----- src/utils/components/init-map.vue | 1 src/views/system/project/components/addPorjectDialog.vue | 518 ++++++++++++++++++++++++++++++++++++++++++++++- src/views/model/index.vue | 1 src/views/system/model/components/modelDialog.vue | 1 src/views/system/device/components/deviceDialog.vue | 2 src/views/system/shootPoint/components/chooseModelDialog.vue | 3 10 files changed, 563 insertions(+), 79 deletions(-) diff --git a/src/js/map3d.js b/src/js/map3d.js index c2b2ee7..629215f 100644 --- a/src/js/map3d.js +++ b/src/js/map3d.js @@ -46,7 +46,6 @@ orientation: orientations, model: { uri: url, - scale: 20, shadows: Cesium.ShadowMode.DISABLED, imageBasedLightingFactor: new Cesium.Cartesian2(1, 0.5) } diff --git a/src/utils/components/init-map.vue b/src/utils/components/init-map.vue index d61ae67..bbc8421 100644 --- a/src/utils/components/init-map.vue +++ b/src/utils/components/init-map.vue @@ -190,7 +190,6 @@ orientation: orientations, model: { uri: url, - scale: 20, shadows: Cesium.ShadowMode.DISABLED, imageBasedLightingFactor: new Cesium.Cartesian2(1, 0.5) } diff --git a/src/views/model/index.vue b/src/views/model/index.vue index 2789560..21facff 100644 --- a/src/views/model/index.vue +++ b/src/views/model/index.vue @@ -147,7 +147,6 @@ position: Cesium.Cartesian3.fromDegrees(124.99140002766548, 46.5903479189505, 0), model: { uri: "/Model/tower.glb", - scale: 1000, minimumPixelSize: 50, }, }); diff --git a/src/views/system/device/components/deviceDialog.vue b/src/views/system/device/components/deviceDialog.vue index f08cfae..fdf3e42 100644 --- a/src/views/system/device/components/deviceDialog.vue +++ b/src/views/system/device/components/deviceDialog.vue @@ -105,7 +105,6 @@ orientation: orientation, model: { uri:this.modelUrl, // 鏇挎崲鎴愪綘鐨勬ā鍨嬭矾寰� - scale: 1000, }, }); viewer.flyTo(entity) @@ -205,7 +204,6 @@ orientation: orientation, model: { uri: this.modelUrl, // 鏇挎崲鎴愪綘鐨勬ā鍨嬭矾寰� - scale: 1000, }, }); viewer.flyTo(entity) diff --git a/src/views/system/model/components/modelDialog.vue b/src/views/system/model/components/modelDialog.vue index fda976d..e9fefad 100644 --- a/src/views/system/model/components/modelDialog.vue +++ b/src/views/system/model/components/modelDialog.vue @@ -164,7 +164,6 @@ orientation: orientation, model: { uri: "/Model/tower.glb", // 鏇挎崲鎴愪綘鐨勬ā鍨嬭矾寰� - scale: 1000, }, }); console.log(entity) diff --git a/src/views/system/project/components/addPorjectDialog.vue b/src/views/system/project/components/addPorjectDialog.vue index cf5606f..c336406 100644 --- a/src/views/system/project/components/addPorjectDialog.vue +++ b/src/views/system/project/components/addPorjectDialog.vue @@ -13,6 +13,7 @@ <!-- <el-button type="primary" @click='chooseModel'>娣诲姞璁惧</el-button> --> <div class="fontJust">璁惧鍒楄〃</div> <el-button @click="addDevice"> 鏂板</el-button> + <el-button @click="draw"> 娓叉煋</el-button> <el-table :data="tableData" max-height = '180' @@ -23,15 +24,16 @@ width="150"> </el-table-column> <el-table-column - prop="muban" + prop="mode" label="妯℃澘" - width="150"> + width="120"> </el-table-column> <el-table-column fixed="right" label="鎿嶄綔" - width="100"> + width="130"> <template slot-scope="scope"> + <el-button type="text" size="small" @click="chooseModel(scope.row)">妯℃澘</el-button> <el-button type="text" size="small" @click="flyToLocal(scope.row)">瀹氫綅</el-button> <el-button type="text" size="small" @click="deleteData(scope.row)">绉婚櫎</el-button> </template> @@ -63,28 +65,379 @@ <el-button type="primary" @click="submit()" >鐢熸垚鑸嚎浠诲姟</el-button> </span> </el-dialog> - <chooseDeviceDialog v-if="showModel" @cancel ='cancel' @dealChooseArr="dealChooseArr" ></chooseDeviceDialog> + <chooseDeviceDialog v-if="showDevice" @cancel ='cancel' @dealChooseArr="dealChooseArr" ></chooseDeviceDialog> + <chooseModelDialog v-if="showModel" @cancelModel ='cancelModel' @receiveModel="receiveModel" :deviceId="deviceId"></chooseModelDialog> </div> </template> <script> import CesiumMap from "../../../../utils/components/cesium-map.vue"; import chooseDeviceDialog from './chooseDeviceDialog.vue'; +import chooseModelDialog from './chooseModelDialog.vue'; export default{ components: { CesiumMap, - chooseDeviceDialog + chooseDeviceDialog, + chooseModelDialog }, data(){ return{ dialogVisible :true, tableData: [], - treeData:[], + treeData:[ + { + "createBy": null, + "createTime": null, + "updateBy": null, + "updateTime": null, + "remark": null, + "id": "3c5fc76c46c54c1187ff0bbcc092194b", + "modelId": "6257cf734cf94c7caae0dee2ac2231d1", + "deviceName": "璁惧3", + "deviceType": null, + "longitude": 125.01255362568844, + "latitude": 46.40803605631184, + "altitude": -0.029793403136164368, + "belongingRoute": "绾胯矾3", + "face": 30, + "label": "璁惧3", + "children": [ + { + "id": "197ee63df18b0af0", + "label": "鍦伴潰鐐�0", + "longitude": 125.01254682821249, + "latitude": 46.40803726847258, + "height": 5.55594577349203, + "children": [ + { + "id": "197ee63df18539a3", + "label": "绌轰腑鐐�1", + "longitude": 125.01128753149214, + "latitude": 46.4082612208105, + "height": 6.492838981926156 + } + ] + }, + { + "id": "197ee63df18cce29", + "label": "鍦伴潰鐐�1", + "longitude": 125.01254709729052, + "latitude": 46.408037217374755, + "height": 6.4920524070572645, + "children": [ + { + "id": "197ee63df18539a3", + "label": "绌轰腑鐐�1", + "longitude": 125.01128753149214, + "latitude": 46.4082612208105, + "height": 6.492838981926156 + } + ] + }, + { + "id": "197ee63df188aa47", + "label": "鍦伴潰鐐�2", + "longitude": 125.01254783039168, + "latitude": 46.408036932133236, + "height": 7.424864167610554, + "children": [ + { + "id": "197ee63df1845bc7", + "label": "绌轰腑鐐�2", + "longitude": 125.0112772702233, + "latitude": 46.40822893934041, + "height": 7.425650325131619 + } + ] + }, + { + "id": "197ee63df199a530", + "label": "鍦伴潰鐐�3", + "longitude": 125.01255933758492, + "latitude": 46.40803691722688, + "height": 7.424719094681872, + "children": [ + { + "id": "197ee63df1908bad", + "label": "绌轰腑鐐�3", + "longitude": 125.0138300519516, + "latitude": 46.40822843553173, + "height": 7.425505375628057 + } + ] + }, + { + "id": "197ee63df198ebdf", + "label": "鍦伴潰鐐�4", + "longitude": 125.01256021566009, + "latitude": 46.408036958116895, + "height": 6.454013013927198, + "children": [ + { + "id": "197ee63df192e649", + "label": "绌轰腑鐐�4", + "longitude": 125.0138360193498, + "latitude": 46.40821153783117, + "height": 6.454799694246353 + } + ] + }, + { + "id": "197ee63df1989863", + "label": "鍦伴潰鐐�5", + "longitude": 125.01256037655455, + "latitude": 46.40803705402738, + "height": 5.5173191358810305, + "children": [ + { + "id": "197ee63df19fb1cb", + "label": "绌轰腑鐐�5", + "longitude": 125.01384789553899, + "latitude": 46.408163891976834, + "height": 6.023658449094137 + } + ] + } + ] + }, + { + "createBy": null, + "createTime": null, + "updateBy": null, + "updateTime": null, + "remark": null, + "id": "5d7c595466094e369c6ed9fdcab6ba50", + "modelId": "416a0c3361a9409495623eff5c19fb41", + "deviceName": "璁惧2", + "deviceType": null, + "longitude": 124.98495711631958, + "latitude": 46.60913669289758, + "altitude": -0.010649270561847658, + "belongingRoute": "绾胯矾2", + "face": 30, + "label": "璁惧2", + "children": [ + { + "id": "197ee6746f64a423", + "label": "鍦伴潰鐐�0", + "longitude": 124.98496378621228, + "latitude": 46.60913556199556, + "height": 5.517188951102072, + "children": [ + { + "id": "197ee6746f74e23a", + "label": "绌轰腑鐐�0", + "longitude": 124.98623131325654, + "latitude": 46.60892064074182, + "height": 5.517975962983238 + } + ] + }, + { + "id": "197ee6746f7d5cbb", + "label": "鍦伴潰鐐�1", + "longitude": 124.98496380688303, + "latitude": 46.609135777787124, + "height": 6.454174518781066, + "children": [ + { + "id": "197ee6746f76d1f7", + "label": "绌轰腑鐐�1", + "longitude": 124.98624416031694, + "latitude": 46.60896064802085, + "height": 6.454961413485681 + } + ] + }, + { + "id": "197ee6746f7f75d3", + "label": "鍦伴潰鐐�2", + "longitude": 124.9849627026509, + "latitude": 46.6091358190698, + "height": 7.4247849395402445, + "children": [ + { + "id": "197ee6746f7bd9af", + "label": "绌轰腑鐐�2", + "longitude": 124.98623564998626, + "latitude": 46.608936693647046, + "height": 7.425571052201786 + } + ] + }, + { + "id": "197ee6746f786c30", + "label": "鍦伴潰鐐�3", + "longitude": 124.98495139129277, + "latitude": 46.609136202860036, + "height": 7.385436810668997, + "children": [ + { + "id": "197ee6746f7220cc", + "label": "绌轰腑鐐�3", + "longitude": 124.98365601680429, + "latitude": 46.60902531680706, + "height": 7.386222783506121 + } + ] + }, + { + "id": "197ee6746f70eac7", + "label": "鍦伴潰鐐�4", + "longitude": 124.98495046384257, + "latitude": 46.6091358802505, + "height": 6.453950090508963, + "children": [ + { + "id": "197ee6746f74dd82", + "label": "绌轰腑鐐�4", + "longitude": 124.98366517250753, + "latitude": 46.60897886511559, + "height": 6.4547368247826675 + } + ] + }, + { + "id": "197ee6746f7ac599", + "label": "鍦伴潰鐐�5", + "longitude": 124.984950334958, + "latitude": 46.609135834916806, + "height": 5.516518597126235, + "children": [ + { + "id": "197ee6746f7220cc", + "label": "绌轰腑鐐�3", + "longitude": 124.98365601680429, + "latitude": 46.60902531680706, + "height": 7.386222783506121 + } + ] + } +] + }, + { + "createBy": null, + "createTime": null, + "updateBy": null, + "updateTime": null, + "remark": null, + "id": "f796896ac1c445c183456c500502bef0", + "modelId": "1bd29eedeaaf4a3da83212fbb1793fd5", + "deviceName": "璁惧1", + "deviceType": null, + "longitude": 125.14336018333184, + "latitude": 46.558980802047344, + "altitude": -0.0019061848373990704, + "belongingRoute": "绾胯矾1", + "face": 60, + "label": "璁惧1", + "children": [ + { + "id": "197ee65dac710766", + "label": "鍦伴潰鐐�0", + "longitude": 125.14335344347126, + "latitude": 46.55898205916312, + "height": 5.556756800574575, + "children": [ + { + "id": "197ee65dac75edbb", + "label": "绌轰腑鐐�0", + "longitude": 125.14209452120562, + "latitude": 46.55921686479333, + "height": 5.557543680589247 + } + ] + }, + { + "id": "197ee65dac76a522", + "label": "鍦伴潰鐐�1", + "longitude": 125.14335363213557, + "latitude": 46.55898182607255, + "height": 6.651683951645225, + "children": [ + { + "id": "197ee65dac772525", + "label": "绌轰腑鐐�2", + "longitude": 125.14208232214659, + "latitude": 46.559179705774746, + "height": 7.425743074154034 + } + ] + }, + { + "id": "197ee65dac712c69", + "label": "鍦伴潰鐐�2", + "longitude": 125.14335446603941, + "latitude": 46.55898169199969, + "height": 7.424957062075383, + "children": [ + { + "id": "197ee65dac772525", + "label": "绌轰腑鐐�2", + "longitude": 125.14208232214659, + "latitude": 46.559179705774746, + "height": 7.425743074154034 + } + ] + }, + { + "id": "197ee65dac7d469a", + "label": "鍦伴潰鐐�3", + "longitude": 125.14336581328187, + "latitude": 46.55898112552418, + "height": 7.385369522508276, + "children": [ + { + "id": "197ee65dac74b335", + "label": "绌轰腑鐐�3", + "longitude": 125.14460210993491, + "latitude": 46.55869709406983, + "height": 11.416007026601994 + } + ] + }, + { + "id": "197ee65dac7817ff", + "label": "鍦伴潰鐐�4", + "longitude": 125.14336674537108, + "latitude": 46.55898211835868, + "height": 6.48472072335647, + "children": [ + { + "id": "197ee65dac7602d7", + "label": "绌轰腑鐐�4", + "longitude": 125.14461900411601, + "latitude": 46.559233306964344, + "height": 6.485507501890941 + } + ] + }, + { + "id": "197ee65dac74500d", + "label": "鍦伴潰鐐�5", + "longitude": 125.14336684823117, + "latitude": 46.55898218335435, + "height": 5.556803725040882, + "children": [ + { + "id": "197ee65dac7d10f5", + "label": "绌轰腑鐐�5", + "longitude": 125.14464805019499, + "latitude": 46.559149450894154, + "height": 7.227587215704448 + } + ] + } +] + } +], defaultProps: { children: 'children', label: 'label' }, + showDevice:false, + multipleSelection: [], showModel:false, - multipleSelection: [] + deviceId:null } }, methods:{ @@ -114,18 +467,34 @@ orientation: orientation, model: { uri: "http://192.168.1.5:9000/tower/2025/07/01/tower_20250701145739A004.glb", // 鏇挎崲鎴愪綘鐨勬ā鍨嬭矾寰� - scale: 1000, + scale: 1, }, + label: { + show: true, + verticalOrigin: Cesium.VerticalOrigin.BOTTOM, + horizontalOrigin: Cesium.HorizontalOrigin.CENTER, + font: '28px Helvetica', + outlineColor: Cesium.Color.BLUE, + outlineWidth: 3, + fillColor: Cesium.Color.fromCssColorString('#FFFFFF'), //44c3cc + text: row.deviceName, + style: Cesium.LabelStyle.FILL_AND_OUTLINE, + pixelOffset: new Cesium.Cartesian2(0.0, -56.0), + scaleByDistance: new Cesium.NearFarScalar(1000, 0.6, 10000, 0.4), + pixelOffsetScaleByDistance: new Cesium.NearFarScalar(1000, 0.4, 10000, 0.4), + disableDepthTestDistance: 100000000 + } }); console.log(entity) // 椋炶鍒版ā鍨嬩綅缃� + console.log(this.treeData) viewer.flyTo(entity) }, addDevice(){ - this.showModel = true + this.showDevice = true }, cancel(){ - this.showModel = false + this.showDevice = false }, hasSameId(array1, array2) { const ids1 = new Set(array1.map(item => item.id)); @@ -148,7 +517,7 @@ this.tableData = this.tableData.concat(arr) } const dealTreeData =this.dealTee() - this.treeData = dealTreeData + // this.treeData = dealTreeData console.log(this.treeData) }, dealTee(){ @@ -167,7 +536,132 @@ this.tableData.splice(index, 1); } const dealTreeData = this.dealTee() - this.treeData = dealTreeData + // this.treeData = dealTreeData + }, + chooseModel(row){ + this.deviceId = row.id + this.showModel = true + }, + cancelModel(){ + this.showModel = false + }, + receiveModel(obj){ + //deal閫昏緫 + console.log(obj) + this.dealTableTemplate(obj) + // this.dealTreeMerge(obj) + }, + dealTableTemplate(obj){ + const target = this.tableData.find(item => item.id === obj.deviceId) + if (target) { + this.$set(target, 'mode', obj.modelObj.name) // 鉁� Vue2 闇�瑕佷娇鐢� $set 浠ョ‘淇濆搷搴斿紡 + } + }, + dealTreeMerge(obj){ + let newChildrenData= [ + { id: 100, label: '鏂板瓙鑺傜偣A',children:[{id: 1001,label: '鏂板瓙鑺傜偣A-1'}]}, + { id: 101, label: '鏂板瓙鑺傜偣B' } + ] + this.treeData.forEach(item => { + if(item.id == obj.deviceId) { + // 鏇挎崲绗竴灞傛瘡涓妭鐐圭殑 children + this.$set(item, 'children', JSON.parse(JSON.stringify(newChildrenData))); + } + }); + }, + drawConnectionsWithLabels(devices) { + const airPoints = []; + + devices.forEach(device => { + if (!Array.isArray(device.children)) return; + + device.children.forEach(groundPoint => { + console.log(groundPoint) + const groundPos = Cesium.Cartesian3.fromDegrees( + groundPoint.longitude, + groundPoint.latitude, + groundPoint.height + ); + + // 鉁� 鍦伴潰鐐癸細娣诲姞瀹炰綋 + label + viewer.entities.add({ + position: groundPos, + point: { + pixelSize: 6, + color: Cesium.Color.BLUE + }, + label: { + text: groundPoint.label || '', + font: '14px sans-serif', + fillColor: Cesium.Color.WHITE, + style: Cesium.LabelStyle.FILL_AND_OUTLINE, + outlineWidth: 2, + outlineColor: Cesium.Color.BLACK, + verticalOrigin: Cesium.VerticalOrigin.BOTTOM, + pixelOffset: new Cesium.Cartesian2(0, -12) + } + }); + + // 閬嶅巻绌轰腑鐐� + if (Array.isArray(groundPoint.children)) { + groundPoint.children.forEach(airPoint => { + console.log(airPos) + const airPos = Cesium.Cartesian3.fromDegrees( + airPoint.longitude, + airPoint.latitude, + airPoint.height + ); + + // 鉁� 绌轰腑鐐癸細娣诲姞瀹炰綋 + label + viewer.entities.add({ + position: airPos, + point: { + pixelSize: 6, + color: Cesium.Color.YELLOW + }, + label: { + text: airPoint.label || '', + font: '14px sans-serif', + fillColor: Cesium.Color.YELLOW, + style: Cesium.LabelStyle.FILL_AND_OUTLINE, + outlineWidth: 2, + outlineColor: Cesium.Color.BLACK, + verticalOrigin: Cesium.VerticalOrigin.BOTTOM, + pixelOffset: new Cesium.Cartesian2(0, -12) + } + }); + + // 鉁� 鍦伴潰鐐� 鉃� 绌轰腑鐐� 钃濊壊铏氱嚎 + viewer.entities.add({ + polyline: { + positions: [groundPos, airPos], + width: 2, + material: new Cesium.PolylineDashMaterialProperty({ + color: Cesium.Color.BLUE, + dashLength: 8 + }) + } + }); + + airPoints.push(airPos); + }); + } + }); + }); + + // 鉁� 鎵�鏈夌┖涓偣 鉃� 榛勮壊瀹炵嚎杩炴帴 + if (airPoints.length > 1) { + viewer.entities.add({ + polyline: { + positions: airPoints, + width: 3, + material: Cesium.Color.YELLOW + } + }); + } + }, + draw(){ + this.drawConnectionsWithLabels(this.treeData) } } } diff --git a/src/views/system/project/components/chooseDeviceDialog.vue b/src/views/system/project/components/chooseDeviceDialog.vue index 0bb2deb..0eb9f2e 100644 --- a/src/views/system/project/components/chooseDeviceDialog.vue +++ b/src/views/system/project/components/chooseDeviceDialog.vue @@ -51,6 +51,7 @@ submit(){ // this.selectArr this.$emit('dealChooseArr',this.selectArr) + this.$emit('cancel') }, clickRow(row){ console.log(row) @@ -76,7 +77,6 @@ orientation: orientation, model: { uri: row.modelRoute, // 鏇挎崲鎴愪綘鐨勬ā鍨嬭矾寰� - scale: 1000, }, }); viewer.flyTo(entity) diff --git a/src/views/system/project/components/chooseModelDialog.vue b/src/views/system/project/components/chooseModelDialog.vue index a56d779..a601599 100644 --- a/src/views/system/project/components/chooseModelDialog.vue +++ b/src/views/system/project/components/chooseModelDialog.vue @@ -3,18 +3,22 @@ title="閫夋嫨妯℃澘" :visible.sync="dialogVisible" @close="cancel" - width="50%"> - <el-form ref="form" :model="form" label-width="80px"> - <el-form-item label="娲诲姩鍖哄煙"> - <el-select v-model="form.region" placeholder="璇烽�夋嫨娲诲姩鍖哄煙"> - <el-option label="鍖哄煙涓�" value="shanghai"></el-option> - <el-option label="鍖哄煙浜�" value="beijing"></el-option> + width="20%"> + <el-form ref="form" :model="form" label-width="80px" :rules="rules"> + <el-form-item label="妯℃澘"> + <el-select v-model="form.modelObj" placeholder="璇烽�夋嫨妯℃澘"> + <el-option + v-for="item in templateArr" + :key="item.id" + :label="item.name" + :value="item"> + </el-option> </el-select> </el-form-item> - <span slot="footer" class="dialog-footer"> - <el-button @click="cancel">鍙� 娑�</el-button> + <el-form-item> <el-button type="primary" @click="submit">纭� 瀹�</el-button> - </span> + <el-button @click="cancel">鍙� 娑�</el-button> + </el-form-item> </el-form> </el-dialog> </template> @@ -23,10 +27,15 @@ name:'chooseModelDialog', components: { }, + props: { + deviceId: { + type: String, + defaule: null + } + }, data() { return { dialogVisible: true, - showMap:false, tableColumns: [ { label: '璁惧鍚嶇О', @@ -37,59 +46,46 @@ prop: 'belongingRoute' }, ], - selectArr:[] + selectArr:[], + form:{}, + templateArr:[ + { + id:111, + name:'妯℃澘1' + }, + { + id:222, + name:'妯℃澘2' + }, + { + id:333, + name:'妯℃澘3' + } + ], + rules:{ + modelObj: [ + { required: true, message: '璇烽�夋嫨妯℃澘', trigger: 'change' } + ] + } }; }, + mounted() { + console.log(this.deviceId) + if(this.deviceId){ + //鐐瑰嚮妯℃澘鏌ヨ璁惧涓嬬殑鍏宠仈妯″瀷鐨勬墍鏈夋ā鏉� + } + }, methods: { cancel(){ - this.showMap = false - this.$emit('cancel') - }, - chooseRow(row){ - this.showMap = false - this.$emit('cancel') - this.$emit('getRowData',row) - }, + this.$emit('cancelModel') + }, submit(){ // this.selectArr - this.$emit('dealChooseArr',this.selectArr) - }, - clickRow(row){ - console.log(row) - this.showMap =true - setTimeout(()=>{ - const position = Cesium.Cartesian3.fromDegrees(0, 0, 0); - // 璁剧疆妯″瀷鏂瑰悜锛堝彲閫夛級 - // const heading = Cesium.Math.toRadians(135); // 鏈濅笢鍗楁柟鍚� - let model = viewer.entities.getById("modelList"); - const heading = Cesium.Math.toRadians(120); // 鏈濅笢鍗楁柟鍚� - const pitch = 0; - const roll = 0; - const orientation = Cesium.Transforms.headingPitchRollQuaternion( - position, - new Cesium.HeadingPitchRoll(heading, pitch, roll) - ); - if(!model) { - // 鍔犺浇 glTF 妯″瀷 - const entity = viewer.entities.add({ - id: "modelList", - name: "modelList", - position: position, - orientation: orientation, - model: { - uri: row.modelRoute, // 鏇挎崲鎴愪綘鐨勬ā鍨嬭矾寰� - scale: 1000, - }, - }); - viewer.flyTo(entity) - }else { - model.orientation = orientation - } - },1000) - }, - handleSelectionChange(selection) { - console.log(selection) - this.selectArr = selection + //鍙嶆樉鍙傛暟浼犻�抩ption瀵硅薄 + this.form.deviceId = this.deviceId + console.log(this.form) + this.$emit('receiveModel',this.form) + this.$emit('cancelModel') }, } }; diff --git a/src/views/system/shootPoint/components/chooseModelDialog.vue b/src/views/system/shootPoint/components/chooseModelDialog.vue index 64793ee..585acfe 100644 --- a/src/views/system/shootPoint/components/chooseModelDialog.vue +++ b/src/views/system/shootPoint/components/chooseModelDialog.vue @@ -6,7 +6,7 @@ width="70%"> <el-row :gutter="20"> <el-col :span="showMap ? 12 : 24" :xs="24"> - <AppTable ref="AppTable" :showDeptSearch="false" :url="'tower/point/list'" :tableColumns="tableColumns" :showSearchBtn="false"> + <AppTable ref="AppTable" :showDeptSearch="false" :url="'tower/model/list'" :tableColumns="tableColumns" :showSearchBtn="false"> <template #operator="{ row }"> <el-button size="mini" type="text" @click="clickRow(row)">棰勮</el-button> @@ -97,7 +97,6 @@ orientation: orientation, model: { uri: row.modelRoute, // 鏇挎崲鎴愪綘鐨勬ā鍨嬭矾寰� - scale: 1000, }, }); viewer.flyTo(entity) diff --git a/src/views/system/shootPoint/components/shootPointDialog.vue b/src/views/system/shootPoint/components/shootPointDialog.vue index 969c7c3..92d54c7 100644 --- a/src/views/system/shootPoint/components/shootPointDialog.vue +++ b/src/views/system/shootPoint/components/shootPointDialog.vue @@ -51,7 +51,7 @@ import ChooseModelDialog from './chooseModelDialog.vue'; import { addPoint} from "@/api/system/template" let globalon = 0 -let globalat =0 +let globalat = 0 const centerCartesian = Cesium.Cartesian3.fromDegrees(globalon,globalat , 0) let rotationAngle = Cesium.Math.toRadians(60) let relativeData @@ -203,6 +203,7 @@ } console.log(this.treeData) }, + //鏁扮粍 濉旂殑绮惧害 濉旂殑绾害 濉旂殑楂樺害 鍗婂緞 insertRaisedPoints(data, centerLon, centerLat, centerHeight, radius = 130) { const center = Cesium.Cartesian3.fromDegrees(centerLon, centerLat, centerHeight); const result = JSON.parse(JSON.stringify(data)); // 娣辨嫹璐濋伩鍏嶆薄鏌撳師鏁版嵁 -- Gitblit v1.9.3