generate.html 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  7. <meta name="keywords" content="">
  8. <meta name="description" content="">
  9. <title text="代码生成"></title>
  10. <link rel="stylesheet" href="../../component/pear/css/pear.css">
  11. <style>
  12. .pear-btn-success {
  13. background-color: #2d8cf0 !important;
  14. }
  15. </style>
  16. </head>
  17. <body>
  18. <form class="layui-form" lay-filter="edit">
  19. <div class="mainBox">
  20. <div class="main-container">
  21. <div class="main-container">
  22. <input type="hidden" name="id">
  23. <div class="layui-form-item">
  24. <label class="layui-form-label layui-required">表名称:</label>
  25. <div class="layui-input-block">
  26. <input type="text" name="tableName" lay-verify="required"
  27. autocomplete="off" placeholder="" class="layui-input layui-disabled" readonly>
  28. </div>
  29. </div>
  30. <div class="layui-form-item layui-form-text">
  31. <label class="layui-form-label layui-required">生成路径:</label>
  32. <div class="layui-input-block">
  33. <input type="text" name="packageName" lay-verify="required"
  34. autocomplete="off" placeholder="" class="layui-input layui-disabled" readonly>
  35. </div>
  36. </div>
  37. </div>
  38. </div>
  39. </div>
  40. <div class="bottom">
  41. <div class="button-container">
  42. <button type="submit" class="pear-btn pear-btn-success pear-btn-md"
  43. lay-submit="" lay-filter="save">
  44. <i class="layui-icon layui-icon-ok"></i>
  45. 保 存
  46. </button>
  47. <button type="submit" class="pear-btn pear-btn-md" onclick="parent.layer.closeAll();">
  48. <i class="layui-icon layui-icon-close"></i>
  49. 关 闭
  50. </button>
  51. </div>
  52. </div>
  53. </form>
  54. <script src="../../component/layui/layui.js"></script>
  55. <script src="../../component/pear/pear.js"></script>
  56. <script src="../../component/js/xm-select.js"></script>
  57. <script>
  58. layui.use(['request', 'form'], function () {
  59. var $ = layui.jquery,
  60. request = layui.request,
  61. form = layui.form;
  62. var MODULE_PATH = '/generator/v1/';
  63. layer.ready(function() {
  64. var id = request.getQueryString("id");
  65. if (id) {
  66. request.httpGet(MODULE_PATH + id, function(result) {
  67. result.data.packageName = result.data.packageName + "." +result.data.moduleName;
  68. form.val('edit', result.data);
  69. });
  70. }
  71. });
  72. form.on('submit(save)', function (data) {
  73. request.http({
  74. url: MODULE_PATH + 'generate',
  75. data: {tableId: $('[name="id"]').val()},
  76. type: 'post',
  77. dataType: 'json',
  78. success: function (result) {
  79. if (result.success) {
  80. parent.layer.closeAll();
  81. parent.layer.alert(result.data, {
  82. title: '生成路径',
  83. area: 'auto',
  84. maxWidth:'500'
  85. });
  86. } else {
  87. layer.msg(result.msg, {icon: 2, time: 1500});
  88. }
  89. }
  90. });
  91. return false;
  92. });
  93. })
  94. </script>
  95. </body>
  96. </html>