From f76b96c26b878840ecc80b79d1e28e477d5573e6 Mon Sep 17 00:00:00 2001 From: suerprisePlus <15810472099@163.com> Date: 星期一, 01 七月 2024 18:10:25 +0800 Subject: [PATCH] 模型发布管理 添加 --- src/views/visual/mapView/location.vue | 79 ++++++++++++++++++++++++++++++++++++++- 1 files changed, 77 insertions(+), 2 deletions(-) diff --git a/src/views/visual/mapView/location.vue b/src/views/visual/mapView/location.vue index 831f58f..85f2da4 100644 --- a/src/views/visual/mapView/location.vue +++ b/src/views/visual/mapView/location.vue @@ -1,6 +1,21 @@ <template> - <Popup ref="pop" top="20px" left="calc(100% - 600px)" :title="title" @close="close(true)" width="300px" @cancel="close(false)"> - <el-tree></el-tree> + <Popup ref="pop" top="20px" left="calc(100% - 600px)" :maxHeight="'700px'" :title="title" @close="close(true)" width="300px" @cancel="close(false)"> + <div> + <el-form label-width="60px" ref="modelFrom" :model="modelFrom" :rules="rules" append-to-body :close-on-click-modal="false"> + <el-form-item label="缁忓害" prop="lon"> + <el-input v-model="modelFrom.lon"></el-input> + </el-form-item> + <el-form-item label="绾害" prop="lat"> + <el-input v-model="modelFrom.lat"></el-input> + </el-form-item> + <el-form-item label="楂樺害" prop="alt"> + <el-input v-model="modelFrom.alt"></el-input> + </el-form-item> + </el-form> + <div slot="footer" style="float: right; margin-right: 10px; margin-bottom: 10px" class="dialog-footer"> + <el-button type="primary" @click="setSsubmitForm('modelFrom')">瀹� 浣�</el-button> + </div> + </div> </Popup> </template> @@ -12,6 +27,36 @@ data() { return { title: '鍧愭爣瀹氫綅', + billboard: null, + + modelFrom: { + lon: '', + lat: '', + alt: '', + }, + rules: { + lon: [ + { + required: true, + message: '缁忓害涓嶈兘涓虹┖', + trigger: 'blur', + }, + ], + lat: [ + { + required: true, + message: '绾害涓嶈兘涓虹┖', + trigger: 'blur', + }, + ], + alt: [ + { + required: true, + message: '楂樺害涓嶈兘涓虹┖', + trigger: 'blur', + }, + ], + }, }; }, methods: { @@ -19,14 +64,44 @@ close(isCloseBtn, removeLayer = true) { // removeLayer && this.removeImageLayer(); // 閲嶇疆data鍊� + this.setRemoveBillboard(); Object.assign(this.$data, this.$options.data()); !isCloseBtn && this.$refs.pop.close(); + }, // 鎵撳紑寮圭獥 open() { this.close(true); this.$refs.pop.open(); }, + setRemoveBillboard() { + if (this.billboard) { + Viewer.entities.remove(this.billboard); + this.billboard = null; + } + }, + setSsubmitForm(formName) { + this.$refs[formName].validate((valid) => { + if (valid) { + this.setRemoveBillboard(); + + const url = config.sdkImg + 'Workers/image/mark.png'; + console.log(url); + this.billboard = Viewer.entities.add({ + position: Cesium.Cartesian3.fromDegrees(this.modelFrom.lon, this.modelFrom.lat), // 璁剧疆瀹炰綋鍦ㄥ湴鐞冧笂鐨勪綅缃� + billboard: { + image: url, // 璁剧疆浣犳兂鏄剧ず鐨勫浘鐗� + verticalOrigin: Cesium.VerticalOrigin.BOTTOM, // 璁剧疆鍥剧墖鍦ㄥ疄浣撲腑鐨勪綅缃� + disableDepthTestDistance: Number.POSITIVE_INFINITY, // 绂佺敤娣卞害娴嬭瘯锛岀‘淇濅笉琚湴褰㈤伄鎸� + }, + }); + earthCtrl.userScene.flyTo(this.billboard); + } else { + console.log('error submit!!'); + return false; + } + }); + }, }, }; </script> -- Gitblit v1.9.3