提交
This commit is contained in:
1 parent
3d98104455
commit
0d52442902
76 files changed
+21994
-12642
No files matched your search
@@ -903,6 +903,19 @@ STATIC_MENU_TREE = [
|
||||
"component": "/oa-approval/start/index",
|
||||
"meta": {"title": "发起审批", "keepAlive": True, "menuCode": "oa:start"},
|
||||
},
|
||||
{
|
||||
"id": "OA000000000000000000000000000203",
|
||||
"name": "OaApprovalHistory",
|
||||
"path": "history/:appId",
|
||||
"component": "/oa-approval/history/index",
|
||||
"meta": {
|
||||
"title": "历史记录",
|
||||
"keepAlive": True,
|
||||
"isHide": True,
|
||||
"worktabMulti": True,
|
||||
"menuCode": "oa:start",
|
||||
},
|
||||
},
|
||||
{
|
||||
"id": "OA000000000000000000000000000104",
|
||||
"name": "OaApprovalPending",
|
||||
|
||||
@@ -937,6 +937,47 @@ async def list_oa_instance_history(
|
||||
return error_response(400, str(e))
|
||||
|
||||
|
||||
@router.get("/instances/history/export")
|
||||
async def export_oa_instance_history(
|
||||
appId: str = Query(..., description="流程应用 ID"),
|
||||
instanceId: str = Query(""),
|
||||
instanceIds: str = Query("", description="逗号分隔的实例 ID,用于导出勾选"),
|
||||
instanceStatus: str = Query(""),
|
||||
initiatorName: str = Query(""),
|
||||
applyTimeFrom: str = Query(""),
|
||||
applyTimeTo: str = Query(""),
|
||||
finishTimeFrom: str = Query(""),
|
||||
finishTimeTo: str = Query(""),
|
||||
user: dict = Depends(require_admin_or_super_admin),
|
||||
db: Session = Depends(get_db),
|
||||
):
|
||||
from app.core.menu_guard import user_has_menu_perm
|
||||
from app.services.oa_engine import OaEngineError, export_instance_history
|
||||
|
||||
try:
|
||||
tenant_no = _get_tenant_no(db, user)
|
||||
can_view_all = user_has_menu_perm(db, user, OA_START_HISTORY_ALL_PERM)
|
||||
id_list = [x.strip() for x in (instanceIds or "").split(",") if x.strip()]
|
||||
data = export_instance_history(
|
||||
db,
|
||||
tenant_no=tenant_no,
|
||||
user_id=user.get("user_id") or "",
|
||||
can_view_all=can_view_all,
|
||||
app_id=appId,
|
||||
instance_id=instanceId or None,
|
||||
instance_ids=id_list or None,
|
||||
initiator_name=initiatorName or None,
|
||||
apply_time_from=applyTimeFrom or None,
|
||||
apply_time_to=applyTimeTo or None,
|
||||
finish_time_from=finishTimeFrom or None,
|
||||
finish_time_to=finishTimeTo or None,
|
||||
instance_status=instanceStatus or None,
|
||||
)
|
||||
return success_response(data)
|
||||
except OaEngineError as e:
|
||||
return error_response(400, str(e))
|
||||
|
||||
|
||||
@router.get("/instances/{instance_id}")
|
||||
async def get_oa_instance(
|
||||
instance_id: str,
|
||||
|
||||
Reference in new issue
Block a user