管道基础大数据平台系统开发-【前端】-新系統界面
src/components/mapsdk.vue
@@ -97,6 +97,44 @@
        </el-card>
      </div>
      <div
        class="terrainLevelBox"
        v-if="showTerrainLevelDialog"
      >
        <el-card class="box-card">
          <div slot="header">
            <span>地形平整</span>
            <div style="float: right; cursor: pointer">
              <i
                class="el-icon-close"
                @click="closeBufferBox(5)"
              ></i>
            </div>
          </div>
          <div class="box-body">
            <el-form
              ref="form"
              :model="terrainFrom"
              label-width="100px"
            >
              <el-form-item label="平整高度:">
                <el-input v-model="terrainFrom.height"></el-input>
              </el-form-item>
              <el-form-item>
                <el-button
                  @click="drawTerrainLevel"
                  type="parmary"
                >绘制</el-button>
                <el-button
                  @click="clearTerrainLevel"
                  type="info"
                >清除</el-button>
              </el-form-item>
            </el-form>
          </div>
        </el-card>
      </div>
      <div
        class="toponymicLocalBox"
        v-if="showToponymicLocalBoxDialog"
      >
@@ -141,12 +179,19 @@
                type="index"
                label="序号"
              />
              <el-table-column prop="name" align="center" label="地名">
              <el-table-column
                prop="name"
                align="center"
                label="地名"
              >
                <template slot-scope="scope">
                  <el-button
                      @click="handleLocation(scope.$index, scope.row)"
                      size="small"
                  >{{scope.row.name}}<i class="el-icon-place" style="padding-left: 5px"></i></el-button>
                  >{{scope.row.name}}<i
                      class="el-icon-place"
                      style="padding-left: 5px"
                    ></i></el-button>
                </template>
              </el-table-column>
<!--              <el-table-column-->
@@ -260,9 +305,39 @@
              v-bind:class="{ active: isActive, menuLayer: isMenuLayer }"
          ></div>
        </div>
        <div @click="changeMapType" class="changeMapType">
          <div id="cenBg" :class="show2DMap ? 'mapTypeTwo' : 'mapTypeThree'"></div>
        <div
          @click="changeMapType"
          class="changeMapType"
        >
          <div
            id="cenBg"
            :class="show2DMap ? 'mapTypeTwo' : 'mapTypeThree'"
          ></div>
        </div>
      </div>
      <div
        class="lengend"
        v-show="showLengendDialog"
      >
        <el-card class="box-card">
          <!-- <div
            class="lengend_color"
            style="height:205px"
          >
          </div> -->
          <div class="lengendBox">
            <div class="lengendSpan">
              <div style="left:10px">0°</div>
              <div style="align-self: flex-end;left:10px; position: absolute;
          bottom: 8%; ">70°</div>
            </div>
            <div
              class="lengend_color"
              style="height:205px; width:30px "
            ></div>
          </div>
        </el-card>
      </div>
<!--      <div-->
<!--        @click="changeMenulayer"-->
@@ -375,13 +450,16 @@
      isMenuLayer: true,
      selFrom: {},
      selectTree: null,
      showTerrainLevelDialog: false,
      menuList: [],
      defaultProps: {
        children: "children",
        label: "label",
      }, //树绑定对象
      show2DMap:false,
      terrainFrom: {
        height: '10'
      }, showLengendDialog: false,
    };
  },
  mounted() {
@@ -394,6 +472,28 @@
    });
  },
  methods: {
    drawTerrainLevel() {
      this.clearTerrainLevel()
      var deep = parseFloat(this.terrainFrom.height)
      sgworld.Creator.createSimpleGraphic(
        'polygon',
        {
          clampToGround: true,
        },
        function (entity) {
          var positions = entity.polygon.hierarchy.getValue().positions;
          sgworld.Creator.SimpleGraphic.remove(entity.id);
          window.TerrainFlattening = sgworld.Creator.createTerrainModifier("地形压平", positions, deep, {});
        }
      );
    },
    clearTerrainLevel() {
      if (window.TerrainFlattening) {
        window.TerrainFlattening && window.TerrainFlattening.remove();
      }
    },
    init3DMap() {
      var webKey = "94a34772eb88317fcbf8428e10448561";
@@ -544,6 +644,23 @@
            this.closeBufferBox(4);
          }
        }
      } else if (res.name == "Trrain") {
        switch (res.id) {
          case "d10":
            this.showTerrainLevelDialog = !this.showTerrainLevelDialog;
            this.clearTerrainLevel();
            break;
        }
      } else if (res.name == "Lengend") {
        switch (res.id) {
          case "d2":
            this.showLengendDialog = res.vshow;
            break;
        }
      }
    },
    handleSizeChange(val) {
@@ -628,7 +745,10 @@
        case 4:
          this.showPathAnalysisBoxDialog = false;
          this.clearPathAll(3);
          break;
        case 5:
          this.showTerrainLevelDialog = false;
          this.clearTerrainLevel()
          break;
      }
    },
@@ -944,7 +1064,7 @@
      height: 450x;
      z-index: 40;
      position: absolute;
      right: 6%;
      right: 8%;
      bottom: 1%;
    }
    .bufferBox {
@@ -960,15 +1080,23 @@
      height: 370px;
      z-index: 40;
      position: absolute;
      right: 6%;
      right: 8%;
      bottom: 1%;
    }
    .terrainLevelBox {
      width: 350px;
      height: 370px;
      z-index: 40;
      position: absolute;
      right: 8%;
      bottom: -11%;
    }
    .pathAnalysisBox {
      width: 412px;
      z-index: 40;
      position: absolute;
      right: 6%;
      right: 8%;
      bottom: 1%;
    }
@@ -995,6 +1123,35 @@
      bottom: 5%;
      position: absolute;
      z-index: 40;
    }
    .lengend {
      width: 80px;
      z-index: 40;
      position: absolute;
      right: 8%;
      bottom: 1%;
      .lengendBox {
        width: 100%;
        height: 100%;
        display: flex;
        .lengendSpan {
          flex-direction: column;
          align-items: center;
          justify-content: space-between;
        }
        .lengend_color {
          background-image: linear-gradient(
            #0055ff,
            #2448da,
            #483cb6,
            #6d3091,
            #91246d,
            #b61848,
            #da0c24
          );
        }
      }
    }
  }
}
@@ -1104,17 +1261,17 @@
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 3px 3px 6px #666;
  // box-shadow: 3px 3px 6px #666;
  //border: 1px solid rgba(204, 204, 204, 0.76);
  border-radius: 5px;
  background: #fff;
  cursor: pointer;
}
.mapTypeTwo{
  width: 100%;
  height: 100%;
  margin-left: 10px;
  background-image: url("../assets/img/3dmap.png");
  background-image: url("../assets/img/synthesis/3D.png");
  background-repeat: no-repeat;
  background-size: contain;
}
@@ -1122,7 +1279,7 @@
  width: 100%;
  height: 100%;
  margin-left: 10px;
  background-image: url("../assets/img/2dmap.png");
  background-image: url("../assets/img/synthesis/2D 拷贝 2.png");
  background-repeat: no-repeat;
  background-size: contain;
}