cgFormHead.jsp 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386
  1. <%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2. <%@page import="org.jeecgframework.web.cgform.common.CgAutoListConstant"%>
  3. <%@include file="/context/mytags.jsp"%>
  4. <!DOCTYPE html>
  5. <%
  6. String lang = (String)request.getSession().getAttribute("lang");
  7. String langurl = basePath + "/plug-in/mutiLang/" + lang +".js";
  8. %>
  9. <html>
  10. <head>
  11. <title><t:mutiLang langKey="smark.form.form.maintain"/></title>
  12. <script src=<%=langurl%> type="text/javascript"></script>
  13. <t:base type="jquery,easyui,jqueryui-sortable,tools"></t:base>
  14. <script type="text/javascript" src="plug-in/cgform/js/cgformField.js"></script>
  15. <style type="text/css">
  16. .table-list {
  17. margin: 0;
  18. width: auto;
  19. margin-left: 0px;
  20. margin-right: 0px;
  21. overflow: hidden;
  22. }
  23. .table-list td,.table-list th {
  24. text-align: center;
  25. }
  26. .t_table {
  27. overflow: auto; /*让内容表格外面的div自动有滚动条*/
  28. margin-left: 0px;
  29. margin-right: 0px;
  30. width: auto;
  31. }
  32. #tab_div_database tr {
  33. border-bottom: 1px solid #e6e6e6;
  34. cursor: n-resize;
  35. }
  36. /*update-end--Author:liuht Date:20131207 for[333]:OL模块,增加一个特效 调整字段顺序(上下挪动)*/
  37. </style>
  38. </head>
  39. <body style="overflow-y: hidden; overflow-x: hidden;" scroll="no">
  40. <!-- 增加beforeSubmit页面逻辑删除-->
  41. <t:formvalid formid="formobj" dialog="true" usePlugin="password" beforeSubmit="deleteUnUsedFiled();" layout="table" tiptype="1" action="cgFormHeadController.do?save">
  42. <!-- tiptype="1" -->
  43. <input id="id" name="id" type="hidden" value="${cgFormHeadPage.id}">
  44. <input id="langurl" name="langurl" type="hidden" value="<%=langurl%>">
  45. <!-- add-start--Author:gengjiajia Date:20160804 for:添加表类型隐藏域-->
  46. <input id="tableType" name="tableType" type="hidden" value="${cgFormHeadPage.tableType}">
  47. <!-- add-start--Author:gengjiajia Date:20160804 for:添加表类型隐藏域-->
  48. <table cellpadding="0" cellspacing="1" class="formtable">
  49. <tr>
  50. <td align="right"><label class="Validform_label"> <t:mutiLang langKey="table.name"/>: </label></td>
  51. <td class="value">
  52. <input class="inputxt" id="tableName" name="tableName" value="${cgFormHeadPage.tableName}"
  53. prefixName="" <c:if test="${not empty cgFormHeadPage.tableName}">readonly="readonly"</c:if> datatype="*" validType="cgform_head,table_Name,id" nullmsg=<t:mutiLang langKey="please.input.table.name"/>>
  54. <span class="Validform_checktip"></span>
  55. </td>
  56. <td align="right"><label class="Validform_label"> <t:mutiLang langKey="table.description"/>: </label></td>
  57. <td class="value"><input class="inputxt" id="content" name="content" value="${cgFormHeadPage.content}" datatype="s2-100"> <span class="Validform_checktip"></span></td>
  58. </tr>
  59. <tr>
  60. <td align="right"><label class="Validform_label"> <t:mutiLang langKey="pk.strategies"/>:</label></td>
  61. <td class="value" id="jformPkTypeTd" <c:if test="${cgFormHeadPage.jformPkType ne 'SEQUENCE'}">colspan="3"</c:if>>
  62. <select id="jformPkType" name="jformPkType" onchange="jformPkTypeChange();">
  63. <option value="UUID" <c:if test="${cgFormHeadPage.jformPkType eq 'UUID'}"> selected='selected'</c:if>><t:mutiLang langKey="common.uuid36bit"/></option>
  64. <option value="NATIVE" <c:if test="${cgFormHeadPage.jformPkType eq 'NATIVE'}"> selected='selected'</c:if>><t:mutiLang langKey="common.native.auto.increment"/></option>
  65. <option value="SEQUENCE" <c:if test="${cgFormHeadPage.jformPkType eq 'SEQUENCE'}"> selected='selected'</c:if>><t:mutiLang langKey="common.sequence"/></option>
  66. </select>
  67. </td>
  68. <td align="right" id="jformPkSequenceN" <c:if test="${cgFormHeadPage.jformPkType ne 'SEQUENCE'}">style="display: none;"</c:if>><label class="Validform_label"> <t:mutiLang langKey="sequence.name"/>:</label></td>
  69. <td class="value" id="jformPkSequenceV" <c:if test="${cgFormHeadPage.jformPkType ne 'SEQUENCE'}">style="display: none;"</c:if>><input id="jformPkSequence" name="jformPkSequence" type="text"
  70. class="inputxt" value="${cgFormHeadPage.jformPkSequence}" /> <span class="Validform_checktip"></span> <label class="Validform_label" style="display: none;"> <t:mutiLang langKey="sequence.name"/>:</label></td>
  71. </tr>
  72. <tr>
  73. <!--add-start--Author:luobaoli Date:20150607 for:增加表单分类下拉列表-->
  74. <td align="right"><label class="Validform_label"> <t:mutiLang langKey="form.category"/>:</label></td>
  75. <td class="value"><select id="jformCategory" name="jformCategory">
  76. <c:forEach items="${typeList}" var="type">
  77. <option value="${type.typecode}" <c:if test="${type.typecode==cgFormHeadPage.jformCategory}">selected="selected"</c:if>>${type.typename}</option>
  78. </c:forEach>
  79. </select></td>
  80. <!--add-end--Author:luobaoli Date:20150607 for:增加表单分类下拉列表-->
  81. <td align="right"><label class="Validform_label"> <t:mutiLang langKey="table.type"/>: </label></td>
  82. <td class="value"><select id="jformType" name="jformType" onchange="formTypeChange();">
  83. <option value="1" <c:if test="${cgFormHeadPage.jformType eq '1'}"> selected='selected'</c:if>><t:mutiLang langKey="single.table"/></option>
  84. <option value="2" <c:if test="${cgFormHeadPage.jformType eq '2'}"> selected="selected"</c:if>><t:mutiLang langKey="master.table"/></option>
  85. <option value="3" <c:if test="${cgFormHeadPage.jformType eq '3'}"> selected="selected"</c:if>><t:mutiLang langKey="slave.table"/></option>
  86. </select>
  87. <div id="relation_type_div" style="display: none;">
  88. <input type="radio" name="relationType"
  89. <c:if test="${cgFormHeadPage.relationType eq '0' || cgFormHeadPage.relationType ==null }">
  90. checked="checked"
  91. </c:if> value="0">
  92. <t:mutiLang langKey="common.one.to.many"/>
  93. </input>
  94. <input type="radio" name="relationType"
  95. <c:if test="${cgFormHeadPage.relationType eq '1' }">
  96. checked="checked"
  97. </c:if> value="1">
  98. <t:mutiLang langKey="comon.one.to.one"/>
  99. </input> &nbsp;
  100. <t:mutiLang langKey="sequence.name"/>:<input class="inputxt" style="width: 30px" id="tabOrder" name="tabOrder" value="${cgFormHeadPage.tabOrder}" datatype="n" ignore="ignore"></div>
  101. </td>
  102. </tr>
  103. <tr>
  104. <!--add-start--Author:张忠亮 Date:20150618 for:增加表单模板选择-->
  105. <td align="right"><label class="Validform_label"> <t:mutiLang langKey="form.template.style_pc" />:</label></td>
  106. <td class="value"><select id="formTemplate" name="formTemplate" temVal="${cgFormHeadPage.formTemplate}"></select></td>
  107. <!--add-end--Author:张忠亮 Date:20150618 for:增加表单模板选择-->
  108. <!--add-start--Author:scott Date:20160301 for:online表单移动样式单独配置-->
  109. <td align="right"><label class="Validform_label"> <t:mutiLang langKey="form.template.style_mobile" />:</label></td>
  110. <td class="value"><select id="formTemplateMobile" name="formTemplateMobile" temVal="${cgFormHeadPage.formTemplateMobile}"></select></td>
  111. <!--add-start--Author:scott Date:20160301 for:online表单移动样式单独配置-->
  112. </tr>
  113. <tr>
  114. <td align="right"><label class="Validform_label"> <t:mutiLang langKey="show.checkbox"/>: </label></td>
  115. <td class="value"><select id="isCheckbox" name="isCheckbox">
  116. <option value="N" <c:if test="${cgFormHeadPage.isCheckbox eq 'N'}"> selected="selected"</c:if>><t:mutiLang langKey="common.no"/></option>
  117. <option value="Y" <c:if test="${cgFormHeadPage.isCheckbox eq 'Y'}"> selected="selected"</c:if>><t:mutiLang langKey="common.yes"/></option>
  118. </select></td>
  119. <td align="right"><label class="Validform_label"> <t:mutiLang langKey="is.page"/>:</label></td>
  120. <td class="value"><select id="isPagination" name="isPagination">
  121. <option value="Y" <c:if test="${cgFormHeadPage.isPagination eq 'Y'}"> selected='selected'</c:if>><t:mutiLang langKey="common.yes"/></option>
  122. <option value="N" <c:if test="${cgFormHeadPage.isPagination eq 'N'}"> selected="selected"</c:if>><t:mutiLang langKey="common.no"/></option>
  123. </select></td>
  124. </tr>
  125. <tr>
  126. <td align="right"><label class="Validform_label"> <t:mutiLang langKey="is.tree"/>: </label></td>
  127. <td class="value"><select id="isTree" name="isTree">
  128. <option value="N" <c:if test="${cgFormHeadPage.isTree eq 'N'}"> selected='selected'</c:if>><t:mutiLang langKey="common.no"/></option>
  129. <option value="Y" <c:if test="${cgFormHeadPage.isTree eq 'Y'}"> selected='selected'</c:if>><t:mutiLang langKey="common.yes"/></option>
  130. </select></td>
  131. <td align="right"><label class="Validform_label"> <t:mutiLang langKey="common.query.module"/>: </label></td>
  132. <td class="value"><select id="querymode" name="querymode">
  133. <option value="single" <c:if test="${cgFormHeadPage.querymode eq 'single'}"> selected="selected"</c:if>><t:mutiLang langKey="single.query"/></option>
  134. <option value="group" <c:if test="${cgFormHeadPage.querymode eq 'group'}"> selected="selected"</c:if>><t:mutiLang langKey="combine.query"/></option>
  135. </select></td>
  136. </tr>
  137. <c:if test="${cgFormHeadPage.jformType eq '2'}">
  138. <tr id="fb_tb">
  139. <td align="right"><label class="Validform_label"><t:mutiLang langKey="slave.table"/></label></td>
  140. <td class="value" colspan="3"><input class="inputxt" style="width: 440px" disabled="disabled" value="${cgFormHeadPage.subTableStr}"></td>
  141. </tr>
  142. </c:if>
  143. <tr class="tree">
  144. <td align="right"><label class="Validform_label"> 树形表单父id: </label></td>
  145. <td class="value"><input class="inputxt" id="treeParentIdFieldName" name="treeParentIdFieldName" value="${cgFormHeadPage.treeParentIdFieldName}" datatype="s2-100"> <span class="Validform_checktip"></span></td>
  146. <td align="right"><label class="Validform_label"> 树开表单列: </label></td>
  147. <td class="value"><input class="inputxt" id="treeFieldname" name="treeFieldname" value="${cgFormHeadPage.treeFieldname}" datatype="s2-100"> <span class="Validform_checktip"></span></td>
  148. </tr>
  149. <tr style="display:none;">
  150. <td align="right"><label class="Validform_label"> idField: </label></td>
  151. <td class="value"><input class="inputxt" id="treeIdFieldname" name="treeIdFieldname" value="id" datatype="s2-100"> <span class="Validform_checktip"></span></td>
  152. </tr>
  153. </table>
  154. <div id="tabs" class="easyui-tabs" tabPosition="top" fit="false" style="margin: 0px; padding: 0px; overflow: hidden; width: auto;">
  155. <div title= '<t:mutiLang langKey="database.property"/>' width="auto" style="width: auto; margin: 0px; padding: 0px; overflow: hidden;">
  156. <!-- add-start--Author:gengjiajia Date:20160804 for:如果表类型是“配置表”,则online表单配置不可修改,禁止添加,删除,按钮-->
  157. <c:if test="${cgFormHeadPage.tableType != '1'}">
  158. <div style="height: 25px;" class="datagrid-toolbar"><a id="addColumnBtn" class="easyui-linkbutton" data-options="iconCls:'icon-add'" onclick="addColumnBtnClick();" href="#"><t:mutiLang langKey="common.add.to"/></a> <a
  159. id="delColumnBtn" class="easyui-linkbutton" data-options="iconCls:'icon-remove'" onclick="delColumnBtnClick();" href="#"><t:mutiLang langKey="common.delete"/></a></div>
  160. </c:if>
  161. <!-- add-end--Author:gengjiajia Date:20160804 for:如果表类型是“配置表”,则online表单配置不可修改,禁止添加,删除,按钮-->
  162. <table id="tab_div_database_title" class="table-list" style="height: 25px;">
  163. </table>
  164. <div class="t_table" id="t_table_database">
  165. <table id="tab_div_database" class="table-list">
  166. </table>
  167. <br><br><br>
  168. <%--//update-end--Author:zhangdaihao Date:20170309 for:TASK #1754 【bug】online编辑的时候,树类型的时候,最后一行没显示出来--%>
  169. <div style="height: 43px"></div>
  170. <%--//update-end--Author:zhangdaihao Date:20170309 for:TASK #1754 【bug】online编辑的时候,树类型的时候,最后一行没显示出来--%>
  171. </div>
  172. </div>
  173. <div title='<t:mutiLang langKey="page.property"/>' style="overflow: hidden;">
  174. <table id="tab_div_page_title" class="table-list" style="height: 25px;">
  175. </table>
  176. <div class="t_table" id="t_table_page">
  177. <table id="tab_div_page" class="table-list">
  178. </table>
  179. <br><br><br>
  180. </div>
  181. </div>
  182. <div title='<t:mutiLang langKey="validate.dict"/>' style="overflow: hidden;">
  183. <table id="tab_div_check_title" class="table-list" style="height: 25px;">
  184. </table>
  185. <div class="t_table" id="t_table_check">
  186. <table id="tab_div_check" class="table-list">
  187. </table>
  188. <br><br><br>
  189. </div>
  190. </div>
  191. <div title='<t:mutiLang langKey="common.fk"/>' style="overflow: hidden;">
  192. <table id="tab_div_key_title" class="table-list" style="height: 25px;">
  193. </table>
  194. <div class="t_table" id="t_table_key">
  195. <table id="tab_div_key" class="table-list">
  196. </table>
  197. <br><br><br>
  198. </div>
  199. </div>
  200. <!-- add-start author: wangkun date:20160611 for: TASK #1090 【online】online表单缺少索引配置 代码修改痕迹-->
  201. <div title='<t:mutiLang langKey="common.index"/>' style="overflow: hidden;">
  202. <div style="height: 25px;" class="datagrid-toolbar">
  203. <a id="addColumnBtn1" class="easyui-linkbutton" data-options="iconCls:'icon-add'" onclick="addIndexBtnClick();" href="#"><t:mutiLang langKey="common.add.to"/></a>
  204. <a id="delColumnBtn1" class="easyui-linkbutton" data-options="iconCls:'icon-remove'" onclick="delIndexBtnClick();" href="#"><t:mutiLang langKey="common.delete"/></a>
  205. </div>
  206. <table id="tab_div_index_title" class="table-list" style="height: 25px;">
  207. </table>
  208. <div class="t_table" id="t_table_index">
  209. <table id="tab_div_index" class="table-list">
  210. </table>
  211. <br><br><br>
  212. </div>
  213. </div>
  214. <!-- add-end author: wangkun date:20160611 for: TASK #1090 【online】online表单缺少索引配置 代码修改痕迹-->
  215. </div>
  216. </t:formvalid>
  217. <script type="text/javascript">
  218. $(function() {
  219. //显示/隐藏树形表单输入项
  220. isTreeHandle();
  221. $("#isTree").change(function() {
  222. isTreeHandle();
  223. });
  224. getFormTemplateName();
  225. <!--add-start--Author:scott Date:20160301 for:online表单移动样式单独配置-->
  226. getFormTemplateName2();
  227. <!--add-end--Author:scott Date:20160301 for:online表单移动样式单独配置-->
  228. });
  229. //根据是否为树形菜单隐藏或显示tree输入框
  230. function isTreeHandle() {
  231. if($("#isTree").val() == "Y") {
  232. //树形表单设置默认值
  233. if(!$("#treeFieldname").val()) {
  234. $("#treeFieldname").val($(":text[name='columns[1].fieldName']").val());
  235. }
  236. $("tr.tree").find(":input").attr("disabled", false).attr("datatype", "s2-100").end().show();
  237. }else {
  238. $("tr.tree").find(":input").attr("disabled", true).removeAttr("datatype").end().hide();
  239. }
  240. }
  241. <!--add-start--Author:张忠亮 Date:20150714 for:根据表单类型获取风格-->
  242. //获取表单风格模板名称
  243. function getFormTemplateName(){
  244. var type=$("#jformType").val();
  245. $.ajax({
  246. url:"${pageContext.request.contextPath}/cgformTemplateController.do?getTemplate",
  247. type:"post",
  248. data:{type:type},
  249. dataType:"json",
  250. success:function(data){
  251. if(data.success){
  252. $("#formTemplate").empty();
  253. $("#formTemplate").append("<option value='' ><t:mutiLang langKey="common.please.select"/></option>");
  254. $.each(data.obj,function(i,tem){
  255. $("#formTemplate").append("<option value='"+tem.templateCode+"' >"+tem.templateName+"</option>");
  256. });
  257. var temVal=$("#formTemplate").attr("temVal");
  258. if(temVal.length>0){
  259. var len=$("#formTemplate").find("[value='"+temVal+"']").attr("selected","selected");
  260. }
  261. }
  262. }
  263. });
  264. }
  265. <!--add-start--Author:scott Date:20160301 for:online表单移动样式单独配置-->
  266. //获取表单风格模板名称
  267. function getFormTemplateName2(){
  268. var type=$("#jformType").val();
  269. $.ajax({
  270. url:"${pageContext.request.contextPath}/cgformTemplateController.do?getTemplate",
  271. type:"post",
  272. data:{type:type},
  273. dataType:"json",
  274. success:function(data){
  275. if(data.success){
  276. $("#formTemplateMobile").empty();
  277. $("#formTemplateMobile").append("<option value='' ><t:mutiLang langKey="common.please.select"/></option>");
  278. $.each(data.obj,function(i,tem){
  279. $("#formTemplateMobile").append("<option value='"+tem.templateCode+"' >"+tem.templateName+"</option>");
  280. });
  281. var temVal=$("#formTemplateMobile").attr("temVal");
  282. if(temVal.length>0){
  283. var len=$("#formTemplateMobile").find("[value='"+temVal+"']").attr("selected","selected");
  284. }
  285. }
  286. }
  287. });
  288. }
  289. <!--add-end--Author:scott Date:20160301 for:online表单移动样式单独配置-->
  290. //表单类型改变 调用
  291. function formTypeChange(){
  292. jformTypeChange();
  293. getFormTemplateName();
  294. <!--add-start--Author:scott Date:20160301 for:online表单移动样式单独配置-->
  295. getFormTemplateName2();
  296. <!--add-end--Author:scott Date:20160301 for:online表单移动样式单独配置-->
  297. }
  298. <!--add-end--Author:张忠亮 Date:20150714 for:根据表单类型获取风格-->
  299. //add-start--Author:jg_renjie Date:20160413 for:TASK #1019 【平台bug】ONLINE百度编辑器控件样式不好。
  300. function getShowType(obj){
  301. var $this = $(obj),value = obj.value;
  302. if(value == 'umeditor'){
  303. $this.parent().next().eq(0).find("input[name$=fieldLength]").val('500');
  304. } else {
  305. $this.parent().next().eq(0).find("input[name$=fieldLength]").val('120');
  306. }
  307. }
  308. //add-end--Author:jg_renjie Date:20160301 for:TASK #1019 【平台bug】ONLINE百度编辑器控件样式不好。
  309. function selectField(select){
  310. var selected = select.val().split(",");
  311. var fieldArray = new Array();
  312. $("#tab_div_database tr").each(function(){
  313. fieldArray.push($(this).find("td:eq(3)>input").val());
  314. })
  315. var content = "<table id='field'>";
  316. for(var i=0;i<fieldArray.length;i++){
  317. if(selected.indexOf(fieldArray[i])!=-1){
  318. content += "<tr><td align='left'><input style='width: 30px' type='checkbox' name='ck' checked='checked'/></td>";
  319. }else{
  320. content += "<tr><td align='left'><input style='width: 30px' type='checkbox' name='ck'/></td>";
  321. }
  322. content += "<td>"+fieldArray[i]+"</td></tr>";
  323. }
  324. content += "</table>";
  325. $.dialog({
  326. content: content,
  327. zIndex: 2200,
  328. title: '字段',
  329. lock: false,
  330. width: 250,
  331. height: 250,
  332. opacity: 0.4,
  333. button: [
  334. {
  335. name: '<t:mutiLang langKey="common.confirm"/>',
  336. callback: function(){
  337. var s = "";
  338. parent.$("input[name='ck']").each(function(){
  339. if($(this).attr("checked")){
  340. s += $(this).parent().next("td").text()+",";
  341. }
  342. });
  343. /* if(nodes.length>0){
  344. var ids='',names='';
  345. for(i=0;i<nodes.length;i++){
  346. var node = nodes[i];
  347. ids += node.id+',';
  348. names += node.name+',';
  349. }
  350. $("#" + selectedNamesInputId_depart).val(names);
  351. $("#" + selectedNamesInputId_depart).blur();
  352. $("#" + selectedIdsInputId_depart).val(ids);
  353. } */
  354. select.val(s.substring(0,s.length-1));
  355. },
  356. focus: true
  357. },
  358. {
  359. name: '<t:mutiLang langKey="common.cancel"/>',
  360. callback: function () {
  361. }
  362. }
  363. ]});
  364. }
  365. </script>
  366. <iframe id="iframe_check" name="iframe_check" src="plug-in/cgform/fields/cgformOfCheck.html" style="display: none"></iframe>
  367. <iframe id="iframe_database" src="plug-in/cgform/fields/cgformOfDatabase.html" style="display: none"></iframe>
  368. <iframe id="iframe_key" src="plug-in/cgform/fields/cgformOfForeignKey.html" style="display: none"></iframe>
  369. <iframe id="iframe_page" src="plug-in/cgform/fields/cgformOfPage.html" style="display: none"></iframe>
  370. <!-- add-start author: wangkun date:20160611 for: TASK #1090 【online】online表单缺少索引配置 代码修改痕迹-->
  371. <iframe id="iframe_index" src="plug-in/cgform/fields/cgformOfIndex.html" style="display: none"></iframe>
  372. <!-- add-end author: wangkun date:20160611 for: TASK #1090 【online】online表单缺少索引配置 代码修改痕迹-->
  373. </body>