| | |
| | | <template> |
| | | <div class="lalala tree-container"> |
| | | <el-input |
| | | placeholder="输入关键字进行过滤" |
| | | v-model="filterText" |
| | | class="search" |
| | | > |
| | | </el-input> |
| | | |
| | | <el-form ref="form"> |
| | | <el-form-item> |
| | | |
| | | <el-select |
| | | v-model="$store.state.pigCode" |
| | | clearable |
| | | filterable |
| | | style="width :100%" |
| | | @change="setproChange" |
| | | placeholder="请选择项目" |
| | | > |
| | | <el-option |
| | | v-for="item in optionts" |
| | | :key="item.code" |
| | | :label="item.name" |
| | | :value="item.code" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-input |
| | | placeholder="输入关键字进行过滤" |
| | | v-model="filterText" |
| | | class="search" |
| | | > |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | <el-tree |
| | | ref="tree" |
| | | :data="treeData" |
| | |
| | | :props="defaultProps" |
| | | @node-click="handleLeftclick" |
| | | @node-contextmenu="rightClick" |
| | | @check-change="handleCheckChange" |
| | | @check="handleCheckChange" |
| | | :default-checked-keys="handleTreeCheck" |
| | | :expand-on-click-node="false" |
| | | :filter-node-method="filterNode" |
| | | draggable |
| | | > |
| | | <span |
| | | class="slot-t-node" |
| | |
| | | v-if="showlocal" |
| | | > |
| | | <i class="el-icon-tickets"></i> 定位 |
| | | </div> |
| | | <div |
| | | class="edit" |
| | | @click="pellucidity()" |
| | | v-if="showlocal" |
| | | > |
| | | <i class="el-icon-tickets"></i> 透明度 |
| | | </div> |
| | | <div |
| | | class="edit" |
| | |
| | | >确 定</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <queryinfo ref="queryinfo" /> |
| | | |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | |
| | | import View from "ol/View.js"; |
| | | import { Fill, Stroke, Style } from "ol/style.js"; |
| | | import { perms_selectLayers, inquiry_selectDomains } from "../../api/api.js"; |
| | | import { |
| | | perms_selectLayers, inquiry_selectDomains, comprehensive_selectPubById, |
| | | project_selectDirAll, project_selectByDirid |
| | | } from "../../api/api.js"; |
| | | export default { |
| | | name: "tree", |
| | | components: { queryinfo }, |
| | |
| | | label: "WFS", |
| | | }, |
| | | ], |
| | | childOption: [], |
| | | mptLayer: [], |
| | | optionts: [], |
| | | proValue: null, |
| | | }; |
| | | }, |
| | | methods: { |
| | |
| | | var layer = this.currentData.enName.replaceAll("_", ""); |
| | | this.$store.state.mapSpaceQueryLayer = layer; |
| | | this.$store.state.mapPopBoxFlag = "2"; |
| | | this.$refs && this.$refs.queryinfo && this.$refs.queryinfo.close(); |
| | | this.$refs && |
| | | this.$refs.queryinfo && |
| | | this.$refs.queryinfo.open("属性", null, { |
| | | close: () => { |
| | | if (this.$store.state.primitLayer != null) { |
| | | sgworld.Creator.DeleteObject(this.$store.state.primitLayer); |
| | | this.$store.state.primitLayer = null; |
| | | } |
| | | |
| | | if (window.Viewer.scene.primitives.length != 0) { |
| | | window.Viewer.scene.primitives.removeAll(); |
| | | } |
| | | }, |
| | | }); |
| | | this.$store.state.showPopBoxFlag = true; |
| | | }, |
| | | modelAttach() { |
| | | this.menuVisible = false; |
| | |
| | | rightClick(event, object, Node, element) { |
| | | this.currentData = object; |
| | | this.currentNode = Node; |
| | | |
| | | this.$store.state.propertiesName = this.currentData; |
| | | if (this.currentData.serveType == "Tileset") { |
| | | this.showModelAttach = true; |
| | |
| | | this.menuVisible = false |
| | | var label = this.currentNode.data.cnName; |
| | | if (this.currentNode.data.serveType == "WMS") { |
| | | for (var i in window.Viewer.imageryLayers._layers) { |
| | | if ( |
| | | window.Viewer.imageryLayers._layers[i].imageryProvider.name === |
| | | label |
| | | ) { |
| | | window.Viewer.imageryLayers.remove( |
| | | window.Viewer.imageryLayers._layers[i] |
| | | ); |
| | | } |
| | | } |
| | | 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) { |
| | |
| | | ); |
| | | } |
| | | } |
| | | var list = this.$store.state.setAlphaList; |
| | | for (var i = 0; i < list.length; i++) { |
| | | if (list[i].name == label) { |
| | | list.splice(i, 1) |
| | | } |
| | | } |
| | | |
| | | } |
| | | var layers_ol = window.map.getAllLayers(); |
| | | for (var i in layers_ol) { |
| | |
| | | this.currentData = data ? data : this.currentData; |
| | | var layer = this.currentData.enName.replaceAll("_", ""); |
| | | this.$store.state.mapSpaceQueryLayer = layer; |
| | | |
| | | this.$store.state.showPopBoxFlag = true; |
| | | this.$store.state.mapPopBoxFlag = "2"; |
| | | this.$refs && this.$refs.queryinfo && this.$refs.queryinfo.close(); |
| | | this.$refs && |
| | | this.$refs.queryinfo && |
| | | this.$refs.queryinfo.open("属性", null, { |
| | | close: () => { |
| | | if (this.$store.state.primitLayer != null) { |
| | | sgworld.Creator.DeleteObject(this.$store.state.primitLayer); |
| | | this.$store.state.primitLayer = null; |
| | | } |
| | | |
| | | if (window.Viewer.scene.primitives.length != 0) { |
| | | window.Viewer.scene.primitives.removeAll(); |
| | | } |
| | | }, |
| | | }); |
| | | |
| | | }, |
| | | //模型设置透明度 |
| | | pellucidity() { |
| | | this.foo(); |
| | | this.menuVisible = false |
| | | var tile = this.currentData |
| | | for (var j in Viewer.scene.primitives._primitives) { |
| | | if (Viewer.scene.primitives._primitives[j].id == tile.cnName) { |
| | | this.$store.state.setAlphaDity = this.currentData; |
| | | this.$bus.$emit("showPellucidity", true); |
| | | break; |
| | | } |
| | | } |
| | | }, |
| | | |
| | | |
| | | |
| | | //模型定位 |
| | | positioning() { |
| | | this.menuVisible = false |
| | |
| | | console.log("tree drop: ", dropNode.label, dropType); |
| | | }, |
| | | handleCheckChange(data, checked, indeterminate) { |
| | | if (data.type == 1) { |
| | | this.childOption = []; |
| | | this.getchilds(data); |
| | | var listWMS = []; |
| | | var listWFS = []; |
| | | var listTileset = []; |
| | | var listTMS = []; |
| | | var listMpt = []; |
| | | for (var i in this.childOption) { |
| | | switch (this.childOption[i].serveType) { |
| | | case 'WMS': |
| | | listWMS.push(this.childOption[i]) |
| | | break; |
| | | case 'WFS': |
| | | listWFS.push(this.childOption[i]) |
| | | break; |
| | | case 'Tileset': |
| | | listTileset.push(this.childOption[i]) |
| | | break; |
| | | case 'Mpt': |
| | | listMpt.push(this.childOption[i]) |
| | | break; |
| | | case 'TMS': |
| | | listTMS.push(this.childOption[i]) |
| | | break; |
| | | |
| | | if (data.type != 2) return; |
| | | var std = []; |
| | | if (data.serveType == "WMS") { |
| | | for (var i = 0; i < window.Viewer.imageryLayers._layers.length; i++) { |
| | | var val_id = |
| | | window.Viewer.imageryLayers._layers[i].imageryProvider.name; |
| | | if (val_id == data.cnName) { |
| | | std.push(data.label); |
| | | |
| | | const img_layer = window.Viewer.imageryLayers._layers[i]; |
| | | img_layer.show = checked; |
| | | } |
| | | } |
| | | } else if (data.serveType == "WFS") { |
| | | if (window.Viewer.dataSources._dataSources.length == 0) { |
| | | this.setAddLayers(data); |
| | | } else { |
| | | for (var i in window.Viewer.dataSources._dataSources) { |
| | | if (window.Viewer.dataSources._dataSources[i].name == data.cnName) { |
| | | window.Viewer.dataSources._dataSources[i].show = checked; |
| | | std.push(data.label); |
| | | } |
| | | } |
| | | } |
| | | } else if (data.serveType == "Tileset") { |
| | | if (Viewer.scene.primitives._primitives.length == 0) { |
| | | this.setAddLayers(data); |
| | | } else { |
| | | 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(res.id); |
| | | Viewer.flyTo(Viewer.scene.primitives._primitives[i]); |
| | | } |
| | | } |
| | | this.setChangeWMS(listWMS, checked); |
| | | this.setChangeWFS(listWFS, checked); |
| | | this.setChangeTileset(listTileset, checked); |
| | | this.setChangeTMS(listTMS, checked); |
| | | this.setChangeMpt(listMpt, checked); |
| | | } else if (data.type == 2) { |
| | | if (data.serveType == "WMS") { |
| | | this.setChangeWMS([data], checked); |
| | | } else if (data.serveType == "Tileset") { |
| | | this.setChangeTileset([data], checked); |
| | | } else if (data.serveType == "TMS") { |
| | | this.setChangeTMS([data], checked); |
| | | } else if (data.serveType == "Mpt") { |
| | | this.setChangeMpt([data], checked); |
| | | } |
| | | } |
| | | 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); |
| | | debugger |
| | | } |
| | | }); |
| | | } |
| | | // 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, ""); |
| | | // } |
| | | |
| | | // } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | // } |
| | | // } |
| | | }, |
| | | setChangeWMS(result, checked) { |
| | | var value = this.$refs.tree.getCheckedNodes(); |
| | | this.$bus.$emit("showMenuLayer", value); |
| | | }, |
| | | setChangeWFS(result, checked) { |
| | | var value = this.$refs.tree.getCheckedNodes(); |
| | | var std = []; |
| | | for (var i in value) { |
| | | std.push(value[i].id) |
| | | } |
| | | for (var i in result) { |
| | | var tile = result[i] |
| | | if (std.indexOf(tile.id) != -1) { |
| | | this.setAddLayers(tile) |
| | | } else { |
| | | for (var i in window.Viewer.dataSources._dataSources) { |
| | | if (window.Viewer.dataSources._dataSources[i].name == tile.cnName) { |
| | | window.Viewer.dataSources.remove(window.Viewer.dataSources._dataSources[i]); |
| | | } |
| | | } |
| | | |
| | | var layers_ol = window.map.getAllLayers(); |
| | | for (var i in layers_ol) { |
| | | var layerOl = layers_ol[i]; |
| | | if (layerOl.values_.name == tile.cnName) { |
| | | window.map.removeLayer(layerOl) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | setChangeTileset(result, checked) { |
| | | var value = this.$refs.tree.getCheckedNodes(); |
| | | var std = []; |
| | | for (var i in value) { |
| | | std.push(value[i].id) |
| | | } |
| | | for (var i in result) { |
| | | var tile = result[i] |
| | | if (std.indexOf(tile.id) != -1) { |
| | | this.setAddLayers(tile) |
| | | } else { |
| | | for (var j in Viewer.scene.primitives._primitives) { |
| | | if (Viewer.scene.primitives._primitives[j].id == tile.cnName) { |
| | | Viewer.scene.primitives.remove(Viewer.scene.primitives._primitives[j]) |
| | | } |
| | | } |
| | | var list = this.$store.state.setAlphaList; |
| | | for (var i = 0; i < list.length; i++) { |
| | | if (list[i].name == tile.cnName) { |
| | | list.splice(i, 1) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | // 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(); |
| | | var std = []; |
| | | for (var i in value) { |
| | | std.push(value[i].id) |
| | | } |
| | | for (var i in result) { |
| | | var tile = result[i] |
| | | if (std.indexOf(tile.id) != -1) { |
| | | this.setAddLayers(tile) |
| | | |
| | | } else { |
| | | for (var i in this.mptLayer) { |
| | | if (this.mptLayer[i].treeobj.name == tile.cnName) { |
| | | this.mptLayer[i].deleteObject(); |
| | | this.mptLayer.splice(i, 1) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | setChangeTMS(result, checked) { |
| | | var value = this.$refs.tree.getCheckedNodes(); |
| | | var std = []; |
| | | for (var i in value) { |
| | | std.push(value[i].id) |
| | | } |
| | | for (var i in result) { |
| | | var tile = result[i] |
| | | if (std.indexOf(tile.id) != -1) { |
| | | this.setAddLayers(tile) |
| | | |
| | | } else { |
| | | for (var i = 0; i < window.Viewer.imageryLayers._layers.length; i++) { |
| | | var val_id = window.Viewer.imageryLayers._layers[i].name; |
| | | if (val_id == tile.cnName) { |
| | | window.Viewer.imageryLayers.remove( |
| | | window.Viewer.imageryLayers._layers[i] |
| | | ); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | getchilds(source) { |
| | | if (source.children) { |
| | | var child = source.children |
| | | for (var i in child) { |
| | | if (child[i].children) { |
| | | this.getchilds(child[i]) |
| | | } else { |
| | | this.childOption.push(child[i]) |
| | | } |
| | | } |
| | | } else { |
| | | this.childOption.push(source) |
| | | } |
| | | }, |
| | | |
| | | setAddLayers(res) { |
| | | |
| | | if (res.serveType == "WMS") { |
| | | var resource = geoServerURl; |
| | | if (res.resource != null && res.resource != undefined) { |
| | |
| | | }); |
| | | window.map.addLayer(vectorLayer); |
| | | } else if (res.serveType == "Tileset") { |
| | | var url; |
| | | if (res.url.indexOf("{host}") != -1) { |
| | | url = res.url.replace("{host}", iisHost); |
| | | } else { |
| | | url = modelUrl + "/" + res.url |
| | | } |
| | | |
| | | var tileset = Viewer.scene.primitives.add( |
| | | new Cesium.Cesium3DTileset({ |
| | | name: res.cnName, |
| | | url: modelUrl + "/" + res.url, //192.168.20.106,to4 |
| | | url: url, //192.168.20.106,to4 |
| | | maximumScreenSpaceError: 64, // 最大屏幕空间错误:16 |
| | | maximumMemoryUsage: 768, // 最大内存:512 |
| | | dynamicScreenSpaceError: true, // 减少离相机较远的屏幕空间错误:false |
| | | skipLevelOfDetail: true, // 在遍历时候跳过详情:false |
| | | }) |
| | | ); |
| | | |
| | | tileset.readyPromise.then((tileset) => { |
| | | |
| | | tileset.id = res.cnName; |
| | | tileset.layerId = res.id; |
| | | this.tileSet(tileset, parseFloat(res.elev)) |
| | | Viewer.flyTo(tileset); |
| | | tileset.pubid = res.pubid; |
| | | // Cesium.Matrix4.equals(a,b)判断两个四维矩阵是否相等 |
| | | // 整个根节点模型矩阵,该tileSet=>世界坐标系 |
| | | // 单位矩阵,对角线值为1.0的4*4矩阵 |
| | | if (!Cesium.Matrix4.equals(tileset.root.transform, Cesium.Matrix4.IDENTITY)) { |
| | | // 获取模型的世界坐标(笛卡尔) |
| | | // Cesium.Matrix4.getTranslation 通过仿射变换矩阵获取该tileSet的世界坐标 |
| | | const transformCenter = Cesium.Matrix4.getTranslation( |
| | | tileset.root.transform, |
| | | new Cesium.Cartesian3() |
| | | ); |
| | | // 将笛卡尔坐标转换为WGS84经纬度坐标(模型的) |
| | | const transformCartographic = Cesium.Cartographic.fromCartesian( |
| | | transformCenter |
| | | ); |
| | | // 将笛卡尔坐标转换为WGS84经纬度坐标(截面的) |
| | | const boundingSphereCartographic = Cesium.Cartographic.fromCartesian( |
| | | tileset.boundingSphere.center |
| | | ); |
| | | const height = boundingSphereCartographic.height - transformCartographic.height; |
| | | // 从一个Cartesian3对象生成Matrix4变换矩阵(裁切面的) |
| | | window.modelHeight = height; |
| | | } else window.modelHeight = 0; |
| | | this.getTilesetArgs(tileset, res); |
| | | }); |
| | | this.$store.state.setAlphaList.push({ |
| | | name: res.cnName, |
| | | alpha: 1 |
| | | }) |
| | | window.model = tileset |
| | | } else if (res.serveType == "TMS") { |
| | | var url = res.url; |
| | | if (res.url.indexOf("{host}") != -1) { |
| | | url = res.url.replace("{host}", iisHost); |
| | | } |
| | | |
| | | if (res.pubid) { |
| | | this.setQueryPubid(res); |
| | | } else { |
| | | var layer = Viewer.imageryLayers.addImageryProvider( |
| | | new Cesium.UrlTemplateImageryProvider({ |
| | | url: url, |
| | | maximumLevel: 18, |
| | | }) |
| | | ); |
| | | layer.name = res.cnName; |
| | | this.setChangeWMS(); |
| | | } |
| | | |
| | | } else if (res.serveType == "Mpt") { |
| | | |
| | | if (res.url.indexOf("{host}") != -1) { |
| | | res.url = res.url.replace("{host}", iisHost); |
| | | } |
| | | var url = res.url.split(';') |
| | | |
| | | var layer = sgworld.Creator.createImageryProvider(res.cnName, "wms", { |
| | | url: url[0], |
| | | layers: url[1] |
| | | }, "0", undefined, true, ""); |
| | | this.mptLayer.push(layer) |
| | | setTimeout(() => { |
| | | this.setChangeWMS(); |
| | | }, 500); |
| | | } |
| | | |
| | | }, |
| | | async getTilesetArgs(tileset, res) { |
| | | if (res.pubid > 0) { |
| | | const data = await comprehensive_selectPubById({ id: res.pubid }) |
| | | if (data.code != 200) { |
| | | |
| | | } else { |
| | | this.reload(tileset, data.result.json) |
| | | } |
| | | } 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); |
| | | } |
| | | var layer = Viewer.imageryLayers.addImageryProvider( |
| | | new Cesium.UrlTemplateImageryProvider({ |
| | | url: url, |
| | | maximumLevel: 18, |
| | | }) |
| | | ); |
| | | layer.name = res.cnName; |
| | | |
| | | if (data.result.geom) { |
| | | var wkt = this.$wkt.parse(data.result.geom); |
| | | Viewer.camera.flyTo({ |
| | | destination: Cesium.Cartesian3.fromDegrees(wkt.coordinates[1], wkt.coordinates[0], 2000), |
| | | }); |
| | | } |
| | | this.setChangeWMS(); |
| | | } |
| | | }, |
| | | |
| | | |
| | | reload(tileset, res) { |
| | | var vm = JSON.parse(res) |
| | | var pos = Cesium.Cartesian3.fromDegrees(vm.lon, vm.lat, vm.height); |
| | | var converter = Cesium.Transforms.eastNorthUpToFixedFrame; |
| | | var hpr = new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(vm.yaw), 0, 0); |
| | | var matrix = Cesium.Transforms.headingPitchRollToFixedFrame(pos, hpr, Cesium.Ellipsoid.WGS84, converter); |
| | | tileset._root.transform = matrix; |
| | | Viewer.flyTo(tileset); |
| | | }, |
| | | tileSet(tileset, height) { |
| | | //3dtile模型的边界球体 |
| | | var boundingSphere = tileset.boundingSphere; |
| | |
| | | var translation = Cesium.Cartesian3.subtract(Cartesian3_offset, Cartesian3_original, new Cesium.Cartesian3()); |
| | | //修改模型矩阵 |
| | | tileset.modelMatrix = Cesium.Matrix4.fromTranslation(translation); |
| | | Viewer.flyTo(tileset); |
| | | }, |
| | | setTreeData(source) { |
| | | let cloneData = JSON.parse(JSON.stringify(source)); // 对源数据深度克隆 |
| | |
| | | var std = data.result; |
| | | var that = this; |
| | | var checkKey = []; |
| | | let checkedLayers = []; |
| | | var val = std.filter((str) => { |
| | | if (str.type == 1) { |
| | | return str; |
| | |
| | | if (str.url != null && str.type == 2) { |
| | | if (str.isShow == 1) { |
| | | checkKey.push(str.id); |
| | | that.setAddLayers(str); |
| | | // that.setAddLayers(str); |
| | | if (str.serveType == "WMS" && str.url) { |
| | | checkedLayers.push(str); |
| | | } |
| | | } |
| | | 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; |
| | | } |
| | | }); |
| | | } |
| | | // 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) { |
| | | |
| | | this.$store.state.pigCode = res; |
| | | if (res) { |
| | | var obj = { |
| | | dirid: res, |
| | | pageIndex: 1, |
| | | pageSize: 10, |
| | | } |
| | | |
| | | const data = await project_selectByDirid(obj); |
| | | if (data.code != 200) { |
| | | this.$message.error("列表获取失败"); |
| | | return; |
| | | } |
| | | if (data.result[0]) { |
| | | var geom = data.result[0].geom |
| | | var wkt = this.$wkt.parse(geom) |
| | | Viewer.camera.flyTo({ |
| | | destination: Cesium.Cartesian3.fromDegrees(wkt.coordinates[0].toFixed(6), wkt.coordinates[1].toFixed(6), 5000), |
| | | }); |
| | | |
| | | } |
| | | this.setChangeProLayer(); |
| | | } else { |
| | | |
| | | this.$store.state.pigCode = null |
| | | this.setChangeWMS(); |
| | | } |
| | | }, |
| | | setChangeProLayer() { |
| | | var value = this.$store.state.isProjectLayer; |
| | | if (value.length != 0) { |
| | | |
| | | var std = []; |
| | | for (var i in value) { |
| | | std.push(value[i].id) |
| | | } |
| | | this.$refs.tree.setCheckedKeys(std); |
| | | this.$bus.$emit("showMenuLayer", value); |
| | | } |
| | | |
| | | |
| | | }, |
| | | |
| | | async getMenuProject() { |
| | | const data = await project_selectDirAll(); |
| | | if (data.code != 200) { |
| | | return |
| | | } |
| | | this.optionts = data.result; |
| | | }, |
| | | }, |
| | | watch: { |
| | | filterText(val) { |
| | |
| | | }, |
| | | }, |
| | | mounted() { |
| | | |
| | | this.getMenuProject() |
| | | this.$bus.$on("treeDataCopy", (res) => { |
| | | this.$store.state.treeData = this.treeData; |
| | | this.$store.state.checkedKeys = this.$refs.tree.getCheckedKeys(); |
| | |
| | | } |
| | | |
| | | .el-checkbox .el-checkbox__inner { |
| | | display: none; |
| | | //display: none; |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | /deep/ .el-form .el-form-item { |
| | | padding-right: 0px !important; |
| | | } |
| | | /deep/ .el-form-item { |
| | | margin-bottom: 10px !important; |
| | | } |
| | | /*.lalala {*/ |
| | | /*position: relative;*/ |
| | | /*}*/ |