管道基础大数据平台系统开发-【前端】-新系統界面
Surpriseplus
2023-03-18 35889caf6315da8f72aec921069547af462b479a
src/components/MapView/mapSpaceTop.vue
@@ -1,7 +1,27 @@
<template>
  <div class="spaceBox">
    <el-select v-model="menuTopFrom.queryLayer" placeholder="请选择...">
      <el-option :value="menuTopFrom.queryLayer" style="height: 100%">
    <el-select
      v-model="menuTopFrom.queryLayer"
      @change="menuTreeCheck"
      placeholder="请选择..."
      filterable
    >
      <el-option
        v-for="item in layerData"
        :key="item.entity"
        :label="item.tabDesc"
        :value="item.entity"
      >
      </el-option>
    </el-select>
    <!-- <el-select
      v-model="menuTopFrom.queryLayer"
      placeholder="请选择..."
    >
      <el-option
        :value="menuTopFrom.queryLayer"
        style="height: 100%"
      >
        <div style="height: 200px; overflow: auto">
          <el-tree
            :data="layerData"
@@ -18,46 +38,53 @@
          </el-tree>
        </div>
        <div style="margin-top: 5px">
          <el-button size="mini" plain @click="getCheckedNodes">确认</el-button>
          <el-button size="mini" type="info" plain @click="resetCheckedNodes"
            >重置</el-button
          >
          <el-button
            size="mini"
            plain
            @click="getCheckedNodes"
          >确认</el-button>
          <el-button
            size="mini"
            type="info"
            plain
            @click="resetCheckedNodes"
          >重置</el-button>
        </div>
      </el-option>
    </el-select>
    <queryinfo ref="queryinfo"/>
    </el-select> -->
    <queryinfo ref="queryinfo" />
  </div>
</template>
<script>
import   queryinfo  from "../../views/Tools/queryinfo.vue"
import { inquiry_SelectTabs } from '../../api/api.js';
import queryinfo from "../../views/Tools/queryinfo.vue";
import { inquiry_SelectTabs, dataLib_selectTabed } from "../../api/api.js";
export default {
  components:{queryinfo },
  components: { queryinfo },
  data() {
    return {
      menuTopFrom: {
        queryLayer: '',
        queryLayer: "",
      },
      layerData: [
        {
          id: 1,
          label: '基础数据',
          tabDesc: '基础数据',
          value: 'BD',
          children: [],
        },
        {
          id: 2,
          label: '基础数据',
          tabDesc: '业务数据',
          value: 'BS',
          children: [],
        },
        // {
        //   id: 1,
        //   label: '基础数据',
        //   tabDesc: '基础数据',
        //   value: 'BD',
        //   children: [],
        // },
        // {
        //   id: 2,
        //   label: '业务数据',
        //   tabDesc: '业务数据',
        //   value: 'BS',
        //   children: [],
        // },
      ],
      defaultProps: {
        children: 'children',
        label: 'label',
        children: "children",
        label: "label",
      },
      mapSpaceQueryLayer: null,
    };
@@ -67,30 +94,77 @@
  },
  methods: {
    async getAllTable() {
      const data = await inquiry_SelectTabs();
      // const data = await inquiry_SelectTabs();
      const data = await dataLib_selectTabed({
        hasGeom: "false",
        name: null,
      });
      if (data.code != 200) {
        this.$message.error('列表调用失败');
        this.$message.error("列表调用失败");
      }
      var option = data.result;
      this.layerData = option.filter((res) => {
      for (var i in option) {
        var val_Data = option[i];
        val_Data.id = '1' + i;
        val_Data.label = val_Data.tabDesc + '(' + val_Data.tab + ')';
        if (option[i].ns == 'bd') {
          this.layerData[0].children.push(val_Data);
        } else {
          this.layerData[1].children.push(val_Data);
        }
      }
        return res;
      });
      // var val = data.result
      // var std = [];
      // val.filter((item) => {
      //   if (std.indexOf(item.bak) == -1) {
      //     std.push(item.bak);
      //     this.layerData.push(
      //       {
      //         val: item.bak,
      //         label: item.bak,
      //         children: [],
      //       }
      //     )
      //   }
      // });
      // for (var i in this.layerData) {
      //   var item = this.layerData[i];
      //   for (var j in val) {
      //     var res = val[j];
      //     if (item.val === res.bak) {
      //       res.label = res.tabDesc
      //       this.layerData[i].children.push(res)
      //     }
      //   }
      // }
      // for (var i in option) {
      //   // console.log(option[i].tableType)
      //   var val_Data = option[i];
      //   val_Data.id = '1' + i;
      //   val_Data.label = val_Data.tabDesc;
      //   if (option[i].ns == 'bd') {
      //     this.layerData[0].children.push(val_Data);
      //   } else {
      //     this.layerData[1].children.push(val_Data);
      //   }
      // }
    },
    getCheckedNodes() {
      this.$store.state.mapSpaceQueryLayer = this.mapSpaceQueryLayer;
      // this.$store.state.mapPopBoolean = true;
      this.$store.state.mapPopBoxFlag = '2';
       this.$refs && this.$refs.queryinfo && this.$refs.queryinfo.open("属性查询",null,{
      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();
            }
          },
        });
    },
@@ -98,17 +172,14 @@
      this.menuTopFrom.queryLayer = null;
      this.$refs.treeForm.setCheckedKeys([]);
    },
    menuTreeCheck(node, list) {
      if (list.checkedNodes.length > 0) {
        this.menuTopFrom.queryLayer = node.tabDesc;
        this.mapSpaceQueryLayer = node.entity;
        if (list.checkedKeys.length == 2) {
          //单选实现
          this.$refs.treeForm.setCheckedKeys([node.id]);
    menuTreeCheck(value) {
      this.mapSpaceQueryLayer = value;
      this.layerData.forEach(item => {
        if (this.menuTopFrom.queryLayer == item.entity) {
          this.$store.state.propertiesName = item;
        }
      } else {
        this.menuid = null;
      }
      })
      this.getCheckedNodes();
    },
  },
};
@@ -123,28 +194,4 @@
  overflow: hidden;
}
</style>
<style lang="less" scoped>
.el-tree .el-tree-node .is-leaf + .el-checkbox .el-checkbox__inner {
  display: inline-block;
}
.el-tree .el-tree-node .el-checkbox .el-checkbox__inner {
  display: none;
}
/deep/.el-form-item__label {
  color: white;
}
/deep/.el-input__inner {
  background-color: transparent !important ;
  color: #fff !important;
  border: 1px solid;
}
/deep/ .el-input__inner {
  border-color: #fff !important;
}
/deep/.el-select-dropdown {
  border-color: white;
  opacity: 0.85;
}
</style>
<style lang="less" scoped></style>