forked from drone/command-center-dashboard

chenyao
2025-04-11 475ad61eacb175bb49764f23349069f9d8d618ff
feat:修改巡查任务列表和状态以及智引指飞
5 files modified
2 files added
1 files deleted
106 ■■■■ changed files
src/api/home/index.js 15 ●●●●● patch | view | raw | blame | history
src/assets/images/aiNowFly/close.png patch | view | raw | blame | history
src/assets/images/signMachineNest/machineRight/return-fly.png patch | view | raw | blame | history
src/assets/images/signMachineNest/machineRight/return.png patch | view | raw | blame | history
src/store/modules/home.js 3 ●●●● patch | view | raw | blame | history
src/views/Home/AINowFly.vue 19 ●●●●● patch | view | raw | blame | history
src/views/SignMachineNest/MachineRight/InspectionRaskList.vue 52 ●●●●● patch | view | raw | blame | history
src/views/SignMachineNest/MachineRight/MachineStatus/MachineStatus.vue 17 ●●●●● patch | view | raw | blame | history
src/api/home/index.js
@@ -107,3 +107,18 @@
        params: { code },
    })
}
// 立即返航
export const flyByJobId = jobId => {
    return request({
        url: '/drone-device-core/wayline/api/v1/workspaces/flyByJobId?jobId=' + jobId,
        method: 'get',
    })
}
// 再次执行
export const returnHome = sn => {
    return request({
        url: `/drone-device-core/dp/home/${sn}/drc/returnHome`,
        method: 'post',
    })
}
src/assets/images/aiNowFly/close.png
src/assets/images/signMachineNest/machineRight/return-fly.png
src/assets/images/signMachineNest/machineRight/return.png
Binary files differ
src/store/modules/home.js
@@ -74,8 +74,7 @@
      window.localStorage.setItem('bs_osd', JSON.stringify(info))
    },
    setWsMessage: (state, data) => {
      console.log(data, '看看值')
      state.wsMessage = data.host;
      state.wsMessage = data.data.host;
    },
    setDeviceInfo: (state, data) => {
      const info = data.data
src/views/Home/AINowFly.vue
@@ -1,6 +1,6 @@
<template>
    <div class="AINowFly">
        <div class="title">指点飞行</div>
        <div class="title">指点飞行<img @click="closeClick" src="@/assets/images/aiNowFly/close.png"/></div>
        <el-form ref="ruleFormRef" :model="params" :rules="rules" label-width="auto" size="small" status-icon>
            <el-form-item label="任务名称" prop="name">
                <el-input v-model="params.name" />
@@ -233,6 +233,15 @@
    handler = null
}
// 关闭
const closeClick = () => {
    removeAll()
    params.value = _.cloneDeep(paramsInit)
    list.value = []
    eventPoint = {}
    store.commit('setFootActiveIndex', 0)
}
onBeforeUnmount(() => {
    removeAll()
})
@@ -265,6 +274,14 @@
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        img {
            position: absolute;
            cursor: pointer;
            width: 16px;
            height: 16px;
            right: 15px;
            top: 15px;
        }
    }
    .el-form {
        padding: 20px 16px 13px 11px;
src/views/SignMachineNest/MachineRight/InspectionRaskList.vue
@@ -34,8 +34,13 @@
              <img src="../../../assets/images/signMachineNest/machineRight/name.png" alt="" />{{ item.creator_name || '' }}
            </div>
          </div>
          <div class="right">
            <img src="../../../assets/images/signMachineNest/machineRight/return.png" alt="">
          <div class="right" v-if="tabIndex===1" @click="returnImmediately(item.id)">
            <span>立即返航</span>
            <img src="../../../assets/images/signMachineNest/machineRight/return-fly.png" alt="">
          </div>
          <div class="right" v-else @click="reExecute(item.dock_sn)">
            <span>再次执行</span>
            <img src="../../../assets/images/signMachineNest/machineRight/return-fly.png" alt="">
          </div>
        </div>
      </div>
@@ -51,7 +56,12 @@
<script setup>
import { Search } from '@element-plus/icons-vue';
import CommonTitle from '@/components/CommonTitle.vue';
import { getBeforeJob, getTodayJob } from '@/api/home'
import { getBeforeJob, getTodayJob, flyByJobId, returnHome } from '@/api/home';
import { useStore } from 'vuex';
const store = useStore();
// 单个机巢信息
const singleUavHome = computed(() => store.state.home.singleUavHome);
const isMore = ref(true);
// 控制加载状态
@@ -96,7 +106,7 @@
const getJobList = async () => {
  const params = {
    area_code: '',
    device_sn: '',
    device_sn: singleUavHome.value.device_sn,
    job_name: searchText.value,
    current: pageParams.value.current,
    size: pageParams.value.size,
@@ -132,6 +142,27 @@
// 搜索数据
const searchNickName = () => {
  clearData();
};
// 立即返航
const returnImmediately = (id) => {
  flyByJobId(id).then(result => {
    if (result.data.code === 0) {
      ElMessage.success('返航成功');
    } else {
      ElMessage.error(result.data.message);
    }
  });
};
// 重新执行
const reExecute = (dock_sn) => {
  returnHome(dock_sn).then(result => {
    if (result.data.code === 0) {
      ElMessage.success('执行成功');
    } else {
      ElMessage.error(result.data.message);
    }
  });
};
onMounted(() => {
@@ -256,6 +287,19 @@
          }
        }
        .right {
          cursor: pointer;
          position: relative;
          span {
            position: absolute;
            display: inline-block;
            top: 12px;
            left: 12px;
            width: 26px;
            line-height: 12px;
            font-size: 12px;
            font-family: YouSheBiaoTiHei, YouSheBiaoTiHei, serif;
            color: rgb(4,18,44)
          }
          img {
            width: 46px;
            height: 46px
src/views/SignMachineNest/MachineRight/MachineStatus/MachineStatus.vue
@@ -13,7 +13,7 @@
          </div>
          <div class="close-wb">
            <div class="close">{{ AircraftStatus ? AircraftStatus : '舱内关机' }}</div>
            <div class="wb">需要维保</div>
            <!-- <div class="wb">需要维保</div> -->
          </div>
        </div>
      </div>
@@ -136,13 +136,16 @@
let mode_code = ref('已断开连接');
// 监听实时信息
watch(store.state.home.wsMessage, (newValue) => {
    // if (newValue || newValue.mode_code === 14) return
    // if (Object.keys(newValue).length === 0) return
    console.log(newValue,'咋没数据呀');
    detailInfo.value.longitudee = newValue?.longitude.toFixed(6) || '--';
watch(
  () => store.state.home.wsMessage,
  (newValue) => {
    if (newValue.mode_code === 14) return
    if (Object.keys(newValue).length === 0) return
    // console.log(newValue, '顶顶顶111')
    detailInfo.value.longitude = newValue?.longitude.toFixed(6) || '--';
        detailInfo.value.latitude = newValue?.latitude.toFixed(6) || '--';
    getLnglatAltitude(newValue?.longitude,newValue?.latitude).then((res) => {
    getLnglatAltitude(Number(detailInfo.value.longitude), Number(detailInfo.value.latitude)).then((res) => {
      console.log(res, '顶顶顶')
      const height = newValue?.height - res?.height;
      //针对西安实时高度进行降低
      const wId = localStorage.getItem('bs_workspace_id');