Merge remote-tracking branch 'origin/lxl-dev' into lxl-dev

# Conflicts:
#	src/views/inspection/cockpit/components/MapOverview.vue
This commit is contained in:
lixiaolong 2026-08-06 11:24:14 +08:00
commit 02706a39a1
2 changed files with 28 additions and 3 deletions

View File

@ -350,9 +350,12 @@ const centerCanvasView = () => {
} }
const loadSourceMap = async () => { const loadSourceMap = async () => {
const connectedRobot = props.robotList.find(item => item.connectStatus == 1);
if (!connectedRobot) return;
const res = await getMapJson({ const res = await getMapJson({
robotId: props.robotList[0].id, robotId: connectedRobot.id,
mapName: props.robotList[0].robotMapName mapName: connectedRobot.robotMapName
}); });
if (res.code === 200) { if (res.code === 200) {
try { try {

View File

@ -8,7 +8,7 @@
<div><SvgIcon name="bot" color="#fff" /></div> <div><SvgIcon name="bot" color="#fff" /></div>
<div class="bot-name">全部</div> <div class="bot-name">全部</div>
</div> </div>
<div v-for="item, index in 4" class="robot" :class="{ active: activeBot === index + 1 }" @click="changeBot(index + 1)"> <div v-for="item, index in robotList" class="robot" :class="{ active: activeBot === index + 1 }" @click="changeBot(index + 1)">
<div> <div>
<SvgIcon name="bot" :color="colorList[index]" /> <SvgIcon name="bot" :color="colorList[index]" />
</div> </div>
@ -41,15 +41,37 @@
<script setup> <script setup>
import SvgIcon from "@/components/SvgIcon"; import SvgIcon from "@/components/SvgIcon";
import IPlayer from "@/components/IPlayer/index.vue"; import IPlayer from "@/components/IPlayer/index.vue";
import { getRobotList } from '@/api/inspection/robot'
const videoUrl = ref('https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8') const videoUrl = ref('https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8')
const colorList = ['#00D4FF', '#FFB300', '#00FF88', '#fd00ff'] const colorList = ['#00D4FF', '#FFB300', '#00FF88', '#fd00ff']
const robotList = ref([])
const activeBot = ref(0) const activeBot = ref(0)
const changeBot = (index) => { const changeBot = (index) => {
activeBot.value = index activeBot.value = index
} }
const fetchRobotList = async () => {
try {
const res = await getRobotList({
robotType: 2,
})
if (res.code === 200) {
robotList.value = res.rows
} else {
console.error('获取机器人列表失败:', res.message)
}
} catch (error) {
console.error('获取机器人列表失败:', error)
}
}
onMounted(() => {
fetchRobotList()
})
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.page-container { .page-container {