views.py 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. from django.shortcuts import render
  2. from django.contrib.auth.decorators import login_required
  3. @login_required
  4. def index(request):
  5. """
  6. 总览
  7. :param request:
  8. :return:
  9. """
  10. return render(request, 'overview.html', {'active_nav': 'overview'})
  11. @login_required
  12. def doc_view(request):
  13. """
  14. 文档
  15. :param request:
  16. :return:
  17. """
  18. return render(request, 'doc/index.html', {'active_nav': 'doc'})
  19. @login_required
  20. def user_manage_view(request):
  21. """
  22. 用户管理
  23. :param request:
  24. :return:
  25. """
  26. return render(request, 'user_and_permission/user_manage.html', {'active_nav': 'user_manage'})
  27. @login_required
  28. def role_manage_view(request):
  29. """
  30. 角色管理
  31. :param request:
  32. :return:
  33. """
  34. return render(request, 'user_and_permission/role_manage.html', {'active_nav': 'role_manage'})
  35. @login_required
  36. def dept_manage_view(request):
  37. """
  38. 部门管理
  39. :param request:
  40. :return:
  41. """
  42. return render(request, 'user_and_permission/dept_manage.html', {'active_nav': 'dept_manage'})
  43. @login_required
  44. def app_token_manage_view(request):
  45. """
  46. 应用调用权限管理
  47. :param request:
  48. :return:
  49. """
  50. return render(request, 'user_and_permission/token_manage.html', {'active_nav': 'token_manage'})
  51. @login_required
  52. def workflow_manage_view(request):
  53. """
  54. 工作流管理
  55. :param request:
  56. :return:
  57. """
  58. return render(request, 'workflow/workflow_manage.html', {'active_nav': 'workflow_manage'})
  59. @login_required
  60. def workflow_manage_edit_view(request, workflow_id):
  61. """
  62. 工作流编辑
  63. :param request:
  64. :return:
  65. """
  66. return render(request, 'workflow/workflow_manage_edit.html', {'active_nav': 'workflow_manage', 'workflow_id': workflow_id})
  67. @login_required
  68. def run_script_manage_view(request):
  69. """
  70. 执行脚本管理
  71. :param request:
  72. :return:
  73. """
  74. return render(request, 'workflow/run_script_manage.html', {'active_nav': 'run_script_manage'})
  75. @login_required
  76. def notice_manage_view(request):
  77. """
  78. 通知管理
  79. :param request:
  80. :return:
  81. """
  82. return render(request, 'workflow/notice_manage.html', {'active_nav': 'notice_manage'})
  83. @login_required
  84. def workflow_flow_chart_view(request, workflow_id):
  85. """
  86. 工作流流程图
  87. :param request:
  88. :param workflow_id:
  89. :return:
  90. """
  91. return render(request, 'workflow/flow_chart.html', {'active_nav': 'workflow_manage', 'workflow_id': workflow_id})
  92. def user_login_view(request):
  93. """
  94. 用户登录
  95. :param request:
  96. :return:
  97. """
  98. next_url = request.GET.get("next")
  99. return render(request, 'login.html', {'active_nav': 'user_manage', 'next_url': next_url})