建图修改

This commit is contained in:
2025-08-11 13:28:37 +08:00
parent af93101ff2
commit 6eb3f30be2
3 changed files with 49 additions and 37 deletions

View File

@@ -114,8 +114,8 @@ export const getMappingStatus = () => {
let res = {
code: 200,
message: 'ok',
mapping_return: '2',
mapping_percent: '100'
mapping_return: '1',
mapping_percent: '50'
}
return res
}

View File

@@ -32,9 +32,11 @@
<div v-if="showProgress" class="progress-mask">
<!-- 进度条内容区 -->
<div class="progress-container">
<el-progress
<div class="progress_tip">{{warnTip ? '正在部署地图中...' : '正在生成地图中...'}}</div>
<el-progress
v-show="!warnTip"
:percentage="percentage"
:stroke-width="6"
:stroke-width="10"
style="width: 300px;"
></el-progress>
</div>
@@ -114,6 +116,7 @@ export default {
preventClickEvent: false
},
showProgress: false,
warnTip: false,
percentage: 0,
intervalId: null // 用于存储定时器ID
}
@@ -199,7 +202,7 @@ export default {
addPoint () {
this.dialogVisible = true
this.dataForm.stationCode = 'B' + (this.keyPoints.length + 1)
this.dataForm.stationName = 'B' + (this.keyPoints.length + 1)
this.dataForm.stationName = '工作点' + (this.keyPoints.length + 1)
},
// 打点->保存
async _setStation () {
@@ -258,39 +261,36 @@ export default {
async _getMappingStatus () {
try {
let res = await getMappingStatus()
if (res && res.code === 200) {
this.showProgress = true
this.percentage = Number(res.mapping_percent) || 0
if (res.mapping_return === '0') {
if (this.intervalId) clearTimeout(this.intervalId)
this.intervalId = setTimeout(() => this._getMappingStatus(), 1000)
}
if (res.mapping_return === '1') {
if (this.intervalId) clearTimeout(this.intervalId)
this.showProgress = false
this.percentage = 0
this._oneClickDeployment()
}
if (res.mapping_return === '2') {
if (this.intervalId) clearTimeout(this.intervalId)
this.showProgress = false
this.percentage = 0
this.keyPoints = []
this.$confirm('新建地图失败, 是否重新建图?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this._startMapping()
}).catch(() => {
this.$message({
type: 'info',
message: '已取消建图'
})
})
}
this.showProgress = true
this.percentage = Number(res.mapping_percent) || 0
if (res.mapping_return === '0') {
if (this.intervalId) clearTimeout(this.intervalId)
this.intervalId = setTimeout(() => this._getMappingStatus(), 1000)
}
if (res.mapping_return === '1') {
if (this.intervalId) clearTimeout(this.intervalId)
this.warnTip = true
this.percentage = 0
this._oneClickDeployment()
}
if (res.mapping_return === '2') {
if (this.intervalId) clearTimeout(this.intervalId)
this.showProgress = false
this.percentage = 0
this.keyPoints = []
this.$confirm('新建地图失败, 是否重新建图?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this._startMapping()
}).catch(() => {
this.$message({
type: 'info',
message: '已取消建图'
})
})
}
this.loading.close()
} catch (e) {
this.message = ''
this.error = false
@@ -322,11 +322,15 @@ export default {
} else {
this.$message.error(res.message)
}
this.showProgress = false
this.warnTip = false
this.message = ''
this.error = false
this.disabled = false
this.loading.close()
} catch (e) {
this.showProgress = false
this.warnTip = false
this.$message.error(e)
this.message = ''
this.error = false
@@ -381,4 +385,10 @@ export default {
text-align: center;
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}
.progress_tip {
font-size: .2rem
line-height: .34rem
color: #000
font-weight: 700
}
</style>

View File

@@ -218,6 +218,8 @@
color #17ff09
.el-progress-bar__inner,.el-progress-bar__outer
border-radius 0
.el-progress__text
font-size .2rem !important
// button
.button_control