重定位

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

@@ -22,6 +22,7 @@
"vue-i18n": "8.0.0",
"vue-router": "3.5.2",
"vue-touch-keyboard": "^0.3.2",
"vue-tour": "^2.0.0",
"vuex": "3.6.2"
},
"devDependencies": {

View File

@@ -39,3 +39,11 @@ export const updateStation = (code, st) => post('api/operate/updateStation', {
export const getMapInfoByCode = () => get('mapInfo/getMapInfoByCode', {})
export const queryMapAllStation = () => get('station/queryMapAllStation', {})
export const getRouteInfo = () => get('routeInfo/getRouteInfo', {})
// 下发任务
export const relocate = (x, y, angle) => get('teaching/relocate', {
x: x,
y: y,
angle: angle
})
// 关机重启
export const rebootVehicle = () => get('vehicle/rebootVehicle', {})

View File

@@ -7,6 +7,8 @@ import VueTouchKeyboard from 'vue-touch-keyboard'
import 'vue-touch-keyboard/dist/vue-touch-keyboard.css'
import { Row, Col, Button, Icon, Dialog, Form, FormItem, Input, Select, Option, Table, TableColumn, Tabs, TabPane, Popover, Loading, MessageBox, Message, Progress } from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import VueTour from 'vue-tour'
import 'vue-tour/dist/vue-tour.css'
import './style/common.styl'
import i18n from './i18n/i18n'
import './config/rem.js'
@@ -34,6 +36,7 @@ Vue.use(Progress)
Vue.prototype.$confirm = MessageBox.confirm
Vue.prototype.$message = Message
Vue.use(VueTouchKeyboard)
Vue.use(VueTour)
Vue.prototype.$post = post
Vue.config.productionTip = false

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')

View File

@@ -1034,6 +1034,11 @@
resolved "https://registry.npmmirror.com/@polka/url/-/url-1.0.0-next.29.tgz#5a40109a1ab5f84d6fd8fc928b19f367cbe7e7b1"
integrity sha512-wwQAWhWSuHaag8c4q/KN/vCoeOJYshAIvMQwD4GpSb3OiZklFfvAgmj0VCBBImRpuF/aFgIRzllXlVX93Jevww==
"@popperjs/core@^2.9.1":
version "2.11.8"
resolved "https://registry.npmmirror.com/@popperjs/core/-/core-2.11.8.tgz#6b79032e760a0899cd4204710beede972a3a185f"
integrity sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==
"@sideway/address@^4.1.5":
version "4.1.5"
resolved "https://registry.npmmirror.com/@sideway/address/-/address-4.1.5.tgz#4bc149a0076623ced99ca8208ba780d65a99b9d5"
@@ -4117,6 +4122,11 @@ jsonfile@^6.0.1:
optionalDependencies:
graceful-fs "^4.1.6"
jump.js@^1.0.2:
version "1.0.2"
resolved "https://registry.npmmirror.com/jump.js/-/jump.js-1.0.2.tgz#e0641b47f40a38f2139c25fda0500bf28e43015a"
integrity sha512-oUkJJ/Y4ATU5qjkXBntCZSKctbSyS3ewe2jrLaUu/cc9jsQiAn0fnTUxQnZz3mJdDdem1Q279zrD6h3n+Cgxtg==
keyv@^4.5.3:
version "4.5.4"
resolved "https://registry.npmmirror.com/keyv/-/keyv-4.5.4.tgz#a879a99e29452f942439f2a405e3af8b31d4de93"
@@ -6264,7 +6274,17 @@ vue-touch-keyboard@^0.3.2:
dependencies:
babel-runtime "^6.26.0"
vue@^2.6.14:
vue-tour@^2.0.0:
version "2.0.0"
resolved "https://registry.npmmirror.com/vue-tour/-/vue-tour-2.0.0.tgz#aa4489cfc9f9090ca57d3208a074010f3be8ec05"
integrity sha512-vhKzqdhunQ3EoO1733UxhOB389u3EKv2X8JqYhX4tIq4ilqlZtnY3azPFBYPFmnAqHn5RyZBrP2CpqSaxTs8og==
dependencies:
"@popperjs/core" "^2.9.1"
hash-sum "^2.0.0"
jump.js "^1.0.2"
vue "^2.6.12"
vue@^2.6.12, vue@^2.6.14:
version "2.7.16"
resolved "https://registry.npmmirror.com/vue/-/vue-2.7.16.tgz#98c60de9def99c0e3da8dae59b304ead43b967c9"
integrity sha512-4gCtFXaAA3zYZdTp5s4Hl2sozuySsgz4jy1EnpBHNfpMa9dK1ZCG7viqBPCwXtmgc8nHqUsAu3G4gtmXkkY3Sw==