管道基础大数据平台系统开发-【前端】-新系統界面
Surpriseplus
2023-03-09 6fe940335b9ca7f4640983929b070c00e401dc61
src/views/Tools/LayerTree.vue
@@ -17,6 +17,7 @@
      @check-change="handleCheckChange"
      :default-checked-keys="handleTreeCheck"
      :expand-on-click-node="false"
      :filter-node-method="filterNode"
    >
      <span
        class="slot-t-node"
@@ -85,6 +86,20 @@
        v-show="showlocal"
      >
        <i class="el-icon-tickets"></i>&nbsp;&nbsp;定位
      </div>
      <div
        class="edit"
        @click="histogram()"
        v-show="shwoHistogram"
      >
        <i class="el-icon-tickets"></i>&nbsp;&nbsp;钻孔柱状图
      </div>
      <div
        class="edit"
        v-show="showModelAttach"
        @click="modelAttach()"
      >
        <i class="el-icon-tickets"></i>&nbsp;&nbsp;模型属性
      </div>
      <!-- <div
        class="edit"
@@ -169,12 +184,13 @@
import View from "ol/View.js";
import { Fill, Stroke, Style } from "ol/style.js";
import { perms_selectLayers } from "../../api/api.js";
import { perms_selectLayers, inquiry_selectDomains } from "../../api/api.js";
export default {
  name: "tree",
  components: { queryinfo },
  data() {
    return {
      shwoHistogram: false,
      showlocal: false,
      eleId: "",
      isShow: false,
@@ -188,6 +204,7 @@
      rightClickMenuStyle: {},
      handleTreeCheck: [],
      dialogVisible: false,
      showModelAttach: false,
      addFormServer: {
        opacity: 100,
        serveType: "WMS",
@@ -217,6 +234,36 @@
    };
  },
  methods: {
    //转孔柱状图
    async histogram() {
      this.menuVisible = false
      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();
            }
          },
        });
    },
    modelAttach() {
      this.menuVisible = false;
      this.$store.state.attachinfo = this.currentData;
      this.$store.state.attachModel = true;
    },
    NodeBlur(Node, data) {
      if (data.label.length === 0) {
        this.$message.error("菜单名不可为空!");
@@ -230,11 +277,7 @@
        });
      }
    },
    // 查询
    filterNode(value, data) {
      if (!value) return true;
      return data.label.indexOf(value) !== -1;
    },
    allowDrop(draggingNode, dropNode, type) {
      if (dropNode.data.label === "二级 3-1") {
@@ -250,6 +293,17 @@
    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;
      } else {
        this.showModelAttach = false;
      }
      if (this.currentData.enName == "s_explorationpoint") {
        this.shwoHistogram = true;
      } else {
        this.shwoHistogram = false;
      }
      if (Node.level === 3) {
        this.firstLevel = false;
      } else {
@@ -286,6 +340,7 @@
    },
    // 增加同级节点事件
    addSameLevelNode() {
      this.menuVisible = false
      this.foo();
      if (this.currentNode.level == 2) {
        this.appendNodetitle = this.currentData.label;
@@ -299,6 +354,7 @@
    // 增加子级节点事件
    addChildNode() {
      this.foo();
      this.menuVisible = false
      // if (this.currentNode.level >= 2) {
      //   this.$message.error("最多只支两级!");
      //   return false;
@@ -327,6 +383,7 @@
    // 删除节点
    deleteNode() {
      this.foo();
      this.menuVisible = false
      var label = this.currentNode.data.cnName;
      if (this.currentNode.data.serveType == "WMS") {
        for (var i in window.Viewer.imageryLayers._layers) {
@@ -370,10 +427,11 @@
    //属性显示
    showLayerAttribute(data) {
      this.foo();
      this.menuVisible = false
      this.currentData = data ? data : this.currentData;
      var layer = this.currentData.enName.replaceAll("_", "");
      this.$store.state.mapSpaceQueryLayer = layer;
      // this.$store.state.mapPopBoolean = true;
      this.$store.state.mapPopBoxFlag = "2";
      this.$refs && this.$refs.queryinfo && this.$refs.queryinfo.close();
      this.$refs &&
@@ -393,6 +451,7 @@
    },
    //模型定位
    positioning() {
      this.menuVisible = false
      for (var i in Viewer.scene.primitives._primitives) {
        if (
          Viewer.scene.primitives._primitives[i].id == this.currentData.cnName
@@ -404,6 +463,7 @@
    // 编辑节点
    editNode(data) {
      this.foo();
      this.menuVisible = false
      this.currentData = data ? data : this.currentData;
      if (!this.currentData.isEdit) {
        this.$set(this.currentData, "isEdit", true);
@@ -618,13 +678,10 @@
          })
        );
        tileset.readyPromise.then((tileset0) => {
        tileset.readyPromise.then((tileset) => {
          tileset.id = res.cnName;
          tileset.layerId = res.id;
          this.tileSet(tileset, parseFloat(res.elev))
          Viewer.flyTo(tileset);
        });
      }
@@ -747,6 +804,12 @@
      }
      this.$refs.tree.setCheckedKeys(std);
    },
    // 查询
    filterNode(value, data) {
      if (!value) return true;
      return data.cnName.indexOf(value) !== -1;
    },
  },
  watch: {
    filterText(val) {