map
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user