无人机管理后台前端(已迁走)
张含笑
2025-06-27 f0c8530e9ef41fcc075403fd61bd36f8ec7e2458
feat:正射不选择文件类别
2 files modified
113 ■■■■■ changed files
src/views/dataCenter/components/searchData.vue 87 ●●●●● patch | view | raw | blame | history
src/views/dataCenter/dataCenter.vue 26 ●●●●● patch | view | raw | blame | history
src/views/dataCenter/components/searchData.vue
@@ -73,6 +73,7 @@
        </el-form-item>
        <el-form-item label="文件类别:">
          <el-select
            :disabled="disabled"
            :teleported="false"
            v-model="searchForm.photoType"
            placeholder="请选择"
@@ -98,8 +99,12 @@
      </div>
      <div class="search-first">
        <div class="search-btn">
          <el-button type="primary" icon="el-icon-download" @click="allDownloadFun">全部下载</el-button>
          <el-button type="success" plain icon="el-icon-download" @click="downloadFun">下载</el-button>
          <el-button type="primary" icon="el-icon-download" @click="allDownloadFun"
            >全部下载</el-button
          >
          <el-button type="success" plain icon="el-icon-download" @click="downloadFun"
            >下载</el-button
          >
        </div>
      </div>
    </el-form>
@@ -112,17 +117,34 @@
import dayjs from 'dayjs';
import { useStore } from 'vuex';
import { getRegionTreeAll, getDeviceRegion, deptsByAreaCode } from '@/api/job/task';
import { watch } from 'vue';
const store = useStore();
const userAreaCode = computed(() => store.getters.userInfo.detail.areaCode);
const selectedAreaCode = computed(() => store.state.user.selectedAreaCode);
const emit = defineEmits(['search','downFun','allDownFun']);
const emit = defineEmits(['search', 'downFun', 'allDownFun']);
const startTime = dayjs().subtract(6, 'day').startOf('day');
const endTime = dayjs().endOf('day');
const timeRange = [startTime.format('YYYY-MM-DD HH:mm:ss'), endTime.format('YYYY-MM-DD HH:mm:ss')];
const dateRange = ref(timeRange);
const timeFormat = 'YYYY-MM-DD HH:mm:ss';
const searchForm = reactive({
  jobName: '', //任务名称
  name: '', //文件名称
  areaCode: userAreaCode.value, // 区域code
  endTime: endTime.format(timeFormat), // 结束时间
  startTime: startTime.format(timeFormat), // 开始时间
  deviceSn: '', // 所属机巢
  resultType: '', //文件格式
  photoType: '', //文件类别
});
const disabled = ref(false);
const treeProps = {
  label: 'name',
  value: 'id',
  children: 'childrens',
};
const fileFormatOption = [
{
  {
    value: '',
    label: '全部',
  },
@@ -157,21 +179,17 @@
    label: '红外',
  },
];
const startTime = dayjs().subtract(6, 'day').startOf('day')
const endTime = dayjs().endOf('day')
const timeRange = [startTime.format('YYYY-MM-DD HH:mm:ss'), endTime.format('YYYY-MM-DD HH:mm:ss')]
const dateRange = ref(timeRange);
const timeFormat = 'YYYY-MM-DD HH:mm:ss';
const searchForm = reactive({
  jobName: '', //任务名称
  name: '', //文件名称
  areaCode: userAreaCode.value, // 区域code
  endTime:  endTime.format(timeFormat), // 结束时间
  startTime: startTime.format(timeFormat), // 开始时间
  deviceSn: '', // 所属机巢
  resultType: '', //文件格式
  photoType: '', //文件类别
});
watch(
  () => searchForm.resultType,
  newVal => {
    if (newVal === '4') {
      disabled.value = true;
    } else {
      disabled.value = false;
    }
  },
  { deep: true }
);
// 部门
let deptTreeData = ref([]);
@@ -196,7 +214,7 @@
      }, 0);
      return;
    }
    // 更新搜索表单中的时间
    searchForm.startTime = start.format(timeFormat);
    searchForm.endTime = end.format(timeFormat);
@@ -224,7 +242,7 @@
    searchForm.deviceSn = signDevice_sn.value;
  }
  // 所属部门重新请求值
  deptData.value = [];
  getDeptsByAreaCode();
};
@@ -256,26 +274,25 @@
// 清空
const handleReset = () => {
  dateRange.value = timeRange;
searchForm.jobName = ''
searchForm.name = ''
searchForm.areaCode = userAreaCode.value
searchForm.endTime = endTime.format(timeFormat)
searchForm.startTime = startTime.format(timeFormat)
searchForm.deviceSn = ''
searchForm.resultType = ''
searchForm.photoType = ''
  searchForm.jobName = '';
  searchForm.name = '';
  searchForm.areaCode = userAreaCode.value;
  searchForm.endTime = endTime.format(timeFormat);
  searchForm.startTime = startTime.format(timeFormat);
  searchForm.deviceSn = '';
  searchForm.resultType = '';
  searchForm.photoType = '';
  handleNodeClick({ id: userAreaCode.value });
  handleSearch();
};
// 下载
const downloadFun =()=>{
const downloadFun = () => {
  emit('downFun');
}
};
// 全部下载
const allDownloadFun =()=>{
    emit('allDownFun');
}
const allDownloadFun = () => {
  emit('allDownFun');
};
onMounted(() => {
  requestDockInfo();
});
src/views/dataCenter/dataCenter.vue
@@ -328,24 +328,20 @@
// 处理区域名称的函数
function processAddress(str) {
  if (!str) return '';
  const parts = str.split(',');
  // 省级账号:显示市和区(去除省级)
  if (isProvinceLevel.value) {
    return parts.filter(part => !part.endsWith('省')).join(',');
  }
  // 市级账号:只显示区(去除省和市)
  if (isCityLevel.value) {
    return parts.filter(part => !part.endsWith('省') && !part.endsWith('市')).join(',');
  }
  // 区县级账号:不显示区域信息(在模板中已隐藏该列)
  return '';
}
const showRegionColumn = computed(() => {
  // 检查表格数据中是否有任何行的 regionName 处理后不为空
  // 是否显示列
  return tableData.value.some(row => {
    const processed = processAddress(row.regionName || '');
    return processed !== '';
@@ -388,8 +384,12 @@
    orderByCreateTime: jobListParams.orderByCreateTime,
    ...jobListParams.searchParams,
  };
  getaiImagesPageAPI(params, { current: jobListParams.current, size: jobListParams.size }).then(
    res => {
  getaiImagesPageAPI(params, {
    current: jobListParams.current,
    size: jobListParams.size
  })
    .then(res => {
      total.value = res.data.data.total;
      tableData.value = res.data.data.records.map(i => ({
        ...i,
@@ -399,10 +399,14 @@
        showUrl: getShowImg(i?.link),
        file_name: i.name.split('/').pop(),
      }));
      loadings.value = false;
    }
  );
    })
    .catch(error => {
      // 可选:这里可以添加错误处理逻辑
      console.error("获取数据失败:", error);
    })
    .finally(() => {
      loadings.value = false; // 无论成功失败都会执行
    });
};
// 查询
const searchClick = params => {