| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224 |
- <%@ include file="/include/head.jsp"%>
- <%@ page contentType="text/html;charset=GBK"%>
- <%
- String[][] roles = (String[][])request.getAttribute("roles");
- String selectFlag="选择";
- %>
- <html>
- <head>
- <title>视图编辑</title>
- <LINK REL="stylesheet" TYPE="text/css" HREF="/css/main.css" TITLE="SID OA">
- <SCRIPT LANGUAGE="JavaScript">
- var count=0;
- //**增加表操作**//
- function drawTable(){
- count+=1;
- theForm.Count.value=String(count);
- // 插入两行。
- var oRow1=oTable.insertRow(oTable.rows.length);
- // 获取表格的行集合。
- var aRows=oTable.rows;
- // 获取第一行的单元格集合。
- var aCells=oRow1.cells;
- //window.alert("");
- // 在第一行中插入两个单元格。
- var oCell1_1=aRows(oRow1.rowIndex).insertCell(aCells.length);
- var oCell1_2=aRows(oRow1.rowIndex).insertCell(aCells.length);
- var oCell1_3=aRows(oRow1.rowIndex).insertCell(aCells.length);
- var oCell1_4=aRows(oRow1.rowIndex).insertCell(aCells.length);
- // 为 2 个新单元格添加规范的 HTML 值。
- oCell1_1.innerHTML="操作"+String(count);
- oCell1_2.innerHTML="<input name="+"Title"+String(count)+" class=\"caption\" value=\"\">";
- oCell1_3.innerHTML="<input name="+"Action"+String(count)+" value=\"\" size=\"60\">"; var del;
- del="<input type=\"button\" id ="+"row"+String(count) +" value=\"删除此行\" onclick=\"delRow("+String(count)+")\">";
- oCell1_4.innerHTML=del;
- }
- //**删除操作**//
- function delRow(num){
- alert(num);
- oTable.deleteRow(document.getElementById("row"+String(num)).rowindex);
- //oTable.deleteRow(num+1);
- count=count-1;
- theForm.Count.value=String(count);
- }
- function submitForm(){
- //var re=window.confirm("您要将提交当前的页面吗?");
- //if (re==false) { return("");}
- //window.alert(theForm.test.value+"-------")
- if (theForm.Name.value=="") {window.alert("视图名不能为空");return("");}
- if (theForm.TableName.value=="") {window.alert("实体名不能为空");return("");}
- if (theForm.AddApp.value=="") {window.alert("增加操作不能为空");return("");}
- if (theForm.DelApp.value=="") {window.alert("删除操作不能为空");return("");}
- if (theForm.EditApp.value=="") {window.alert("编辑操作不能为空");return("");}
- var s1=theForm.AddRole.options(theForm.AddRole.options.selectedIndex).text;
- if (s1=="<%=selectFlag%>") {window.alert("增加角色不能为空");return("");}
- var s1=theForm.DelRole.options(theForm.DelRole.options.selectedIndex).text;
- if (s1=="<%=selectFlag%>") {window.alert("删除角色不能为空");return("");}
- var s1=theForm.EditRole.options(theForm.EditRole.options.selectedIndex).text;
- if (s1=="<%=selectFlag%>") {window.alert("编辑角色不能为空");return("");}
- if (theForm.ShowName.value=="") {window.alert("显示名不能为空");return("");}
- <% request.setAttribute("message","No permission to create forums"); %>
- theForm.submit();
- }
- </SCRIPT>
- </head>
- <body>
- <form name="theForm" method="POST" action="/servlet/com.content.control.SubmitView?new=0">
- <%@ include file="/include/top.jsp"%>
- <table border="0" cellspacing="1" cellpadding="0" width="100%">
- <tr>
- <td class="caption">视图名</td>
- <td class="detail"><input type="text" name="Name" size="80"></td>
- </tr>
- <tr>
- <td class="caption">实体名</td>
- <td class="detail"><input type="text" name="TableName" size="80"></td>
- </tr>
- <tr>
- <td class="caption">增加操作</td>
- <td class="detail"><input type="text" name="AddApp" size="80"></td>
- </tr>
- <tr>
- <td class="caption">删除操作</td>
- <td class="detail"><input type="text" name="DelApp" size="80"></td>
- </tr>
- <tr>
- <td class="caption">编辑操作</td>
- <td class="detail"><input type="text" name="EditApp" size="80"></td>
- </tr>
- <tr>
- <td class="caption">浏览操作</td>
- <td class="detail"><input type="text" name="SeeApp" size="80"></td>
- </tr>
- <tr>
- <td class="caption">增加角色</td>
- <td class="detail"><select name="AddRole" >
- <option selected><%=selectFlag%></option>
- <%
- if (roles!= null){
- for(int i=0;i<roles.length;i++) {
- %>
- <option><%=roles[i][0]%></option>
- <%
- }
- }
- %>
- </select>
- </td>
- </tr>
- <tr>
- <td class="caption">删除角色</td>
- <td class="detail">
- <select name="DelRole" >
- <option selected><%=selectFlag%></option>
- <%
- if (roles!= null){
- for(int i=0;i<roles.length;i++) {
- %>
- <option><%=roles[i][0]%></option>
- <%
- }
- }
- %>
- </select>
- </td>
- </tr>
- <tr>
- <td class="caption">编辑角色</td>
- <td class="detail">
- <select name="EditRole" >
- <option selected><%=selectFlag%></option>
- <%
- if (roles!= null){
- for(int i=0;i<roles.length;i++) {
- %>
- <option><%=roles[i][0]%></option>
- <%
- }
- }
- %>
- </select>
- </td>
- </tr>
- <tr>
- <td class="caption">浏览角色</td>
- <td class="detail">
- <select name="SeeRole" >
- <option selected><%=selectFlag%></option>
- <%
- if (roles!= null){
- for(int i=0;i<roles.length;i++) {
- %>
- <option><%=roles[i][0]%></option>
- <%
- }
- }
- %>
- </select>
- </td>
- </tr>
- <tr>
- <td class="caption">显示</td>
- <td class="detail"><input type="text" name="ShowName" size="80"></td>
- </tr>
- <tr>
- <td class="caption">条件</td>
- <td class="detail"><input type="text" name="AppWhereSql" size="80"></td>
- </tr>
- <tr>
- <td class="caption">视图类型</td>
- <td class="detail">
- <select name="Type" >
- <option selected>B</option>
- <option>A</option>
- <option>B</option>
- </select>
- A私有,B共享</td>
- </tr>
- <tr>
- <td class="caption">分类</td>
- <td class="detail"><input type="text" name="Catogory" size="80"></td>
- </tr>
- <tr>
- <td class="caption">排序</td>
- <td class="detail"><input type="text" name="SortItem" size="80"></td>
- </tr>
- </table>
- <input class="small" type="button" value="提交" name="B1" onclick="submitForm()">
- <input class="small" type="button" value="返回" name="B2" onclick="history.back()">
- <input class="small" type="button" value="增加" name="B3" onclick="drawTable()">
- <input class="small" type="button" value="删除" name="B4" onclick="DelTable()">
- 操作数目
- <input class="small" type="input" value="" name="Count" >
-
- <!--
- <table border="1" width="100%" bgcolor="#C0C0C0">
- <tr>
- <td width="10%">序号</td><td width="20%">操作名</td><td width="60%">操作名</td><td width="10%">操作名</td>
- <tr>
- </table> -->
- <p>
- <table border="0" cellspacing="1" cellpadding="0" width="100%" bgcolor="#C0C0C0" id=oTable>
- <tr>
- <td width="10%">序号</td><td width="20%">操作名</td><td width="60%">操作名</td><td width="10%">操作名</td>
- <tr>
- </table>
- </form>
- </body>
- </html>
|