Surpriseplus
2022-11-04 d3208016fbb567fb55186e0275fdd1b421ee3e0d
src/components/mapsdk.vue
@@ -1,168 +1,195 @@
<template>
  <div id="mapdiv" class="mapdiv">
    <div class="bufferBox" v-if="showBufferBoxDialog">
      <el-card class="box-card">
        <div slot="header" class="clearfix">
          <span>缓冲区分析</span>
          <div style="float: right; cursor: pointer">
            <i class="el-icon-close" @click="closeBufferBox(1)"></i>
  <div class="mapBox">
    <div id="mapdiv">
      <div class="menu_Top" v-if="$store.state.mapMenuBoolean">
        <map-menu-top v-if="$store.state.mapMenuBoxFlag == '1'" />
        <map-space-top v-if="$store.state.mapMenuBoxFlag == '2'" />
      </div>
      <div class="menu_Popup" v-if="$store.state.mapPopBoolean">
        <map-menu-pop v-if="$store.state.mapPopBoxFlag == '1'" />
        <map-space-pop v-if="$store.state.mapPopBoxFlag == '2'" />
      </div>
      <div class="bufferBox" v-if="showBufferBoxDialog">
        <el-card class="box-card">
          <div slot="header" class="clearfix">
            <span>缓冲区分析</span>
            <div style="float: right; cursor: pointer">
              <i class="el-icon-close" @click="closeBufferBox(1)"></i>
            </div>
          </div>
        </div>
        <div class="box-body">
          <el-form ref="form" :model="bufFrom" label-width="100px">
            <el-form-item label="缓冲半径(米):">
              <el-input v-model="bufFrom.val"></el-input>
            </el-form-item>
            <el-form-item>
              <el-button @click="addBuffer(1)" type="info">点</el-button>
              <el-button @click="addBuffer(2)" type="info">线</el-button>
              <el-button @click="addBuffer(3)" type="info">面</el-button>
              <el-button @click="clearBuffer" type="info">清除</el-button>
            </el-form-item>
          </el-form>
        </div>
      </el-card>
    </div>
    <div class="coordLocalBox" v-if="showCoordLocalBoxDialog">
      <el-card class="box-card">
        <div slot="header" class="clearfix">
          <span>坐标定位</span>
          <div style="float: right; cursor: pointer">
            <i class="el-icon-close" @click="closeBufferBox(2)"></i>
          <div class="box-body">
            <el-form ref="form" :model="bufFrom" label-width="100px">
              <el-form-item label="缓冲半径(米):">
                <el-input v-model="bufFrom.val"></el-input>
              </el-form-item>
              <el-form-item>
                <el-button @click="addBuffer(1)" type="info">点</el-button>
                <el-button @click="addBuffer(2)" type="info">线</el-button>
                <el-button @click="addBuffer(3)" type="info">面</el-button>
                <el-button @click="clearBuffer" type="info">清除</el-button>
              </el-form-item>
            </el-form>
          </div>
        </div>
        <div class="box-body">
          <el-form ref="form" :model="coordFrom" label-width="50px">
            <el-form-item label="经度:">
              <el-input v-model="coordFrom.lon"></el-input>
            </el-form-item>
            <el-form-item label="纬度:">
              <el-input v-model="coordFrom.lat"></el-input>
            </el-form-item>
            <el-form-item label="高度:">
              <el-input v-model="coordFrom.height"></el-input>
            </el-form-item>
            <el-form-item>
              <el-button @click="setCoordLocal" type="info">定位</el-button>
            </el-form-item>
          </el-form>
        </div>
      </el-card>
    </div>
    <div class="toponymicLocalBox" v-if="showToponymicLocalBoxDialog">
      <el-card class="box-card">
        <div slot="header" class="clearfix">
          <span>地名定位</span>
          <div style="float: right; cursor: pointer">
            <i class="el-icon-close" @click="closeBufferBox(3)"></i>
        </el-card>
      </div>
      <div class="coordLocalBox" v-if="showCoordLocalBoxDialog">
        <el-card class="box-card">
          <div slot="header" class="clearfix">
            <span>坐标定位</span>
            <div style="float: right; cursor: pointer">
              <i class="el-icon-close" @click="closeBufferBox(2)"></i>
            </div>
          </div>
        </div>
        <div class="box-body">
          <el-form :model="comprehensive" :inline="true" label-width="50px">
            <el-form-item label="地名:">
              <el-input
                style="width: 200px"
                v-model="comprehensive.name"
              ></el-input>
            </el-form-item>
            <el-form-item>
              <el-button type="info">查询</el-button>
            </el-form-item>
          </el-form>
          <el-table :data="tableData" height="200px" style="width: 100%">
            <el-table-column
              align="center"
              type="index"
              label="序号"
              width="70px"
            />
            <el-table-column prop="name" align="center" label="定位">
              <template slot-scope="scope">
                <el-button
                  @click="handleLocation(scope.$index, scope.row)"
                  size="small"
                  icon="el-icon-place"
                ></el-button>
              </template>
            </el-table-column>
            <el-table-column prop="name" align="center" label="地名">
            </el-table-column>
          </el-table>
          <div style="margin-top: 10px" class="pagination_box">
            <el-pagination
              @size-change="handleSizeChange"
              @current-change="handleCurrentChange"
              :current-page="listData.pageIndex"
              :page-sizes="[10, 20, 30, 40]"
              :page-size="listData.pageSize"
              layout="total, sizes, prev, pager, next, jumper"
              :total="count"
            >
            </el-pagination>
          <div class="box-body">
            <el-form ref="form" :model="coordFrom" label-width="50px">
              <el-form-item label="经度:">
                <el-input v-model="coordFrom.lon"></el-input>
              </el-form-item>
              <el-form-item label="纬度:">
                <el-input v-model="coordFrom.lat"></el-input>
              </el-form-item>
              <el-form-item label="高度:">
                <el-input v-model="coordFrom.height"></el-input>
              </el-form-item>
              <el-form-item>
                <el-button @click="setCoordLocal" type="info">定位</el-button>
              </el-form-item>
            </el-form>
          </div>
        </div>
      </el-card>
    </div>
    <div class="pathAnalysisBox" v-if="showPathAnalysisBoxDialog">
      <el-card class="box-card">
        <div slot="header" class="clearfix">
          <span>路径分析</span>
          <div style="float: right; cursor: pointer">
            <i class="el-icon-close" @click="closeBufferBox(4)"></i>
        </el-card>
      </div>
      <div class="toponymicLocalBox" v-if="showToponymicLocalBoxDialog">
        <el-card class="box-card">
          <div slot="header" class="clearfix">
            <span>地名定位</span>
            <div style="float: right; cursor: pointer">
              <i class="el-icon-close" @click="closeBufferBox(3)"></i>
            </div>
          </div>
        </div>
        <div class="box-body">
          <el-form ref="form" :model="pathFrom" label-width="50px">
            <el-form-item label="经度:">
              <el-input style="width: 300px" v-model="pathFrom.lon"></el-input>
              <el-link
                :underline="false"
                @click="showMouseLeftClick(1)"
                style="margin-left: 10px"
                ><i style="color: white" class="el-icon-plus"></i
              ></el-link>
            </el-form-item>
            <el-form-item label="纬度:">
              <el-input style="width: 300px" v-model="pathFrom.lat"></el-input>
              <el-link
                :underline="false"
                @click="showMouseLeftClick(2)"
                style="margin-left: 10px"
                ><i style="color: white" class="el-icon-plus"></i
              ></el-link>
            </el-form-item>
            <el-form-item>
              <el-button @click="showMouseLeftClick(3)" type="info"
                >查询</el-button
          <div class="box-body">
            <el-form :model="comprehensive" :inline="true" label-width="50px">
              <el-form-item label="地名:">
                <el-input
                  style="width: 200px"
                  v-model="comprehensive.name"
                ></el-input>
              </el-form-item>
              <el-form-item>
                <el-button type="info">查询</el-button>
              </el-form-item>
            </el-form>
            <el-table :data="tableData" height="200px" style="width: 100%">
              <el-table-column
                align="center"
                type="index"
                label="序号"
                width="70px"
              />
              <el-table-column prop="name" align="center" label="定位">
                <template slot-scope="scope">
                  <el-button
                    @click="handleLocation(scope.$index, scope.row)"
                    size="small"
                    icon="el-icon-place"
                  ></el-button>
                </template>
              </el-table-column>
              <el-table-column prop="name" align="center" label="地名">
              </el-table-column>
            </el-table>
            <div style="margin-top: 10px" class="pagination_box">
              <el-pagination
                @size-change="handleSizeChange"
                @current-change="handleCurrentChange"
                :current-page="listData.pageIndex"
                :page-sizes="[10, 20, 30, 40]"
                :page-size="listData.pageSize"
                layout="total, sizes, prev, pager, next, jumper"
                :total="count"
              >
            </el-form-item>
          </el-form>
        </div>
      </el-card>
    </div>
    <div
      @click="changeMenulayer"
      class="center CenDiv"
      :class="{ center1: centerFlag }"
    >
              </el-pagination>
            </div>
          </div>
        </el-card>
      </div>
      <div class="pathAnalysisBox" v-if="showPathAnalysisBoxDialog">
        <el-card class="box-card">
          <div slot="header" class="clearfix">
            <span>路径分析</span>
            <div style="float: right; cursor: pointer">
              <i class="el-icon-close" @click="closeBufferBox(4)"></i>
            </div>
          </div>
          <div class="box-body">
            <el-form ref="form" :model="pathFrom" label-width="50px">
              <el-form-item label="经度:">
                <el-input
                  style="width: 300px"
                  v-model="pathFrom.lon"
                ></el-input>
                <el-link
                  :underline="false"
                  @click="showMouseLeftClick(1)"
                  style="margin-left: 10px"
                  ><i style="color: white" class="el-icon-plus"></i
                ></el-link>
              </el-form-item>
              <el-form-item label="纬度:">
                <el-input
                  style="width: 300px"
                  v-model="pathFrom.lat"
                ></el-input>
                <el-link
                  :underline="false"
                  @click="showMouseLeftClick(2)"
                  style="margin-left: 10px"
                  ><i style="color: white" class="el-icon-plus"></i
                ></el-link>
              </el-form-item>
              <el-form-item>
                <el-button @click="showMouseLeftClick(3)" type="info"
                  >查询</el-button
                >
              </el-form-item>
            </el-form>
          </div>
        </el-card>
      </div>
      <div
        id="cenBg"
        v-bind:class="{ active: isActive, menuLayer: isMenuLayer }"
      ></div>
        @click="changeMenulayer"
        class="center CenDiv"
        :class="{ center1: centerFlag }"
      >
        <div
          id="cenBg"
          v-bind:class="{ active: isActive, menuLayer: isMenuLayer }"
        ></div>
      </div>
    </div>
  </div>
