管道基础大数据平台系统开发-【前端】-新系統界面
王旭
2023-02-20 198b83ce825fbbf912cb26d592e3c7b0b586ca92
src/components/MapView/mapSpaceTop.vue
@@ -2,6 +2,20 @@
  <div class="spaceBox">
    <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
@@ -37,14 +51,14 @@
          >重置</el-button>
        </div>
      </el-option>
    </el-select>
    </el-select> -->
    <queryinfo ref="queryinfo" />
  </div>
</template>
<script>
import queryinfo from "../../views/Tools/queryinfo.vue"
import { inquiry_SelectTabs } from '../../api/api.js';
import { inquiry_SelectTabs, dataLib_selectTabs } from '../../api/api.js';
export default {
  components: { queryinfo },
  data() {
@@ -53,20 +67,20 @@
        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',
@@ -80,29 +94,40 @@
  },
  methods: {
    async getAllTable() {
      const data = await inquiry_SelectTabs();
      // const data = await inquiry_SelectTabs();
      const data = await dataLib_selectTabs({
        pageIndex: 1,
        pageSize: 500
      })
      if (data.code != 200) {
        this.$message.error('列表调用失败');
      }
      var option = data.result;
      for (var i in option) {
        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);
      this.layerData = option.filter((res) => {
        if (res.rows != 0) {
          return 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.close();
      this.$refs && this.$refs.queryinfo && this.$refs.queryinfo.open("空间查询", null, {
      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) {
@@ -120,17 +145,11 @@
      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]);
        }
      } else {
        this.menuid = null;
      }
    menuTreeCheck(value) {
      this.mapSpaceQueryLayer = value;
      this.getCheckedNodes();
    },
  },
};
@@ -146,5 +165,4 @@
}
</style>
<style lang="less" scoped>
</style>