forked from drone/command-center-dashboard

chenyao
2025-04-14 c420904b303625bc3934263efbe93c1384a45874
feat:更新机巢列表数据传参
5 files modified
58 ■■■■■ changed files
src/views/Home/HomeLeft/MachineNestList.vue 19 ●●●● patch | view | raw | blame | history
src/views/Home/HomeLeft/OverviewNext.vue 6 ●●●●● patch | view | raw | blame | history
src/views/SignMachineNest/MachineRight/MachineMonitor.vue 2 ●●● patch | view | raw | blame | history
src/views/SignMachineNest/MachineRight/MachineStatus/MachineStatus.vue 30 ●●●● patch | view | raw | blame | history
src/views/SignMachineNest/SignMachineNest.vue 1 ●●●● patch | view | raw | blame | history
src/views/Home/HomeLeft/MachineNestList.vue
@@ -83,14 +83,15 @@
const getTableList = () => {
    const params = {
        nickname: searchText.value,
        current: pageParams.value.current,
        current: 1,
        size: pageParams.value.size,
    }
    selectDevicePage(params).then(res => {
        if (res.data.code !== 0) return
        if (res.data.data.records.length === 0) return (isMore.value = false)
        pageParams.value.current += 1
        tableList.value = [...tableList.value, ...res.data.data.records]
        // pageParams.value.current += 1
        pageParams.value.size += 8
        tableList.value = res.data.data.records;// [...tableList.value, ...res.data.data.records]
        busy.value = false
    })
}
@@ -105,18 +106,6 @@
    searchText.value = name
    pageParams.value.current = 1
    tableList.value = []
    getTableList()
}
// 分页方法
const handleSizeChange = val => {
    pageParams.value.size = val
    pageParams.value.current = 1
    getTableList()
}
const handleCurrentChange = val => {
    pageParams.value.current = val
    getTableList()
}
src/views/Home/HomeLeft/OverviewNext.vue
@@ -81,8 +81,9 @@
    selectDevicePage(params).then(res => {
        if (res.data.code !== 0) return
        if (res.data.data.records.length === 0) return (isMore.value = false)
        pageParams.value.current += 1
        tableList.value = [...tableList.value, ...res.data.data.records]
        // pageParams.value.current += 1
        pageParams.value.size += 5;
        tableList.value = res.data.data.records;// [...tableList.value, ...res.data.data.records]
        busy.value = false
    })
}
@@ -98,6 +99,7 @@
const handleSearch = name => {
    searchText.value = name
    pageParams.value.current = 1
    pageParams.value.size = 5;
    tableList.value = []
    isMore.value = true
    getTableList()
src/views/SignMachineNest/MachineRight/MachineMonitor.vue
@@ -1,6 +1,6 @@
<!-- 机巢监控 -->
<template>
  <CommonTitle title="视频监控" />
  <CommonTitle title="直播监控" />
  <div :style="{ marginLeft: pxToRem(14) }">
    <div class="machine-monitor">
      <LiveVideo :videoUrl="airPortUrl" />
src/views/SignMachineNest/MachineRight/MachineStatus/MachineStatus.vue
@@ -13,7 +13,9 @@
            <span class="right">{{ detailInfo.longitude }},{{ detailInfo.latitude }}</span>
          </div>
          <div class="close-wb">
            <div class="close">{{ AircraftStatus ? AircraftStatus : '舱内关机' }}</div>
            <div class="close" :class="AircraftStatus == undefined ? '' : 'other'">
              {{ AircraftStatus == undefined ? '舱内关机' : AircraftStatus }}
            </div>
            <!-- <div class="wb">需要维保</div> -->
          </div>
        </div>
@@ -80,8 +82,7 @@
const store = useStore();
// 获取机巢信息
let osdVisible = computed(() => store.state.home.osdVisible);
console.log('333',osdVisible)
let osdVisible = ref({});//computed(() => store.state.home.osdVisible);
const singleUavHome = computed(() => store.state.home.singleUavHome);
// 单个机巢统计数据
const singleTotal = computed(() => store.state.home.singleTotal);
@@ -139,7 +140,7 @@
let mode_code = ref('已断开连接');
watch(() => store.state.home.osdVisible, (newValue) => {
  console.log(newValue,'osdVisible222')
  osdVisible.value = newValue;
});
// 监听实时信息
@@ -150,7 +151,7 @@
    if (Object.keys(newValue).length === 0) return
    detailInfo.value.longitude = newValue?.longitude.toFixed(6) || '--';
        detailInfo.value.latitude = newValue?.latitude.toFixed(6) || '--';
    console.log(window.$viewer)
    getLnglatAltitude(Number(detailInfo.value.longitude), Number(detailInfo.value.latitude),window.$viewer).then((res) => {
      const height = newValue?.height - res?.height;
      //针对西安实时高度进行降低
@@ -171,12 +172,10 @@
);
// 获取最新机场状态
watch(store.state.home.deviceState, (newValue) => {
    // if (data.currentSn !== osdVisible.gateway_sn) return;
    if (newValue.currentType === EDeviceTypeName.Dock && newValue?.dockInfo[newValue.currentSn]) {
      // 机场状态
      mode_code.value = EDockModeText[newValue?.dockInfo[newValue.currentSn]?.basic_osd?.mode_code];
      // this.$emit('updateModeCode', mode_code.value);
      // console.log('3333333',deviceInfo.value)
      // 舱内状态
      AircraftStatus.value =
        EModeText[newValue.deviceInfo[
@@ -185,7 +184,6 @@
          ]?.mode_code
        ];
      // 舱内关机时显示的电量
      // console.log('444',newValue.currentSn)
      let child_sn = newValue?.dockInfo[newValue.currentSn].basic_osd.sub_device?.device_sn;
      // 飞机在线时取飞机中的电量
      if(newValue.deviceInfo[child_sn]) {
@@ -199,22 +197,21 @@
          drone_charge_state.value = newValue.drone_charge_state_new;
        }
      }
      // console.log('osdVisible',osdVisible.visible)
      if (osdVisible.visible && osdVisible.is_dock && osdVisible.gateway_sn !== '') {
        deviceInfo.value.dock = newValue.dockInfo[osdVisible.gateway_sn];
      if (osdVisible.value.visible && osdVisible.value.is_dock && osdVisible.value.gateway_sn !== '') {
        deviceInfo.value.dock = newValue.dockInfo[osdVisible.value.gateway_sn];
        deviceInfo.value.device =
        newValue.deviceInfo[deviceInfo.value.dock.basic_osd?.sub_device?.device_sn ??
            osdVisible.sn
        osdVisible.value.sn
          ];
        // 设备关机即不显示信息
        // 兼容遥控器 关闭无人机 mode_code返回的是14 不是undefined
        if (
          newValue.deviceInfo[
            deviceInfo.value.dock.basic_osd?.sub_device?.device_sn ??
            osdVisible.sn
            osdVisible.value.sn
          ]?.mode_code === undefined || newValue.deviceInfo[
            deviceInfo.value.dock.basic_osd?.sub_device?.device_sn ??
            osdVisible.sn
            osdVisible.value  .sn
          ]?.mode_code == 14
        ) {
          detailInfo.value = {
@@ -334,12 +331,17 @@
          .close {
            width: 60px;
            height: 20px;
            line-height: 20px;
            background: rgba(255,178,106,0.2);
            border-radius: 4px 4px 4px 4px;
            border: 1px solid #FFB26A;
            color: #FFB26A;
            margin-right: 10px;
          }
          .other {
            border: 1px solid #8EFFAC;
            color: #8EFFAC;
          }
          .wb {
            width: 60px;
            height: 20px;
src/views/SignMachineNest/SignMachineNest.vue
@@ -71,7 +71,6 @@
    osdVisible.value.device_sub_type = child.sub_type || 1
    osdVisible.value.device_type = child.type || 0
    // osdVisible.value.latest_wayline_job = result?.latest_wayline_job || {}
    console.log(osdVisible.value, '999')
    store.commit('setOsdVisibleInfo', osdVisible.value);
    store.commit('setSelectedWorkSpaceId', result.workspace_id);
    workspaceId.value = result.workspace_id;