| | |
| | | <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" |
| | | > |
| | | <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" |
| | |
| | | |
| | | import View from "ol/View.js"; |
| | | import { Fill, Stroke, Style } from "ol/style.js"; |
| | | import { perms_selectLayers, inquiry_selectDomains, comprehensive_selectPubById } 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 }, |
| | |
| | | ], |
| | | childOption: [], |
| | | mptLayer: [], |
| | | optionts: [], |
| | | proValue: null, |
| | | }; |
| | | }, |
| | | methods: { |
| | |
| | | // Cesium.Matrix4.equals(a,b)判断两个四维矩阵是否相等 |
| | | // 整个根节点模型矩阵,该tileSet=>世界坐标系 |
| | | // 单位矩阵,对角线值为1.0的4*4矩阵 |
| | | if (!Cesium.Matrix4.equals(tileset.root.transform,Cesium.Matrix4.IDENTITY)) { |
| | | 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() |
| | | tileset.root.transform, |
| | | new Cesium.Cartesian3() |
| | | ); |
| | | // 将笛卡尔坐标转换为WGS84经纬度坐标(模型的) |
| | | const transformCartographic = Cesium.Cartographic.fromCartesian( |
| | | transformCenter |
| | | transformCenter |
| | | ); |
| | | // 将笛卡尔坐标转换为WGS84经纬度坐标(截面的) |
| | | const boundingSphereCartographic = Cesium.Cartographic.fromCartesian( |
| | | tileset.boundingSphere.center |
| | | tileset.boundingSphere.center |
| | | ); |
| | | const height = boundingSphereCartographic.height - transformCartographic.height; |
| | | // 从一个Cartesian3对象生成Matrix4变换矩阵(裁切面的) |
| | | window.modelHeight = height; |
| | | }else window.modelHeight = 0; |
| | | } else window.modelHeight = 0; |
| | | this.getTilesetArgs(tileset, res); |
| | | }); |
| | | this.$store.state.setAlphaList.push({ |
| | |
| | | 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.isProjectLayer = []; |
| | | } |
| | | }, |
| | | 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(); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | /deep/ .el-form .el-form-item { |
| | | padding-right: 0px !important; |
| | | } |
| | | /deep/ .el-form-item { |
| | | margin-bottom: 10px !important; |
| | | } |
| | | /*.lalala {*/ |
| | | /*position: relative;*/ |
| | | /*}*/ |