From c65235f3779eaa223770ae29d9126d470c6bd434 Mon Sep 17 00:00:00 2001 From: wintsa <770775984@qq.com> Date: Mon, 11 May 2026 10:30:14 +0800 Subject: [PATCH] feat: switch to building facility object --- README.md | 6 +++--- src/App.tsx | 12 +++++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 7a6c5f3..ecf9790 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ -# 组团趋势图 +# 建筑设施对象趋势图 -这是一个基于 `React + AG Charts` 的组团趋势图页面,用来查看不同分类维度下的年度统计趋势,并通过右侧筛选条件联动图表结果。 +这是一个基于 `React + AG Charts` 的建筑设施对象趋势图页面,用来查看不同分类维度下的年度统计趋势,并通过右侧筛选条件联动图表结果。 ## 功能 -- 左侧展示组团趋势图,支持最低值、最高值、平均值、中位数和数据量切换 +- 左侧展示建筑设施对象趋势图,支持最低值、最高值、平均值、中位数和数据量切换 - 右侧展示分类树,支持按 `自然地理区位 / 设施类别 / 建设阶段 / 规划形式` 选择节点 - 筛选条件支持 `省市区`,后端会根据 `uf_xzqy` 展开到区级 `id` 后再过滤 - 支持搜索筛选树节点,支持多条件叠加 diff --git a/src/App.tsx b/src/App.tsx index f0d1000..a6a6361 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -18,6 +18,12 @@ ModuleRegistry.registerModules([AnnotationsModule, ContextMenuModule, ZoomModule const API_BASE_URL = 'https://nest.zwgczx.com/api/v1'; // const API_BASE_URL = 'http://127.0.0.1:9089/api/v1'; +const API_ROUTES = { + filterTree: '/zw/getBuildingFacilityObjectFilterTree', + filterTreeSearch: '/zw/getBuildingFacilityObjectFilterTreeSearch', + statsBatch: '/zw/getBuildingFacilityObjectStatsBatch', +} as const; + const statisticOptions = [ { key: 'minValue', label: '最低值', shortLabel: '低' }, { key: 'maxValue', label: '最高值', shortLabel: '高' }, @@ -729,7 +735,7 @@ function App() { }; const fetchRegionFilterTree = async (signal?: AbortSignal) => { - const response = await fetch(`${API_BASE_URL}/zw/getBuildingFunctionCostFilterTree?${buildQuery({ key: 'region' })}`, { + const response = await fetch(`${API_BASE_URL}${API_ROUTES.filterTree}?${buildQuery({ key: 'region' })}`, { signal, headers: { 'X-Requested-With': 'XMLHttpRequest', @@ -744,7 +750,7 @@ function App() { }; const fetchBackendFilterTreeSearch = async (filterKey: FilterKey, keyword: string, signal?: AbortSignal) => { - const response = await fetch(`${API_BASE_URL}/zw/getBuildingFunctionCostFilterTreeSearch?${buildQuery({ + const response = await fetch(`${API_BASE_URL}${API_ROUTES.filterTreeSearch}?${buildQuery({ key: filterKey, keyword, nodePrefix: isContentFilterKey(filterKey) ? getTreeNodePrefix(filterTreeByKey[filterKey]) : '', @@ -1127,7 +1133,7 @@ function App() { return; } - const response = await fetch(`${API_BASE_URL}/zw/getBuildingFunctionCostStatsBatch`, { + const response = await fetch(`${API_BASE_URL}${API_ROUTES.statsBatch}`, { method: 'POST', signal: controller.signal, headers: {