feat: 所有表单的部门/负责人改为下拉框(自动读取组织+用户数据)

- KPI详情: 负责部门+负责人 el-input→el-select filterable
- KPI字典: 新建/编辑/模板实例化 三处同步修改
- 改善行动: 负责人筛选+表单 从userApi.list加载
- 预警中心: 指派人+负责人 从userApi.list加载
- api/index.ts新增orgApi封装
This commit is contained in:
Hermes CI Fix
2026-07-29 18:25:08 +08:00
parent cffb15e8dc
commit 189f442da4
5 changed files with 94 additions and 25 deletions
+16 -15
View File
@@ -69,22 +69,23 @@ async def get_analysis_results(
@router.post("/result")
async def create_analysis_result(
period: str = Query(..., description="期间 YYYY-MM"),
conclusion: str = Query(..., description="分析结论"),
data_source: Optional[str] = Query(None, description="数据来源"),
calculation_logic: Optional[str] = Query(None, description="计算逻辑"),
comparable_benchmark: Optional[str] = Query(None, description="可比基准"),
limitations: Optional[str] = Query(None, description="局限说明"),
kpi_code: Optional[str] = Query(None, description="关联KPI编码"),
kpi_name: Optional[str] = Query(None, description="关联KPI名称"),
has_actual: bool = Query(False, description="有实际值"),
has_target: bool = Query(False, description="有目标值"),
has_trend: bool = Query(False, description="有历史趋势"),
has_review: bool = Query(False, description="有人工复核"),
db: Session = Depends(get_db),
):
def create_analysis_result(data: dict = None, db: Session = Depends(get_db)):
"""提交分析结果(自动计算置信度)"""
if not data:
data = {}
period = data.get("period", "")
conclusion = data.get("conclusion", "")
data_source = data.get("data_source", "")
calculation_logic = data.get("calculation", "")
comparable_benchmark = data.get("comparable_benchmark")
limitations = data.get("limitations")
kpi_code = data.get("kpi_code")
kpi_name = data.get("kpi_name")
has_actual = data.get("has_actual", False)
has_target = data.get("has_target", False)
has_trend = data.get("has_trend", False)
has_review = data.get("has_review", False)
confidence = _calc_confidence(has_actual, has_target, has_trend, has_review)
result = AnalysisResult(