管道基础大数据平台系统开发-【前端】-新系統界面
Surpriseplus
2022-12-21 a7311a5147d0f2190e2f62728cb652a0f721dd7a
src/components/mapsdk.vue
@@ -75,7 +75,7 @@
                ></el-input>
              </el-form-item>
              <el-form-item>
                <el-button type="info">查询</el-button>
                <el-button @click="setQueryTable" type="info">查询</el-button>
              </el-form-item>
            </el-form>
            <el-table :data="tableData" height="200px" style="width: 100%">
@@ -122,10 +122,11 @@
          </div>
          <div class="box-body">
            <el-form ref="form" :model="pathFrom" label-width="50px">
              <el-form-item label="经度:">
              <el-form-item label="起点:">
                <el-input
                  style="width: 300px"
                  style="width: 250px"
                  v-model="pathFrom.lon"
                  :disabled="true"
                ></el-input>
                <el-link
                  :underline="false"
@@ -134,10 +135,11 @@
                  ><i style="color: white" class="el-icon-plus"></i
                ></el-link>
              </el-form-item>
              <el-form-item label="纬度:">
              <el-form-item label="终点:">
                <el-input
                  style="width: 300px"
                  style="width: 250px"
                  v-model="pathFrom.lat"
                  :disabled="true"
                ></el-input>
                <el-link
                  :underline="false"
@@ -197,8 +199,8 @@
      showPathAnalysisBoxDialog: false,
      comprehensive: {},
      pathFrom: {
        lon: '116.086746,39.937314',
        lat: '116.086000,39.936289',
        lon: ' ',
        lat: ' ',
      },
      bufFrom: {
        val: 50,
@@ -227,56 +229,7 @@
      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',
            },
          ],
        },
      ],
      menuList: [],
      defaultProps: {
        children: 'children',
        label: 'label',
@@ -299,62 +252,58 @@
      });
      window.Viewer = window.sgworld._Viewer;
      Viewer.imageryLayers._layers[0].show = false;
      //定位
      sgworld.Navigate.jumpTo({
        //跳转视角
        destination: new Cesium.Cartesian3.fromDegrees(
          116.055913,
          39.937685,
          8000
          116.3911,
          39.9115,
          100000
        ),
      });
      Viewer.imageryLayers.addImageryProvider(
        new Cesium.WebMapTileServiceImageryProvider({
          url: 'http://t0.tianditu.com/vec_w/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER=vec&tileMatrixSet=w&TileMatrix={TileMatrix}&TileRow={TileRow}&TileCol={TileCol}&style=default&format=tiles&tk=94a34772eb88317fcbf8428e10448561',
          layer: 'tdtVecBasicLayer',
          style: 'default',
          format: 'image/jpeg',
          tileMatrixSetID: 'GoogleMapsCompatible',
          show: false,
        })
      );
      // Viewer.imageryLayers.addImageryProvider(
      //   new Cesium.WebMapTileServiceImageryProvider({
      //     url: 'http://t0.tianditu.com/vec_w/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER=vec&tileMatrixSet=w&TileMatrix={TileMatrix}&TileRow={TileRow}&TileCol={TileCol}&style=default&format=tiles&tk=94a34772eb88317fcbf8428e10448561',
      //     layer: 'tdtVecBasicLayer',
      //     style: 'default',
      //     format: 'image/jpeg',
      //     tileMatrixSetID: 'GoogleMapsCompatible',
      //     show: false,
      //   })
      // );
      Viewer.imageryLayers.addImageryProvider(
        new Cesium.WebMapTileServiceImageryProvider({
          url: 'http://t0.tianditu.com/img_w/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER=img&tileMatrixSet=w&TileMatrix={TileMatrix}&TileRow={TileRow}&TileCol={TileCol}&style=default&format=tiles&tk=94a34772eb88317fcbf8428e10448561',
          layer: 'tdtBasicLayer',
          style: 'default',
          format: 'image/jpeg',
          tileMatrixSetID: 'GoogleMapsCompatible',
          show: false,
        })
      );
      Viewer.imageryLayers.addImageryProvider(
        new Cesium.WebMapTileServiceImageryProvider({
          url: 'http://t0.tianditu.com/cva_w/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER=cva&tileMatrixSet=w&TileMatrix={TileMatrix}&TileRow={TileRow}&TileCol={TileCol}&style=default.jpg&tk=94a34772eb88317fcbf8428e10448561',
          layer: 'tdtAnnoLayer',
          style: 'default',
          format: 'image/jpeg',
          tileMatrixSetID: 'GoogleMapsCompatible',
        })
      );
      // Viewer.imageryLayers.addImageryProvider(
      //   new Cesium.WebMapTileServiceImageryProvider({
      //     url: 'http://t0.tianditu.com/img_w/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER=img&tileMatrixSet=w&TileMatrix={TileMatrix}&TileRow={TileRow}&TileCol={TileCol}&style=default&format=tiles&tk=94a34772eb88317fcbf8428e10448561',
      //     layer: 'tdtBasicLayer',
      //     style: 'default',
      //     format: 'image/jpeg',
      //     tileMatrixSetID: 'GoogleMapsCompatible',
      //     show: false,
      //   })
      // );
      // Viewer.imageryLayers.addImageryProvider(
      //   new Cesium.WebMapTileServiceImageryProvider({
      //     url: 'http://t0.tianditu.com/cva_w/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER=cva&tileMatrixSet=w&TileMatrix={TileMatrix}&TileRow={TileRow}&TileCol={TileCol}&style=default.jpg&tk=94a34772eb88317fcbf8428e10448561',
      //     layer: 'tdtAnnoLayer',
      //     style: 'default',
      //     format: 'image/jpeg',
      //     tileMatrixSetID: 'GoogleMapsCompatible',
      //   })
      // );
      // sgworld.Navigate.jumpTo({
      //   //跳转视角
      //   destination: {
      //     x: 311837.3471863137,
      //     y: 5628280.936629815,
      //     z: 2992581.921482893,
      //   },
      //   orientation: {
      //     heading: 2.5028896264234364,
      //     pitch: -0.2201285642360813,
      //     roll: 0.0,
      //   },
      // });
      for (var i in gaoDeBaseUrl) {
        sgworld.Creator.createUrlTemplateImageryProvider(
          gaoDeBaseUrl[i].label,
          gaoDeBaseUrl[i].url,
          '0',
          undefined,
          true,
          ''
        );
      }
      // Viewer.scene.globe.depthTestAgainstTerrain = true;
      Viewer._enableInfoOrSelection = false;
      //显示fps
      Viewer.scene.debugShowFramesPerSecond = false;
