Merge remote-tracking branch 'origin/lxl-dev' into lxl-dev
# Conflicts: # src/views/inspection/cockpit/components/MapOverview.vue
This commit is contained in:
commit
02706a39a1
@ -350,9 +350,12 @@ const centerCanvasView = () => {
|
||||
}
|
||||
|
||||
const loadSourceMap = async () => {
|
||||
const connectedRobot = props.robotList.find(item => item.connectStatus == 1);
|
||||
if (!connectedRobot) return;
|
||||
|
||||
const res = await getMapJson({
|
||||
robotId: props.robotList[0].id,
|
||||
mapName: props.robotList[0].robotMapName
|
||||
robotId: connectedRobot.id,
|
||||
mapName: connectedRobot.robotMapName
|
||||
});
|
||||
if (res.code === 200) {
|
||||
try {
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
<div><SvgIcon name="bot" color="#fff" /></div>
|
||||
<div class="bot-name">全部</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>
|
||||
<SvgIcon name="bot" :color="colorList[index]" />
|
||||
</div>
|
||||
@ -41,15 +41,37 @@
|
||||
<script setup>
|
||||
import SvgIcon from "@/components/SvgIcon";
|
||||
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 colorList = ['#00D4FF', '#FFB300', '#00FF88', '#fd00ff']
|
||||
|
||||
const robotList = ref([])
|
||||
|
||||
const activeBot = ref(0)
|
||||
const changeBot = (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>
|
||||
<style lang="scss" scoped>
|
||||
.page-container {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user