From 68ce9382090846dc3a03a057a18a7d09f30e45e5 Mon Sep 17 00:00:00 2001
From: cuiqian2004 <cuiqian2004@163.com>
Date: 星期五, 17 十月 2025 17:39:03 +0800
Subject: [PATCH] test

---
 pages/map/js/ctx.js |  219 ++++++++++++------------------
 pages/map/scene.vue |   46 ++++-
 pages/map/index.vue |  132 +++++++++++++-----
 manifest.json       |    4 
 4 files changed, 222 insertions(+), 179 deletions(-)

diff --git a/manifest.json b/manifest.json
index 9cad931..6e2ede5 100644
--- a/manifest.json
+++ b/manifest.json
@@ -2,8 +2,8 @@
     "name" : "ES-GO",
     "appid" : "__UNI__C988375",
     "description" : "",
-    "versionName" : "1.3.6",
-    "versionCode" : 136,
+    "versionName" : "1.3.9",
+    "versionCode" : 139,
     "transformPx" : false,
     /* 5+App鐗规湁鐩稿叧 */
     "app-plus" : {
diff --git a/pages/map/index.vue b/pages/map/index.vue
index 1c35489..7c03354 100644
--- a/pages/map/index.vue
+++ b/pages/map/index.vue
@@ -394,31 +394,31 @@
 				<uni-popup-dialog type="info" cancelText="鍙栨秷" confirmText="纭畾" title="绀烘暀鏇存柊"
 					@confirm="dialogTeachingUpdateConfirm" @close="dialogTeachingUpdateClose">
 
-					<view>
-
-						<radio-group @change="radioTeachinMainRoadChange">
-							<label class="radio">
-								<radio :value="1" :checked="selectTeachingMode.main_road == 1" />涓昏矾
-							</label>
-							<label class="radio">
-								<radio :value="0" :checked="selectTeachingMode.main_road != 1" />鏀矾
-							</label>
-						</radio-group>
+					<view class="popup-dialog-content">
+						<view class="popup-content-item">
+							<radio-group @change="radioTeachinMainRoadChange">
+								<label class="radio">
+									<radio :value="1" :checked="selectTeachingMode.main_road == 1" />涓昏矾
+								</label>
+								<label class="radio">
+									<radio :value="0" :checked="selectTeachingMode.main_road != 1" />鏀矾
+								</label>
+							</radio-group>
 
 
+						</view>
+						<view class="popup-content-item">
+							<radio-group @change="radioTeachinBidirectionChange">
+								<label class="radio">
+									<radio :value="1" :checked="selectTeachingMode.bidirection == 1" />鍙屽悜
+								</label>
+								<label class="radio">
+									<radio :value="0" :checked="selectTeachingMode.bidirection != 1" />鍗曞悜
+								</label>
+							</radio-group>
+
+						</view>
 					</view>
-					<view>
-						<radio-group @change="radioTeachinBidirectionChange">
-							<label class="radio">
-								<radio :value="1" :checked="selectTeachingMode.bidirection == 1" />鍙屽悜
-							</label>
-							<label class="radio">
-								<radio :value="0" :checked="selectTeachingMode.bidirection != 1" />鍗曞悜
-							</label>
-						</radio-group>
-
-					</view>
-
 				</uni-popup-dialog>
 			</uni-popup>
 
@@ -520,6 +520,7 @@
 				unlinked: false,
 				showTeachingPathFlag: true,
 				curTeachingPathFlag: false,
+				curTeachingPathTime: 0,
 				curMapInfo: {
 					proportion: 1,
 					img_proportion: 1,
@@ -803,9 +804,7 @@
 								if (this.mapOperationStatus == 'end' || this.mapOperationStatus ==
 									'save') {
 									try {
-										//	await delTeachingMode(this.vehicleIp, [this.teachingModeCur])
-										await deleteSplitTeachingData(this.vehicleIp, this.teachingModeCur
-											.edge_name, this.teachingModeCur.name)
+										await delTeachingMode(this.vehicleIp, [this.teachingModeCur])
 
 										listDataStr.push({
 											method: "remove_teaching_path",
@@ -1193,8 +1192,9 @@
 							name: param.data?.name || "",
 							point: param.point,
 							main_road: param.data?.main_road || 0,
-							bidirection: param.data?.name || 0,
+							bidirection: param.data?.bidirection || 0,
 						}
+						console.log(this.selectTeachingMode.main_road, this.selectTeachingMode)
 					}
 					this.$refs.refPopupOperateTeaching.open("bottom")
 				} else if (param.method == "cancel_positioning_agv") {
@@ -2087,10 +2087,19 @@
 							}
 						})
 						if (list.length > 0) {
+							this.curTeachingPathTime += 1
 							this.curTeachingPathFlag = true
+							if (this.curTeachingPathTime % 5 == 0) {
+								const listStationCtxData = await this.getRefreshStationCtxData() || []
+								if (listStationCtxData.length > 0) {
+									listCtrData.push(...listStationCtxData)
+								}
+							}
 						} else {
 							if (this.curTeachingPathFlag) {
 								this.curTeachingPathFlag = false
+								this.curTeachingPathTime = 0
+
 								const teaching = await this.loadTeachingMode()
 
 								const publicOld = this.teachingMode.Public || []
@@ -2101,8 +2110,8 @@
 								const stationAdd = []
 								for (let i in publicNew) {
 									const item = publicNew[i]
-									const curIndex = publicOld.findIndex((a) => a.name == item.name)
-									console.log(curIndex, item)
+									const curIndex = publicOld.findIndex((a) => a.name == item.name && a.edge_name == item.edge_name )
+									
 									if (curIndex < 0) {
 										publicAdd.push(item)
 										publicOld.push(item)
@@ -2138,6 +2147,10 @@
 											show: this.showTeachingPathFlag
 										}
 									})
+								}
+								const listStationCtxData = await this.getRefreshStationCtxData() || []
+								if (listStationCtxData.length > 0) {
+									listCtrData.push(...listStationCtxData)
 								}
 							}
 						}
