管道基础大数据平台系统开发-【前端】-新系統界面
q
Surpriseplus
2022-12-23 8d301b885c7c433300b5bbeb47a0864eb738fad4
src/components/MapView/mapMenuTop.vue
@@ -1,13 +1,20 @@
<template>
  <div class="menuBox">
    <el-form :inline="true" :model="menuTopFrom" class="demo-form-inline">
    <el-form
      :inline="true"
      :model="menuTopFrom"
      class="demo-form-inline"
    >
      <el-form-item>
        <el-select
          v-model="menuTopFrom.queryLayer"
          :title="treeChange"
          placeholder="请选择..."
        >
          <el-option :value="menuTopFrom.queryLayer" style="height: 100%">
          <el-option
            :value="menuTopFrom.queryLayer"
            style="height: 100%"
          >
            <div style="height: 200px; overflow: auto">
              <el-tree
                :data="layerData"
@@ -21,16 +28,17 @@
              </el-tree>
            </div>
            <div style="margin-top: 5px">
              <el-button size="mini" plain @click="getCheckedNodes"
                >确认</el-button
              >
              <el-button
                size="mini"
                plain
                @click="getCheckedNodes"
              >确认</el-button>
              <el-button
                size="mini"
                type="info"
                plain
                @click="resetCheckedNodes"
                >重置</el-button
              >
              >重置</el-button>
            </div>
          </el-option>
        </el-select>
@@ -67,19 +75,29 @@
        > -->
      </el-form-item>
      <el-form-item>
        <el-button plain @click="getAttributeQuery">查询</el-button>
        <el-button type="info" @click="clearQuery" plain>重置</el-button>
        <el-button
          plain
          @click="getAttributeQuery"
        >查询</el-button>
        <el-button
          type="info"
          @click="clearQuery"
          plain
        >重置</el-button>
      </el-form-item>
    </el-form>
    <queryinfo ref="queryinfo" />
  </div>
</template>
<script>
import queryinfo from "../../views/Tools/queryinfo.vue"
import $ from 'jquery';
import { inquiry_SelectTabs, inquiry_uploadShp, encr } from '../../api/api.js';
import { getToken } from '@/utils/auth';
import * as turf from '@turf/turf';
export default {
  components: { queryinfo },
  data() {
    return {
      menuTopFrom: {
@@ -233,10 +251,19 @@
      //清空标绘
      sgworld.Creator.SimpleGraphic.edit(false, { editProp: false });
      sgworld.Creator.SimpleGraphic.clear();
      if (this.treeChange.length == 0) {
        this.$message.error('请选择要查询的数据');
        return;
      }
      if (this.menuTopFrom.queryType != 'inputFile') {
        sgworld.Creator.createSimpleGraphic(
          this.menuTopFrom.queryType,
          {},
          {
            color: '#00FF0060',
            outlineColor: '#0f0',
            outlineWidth: 5,
          },
          (entity) => {
            this.setTurfGeometry(entity);
          }
@@ -297,7 +324,6 @@
      if (type == 'polyline') {
        var line = turf.lineString(std, { name: 'polyline' });
        restVal = turf.buffer(line, 10, { units: 'miles' });
        console.log('line', restVal);
      } else if (type == 'rectangle') {
        var ste = this.setCartesianToEightFour(res[0]);
        std.push([ste.lng, ste.lat]);
@@ -317,14 +343,24 @@
    },
    showMapMenuPop() {
      this.$store.state.mapSpaceQueryLayer = this.treeChange;
      if (
        this.$store.state.mapPopBoolean != true &&
        this.$store.state.mapPopBoxFlag != '1'
      ) {
        this.$store.state.mapPopBoolean = true;
        this.$store.state.mapPopBoxFlag = '1';
      }
      this.$store.state.mapPopBoxFlag = '1';
      // 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()
          }
        }
      });
      this.$bus.$emit('changeMapMenuTop', 'true');
      sgworld.Creator.SimpleGraphic.edit(false, { editProp: false });
      sgworld.Creator.SimpleGraphic.clear();
      //清空inputFile
      // var file = document.getElementById('getMenuTopFile');
      // file.outerHTML = file.outerHTML;