9a37a6f0737f8e881f1d4e965ac7a0b528f46590.svn-base 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329
  1. <%@ page pageEncoding="UTF-8"%>
  2. <%@ page contentType="text/html; charset=UTF-8" language="java" %>
  3. <%@ page language="java"
  4. import="com.sysmodel.datamodel.xmlmodel.ModelFactory,
  5. com.sysmodel.datamodel.xmlmodel.impl.TemplateImpl,
  6. com.sysmodel.datamodel.xmlmodel.impl.PropertyImpl,
  7. com.sysmodel.datamodel.xmlmodel.able.SysModel,
  8. com.sysmodel.xformmodel.impl.RegExpImpl,
  9. com.sysmodel.XFormModelImpl,
  10. com.sysmodel.xformmodel.able.Validate,
  11. com.sysmodel.xformmodel.impl.DojoInputTypeImpl,
  12. java.util.ArrayList"%>
  13. <%
  14. String propertyName = request.getParameter("propertyName") == null ? "0" : request.getParameter("propertyName");
  15. String templateName = request.getParameter("templateName") == null ? "0" : request.getParameter("templateName");
  16. String name="";
  17. String description="";
  18. String dataType="";
  19. String length="";
  20. String scale="";
  21. String referenceParentName="";
  22. String display="";
  23. String unique="";
  24. String promptMessage="";
  25. String invalidMessage="";
  26. String need="";
  27. String trime="";
  28. String regxValue = "";
  29. String dojoInuptType = "";
  30. SysModel sysmodel = ModelFactory.getSysmodel();
  31. TemplateImpl TemplateImpl = (TemplateImpl)sysmodel.getTemplateByName(templateName);
  32. String action = "";
  33. if(propertyName.equals("0")){
  34. action = "save";
  35. }else{
  36. action = "edit";
  37. PropertyImpl PropertyImpl = (PropertyImpl)TemplateImpl.getPropertyByName(propertyName);
  38. Validate Validate = PropertyImpl.getValidate();
  39. need = new Boolean(Validate.isNeed()).toString();
  40. trime = new Boolean(Validate.isTrim()).toString();
  41. invalidMessage = Validate.getInvalidMessage();
  42. promptMessage = Validate.getPromptMessage();
  43. regxValue = Validate.getRegxValue();
  44. dojoInuptType = Validate.getDojoType();
  45. name = PropertyImpl.getName();
  46. description = PropertyImpl.getDescription();
  47. dataType = PropertyImpl.getDataType();
  48. length = "" + PropertyImpl.getLength();
  49. scale = PropertyImpl.getScale();
  50. referenceParentName = PropertyImpl.getReferenceParentName();
  51. display = new Boolean(PropertyImpl.isDisplay()).toString();
  52. unique = new Boolean(PropertyImpl.isUnique()).toString();
  53. }
  54. %>
  55. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  56. <HTML>
  57. <HEAD>
  58. <TITLE></TITLE>
  59. <META http-equiv="Content-Type" content="text/html; charset=GB2312">
  60. <link rel="stylesheet" href="../../../../../../styles/css.css" type="text/css">
  61. <script type="text/javascript" src="../../../../../../scripts/dojo/dojo/dojo.js" djConfig="isDebug: false, parseOnLoad: true"></script>
  62. <script type="text/javascript">
  63. dojo.require("dijit.form.Form");
  64. dojo.require("dijit.form.ValidationTextBox");
  65. dojo.require("dijit.form.FilteringSelect");
  66. dojo.require("dijit.form.Button");
  67. dojo.require("dijit.Tooltip");
  68. </script>
  69. <style type="text/css">
  70. @import "../../../../../../scripts/dojo/dojo/resources/dojo.css";
  71. @import "../../../../../../scripts/dojo/dijit/themes/tundra/tundra.css";
  72. @import "../../../../../../scripts/dojo/dijit/themes/tundra/tundra_rtl.css";
  73. @import "../../../../../../scripts/dojo/dijit/tests/css/dijitTests.css";
  74. .formQuestion {
  75. background-color:#d0e3f5;
  76. padding:0.3em;
  77. font-weight:900;
  78. font-family:Verdana, Arial, sans-serif;
  79. font-size:0.8em;
  80. color:#5a5a5a;
  81. }
  82. .formAnswer {
  83. background-color:#f5eede;
  84. padding:0.3em;
  85. margin-bottom:1em;
  86. width: 100%;
  87. }
  88. .pageSubContentTitle {
  89. color:#8e8e8e;
  90. font-size:1em;
  91. font-family:Verdana, Arial, sans-serif;
  92. margin-bottom:0.75em;
  93. }
  94. .small INPUT {
  95. width: 2.5em;
  96. }
  97. .medium INPUT {
  98. width: 10em;
  99. }
  100. .long INPUT {
  101. width: 20em;
  102. }
  103. .firstLabel {
  104. display: inline-block;
  105. display: -moz-inline-box;
  106. width: 10em;
  107. min-width: 10em;
  108. }
  109. .secondLabel {
  110. width: auto;
  111. margin-left: 5em;
  112. margin-right: 1em;
  113. }
  114. fieldset label {
  115. margin-right: 1em;
  116. }
  117. .noticeMessage {
  118. display: block;
  119. float: right;
  120. font-weight: normal;
  121. font-family:Arial, Verdana, sans-serif;
  122. color:#663;
  123. font-size:0.9em;
  124. }
  125. </style>
  126. </HEAD>
  127. <body class="tundra">
  128. <form action="editExc.jsp" method="post">
  129. <input type="hidden" name="action" value="<%=action%>">
  130. <input type="hidden" name="templateName" value="<%=templateName%>">
  131. <input type="hidden" name="oldname" value="<%=name%>">
  132. <div id=total>
  133. <div class="whiteborder">
  134. <div class="titback">
  135. <div class="floatleft"><img src="../../../../../../images/index/arrow1.gif" width="20" height="24"/></div>
  136. <div class="dropshadow">常量模版</div>
  137. <div class="clear"></div>
  138. </div>
  139. <div class="report">
  140. <table align="center" id="SortTable512_1" width="100%" cellpadding="1" cellspacing="1" class="ltab2">
  141. <tr>
  142. <td align="right">英文名称&nbsp; <span class="redcolor">*</span>&nbsp;&nbsp;</td>
  143. <td align="left">
  144. <input type="text" id="name" name="name" class="medium"
  145. dojoType="dijit.form.ValidationTextBox"
  146. required="true"
  147. regExp="^[A-Za-z0-9$_]+$"
  148. value="<%=name %>"
  149. <%if(action.equals("edit")){ %> readonly<%} %>/>
  150. </td>
  151. </tr>
  152. <tr>
  153. <td align="right">中文描述&nbsp; <span class="redcolor">*</span>&nbsp;&nbsp;</td>
  154. <td align="left">
  155. <input type="text" id="description" name="description" class="medium"
  156. dojoType="dijit.form.ValidationTextBox"
  157. required="true"
  158. ucfirst="true"
  159. value="<%=description %>"
  160. invalidMessage="中文描述必须录入!"/>
  161. </td>
  162. </tr>
  163. <tr>
  164. <td align="right">字段类型&nbsp; <span class="redcolor">*</span>&nbsp;&nbsp;</td>
  165. <td align="left">
  166. <select dojoType="dijit.form.FilteringSelect"
  167. required="true" name="dataType" id="dataType" autocomplete="true">
  168. <option value="string" <%if(dataType.equals("string")) out.print("selected");%>>字符</option>
  169. <option value="number" <%if(dataType.equals("number")) out.print("selected");%>>整数 </option>
  170. <option value="boolean" <%if(dataType.equals("boolean")) out.print("selected");%>>逻辑</option>
  171. <option value="date" <%if(dataType.equals("date")) out.print("selected");%>>日期</option>
  172. </select>
  173. </td>
  174. </tr>
  175. <tr>
  176. <td align="right">字段长度&nbsp; <span class="redcolor">*</span>&nbsp;&nbsp;</td>
  177. <td align="left">
  178. <input type="text" id="lengths" name="lengths" class="medium"
  179. dojoType="dijit.form.ValidationTextBox"
  180. required="true"
  181. value="<%=length %>"
  182. invalidMessage="字段长度必须录入!"/>
  183. </td>
  184. </tr>
  185. <tr>
  186. <td align="right">格式化类型&nbsp;&nbsp;&nbsp;</td>
  187. <td align="left">
  188. <input type="text" id="scale" name="scale" class="medium"
  189. dojoType="dijit.form.ValidationTextBox"
  190. value="<%=scale %>"/>
  191. </tr>
  192. <tr>
  193. <td align="right">上级节点&nbsp;&nbsp;&nbsp;</td>
  194. <td align="left">
  195. <input type="text" id="referenceParentName" name="referenceParentName" class="medium"
  196. dojoType="dijit.form.ValidationTextBox"
  197. value="<%=referenceParentName %>"/>
  198. </tr>
  199. <tr>
  200. <td align="right">是否显示&nbsp; <span class="redcolor">*</span>&nbsp;&nbsp;</td>
  201. <td align="left">
  202. <select dojoType="dijit.form.FilteringSelect"
  203. required="true"
  204. name="display"
  205. id="display"
  206. autocomplete="true" >
  207. <option value="true" <%if(display.equals("true")) out.print("selected");%>>true</option>
  208. <option value="false" <%if(display.equals("false")) out.print("selected");%>>false </option>
  209. </select>
  210. </td>
  211. </tr>
  212. <tr>
  213. <td align="right">是否重复&nbsp; <span class="redcolor">*</span>&nbsp;&nbsp;</td>
  214. <td align="left">
  215. <select dojoType="dijit.form.FilteringSelect"
  216. required="true" name="unique" id="unique" autocomplete="true">
  217. <option value="true" <%if(unique.equals("true")) out.print("selected");%>>true</option>
  218. <option value="false" <%if(unique.equals("false")) out.print("selected");%>>false</option>
  219. </select>
  220. </td>
  221. </tr>
  222. </table>
  223. <table align="center" width="100%" cellpadding="1" cellspacing="1" class="ltab2">
  224. <tr class="TableBgColorBlack">
  225. <td colspan="4" align="left">录入验证</td>
  226. </tr>
  227. <tr class="">
  228. <td>录入提示</td>
  229. <td align="left">
  230. <input type="text" value="<%=promptMessage %>"
  231. id="promptMessage" name="promptMessage" class="medium"
  232. dojoType="dijit.form.ValidationTextBox"
  233. required="false"
  234. ucfirst="true"
  235. invalidMessage="">
  236. </td>
  237. </tr><tr class="">
  238. <td>验证失败提示</td>
  239. <td align="left"><input type="text" value="<%=invalidMessage %>"
  240. id="invalidMessage" name="invalidMessage" class="medium"
  241. dojoType="dijit.form.ValidationTextBox"
  242. required="false"
  243. ucfirst="true"
  244. invalidMessage=""></td>
  245. </tr>
  246. <tr class="">
  247. <td>是否必填&nbsp;<font color="red">*</font></td>
  248. <td align="left" >
  249. <select id="need" name="need"
  250. dojoType="dijit.form.FilteringSelect"
  251. required="true"
  252. autocomplete="true">
  253. <option value="true" <%if(need.equals("true"))out.print("selected"); %>>true</option>
  254. <option value="false"<%if(need.equals("false"))out.print("selected"); %>>false</option>
  255. </select>
  256. </td>
  257. </tr>
  258. <tr class="">
  259. <td>是否去掉空格</td>
  260. <td align="left" >
  261. <select id="trime" name="trime"
  262. dojoType="dijit.form.FilteringSelect"
  263. required="true"
  264. autocomplete="true">
  265. <option value="true" <%if(trime.equals("false"))out.print("selected"); %>>true</option>
  266. <option value="false" <%if(trime.equals("false"))out.print("selected"); %>>false</option>
  267. </select>
  268. </td>
  269. </tr>
  270. <tr class="">
  271. <td>dojo]控件类型</td>
  272. <td align="left">
  273. <select id="dojoInuptType" name="dojoInuptType"
  274. dojoType="dijit.form.FilteringSelect"
  275. required="true"
  276. autocomplete="true">
  277. <option value="0">--请选择--</option>
  278. <% ArrayList dojoInuptTypes = XFormModelImpl.getInstance().getDojoInuptTypesByType("text");
  279. for(int m = 0; m<dojoInuptTypes.size(); m++){
  280. DojoInputTypeImpl DojoInputTypeImpl=(DojoInputTypeImpl)dojoInuptTypes.get(m);
  281. %>
  282. <option value="<%=DojoInputTypeImpl.getCode() %>" <%if(DojoInputTypeImpl.getCode().equals(dojoInuptType))out.print("selected");%>><%=DojoInputTypeImpl.getName() %></option>
  283. <%} %>
  284. </select>
  285. </td>
  286. </tr>
  287. <tr class="">
  288. <td>正则表达式</td>
  289. <td align="left"><select id="regxValue" name="regxValue"
  290. dojoType="dijit.form.FilteringSelect"
  291. required="true"
  292. autocomplete="true">
  293. <option value="0">--请选择--</option>
  294. <% ArrayList regExps=XFormModelImpl.getInstance().getRegExps();
  295. for(int j = 0; j<regExps.size(); j++){
  296. RegExpImpl RegExpImpl=(RegExpImpl)regExps.get(j);
  297. %>
  298. <option value="<%=RegExpImpl.getCode()%>" <%if(RegExpImpl.getCode().equals(regxValue))out.print("selected");%>><%=RegExpImpl.getName() %></option>
  299. <%} %>
  300. </select></td>
  301. </tr>
  302. </table>
  303. </div>
  304. <div class="btmbox">
  305. <button id="save" dojoType="dijit.form.Button" onClick='console.log("clicked simple")' type="submit" iconClass="plusIcon">
  306. 保存
  307. </button>
  308. <span dojoType="dijit.Tooltip" connectId="save">保存按钮</span>&nbsp;&nbsp;
  309. </div>
  310. </div>
  311. </div>
  312. </form>
  313. </BODY>
  314. </HTML>