董国庆
2026-06-30 a6096db19efba2b79efd0924b202b6caf563bc7d
Merge branch 'deploy-2.0' into feat/deploy-2.0
2个文件已修改
141 ■■■■■ 已修改文件
src/views/businessOperations/operationWorkbench/map.vue 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/testDemo/operationWorkbench/map.vue 94 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/businessOperations/operationWorkbench/map.vue
@@ -1416,6 +1416,8 @@
const fenceHoverTooltipText = ref('')
const fenceHoverTooltipType = ref<'enabled' | 'disabled' | 'testing'>('testing')
const fenceCreateOutsideCurrentCity = ref(false)
const hoveredFencePolygon = shallowRef<any | null>(null)
const hoveredFenceBaseStrokeWeight = ref<number | null>(null)
const fenceHoverTooltipPosition = reactive({
  x: 0,
  y: 0,
@@ -2016,10 +2018,38 @@
  }
}
function resetFenceHoverPolygonStyle() {
  if (hoveredFencePolygon.value && hoveredFenceBaseStrokeWeight.value !== null) {
    hoveredFencePolygon.value.setOptions({
      strokeWeight: hoveredFenceBaseStrokeWeight.value,
    })
  }
  hoveredFencePolygon.value = null
  hoveredFenceBaseStrokeWeight.value = null
}
function highlightFenceHoverPolygon(polygon: any, item: any) {
  if (Number(item?.areaType) !== 1)
    return
  if (hoveredFencePolygon.value === polygon)
    return
  resetFenceHoverPolygonStyle()
  const currentStrokeWeight = Number(polygon?.getExtData?.()?.baseStrokeWeight ?? 2)
  hoveredFencePolygon.value = polygon
  hoveredFenceBaseStrokeWeight.value = currentStrokeWeight
  polygon.setOptions({
    strokeWeight: currentStrokeWeight + 1,
  })
}
function hideFenceHoverTooltip() {
  clearFenceHoverTooltipTimer()
  pendingFenceHoverKey = ''
  pendingFenceHoverPixel = null
  resetFenceHoverPolygonStyle()
  fenceHoverTooltipVisible.value = false
  fenceHoverTooltipText.value = ''
  fenceHoverTooltipType.value = 'testing'
@@ -9104,6 +9134,13 @@
        const shouldBlockAreaClick
          = areaType === 2 && isDisabledFenceArea
        const fencePriority = getFenceOverlayPriority(item)
        const baseStrokeWeight = areaType === 2
          ? 0
          : isFenceDetailActive
              ? 2
              : isActive
                ? 3
                : 2
        const polygon = new (window as any).AMap.Polygon({
          path: points,
          fillColor:
@@ -9130,13 +9167,7 @@
                  : isFenceReadonlyDimmed
                    ? '#AEB0B2'
                    : '#AEB0B2',
          strokeWeight: areaType === 2
            ? 0
            : isFenceDetailActive
              ? 2
              : isActive
                ? 3
                : 2,
          strokeWeight: baseStrokeWeight,
          strokeOpacity:
            isFenceDisabledReadonly
              ? 0.3
@@ -9212,6 +9243,7 @@
          handleMapEntityClick('fence', currentFenceId)
        })
        polygon.on('mouseover', (event: any) => {
          highlightFenceHoverPolygon(polygon, item)
          scheduleFenceHoverTooltip(item, event?.pixel || null)
        })
        polygon.on('mousemove', (event: any) => {
@@ -9228,6 +9260,7 @@
          type: 'fence',
          areaType,
          areaId: String(item.id || ''),
          baseStrokeWeight,
        })
        return polygon
      })
