重定位
This commit is contained in:
@@ -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', {})
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user