管道基础大数据平台系统开发-【前端】-新系統界面
Surpriseplus
2023-05-09 64479e2ce8b7c30e36f08c41eed226a1def1be82
src/views/Tools/LayerTree.vue
@@ -126,6 +126,14 @@
      >
        <i class="el-icon-tickets"></i>&nbsp;&nbsp;钻孔柱状图
      </div>
      <div
        class="edit"
        v-show="shwoTitle"
        @click="tileDownload()"
      >
        <i class="el-icon-download"></i>&nbsp;&nbsp;瓦片下载
      </div>
      <!-- <div
        class="edit"
        v-show="showModelAttach"
@@ -220,6 +228,7 @@
  perms_selectLayers, inquiry_selectDomains, comprehensive_selectPubById,
  project_selectDirAll, project_selectByDirid, dataQuerySelectWktById
} from "../../api/api.js";
import { conditions } from '../Archive/Archive.js';
export default {
  name: "tree",
  components: { queryinfo },
@@ -271,11 +280,47 @@
      mptLayer: [],
      optionts: [],
      proValue: null,
      setCheeckedLayer: []
      setCheeckedLayer: [],
      shwoTitle: false,
    };
  },
  methods: {
    //瓦片下载
    tileDownload() {
      var that = this;
      this.menuVisible = false
      sgworld.Creator.createSimpleGraphic(
        "rectangle",
        {},
        function (entity) {
          that.getTileRectangle(entity);
          sgworld.Creator.SimpleGraphic.clear()
        }
      );
    },
    getTileRectangle(res) {
      var value = res.rectangle.coordinates.getValue();
      var val = {
        pubid: this.currentData.pubid,
        pwd: "",
        title: "",
        xmax: Cesium.Math.toDegrees(
          value.east
        ),
        xmin: Cesium.Math.toDegrees(
          value.west
        ),
        ymax: Cesium.Math.toDegrees(
          value.north
        ),
        ymin: Cesium.Math.toDegrees(
          value.south
        )
      }
      this.$bus.$emit("titleDown", val)
    },
    //转孔柱状图
    async histogram() {
      this.menuVisible = false
@@ -325,10 +370,14 @@
      this.currentNode = Node;
      this.$store.state.propertiesName = this.currentData;
      if (this.currentData.serveType == "Tileset") {
      this.showModelAttach = false;
      this.shwoTitle = false;
      if (this.currentData.serveType == 'TMS') {
        this.shwoTitle = true
      } else if (this.currentData.serveType == "Tileset") {
        this.showModelAttach = true;
      } else {
        this.showModelAttach = false;
      }
      if (this.currentData.enName == "s_explorationpoint") {
        this.shwoHistogram = true;
@@ -1081,7 +1130,15 @@
      let cloneData = JSON.parse(JSON.stringify(source)); // 对源数据深度克隆
      return cloneData.filter((father) => {
        // 循环所有项
        let branchArr = cloneData.filter((child) => father.id == child.pid); // 对比ID,分别上下级菜单,并返回数据
        let branchArr = cloneData.filter((child) => father.id == child.pid);
        if (branchArr.length > 0) {
          branchArr.sort(function (a, b) {
            return a.orderNum - b.orderNum
          })
        }
        branchArr.length > 0 ? (father.children = branchArr) : ""; // 给父级添加一个children属性,并赋值
        // 属于同一对象问题,例如:令 a=b、c=1 ,然后再令 b.c=c , 那么 a.c=b.c=c=1 ;同理,后续令 c.d=2 ,那么 a.c.d 也是=2;
        // 由此循环多次后,就能形成相应的树形数据结构
@@ -1391,7 +1448,9 @@
    if (this.$store.state.showAllLayers == true) {
      this.layersStart();
      this.$store.state.showAllLayers = false;
    } else {
      this.treeData = this.$store.state.treeData;
      this.$refs.tree.setCheckedKeys(this.$store.state.checkedKeys);
    }