</template>
<script>
import $ from 'jquery';
import mapMenuTop from './MapView/mapMenuTop.vue';
import mapMenuPop from './MapView/mapMenuPop.vue';
import mapSpaceTop from './MapView/mapSpaceTop.vue';
import mapSpacePop from './MapView/mapSpacePop.vue';
import {
  select_Comprehensive_ByPageAndCount,
  select_Comprehensive_SelectWktById,
} from '../api/api';
export default {
  name: '',
  components: {
    mapMenuTop,
    mapMenuPop,
    mapSpaceTop,
    mapSpacePop,
  },
  data() {
    return {
      centerFlag: false,
      buffer: null,
      showBufferBoxDialog: false,
      showCoordLocalBoxDialog: false,
@@ -187,6 +214,7 @@
        pageSize: 10,
      },
      count: 0,
      selFrom: {},
      tableData: [],
      imagePoint: null,
      handler: null,
@@ -196,6 +224,63 @@
      isActive: false,
      isMenuLayer: true,
      selFrom: {},
      selectTree: null,
      menuList: [
        {
          id: 1,
          label: '一级 1',
          children: [
            {
              id: 4,
              label: '二级 1-1',
              children: [
                {
                  id: 9,
                  label: '三级 1-1-1',
                },
                {
                  id: 10,
                  label: '三级 1-1-2',
                },
              ],
            },
          ],
        },
        {
          id: 2,
          label: '一级 2',
          children: [
            {
              id: 5,
              label: '二级 2-1',
            },
            {
              id: 6,
              label: '二级 2-2',
            },
          ],
        },
        {
          id: 3,
          label: '一级 3',
          children: [
            {
              id: 7,
              label: '二级 3-1',
            },
            {
              id: 8,
              label: '二级 3-2',
            },
          ],
        },
      ],
      defaultProps: {
        children: 'children',
        label: 'label',
      }, //树绑定对象
    };
  },
  mounted() {
@@ -645,149 +730,226 @@
};
</script>
<style scoped>
.mapdiv {
<style scoped lang="less">
.mapBox {
  width: 100%;
  height: 100%;
  overflow: hidden;
  margin: 0;
  padding: 0;
  position: relative;
}
.bufferBox {
  width: 412px;
  height: 230px;
  z-index: 40;
  position: absolute;
  right: 1%;
  bottom: 1%;
  #mapdiv {
    width: 100%;
    height: 100%;
    overflow: hidden;
    margin: 0;
    padding: 0;
    position: absolute;
    .toponymicLocalBox {
      width: 750px;
      height: 450x;
      z-index: 40;
      position: absolute;
      right: 1%;
      bottom: 1%;
    }
    .bufferBox {
      width: 412px;
      height: 230px;
      z-index: 40;
      position: absolute;
      right: 1%;
      bottom: 1%;
    }
    .coordLocalBox {
      width: 350px;
      height: 370px;
      z-index: 40;
      position: absolute;
      right: 1%;
      bottom: 1%;
    }
    .pathAnalysisBox {
      width: 412px;
      z-index: 40;
      position: absolute;
      right: 1%;
      bottom: 1%;
    }
    .box-body {
      padding: 18px;
      /deep/ .el-form-item__label {
        color: white !important;
      }
      /deep/ .el-input__inner {
        background: rgba(255, 255, 255, 0.2) !important;
        color: white !important;
      }
      /deep/.el-table,
      .el-table__expanded-cell {
        background-color: transparent;
        color: white;
      }
      /deep/ .el-table tr {
        background-color: transparent !important;
      }
      /deep/ .el-table tbody tr:hover > td {
        background-color: rgba(255, 255, 255, 0.2) !important;
      }
      /deep/.el-table–enable-row-transition .el-table__body td,
      .el-table .cell {
        background-color: transparent !important;
      }
      /deep/ .el-table th.el-table__cell {
        background-color: transparent !important;
        color: white;
      }
      /deep/.el-pager li {
        background-color: transparent !important;
        color: white;
      }
      /deep/ .btn-prev {
        background-color: transparent !important;
      }
      /deep/ .btn-next {
        background-color: transparent !important;
        color: white !important;
      }
      /deep/ .el-pagination__total {
        color: white;
      }
      /deep/ .el-pagination__jump {
        color: white;
      }
    }
    .box-card {
      background-color: rgba(0, 0, 0, 0.6);
      border: 1px solid rgba(32, 160, 255, 0.6);
      color: white;
    }
    .menu_Top {
      background: rgba(0, 0, 0, 0.5);
      width: 100%;
      height: 6%;
      padding: 1%;
      position: absolute;
      z-index: 40;
    }
    .menu_Popup {
      background: rgba(0, 0, 0, 0.6);
      width: 60%;
      height: 45%;
      left: 20%;
      bottom: 5%;
      position: absolute;
      z-index: 40;
    }
  }
}
.pathAnalysisBox {
  width: 412px;
// /deep/
// /deep/ .el-input__inner {
//   background: rgba(255, 255, 255, 0.2) !important;
//   color: white !important;
// }
  z-index: 40;
  position: absolute;
  right: 1%;
  bottom: 1%;
}
.coordLocalBox {
  width: 350px;
  height: 370px;
  z-index: 40;
  position: absolute;
  right: 1%;
  bottom: 1%;
}
.toponymicLocalBox {
  width: 750px;
  height: 450x;
  z-index: 40;
  position: absolute;
  right: 1%;
  bottom: 1%;
}
.box-card {
  background-color: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(32, 160, 255, 0.6);
  color: white;
}
.box-body {
  padding: 18px;
}
/deep/ .el-form-item__label {
  color: white !important;
}
/deep/ .el-input__inner {
  background: rgba(255, 255, 255, 0.2) !important;
  color: white !important;
}
// ::v-deep .el-table,
// .el-table__expanded-cell {
//   background-color: transparent;
//   color: white;
// }
::v-deep .el-table,
.el-table__expanded-cell {
  background-color: transparent;
  color: white;
}
// ::v-deep .el-table tr {
//   background-color: transparent !important;
// }
// ::v-deep .el-table tbody tr:hover > td {
//   background-color: rgba(255, 255, 255, 0.2) !important;
// }
// ::v-deep .el-table–enable-row-transition .el-table__body td,
// .el-table .cell {
//   background-color: transparent !important;
// }
// ::v-deep .el-table th.el-table__cell {
//   background-color: transparent !important;
//   color: white;
// }
// ::v-deep .el-pager li {
//   background-color: transparent !important;
//   color: white;
// }
// ::v-deep .btn-prev {
//   background-color: transparent !important;
// }
// ::v-deep .btn-next {
//   background-color: transparent !important;
//   color: white !important;
// }
// ::v-deep .el-pagination__total {
//   color: white;
// }
// ::v-deep .el-pagination__jump {
//   color: white;
// }
// .center {
//   left: 1%;
// }
// .CenDiv {
//   position: absolute;
//   bottom: 1%;
//   height: 40px;
//   width: 60px;
//   z-index: 101;
//   display: flex;
//   flex-direction: column;
//   justify-content: space-between;
//   box-shadow: 3px 3px 6px #666;
//   border: 1px solid rgba(204, 204, 204, 0.76);
//   border-radius: 5px;
//   cursor: pointer;
// }
// .center1 {
//   right: 1%;
// }
// .right {
//   position: absolute;
//   top: 50px;
//   right: 0;
//   width: 20%;
//   height: calc(100% - 50px);
::v-deep .el-table tr {
  background-color: transparent !important;
}
::v-deep .el-table tbody tr:hover > td {
  background-color: rgba(255, 255, 255, 0.2) !important;
}
::v-deep .el-table–enable-row-transition .el-table__body td,
.el-table .cell {
  background-color: transparent !important;
}
::v-deep .el-table th.el-table__cell {
  background-color: transparent !important;
  color: white;
}
::v-deep .el-pager li {
  background-color: transparent !important;
  color: white;
}
::v-deep .btn-prev {
  background-color: transparent !important;
}
::v-deep .btn-next {
  background-color: transparent !important;
  color: white !important;
}
::v-deep .el-pagination__total {
  color: white;
}
::v-deep .el-pagination__jump {
  color: white;
}
.center {
  left: 1%;
}
.CenDiv {
  position: absolute;
  bottom: 1%;
  height: 40px;
  width: 60px;
  z-index: 101;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 3px 3px 6px #666;
  border: 1px solid rgba(204, 204, 204, 0.76);
  border-radius: 5px;
  cursor: pointer;
}
.center1 {
  right: 1%;
}
.right {
  position: absolute;
  top: 50px;
  right: 0;
  width: 20%;
  height: calc(100% - 50px);
//   display: flex;
//   flex-direction: column;
//   justify-content: space-between;
// }
// .CenDiv:hover {
//   border: 1px solid #409eff;
// }
// .active {
//   width: 100%;
//   height: 100%;
//   background: url('../assets/img/Layer/imgLayer2.png') no-repeat center;
//   position: absolute;
//   background-size: 100% 100%;
//   border-radius: 5px;
// }
// .menuLayer {
//   width: 100%;
//   height: 100%;
//   background: url('../assets/img/Layer/imgLayer1.png') no-repeat center;
//   position: absolute;
//   background-size: 100% 100%;
//   border-radius: 5px;
// }
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.CenDiv:hover {
  border: 1px solid #409eff;
}
.active {
  width: 100%;
  height: 100%;
  background: url('../assets/img/Layer/imgLayer2.png') no-repeat center;
  position: absolute;
  background-size: 100% 100%;
  border-radius: 5px;
}
.menuLayer {
  width: 100%;
  height: 100%;
  background: url('../assets/img/Layer/imgLayer1.png') no-repeat center;
  position: absolute;
  background-size: 100% 100%;
  border-radius: 5px;
}
// .menuSelect .el-input__inner {
//   background: rgba(255, 255, 255, 0.2) !important;
//   color: white !important;
//   border: 1px solid rgba(255, 255, 255, 0.2) !important;
// }
</style>