This commit is contained in:
2025-07-23 20:05:03 +08:00
parent ecc4e40939
commit 677ce26b2e
11 changed files with 345 additions and 11 deletions

View File

@@ -44,18 +44,23 @@
import { startMapping, setStation, stopMapping, getLocalMaps, oneClickDeployment } from '@config/getData.js'
export default {
beforeRouteLeave (to, from, next) {
this.$confirm('是否放弃本次建图?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
next() // 允许离开
}).catch(() => {
next(false) // 阻止离开
})
if (this.needsConfirmation) {
this.$confirm('是否放弃本次建图?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
next() // 允许离开
}).catch(() => {
next(false) // 阻止离开
})
} else {
next()
}
},
data () {
return {
needsConfirmation: true,
mapName: '',
dialogVisible: false,
dataForm: {
@@ -245,6 +250,7 @@ export default {
type: 'success',
message: res.message
})
this.needsConfirmation = false
this.$router.push('/index/home')
} else {
this.$message.error(res.message)