| | |
| | | }; |
| | | }); |
| | | |
| | | const selectedPointDetailItem = computed<ListItem | null>(() => { |
| | | if (activeTab.value !== "point") return null; |
| | | if (pointCreateMode.value || pointPanelClosed.value) return null; |
| | | if (!pointDetailData.value || !selectedId.value) return null; |
| | | if (String(pointDetailData.value.id || "") !== String(selectedId.value)) |
| | | return null; |
| | | return mapPointApiItemToListItem(pointDetailData.value); |
| | | }); |
| | | |
| | | const selectedItem = computed(() => { |
| | | if (activeTab.value === "point") { |
| | | if (pointCreateMode.value) return null; |
| | | if (pointPanelClosed.value) return null; |
| | | return pointData.value.find((item) => item.id === selectedId.value) || null; |
| | | return ( |
| | | pointData.value.find( |
| | | (item) => String(item.id) === String(selectedId.value) |
| | | ) || |
| | | selectedPointDetailItem.value || |
| | | null |
| | | ); |
| | | } |
| | | if (activeTab.value === "fence" && fenceCreateMode.value) return null; |
| | | if (activeTab.value === "fence") |
| | |
| | | watch(currentList, (list) => { |
| | | if (activeTab.value === "point") { |
| | | if (pointCreateMode.value) return; |
| | | const selectedPointDetailId = String(pointDetailData.value?.id || ""); |
| | | if ( |
| | | selectedId.value && |
| | | selectedPointDetailId && |
| | | selectedPointDetailId === String(selectedId.value) |
| | | ) |
| | | return; |
| | | if ( |
| | | selectedId.value && |
| | | (pendingWorkbenchType.value === "detail" || |
| | | pendingWorkbenchType.value === "edit" || |
| | | hasActiveWorkbenchEntryQuery()) |
| | | ) |
| | | return; |
| | | const availableList = list.filter((item) => item.source !== "amap"); |
| | | if (!availableList.length) { |
| | | selectedId.value = ""; |