|
|
|
@ -15,13 +15,13 @@ |
|
|
|
|
|
|
|
|
|
|
|
<div class="forest-grass-wet-ui ecological-protection-ui"> |
|
|
|
<div class="forest-grass-wet-ui ecological-protection-ui"> |
|
|
|
<div |
|
|
|
<div |
|
|
|
v-if="isEcologicalDirectView && ecologicalDirectDataState !== 'ready'" |
|
|
|
v-if="isEcologicalDataView && ecologicalDataState !== 'ready'" |
|
|
|
class="fgw-data-state" |
|
|
|
class="fgw-data-state" |
|
|
|
:class="{ 'is-error': ecologicalDirectDataState === 'error' }" |
|
|
|
:class="{ 'is-error': ecologicalDataState === 'error' }" |
|
|
|
role="status" |
|
|
|
role="status" |
|
|
|
aria-live="polite" |
|
|
|
aria-live="polite" |
|
|
|
> |
|
|
|
> |
|
|
|
{{ ecologicalDirectDataStateMessage }} |
|
|
|
{{ ecologicalDataStateMessage }} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div v-if="!isEngineeringAnalysis" class="fgw-left"> |
|
|
|
<div v-if="!isEngineeringAnalysis" class="fgw-left"> |
|
|
|
<div class="fgw-side-stack is-left"> |
|
|
|
<div class="fgw-side-stack is-left"> |
|
|
|
@ -229,7 +229,8 @@ const redlinePanels = ref(buildEcologicalRedlinePanels()) |
|
|
|
const redlineDataState = ref("loading") |
|
|
|
const redlineDataState = ref("loading") |
|
|
|
const naturalProtectedAreaPanels = ref(buildNaturalProtectedAreaPanels()) |
|
|
|
const naturalProtectedAreaPanels = ref(buildNaturalProtectedAreaPanels()) |
|
|
|
const naturalProtectedAreaDataState = ref("loading") |
|
|
|
const naturalProtectedAreaDataState = ref("loading") |
|
|
|
const nationalParkPanels = ref(buildNationalParkPanels({})) |
|
|
|
const nationalParkPanels = ref(buildNationalParkPanels()) |
|
|
|
|
|
|
|
const nationalParkDataState = ref("loading") |
|
|
|
const restorationPanels = ref(buildEcologicalRestorationPanels({})) |
|
|
|
const restorationPanels = ref(buildEcologicalRestorationPanels({})) |
|
|
|
const selectedFeature = ref(null) |
|
|
|
const selectedFeature = ref(null) |
|
|
|
const featureEmpty = ref(false) |
|
|
|
const featureEmpty = ref(false) |
|
|
|
@ -297,15 +298,24 @@ const isEngineeringAnalysis = computed(() => currentView.value === "engineering- |
|
|
|
const isProjectDetailView = computed(() => ["restoration", "engineering-analysis"].includes(currentView.value)) |
|
|
|
const isProjectDetailView = computed(() => ["restoration", "engineering-analysis"].includes(currentView.value)) |
|
|
|
const isEcologicalRedlineView = computed(() => currentView.value === "ecological-redline") |
|
|
|
const isEcologicalRedlineView = computed(() => currentView.value === "ecological-redline") |
|
|
|
const isNaturalProtectedAreaView = computed(() => currentView.value === "natural-protected-area") |
|
|
|
const isNaturalProtectedAreaView = computed(() => currentView.value === "natural-protected-area") |
|
|
|
const isEcologicalDirectView = computed(() => isEcologicalRedlineView.value || isNaturalProtectedAreaView.value) |
|
|
|
const isNationalParkView = computed(() => currentView.value === "national-park") |
|
|
|
const ecologicalDirectDataState = computed(() => ( |
|
|
|
const isEcologicalDataView = computed(() => ( |
|
|
|
isEcologicalRedlineView.value ? redlineDataState.value : naturalProtectedAreaDataState.value |
|
|
|
isEcologicalRedlineView.value || isNaturalProtectedAreaView.value || isNationalParkView.value |
|
|
|
)) |
|
|
|
)) |
|
|
|
const ecologicalDirectDataStateMessage = computed(() => { |
|
|
|
const ecologicalDataState = computed(() => { |
|
|
|
const featureName = isEcologicalRedlineView.value ? "生态保护红线" : "自然保护地" |
|
|
|
if (isEcologicalRedlineView.value) return redlineDataState.value |
|
|
|
if (ecologicalDirectDataState.value === "loading") return `${featureName}数据加载中` |
|
|
|
if (isNaturalProtectedAreaView.value) return naturalProtectedAreaDataState.value |
|
|
|
if (ecologicalDirectDataState.value === "empty") return `${featureName}暂无数据` |
|
|
|
return nationalParkDataState.value |
|
|
|
if (ecologicalDirectDataState.value === "error") return `${featureName}数据加载失败,请稍后重试` |
|
|
|
}) |
|
|
|
|
|
|
|
const ecologicalDataStateMessage = computed(() => { |
|
|
|
|
|
|
|
const featureName = isEcologicalRedlineView.value |
|
|
|
|
|
|
|
? "生态保护红线" |
|
|
|
|
|
|
|
: isNaturalProtectedAreaView.value |
|
|
|
|
|
|
|
? "自然保护地" |
|
|
|
|
|
|
|
: "国家公园" |
|
|
|
|
|
|
|
if (ecologicalDataState.value === "loading") return `${featureName}数据加载中` |
|
|
|
|
|
|
|
if (ecologicalDataState.value === "empty") return `${featureName}暂无数据` |
|
|
|
|
|
|
|
if (ecologicalDataState.value === "error") return `${featureName}数据加载失败,请稍后重试` |
|
|
|
return "" |
|
|
|
return "" |
|
|
|
}) |
|
|
|
}) |
|
|
|
const baseActiveLayer = computed(() => activeLayerKey.value ? getLayerByKey(currentView.value, activeLayerKey.value) : null) |
|
|
|
const baseActiveLayer = computed(() => activeLayerKey.value ? getLayerByKey(currentView.value, activeLayerKey.value) : null) |
|
|
|
@ -440,7 +450,8 @@ function syncView(viewKey) { |
|
|
|
naturalProtectedAreaPanels.value = buildNaturalProtectedAreaPanels() |
|
|
|
naturalProtectedAreaPanels.value = buildNaturalProtectedAreaPanels() |
|
|
|
} |
|
|
|
} |
|
|
|
if (isNationalPark) { |
|
|
|
if (isNationalPark) { |
|
|
|
nationalParkPanels.value = buildNationalParkPanels({}) |
|
|
|
nationalParkDataState.value = "loading" |
|
|
|
|
|
|
|
nationalParkPanels.value = buildNationalParkPanels() |
|
|
|
} |
|
|
|
} |
|
|
|
if (isRestoration) { |
|
|
|
if (isRestoration) { |
|
|
|
restorationPanels.value = buildEcologicalRestorationPanels({}) |
|
|
|
restorationPanels.value = buildEcologicalRestorationPanels({}) |
|
|
|
@ -455,7 +466,7 @@ function syncView(viewKey) { |
|
|
|
items: isRedline || isNaturalProtectedArea |
|
|
|
items: isRedline || isNaturalProtectedArea |
|
|
|
? [] |
|
|
|
? [] |
|
|
|
: isNationalPark |
|
|
|
: isNationalPark |
|
|
|
? getNationalParkTopStats({}) |
|
|
|
? [] |
|
|
|
: isRestoration |
|
|
|
: isRestoration |
|
|
|
? getEcologicalRestorationTopStats({}) |
|
|
|
? getEcologicalRestorationTopStats({}) |
|
|
|
: [], |
|
|
|
: [], |
|
|
|
@ -527,10 +538,13 @@ async function loadEcologicalRestorationStats(viewKey) { |
|
|
|
|
|
|
|
|
|
|
|
async function loadNationalParkStats(viewKey) { |
|
|
|
async function loadNationalParkStats(viewKey) { |
|
|
|
const requestId = ++nationalParkStatsRequestId |
|
|
|
const requestId = ++nationalParkStatsRequestId |
|
|
|
|
|
|
|
nationalParkDataState.value = "loading" |
|
|
|
|
|
|
|
nationalParkPanels.value = buildNationalParkPanels() |
|
|
|
try { |
|
|
|
try { |
|
|
|
const stats = nationalParkStatsCache || await getNationalParkStats() |
|
|
|
const stats = nationalParkStatsCache || await getNationalParkStats() |
|
|
|
if (requestId !== nationalParkStatsRequestId || currentView.value !== viewKey) return |
|
|
|
if (requestId !== nationalParkStatsRequestId || currentView.value !== viewKey) return |
|
|
|
nationalParkStatsCache = stats |
|
|
|
nationalParkStatsCache = stats |
|
|
|
|
|
|
|
nationalParkDataState.value = stats.dataState |
|
|
|
nationalParkPanels.value = buildNationalParkPanels(stats) |
|
|
|
nationalParkPanels.value = buildNationalParkPanels(stats) |
|
|
|
mapRanking.value = getEcologicalMapRanking(viewKey, stats) |
|
|
|
mapRanking.value = getEcologicalMapRanking(viewKey, stats) |
|
|
|
emit("module-stats", { |
|
|
|
emit("module-stats", { |
|
|
|
@ -540,12 +554,13 @@ async function loadNationalParkStats(viewKey) { |
|
|
|
}) |
|
|
|
}) |
|
|
|
} catch (error) { |
|
|
|
} catch (error) { |
|
|
|
if (requestId !== nationalParkStatsRequestId || currentView.value !== viewKey) return |
|
|
|
if (requestId !== nationalParkStatsRequestId || currentView.value !== viewKey) return |
|
|
|
nationalParkPanels.value = buildNationalParkPanels({}) |
|
|
|
nationalParkDataState.value = "error" |
|
|
|
|
|
|
|
nationalParkPanels.value = buildNationalParkPanels() |
|
|
|
mapRanking.value = getEcologicalMapRanking(viewKey) |
|
|
|
mapRanking.value = getEcologicalMapRanking(viewKey) |
|
|
|
emit("module-stats", { |
|
|
|
emit("module-stats", { |
|
|
|
moduleKey: "ecological-protection", |
|
|
|
moduleKey: "ecological-protection", |
|
|
|
viewKey, |
|
|
|
viewKey, |
|
|
|
items: getNationalParkTopStats({}), |
|
|
|
items: [], |
|
|
|
}) |
|
|
|
}) |
|
|
|
layerStatus.value = { |
|
|
|
layerStatus.value = { |
|
|
|
type: "error", |
|
|
|
type: "error", |
|
|
|
|