加功能

This commit is contained in:
2025-09-16 18:01:49 +08:00
parent 3ac1d5f49c
commit 1a1ddd256f
14 changed files with 682 additions and 2710 deletions

View File

@@ -14,7 +14,7 @@
<el-col :span="8">
<el-row type="flex" justify="end">
<button class="button_control" @click="$router.push('/index/home')"><p>{{$t('AbandonMapbuild')}}</p></button>
<button id="v-step-3" class="button_control" style="margin-left: 10px" :disabled="disabled" @click="stopMappingConfirm"><p>{{$t('FinishMapbuild')}}</p></button>
<button id="v-step-3" class="button_control" :class="{'button_control_gray': autoLoopEnable !== '1'}" style="margin-left: 10px" :disabled="disabled" @click="stopMappingConfirm"><p>{{$t('FinishMapbuild')}}</p></button>
</el-row>
</el-col>
</el-row>
@@ -56,11 +56,11 @@
</template>
<script>
import GlMap from './gl-map-4.vue'
import GlMap from './gl-map.vue'
import { driver } from 'driver.js'
import 'driver.js/dist/driver.css'
// import { startMapping } from '../../config/mork.js'
import { startMapping, stopMapping, getMappingStatus, setStation, oneClickDeployment, abandonMapping } from '../../config/getData.js'
import { startMapping, stopMapping, getMappingStatus, setStation, oneClickDeployment, abandonMapping, sendAutoBack } from '../../config/getData.js'
import { mapGetters } from 'vuex'
export default {
name: 'ModuleBuilding',
@@ -137,11 +137,38 @@ export default {
showProgress: false,
warnTip: false,
percentage: 0,
intervalId: null // 用于存储定时器ID
intervalId: null, // 用于存储定时器ID
backActive: false // 打点完成后新增一个弹框 提示用户是否自动开回上一个点
}
},
computed: {
...mapGetters(['isTop', 'carPosition'])
...mapGetters(['isTop', 'carPosition', 'autoLoopEnable', 'autoBackEnable'])
},
watch: {
autoBackEnable (val) {
if (this.backActive && val === '0') {
this.loading = this.$loading({
lock: true,
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.6)'
})
}
if (this.backActive && val === '1') {
this.loading.close()
}
if (this.backActive && val === '2') {
this.$confirm(this.$t('Whetherdrivebackpoint'), this.$t('Prompt'), {
confirmButtonText: this.$t('yes'),
cancelButtonText: this.$t('no'),
type: 'warning'
}).then(() => {
this._sendAutoBack()
this.backActive = false
}).catch(() => {
this.backActive = false
})
}
},
},
beforeDestroy () {
document.removeEventListener('keydown', this.handleKeydown);
@@ -297,8 +324,10 @@ export default {
message: res.message
})
this.keyPoints.push(this.dataForm.stationCode)
this.backActive = true
} else {
this.$message.error(res.message)
this.backActive = false
}
}
this.dialogVisible = false
@@ -307,9 +336,11 @@ export default {
this.$message.error(e)
this.dialogVisible = false
this.disabled = false
this.backActive = false
}
},
stopMappingConfirm () {
if (this.autoLoopEnable !== '1') return
if (this.driverActive) return
this.$confirm(this.$t('sureendbuilding'), this.$t('Prompt'), {
confirmButtonText: this.$t('Confirm'),
@@ -443,6 +474,26 @@ export default {
this.$refs.glMap.init()
})
}
},
// 打点功能点击反馈成功后
async _sendAutoBack () {
try {
this.loading = this.$loading({
lock: true,
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.6)'
})
let res = await sendAutoBack()
if (res && res.code === 200) {
this.$message({
type: 'success',
message: res.message
})
}
this.loading.close()
} catch (e) {
this.loading.close()
}
}
}
}
@@ -468,7 +519,7 @@ export default {
z-index 2003
display flex
align-items center
font-size .16rem
font-size .2rem
list-height 1
p
margin-left 10px
@@ -512,6 +563,9 @@ export default {
line-height: 0.36rem;
color: #fff
overflow: hidden
.button_control
p
font-size .26rem
.enClass
.button_control
p