| | |
| | | ); |
| | | }); |
| | | |
| | | const createToolTriggerLabel = computed(() => { |
| | | if (pointCreateMode.value) return "取消新建点位"; |
| | | if (fenceCreateMode.value) return "取消新建围栏"; |
| | | if (stationCreateMode.value) return "取消新建场站"; |
| | | return selectedCreateToolOption.value?.label || "创建工具"; |
| | | }); |
| | | |
| | | // 统一收口各个下拉弹层的展开状态,避免在模板中散落过多单独事件处理。 |
| | | function handleSelectShowUpdate(key: string, show: boolean) { |
| | | selectShowState[key] = show; |
| | |
| | | ) { |
| | | fencePolygons.value = fenceRenderAreaData.value |
| | | .filter((item: any) => { |
| | | if (!item.fencePoints) |
| | | return false; |
| | | const isDisabledFenceArea = Number(item.areaStatus || 1) === 2; |
| | | if ( |
| | | !item.fencePoints || |
| | | !isDisabledFenceArea && |
| | | !visibleFenceIdSet.value.has(String(item.electronicId)) |
| | | ) |
| | | return false; |
| | |
| | | }) |
| | | .map((item) => { |
| | | const areaType = Number(item.areaType); |
| | | const isDisabledFenceArea = Number(item.areaStatus || 1) === 2; |
| | | const points = String(item.fencePoints) |
| | | .split(",") |
| | | .map((pointStr: string) => { |
| | |
| | | !isFenceFormMode.value && |
| | | isActive && |
| | | readonlyRestrictedAreaId.value === String(item.id); |
| | | const isFenceReadonlyDimmed = areaType === 1 && !isActive; |
| | | const isFenceReadonlyDimmed = |
| | | areaType === 1 && !isActive && !isDisabledFenceArea; |
| | | const isFenceDetailActive = |
| | | areaType === 1 && isActive && !isFenceFormMode.value; |
| | | areaType === 1 && |
| | | isActive && |
| | | !isFenceFormMode.value && |
| | | !isDisabledFenceArea; |
| | | const polygon = new (window as any).AMap.Polygon({ |
| | | path: points, |
| | | fillColor: |
| | | areaType === 2 |
| | | isDisabledFenceArea |
| | | ? "#000000" |
| | | : areaType === 2 |
| | | ? isReadonlyRestrictedActive |
| | | ? "#F14637" |
| | | : "#EF938B" |
| | |
| | | ? "#171F26" |
| | | : "#171F26", |
| | | strokeColor: |
| | | areaType === 2 |
| | | isDisabledFenceArea |
| | | ? "#000000" |
| | | : areaType === 2 |
| | | ? isReadonlyRestrictedActive |
| | | ? "#F14637" |
| | | : "#EF938B" |
| | |
| | | : isActive |
| | | ? 3 |
| | | : 2, |
| | | strokeOpacity: areaType === 2 ? 0 : 1, |
| | | strokeOpacity: isDisabledFenceArea ? 0 : areaType === 2 ? 0 : 1, |
| | | fillOpacity: |
| | | areaType === 2 |
| | | isDisabledFenceArea |
| | | ? 0 |
| | | : areaType === 2 |
| | | ? isReadonlyRestrictedActive |
| | | ? 1 |
| | | : 1 |
| | |
| | | ? "dashed" |
| | | : "solid", |
| | | clickable: |
| | | !isDisabledFenceArea && |
| | | !isPointMapPickActive.value && |
| | | !isFenceFormMode.value && |
| | | !isStationFormMode.value, |
| | |
| | | }); |
| | | polygon.on("click", () => { |
| | | if ( |
| | | isDisabledFenceArea || |
| | | isPointMapPickActive.value || |
| | | isFenceFormMode.value || |
| | | isStationFormMode.value |
| | |
| | | class="operate-icon operate-main-icon" |
| | | /> |
| | | <div class="selected-create-tool-text"> |
| | | {{ selectedCreateToolOption.label }} |
| | | {{ createToolTriggerLabel }} |
| | | </div> |
| | | </div> |
| | | </template> |