123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="keywords" content="">
- <meta name="description" content="">
- <title text="代码生成"></title>
- <link rel="stylesheet" href="../../component/pear/css/pear.css">
- <style>
- .pear-btn-success {
- background-color: #2d8cf0 !important;
- }
- </style>
- </head>
- <body>
- <form class="layui-form" lay-filter="edit">
- <div class="mainBox">
- <div class="main-container">
- <div class="main-container">
- <input type="hidden" name="id">
- <div class="layui-form-item">
- <label class="layui-form-label layui-required">表名称:</label>
- <div class="layui-input-block">
- <input type="text" name="tableName" lay-verify="required"
- autocomplete="off" placeholder="" class="layui-input layui-disabled" readonly>
- </div>
- </div>
- <div class="layui-form-item layui-form-text">
- <label class="layui-form-label layui-required">生成路径:</label>
- <div class="layui-input-block">
- <input type="text" name="packageName" lay-verify="required"
- autocomplete="off" placeholder="" class="layui-input layui-disabled" readonly>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="bottom">
- <div class="button-container">
- <button type="submit" class="pear-btn pear-btn-success pear-btn-md"
- lay-submit="" lay-filter="save">
- <i class="layui-icon layui-icon-ok"></i>
- 保 存
- </button>
- <button type="submit" class="pear-btn pear-btn-md" onclick="parent.layer.closeAll();">
- <i class="layui-icon layui-icon-close"></i>
- 关 闭
- </button>
- </div>
- </div>
- </form>
- <script src="../../component/layui/layui.js"></script>
- <script src="../../component/pear/pear.js"></script>
- <script src="../../component/js/xm-select.js"></script>
- <script>
- layui.use(['request', 'form'], function () {
- var $ = layui.jquery,
- request = layui.request,
- form = layui.form;
- var MODULE_PATH = '/generator/v1/';
- layer.ready(function() {
- var id = request.getQueryString("id");
- if (id) {
- request.httpGet(MODULE_PATH + id, function(result) {
- result.data.packageName = result.data.packageName + "." +result.data.moduleName;
- form.val('edit', result.data);
- });
- }
- });
- form.on('submit(save)', function (data) {
- request.http({
- url: MODULE_PATH + 'generate',
- data: {tableId: $('[name="id"]').val()},
- type: 'post',
- dataType: 'json',
- success: function (result) {
- if (result.success) {
- parent.layer.closeAll();
- parent.layer.alert(result.data, {
- title: '生成路径',
- area: 'auto',
- maxWidth:'500'
- });
- } else {
- layer.msg(result.msg, {icon: 2, time: 1500});
- }
- }
- });
- return false;
- });
- })
- </script>
- </body>
- </html>
|