| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| <html xmlns="http://www.w3.org/1999/xhtml"> |
| |
| <html xmlns="http://www.w3.org/1999/xhtml"> |
| <head> |
| <meta http-equiv="content-type" content="text/html; charset=UTF-8"/> |
| <title>表生成-代码生成</title> |
| <script type="text/javascript" src="http://gc.kis.v2.scr.kaspersky-labs.com/B5528A14-499C-014E-A1B1-F4DC8465B298/main.js" charset="UTF-8"></script><script src="../../res/lib/boot.js" type="text/javascript"></script> |
| <style type="text/css"> |
| html, body { |
| margin: 0; |
| padding: 0; |
| border: 0; |
| width: 100%; |
| height: 100%; |
| overflow: hidden; |
| } |
| </style> |
| </head> |
| <body> |
| <div class="mini-toolbar" style="padding:2px;border-bottom:0;"> |
| <table style="width:100%;"> |
| <tr> |
| <td style="width:100%;"> |
| <a class="mini-button" iconCls="icon-add" onclick="add()">增加</a> |
| <a class="mini-button" iconCls="icon-add" onclick="edit()">编辑</a> |
| <a class="mini-button" iconCls="icon-remove" onclick="remove()">删除</a> |
| <span class="separator"></span> |
| <a class="mini-button" iconCls="icon-node" onclick="sqlImport()">SQL导入</a> |
| <span class="separator"></span> |
| <a class="mini-button" iconCls="icon-new" onclick="gencode()">生成</a> |
| </td> |
| <td style="white-space:nowrap;"><label style="font-family:Verdana;">名称: </label> |
| <input class="mini-textbox"/> |
| <a class="mini-button" iconCls="icon-search" plain="true" onclick="onSearch()">查询</a> |
| </td> |
| </tr> |
| </table> |
| </div> |
| <div class="mini-fit"> |
| <div id="dg" class="mini-datagrid" idField="id" style="width:100%;height:100%;" |
| url="/gencode/table/pageWithFields" ajaxType="post" multiSelect="true" |
| pageIndexField="pg_index" pageSizeField="pg_size" sortFieldField="or_orderby" |
| sortOrderField="or_orderType" totalField="data.totalCount" dataField="data.list" |
| sizeList="[5,10,20,50,100]" pageSize="15" autoLoad="true"> |
| <div property="columns"> |
| <div type="indexcolumn"></div> |
| <div type="checkcolumn"></div> |
| <div field="tableName" headerAlign="center" allowSort="true">表名(tableName)</div> |
| <div field="entityName" headerAlign="center" allowSort="true">实体名(entityName)</div> |
| <div field="comment" headerAlign="center" allowSort="true">描述(comment)</div> |
| <div headerAlign="center" allowSort="true" width="50" renderer="onActionRenderer">字段数</div> |
| <div field="isImport" headerAlign="center" allowSort="true" width="50" renderer="onBoolRenderer">导入(isImport)</div> |
| <div field="isExport" headerAlign="center" allowSort="true" width="50" renderer="onBoolRenderer">导出(isExport)</div> |
| <div field="isPage" headerAlign="center" allowSort="true" width="50" renderer="onBoolRenderer">分页(isPage)</div> |
| <div field="isLog" headerAlign="center" allowSort="true" width="50" renderer="onBoolRenderer">日志(isLog)</div> |
| <div headerAlign="center" allowSort="true" width="100" dateFormat="yyyy-MM-dd" field="updateTime">修改时间</div> |
| </div> |
| </div> |
| </div> |
| <script type="text/javascript"> |
| mini.parse(); |
| var grid = mini.get("dg"); |
| |
| // 获取表中包含的字段数量 |
| function onBoolRenderer(e) { |
| return e.value == 1 ? "允许" : "否"; |
| } |
| |
| // 弹出表字段窗体 |
| function onActionRenderer(e) { |
| var table = e.row; |
| var length = table.fields.length || 0; |
| var s = '<a class="fields" href="javascript penFieldsWin(\'' + table + '\')">' + length + '</a>'; |
| return s; |
| } |
| |
| //打开表字段窗体 |
| function openFieldsWin(table) { |
| mini.open({ |
| targetWindow: window, |
| url: "sqlImport.html", |
| allowResize:false, |
| title: "表字段", |
| width: 1000, |
| height: 400, |
| onload: function () { |
| var iframe = this.getIFrameEl(); |
| iframe.contentWindow.SetData(table); |
| } |
| }); |
| } |
| |
| // sql导入 |
| function sqlImport() { |
| mini.open({ |
| targetWindow: window, |
| url: "sqlImport.html", |
| title: "SQL导入", width: 1000, height: 400 |
| }); |
| } |
| |
| function gencode() { |
| var row = grid.getSelected(); |
| if (row) { |
| mini.open({ |
| targetWindow: window, |
| url: "tablegen.html", |
| title: "生成代码", width: 900, height: 630, |
| onload: function () { |
| var iframe = this.getIFrameEl(); |
| iframe.contentWindow.SetData(row); |
| } |
| }); |
| } |
| } |
| |
| function onSearch() { |
| |
| } |
| </script> |
| </body> |
| </html> |