@@ -2182,7 +2195,45 @@
 				}
 
 			},
+			async getRefreshStationCtxData() {
+				try {
+					const listCtrData = []
+					const listOld = this.stationList
+					const listId = listOld.map((a) => a.stationID)
+					const stationLst = await this.loadStations()
+					const listNew = stationLst.filter((a) => {
+						return !listId.includes(a.stationID)
+					})
+					// console.log(listId.length,listNew.length,stationLst.length)
+					// console.log(listId)
+					if (listId.length + listNew.length > stationLst.length) {
+						const listId2 = stationLst.map((a) => a.stationID)
 
+						const listRemove = listOld.filter((a) => {
+							return !listId2.includes(a.stationID)
+						})
+						if (listRemove.length > 0) {
+							listCtrData.push({
+								method: "remove_station",
+								param: listRemove
+							})
+							this.stationList = stationLst
+						}
+					}
+					if (listNew.length > 0) {
+						listCtrData.push({
+							method: "add_station",
+							param: listNew
+						})
+						this.stationList = stationLst
+					}
+					return listCtrData
+				} catch (ex) {
+
+					showToast(ex)
+					return []
+				}
+			},
 			askTeachingBiDirection(teachingMode) {
 				showModal("閫夋嫨褰撳墠绀烘暀璺嚎绫诲瀷?", "绀烘暀缁撴潫", true, "鍙屽悜璺嚎",
 					"鍗曞悜璺嚎").then((res) => {
@@ -2245,9 +2296,7 @@
 						if (res) {
 							try {
 								this.loading = true
-								//await delTeachingMode(_this.vehicleIp, [_this.teachingModeCur])
-								await deleteSplitTeachingData(_this.vehicleIp, _this.teachingModeCur.edge_name,
-									_this.teachingModeCur.name)
+								await delTeachingMode(_this.vehicleIp, [_this.teachingModeCur])
 								_this.mapOperationStatus = ""
 								const listDataStr = []
 								listDataStr.push({
@@ -2378,7 +2427,8 @@
 						this.teachingModeCur.teaching_flag = 1
 						this.teachingModeCur.mode = "Public"
 						this.teachingModeCur.name = ""
-						const res = await teachingModeFlag(this.vehicleIp, this.teachingModeCur)
+						const res = await teachingModeFlag(this.vehicleIp, this
+							.teachingModeCur)
 						if (val == 1)
 							showToast("宸插皢绀烘暀鍒囨崲鎴愬弻鍚戞ā寮�)
 						else if (val == 2)
@@ -2445,7 +2495,7 @@
 				// 		param: this.selectTeachingMode,
 				// 	}])
 			},
-			radioTeachinMainRoadChange(e) {
+			radioTeachinMainRoadChange(evt) {
 				this.selectTeachingMode.main_road = evt.detail.value
 			},
 			radioTeachinBidirectionChange(evt) {
@@ -2483,7 +2533,8 @@
 					uni.showLoading({
 						title: "鍒犻櫎绀烘暀涓�
 					})
-					await deleteSplitTeachingData(this.vehicleIp, item.edge_name, item.name)
+					await deleteSplitTeachingData(this.vehicleIp, item
+						.edge_name, item.name)
 					//await delTeachingMode(this.vehicleIp, [item])
 					this.ctxDataStr =
 						JSON.stringify(
@@ -2504,8 +2555,7 @@
 					uni.showLoading({
 						title: "鍒犻櫎绀烘暀鏁版嵁涓�
 					})
-					await deleteSplitTeachingData(this.vehicleIp, data.edge_name, data.name)
-					//await delTeachingModeData(this.vehicleIp, data)
+					await delTeachingModeData(this.vehicleIp, data)
 					showToast("鍒犻櫎绀烘暀鎴愬姛")
 					this.reloadTeachingMode()
 				} catch (ex) {
@@ -2950,6 +3000,7 @@
 						height: 32px;
 						line-height: 32px;
 						text-align: center;
+						box-shadow: 0px 2px 8px 0px #0000000C;
 					}
 
 					.switch-button-checked {
@@ -2978,6 +3029,15 @@
 			background-color: transparent;
 		}
 
+		.popup-dialog-content {
+			display: flex;
+			flex-direction: column;
+
+			.popup-content-item {
+				padding: 10rpx;
+			}
+		}
+
 		.popup-content-menu {
 			margin-top: 140rpx;
 			margin-left: 225rpx;
diff --git a/pages/map/js/ctx.js b/pages/map/js/ctx.js
index 7479ccf..aeca5a2 100644
--- a/pages/map/js/ctx.js
+++ b/pages/map/js/ctx.js
@@ -1268,6 +1268,7 @@
 			}
 		},
 		clearObjects() {
+			
 			if (!this.canvas) return;
 			this.canvas.discardActiveObject()
 			const objects = this.canvas.getObjects()
@@ -1283,6 +1284,8 @@
 			this.objEditing = null;
 			this.editObject = null;
 			this.drawingObj = null;
+			this.objAgvLaser = null
+			this.objAgvLaserLine = null
 			if (this.pressObjTimer) {
 				clearTimeout(this.pressObjTimer);
 				this.pressObjTimer = null;
@@ -2063,9 +2066,6 @@
 				}
 			})
 			let path2 = ""
-			const theta = 20;
-			let headlen = 10;
-			var main_road = teachingData.main_road || 0
 
 			const len = pos_list.length
 			let fromX = 0,
@@ -2079,33 +2079,7 @@
 					y: this.getYOnImg(pt.y)
 				}
 				if (index > 0) {
-					// if ((index % 50 == 0 || index == len - 1 || index % 50 == 1)) {
-					// 	if (index % 50 == 0 || index == len - 1) {
-					// 		toX = pt2.x
-					// 		toY = pt2.y
-					// 		path2 += ` L${pt2.x} ${pt2.y}`
 
-					// 		// 璁$畻鍚勮搴﹀拰瀵瑰簲鐨凱2,P3鍧愭爣
-					// 		let angle = (Math.atan2(fromY - toY, fromX - toX) * 180) / Math.PI,
-					// 			angle1 = ((angle + theta) * Math.PI) / 180,
-					// 			angle2 = ((angle - theta) * Math.PI) / 180,
-					// 			topX = headlen * Math.cos(angle1),
-					// 			topY = headlen * Math.sin(angle1),
-					// 			botX = headlen * Math.cos(angle2),
-					// 			botY = headlen * Math.sin(angle2);
-					// 		let arrowX = fromX - topX,
-					// 			arrowY = fromY - topY;
-					// 		arrowX = toX + topX;
-					// 		arrowY = toY + topY;
-					// 		path2 += " L " + arrowX + " " + arrowY;
-					// 		arrowX = toX + botX;
-					// 		arrowY = toY + botY;
-					// 		path2 += " M " + arrowX + " " + arrowY;
-					// 		path2 += " L " + toX + " " + toY;
-					// 	}
-					// } else {
-					// 	path2 += ` L${pt2.x} ${pt2.y}`
-					// }
 					path2 += ` L${pt2.x} ${pt2.y}`
 				} else {
 					path2 = `M${pt2.x} ${pt2.y}`
@@ -2116,9 +2090,7 @@
 			let strokeWidth = 5
 			let stroke = "#69C0FF"
 
-			// if (main_road == 1) {
-			// 	stroke = "#69C0FF"
-			// }
+
 			const objPath = new fabric.Path(
 				path2, {
 					id: "current_teaching",
@@ -2154,7 +2126,7 @@
 
 			const theta = 20;
 			let headlen = 10;
-			var main_road = teachingData.main_road || 0
+			var main_road = teachingData.main_road 
 
 			const len = pos_list.length
 			let fromX = 0,
@@ -2170,79 +2142,12 @@
 					y: this.getYOnImg(pt.y)
 				}
 				if (index > 0) {
-					// if ((type == "public_teaching") && (index % 50 == 0 || index == len - 1 || index % 50 == 1)) {
-					// 	if (index % 50 == 1 || index == len - 1) {
-					// 		if (teachingData.bidirection == 1 && index < len - 1) { //- 1
-					// 			toY = fromY
-					// 			toX = fromX
-					// 			fromX = pt2.x
-					// 			fromY = pt2.y
-					// 			let angle = (Math.atan2(fromY - toY, fromX - toX) * 180) / Math.PI,
-					// 				angle1 = ((angle + theta) * Math.PI) / 180,
-					// 				angle2 = ((angle - theta) * Math.PI) / 180,
-					// 				topX = headlen * Math.cos(angle1),
-					// 				topY = headlen * Math.sin(angle1),
-					// 				botX = headlen * Math.cos(angle2),
-					// 				botY = headlen * Math.sin(angle2);
-					// 			let arrowX = fromX - topX,
-					// 				arrowY = fromY - topY;
-					// 			arrowX = toX + topX;
-					// 			arrowY = toY + topY;
-					// 			let path3 = " L " + arrowX + " " + arrowY;
-					// 			arrowX = toX + botX;
-					// 			arrowY = toY + botY;
-					// 			path3 += " M " + arrowX + " " + arrowY;
-					// 			path3 += " L " + toX + " " + toY;
-
-					// 			path2 += path3
-					// 			fromY = toY
-					// 			fromX = toX
-					// 		}
-					// 	}
-					// 	if (index % 50 == 0 || index == len - 1) {
-					// 		toX = pt2.x
-					// 		toY = pt2.y
-					// 		// if (fromX == toX && fromY == toY) {
-					// 		// 	if (index - 2 >= 0) {
-					// 		// 		const pt3 = pos_list[index - 2]
-					// 		// 		fromX = this.getXOnImg(pt3.x),
-					// 		// 			fromY = this.getYOnImg(pt3.y)
-					// 		// 	} else {
-					// 		// 		continue;
-					// 		// 	}
-					// 		// }
-					// 		path2 += ` L${pt2.x} ${pt2.y}`
-
-					// 		// 璁$畻鍚勮搴﹀拰瀵瑰簲鐨凱2,P3鍧愭爣
-					// 		let angle = (Math.atan2(fromY - toY, fromX - toX) * 180) / Math.PI,
-					// 			angle1 = ((angle + theta) * Math.PI) / 180,
-					// 			angle2 = ((angle - theta) * Math.PI) / 180,
-					// 			topX = headlen * Math.cos(angle1),
-					// 			topY = headlen * Math.sin(angle1),
-					// 			botX = headlen * Math.cos(angle2),
-					// 			botY = headlen * Math.sin(angle2);
-					// 		let arrowX = fromX - topX,
-					// 			arrowY = fromY - topY;
-					// 		arrowX = toX + topX;
-					// 		arrowY = toY + topY;
-					// 		path2 += " L " + arrowX + " " + arrowY;
-					// 		arrowX = toX + botX;
-					// 		arrowY = toY + botY;
-					// 		path2 += " M " + arrowX + " " + arrowY;
-					// 		path2 += " L " + toX + " " + toY;
-					// 	}
-					// 	//	console.log(`绠ご L${pt2.x} ${pt2.y}`)
-					// } else {
-					// 	//	console.log(`鐐�L${pt2.x} ${pt2.y} ${index} == ${len-1}`)
-					// 	path2 += ` L${pt2.x} ${pt2.y}`
-					// }
+					
 					path2 += ` L${pt2.x} ${pt2.y}`
 				} else {
-					if (pt.main_road)
+					if (main_road === undefined)
 						main_road = pt.main_road
-					// if (main_road == 1) {
-					// 	headlen = 15
-					// }
+				
 					path2 = `M${pt2.x} ${pt2.y}`
 				}
 				fromX = pt2.x
@@ -2271,6 +2176,7 @@
 					}
 				}
 			}
+			teachingData.main_road = main_road
 			let list = this.canvas.getObjects() || []
 			list = list.filter((a) => a.eleType == "station_teaching" || a.eleType == "public_teaching")
 			let lenTeaching = list.length
@@ -2360,7 +2266,7 @@
 			let id = ""
 			if (teachingMode.mode == "Public") {
 				eleType = "public_teaching"
-				id = `public_teaching_${teachingMode.name}`
+				id = `public_teaching_${teachingMode.name}_${teachingMode.edge_name}`
 			} else if (teachingMode.mode == "Stations") {
 				eleType = "station_teaching"
 				id = `station_teaching_${teachingMode.src_dst}`
@@ -3083,48 +2989,97 @@
 				x: this.getXOnImg(param.x),
 				y: this.getYOnImg(param.y)
 			}
+			if (this.objAgvLaser) {
+				this.objAgvLaser.set({stroke: "#00ff00",	rx: 2,
+				ry:2})
+			}
 			let ellipse = new fabric.Ellipse({
 				id: "agv_laser",
 				eleType: "agv_laser",
 				left: pt.x,
 				top: pt.y,
-				rx: 2,
-				ry: 2,
-				stroke: "#00aa00",
+				rx: 3,
+				ry: 3,
+				stroke: "#ff0000",
 				strokeWidth: 1,
-				fill: "#00aa00",
+				fill: "#00ff00",
 				originX: "center",
 				originY: "center",
 				selectable: false,
-				hasControls: true,
-				lockRotation: true,
-				lockScalingX: true,
-				lockScalingY: true,
-				lockMovementX: true,
-				lockMovementY: true,
+				hasControls: false,
+
 			});
 			this.canvas.add(ellipse)
 			const offX = 20 * Math.cos(angle)
 			const offY = 20 * Math.sin(angle)
-
-			if (this.objAgvLaser) {
-				this.canvas.remove(this.objAgvLaser)
+			this.objAgvLaser = ellipse
+			if (this.objAgvLaserLine) {
+				this.canvas.remove(this.objAgvLaserLine)
 			}
 			const line = new fabric.Line([pt.x, pt.y, pt.x + offX,
 				pt.y + offY
 			], {
 				id: "agv_laser_angle",
 				eleType: "agv_laser_angle",
-				stroke: "#00aa00",
+				stroke: "#00ff00",
 				strokeWidth: 1,
-				lockRotation: true,
-				lockScalingX: true,
-				lockScalingY: true,
-				lockMovementX: true,
-				lockMovementY: true,
+				selectable: false,
+				hasControls: false,
 			});
-			this.objAgvLaser = line
+			
+			this.objAgvLaserLine = line
 			this.canvas.add(line)
+		},
+		addTrajectoryPoint(list) {
+			const objs = []
+
+			let right = 0
+			let bottom = 0
+			let left = this.mapInfo.img_x
+			let top = this.mapInfo.img_y
+			for (let i in list) {
+				const pt = list[i]
+				const pt2 = {
+					x: this.getXOnImg(pt[0]),
+					y: this.getYOnImg(pt[1])
+				}
+				let ellipse = new fabric.Ellipse({
+					left: pt2.x,
+					top: pt2.y,
+					rx: 2,
+					ry: 2,
+					stroke: "#00ff00",
+					strokeWidth: 1,
+					fill: "#00ff00",
+					originX: "center",
+					originY: "center",
+				});
+				
+				objs.push(ellipse)
+				if (left > pt2.x-2) {
+					left = pt2.x-2
+				}
+				if (top > pt2.y-2) {
+					top = pt2.y-2
+				}
+				if (right < pt2.x + 2) {
+					right = pt2.x + 2
+				}
+				if (bottom < pt2.y + 2) {
+					bottom = pt2.y + 2
+				}
+			}
+			const groupObj = new fabric.Group(objs, {
+				id: `trajectory_point_group`,
+				eleType: "trajectory_point_group",
+				left,
+				top,
+				width: right - left,
+				height: bottom - top,
+				selectable: false,
+				hasControls: true,
+			})
+			this.canvas.add(groupObj)
 		},
 		updateLaserPoint(param) {
 
@@ -3166,7 +3121,7 @@
 					top: pt2.y,
 					width: 1,
 					height: 1,
-					fill: "#F5222D",
+					fill: "#ff00ff",
 					originX: "left",
 					originY: "top",
 					// selectable: false,
@@ -3600,7 +3555,7 @@
 						const show = item.param?.show || false
 						for (let i2 in teachingPathList) {
 							const teachingPath = teachingPathList[i2]
-							const id = `public_teaching_${teachingPath.name}`
+							const id = `public_teaching_${teachingPath.name}_${teachingPath.edge_name}`
 							const obj = await this.addTeachingPath(teachingPath, id, "public_teaching",
 								show)
 							obj.set({
@@ -3631,7 +3586,7 @@
 						let list = _this.canvas.getObjects() || []
 						if (item.param.mode == "Public") {
 							list = list.filter((a) => a.eleType == "public_teaching")
-							const id = `public_teaching_${item.param.name}`
+							const id = `public_teaching_${item.param.name}_${item.param.edge_name}`
 							const curIndex = list.findIndex((a) => a.id == id)
 
 							if (curIndex > -1) {
@@ -3656,7 +3611,7 @@
 					} else if (item.method == "update_teaching") {
 						let list = _this.canvas.getObjects() || []
 						list = list.filter((a) => a.eleType == "public_teaching")
-						const id = `public_teaching_${item.param.name}`
+						const id = `public_teaching_${item.param.name}_${item.param.edge_name}`
 						const curIndex = list.findIndex((a) => a.id == id)
 						if (curIndex > -1) {
 							const obj = list[curIndex]
@@ -3679,7 +3634,10 @@
 								}
 							}
 
-							obj.set({strokeWidth,stroke})
+							obj.set({
+								strokeWidth,
+								stroke
+							})
 
 						}
 					} else if (item.method == "set_selectable") {
@@ -3756,7 +3714,10 @@
 						this.updateAgvLaser(item.param || {})
 					} else if (item.method == "point_cloud") {
 						this.updateLaserPoint(item.param || {})
+					} else if (item.method == "point_trajectory") {
+						this.addTrajectoryPoint(item.param || [])
 					}
+
 				}
 				if (_this.canvas)
 					_this.canvas.renderAll()
diff --git a/pages/map/scene.vue b/pages/map/scene.vue
index aa7af12..c787b5d 100644
--- a/pages/map/scene.vue
+++ b/pages/map/scene.vue
@@ -44,7 +44,7 @@
 				<view class="tip">鍦烘櫙鏋勫缓涓�/view>
 				<view>
 					<!-- 璇锋搷浣滄惉杩愯溅鎵弿鍦板浘瑕嗙洊鐨勫尯鍩�-->
-					{{mapServerPhase=== 1  ?"鍦烘櫙鏋勫缓鏈嶅姟锛氭湭鍚姩":mapServerPhase===2 ?"鍦烘櫙鏋勫缓鏈嶅姟锛氬惎鍔ㄤ腑":mapServerPhase===3  ?"鍦烘櫙鏋勫缓涓�:mapServerPhase}}
+					{{mapCreatePhase}}
 				</view>
 
 				<view class="text-button-group">
@@ -55,7 +55,7 @@
 				<view class="tip"> 鈥渰{sceneName}}鈥漿{opType == "extend"?"鍦烘櫙鎵╁睍缁撴潫"+"":"鍦烘櫙鏋勫缓缁撴潫"}}</view>
 				<!-- 	<view> 宸叉垚鍔熸瀯寤衡�{{sceneName}}鈥�/view> -->
 				<view class="loading-view">
-					鏋勫浘鐘舵�锛歿{mapServerPhase===5?"淇濆瓨鎴愬姛":mapServerPhase===4?"淇濆瓨涓�:mapServerPhase===6?"淇濆瓨澶辫触":mapServerPhase}}
+					{{mapCreatePhase}}
 					<view v-if="mapServerPhase === 4" class="auto-circle"></view>
 				</view>
 				<view class="text-button-group">
@@ -125,7 +125,22 @@
 			}
 		},
 		computed: {
-
+			mapCreatePhase() {
+				if (this.mapServerPhase == 1) {
+					return "鍦烘櫙鏋勫缓鏈嶅姟锛氭湭鍚姩"
+				} else if (this.mapServerPhase == 2) {
+					return "鍦烘櫙鏋勫缓鏈嶅姟锛氬惎鍔ㄤ腑"
+				} else if (this.mapServerPhase == 3) {
+					return "鍦烘櫙鏋勫缓涓�
+				} else if (this.mapServerPhase == 4) {
+					return "鍦烘櫙鏋勫浘淇濆瓨涓�
+				} else if (this.mapServerPhase == 5) {
+					return "鍦烘櫙鏋勫浘淇濆瓨鎴愬姛"
+				} else if (this.mapServerPhase == 6) {
+					return "鍦烘櫙鏋勫浘淇濆瓨澶辫触"
+				} else
+					return this.mapServerPhase
+			}
 		},
 		watch: {
 
@@ -265,12 +280,12 @@
 
 					const res = await getMapServerPhase(this.ip)
 					this.mapServerPhase = res || 1
-					if (this.mapServerPhase === 3) {
-						return
-					}
-					if (this.mapServerPhase === 5 || this.mapServerPhase === 6) {
-						this.saveMapIsOk = true
-						return
+					if(this.opSceneType === "finish")
+					{
+						if (this.mapServerPhase === 5 || this.mapServerPhase === 6) {
+							this.saveMapIsOk = true
+							return
+						}
 					}
 					setTimeout(this.checkMapServerPhase, 1000);
 				} catch (ex) {
@@ -451,8 +466,8 @@
 					})
 					this.saveMapIsOk = false
 					await stopMap(this.ip, this.sceneName)
-					this.mapServerPhase = 4
-					this.checkMapServerPhase();
+					//this.mapServerPhase = 4
+					//this.checkMapServerPhase();
 					// if (this.opType == "extend") {
 					// 	this.opSceneType = ""
 					// 	const eventChannel = this.getOpenerEventChannel();
@@ -552,7 +567,11 @@
 									filedata: mapData
 								}
 							})
-
+							listCtrData.push({
+								method: "point_trajectory",
+								param: data.base_map.trajectoryPoints ||
+								[] //[ [[2,2],[6,2],[10,2],[14,2],[18,2],[2,6],[2,10],[2,14],[2,18],]
+							})
 
 						}
 
@@ -560,6 +579,8 @@
 							method: "point_cloud",
 							param: data.point_cloud
 						})
+
+
 						if (data.robot_pose) {
 							listCtrData.push({
 								method: "agv_laser",
@@ -586,6 +607,7 @@
 									})
 								}
 							}
+
 						}
 						// console.log("ctxDataStr",listCtrData.length)
 						this.ctxDataStr = JSON.stringify(listCtrData)

--
Gitblit v1.9.1