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

@@ -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>