无人机管理后台前端(已迁走)
张含笑
2025-06-19 9decbadee82b4c4dd8f755dc01e3311487bcaee0
feat:区域显示
1 files modified
63 ■■■■ changed files
src/views/dataCenter/dataCenter.vue 63 ●●●● patch | view | raw | blame | history
src/views/dataCenter/dataCenter.vue
@@ -25,7 +25,11 @@
            }}
          </template>
        </el-table-column>
        <el-table-column prop="regionName" label="所属区域" />
        <el-table-column prop="regionName" label="所属区域" v-if="showRegionColumn">
          <template #default="scope">
            <span>{{processAddress(scope.row.regionName)}}</span>
          </template>
        </el-table-column>
        <el-table-column property="nestName" label="所属机巢" />
        <el-table-column property="jobName" label="任务名称" show-overflow-tooltip />
        <el-table-column prop="nickName" label="文件名称" show-overflow-tooltip />
@@ -83,7 +87,7 @@
            <span
              class="location"
              @click="positionDetail(scope.row)"
             v-if="shouldShowLocation(scope.row)"
              v-if="shouldShowLocation(scope.row)"
              >定位</span
            >
          </template>
@@ -273,7 +277,34 @@
  visible: '可见光',
  ir: '红外',
};
// 判断省市区
function processAddress(str) {
  const parts = str.split(',');
  // 检查是否有省级单位(以"省"结尾)
  const hasProvince = parts.some(part => part.endsWith('省'));
  // 检查是否有市级单位(以"市"结尾)
  const hasCity = parts.some(part => part.endsWith('市'));
  if (hasProvince) {
    // 移除省级部分(第一个以"省"结尾的元素)
    return parts.filter(part => !part.endsWith('省')).join(',');
  } else if (hasCity) {
    // 如果有市,返回空字符串
    return '';
  }
  // 既没有省也没有市,返回原字符串
  return str;
}
const showRegionColumn = computed(() => {
  // 检查表格数据中是否有任何行的 regionName 处理后不为空
  return tableData.value.some(row => {
    const processed = processAddress(row.regionName || '');
    return processed !== '';
  });
});
const loadings = ref(true);
let loading;
const total = ref(0);
@@ -536,9 +567,9 @@
  if (lastDot === -1) return false; // 无后缀
  return filename.slice(lastDot + 1).toLowerCase() === 'tif';
}
const shouldShowLocation=(row)=>{
return row.resultType !== 1 && row.resultType !== 4
}
const shouldShowLocation = row => {
  return row.resultType !== 1 && row.resultType !== 4;
};
const dialogVisible = ref(false);
const dialogDetailList = ref(null);
const detailTitle = ref('');
@@ -551,8 +582,8 @@
    getOrthoimageInfo(val.wayLineJobId).then(async res => {
      dialogVisible.value = true;
      detailTitle.value = val.nickName;
      dialogDetailList.value = val;
      await nextTick()
      dialogDetailList.value = val;
      await nextTick();
      initMap();
      orthoimageApi.value = res.data.data.orthoimageApi;
      odmToken.value = res.data.data.odmToken;
@@ -564,27 +595,29 @@
            }`,
            // maximumLevel: 12,
          })
        );
        yxShowBox.value = true;
      }
    });
  } else {
    getAttachInfoAPI(val.id).then(res => {
      detailTitle.value = res.data.data.nickName.split('.jpeg')[0];
      // dialogDetailList.value = res.data.data;
      dialogDetailList.value = { ...res.data.data, checkedinput: false,    editName: res.data.data?.nickName?.split('.jpeg')[0], };
      dialogDetailList.value = {
        ...res.data.data,
        checkedinput: false,
        editName: res.data.data?.nickName?.split('.jpeg')[0],
      };
      dialogVisible.value = true;
    });
  }
};
function dialogClose(){
 // 对话框关闭时清理资源
    viewInstance.value?.viewerDestroy();
    viewer = null;
    isMapInitialized.value = false;
function dialogClose() {
  // 对话框关闭时清理资源
  viewInstance.value?.viewerDestroy();
  viewer = null;
  isMapInitialized.value = false;
}
onMounted(() => {
  getaiImagesPage();