| | |
| | | <template> |
| | | <div class="modelBox" v-drag > |
| | | <div class="modelBox" v-drag> |
| | | <div> |
| | | <div class="modleTitle " > |
| | | <div class="modleTitle"> |
| | | <div>模型添加</div> |
| | | <div class="modelClose" @click="$store.state.showModelFlag = false"> X</div> |
| | | <el-button size="mini" @click="batchAdd">批量添加</el-button> |
| | | <div class="modelClose" @click="$store.state.showModelFlag = false"> |
| | | X |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="modelContent"> |
| | | <div class="modelType" v-for="(item, index) in modelOption" :key="index" @click="setModelAddLayer(item)"> |
| | | <img class="imgIcon" :src="require('../../../assets/img/model/' + item.imgUrl)" /> |
| | | <div |
| | | class="modelType" |
| | | v-for="(item, index) in modelOption" |
| | | :key="index" |
| | | @click="setModelAddLayer(item)" |
| | | > |
| | | <img |
| | | class="imgIcon" |
| | | :src="require('../../../assets/img/model/' + item.imgUrl)" |
| | | /> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import model from '../../../assets/js/Layer/model'; |
| | | import model from "../../../assets/js/Layer/model"; |
| | | import batchAddGrid from "../../../assets/js/Layer/batchAddGrid"; |
| | | |
| | | export default { |
| | | name: "modelLayer", |
| | | components: { |
| | | |
| | | }, |
| | | components: {}, |
| | | |
| | | data() { |
| | | return { |
| | | modelOption: [ |
| | | |
| | | ], |
| | | modelOption: [], |
| | | }; |
| | | }, |
| | | mounted() { |
| | | this.setLayerStart(); |
| | | }, |
| | | destroyed() { |
| | | |
| | | }, |
| | | destroyed() {}, |
| | | methods: { |
| | | setLayerStart() { |
| | | this.modelOption = layerData.modelData; |
| | | |
| | | }, |
| | | setModelAddLayer(item) { |
| | | // model |
| | | model.changeLayer(item,true); |
| | | if (this.$store.state.batchGridArr == []) { |
| | | // model |
| | | model.changeLayer(item, true); |
| | | } else { |
| | | model.changeBatchLayer(item, true); |
| | | this.$store.state.isBatchGridArr =false; |
| | | let coordinates = this.$store.state.batchGridArr; |
| | | let shape = this.$store.state.batchShape; |
| | | Viewer.entities.remove(shape); |
| | | coordinates.forEach((element) => { |
| | | let coordinate = { |
| | | longitude: Number(element[0].toFixed(6)), |
| | | latitude: Number(element[1].toFixed(6)), |
| | | altitude: 0, |
| | | heading: 0, |
| | | pitch: 0, |
| | | roll: 0, |
| | | scale: 1, |
| | | }; |
| | | model.setModelCoord(coordinate); |
| | | }); |
| | | } |
| | | }, |
| | | } |
| | | batchAdd() { |
| | | batchAddGrid.drawRect(); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | |
| | | background-color: rgba(0, 0, 0, 0.6); // #0048fd69 !important |
| | | z-index: 9999; |
| | | position: absolute; |
| | | |
| | | .el-button { |
| | | background-color: #0051e9; |
| | | color: #fff; |
| | | |
| | | } |
| | | .modleTitle { |
| | | height: 42px; |
| | | width: 90%; |
| | |
| | | width: 100%; |
| | | height: 100%; |
| | | } |
| | | |
| | | } |
| | | |
| | | .modelType :hover { |
| | | border: 1px solid #409EFF; |
| | | border: 1px solid #409eff; |
| | | } |
| | | } |
| | | } |