no message

This commit is contained in:
2025-07-14 17:52:37 +08:00
parent cdf9462a70
commit bd9c5ae7da
6 changed files with 68 additions and 15 deletions

View File

@@ -9,16 +9,18 @@ export const authlogin = (username, password) => post('auth/login', {
export const startMapping = (na) => post('teaching/startMapping?mapName=' + na, {})
export const setStation = (sn) => post('teaching/setStation?stationName=' + sn, {})
export const stopMapping = () => post('teaching/stopMapping', {})
export const getLocalMaps = () => post('teaching/getLocalMaps', {})
export const synchronzieMap = (map) => post('teaching/synchronzieMap', {
mapName: map
})
export const restart = () => post('teaching/restart', {})
export const relocate = (x, y, angle) => post('teaching/relocate', {
x: x,
y: x,
angle: angle
})
export const oneClickDeployment = (map) => post('teaching/oneClickDeployment?mapName=' + map, {})
// export const getLocalMaps = () => post('teaching/getLocalMaps', {})
// export const synchronzieMap = (map) => post('teaching/synchronzieMap', {
// mapName: map
// })
// export const restart = () => post('teaching/restart', {})
// export const relocate = (x, y, angle) => post('teaching/relocate', {
// x: x,
// y: x,
// angle: angle
// })
// 操作
export const queryStation = () => post('api/operate/queryStation', {})
export const queryTaskChain = () => post('api/operate/queryTaskChain', {})

View File

@@ -7,7 +7,7 @@ import store from './vuex/store'
import '@style/reset.css'
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, 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 i18n from './i18n/i18n'
import '@config/rem.js'
@@ -30,6 +30,7 @@ Vue.use(Tabs)
Vue.use(TabPane)
Vue.use(Popover)
Vue.use(Loading)
Vue.prototype.$confirm = MessageBox.confirm
Vue.prototype.$message = Message
Vue.use(VueTouchKeyboard)
Vue.prototype.$post = post

View File

@@ -12,7 +12,7 @@
<div class="canvas-container">
<canvas id="canvas" ref="canvas" width="1920" height="1080"></canvas>
</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
title="设置站点"
:visible.sync="dialogVisible"
@@ -32,10 +32,11 @@
</template>
<script>
import { startMapping, setStation, stopMapping } from '@config/getData.js'
import { startMapping, setStation, stopMapping, oneClickDeployment } from '@config/getData.js'
export default {
data () {
return {
mapName: '',
dialogVisible: false,
dataForm: {
point: ''
@@ -105,7 +106,9 @@ export default {
},
async _startMapping () {
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.code !== 200) {
this.$message.error(res.message)
@@ -133,15 +136,35 @@ export default {
this.$message.error(res.message)
}
}
this.dialogVisible = false
this.visible = false
} catch (e) {
this.$message.error(e)
this.dialogVisible = false
this.visible = false
}
},
async _stopMapping () {
try {
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.code === 200) {
this.$message({

View File

@@ -25,6 +25,21 @@ export default {
},
methods: {
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)
}
}

View File

@@ -11,7 +11,7 @@
<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-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 v-else class="relative elec-qty-wrap elec-wraning">
<div class="absolute elec-qty" style="width: 100%"></div>

View File

@@ -178,6 +178,18 @@
color #606266
line-height 1.4
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_control