From d87c256a957a6a5c3b40eaf9c52ec68f2fc22c97 Mon Sep 17 00:00:00 2001
From: cuiqian2004 <cuiqian2004@163.com>
Date: 星期五, 12 九月 2025 16:23:42 +0800
Subject: [PATCH] test

---
 pages/teaching/index.vue |   44 +++++++++++++++++++++++++++-----------------
 1 files changed, 27 insertions(+), 17 deletions(-)

diff --git a/pages/teaching/index.vue b/pages/teaching/index.vue
index 2b171f9..924f9a3 100644
--- a/pages/teaching/index.vue
+++ b/pages/teaching/index.vue
@@ -379,18 +379,11 @@
 							this.calibratioStationType = "end"
 							this.$refs.refPopupCalibration.open()
 						} else {
-							this.teachingModeCur.teaching_flag = 0
-							await teachingModeFlag(this.ip, this.teachingModeCur)
-							this.teachingMode = await getTeachingMode(this.ip)
-
-							this.teachingStatus = "end"
+							this.askTeachingBiDirection(this.teachingModeCur)
 
 						}
 					} else {
-						this.teachingModeCur.teaching_flag = 0
-						await teachingModeFlag(this.ip, this.teachingModeCur)
-						this.teachingMode = await getTeachingMode(this.ip)
-						this.teachingStatus = "end"
+						this.askTeachingBiDirection(this.teachingModeCur)
 					}
 				} catch (ex) {
 					this.showError(ex)
@@ -639,10 +632,8 @@
 							list[curIndex].y = infoAgv.y
 
 						}
-						this.teachingStatus = "end"
-						this.teachingModeCur.teaching_flag = 0
-						await teachingModeFlag(this.ip, this.teachingModeCur)
-						this.teachingMode = await getTeachingMode(this.ip)
+						this.askTeachingBiDirection(this.teachingModeCur)
+
 
 					}
 				} catch (ex) {
@@ -667,11 +658,30 @@
 
 					} else if (this.calibratioStationType == "end") {
 
-						this.teachingModeCur.teaching_flag = 0
-						await teachingModeFlag(this.ip, this.teachingModeCur)
-						this.teachingMode = await getTeachingMode(this.ip)
+						this.askTeachingBiDirection(this.teachingModeCur)
 
 					}
+				} catch (ex) {
+					this.showError(ex)
+				}
+			},
+			askTeachingBiDirection(teachingMode) {
+				showModal("鏄惁灏嗗綋鍓嶇ず鏁欒矾绾胯缃负鍙屽悜?", "绀烘暀缁撴潫").then((res) => {
+					if (res) {
+						teachingMode.bidirection = "1"
+					} else {
+						teachingMode.bidirection = "0"
+					}
+					teachingMode.teaching_flag = 0
+					this.finishTeaching(teachingMode)
+				})
+
+			},
+			async finishTeaching(teachingMode) {
+				try {
+					await teachingModeFlag(this.ip, teachingMode)
+					this.teachingMode = await getTeachingMode(this.ip)
+					this.teachingStatus = "end"
 				} catch (ex) {
 					this.showError(ex)
 				}
@@ -685,7 +695,7 @@
 				if (exStr == "{}")
 					exStr = ex
 				let tip = typeof ex.msg == "string" ? ex.msg : exStr
-				showModal(tip, "閿欒", false)
+				showModal(tip, "閿欒", false, "纭畾")
 			},
 
 

--
Gitblit v1.9.1