@@ -362,29 +311,31 @@
      window.sgworld.navControl('nav', false);
      //比例尺
      window.sgworld.navControl('scale', false);
      //开启深度检测
      sgworld.Analysis.depthTestAgainstTerrain(true);
      //影像对比设置
      var base = {
        url: 'https://a.tile.openstreetmap.org/',
      };
      window.openStreetMap = sgworld.Creator.createImageryProvider(
        'OpenStreetMap',
        'OpenStreetMap',
        base,
        '0',
        undefined,
        true,
        ''
      );
      openStreetMap.item.show = false;
      // var base = {
      //   url: 'https://a.tile.openstreetmap.org/',
      // };
      // window.openStreetMap = sgworld.Creator.createImageryProvider(
      //   'OpenStreetMap',
      //   'OpenStreetMap',
      //   base,
      //   '0',
      //   undefined,
      //   true,
      //   ''
      // );
      // openStreetMap.item.show = false;
      //mpt加载
      var option = {
        url: window.sceneConfig.mpt.url,
        layerName: window.sceneConfig.mpt.name,
        requestVertexNormals: true,
      };
      // sgworld.Creator.sfsterrainprovider('mpt', option, '', true, '');
      sgworld.Creator.sfsterrainprovider('mpt', option, '', true, '');
      window.elevationTool = new SmartEarth.ElevationTool(window.sgworld);
      elevationTool.setContourColor('#F1D487');
    },
    changeMenulayer() {
@@ -394,11 +345,13 @@
    },
    setLayerVisible() {
      if (this.isActive == true) {
        Viewer.imageryLayers.get(1).show = true;
        Viewer.imageryLayers.get(2).show = false;
        Viewer.imageryLayers._layers[1].show = true;
        Viewer.imageryLayers._layers[2].show = false;
        Viewer.imageryLayers._layers[3].show = false;
      } else {
        Viewer.imageryLayers.get(1).show = false;
        Viewer.imageryLayers.get(2).show = true;
        Viewer.imageryLayers._layers[1].show = false;
        Viewer.imageryLayers._layers[2].show = true;
        Viewer.imageryLayers._layers[3].show = true;
      }
    },
    //显示弹窗
@@ -428,6 +381,11 @@
    },
    handleCurrentChange(val) {
      this.listData.pageIndex = val;
      this.getToponymicData();
    },
    setQueryTable() {
      this.listData.pageSize = 10;
      this.listData.pageIndex = 1;
      this.getToponymicData();
    },
    async getToponymicData() {
@@ -571,7 +529,8 @@
        }
        var jsonurl =
          'http://192.168.20.39:9055/gisserver/wnsserver/beijingdaohang_wns?start=' +
          wnsUrl +
          '?start=' +
          this.pathFrom.lon +
          '&end=' +
          this.pathFrom.lat +
@@ -823,12 +782,14 @@
    }
    .box-card {
      background-color: rgba(0, 0, 0, 0.6);
      background: #303030;
      opacity: 0.85;
      border: 1px solid rgba(32, 160, 255, 0.6);
      color: white;
    }
    .menu_Top {
      background: rgba(0, 0, 0, 0.5);
      background: #303030;
      opacity: 0.85;
      width: 100%;
      height: 6%;
      padding: 1%;
@@ -836,7 +797,8 @@
      z-index: 40;
    }
    .menu_Popup {
      background: rgba(0, 0, 0, 0.6);
      background: #303030;
      opacity: 0.85;
      width: 60%;
      height: 45%;
@@ -894,53 +856,54 @@
// .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);
.CenDiv {
  position: absolute;
  bottom: 1%;
  left: 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;