From 75c45150bcc5b1a3b45efe98ce6ec92b7b10aba3 Mon Sep 17 00:00:00 2001
From: quanyawei <401863037@qq.com>
Date: Fri, 06 Sep 2024 11:14:40 +0800
Subject: [PATCH] fix: 责任单位修改
---
src/views/list/road.vue | 114 ++++++++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 105 insertions(+), 9 deletions(-)
diff --git a/src/views/list/road.vue b/src/views/list/road.vue
index ea2465c..43fa29d 100644
--- a/src/views/list/road.vue
+++ b/src/views/list/road.vue
@@ -53,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"
@@ -308,12 +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-popconfirm
title="������������������"
@@ -323,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>
);
}
@@ -371,9 +384,58 @@
// this.selectCar()
});
}
+ // ������������������
+ showAllPolygon() {
+ 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);
+ }
+ });
+ });
+ }
+ // ������������
+ handleShowPolygon(record: any) {
+ console.log(record);
+ if (record.bdValues) {
+ let pointList = record.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);
+ }
+ }
+ // ������������
+ private handleEditCanves(record: any) {
+ console.log("this.turfPolygon", this.turfPolygon);
+ if (this.roadbaiduPolygon.length > 0) {
+ post("coordinate/updateCruiserRoad", {
+ coordinateId: record.coordinateId,
+ bdValue: this.roadbaiduPolygon,
+ value: this.road84Polygon,
+ }).then((res) => {
+ this.$message.success("������������");
+ this.selectLu();
+ });
+ } else {
+ this.$message.warning("���������������");
+ }
+ }
private canvasbatch(record: any) {
let ptsWithin = turf.pointsWithinPolygon(this.multiPt, this.turfPolygon);
- console.log("ptsWithin", ptsWithin);
let data: { flylon: number; flylat: number }[] = [];
turf.coordEach(ptsWithin, (currentCoord) => {
data.push({
@@ -504,7 +566,20 @@
// console.log(this.carDate,'this.carDate');
this.carDate = [];
this.pointshow = false;
+ this.map.removeOverlay();
this.setMarker(res);
+ });
+ }
+ reosurce() {
+ console.log("this.timevalue", this.timevalue);
+ post("coordinateDetail/queryAll", {
+ mac: this.carvalue,
+ time1: this.timevalue[0],
+ time2: this.timevalue[1],
+ }).then((res) => {
+ console.log(res.data.data, "res");
+ this.$message.success("������������");
+ // console.log(this.carDate,'this.carDate');
});
}
private markerdata: any = [];
@@ -535,9 +610,20 @@
};
private actNav: String = "";
private clearPolygon() {
+ //������������overlays
+ let overlays = this.map.getOverlays();
this.drawingManager.clearOverlays();
+ //���������Marker������������Label������
+ overlays.forEach((overlay: any) => {
+ if (overlay.toString() === "Polygon") {
+ this.map.removeOverlay(overlay);
+ }
+ });
+ // this.map.clearOverlays();
}
private turfPolygon: any = null;
+ private roadbaiduPolygon: any = [];
+ private road84Polygon: any = [];
private draw(drawingType: String) {
console.log("new BMapGLLib", this.drawingManager);
this.actNav = drawingType;
@@ -557,13 +643,15 @@
const polygon = e.overlay;
// ���������������������������
const polygonPoints = polygon.getPath();
- console.log("polygonPoints1", polygonPoints);
+ this.roadbaiduPolygon = polygonPoints;
let transformationPoints = polygonPoints.map((coord: any) => {
const [x, y] = [coord.lng, coord.lat];
const [lng1, lat1] = coordtransform.bd09togcj02(x, y);
const [lng2, lat2] = coordtransform.gcj02towgs84(lng1, lat1);
return { lng: lng2, lat: lat2 };
});
+
+ this.road84Polygon = transformationPoints;
console.log("polygonPoints2", transformationPoints);
this.turfPolygon = turf.polygon([
transformationPoints.map((item: any) => [item.lng, item.lat]),
@@ -612,21 +700,27 @@
);
bPoints.push(statePoint);
if (i === 0) {
- that.marker[i] = new BMapGL.Marker(statePoint, { icon: startIcon });
+ that.marker[i] = new BMapGL.Marker(statePoint, {
+ icon: startIcon,
+ });
that.marker[i].customData = {
data: that.carDate[i].data,
state: that.carDate[i].state,
};
that.marker[i].iconPng = "startIcon";
} else if (i === that.carDate.length - 1) {
- that.marker[i] = new BMapGL.Marker(statePoint, { icon: endIcon });
+ that.marker[i] = new BMapGL.Marker(statePoint, {
+ icon: endIcon,
+ });
that.marker[i].customData = {
data: that.carDate[i].data,
state: that.carDate[i].state,
};
that.marker[i].iconPng = "endIcon";
} else {
- that.marker[i] = new BMapGL.Marker(statePoint, { icon: myIcon });
+ that.marker[i] = new BMapGL.Marker(statePoint, {
+ icon: myIcon,
+ });
that.marker[i].customData = {
data: that.carDate[i].data,
state: that.carDate[i].state,
@@ -717,7 +811,9 @@
// console.log(statePoint,'statePoint');
aPoints.push(statePoint);
//���marker���������data��������� ������������������
- that.markerdata[i] = new BMapGL.Marker(statePoint, { icon: myIcon });
+ that.markerdata[i] = new BMapGL.Marker(statePoint, {
+ icon: myIcon,
+ });
that.markerdata[i].customData = {
data: that.carDataList[i].code,
state: that.carDataList[i].state,
--
Gitblit v1.8.0