From 417c46988366e8c11f54230345f2e6840a0025f7 Mon Sep 17 00:00:00 2001 From: jihongshun <1151753686@qq.com> Date: 星期三, 16 七月 2025 16:43:00 +0800 Subject: [PATCH] 项目相关 --- src/views/system/device/components/deviceDialog.vue | 21 ++++++++++++++------- 1 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/views/system/device/components/deviceDialog.vue b/src/views/system/device/components/deviceDialog.vue index fdf3e42..ee4c403 100644 --- a/src/views/system/device/components/deviceDialog.vue +++ b/src/views/system/device/components/deviceDialog.vue @@ -74,19 +74,25 @@ this.resetForm("form"); if (ids) { + this.getModel() // 缂栬緫 this.$api.detail('/tower/device', ids).then(res => { + console.log(res) this.form = res.data this.open = true this.$nextTick(() => { + console.log(this.form) this.$refs.cesiumMapSelctPoint.showPickPoint({ longitude: +this.form.longitude, latitude: +this.form.latitude, - altitude: +this.form.altitude, + height: +this.form.height, }) + console.log(this.modelListData) let url = this.modelListData.filter(item=>item.id == this.form.modelId)[0].modelRoute + console.log(url) this.modelUrl = url - const position = Cesium.Cartesian3.fromDegrees(this.form.longitude, this.form.latitude, this.form.altitude); + const position = Cesium.Cartesian3.fromDegrees(this.form.longitude, this.form.latitude, this.form.height); + console.log(position) // 璁剧疆妯″瀷鏂瑰悜锛堝彲閫夛級 let model = viewer.entities.getById("MyModel"); const heading = Cesium.Math.toRadians(this.form.face); // 鏈濅笢鍗楁柟鍚� @@ -122,19 +128,20 @@ } }, handleSelectAddress(data) { + console.log(data) this.$set(this.form, 'longitude', data.longitude) this.$set(this.form, 'latitude', data.latitude) - this.$set(this.form, 'altitude', data.altitude) + this.$set(this.form, 'height', data.altitude) this.$refs.form.validateField('longitude') this.$refs.form.validateField('latitude') - this.$refs.form.validateField('altitude') + this.$refs.form.validateField('height') }, submitForm() { this.$refs["form"].validate(valid => { console.log(this.form) this.form.longitude = Number(this.form.longitude) this.form.latitude = Number(this.form.latitude) - this.form.altitude = Number(this.form.altitude) + this.form.height = Number(this.form.height) this.form.face = Number(this.form.face) if (valid) { this.$api.save('tower/device/', 'id', Object.assign({}, this.form)).then(res => { @@ -178,13 +185,13 @@ this.$message.error("璇疯緭鍏ョ含搴�"); return; } - if (!this.form.altitude) { + if (!this.form.height) { this.$message.error("璇疯緭鍏ラ珮搴�"); return; } //鍔ㄦ�佺粡绾害鏈濆悜 鍔犺浇妯″瀷浣嶇疆棰勮 // const position = Cesium.Cartesian3.fromDegrees(0, 0, 0); - const position = Cesium.Cartesian3.fromDegrees(this.form.longitude, this.form.latitude, this.form.altitude); + const position = Cesium.Cartesian3.fromDegrees(this.form.longitude, this.form.latitude, this.form.height); // 璁剧疆妯″瀷鏂瑰悜锛堝彲閫夛級 // const heading = Cesium.Math.toRadians(135); // 鏈濅笢鍗楁柟鍚� let model = viewer.entities.getById("MyModel"); -- Gitblit v1.9.3