建图修改

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 = { let res = {
code: 200, code: 200,
message: 'ok', message: 'ok',
mapping_return: '2', mapping_return: '1',
mapping_percent: '100' mapping_percent: '50'
} }
return res return res
} }

View File

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

View File

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