forked from drone/command-center-dashboard

chenyao
2025-04-10 5ae3a5a69832cfd8ec2d3fe14d875079c6bce171
feat: 修改首页机巢列表传参
5 files modified
1 files added
70 ■■■■■ changed files
src/api/home/machineNest.js 3 ●●●● patch | view | raw | blame | history
src/api/home/task.js 2 ●●● patch | view | raw | blame | history
src/views/Home/HomeLeft/OverviewNext.vue 1 ●●●● patch | view | raw | blame | history
src/views/TaskManage/TaskIntermediateContent/AddTask.vue 1 ●●●● patch | view | raw | blame | history
src/views/TaskManage/TaskIntermediateContent/CurrentTaskDetails.vue 20 ●●●●● patch | view | raw | blame | history
src/views/TaskManage/TaskIntermediateContent/TaskIntermediateContent.vue 43 ●●●●● patch | view | raw | blame | history
src/api/home/machineNest.js
@@ -9,13 +9,12 @@
    })
}
// 机巢列表
export const selectDevicePage = ({ nickname, is_execute, ...params }) => {
export const selectDevicePage = ({ nickname, ...params }) => {
    return request({
        url: `/drone-device-core/manage/api/v1/devices/selectDevicePage?type=${params.type}&current=${params.current}&size=${params.size}`,
        method: 'post',
        data: {
            nickname,
            is_execute,
        },
    })
}
src/api/home/task.js
@@ -43,7 +43,7 @@
// 任务列表
export const jobList = data => {
    return request({
        url: '/drone-device-core/wayline/waylineJobInfo/jobList?current=' + data.page + '&size=' + data.limit,
        url: '/drone-device-core/wayline/waylineJobInfo/jobList?current=' + data.page + '&size=' + data.size,
        method: 'post',
        data: data.searchParams,
    })
src/views/Home/HomeLeft/OverviewNext.vue
@@ -56,7 +56,6 @@
const getTableList = () => {
  const params = {
    nickname: searchText.value,
    is_execute: true,
    current: pageParams.value.current,
    size: pageParams.value.size
  };
src/views/TaskManage/TaskIntermediateContent/AddTask.vue
@@ -243,6 +243,7 @@
  rangDate.value = [];
  waylineId.value = '';
  wayLineFile.value = '';
    taskData.value = '';
};
onMounted(() => {
src/views/TaskManage/TaskIntermediateContent/CurrentTaskDetails.vue
New file
@@ -0,0 +1,20 @@
<!--当前任务详情-->
<template>
  <el-dialog
        modal-class="current-task-details"
        v-model="isShowCurrentTaskDetails"
        title="当前任务详情"
        :width="pxToRem(1500)"
        :close-on-click-modal="false"
        :destroy-on-close="true">
        <div class=""></div>
  </el-dialog>
</template>
<script setup>
const isShowCurrentTaskDetails = defineModel('show');
</script>
<style lang="scss" scoped>
.current-task-details {}
</style>
src/views/TaskManage/TaskIntermediateContent/TaskIntermediateContent.vue
@@ -5,7 +5,7 @@
    <el-table :data="jobListData" style="width: 100%" height="calc(100vh - 180px)">
      <el-table-column label="序号" width="60">
        <template #default="scope">
          {{ (jobListParams.page - 1) * jobListParams.limit + scope.$index + 1 }}
          {{ (jobListParams.current - 1) * jobListParams.size + scope.$index + 1 }}
        </template>
      </el-table-column>
      <el-table-column prop="job_info_num" label="任务编号" />
@@ -13,7 +13,7 @@
      <el-table-column prop="dept_name" label="所属部门"  />
      <el-table-column prop="device_names" label="所属机巢"  />
      <el-table-column prop="ai_type_str" label="关联算法"  />
      <el-table-column prop="status" label="任务状态" >
      <el-table-column label="任务状态" >
        <template #default="scope">
          {{ scope.row.status ? getStatusText(scope.row.status) : ''  }}
        </template>
@@ -30,8 +30,8 @@
    </el-table>
    <div class="pagination">
      <el-pagination
        v-model:current-page="jobListParams.page"
        v-model:page-size="jobListParams.limit"
        v-model:current-page="jobListParams.current"
        v-model:page-size="jobListParams.size"
        :page-sizes="[10, 20, 30, 50]"
        layout="total, sizes, prev, pager, next"
        :total="total"
@@ -40,17 +40,21 @@
      />
    </div>
  </div>
  <!-- 添加任务 -->
  <AddTask v-model:show="isShowAddTask" @refresh="searchClick"/>
  <!-- 当前任务详情 -->
  <CurrentTaskDetails v-model:show="isShowCurrentTaskDetails"/>
</template>
<script setup>
import SearchBox from '../SearchBox.vue';
import AddTask from './AddTask.vue';
import CurrentTaskDetails from './CurrentTaskDetails.vue';
import { jobList } from '@/api/home/task';
const jobListParams = reactive({
  page: 1,
  limit: 10,
  current: 1,
  size: 10,
  searchParams:{}
});
const jobListData = ref([]);
@@ -73,42 +77,31 @@
    4: '已取消',
    5: '执行失败'
  };
  return statusMap[status] || '未知';
  return statusMap[status] || '-';
};
// 状态标签类型
const getStatusType = (status) => {
  const typeMap = {
    1: 'info',
    2: 'warning',
    3: 'success',
    4: '',
    5: 'danger'
  };
  return typeMap[status] || '';
};
// 查看详情
// 查看当前任务详情
let isShowCurrentTaskDetails = ref(false);
const handleDetail = (row) => {
  console.log('查看详情', row);
  isShowCurrentTaskDetails.value = true;
};
// 分页大小改变
const handleSizeChange = (val) => {
  jobListParams.limit = val;
  jobListParams.size = val;
  getJobList();
};
// 页码改变
const handleCurrentChange = (val) => {
  jobListParams.page = val;
  jobListParams.current = val;
  getJobList();
};
// 传参查询条件
const searchClick = (params) => {
  jobListParams.page = 1;
  jobListParams.limit = 10;
  jobListParams.current = 1;
  jobListParams.size = 10;
  jobListParams.searchParams = params;
  getJobList();
};