NewViewOld.jsp 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. <%@ include file="/include/head.jsp"%>
  2. <%@ page contentType="text/html;charset=GBK"%>
  3. <%
  4. String[][] roles = (String[][])request.getAttribute("roles");
  5. String selectFlag="选择";
  6. %>
  7. <html>
  8. <head>
  9. <title>视图编辑</title>
  10. <LINK REL="stylesheet" TYPE="text/css" HREF="/css/main.css" TITLE="SID OA">
  11. <SCRIPT LANGUAGE="JavaScript">
  12. var count=0;
  13. //**增加表操作**//
  14. function drawTable(){
  15. count+=1;
  16. theForm.Count.value=String(count);
  17. // 插入两行。
  18. var oRow1=oTable.insertRow(oTable.rows.length);
  19. // 获取表格的行集合。
  20. var aRows=oTable.rows;
  21. // 获取第一行的单元格集合。
  22. var aCells=oRow1.cells;
  23. //window.alert("");
  24. // 在第一行中插入两个单元格。
  25. var oCell1_1=aRows(oRow1.rowIndex).insertCell(aCells.length);
  26. var oCell1_2=aRows(oRow1.rowIndex).insertCell(aCells.length);
  27. var oCell1_3=aRows(oRow1.rowIndex).insertCell(aCells.length);
  28. var oCell1_4=aRows(oRow1.rowIndex).insertCell(aCells.length);
  29. // 为 2 个新单元格添加规范的 HTML 值。
  30. oCell1_1.innerHTML="操作"+String(count);
  31. oCell1_2.innerHTML="<input name="+"Title"+String(count)+" class=\"caption\" value=\"\">";
  32. oCell1_3.innerHTML="<input name="+"Action"+String(count)+" value=\"\" size=\"60\">"; var del;
  33. del="<input type=\"button\" id ="+"row"+String(count) +" value=\"删除此行\" onclick=\"delRow("+String(count)+")\">";
  34. oCell1_4.innerHTML=del;
  35. }
  36. //**删除操作**//
  37. function delRow(num){
  38. alert(num);
  39. oTable.deleteRow(document.getElementById("row"+String(num)).rowindex);
  40. //oTable.deleteRow(num+1);
  41. count=count-1;
  42. theForm.Count.value=String(count);
  43. }
  44. function submitForm(){
  45. //var re=window.confirm("您要将提交当前的页面吗?");
  46. //if (re==false) { return("");}
  47. //window.alert(theForm.test.value+"-------")
  48. if (theForm.Name.value=="") {window.alert("视图名不能为空");return("");}
  49. if (theForm.TableName.value=="") {window.alert("实体名不能为空");return("");}
  50. if (theForm.AddApp.value=="") {window.alert("增加操作不能为空");return("");}
  51. if (theForm.DelApp.value=="") {window.alert("删除操作不能为空");return("");}
  52. if (theForm.EditApp.value=="") {window.alert("编辑操作不能为空");return("");}
  53. var s1=theForm.AddRole.options(theForm.AddRole.options.selectedIndex).text;
  54. if (s1=="<%=selectFlag%>") {window.alert("增加角色不能为空");return("");}
  55. var s1=theForm.DelRole.options(theForm.DelRole.options.selectedIndex).text;
  56. if (s1=="<%=selectFlag%>") {window.alert("删除角色不能为空");return("");}
  57. var s1=theForm.EditRole.options(theForm.EditRole.options.selectedIndex).text;
  58. if (s1=="<%=selectFlag%>") {window.alert("编辑角色不能为空");return("");}
  59. if (theForm.ShowName.value=="") {window.alert("显示名不能为空");return("");}
  60. <% request.setAttribute("message","No permission to create forums"); %>
  61. theForm.submit();
  62. }
  63. </SCRIPT>
  64. </head>
  65. <body>
  66. <form name="theForm" method="POST" action="/servlet/com.content.control.SubmitView?new=0">
  67. <%@ include file="/include/top.jsp"%>
  68. <table border="0" cellspacing="1" cellpadding="0" width="100%">
  69. <tr>
  70. <td class="caption">视图名</td>
  71. <td class="detail"><input type="text" name="Name" size="80"></td>
  72. </tr>
  73. <tr>
  74. <td class="caption">实体名</td>
  75. <td class="detail"><input type="text" name="TableName" size="80"></td>
  76. </tr>
  77. <tr>
  78. <td class="caption">增加操作</td>
  79. <td class="detail"><input type="text" name="AddApp" size="80"></td>
  80. </tr>
  81. <tr>
  82. <td class="caption">删除操作</td>
  83. <td class="detail"><input type="text" name="DelApp" size="80"></td>
  84. </tr>
  85. <tr>
  86. <td class="caption">编辑操作</td>
  87. <td class="detail"><input type="text" name="EditApp" size="80"></td>
  88. </tr>
  89. <tr>
  90. <td class="caption">浏览操作</td>
  91. <td class="detail"><input type="text" name="SeeApp" size="80"></td>
  92. </tr>
  93. <tr>
  94. <td class="caption">增加角色</td>
  95. <td class="detail"><select name="AddRole" >
  96. <option selected><%=selectFlag%></option>
  97. <%
  98. if (roles!= null){
  99. for(int i=0;i<roles.length;i++) {
  100. %>
  101. <option><%=roles[i][0]%></option>
  102. <%
  103. }
  104. }
  105. %>
  106. </select>
  107. </td>
  108. </tr>
  109. <tr>
  110. <td class="caption">删除角色</td>
  111. <td class="detail">
  112. <select name="DelRole" >
  113. <option selected><%=selectFlag%></option>
  114. <%
  115. if (roles!= null){
  116. for(int i=0;i<roles.length;i++) {
  117. %>
  118. <option><%=roles[i][0]%></option>
  119. <%
  120. }
  121. }
  122. %>
  123. </select>
  124. </td>
  125. </tr>
  126. <tr>
  127. <td class="caption">编辑角色</td>
  128. <td class="detail">
  129. <select name="EditRole" >
  130. <option selected><%=selectFlag%></option>
  131. <%
  132. if (roles!= null){
  133. for(int i=0;i<roles.length;i++) {
  134. %>
  135. <option><%=roles[i][0]%></option>
  136. <%
  137. }
  138. }
  139. %>
  140. </select>
  141. </td>
  142. </tr>
  143. <tr>
  144. <td class="caption">浏览角色</td>
  145. <td class="detail">
  146. <select name="SeeRole" >
  147. <option selected><%=selectFlag%></option>
  148. <%
  149. if (roles!= null){
  150. for(int i=0;i<roles.length;i++) {
  151. %>
  152. <option><%=roles[i][0]%></option>
  153. <%
  154. }
  155. }
  156. %>
  157. </select>
  158. </td>
  159. </tr>
  160. <tr>
  161. <td class="caption">显示</td>
  162. <td class="detail"><input type="text" name="ShowName" size="80"></td>
  163. </tr>
  164. <tr>
  165. <td class="caption">条件</td>
  166. <td class="detail"><input type="text" name="AppWhereSql" size="80"></td>
  167. </tr>
  168. <tr>
  169. <td class="caption">视图类型</td>
  170. <td class="detail">
  171. <select name="Type" >
  172. <option selected>B</option>
  173. <option>A</option>
  174. <option>B</option>
  175. </select>
  176. A私有,B共享</td>
  177. </tr>
  178. <tr>
  179. <td class="caption">分类</td>
  180. <td class="detail"><input type="text" name="Catogory" size="80"></td>
  181. </tr>
  182. <tr>
  183. <td class="caption">排序</td>
  184. <td class="detail"><input type="text" name="SortItem" size="80"></td>
  185. </tr>
  186. </table>
  187. <input class="small" type="button" value="提交" name="B1" onclick="submitForm()">
  188. <input class="small" type="button" value="返回" name="B2" onclick="history.back()">
  189. <input class="small" type="button" value="增加" name="B3" onclick="drawTable()">
  190. <input class="small" type="button" value="删除" name="B4" onclick="DelTable()">
  191. 操作数目
  192. <input class="small" type="input" value="" name="Count" >
  193. <!--
  194. <table border="1" width="100%" bgcolor="#C0C0C0">
  195. <tr>
  196. <td width="10%">序号</td><td width="20%">操作名</td><td width="60%">操作名</td><td width="10%">操作名</td>
  197. <tr>
  198. </table> -->
  199. <p>
  200. <table border="0" cellspacing="1" cellpadding="0" width="100%" bgcolor="#C0C0C0" id=oTable>
  201. <tr>
  202. <td width="10%">序号</td><td width="20%">操作名</td><td width="60%">操作名</td><td width="10%">操作名</td>
  203. <tr>
  204. </table>
  205. </form>
  206. </body>
  207. </html>