重定位

This commit is contained in:
2025-08-18 13:51:04 +08:00
parent fc92bf1755
commit 5dc0b64860
6 changed files with 73 additions and 5 deletions

View File

@@ -11,7 +11,7 @@
</template>
<script>
import { queryStation } from '../../config/mork.js'
import { queryStation, relocate } from '../../config/getData.js'
export default {
name: 'ModuleRelocation',
data () {
@@ -20,7 +20,7 @@ export default {
}
},
mounted () {
// this._queryStation()
this._queryStation()
},
methods: {
// 站点查询
@@ -41,13 +41,31 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
console.log(e)
this._relocate(e.x, e.y, e.angle)
}).catch(() => {
this.$message({
type: 'info',
message: '已取消操作'
})
})
},
async _relocate (x, y, angle) {
try {
this.loading = this.$loading({
lock: true,
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.6)'
})
let res = await relocate(x, y, angle)
if (res) {
this.$message(res.message)
this._queryStation()
}
this.loading.close()
} catch (e) {
this.$message.error(e)
this.loading.close()
}
}
}
}

View File

@@ -46,6 +46,7 @@
</template>
<script>
import { rebootVehicle } from '../../config/getData.js'
import { mapGetters, mapActions } from 'vuex'
export default {
data () {
@@ -125,7 +126,7 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.initLink()
this._rebootVehicle()
}).catch(() => {
this.$message({
type: 'info',
@@ -133,6 +134,23 @@ export default {
})
})
},
async _rebootVehicle () {
try {
this.loading = this.$loading({
lock: true,
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.6)'
})
let res = await rebootVehicle()
if (res) {
this.initLink()
}
this.loading.close()
} catch (e) {
this.$message.error(e)
this.loading.close()
}
},
initLink () {
let link = 'stservice://systech.com:8088/router?data=reboot'
const a = document.createElement('a')