| | |
| | | <el-button class="button-user" type="primary" icon="el-icon-upload" title="上传至服务器" |
| | | @click.stop="saveHistoryPlot"></el-button> |
| | | |
| | | <!-- <el-button class="button-user historyBtn" type="primary" icon="el-icon-s-order" title="历史记录" |
| | | @click.stop="histotyPlotting"></el-button> --> |
| | | <el-button class="button-user historyBtn" type="primary" icon="el-icon-s-order" title="获取最新数据" |
| | | @click.stop="histotyPlotting"></el-button> |
| | | </el-upload> |
| | | </div> |
| | | |
| | |
| | | import SaveScene from "./SaveScene.vue"; |
| | | import { Op_SelectByPage, Op_Insert, Op_UpdateById } from '../../../api/api.js' |
| | | import model from "../../../assets/js/Layer/model"; |
| | | import mapOL from "../../../assets/js/Layer/mapOL"; |
| | | // 工程树工具 |
| | | let _treeTool; |
| | | function arrGroup(arr, fn) { |
| | |
| | | Bus.$emit("checkTab", "index/add/treeLayer", false); |
| | | }, |
| | | closeLayer() { |
| | | this.$parent.hideLayer(); |
| | | this.$store.state.isShowLayer= false |
| | | // this.$parent.hideLayer(); |
| | | }, |
| | | // 定义中转站事件 |
| | | initBusEvent() { |
| | |
| | | }, |
| | | // 加载历史标绘数据 |
| | | async histotyPlotting() { |
| | | this.setTreeData([]); |
| | | this.initData({}); |
| | | model.deleteAll(); |
| | | const data = await Op_SelectByPage({ pageSize: 1000000, pageIndex: 1, name: '' }); |
| | | if (data.status == 200 && data.data.length > 0) { |
| | | var val_data = data.data; |
| | |
| | | if (addData && node._children) { |
| | | node._children.forEach((item) => { |
| | | _treeTool.addData(item); |
| | | console.log(item) |
| | | this.setAddGLBLayer(item); |
| | | }); |
| | | } else { |
| | |
| | | model.addModelLayer(treeNode); |
| | | } else { |
| | | model.setDelGLBModel(treeNode); |
| | | } |
| | | } else if (treeNode.sourceType == "SimpleGraphic") { |
| | | if (isCheck) { |
| | | mapOL.addLayerData(treeNode); |
| | | } else { |
| | | mapOL.removeLayerD(treeNode); |
| | | } |
| | | } |
| | | // 只能同时加载一个地形 |
| | |
| | | if (res.sourceType == "GLB" && res.checked) { |
| | | |
| | | model.addModelLayer(res); |
| | | } else if (res.sourceType == "SimpleGraphic" && res.checked) { |
| | | mapOL.addLayerData(res); |
| | | } |
| | | }, |
| | | // 添加演示动画 |
| | |
| | | if (this.selectNode.sourceType === "GLB") { |
| | | model.setDelGLBModel(this.selectNode) |
| | | } |
| | | if (this.selectNode.sourceType === "SimpleGraphic") { |
| | | |
| | | mapOL.removeLayerData(this.selectNode) |
| | | } |
| | | |
| | | this.remove(this.selectNode); |
| | | this.$refs.tree && this.$refs.tree.setCurrentKey(null); |