detail.html 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <link rel="stylesheet" href="/static/editor.md/css/editormd.min.css" />
  2. <div class="layui-row" style="margin-top: 20px;padding-left: 20px">
  3. <div class="layui-col-xs10 search_text">
  4. <!-- <form class="layui-form" action="" onsubmit="javascript:return false;">
  5. <div class="demoTable">
  6. <div class="layui-inline" style="width: 40%">
  7. <input class="layui-input" name="sourceName" id="sourceName" autocomplete="off" placeholder="资源名称" >
  8. </div>
  9. <button class="layui-btn" data-type="reload">查询</button>
  10. </div>
  11. </form> -->
  12. </div>
  13. <div class="layui-col-xs2" style="float: right;text-align: right;">
  14. <a href="/api/edit?id={{.Detail.id}}" id="add_source" class="layui-btn layui-btn-sm"> 编辑 </a>
  15. </div>
  16. </div>
  17. <div class="api-infos">
  18. <ul>
  19. <li><strong>接口名称:</strong> {{.Detail.api_name}}</li>
  20. <li><strong>接口地址:</strong> {{.Detail.api_url}}</li>
  21. <li><strong>请求方式:</strong> {{.Detail.method}}</li>
  22. <li><strong>接口状态:</strong> {{str2html .Detail.audit_status}}</li>
  23. <li><strong>开发人员:</strong> {{.Detail.create_name}}</li>
  24. <li><strong>维护人员:</strong> {{.Detail.update_name}}</li>
  25. <li><strong>审核人员:</strong> {{.Detail.audit_name}}</li>
  26. <li><strong>上线时间:</strong> {{if eq .Detail.status 3}}{{.Detail.audit_time}}{{end}}</li>
  27. <li><strong>最后修改:</strong> {{.Detail.update_time}}</li>
  28. </ul>
  29. <div class="title"> &nbsp;接口详细 </div>
  30. <hr>
  31. <div id="markdown-view" style="width: 95%">
  32. <textarea style="display:none;" name="markdown">
  33. {{.Detail.detail}}
  34. </textarea>
  35. </div>
  36. </div>
  37. <script>
  38. var $;
  39. layui.use(['form','element','layer','jquery',"code"],function(){
  40. var form = layui.form; //只有执行了这一步,部分表单元素才会自动修饰成功
  41. var $ = layui.jquery;
  42. var element = layui.element;
  43. $(".edit_api").on("click",function(){
  44. var obj = $(this)
  45. var id = obj.attr("data-id");
  46. layer.open({
  47. type: 2,
  48. shade: 0.3,
  49. id:1,
  50. title:"修改接口-"+obj.attr("data-name"),
  51. content: '/api/editapi?id='+id,
  52. area:['800px','450px'],
  53. });
  54. })
  55. layui.code();
  56. });
  57. </script>
  58. {{template "public/editormd_show.html" .}}