edit.html 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607
  1. <!DOCTYPE html>
  2. <html lang="zh" xmlns:th="http://www.thymeleaf.org" >
  3. <head>
  4. <th:block th:include="include :: header('修改生成信息')" />
  5. <th:block th:include="include :: select2-css" />
  6. <style type="text/css">
  7. .select-table table{table-layout:fixed;}.table>thead>tr>th{text-align:center;}.select-table .table td{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.form-control{padding:3px 6px 4px;height:30px;}.icheckbox-blue{top:0px;left:6px;}.form-control.select2-hidden-accessible{position:static!important;}.select-table table label.error{position: inherit;}select + label.error{z-index:1;right:40px;}
  8. </style>
  9. </head>
  10. <body class="gray-bg" style="font: 14px Helvetica Neue, Helvetica, PingFang SC, 微软雅黑, Tahoma, Arial, sans-serif !important;">
  11. <section class="section-content">
  12. <div class="row">
  13. <div class="col-xs-12">
  14. <div class="ibox float-e-margins">
  15. <div class="ibox-content" style="border-style:none;">
  16. <div class="nav-tabs-custom">
  17. <ul class="nav nav-tabs">
  18. <li><a href="#tab-basic" data-toggle="tab" aria-expanded="false">基本信息</a></li>
  19. <li class="active"><a href="#tab-field" data-toggle="tab" aria-expanded="true">字段信息</a></li>
  20. <li><a href="#tab-gen" data-toggle="tab" aria-expanded="false">生成信息</a></li>
  21. <li class="pull-right header">
  22. <i class="fa fa-code"></i> 生成配置
  23. </li>
  24. </ul>
  25. <form id="form-gen-edit" class="form-horizontal" th:object="${table}">
  26. <input name="tableId" type="hidden" th:field="*{tableId}" />
  27. <div class="tab-content">
  28. <!-- 基本信息 -->
  29. <div class="tab-pane" id="tab-basic">
  30. <div class="row mt20">
  31. <div class="col-sm-6">
  32. <div class="form-group">
  33. <label class="col-sm-4 control-label is-required">表名称:</label>
  34. <div class="col-sm-8">
  35. <input name="tableName" class="form-control" type="text" placeholder="请输入表名称" maxlength="200" th:field="*{tableName}" required>
  36. </div>
  37. </div>
  38. </div>
  39. <div class="col-sm-6">
  40. <div class="form-group">
  41. <label class="col-sm-4 control-label is-required">表描述:</label>
  42. <div class="col-sm-8">
  43. <input name="tableComment" class="form-control" type="text" placeholder="请输入表描述" maxlength="500" th:field="*{tableComment}" required>
  44. </div>
  45. </div>
  46. </div>
  47. </div>
  48. <div class="row">
  49. <div class="col-sm-6">
  50. <div class="form-group">
  51. <label class="col-sm-4 control-label is-required">实体类名称:</label>
  52. <div class="col-sm-8">
  53. <input name="className" class="form-control" type="text" placeholder="请输入实体类名称" maxlength="100" th:field="*{className}" required>
  54. </div>
  55. </div>
  56. </div>
  57. <div class="col-sm-6">
  58. <div class="form-group">
  59. <label class="col-sm-4 control-label is-required">作者:</label>
  60. <div class="col-sm-8">
  61. <input name="functionAuthor" class="form-control" type="text" placeholder="请输入作者" maxlength="50" th:field="*{functionAuthor}" required>
  62. </div>
  63. </div>
  64. </div>
  65. </div>
  66. <div class="row">
  67. <div class="col-sm-12">
  68. <div class="form-group">
  69. <label class="col-xs-2 control-label">备注:</label>
  70. <div class="col-xs-10">
  71. <textarea name="remark" maxlength="500" class="form-control" rows="3"></textarea>
  72. </div>
  73. </div>
  74. </div>
  75. </div>
  76. </div>
  77. <!-- 字段信息 -->
  78. <div class="tab-pane active" id="tab-field">
  79. <div class="select-table table-striped" style="margin-top: 0px;padding-top: 0px;padding-bottom: 0px;">
  80. <table id="bootstrap-table" data-use-row-attr-func="true" data-reorderable-rows="true"></table>
  81. </div>
  82. </div>
  83. <!-- 生成信息 -->
  84. <div class="tab-pane" id="tab-gen">
  85. <div class="row mt20">
  86. <div class="col-sm-6">
  87. <div class="form-group">
  88. <label class="col-sm-4 control-label is-required">生成模板:</label>
  89. <div class="col-sm-8">
  90. <select class='form-control' id="tplCategory" name='tplCategory' style="width: 100%">
  91. <option value="crud" th:field="*{tplCategory}">单表(增删改查)</option>
  92. <option value="tree" th:field="*{tplCategory}">树表(增删改查)</option>
  93. <option value="sub" th:field="*{tplCategory}">主子表(增删改查)</option>
  94. </select>
  95. </div>
  96. </div>
  97. </div>
  98. <div class="col-sm-6">
  99. <div class="form-group">
  100. <label class="col-sm-4 control-label is-required" title="生成在哪个java包下,例如 com.ruoyi.project.system">生成包路径:<i class="fa fa-question-circle-o"></i></label>
  101. <div class="col-sm-8">
  102. <input name="packageName" class="form-control" type="text" placeholder="请输入生成包路径" maxlength="100" th:field="*{packageName}" required>
  103. </div>
  104. </div>
  105. </div>
  106. </div>
  107. <div class="row">
  108. <div class="col-sm-6">
  109. <div class="form-group">
  110. <label class="col-sm-4 control-label is-required" title="可理解为子系统名,例如 system">生成模块名:<i class="fa fa-question-circle-o"></i></label>
  111. <div class="col-sm-8">
  112. <input name="moduleName" class="form-control" type="text" placeholder="请输入生成模块名" maxlength="30" th:field="*{moduleName}" required>
  113. </div>
  114. </div>
  115. </div>
  116. <div class="col-sm-6">
  117. <div class="form-group">
  118. <label class="col-sm-4 control-label is-required" title="可理解为功能英文名,例如 user">生成业务名:<i class="fa fa-question-circle-o"></i></label>
  119. <div class="col-sm-8">
  120. <input name="businessName" class="form-control" type="text" placeholder="请输入生成业务名" maxlength="50" th:field="*{businessName}" required>
  121. </div>
  122. </div>
  123. </div>
  124. </div>
  125. <div class="row">
  126. <div class="col-sm-6">
  127. <div class="form-group">
  128. <label class="col-sm-4 control-label is-required" title="用作类描述,例如 用户">生成功能名:<i class="fa fa-question-circle-o"></i></label>
  129. <div class="col-sm-8">
  130. <input name="functionName" class="form-control" type="text" placeholder="请输入生成功能名" maxlength="50" th:field="*{functionName}" required>
  131. </div>
  132. </div>
  133. </div>
  134. <div class="col-sm-6">
  135. <div class="form-group">
  136. <label class="col-sm-4 control-label is-required" title="分配到指定菜单下,例如 系统管理">上级菜单:<i class="fa fa-question-circle-o"></i></label>
  137. <div class="col-sm-8">
  138. <input id="parentMenuId" name="params[parentMenuId]" type="hidden" th:value="*{parentMenuId}"/>
  139. <div class="input-group">
  140. <input id="parentMenuName" name="params[parentMenuName]" class="form-control" type="text" onclick="selectMenuTree()" placeholder="请选择上级菜单" maxlength="50" th:value="*{parentMenuName}" required>
  141. <span class="input-group-addon"><i class="fa fa-search"></i></span>
  142. </div>
  143. </div>
  144. </div>
  145. </div>
  146. </div>
  147. <div class="row">
  148. <div class="col-sm-6">
  149. <div class="form-group">
  150. <label class="col-sm-4 control-label" title="默认为zip压缩包下载,也可以自定义生成路径">生成代码方式:<i class="fa fa-question-circle-o"></i></label>
  151. <div class="col-sm-8">
  152. <label class="radio-box"> <input type="radio" name="genType" value="0" th:field="*{genType}" /> zip压缩包 </label>
  153. <label class="radio-box"> <input type="radio" name="genType" value="1" th:field="*{genType}" /> 自定义路径</label>
  154. </div>
  155. </div>
  156. </div>
  157. </div>
  158. <div class="hidden row" id="pathinfo">
  159. <div class="col-sm-12">
  160. <div class="form-group">
  161. <label class="col-xs-2 control-label" title="填写磁盘绝对路径,若不填写,则生成到当前Web项目下">生成基础路径:<i class="fa fa-question-circle-o"></i></label>
  162. <div class="col-xs-10">
  163. <div class="input-group input-group-sm">
  164. <input id="genPath" name="genPath" class="form-control" type="text" th:field="*{genPath}" placeholder="请输入项目路径" maxlength="200">
  165. <div class="input-group-btn">
  166. <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">最近路径快速选择 <span class="caret"></span></button>
  167. <ul class="dropdown-menu dropdown-menu-right" role="menu">
  168. <li><a href="javascript:$('#genPath').val('/')"><i class="fa fa-refresh"></i>恢复默认的生成基础路径</a></li>
  169. </ul>
  170. </div>
  171. </div>
  172. </div>
  173. </div>
  174. </div>
  175. </div>
  176. <div class="hidden" id="subInfo">
  177. <h4 class="form-header h4">关联信息</h4>
  178. <div class="row">
  179. <div class="col-sm-6">
  180. <div class="form-group">
  181. <label class="col-sm-4 control-label is-required" title="关联子表的表名, 如:sys_user">关联子表的表名:<i class="fa fa-question-circle-o"></i></label>
  182. <div class="col-sm-8">
  183. <select class='type form-control' id="subTableName" name='subTableName' th:attr='data-value=*{subTableName}' style="width: 100%">
  184. <option value="">---请选择---</option>
  185. </select>
  186. </div>
  187. </div>
  188. </div>
  189. <div class="col-sm-6">
  190. <div class="form-group">
  191. <label class="col-sm-4 control-label is-required" title="子表关联的外键名, 如:user_id">子表关联的外键名:<i class="fa fa-question-circle-o"></i></label>
  192. <div class="col-sm-8">
  193. <select class='router form-control' id="subTableFkName" name='subTableFkName' th:attr='data-value=*{subTableFkName}' style="width: 100%">
  194. <option value="">---请选择---</option>
  195. </select>
  196. </div>
  197. </div>
  198. </div>
  199. </div>
  200. </div>
  201. <div class="hidden" id="otherInfo">
  202. <h4 class="form-header h4">其他信息</h4>
  203. <div class="row">
  204. <div class="col-sm-6">
  205. <div class="form-group">
  206. <label class="col-sm-4 control-label is-required" title="树显示的编码字段名, 如:dept_id">树编码字段:<i class="fa fa-question-circle-o"></i></label>
  207. <div class="col-sm-8">
  208. <select class='form-control' id="treeCode" name='params[treeCode]' style="width: 100%">
  209. <option value="">---请选择---</option>
  210. <option th:each="column : ${table.columns}" th:text="${column.columnName + ':' + column.columnComment}" th:value="${column.columnName}" th:field="*{treeCode}"></option>
  211. </select>
  212. </div>
  213. </div>
  214. </div>
  215. <div class="col-sm-6">
  216. <div class="form-group">
  217. <label class="col-sm-4 control-label is-required" title="树显示的父编码字段名, 如:parent_Id">树父编码字段:<i class="fa fa-question-circle-o"></i></label>
  218. <div class="col-sm-8">
  219. <select class='form-control' id="treeParentCode" name='params[treeParentCode]' style="width: 100%">
  220. <option value="">---请选择---</option>
  221. <option th:each="column : ${table.columns}" th:text="${column.columnName + ':' + column.columnComment}" th:value="${column.columnName}" th:field="*{treeParentCode}"></option>
  222. </select>
  223. </div>
  224. </div>
  225. </div>
  226. </div>
  227. <div class="row">
  228. <div class="col-sm-6">
  229. <div class="form-group">
  230. <label class="col-sm-4 control-label is-required" title="树节点的显示名称字段名, 如:dept_name">树名称字段:<i class="fa fa-question-circle-o"></i></label>
  231. <div class="col-sm-8">
  232. <select class='form-control' id="treeName" name='params[treeName]' style="width: 100%">
  233. <option value="">---请选择---</option>
  234. <option th:each="column : ${table.columns}" th:text="${column.columnName + ':' + column.columnComment}" th:value="${column.columnName}" th:field="*{treeName}"></option>
  235. </select>
  236. </div>
  237. </div>
  238. </div>
  239. </div>
  240. </div>
  241. </div>
  242. </div>
  243. </form>
  244. </div>
  245. </div>
  246. <div class="box-footer">
  247. <div class="col-sm-offset-5 col-sm-6">
  248. <button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>保 存</button>&nbsp;
  249. <button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭 </button>
  250. </div>
  251. </div>
  252. </div>
  253. </div>
  254. </div>
  255. </section>
  256. <th:block th:include="include :: footer" />
  257. <th:block th:include="include :: select2-js" />
  258. <th:block th:include="include :: bootstrap-table-reorder-rows-js" />
  259. <script th:src="@{/js/jquery.tmpl.js}"></script>
  260. <th:block th:include="include :: jquery-cxselect-js" />
  261. <script th:inline="javascript">
  262. /* 用户信息-修改 */
  263. $("#form-table-edit").validate({
  264. rules: {
  265. tableName: {
  266. required: true,
  267. },
  268. },
  269. focusCleanup: true
  270. });
  271. /* 表级联信息 */
  272. var data = [[${data}]];
  273. $('#subInfo').cxSelect({
  274. selects: ['type', 'router'],
  275. jsonValue: 'v',
  276. data: data
  277. });
  278. function submitHandler() {
  279. if ($.validate.form()) {
  280. $.operate.saveTab(prefix + "/edit", $("#form-gen-edit").serializeArray());
  281. }
  282. }
  283. var prefix = ctx + "tool/gen";
  284. $(function() {
  285. var options = {
  286. url: prefix + "/column/list",
  287. sortName: "sort",
  288. sortOrder: "desc",
  289. height: $(window).height() - 166,
  290. pagination: false,
  291. showSearch: false,
  292. showRefresh: false,
  293. showToggle: false,
  294. showColumns: false,
  295. onLoadSuccess: onLoadSuccess,
  296. onReorderRow: onReorderRow,
  297. columns: [{
  298. title: "序号",
  299. width: "5%",
  300. formatter: function (value, row, index) {
  301. // 编号隐藏域
  302. var columnIdHtml = $.common.sprintf("<input type='hidden' name='columns[%s].columnId' value='%s'>", index, row.columnId);
  303. // 排序隐藏域
  304. var sortHtml = $.common.sprintf("<input type='hidden' name='columns[%s].sort' value='%s' id='columns_sort_%s'>", index, row.sort, row.columnId);
  305. return columnIdHtml + sortHtml + $.table.serialNumber(index);
  306. },
  307. cellStyle: function(value, row, index) {
  308. return { css: { "cursor": "move" } };
  309. }
  310. },
  311. {
  312. field: 'columnName',
  313. title: '字段列名',
  314. width: "10%",
  315. class: "nodrag",
  316. cellStyle: function(value, row, index) {
  317. return { css: { "cursor": "default" } };
  318. }
  319. },
  320. {
  321. field: 'columnComment',
  322. title: '字段描述',
  323. width: "10%",
  324. formatter: function (value, row, index) {
  325. var html = $.common.sprintf("<input class='form-control' type='text' name='columns[%s].columnComment' value='%s'>", index, value);
  326. return html;
  327. }
  328. },
  329. {
  330. field: 'columnType',
  331. title: '物理类型',
  332. width: "10%",
  333. class: "nodrag",
  334. cellStyle: function(value, row, index) {
  335. return { css: { "cursor": "default" } };
  336. }
  337. },
  338. {
  339. field: 'javaType',
  340. title: 'Java类型',
  341. width: "10%",
  342. formatter: function (value, row, index) {
  343. var data = [{ index: index, javaType: value }];
  344. return $("#javaTypeTpl").tmpl(data).html();
  345. }
  346. },
  347. {
  348. field: 'javaField',
  349. title: 'Java属性',
  350. width: "10%",
  351. formatter: function (value, row, index) {
  352. var html = $.common.sprintf("<input class='form-control' type='text' name='columns[%s].javaField' value='%s' required>", index, value);
  353. return html;
  354. }
  355. },
  356. {
  357. field: 'isInsert',
  358. title: '插入',
  359. width: "5%",
  360. formatter: function (value, row, index) {
  361. var isCheck = value == 1 ? 'checked' : '';
  362. var html = $.common.sprintf("<label class='check-box'><input type='checkbox' name='columns[%s].isInsert' value='1' %s></label>", index, isCheck);
  363. return html;
  364. }
  365. },
  366. {
  367. field: 'isEdit',
  368. title: '编辑',
  369. width: "5%",
  370. formatter: function (value, row, index) {
  371. var isCheck = value == 1 ? 'checked' : '';
  372. var html = $.common.sprintf("<label class='check-box'><input type='checkbox' name='columns[%s].isEdit' value='1' %s></label>", index, isCheck);
  373. return html;
  374. }
  375. },
  376. {
  377. field: 'isList',
  378. title: '列表',
  379. width: "5%",
  380. formatter: function (value, row, index) {
  381. var isCheck = value == 1 ? 'checked' : '';
  382. var html = $.common.sprintf("<label class='check-box'><input type='checkbox' name='columns[%s].isList' value='1' %s></label>", index, isCheck);
  383. return html;
  384. }
  385. },
  386. {
  387. field: 'isQuery',
  388. title: '查询',
  389. width: "5%",
  390. formatter: function (value, row, index) {
  391. var isCheck = value == 1 ? 'checked' : '';
  392. var html = $.common.sprintf("<label class='check-box'><input type='checkbox' name='columns[%s].isQuery' value='1' %s></label>", index, isCheck);
  393. return html;
  394. }
  395. },
  396. {
  397. field: 'queryType',
  398. title: '查询方式',
  399. width: "10%",
  400. formatter: function (value, row, index) {
  401. var data = [{ index: index, queryType: value }];
  402. return $("#queryTypeTpl").tmpl(data).html();
  403. }
  404. },
  405. {
  406. field: 'isRequired',
  407. title: '必填',
  408. width: "5%",
  409. formatter: function (value, row, index) {
  410. var isCheck = value == 1 ? 'checked' : '';
  411. var html = $.common.sprintf("<label class='check-box'><input type='checkbox' name='columns[%s].isRequired' value='1' %s></label>", index, isCheck);
  412. return html;
  413. }
  414. },
  415. {
  416. field: 'htmlType',
  417. title: '显示类型',
  418. width: "12%",
  419. formatter: function (value, row, index) {
  420. var data = [{ index: index, htmlType: value }];
  421. return $("#htmlTypeTpl").tmpl(data).html();
  422. }
  423. },
  424. {
  425. field: 'dictType',
  426. title: '字典类型',
  427. width: "13%",
  428. formatter: function (value, row, index) {
  429. var html = $.common.sprintf("<input class='form-control' type='text' name='columns[%s].dictType' value='%s' id='columns_dict_%s'>", index, value, row.columnId);
  430. return "<div class='input-group'>" + html + "<span class='input-group-addon input-sm' onclick='selectDictTree(" + row.columnId + ", this)'><i class='fa fa-search'></i></span></div>";
  431. },
  432. cellStyle: function(value, row, index) {
  433. return { css: { "cursor": "default" } };
  434. }
  435. }]
  436. };
  437. $.table.init(options);
  438. });
  439. // 当所有数据被加载时触发处理函数
  440. function onLoadSuccess(data){
  441. $.fn.select2.defaults.set( "theme", "bootstrap" );
  442. $("select.form-control").each(function () {
  443. $(this).select2().on("change", function () {
  444. $(this).valid();
  445. })
  446. })
  447. $(".check-box").each(function() {
  448. $(this).iCheck({
  449. checkboxClass: 'icheckbox-blue'
  450. })
  451. })
  452. }
  453. // 当拖拽结束后处理函数
  454. function onReorderRow(data) {
  455. for (var i = 0; i < data.length; i++) {
  456. $("#columns_sort_" + data[i].columnId).val(i+1);
  457. }
  458. }
  459. $(function() {
  460. var tplCategory = $("#tplCategory option:selected").val();
  461. tplCategoryVisible(tplCategory);
  462. var genType = $('input[name="genType"]:checked').val();
  463. pathInfoVisible(genType);
  464. });
  465. $('#tplCategory').on('select2:select', function (event) {
  466. var tplCategory = $(event.target).val();
  467. tplCategoryVisible(tplCategory);
  468. });
  469. function tplCategoryVisible(tplCategory) {
  470. if("crud" == tplCategory){
  471. $("#treeCode").select2("val", [""]);
  472. $("#treeParentCode").select2("val", [""]);
  473. $("#treeName").select2("val", [""]);
  474. $("#otherInfo").addClass("hidden");
  475. $("#subInfo").addClass("hidden");
  476. } else if("tree" == tplCategory){
  477. $("#otherInfo").removeClass("hidden");
  478. $("#treeCode").attr("required", "true");
  479. $("#treeParentCode").attr("required", "true");
  480. $("#treeName").attr("required", "true");
  481. $("#subInfo").addClass("hidden");
  482. } else if("sub" == tplCategory){
  483. $("#subInfo").removeClass("hidden");
  484. $("#treeCode").select2("val", [""]);
  485. $("#treeParentCode").select2("val", [""]);
  486. $("#treeName").select2("val", [""]);
  487. $("#subTableName").attr("required", "true");
  488. $("#subTableFkName").attr("required", "true");
  489. $("#otherInfo").addClass("hidden");
  490. }
  491. }
  492. $('input').on('ifChecked', function(event){
  493. var genType = $(event.target).val();
  494. pathInfoVisible(genType);
  495. });
  496. function pathInfoVisible(genType) {
  497. if("0" == genType){
  498. $("#genPath").val("/");
  499. $("#pathinfo").addClass("hidden");
  500. } else if("1" == genType){
  501. $("#pathinfo").removeClass("hidden");
  502. }
  503. }
  504. // 选择字典处理函数
  505. function selectDictTree(columnId, obj) {
  506. var dictType = $.common.nullToStr($(obj).parent().find("input").val());
  507. var url = ctx + "system/dict/selectDictTree/" + columnId + "/" + dictType;
  508. var options = {
  509. title: '选择字典类型',
  510. width: "380",
  511. url: url,
  512. callBack: doDictSubmit
  513. };
  514. $.modal.openOptions(options);
  515. }
  516. // 选择菜单处理函数
  517. function selectMenuTree() {
  518. var parentMenuId = $("#parentMenuId").val();
  519. var menuId = parentMenuId > 0 ? parentMenuId : 1;
  520. var url = ctx + "system/menu/selectMenuTree/" + menuId;
  521. var options = {
  522. title: '菜单选择',
  523. width: "380",
  524. url: url,
  525. callBack: doMenuSubmit
  526. };
  527. $.modal.openOptions(options);
  528. }
  529. function doDictSubmit(index, layero){
  530. var body = layer.getChildFrame('body', index);
  531. var columnId = body.find('#columnId').val();
  532. var dictType = body.find('#dictType').val();
  533. layer.close(index);
  534. $("#columns_dict_" + columnId).val(dictType);
  535. }
  536. function doMenuSubmit(index, layero){
  537. var body = layer.getChildFrame('body', index);
  538. $("#parentMenuId").val(body.find('#treeId').val());
  539. $("#parentMenuName").val(body.find('#treeName').val());
  540. layer.close(index);
  541. }
  542. </script>
  543. </body>
  544. </html>
  545. <!-- java类型 -->
  546. <script id="javaTypeTpl" type="text/x-jquery-tmpl">
  547. <div>
  548. <select class='form-control' name='columns[${index}].javaType'>
  549. <option value="Long" {{if javaType==="Long"}}selected{{/if}}>Long</option>
  550. <option value="String" {{if javaType==="String"}}selected{{/if}}>String</option>
  551. <option value="Integer" {{if javaType==="Integer"}}selected{{/if}}>Integer</option>
  552. <option value="Double" {{if javaType==="Double"}}selected{{/if}}>Double</option>
  553. <option value="BigDecimal" {{if javaType==="BigDecimal"}}selected{{/if}}>BigDecimal</option>
  554. <option value="Date" {{if javaType==="Date"}}selected{{/if}}>Date</option>
  555. </select>
  556. </div>
  557. </script>
  558. <!-- 查询方式 -->
  559. <script id="queryTypeTpl" type="text/x-jquery-tmpl">
  560. <div>
  561. <select class='form-control' name='columns[${index}].queryType'>
  562. <option value="EQ" {{if queryType==="EQ"}}selected{{/if}}>=</option>
  563. <option value="NE" {{if queryType==="NE"}}selected{{/if}}>!=</option>
  564. <option value="GT" {{if queryType==="GT"}}selected{{/if}}>></option>
  565. <option value="GTE" {{if queryType==="GTE"}}selected{{/if}}>>=</option>
  566. <option value="LT" {{if queryType==="LT"}}selected{{/if}}><</option>
  567. <option value="LTE" {{if queryType==="LTE"}}selected{{/if}}><=</option>
  568. <option value="LIKE" {{if queryType==="LIKE"}}selected{{/if}}>Like</option>
  569. <option value="BETWEEN" {{if queryType==="BETWEEN"}}selected{{/if}}>Between</option>
  570. </select>
  571. </div>
  572. </script>
  573. <!-- 显示类型 -->
  574. <script id="htmlTypeTpl" type="text/x-jquery-tmpl">
  575. <div>
  576. <select class='form-control' name='columns[${index}].htmlType'>
  577. <option value="input" {{if htmlType==="input"}}selected{{/if}}>文本框</option>
  578. <option value="textarea" {{if htmlType==="textarea"}}selected{{/if}}>文本域</option>
  579. <option value="select" {{if htmlType==="select"}}selected{{/if}}>下拉框</option>
  580. <option value="radio" {{if htmlType==="radio"}}selected{{/if}}>单选框</option>
  581. <option value="checkbox" {{if htmlType==="checkbox"}}selected{{/if}}>复选框</option>
  582. <option value="summernote" {{if htmlType==="summernote"}}selected{{/if}}>富文本</option>
  583. <option value="datetime" {{if htmlType==="datetime"}}selected{{/if}}>日期控件</option>
  584. <option value="upload" {{if htmlType==="upload"}}selected{{/if}}>上传控件</option>
  585. </select>
  586. </div>
  587. </script>