no message
This commit is contained in:
@@ -9,16 +9,18 @@ export const authlogin = (username, password) => post('auth/login', {
|
|||||||
export const startMapping = (na) => post('teaching/startMapping?mapName=' + na, {})
|
export const startMapping = (na) => post('teaching/startMapping?mapName=' + na, {})
|
||||||
export const setStation = (sn) => post('teaching/setStation?stationName=' + sn, {})
|
export const setStation = (sn) => post('teaching/setStation?stationName=' + sn, {})
|
||||||
export const stopMapping = () => post('teaching/stopMapping', {})
|
export const stopMapping = () => post('teaching/stopMapping', {})
|
||||||
export const getLocalMaps = () => post('teaching/getLocalMaps', {})
|
export const oneClickDeployment = (map) => post('teaching/oneClickDeployment?mapName=' + map, {})
|
||||||
export const synchronzieMap = (map) => post('teaching/synchronzieMap', {
|
// export const getLocalMaps = () => post('teaching/getLocalMaps', {})
|
||||||
mapName: map
|
// export const synchronzieMap = (map) => post('teaching/synchronzieMap', {
|
||||||
})
|
// mapName: map
|
||||||
export const restart = () => post('teaching/restart', {})
|
// })
|
||||||
export const relocate = (x, y, angle) => post('teaching/relocate', {
|
// export const restart = () => post('teaching/restart', {})
|
||||||
x: x,
|
// export const relocate = (x, y, angle) => post('teaching/relocate', {
|
||||||
y: x,
|
// x: x,
|
||||||
angle: angle
|
// y: x,
|
||||||
})
|
// angle: angle
|
||||||
|
// })
|
||||||
|
|
||||||
// 操作
|
// 操作
|
||||||
export const queryStation = () => post('api/operate/queryStation', {})
|
export const queryStation = () => post('api/operate/queryStation', {})
|
||||||
export const queryTaskChain = () => post('api/operate/queryTaskChain', {})
|
export const queryTaskChain = () => post('api/operate/queryTaskChain', {})
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import store from './vuex/store'
|
|||||||
import '@style/reset.css'
|
import '@style/reset.css'
|
||||||
import VueTouchKeyboard from 'vue-touch-keyboard'
|
import VueTouchKeyboard from 'vue-touch-keyboard'
|
||||||
import 'vue-touch-keyboard/dist/vue-touch-keyboard.css'
|
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, Message } from 'element-ui'
|
import { Row, Col, Button, Icon, Dialog, Form, FormItem, Input, Select, Option, Table, TableColumn, Tabs, TabPane, Popover, Loading, MessageBox, Message } from 'element-ui'
|
||||||
import '@style/common.styl'
|
import '@style/common.styl'
|
||||||
import i18n from './i18n/i18n'
|
import i18n from './i18n/i18n'
|
||||||
import '@config/rem.js'
|
import '@config/rem.js'
|
||||||
@@ -30,6 +30,7 @@ Vue.use(Tabs)
|
|||||||
Vue.use(TabPane)
|
Vue.use(TabPane)
|
||||||
Vue.use(Popover)
|
Vue.use(Popover)
|
||||||
Vue.use(Loading)
|
Vue.use(Loading)
|
||||||
|
Vue.prototype.$confirm = MessageBox.confirm
|
||||||
Vue.prototype.$message = Message
|
Vue.prototype.$message = Message
|
||||||
Vue.use(VueTouchKeyboard)
|
Vue.use(VueTouchKeyboard)
|
||||||
Vue.prototype.$post = post
|
Vue.prototype.$post = post
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
<div class="canvas-container">
|
<div class="canvas-container">
|
||||||
<canvas id="canvas" ref="canvas" width="1920" height="1080"></canvas>
|
<canvas id="canvas" ref="canvas" width="1920" height="1080"></canvas>
|
||||||
</div>
|
</div>
|
||||||
<el-row type="flex" justify="end"><button class="button_control" @click="_stopMapping"><p>建图</p></button></el-row>
|
<el-row type="flex" justify="end"><button class="button_control" @click="_stopMapping"><p>结束建图</p></button></el-row>
|
||||||
<el-dialog
|
<el-dialog
|
||||||
title="设置站点"
|
title="设置站点"
|
||||||
:visible.sync="dialogVisible"
|
:visible.sync="dialogVisible"
|
||||||
@@ -32,10 +32,11 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { startMapping, setStation, stopMapping } from '@config/getData.js'
|
import { startMapping, setStation, stopMapping, oneClickDeployment } from '@config/getData.js'
|
||||||
export default {
|
export default {
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
|
mapName: '',
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
dataForm: {
|
dataForm: {
|
||||||
point: ''
|
point: ''
|
||||||
@@ -105,7 +106,9 @@ export default {
|
|||||||
},
|
},
|
||||||
async _startMapping () {
|
async _startMapping () {
|
||||||
try {
|
try {
|
||||||
let res = await startMapping('apt_map_' + new Date().getTime())
|
const getTimestamp = new Date().getTime()
|
||||||
|
this.mapName = `apt_map_${getTimestamp}`
|
||||||
|
let res = await startMapping(this.mapName)
|
||||||
if (res) {
|
if (res) {
|
||||||
if (res.code !== 200) {
|
if (res.code !== 200) {
|
||||||
this.$message.error(res.message)
|
this.$message.error(res.message)
|
||||||
@@ -133,15 +136,35 @@ export default {
|
|||||||
this.$message.error(res.message)
|
this.$message.error(res.message)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
this.dialogVisible = false
|
||||||
this.visible = false
|
this.visible = false
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.$message.error(e)
|
this.$message.error(e)
|
||||||
|
this.dialogVisible = false
|
||||||
this.visible = false
|
this.visible = false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async _stopMapping () {
|
async _stopMapping () {
|
||||||
try {
|
try {
|
||||||
let res = await stopMapping()
|
let res = await stopMapping()
|
||||||
|
if (res) {
|
||||||
|
if (res.code === 200) {
|
||||||
|
this.$message({
|
||||||
|
type: 'success',
|
||||||
|
message: res.message
|
||||||
|
})
|
||||||
|
this._oneClickDeployment()
|
||||||
|
} else {
|
||||||
|
this.$message.error(res.message)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
this.$message.error(e)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async _oneClickDeployment () {
|
||||||
|
try {
|
||||||
|
let res = await oneClickDeployment(this.mapName)
|
||||||
if (res) {
|
if (res) {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
this.$message({
|
this.$message({
|
||||||
|
|||||||
@@ -25,6 +25,21 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
toPage (e) {
|
toPage (e) {
|
||||||
|
if (e.router === '/index/building') {
|
||||||
|
this.$confirm('是否开始新建地图,地图会进行覆盖, 是否继续?', '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
this.$router.push(e.router)
|
||||||
|
}).catch(() => {
|
||||||
|
this.$message({
|
||||||
|
type: 'info',
|
||||||
|
message: '已取消建图'
|
||||||
|
})
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
this.$router.push(e.router)
|
this.$router.push(e.router)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
<div v-if="JSON.stringify(topInfo) !== '{}'" class="relative elec-qty-wrap" :class="{'elec-wraning': topInfo.batteryPower <= 40}">
|
<div v-if="JSON.stringify(topInfo) !== '{}'" class="relative elec-qty-wrap" :class="{'elec-wraning': topInfo.batteryPower <= 40}">
|
||||||
<div class="absolute elec-qty" :style="{ width: topInfo.batteryPower !== -1 ? `calc(100% - ${topInfo.batteryPower}%)` : '100%' }"></div>
|
<div class="absolute elec-qty" :style="{ width: topInfo.batteryPower !== -1 ? `calc(100% - ${topInfo.batteryPower}%)` : '100%' }"></div>
|
||||||
<div class="absolute elec-qty-border"></div>
|
<div class="absolute elec-qty-border"></div>
|
||||||
<div class="elec-txt">{{topInfo.batteryPower !== -1 ? `${topInfo.batteryPower}%` : ''}}</div>
|
<div class="elec-txt">{{topInfo.batteryPower !== -1 ? `${topInfo.batteryPower}%` : '0'}}</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-else class="relative elec-qty-wrap elec-wraning">
|
<div v-else class="relative elec-qty-wrap elec-wraning">
|
||||||
<div class="absolute elec-qty" style="width: 100%"></div>
|
<div class="absolute elec-qty" style="width: 100%"></div>
|
||||||
|
|||||||
@@ -178,6 +178,18 @@
|
|||||||
color #606266
|
color #606266
|
||||||
line-height 1.4
|
line-height 1.4
|
||||||
font-size .14rem
|
font-size .14rem
|
||||||
|
.el-message-box
|
||||||
|
background-color rgba(13, 49, 95,0.95)
|
||||||
|
border-color #4980BD
|
||||||
|
.el-message-box__title, .el-message-box__content
|
||||||
|
color #fff
|
||||||
|
.el-button
|
||||||
|
background-color #c3390c
|
||||||
|
border-color #ed865c
|
||||||
|
color #fff
|
||||||
|
.el-button--primary
|
||||||
|
background-color #009fde
|
||||||
|
border-color #00d9f3
|
||||||
|
|
||||||
// button
|
// button
|
||||||
.button_control
|
.button_control
|
||||||
|
|||||||
Reference in New Issue
Block a user