edit.jsp 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  1. <%@ page pageEncoding="UTF-8"%>
  2. <%@ page contentType="text/html; charset=UTF-8" language="java" %>
  3. <%@ page import ="java.util.*"%>
  4. <%@ page language="java"
  5. import="com.sysmodel.datamodel.xmlmodel.ModelFactory,
  6. com.sysmodel.datamodel.xmlmodel.impl.MdpConstantImpl,
  7. com.sysmodel.datamodel.xmlmodel.able.SysModel,
  8. com.sysmodel.datamodel.xmlmodel.impl.MdpDataSourceImpl,
  9. com.sysmodel.datamodel.xmlmodel.able.Template,
  10. com.sysmodel.datamodel.xmlmodel.impl.TemplateImpl,
  11. com.sysmodel.datamodel.xmlmodel.impl.MdpModuleImpl"%>
  12. <%
  13. String name = request.getParameter("name") == null ? "" : request.getParameter("name");
  14. String description="",
  15. TemplateName="",
  16. RootFrom="",
  17. DataSource="",
  18. isKeyCodeAuto="",
  19. type = "",
  20. OrderProperty="",OrderMethod="";
  21. MdpConstantImpl MdpConstantImpl = null;
  22. SysModel sysmodel = ModelFactory.getSysmodel();
  23. String action = "";
  24. if(name.equals("")){
  25. action = "save";
  26. type = request.getParameter("type") == null ? "" : request.getParameter("type");
  27. }else{
  28. MdpConstantImpl = (MdpConstantImpl)sysmodel.getMdpConstantByName(name);
  29. action = "edit";
  30. description=MdpConstantImpl.getDescription();
  31. TemplateName=MdpConstantImpl.getTemplateName();
  32. RootFrom=MdpConstantImpl.getRootFrom();
  33. DataSource=""+MdpConstantImpl.getDataSource();
  34. isKeyCodeAuto= String.valueOf(MdpConstantImpl.isKeyCodeAuto());
  35. OrderProperty=MdpConstantImpl.getOrderProperty();
  36. OrderMethod=MdpConstantImpl.getOrderMethod();
  37. type = MdpConstantImpl.getType();
  38. }
  39. %>
  40. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  41. <HTML>
  42. <HEAD>
  43. <TITLE></TITLE>
  44. <META http-equiv="Content-Type" content="text/html; charset=GB2312">
  45. <link rel="stylesheet" href="../../../../styles/css.css" type="text/css">
  46. <script type="text/javascript" src="../../../../scripts/dojo/dojo/dojo.js" djConfig="isDebug: false, parseOnLoad: true"></script>
  47. <script type="text/javascript">
  48. dojo.require("dijit.form.Form");
  49. dojo.require("dijit.form.ValidationTextBox");
  50. dojo.require("dijit.form.FilteringSelect");
  51. dojo.require("dijit.form.NumberSpinner");
  52. dojo.require("dijit.form.Button");
  53. dojo.require("dijit.Tooltip");
  54. </script>
  55. <style type="text/css">
  56. @import "../../../../scripts/dojo/dojo/resources/dojo.css";
  57. @import "../../../../scripts/dojo/dijit/themes/tundra/tundra.css";
  58. @import "../../../../scripts/dojo/dijit/themes/tundra/tundra_rtl.css";
  59. @import "../../../../scripts/dojo/dijit/tests/css/dijitTests.css";
  60. .formQuestion {
  61. background-color:#d0e3f5;
  62. padding:0.3em;
  63. font-weight:900;
  64. font-family:Verdana, Arial, sans-serif;
  65. font-size:0.8em;
  66. color:#5a5a5a;
  67. }
  68. .formAnswer {
  69. background-color:#f5eede;
  70. padding:0.3em;
  71. margin-bottom:1em;
  72. width: 100%;
  73. }
  74. .pageSubContentTitle {
  75. color:#8e8e8e;
  76. font-size:1em;
  77. font-family:Verdana, Arial, sans-serif;
  78. margin-bottom:0.75em;
  79. }
  80. .small INPUT {
  81. width: 2.5em;
  82. }
  83. .medium INPUT {
  84. width: 10em;
  85. }
  86. .long INPUT {
  87. width: 20em;
  88. }
  89. .firstLabel {
  90. display: inline-block;
  91. display: -moz-inline-box;
  92. width: 10em;
  93. min-width: 10em;
  94. }
  95. .secondLabel {
  96. width: auto;
  97. margin-left: 5em;
  98. margin-right: 1em;
  99. }
  100. fieldset label {
  101. margin-right: 1em;
  102. }
  103. .noticeMessage {
  104. display: block;
  105. float: right;
  106. font-weight: normal;
  107. font-family:Arial, Verdana, sans-serif;
  108. color:#663;
  109. font-size:0.9em;
  110. }
  111. </style>
  112. <script type="text/javascript">
  113. <%
  114. String refreshNode = request.getParameter("refreshNode") == null ? "" : request.getParameter("refreshNode");
  115. if(!refreshNode.equals("")){%>
  116. var loadTip = "<div>数据装载中,请稍候...</div>";
  117. var treeImagePath = "<%=request.getContextPath()%>/images/tree_images/";
  118. var url = "<%=request.getContextPath()%>/admin/menu/divTreeService.jsp?nodeID=mdpConstant.<%=type%>";
  119. var treeCloseImg = "plus.gif";
  120. var treeOpenImg = "minus.gif";
  121. parent.frames["confTreeFrame"].refreshNode('mdpConstant.<%=type%>');
  122. <%}%>
  123. </script>
  124. </HEAD>
  125. <body class="tundra">
  126. <form action="editExc.jsp" method="post">
  127. <input type="hidden" name="action" value="<%=action%>">
  128. <div id=total>
  129. <div class="whiteborder">
  130. <div class="titback">
  131. <div class="floatleft"><img src="../../../../images/index/arrow1.gif" width="20" height="24"/></div>
  132. <div class="dropshadow">常量配置</div>
  133. <div class="clear"></div>
  134. </div>
  135. <div class="report">
  136. <table align="center" id="SortTable512_1" width="100%" cellpadding="1" cellspacing="1" class="ltab2">
  137. <tr>
  138. <td width="50%">常量编号 <span class="redcolor">*</span></td>
  139. <td align="left">
  140. <input type="text" id="name" name="name" class="medium"
  141. dojoType="dijit.form.ValidationTextBox"
  142. required="true"
  143. regExp="^[A-Za-z0-9$_]+$"
  144. value="<%=name %>"
  145. invalidMessage="格式错误,常量编号必填项!" <%if(action.equals("edit")){ %> readonly<%} %>/></td>
  146. </tr>
  147. <tr>
  148. <td>描述 <span class="redcolor">*</span></td>
  149. <td align="left"><input type="text" id="description" name="description" class="medium"
  150. dojoType="dijit.form.ValidationTextBox"
  151. required="true"
  152. ucfirst="true"
  153. value="<%=description %>"
  154. invalidMessage="描述信息必须录入!"/></td>
  155. </tr>
  156. <tr>
  157. <td>引用模板 <span class="redcolor">*</span></td>
  158. <td align="left">
  159. <select dojoType="dijit.form.FilteringSelect"
  160. required="true" name="TemplateName" id="TemplateName" autocomplete="true">
  161. <option value="0"></option>
  162. <%
  163. ArrayList listTemplate = sysmodel.getTemplates();
  164. Template Template = new TemplateImpl();
  165. for(int i = 0 ; i < listTemplate.size(); i ++){
  166. Template = (Template)listTemplate.get(i);
  167. String id =String.valueOf(Template.getName());
  168. %>
  169. <option value="<%=id%>" <%if(TemplateName.equals(id)) out.print("selected"); %> ><%=Template.getDescription()%></option>
  170. <%
  171. }
  172. %>
  173. </select>
  174. </td>
  175. </tr>
  176. <tr>
  177. <td>树型常量根</td>
  178. <td align="left">
  179. <input type="text" id="RootFrom" name="RootFrom" class="medium"
  180. dojoType="dijit.form.ValidationTextBox"
  181. value="<%=RootFrom %>"/>
  182. </tr>
  183. <tr>
  184. <td>数据源 <span class="redcolor">*</span></td>
  185. <td align="left">
  186. <select dojoType="dijit.form.FilteringSelect"
  187. required="true" name="DataSource" id="DataSource" autocomplete="true">
  188. <option></option>
  189. <%
  190. ArrayList listsource = sysmodel.getMdpDataSources();
  191. MdpDataSourceImpl MdpDataSource = new MdpDataSourceImpl();
  192. for(int i = 0 ; i < listsource.size(); i ++){
  193. MdpDataSource = (MdpDataSourceImpl)listsource.get(i);
  194. String id =String.valueOf(MdpDataSource.getDataSourceid());
  195. %>
  196. <option value="<%=id %>" <%if(DataSource.equals(id)) out.print("selected"); %> ><%=MdpDataSource.getURL()%></option>
  197. <%
  198. }
  199. %>
  200. </select>
  201. </td>
  202. </tr>
  203. <tr>
  204. <td>编码生成机制</td>
  205. <td align="left">
  206. <input type="text" id="isKeyCodeAuto" name="isKeyCodeAuto" class="medium"
  207. dojoType="dijit.form.ValidationTextBox"
  208. value="<%=isKeyCodeAuto %>"/>
  209. </td>
  210. </tr>
  211. <tr>
  212. <td>排序字段</td>
  213. <td align="left">
  214. <input type="text" id="OrderProperty" name="OrderProperty" class="medium"
  215. dojoType="dijit.form.ValidationTextBox"
  216. value="<%=OrderProperty %>"/>
  217. </tr>
  218. <tr>
  219. <td>排序方式</td>
  220. <td align="left">
  221. <input type="text" id="OrderMethod" name="OrderMethod" class="medium"
  222. dojoType="dijit.form.ValidationTextBox"
  223. value="<%=OrderMethod %>"/>
  224. </td>
  225. </tr>
  226. <tr>
  227. <td>所属模块 <span class="redcolor">*</span></td>
  228. <td align="left">
  229. <select name="type" dojoType="dijit.form.FilteringSelect"
  230. required="true" id="type" autocomplete="true">
  231. <%
  232. ArrayList mod = sysmodel.getMdpModules();
  233. MdpModuleImpl MdpModule = new MdpModuleImpl();
  234. for(int i = 0 ; i < mod.size(); i ++){
  235. MdpModule = (MdpModuleImpl)mod.get(i);
  236. String id =String.valueOf(MdpModule.getCode());
  237. %>
  238. <option value="<%=id %>" <%if(id.equals(type)) out.print("selected"); %> ><%=MdpModule.getName() %></option>
  239. <%
  240. }
  241. %>
  242. </select>
  243. </td>
  244. </tr>
  245. </table>
  246. </div>
  247. <div class="btmbox">
  248. <button id="save" dojoType="dijit.form.Button" onClick='console.log("clicked simple")' type="submit" iconClass="plusIcon">
  249. 保存
  250. </button>
  251. <span dojoType="dijit.Tooltip" connectId="save">保存按钮</span>&nbsp;&nbsp;
  252. </div></div>
  253. </div>
  254. </form>
  255. </BODY>
  256. </HTML>