'commit'
This commit is contained in:
@@ -5,15 +5,11 @@ from Model.RenkouModel import RenkouModel
|
||||
# 创建APIRouter实例
|
||||
router = APIRouter(prefix="/bigscreen", tags=["大屏展示"])
|
||||
|
||||
# 定义路由
|
||||
# 默认的根路由
|
||||
@router.get("/")
|
||||
async def root():
|
||||
return {"message": "Welcome to YunNan Education World!"}
|
||||
|
||||
@router.get("/chart/bar")
|
||||
async def get_bar_chart_config():
|
||||
return RenkouModel.generate_population_chart_config()
|
||||
|
||||
@router.get("/population/chart/{year}")
|
||||
async def get_population_chart_config(year: str = "2024"):
|
||||
return RenkouModel.generate_population_chart_config(year)
|
||||
@@ -22,6 +18,3 @@ async def get_population_chart_config(year: str = "2024"):
|
||||
async def get_urbanization_rate_chart_config():
|
||||
return RenkouModel.generate_urbanization_rate_chart_config()
|
||||
|
||||
@router.get("/population/data")
|
||||
async def get_population_data():
|
||||
return {"data": RenkouModel.load_population_data()}
|
||||
|
BIN
Controller/__pycache__/BigScreenController.cpython-310.pyc
Normal file
BIN
Controller/__pycache__/BigScreenController.cpython-310.pyc
Normal file
Binary file not shown.
2
Start.py
2
Start.py
@@ -3,7 +3,7 @@
|
||||
from fastapi import FastAPI
|
||||
from fastapi.staticfiles import StaticFiles
|
||||
import uvicorn
|
||||
from Controller.BigScreen import router as bigscreen_router
|
||||
from Controller.BigScreenController import router as bigscreen_router
|
||||
|
||||
# 创建 FastAPI 应用实例
|
||||
app = FastAPI(title="云南教育决策研究服务系统", description="云南省教育数据分析和可视化平台")
|
||||
|
@@ -65,6 +65,9 @@ $(document).ready(function() {
|
||||
$('#loadPopulationChart').on('click', loadPopulationChartData);
|
||||
$('#loadUrbanizationChart').on('click', loadUrbanizationRateChartData);
|
||||
|
||||
// 添加年份选择器变化事件监听
|
||||
$('#yearSelect').on('change', loadPopulationChartData);
|
||||
|
||||
// 自动加载图表
|
||||
loadPopulationChartData();
|
||||
loadUrbanizationRateChartData();
|
||||
|
Reference in New Issue
Block a user