董国庆
2026-03-21 a526918a7ee0172486d87647a8f80b4638dd505b
修改文档问题
2个文件已修改
67 ■■■■■ 已修改文件
src/views/assetManagement/vehicleManagement/operatingVehicle/components/InspectionDetailModal.vue 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/businessOperations/pointManagement/index.vue 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/assetManagement/vehicleManagement/operatingVehicle/components/InspectionDetailModal.vue
@@ -88,7 +88,7 @@
                  src="/src/assets/element-img/file-icon.png"
                />
                <div class="file-name">{{ file.name }}</div>
                <div class="relative">
                <div class="relative mr-24px">
                  <img
                    class="file-look"
                    src="/src/assets/element-img/look.png"
@@ -149,7 +149,7 @@
                  src="/src/assets/element-img/file-icon.png"
                />
                <div class="file-name">{{ file.name }}</div>
                <div class="relative">
                <div class="relative mr-24px">
                  <img
                    class="file-look"
                    src="/src/assets/element-img/look.png"
@@ -197,7 +197,7 @@
                  src="/src/assets/element-img/file-icon.png"
                />
                <div class="file-name">{{ file.name }}</div>
                <div class="relative">
                <div class="relative mr-24px">
                  <img
                    class="file-look"
                    src="/src/assets/element-img/look.png"
@@ -288,7 +288,6 @@
      .file-look {
        width: 16px;
        height: 16px;
        margin-left: 24px;
      }
      .file-down {
        width: 16px;
src/views/businessOperations/pointManagement/index.vue
@@ -839,6 +839,49 @@
  }
}, { deep: true })
// 获取行政区划信息
async function getAdministrativeInfo(lng: number, lat: number) {
  return new Promise<{
    provinceName: string
    provinceCode: string
    cityName: string
    cityCode: string
    districtName: string
    districtCode: string
  } | null>((resolve) => {
    if (typeof AMap === 'undefined') {
      resolve(null)
      return
    }
    const geocoder = new AMap.Geocoder({
      city: '全国',
    })
    geocoder.getAddress([lng, lat], (status: string, result: any) => {
      if (status === 'complete' && result.regeocode) {
        const comp = result.regeocode.addressComponent
        const adcode = String(comp.adcode) // 6位区县编码
        // 提取省市区代码
        const provinceCode = `${adcode.substring(0, 2)}0000`
        const cityCode = `${adcode.substring(0, 4)}00`
        const districtCode = adcode
        resolve({
          provinceName: comp.province,
          provinceCode,
          cityName: Array.isArray(comp.city) ? comp.province : (comp.city || comp.province), // 直辖市 city 可能为空或数组
          cityCode: comp.citycode || cityCode, // 优先使用 AMap 的 citycode
          districtName: comp.district,
          districtCode,
        })
      }
      else {
        resolve(null)
      }
    })
  })
}
// 保存点位
async function handleSavePoint() {
  if (!currentPoint.value) {
@@ -949,6 +992,22 @@
    }
  }
  // 6. 获取省市区信息
  let administrativeInfo = {
    provinceName: '',
    provinceCode: '',
    cityName: '',
    cityCode: '',
    districtName: '',
    districtCode: '',
  }
  if (currentPoint.value.lon && currentPoint.value.lat) {
    const info = await getAdministrativeInfo(Number(currentPoint.value.lon), Number(currentPoint.value.lat))
    if (info) {
      administrativeInfo = info
    }
  }
  // 兜底:如果没有匹配到任何区域,或者计算失败,尝试使用默认值(虽然业务上应该报错提示)
  if (!electronicAreaId) {
    // const fallbackArea = electronicFenceAreas.value.find(area => area.areaType === 1) || electronicFenceAreas.value[0]
@@ -962,6 +1021,7 @@
  }
  const payload = {
    ...administrativeInfo,
    pointName: currentPoint.value.name,
    pointAddress: currentPoint.value.address,
    pointLon: currentPoint.value.lon,