| | |
| | | <template> |
| | | <div class="lalala tree-container"> |
| | | |
| | | <el-form ref="form"> |
| | | <el-form-item> |
| | | |
| | | <el-select |
| | | v-model="$store.state.pigCode" |
| | | <el-select v-model="$store.state.pigCode" |
| | | clearable |
| | | filterable |
| | | style="width :100%" |
| | | @change="setproChange" |
| | | placeholder="请选择项目" |
| | | > |
| | | <el-option |
| | | v-for="item in optionts" |
| | | placeholder="请选择项目"> |
| | | <el-option v-for="item in optionts" |
| | | :key="item.code" |
| | | :label="item.name" |
| | | :value="item.code" |
| | | > |
| | | :value="item.code"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-input |
| | | placeholder="输入关键字进行过滤" |
| | | <el-input placeholder="输入关键字进行过滤" |
| | | v-model="filterText" |
| | | class="search" |
| | | > |
| | | class="search"> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | <el-tree |
| | | ref="tree" |
| | | <el-tree ref="tree" |
| | | :data="treeData" |
| | | node-key="id" |
| | | show-checkbox |
| | |
| | | :default-checked-keys="handleTreeCheck" |
| | | :expand-on-click-node="false" |
| | | :filter-node-method="filterNode" |
| | | draggable |
| | | > |
| | | <span |
| | | class="slot-t-node" |
| | | slot-scope="{ node, data }" |
| | | > |
| | | draggable> |
| | | <span class="slot-t-node" |
| | | slot-scope="{ node, data }"> |
| | | <span v-show="!data.isEdit"> |
| | | <span :class="[data.id >= 99 ? 'slot-t-node--label' : '']">{{ |
| | | node.label |
| | | }}</span> |
| | | </span> |
| | | <span v-show="data.isEdit"> |
| | | <el-input |
| | | class="slot-t-input" |
| | | <el-input class="slot-t-input" |
| | | size="mini" |
| | | autofocus |
| | | v-model="data.label" |
| | | :ref="'slotTreeInput' + data.id" |
| | | @blur.stop="NodeBlur(node, data)" |
| | | @keydown.native.enter="NodeBlur(node, data)" |
| | | ></el-input> |
| | | @keydown.native.enter="NodeBlur(node, data)"></el-input> |
| | | </span> |
| | | </span> |
| | | </el-tree> |
| | | |
| | | <el-card |
| | | class="box-card" |
| | | <el-card class="box-card" |
| | | ref="card" |
| | | :style="{ ...rightClickMenuStyle }" |
| | | v-show="menuVisible" |
| | | > |
| | | <!-- <div |
| | | @click="addSameLevelNode()" |
| | | v-show="firstLevel" |
| | | > |
| | | <i class="el-icon-plus"></i> 添加图层组 |
| | | </div> --> |
| | | <!-- <div |
| | | class="add" |
| | | @click="addChildNode()" |
| | | > |
| | | <i class="el-icon-plus"></i> 添加图层 |
| | | </div> --> |
| | | <!-- <div |
| | | class="delete" |
| | | @click="deleteNode()" |
| | | > |
| | | <i class="el-icon-delete"></i> 删除 |
| | | </div> --> |
| | | <!-- <div |
| | | class="edit" |
| | | @click="editNode()" |
| | | > |
| | | <i class="el-icon-edit"></i> 重命名 |
| | | </div> --> |
| | | <div |
| | | class="edit" |
| | | v-show="menuVisible"> |
| | | <div class="edit" |
| | | @click="showLayerAttribute()" |
| | | v-if="!showlocal && !shwoHistogram" |
| | | v-show="!firstLevel" |
| | | > |
| | | v-show="!firstLevel"> |
| | | <i class="el-icon-tickets"></i> 属性 |
| | | </div> |
| | | <div |
| | | class="edit" |
| | | <div class="edit" |
| | | @click="positioning()" |
| | | v-if="showlocal" |
| | | > |
| | | v-if="showlocal"> |
| | | <i class="el-icon-tickets"></i> 定位 |
| | | </div> |
| | | <div |
| | | class="edit" |
| | | <div class="edit" |
| | | @click="pellucidity()" |
| | | v-if="showlocal" |
| | | > |
| | | v-if="showlocal"> |
| | | <i class="el-icon-tickets"></i> 透明度 |
| | | </div> |
| | | <div |
| | | class="edit" |
| | | <div class="edit" |
| | | @click="histogram()" |
| | | v-show="shwoHistogram" |
| | | > |
| | | v-show="shwoHistogram"> |
| | | <i class="el-icon-tickets"></i> 钻孔柱状图 |
| | | </div> |
| | | <!-- <div |
| | | class="edit" |
| | | v-show="showModelAttach" |
| | | @click="modelAttach()" |
| | | > |
| | | <i class="el-icon-tickets"></i> 模型属性 |
| | | </div> --> |
| | | <!-- <div |
| | | class="edit" |
| | | @click="menuMoveF( 'up')" |
| | | > |
| | | <i class="el-icon-top"></i> 上移 |
| | | </div> |
| | | <div |
| | | class="edit" |
| | | @click="menuMoveF( 'down')" |
| | | > |
| | | <i class="el-icon-bottom"></i> 下移 |
| | | </div> --> |
| | | </el-card> |
| | | <el-dialog |
| | | :title="appendNodetitle" |
| | | <el-dialog :title="appendNodetitle" |
| | | :visible.sync="dialogVisible" |
| | | width="30%" |
| | | top="20vh" |
| | | :modal="false" |
| | | :before-close="handleClose" |
| | | > |
| | | <el-form |
| | | ref="form" |
| | | :before-close="handleClose"> |
| | | <el-form ref="form" |
| | | :model="addFormServer" |
| | | label-width="100px" |
| | | > |
| | | label-width="100px"> |
| | | <el-form-item label="服务类型"> |
| | | <!-- <el-input v-model="addFormServer.type"></el-input> --> |
| | | <el-select |
| | | style="width: 100%" |
| | | <el-select style="width: 100%" |
| | | :popper-append-to-body="false" |
| | | v-model="addFormServer.serveType" |
| | | placeholder="请选择" |
| | | > |
| | | <el-option |
| | | v-for="item in options" |
| | | placeholder="请选择"> |
| | | <el-option v-for="item in options" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | > |
| | | :value="item.value"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | |
| | | <el-slider v-model="addFormServer.opacity"></el-slider> |
| | | </el-form-item> |
| | | </el-form> |
| | | <span |
| | | slot="footer" |
| | | class="dialog-footer" |
| | | > |
| | | <el-button |
| | | type="primary" |
| | | @click="setAddServer" |
| | | >确 定</el-button> |
| | | <span slot="footer" |
| | | class="dialog-footer"> |
| | | <el-button type="primary" |
| | | @click="setAddServer">确 定</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | }; |
| | | }, |
| | | methods: { |
| | | |
| | | //转孔柱状图 |
| | | async histogram() { |
| | | this.menuVisible = false |
| | |
| | | this.menuVisible = false; |
| | | this.$store.state.attachinfo = this.currentData; |
| | | this.$store.state.attachModel = true; |
| | | |
| | | |
| | | }, |
| | | NodeBlur(Node, data) { |
| | | if (data.label.length === 0) { |
| | |
| | | }); |
| | | } |
| | | }, |
| | | |
| | | |
| | | allowDrop(draggingNode, dropNode, type) { |
| | | if (dropNode.data.label === "二级 3-1") { |
| | | return type !== "inner"; |
| | |
| | | var label = this.currentNode.data.cnName; |
| | | if (this.currentNode.data.serveType == "WMS") { |
| | | var value = this.$refs.tree.getCheckedNodes(); |
| | | |
| | | this.$bus.$emit("showMenuLayer", value); |
| | | |
| | | } else if (this.currentNode.data.serveType == "WFS") { |
| | | for (var i in window.Viewer.dataSources._dataSources) { |
| | | if (window.Viewer.dataSources._dataSources[i].name == label) { |
| | |
| | | window.map.removeLayer(layerOl); //显示图层 |
| | | } |
| | | } |
| | | |
| | | this.$refs.tree.remove(this.currentNode); |
| | | }, |
| | | //属性显示 |
| | |
| | | this.$store.state.mapSpaceQueryLayer = layer; |
| | | this.$store.state.showPopBoxFlag = true; |
| | | this.$store.state.mapPopBoxFlag = "2"; |
| | | |
| | | |
| | | }, |
| | | //模型设置透明度 |
| | | pellucidity() { |
| | |
| | | } |
| | | } |
| | | }, |
| | | |
| | | |
| | | |
| | | //模型定位 |
| | | positioning() { |
| | | this.menuVisible = false |
| | |
| | | this.$refs["slotTreeInput" + this.currentData.id].focus(); |
| | | }); |
| | | }, |
| | | |
| | | menuMoveF(type) { |
| | | // 将变动之前的node备份 |
| | | var node = this.currentNode; |
| | | var data = this.currentData; |
| | | let copyNode = this.currentNode; |
| | | |
| | | // copyNode.previousSibling = {...node. } |
| | | // copyNode.nextSibling = {...node.nextSibling} |
| | | // window.sessionStorage.setItem('menuNode',CircularJSON.stringify(copyNode)) |
| | | let nodeData = {}; |
| | | if (type === "up") { |
| | | // 上移 |
| | |
| | | } |
| | | } |
| | | }, |
| | | |
| | | handleDragStart(node, ev) { |
| | | console.log("drag start", node); |
| | | }, |
| | |
| | | this.setChangeMpt([data], checked); |
| | | } |
| | | } |
| | | // if (data.type != 2) return; |
| | | |
| | | |
| | | |
| | | |
| | | // if (data.serveType == "WFS") { |
| | | // if (window.Viewer.dataSources._dataSources.length == 0) { |
| | | // this.setAddLayers(data); |
| | | // } else { |
| | | |
| | | // } |
| | | // } else if (data.serveType == "Tileset") { |
| | | |
| | | // if (Viewer.scene.primitives._primitives.length == 0) { |
| | | // this.setAddLayers(data); |
| | | // } else { |
| | | // var std = []; |
| | | // for (var i in Viewer.scene.primitives._primitives) { |
| | | // Viewer.scene.primitives._primitives[i].show = checked; |
| | | // if (Viewer.scene.primitives._primitives[i].id == data.cnName) { |
| | | // std.push(data.id); |
| | | // Viewer.flyTo(Viewer.scene.primitives._primitives[i]); |
| | | // } |
| | | // } |
| | | // } |
| | | // if (std.length == 0 && checked == true) { |
| | | // this.setAddLayers(data); |
| | | // } else { |
| | | // window.map.getLayers().getArray().forEach(item => { |
| | | // if (item.get("name") == data.cnName) { |
| | | // item.setVisible(checked); |
| | | |
| | | // } |
| | | // }); |
| | | // } |
| | | // } else if (data.serveType == "TMS") { |
| | | |
| | | // if (data.pubid) { |
| | | |
| | | // } else { |
| | | // var res; |
| | | // if (data.url.indexOf("{host}") != -1) { |
| | | // res = data.url.replace("{host}", iisHost); |
| | | // } else { |
| | | // res = data.url |
| | | // } |
| | | // var url = res.split(';') |
| | | |
| | | // window.sgworld.Creator.createImageryProvider('mpt影像', "wms", { |
| | | // url: url[0], |
| | | // layers: url[1] |
| | | // }, "0", undefined, true, ""); |
| | | // } |
| | | |
| | | // } |
| | | |
| | | |
| | | |
| | | |
| | | // var layers_ol = window.map.getAllLayers(); |
| | | // for (var i in layers_ol) { |
| | | // var layerOl = layers_ol[i]; |
| | | // if (layerOl.values_.name == data.label) { |
| | | // layerOl.setVisible(checked); //显示图层 |
| | | // } |
| | | // } |
| | | }, |
| | | setChangeWMS(result, checked) { |
| | | var value = this.$refs.tree.getCheckedNodes(); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | // if (checked.checkedKeys) { |
| | | // for (var i in result) { |
| | | // |
| | | // } |
| | | // } else { |
| | | |
| | | // for (var j in result) { |
| | | // console.log(result[j]) |
| | | // // |
| | | // } |
| | | // } |
| | | }, |
| | | setChangeMpt(result, checked) { |
| | | var value = this.$refs.tree.getCheckedNodes(); |
| | |
| | | this.childOption.push(source) |
| | | } |
| | | }, |
| | | |
| | | async setAddLayers(res) { |
| | | |
| | | if (res.serveType == "WMS") { |
| | | var resource = geoServerURl; |
| | | if (res.resource != null && res.resource != undefined) { |
| | |
| | | console.log("error"); |
| | | }, |
| | | }); |
| | | |
| | | var vectorLayer = new VectorLayer({ |
| | | name: res.cnName, |
| | | source: new VectorSource({ |
| | |
| | | } else { |
| | | url = modelUrl + "/" + res.url |
| | | } |
| | | |
| | | var tileset = Viewer.scene.primitives.add( |
| | | new Cesium.Cesium3DTileset({ |
| | | name: res.cnName, |
| | |
| | | this.setChangeWMS(); |
| | | }, 500); |
| | | } |
| | | |
| | | }, |
| | | async getTilesetArgs(tileset, res) { |
| | | if (res.pubid > 0) { |
| | | const data = await comprehensive_selectPubById({ id: res.pubid }) |
| | | if (data.code != 200) { |
| | | |
| | | // |
| | | } else { |
| | | if (res.serveType != '3DML') { |
| | | this.reload(tileset, data.result.json) |
| | | } else { |
| | | this.tileSet(tileset, parseFloat(res.elev)) |
| | | } |
| | | |
| | | } |
| | | } else { |
| | | this.tileSet(tileset, parseFloat(res.elev)) |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | }, |
| | | async setQueryPubid(res) { |
| | | const data = await comprehensive_selectPubById({ id: res.pubid }) |
| | | if (data.code != 200) { |
| | | |
| | | // |
| | | } else { |
| | | var url = data.result.url; |
| | | |
| | | if (res.url.indexOf("{host}") != -1) { |
| | | url = res.url.replace("{host}", iisHost); |
| | | } |
| | |
| | | url: url, |
| | | minimumLevel: min, |
| | | maximumLevel: max, |
| | | |
| | | }) |
| | | ); |
| | | } else { |
| | |
| | | } |
| | | |
| | | layer.name = res.cnName; |
| | | |
| | | if (data.result.geom) { |
| | | var wkt = this.$wkt.parse(data.result.geom); |
| | | Viewer.camera.flyTo({ |
| | |
| | | return str; |
| | | } |
| | | }); |
| | | |
| | | //存储选中图层 |
| | | sessionStorage.setItem("checkedLayers", JSON.stringify(checkedLayers)); |
| | | var res = this.setTreeData(val); |
| | | |
| | | // for (var i in res) { |
| | | // res[i].children = res[i].children.filter((val) => { |
| | | // if (val.children != null) { |
| | | // return val; |
| | | // } |
| | | // }); |
| | | // } |
| | | this.treeData = res; |
| | | this.$refs.tree.setCheckedKeys(checkKey); |
| | | }, |
| | |
| | | if (!value) return true; |
| | | return data.cnName.indexOf(value) !== -1; |
| | | }, |
| | | |
| | | async setproChange(res) { |
| | | if (res) { |
| | | this.setCheeckedLayer = this.$refs.tree.getCheckedKeys(); |
| | | |
| | | this.$store.state.pigCode = res; |
| | | var st_code = this.optionts.filter(rs => { |
| | | if (rs.code == res) { |
| | |
| | | destination: Cesium.Cartesian3.fromDegrees(wkt.coordinates[0].toFixed(6), wkt.coordinates[1].toFixed(6), 5000), |
| | | }); |
| | | } |
| | | |
| | | } |
| | | this.cannelTerrainLayer(); |
| | | this.setTerrainMptLayer(); |
| | | //清空图层树选中状态 |
| | | this.$refs.tree.setCheckedKeys([]); |
| | | |
| | | |
| | | if (val.length > 0) { |
| | | |
| | | if (val[0].type == 1 && val[0].isProject == 1) {//项目分类 |
| | | |
| | | var std_check = []; |
| | | for (var i in val) { |
| | | var std_val = this.getNewTree([this.$refs.tree.getNode(val[i].id).data], []) |
| | |
| | | std_check.push(std_val[j]) |
| | | } |
| | | } |
| | | |
| | | |
| | | var value = this.$store.state.isProjectLayer; |
| | | for (var i in value) { |
| | | |
| | |
| | | this.$refs.tree.setCheckedKeys(layerid); |
| | | // var value = this.$refs.tree.getCheckedNodes(); |
| | | // this.$bus.$emit("showMenuLayer", value); |
| | | |
| | | var listWMS = []; |
| | | var listWFS = []; |
| | | var listTileset = []; |
| | |
| | | case 'TMS': |
| | | listTMS.push(res[i]) |
| | | break; |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | this.$refs.tree.setCheckedKeys(std); |
| | | this.$bus.$emit("showMenuLayer", value); |
| | | } |
| | | |
| | | |
| | | }, |
| | | |
| | | async getMenuProject() { |
| | | const data = await project_selectDirAll(); |
| | | if (data.code != 200) { |
| | |
| | | .tree-container /deep/ .el-tree-node { |
| | | position: relative; |
| | | padding-left: 10px; |
| | | // text-indent: 16px; |
| | | } |
| | | |
| | | .tree-container /deep/ .el-tree-node__children { |
| | |
| | | position: absolute; |
| | | right: auto; |
| | | } |
| | | |
| | | /deep/.el-table__placeholder { |
| | | padding-left: 8px; |
| | | } |
| | | |
| | | /deep/.el-card__body { |
| | | padding: 10px !important; |
| | | > div { |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | /deep/ .el-form .el-form-item { |
| | | padding-right: 0px !important; |
| | | } |
| | | |
| | | /deep/ .el-form-item { |
| | | margin-bottom: 10px !important; |
| | | } |
| | | /*.lalala {*/ |
| | | /*position: relative;*/ |
| | | /*}*/ |
| | | |
| | | .text { |
| | | font-size: 14px; |
| | | } |