genTableForm.html 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
  5. <meta charset="utf-8"/>
  6. <meta name="viewport"
  7. content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
  8. <link rel="stylesheet"
  9. href="/common-assets/plugins/font-awesome/css/font-awesome.min.css"/>
  10. <link rel="stylesheet" href="/common-assets/plugins/outdated/bootstrap/css/bootstrap.min.css"/>
  11. <link rel="stylesheet" href="/common-assets/css/outdated/style.css"/>
  12. <link rel="stylesheet"
  13. href="/common-assets/plugins/outdated/metisMenu/2.7/metisMenu.min.css"/>
  14. <link rel="stylesheet"
  15. href="/common-assets/plugins/outdated/bootstrap-toastr/2.0.1/toastr.min.css"/>
  16. <link rel="stylesheet" href="/common-assets/plugins/outdated/icheck/custom.css"/>
  17. <script src='/common-assets/js/jquery-2.1.1.js'></script>
  18. <script src="/common-assets/js/outdated/bootstrap.min.js"></script>
  19. <script src="/common-assets/js/outdated/jquery.form-3.51.0.min.js"></script>
  20. <script src="/common-assets/plugins/layer/3.0.3/layer.js"></script>
  21. <script src="/common-assets/plugins/outdated/pace/pace.min.js"></script>
  22. <script src="/common-assets/plugins/outdated/slimscroll/jquery.slimscroll.min.js"></script>
  23. <script src="/common-assets/plugins/outdated/bootstrap-toastr/2.0.1/toastr.min.js"></script>
  24. <script src="/common-assets/plugins/outdated/jquery-validation/jquery.validate-1.11.1.min.js"></script>
  25. <script src="/common-assets/plugins/outdated/jquery-validation/localization/messages_zh.js"></script>
  26. <script src="/common-assets/plugins/outdated/icheck/icheck.min.js"></script>
  27. <script src="/common-assets/plugins/outdated/metisMenu/2.7/metisMenu.js"></script>
  28. <script src="/common-assets/plugins/dotize/dotize.js"></script>
  29. <script src="/common-assets/js/promise-polyfill.min.js"></script>
  30. <!-- 开发阶段使用vue.js以获取编译信息 -->
  31. <script src="/common-assets/plugins/vue/2.5.17/vue.js"></script>
  32. <script src="/common-assets/plugins/axios/0.18.0/axios.min.js"></script>
  33. <!-- 基础依赖-->
  34. <link rel="stylesheet" href="/common-assets/plugins/outdated/clockpicker/clockpicker.css">
  35. <link rel="stylesheet" href="/common-assets/plugins/outdated/chosen/1.6.2/chosen.css"/>
  36. <script src="/common-assets/plugins/outdated/chosen/1.6.2/chosen.jquery.js"></script>
  37. <script
  38. src="/common-assets/plugins/outdated/jquery-tablednd/jquery.tablednd-0.5.min.js"></script>
  39. <style type="text/css">
  40. tr.myDragClass td {
  41. /*position: fixed;*/
  42. color: blue;
  43. text-shadow: 0 0 10px black, 0 0 10px black, 0 0 8px black, 0 0 6px black, 0 0 6px black;
  44. background-color: #999;
  45. -webkit-box-shadow: 0 12px 14px -12px #111 inset, 0 -2px 2px -1px #333 inset;
  46. }
  47. tr.myDragClass td:first-child {
  48. -webkit-box-shadow: 0 12px 14px -12px #111 inset, 12px 0 14px -12px #111 inset, 0 -2px 2px -1px #333 inset;
  49. }
  50. tr.myDragClass td:last-child {
  51. -webkit-box-shadow: 0 12px 14px -12px #111 inset, -12px 0 14px -12px #111 inset, 0 -2px 2px -1px #333 inset;
  52. }
  53. </style>
  54. <title>表单配置</title>
  55. </head>
  56. <body class="pace-done white-bg">
  57. <div class="container-fluid mt15">
  58. <form id="inputForm" v-cloak :action="saveUrl" method="post"
  59. class="form-horizontal">
  60. <input type="hidden" name="id"/>
  61. <table class="table table-bordered table-condensed dataTables-example dataTable no-footer">
  62. <tbody>
  63. <tr>
  64. <td class="width-15 active"><label class="pull-right control-label">名称:</label></td>
  65. <td class="width-35">
  66. <input name="name" id="name" v-model="entity.name" maxlength="200" class="form-control required"
  67. disabled/>
  68. </td>
  69. <td class="width-15 active"><label class="pull-right control-label"><span
  70. style="color: red; ">*</span>说明:</label></td>
  71. <td class="width-35">
  72. <input name="comments" id="comments" v-model="entity.comments"
  73. maxlength="500" class="form-control required" :disabled="editType === 'view'"/>
  74. </td>
  75. </tr>
  76. <tr>
  77. <td class="width-15 active"><label class="pull-right control-label">逻辑类型:</label></td>
  78. <td class="width-35">
  79. <select name="dataLogicType" id="dataLogicType" v-model="entity.dataLogicType"
  80. class="required form-control" disabled>
  81. <option v-for="item in dataLogicTypeDict" :key="item.id" :value="item.paramCode">
  82. {{item.paramName}}
  83. </option>
  84. </select>
  85. </td>
  86. <td class="width-15 active"><label class="pull-right control-label"><span
  87. style="color: red; ">*</span>记录别名</label></td>
  88. <td class="width-35">
  89. <input name="tableAlias" id="tableAlias" v-model="entity.tableAlias"
  90. maxlength="100" class="form-control required" :disabled="editType === 'view'"/>
  91. </td>
  92. </tr>
  93. <tr>
  94. <td class="width-15 active"><label class="pull-right control-label">数据源:</label></td>
  95. <td class="width-35">
  96. <input name="genDatasource.dsName" id="genDatasource.dsName" v-model="entity.genDatasource.dsName"
  97. maxlength="100" disabled class="form-control required"/>
  98. </td>
  99. <td class="width-15 active"><label class="pull-right control-label"><span
  100. style="color: red; ">*</span>类名:</label></td>
  101. <td class="width-35">
  102. <input id="className" name="className" v-model="entity.className"
  103. maxlength="100" class="form-control required" :disabled="editType === 'view'"/>
  104. </td>
  105. </tr>
  106. <tr>
  107. <td class="width-15 active"><label class="pull-right control-label"><span
  108. style="color: red; ">*</span>主键:</label></td>
  109. <td class="width-35">
  110. <select id="primaryKey" name="pkField" :disabled="editType === 'view'"
  111. class="required form-control" v-model="entity.pkField">
  112. <option value="">--请选择主键--</option>
  113. <option v-for="column in entity.columnList" :key="column.name" :value="column.name"
  114. :selected="column.isPk === '1'">{{column.name}}
  115. </option>
  116. </select></td>
  117. <td class="width-15 active">
  118. <label v-if="needSequence" class="pull-right control-label"> <span style="color: red; ">*</span>
  119. 主键Sequence:
  120. </label>
  121. </td>
  122. <td class="width-35">
  123. <input v-if="needSequence" :disabled="editType === 'view'" name="idGenName" id="idGenName"
  124. v-model="entity.idGenName" maxlength="100" class="form-control required"/>
  125. </td>
  126. </tr>
  127. </tbody>
  128. </table>
  129. <br/>
  130. <div class="row">
  131. <div class="col-md-12 col-sm-12 col-xs-12 tabs-container" role="tabpanel">
  132. <ul class="nav nav-tabs" role="tablist" id="naviTab">
  133. <li class="active"><a aria-expanded="false" role="tab"
  134. href="#pageProperty" data-toggle="tab" id="pagePropertyTab">页面属性</a></li>
  135. <li><a aria-expanded="false" role="tab" href="#gridProperty"
  136. data-toggle="tab" id="gridPropertyTab">自定义JAVA对象信息</a></li>
  137. <li><a aria-expanded="false" role="tab"
  138. href="#advancedProperty" data-toggle="tab"
  139. id="advancedPropertyTab">高级属性(可选)</a></li>
  140. </ul>
  141. <div class="tab-content">
  142. <div id="pageProperty" role="tabpanel" class="tab-pane active">
  143. <div class="row">
  144. <div class="col-md-12 col-sm-12 col-xs-12">
  145. <table id="pageTable"
  146. class="table table-striped table-bordered table-hover table-condensed dataTables-example dataTable">
  147. <thead>
  148. <tr>
  149. <th width="40px" style="display: none;">序号</th>
  150. <th title="数据库字段名" width="15%">列名</th>
  151. <th title="默认读取数据库字段备注">说明</th>
  152. <th title="实体对象的属性字段类型" width="15%">Java类型</th>
  153. <th
  154. title="实体对象的属性字段(对象名.属性名|属性名2|属性名3,例如:用户user.id|name|loginName,属性名2和属性名3为Join时关联查询的字段)">
  155. Java属性名称
  156. <i class="icon-question-sign"></i>
  157. </th>
  158. <th title="选中后该字段被加入到查询列表里">表单</th>
  159. <th title="选中后该字段被加入到查询列表里">列表</th>
  160. <th title="选中后该字段被加入到查询条件里">查询</th>
  161. <th title="该字段为查询字段时的查询匹配放松" width="10%">查询匹配方式</th>
  162. <th title="字段在表单中显示的类型" width="10%">显示表单类型</th>
  163. <th title="显示表单类型设置为“下拉框、复选框、点选框”时,需设置字典的类型">字典类型</th>
  164. <th title="显示表单类型设置为“下拉框”时,可以设置级联字段">级联属性名称</th>
  165. <th title="数据库中设置的字段类型及长度" style="display: none">物理类型</th>
  166. <th title="是否是数据库主键" style="display: none">主键</th>
  167. <th title="字段是否可为空值,不可为空字段自动进行空值验证" style="display: none">可空</th>
  168. </tr>
  169. </thead>
  170. <tbody>
  171. <tr v-for="(item, index) in entity.columnList" :key="item.id">
  172. <td style="display: none;">
  173. <input type="hidden"
  174. :name="'entity.columnList['+index+'].genTableColumnUi.sort'"
  175. v-model="item.genTableColumnUi.sort"
  176. class="form-control required digits"/>
  177. <label>{{index}}</label></td>
  178. <td><input :name="'entity.columnList['+index+'].name'"
  179. :disabled="editType === 'view'"
  180. class="form-control" v-model="item.name"
  181. readonly="readonly"/></td>
  182. <td><input type="text"
  183. :name="'entity.columnList['+index+'].comments'"
  184. :disabled="editType === 'view'"
  185. v-model="item.comments" maxlength="200"
  186. class="form-control"/></td>
  187. <td>
  188. <select :name="'entity.columnList['+index+'].javaType'"
  189. :disabled="editType === 'view'"
  190. v-model="item.javaType"
  191. onchange="javaTypeChanged(this)" class="form-control required m-b">
  192. <option v-for="item in javaTypeDict" :key="item.id"
  193. :value="item.paramCode">
  194. {{item.paramName}}
  195. </option>
  196. <option v-if="isCustomJavaType(item)" :value="item.javaType" selected>
  197. {{getClassName(item.javaType)}}
  198. </option>
  199. <option v-else-if="item.javaType == 'This'" selected>
  200. {{entity.className}}
  201. </option>
  202. </select>
  203. </td>
  204. <td>
  205. <input :name="'entity.columnList['+index+'].javaField'"
  206. :disabled="editType === 'view'"
  207. v-model="item.javaField" class="form-control required"/></td>
  208. <td>
  209. <label class="checkbox-container">
  210. <input type="checkbox" v-model="item.genTableColumnUi.isForm"
  211. true-value="1" false-value="0" :disabled="editType === 'view'"
  212. :name="'entity.columnList['+index+'].genTableColumnUi.isForm'">
  213. <span class="checkmark"></span>
  214. </label>
  215. </td>
  216. <td>
  217. <label class="checkbox-container">
  218. <input type="checkbox" v-model="item.genTableColumnUi.isList"
  219. true-value="1" false-value="0" :disabled="editType === 'view'"
  220. :name="'entity.columnList['+index+'].genTableColumnUi.isList'">
  221. <span class="checkmark"></span>
  222. </label>
  223. </td>
  224. <td>
  225. <label class="checkbox-container">
  226. <input type="checkbox" v-model="item.genTableColumnUi.isQuery"
  227. true-value="1" false-value="0" :disabled="editType === 'view'"
  228. :name="'entity.columnList['+index+'].genTableColumnUi.isQuery'">
  229. <span class="checkmark"></span>
  230. </label>
  231. </td>
  232. <td>
  233. <select :name="'entity.columnList['+index+'].genTableColumnUi.queryType'"
  234. v-model="item.genTableColumnUi.queryType"
  235. :disabled="editType === 'view'"
  236. class="form-control required m-b">
  237. <option v-for="queryType in queryTypeDict" :key="queryType.id"
  238. :value="queryType.paramCode">
  239. {{queryType.paramName}}
  240. </option>
  241. </select>
  242. </td>
  243. <td>
  244. <select :name="'entity.columnList['+index+'].genTableColumnUi.showType'"
  245. v-model="item.genTableColumnUi.showType"
  246. :disabled="editType === 'view'"
  247. class="form-control required m-b" onchange="showTypeChanged(this)">
  248. <option v-for="showType in showTypeDict" :key="showType.id"
  249. :value="showType.paramCode">
  250. {{showType.paramName}}
  251. </option>
  252. </select>
  253. </td>
  254. <td>
  255. <input class="form-control" v-model="item.genTableColumnUi.dictType"
  256. :disabled="editType === 'view'"
  257. :name="'entity.columnList['+index+'].genTableColumnUi.dictType'"/>
  258. </td>
  259. <td>
  260. <input class="form-control" v-model="item.genTableColumnUi.triggerOff"
  261. :disabled="editType === 'view'"
  262. :name="'entity.columnList['+index+'].genTableColumnUi.triggerOff'"/>
  263. </td>
  264. <td style="display: none">
  265. <input :name="'entity.columnList['+index+'].jdbcType'"
  266. :disabled="editType === 'view'"
  267. class="form-control required" v-model="item.jdbcType"/>
  268. </td>
  269. <td style="display: none">
  270. <input type="checkbox" class="i-checks"
  271. :name="'entity.columnList['+index+'].isPk'"
  272. v-model="item.isPk" :checked="'1'===item.isPk"/>
  273. <input type="hidden" :name="'entity.columnList['+index+'].isEdit'"
  274. v-model="item.isEdit"/>
  275. <input type="hidden" :name="'entity.columnList['+index+'].isInsert'"
  276. v-model="item.isInsert"/>
  277. </td>
  278. <td style="display: none">
  279. <input type="checkbox" class="i-checks"
  280. :name="'entity.columnList['+index+'].isNull'"
  281. v-model="item.isNull" :checked="'1'===item.isNull"/>
  282. </td>
  283. </tr>
  284. </tbody>
  285. </table>
  286. </div>
  287. </div>
  288. </div>
  289. <div id="gridProperty" role="tabpanel" class="tab-pane">
  290. <div class="row">
  291. <div class="col-md-12 col-sm-12 col-xs-12">
  292. <table id="gridTable"
  293. class="table table-striped table-bordered table-hover table-condensed dataTables-example dataTable">
  294. <thead>
  295. <tr>
  296. <th title="数据库字段名" width="15%">列名</th>
  297. <th title="实体对象的属性字段类型" width="15%">table表名</th>
  298. <th title="实体对象的属性字段说明(label1|label2|label3,用户名|登录名|角色)">JAVA属性说明<i
  299. class="icon-question-sign"></i></th>
  300. <th title="选中后该字段被加入到查询列表里">JAVA属性名称</th>
  301. <th title="选中后该字段被加入到查询列表里">检索标签</th>
  302. <th title="选中后该字段被加入到查询条件里">检索key</th>
  303. </tr>
  304. </thead>
  305. <tbody>
  306. <tr v-for="(item, index) in entity.columnList" :key="item.id">
  307. <td><input :name="'entity.columnList['+index+'].name'"
  308. class="form-control" v-model="item.name"
  309. disabled="disabled"/></td>
  310. <td><input type="text"
  311. :name="'entity.columnList['+index+'].genTableColumnUi.tableName'"
  312. v-model="item.genTableColumnUi.tableName"
  313. class="form-control"/></td>
  314. <td><input type="text"
  315. :name="'entity.columnList['+index+'].genTableColumnUi.fieldLabels'"
  316. v-model="item.genTableColumnUi.fieldLabels"
  317. class="form-control"/></td>
  318. <td><input type="text"
  319. :name="'entity.columnList['+index+'].genTableColumnUi.fieldKeys'"
  320. v-model="item.genTableColumnUi.fieldKeys"
  321. class="form-control"/></td>
  322. <td><input type="text"
  323. :name="'entity.columnList['+index+'].genTableColumnUi.searchLabel'"
  324. v-model="item.genTableColumnUi.searchLabel"
  325. class="form-control"/></td>
  326. <td><input type="text"
  327. :name="'entity.columnList['+index+'].genTableColumnUi.searchKey'"
  328. v-model="item.genTableColumnUi.searchKey"
  329. class="form-control"/></td>
  330. </tr>
  331. </tbody>
  332. </table>
  333. </div>
  334. </div>
  335. </div>
  336. <div id="advancedProperty" role="tabpanel" class="tab-pane">
  337. <div class="row">
  338. <div class="col-md-12 col-sm-12 col-xs-12">
  339. <table id="advancedTable"
  340. class="table table-striped table-bordered table-hover table-condensed dataTables-example dataTable">
  341. <thead>
  342. <tr>
  343. <th title="数据库字段名" width="15%">列名</th>
  344. <th title="查询面板字段排序" width="15%">查询排序</th>
  345. <th title="页面列表字段排序" width="15%">列表排序</th>
  346. <th title="明细表单字段排序" width="15%">表单排序</th>
  347. </tr>
  348. </thead>
  349. <tbody>
  350. <tr v-for="(item, index) in entity.columnList" :key="item.id">
  351. <td><input :name="'entity.columnList['+index+'].name'"
  352. class="form-control" v-model="item.name"
  353. disabled="disabled"/></td>
  354. <td><input type="number" :disabled="editType === 'view'"
  355. :name="'entity.columnList['+index+'].genTableColumnUi.querySort'"
  356. v-model="item.genTableColumnUi.querySort"
  357. class="form-control required" min="0"/></td>
  358. <td><input type="number" :disabled="editType === 'view'"
  359. :name="'entity.columnList['+index+'].genTableColumnUi.listSort'"
  360. v-model="item.genTableColumnUi.listSort"
  361. class="form-control required" min="0"/></td>
  362. <td><input type="number" :disabled="editType === 'view'"
  363. :name="'entity.columnList['+index+']genTableColumnUi.formSort'"
  364. v-model="item.genTableColumnUi.formSort"
  365. class="form-control required" min="0"/></td>
  366. </tr>
  367. </tbody>
  368. </table>
  369. </div>
  370. </div>
  371. </div>
  372. </div>
  373. </div>
  374. </div>
  375. </form>
  376. </div>
  377. </body>
  378. <script src="/common-assets/js/project.config.js"></script>
  379. <script src="../static/config.js"></script>
  380. <script src="/common-assets/js/outdated/common.js"></script>
  381. <script src="../static/js/genTableForm.js"></script>
  382. </html>