audit.html 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <link rel="stylesheet" href="/static/editor.md/css/editormd.min.css" />
  2. <script type="text/javascript">
  3. var editorids = new Array();
  4. </script>
  5. <div class="layui-row" style="margin-top: 20px;padding-left: 20px">
  6. <div class="layui-col-xs10 search_text">
  7. <!-- <form class="layui-form" action="" onsubmit="javascript:return false;">
  8. <div class="demoTable">
  9. <div class="layui-inline" style="width: 40%">
  10. <input class="layui-input" name="sourceName" id="sourceName" autocomplete="off" placeholder="资源名称" >
  11. </div>
  12. <button class="layui-btn" data-type="reload">查询</button>
  13. </div>
  14. </form> -->
  15. </div>
  16. <div class="layui-col-xs2" style="float: right;text-align: right;">
  17. <button class="layui-btn layui-btn-normal layui-btn-sm" id="audit"> 审核 </button>&nbsp;&nbsp;&nbsp;&nbsp;
  18. </div>
  19. </div>
  20. <div class="api-infos">
  21. <ul>
  22. <li><strong>接口名称:</strong> {{.Detail.api_name}}</li>
  23. <li><strong>接口地址:</strong> {{.Detail.api_url}}</li>
  24. <li><strong>请求方式:</strong> {{.Detail.method}}</li>
  25. <li><strong>接口状态:</strong> {{str2html .Detail.audit_status}}</li>
  26. <li><strong>开发人员:</strong> {{.Detail.create_name}}</li>
  27. <li><strong>维护人员:</strong> {{.Detail.update_name}}</li>
  28. <li><strong>审核人员:</strong> {{.Detail.audit_name}}</li>
  29. <li><strong>上线时间:</strong> {{if eq .Detail.status 3}}{{.Detail.audit_time}}{{end}}</li>
  30. <li><strong>最后修改:</strong> {{.Detail.update_time}}</li>
  31. </ul>
  32. <div class="title"> &nbsp;接口详细 </div>
  33. <hr>
  34. <div id="markdown-view" style="width: 95%">
  35. <textarea style="display:none;" name="markdown">
  36. {{.Detail.detail}}
  37. </textarea>
  38. </div>
  39. </div>
  40. <script>
  41. var $;
  42. layui.use(['form','element','layer','jquery',"code"],function(){
  43. var form = layui.form; //只有执行了这一步,部分表单元素才会自动修饰成功
  44. var $ = layui.jquery;
  45. var element = layui.element;
  46. var id = "{{.Detail.id}}"
  47. $("#audit").on("click",function(){
  48. layer.confirm('是否审核通过', {
  49. btn: ['通过', '不通过','取消'] //可以无限个按钮
  50. ,function(index, layero){
  51. //取消
  52. }
  53. }, function(index, layero){
  54. //通过
  55. var add_audit_data = {"ids":id,"status":3}
  56. $.post('{{urlfor "ApiController.AjaxChangeStatus"}}', add_audit_data, function (out) {
  57. if (out.status == 0) {
  58. layer.msg("操作成功",{icon: 1},function () {
  59. window.location.reload();
  60. })
  61. } else {
  62. layer.msg(out.message)
  63. }
  64. }, "json");
  65. }, function(index){
  66. //不通过
  67. var add_audit_data = {"ids":id,"status":4}
  68. $.post('{{urlfor "ApiController.AjaxChangeStatus"}}', add_audit_data, function (out) {
  69. if (out.status == 0) {
  70. layer.msg("操作成功",{icon: 1},function () {
  71. window.location.reload();
  72. })
  73. } else {
  74. layer.msg(out.message)
  75. }
  76. }, "json");
  77. });
  78. })
  79. layui.code();
  80. });
  81. </script>
  82. {{template "public/editormd_show.html" .}}