src/views/testDemo/operationWorkbench/map.vue
@@ -511,7 +511,7 @@
      'white-space: normal',
      'word-break: break-word',
    ].join(';')
    text.innerHTML = '拖动橙色实心点增加顶点<br />点击白色实心点删除顶点'
    text.innerHTML = `拖动${fenceCreateMode.value ? '橙色' : '蓝色'}实心点增加顶点<br />点击白色实心点删除顶点`
    const arrow = document.createElement('div')
    arrow.style.cssText = [
      'position: absolute',
@@ -540,6 +540,10 @@
    return
  }
  fenceEditGuideMarker.value.setPosition([lng, lat])
  const guideTextElement = fenceEditGuideContentElement?.querySelector?.('.fence-edit-guide__text') as HTMLDivElement | null
  if (guideTextElement) {
    guideTextElement.innerHTML = `拖动${fenceCreateMode.value ? '橙色' : '蓝色'}实心点增加顶点<br />点击白色实心点删除顶点`
  }
  applyFenceEditGuidePlacement(layout.placement, layout.offset)
}
@@ -1086,6 +1090,8 @@
const fenceHoverTooltipText = ref('')
const fenceHoverTooltipType = ref<'enabled' | 'disabled' | 'testing'>('testing')
const fenceCreateOutsideCurrentCity = ref(false)
const hoveredFencePolygon = shallowRef<any | null>(null)
const hoveredFenceBaseStrokeWeight = ref<number | null>(null)
const cityBoundaryHoverPosition = reactive({
  x: 0,
  y: 0,
@@ -1526,10 +1532,38 @@
  }
}
function resetFenceHoverPolygonStyle() {
  if (hoveredFencePolygon.value && hoveredFenceBaseStrokeWeight.value !== null) {
    hoveredFencePolygon.value.setOptions({
      strokeWeight: hoveredFenceBaseStrokeWeight.value,
    })
  }
  hoveredFencePolygon.value = null
  hoveredFenceBaseStrokeWeight.value = null
}
function highlightFenceHoverPolygon(polygon: any, item: any) {
  if (Number(item?.areaType) !== 1)
    return
  if (hoveredFencePolygon.value === polygon)
    return
  resetFenceHoverPolygonStyle()
  const currentStrokeWeight = Number(polygon?.getExtData?.()?.baseStrokeWeight ?? 2)
  hoveredFencePolygon.value = polygon
  hoveredFenceBaseStrokeWeight.value = currentStrokeWeight
  polygon.setOptions({
    strokeWeight: currentStrokeWeight + 1,
  })
}
function hideFenceHoverTooltip() {
  clearFenceHoverTooltipTimer()
  pendingFenceHoverKey = ''
  pendingFenceHoverPixel = null
  resetFenceHoverPolygonStyle()
  fenceHoverTooltipVisible.value = false
  fenceHoverTooltipText.value = ''
  fenceHoverTooltipType.value = 'testing'
@@ -2163,10 +2197,10 @@
  )
  if (activeRestrictedArea) {
    if (activeRestrictedArea.points.length < 3)
      return '请在地图上【橙色运营区域】绘制多边形区域,双击闭合'
      return `请在地图上【${getFenceDraftAccentLabel()}运营区域】绘制多边形区域,双击闭合`
    if (isFenceGeometryLocked.value)
      return '【红色禁行区】已选中'
    return '【红色禁行区】可调整区域点位,请保持在橙色运营区内'
    return `【红色禁行区】可调整区域点位,请保持在${getFenceDraftAccentLabel()}运营区内`
  }
  return ''
})
@@ -3314,6 +3348,14 @@
  })
}
function getFenceDraftAccentColor() {
  return fenceCreateMode.value ? '#F19216' : '#2F7BFF'
}
function getFenceDraftAccentLabel() {
  return fenceCreateMode.value ? '橙色' : '蓝色'
}
function syncFenceStationWarningState(points: LngLatTuple[] = fenceDraftPoints.value) {
  invalidFenceStationIds.value = []
  setFenceDraftPolygonStyle(fenceInteractionMode.value === 'operation-edit')
@@ -3323,9 +3365,10 @@
function setFenceDraftPolygonStyle(editable: boolean) {
  if (!fenceDraftPolygon.value)
    return
  const accentColor = getFenceDraftAccentColor()
  fenceDraftPolygon.value.setOptions({
    fillColor: '#F19216',
    strokeColor: '#F19216',
    fillColor: accentColor,
    strokeColor: accentColor,
    strokeWeight: 2,
    strokeOpacity: 1,
    fillOpacity: 0.1,
@@ -3383,10 +3426,11 @@
    return
  if (fenceDraftPolygon.value)
    map.value.remove(fenceDraftPolygon.value)
  const accentColor = getFenceDraftAccentColor()
  fenceDraftPolygon.value = new (window as any).AMap.Polygon({
    path: points,
    fillColor: '#F19216',
    strokeColor: '#F19216',
    fillColor: accentColor,
    strokeColor: accentColor,
    strokeWeight: 2,
    strokeOpacity: 1,
    fillOpacity: 0.1,
@@ -3419,12 +3463,12 @@
    fenceDraftPolygon.value,
    {
      controlPoint: {
        strokeColor: '#F19216',
        strokeColor: getFenceDraftAccentColor(),
        strokeOpacity: 1,
        strokeWeight: 2,
      },
      midControlPoint: { fillColor: '#F19216' },
      editOptions: { fillColor: '#F19216' },
      midControlPoint: { fillColor: getFenceDraftAccentColor() },
      editOptions: { fillColor: getFenceDraftAccentColor() },
    },
  )
  fencePolyEditor.value.open()
@@ -3499,12 +3543,13 @@
    return
  cleanupFenceEditorState()
  lastValidFenceDrawingPoints.value = []
  const accentColor = getFenceDraftAccentColor()
  fenceMouseTool.value = new (window as any).AMap.MouseTool(map.value)
  fenceMouseTool.value.polygon({
    strokeColor: '#F19216',
    strokeColor: accentColor,
    strokeOpacity: 1,
    strokeWeight: 2,
    fillColor: '#F19216',
    fillColor: accentColor,
    fillOpacity: 0.1,
    strokeStyle: 'solid',
    cursor: 'pointer',
@@ -8791,6 +8836,17 @@
        // 非启用中的选中围栏使用蓝色选中态;启用中的围栏即使被选中也保持绿色。
        const isFenceSelectedBlue = isFenceDetailActive && !isFenceEnabled
        const isFenceHighlighted = isFenceDetailActive || isFenceEnabled
        const baseStrokeWeight = areaType === 2
          ? 0
          : isFenceSelectedBlue
              ? 3
              : isFenceFlowCompletedDisabled
                ? 2
                : isFenceHighlighted
                  ? 2
                  : isActive
                    ? 3
                    : 2
        const polygon = new (window as any).AMap.Polygon({
          path: points,
          // 填充颜色
@@ -8824,17 +8880,7 @@
                      ? '#171F26'
                      : '#AEB0B2',
          // 线宽度
          strokeWeight: areaType === 2
            ? 0
            : isFenceSelectedBlue
              ? 3
              : isFenceFlowCompletedDisabled
                ? 2
                : isFenceHighlighted
                  ? 2
                  : isActive
                    ? 3
                    : 2,
          strokeWeight: baseStrokeWeight,
          // 线透明度
          strokeOpacity: areaType === 2 ? 0 : isFenceFlowCompletedDisabled ? 0.3 : isFenceHighlighted ? 1 : isFenceReadonlyDimmed ? 0.2 : 1,
          // 填充透明度
@@ -8911,6 +8957,7 @@
          handleMapEntityClick('fence', String(item.electronicId))
        })
        polygon.on('mouseover', (event: any) => {
          highlightFenceHoverPolygon(polygon, item)
          scheduleFenceHoverTooltip(item, event?.pixel || null)
        })
        polygon.on('mousemove', (event: any) => {
@@ -8927,6 +8974,7 @@
          type: 'fence',
          areaType,
          areaId: String(item.id || ''),
          baseStrokeWeight,
        })
        return polygon
      })