quanyawei
2024-09-06 60e16bd5406c4cbdf61bf20a50e8e1b49a45b2aa
src/views/list/road.vue
@@ -28,9 +28,6 @@
        <a-button type="primary" style="margin-left: 10px" @click="selectCheck"
          >校验</a-button
        >
        <a-button type="primary" style="margin-left: 10px" @click="reosurce"
          >添加路段信息</a-button
        >
      </div>
      <div class="left-five">
        <a-input
@@ -44,12 +41,6 @@
        <a-button type="primary" style="margin-left: 10px" @click="clearPolygon"
          >清除绘制</a-button
        >
        <a-button
          type="primary"
          style="margin-left: 10px"
          @click="showAllPolygon"
          >显示所有矩形</a-button
        >
      </div>
      <div class="left-two">
        <a-table
@@ -62,6 +53,15 @@
        ></a-table>
      </div>
      <div class="left-three" style="margin-top: 20px">
        <a-button type="primary" style="margin-left: 10px" @click="reosurce"
          >添加路段信息</a-button
        >
        <a-button
          type="primary"
          style="margin-left: 10px"
          @click="showAllPolygon"
          >显示所有矩形</a-button
        >
        <a-button
          v-show="upa === ''"
          type="primary"
@@ -317,16 +317,10 @@
  private opRender(text: string, record: any, index: number) {
    return (
      <div style="width:180px">
      <div style="width:180px;text-align:left">
        <a onClick={() => this.handleEditModalVisible(record)}> 编辑 </a>
        <a-divider type="vertical" />
        <a onClick={() => this.handleEditbatch(record)}> 批量添加 </a>
        <a-divider type="vertical" />
        <a onClick={() => this.canvasbatch(record)}> 绘制批量添加 </a>
        <a-divider type="vertical" />
        <a onClick={() => this.handleEditCanves(record)}> 添加矩形 </a>
        <a-divider type="vertical" />
        <a onClick={() => this.handleShowPolygon(record)}> 显示矩形 </a>
        <a-divider type="vertical" />
        <a-popconfirm
          title="确认删除吗?"
@@ -336,6 +330,12 @@
        >
          <a href="#">删除</a>
        </a-popconfirm>
        <br></br>
        <a onClick={() => this.canvasbatch(record)}> 绘制批量添加 </a>
        <a-divider type="vertical" />
        <a onClick={() => this.handleEditCanves(record)}> 添加矩形 </a>
        <br></br>
        <a onClick={() => this.handleShowPolygon(record)}> 显示矩形 </a>
      </div>
    );
  }
@@ -386,16 +386,24 @@
  }
  // 显示所有矩形
  showAllPolygon() {
    console.log("this.dataSource", this.dataSource);
    this.dataSource.forEach((item: any) => {
      if (item.bdValues) {
        let pointList = item.bdValues.map((item: any) => {
          return new BMapGL.Point(item.lng, item.lat);
        });
        let polygon = new BMapGL.Polygon([...pointList]);
        console.log("polygon", polygon);
        this.map.addOverlay(polygon);
      }
    let macType = null;
    if (this.carvalue !== "请选择走航车") {
      macType = this.carvalue;
    }
    get("coordinate/selectCruiserRoad", {
      name: "",
      mac: macType,
    }).then((res) => {
      res.data.data.forEach((item: any) => {
        if (item.bdValues) {
          let pointList = item.bdValues.map((item: any) => {
            return new BMapGL.Point(item.lng, item.lat);
          });
          let polygon = new BMapGL.Polygon([...pointList]);
          console.log("polygon", polygon);
          this.map.addOverlay(polygon);
        }
      });
    });
  }
  // 显示矩形
@@ -435,7 +443,6 @@
        flylat: currentCoord[1],
      });
    });
    console.log("data", data);
    this.check = false;
    this.startstate = "batch";
    post("coordinateDetail/batch", {