关于项目中用easyUI建tab页的一些东西

来源:互联网 发布:mac终端更改系统时间 编辑:程序博客网 时间:2024/06/06 09:02


/*前台页面*/

<%@ page language="java" contentType="text/html; charset=UTF-8"

    pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="<%=basePath%>R_Javascripts/lib/jquery-1.8.0.min.js"></script>
<link rel="stylesheet" type="text/css" href="<%=basePath%>R_Javascripts/easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="<%=basePath%>R_Javascripts/easyui/themes/icon.css">
<link rel="stylesheet" type="text/css" href="<%=basePath%>R_Javascripts/easyui/ext/portal.css">
<%-- <link rel="stylesheet" type="text/css" href="<%=basePath%>R_Views/user/css/default.css"> --%>
<script type="text/javascript" src="<%=basePath%>R_Javascripts/easyui/jquery.easyui.min.js"></script>
<%-- <script type="text/javascript" src="<%=basePath%>R_Views/user/js/easyui/ext/jquery.portal.js"></script> --%>
<%-- <script type="text/javascript" src="<%=basePath%>R_Views/user/js/easyui/ext/jquery.cookie.js"></script> --%>
<script src="<%=basePath%>R_Javascripts/easyui/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>
<title>Insert title here</title>
<style>
html body{width:100%;height:100%;padding:0px;margin:0px;}
</style>
<script type="text/javascript">
var basePath="<%=basePath%>";

$(function(){
      $("#tt").tabs({
              fit:true,
              onSelect:function(title,index) {
               var x=$(".mytab").eq(index).attr('id');
            add(x); 
            }
      });
}); 

 function add(a){
  if(a == 'a'){
             url=basePath+'R_Views/sgjd/page/sgjd_list.jsp?j_type=管沟成型进度';
             $("#ifame_a").attr('src',url);
  }else if(a=='b'){
             url=basePath+'R_Views/sgjd/page/sgjd_list.jsp?j_type=布管进度';
             $("#ifame_b").attr('src',url);
         }else if(a=='c'){
              url=basePath+'R_Views/sgjd/page/sgjd_list.jsp?j_type=焊接实时进度';
                  $("#ifame_c").attr('src',url);
         }else if(a=='d'){
              url=basePath+'R_Views/sgjd/page/sgjd_list.jsp?j_type=补口补伤进度';
                  $("#ifame_d").attr('src',url);
   }else if(a=='e'){
                    url=basePath+'R_Views/sgjd/page/sgjd_list.jsp?j_type=管沟回填进度';
            $("#ifame_e").attr('src',url);
          }else {
                     url=basePath+'R_Views/sgjd/page/sgjd_list.jsp?j_type=待开发进度施工';
                     $("#ifame_f").attr('src',url);
  }
}
</script>
</head>
<body>
  <div id="tt" class="easyui-tabs" >
  <div  id="a" title="管沟成型进度 " style="padding:0px;" class="mytab"  >
  <iframe id="ifame_a" scrolling="auto" frameborder="0"  src="<%=basePath %>loading.jsp" style="width:100%;height:100%;"></iframe>
  </div>  
  <div  id="b" title="布管进度" style="padding:0px;" class="mytab" >  
  <iframe id="ifame_b" scrolling="auto" frameborder="0"  src="<%=basePath %>loading.jsp" style="width:100%;height:100%;"></iframe>                      
  </div>  
    <div  id="c" title="焊接实时进度" style="padding:0px;" class="mytab"  >     
  <iframe id="ifame_c" scrolling="auto" frameborder="0"  src="<%=basePath %>loading.jsp"  style="width:100%;height:100%;"></iframe>                
          </div> 
          <div  id="d"  title="补口补伤进度" style="padding:0px;" class="mytab" >  
  <iframe id="ifame_d" scrolling="auto" frameborder="0"  src="<%=basePath %>loading.jsp"  style="width:100%;height:100%;"></iframe>
         </div>  
         <div  id="e" title="管沟回填进度" style="padding:0px;" class="mytab" >  
  <iframe id="ifame_e" scrolling="auto" frameborder="0"  src="<%=basePath %>loading.jsp"  style="width:100%;height:100%;"></iframe>
         </div>  
         <div  id="f" title="待开发进度施工" style="padding:0px;" class="mytab" >  
               <iframe id="ifame_f" scrolling="auto" frameborder="0"  src="<%=basePath %>loading.jsp"  style="width:100%;height:100%;"></iframe>         
         </div>   
   </div>  
</body>

</html>




/*前台页面*/


<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="<%=basePath%>R_Javascripts/lib/jquery-1.8.0.min.js"></script>
<link rel="stylesheet" type="text/css" href="<%=basePath%>R_Views/user/js/easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="<%=basePath%>R_Views/user/js/easyui/themes/icon.css">
<link rel="stylesheet" type="text/css" href="<%=basePath%>R_Views/user/js/easyui/ext/portal.css">
<link rel="stylesheet" type="text/css" href="<%=basePath%>R_Views/user/css/default.css">
<script type="text/javascript" src="<%=basePath%>R_Views/user/js/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="<%=basePath%>R_Views/user/js/easyui/ext/jquery.portal.js"></script>
<script type="text/javascript" src="<%=basePath%>R_Views/user/js/easyui/ext/jquery.cookie.js"></script>
<script src="<%=basePath%>R_Views/user/js/easyui/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>
<title>Insert title here</title>
<script type="text/javascript">


function  doAdd(){
 $("#addWindow").window("open");
}


function  doEdit(){
  var rows = $('#tt').datagrid('getSelections');
 if(rows.length <= 0){
 $.messager.alert("提示信息",'请选择一条数据','info');
 }else if(rows.length >1){
         $.messager.alert("提示信息","别急,一条一条地来",'info');
 }else {
         $('#editForm').form('load',rows[0]);
         $('#editWindow').window("open");
     }
}


function doDelete(){
       var rows = $('#tt1').datagrid('getSelections');
 if(rows.length <= 0){
       $.messager.alert("提示信息","请选中要删除的数据",'info')
 }else{
       $.messager.confirm("提示信息","您确定要删除莫",function(a){
 if(a){
 var aa = new Array();
 for(var i = 0;i<rows.length;i++){
 aa.push(rows[i].f_id);
 }
 var ids = aa.join();
 location.href ="http://localhost:21000/app-sjcj/R_action/sgjd/sgjd_delete.action?ids="+ids;
 }
 })
 }

}


</script>
</head>
<body style="width:100%;height:100%;">


        <table id="tt1" class="easyui-datagrid"  iconCls="icon-save" fit="true"  toolbar="#tb" pageList="[30,40,50]"
        pagination="true" rownumbers="true" url ="<%=basePath%>R_action/sgjd/sgjd_list.action?j_type=<%=request.getParameter("j_type")%>">
   <thead>  
       <tr>  
           <th field="f_id" width="80" checkbox="true"></th>
           <th field="j_type" width="200" align="center">施工类型</th>  
           <th field="j_danwei" width="200" align="center">施工单位</th>  
           <th field="j_starthao" width="200" align="center">开始桩号</th>  
           <th field="j_startpianyi" width="200" align="center">开始偏移量</th>  
           <th field="j_endhao" width="200" align="center">结束桩号</th> 
           <th field="j_endpianyi" width="200" align="center">结束偏移量</th>  
           <th field="j_informant" width="200" align="center">填报人</th>  
           <th field="j_date" width="200"  align="center" >填报日期</th>  
           <th field="j_description" width="200" align="center">备注</th>


           
       </tr>  
   </thead>  
       </table>  
<div id="tb">  
   <a href="#" class="easyui-linkbutton" iconCls="icon-add"   plain="true" onclick="javascript:doAdd()">增加</a>  
   <a href="#" class="easyui-linkbutton" iconCls="icon-cut"  align="center" plain="true" onclick="javascript:doEdit()">修改</a>  
   <a href="#" class="easyui-linkbutton" iconCls="icon-remove"  align="center" plain="true" onclick="javascript:doDelete()">删除</a>  
</div>
<!-- 添加用户 -->
    <div class="easyui-window" title="用户添加" id="addWindow" style="top:20px;left:200px">
<div style="height:31px">
<div class="datagrid-toolbar">
<a id="save" icon="icon-save" href="#" class="easyui-linkbutton">保存</a>
<script type="text/javascript">
$(function(){
$('#addWindow').window({
       title: '用户添加',
       width: 600,
       modal: true,
       shadow: true,
       closed: true,
       height: 600,
       resizable:false
   });

$('#save').click(function(){
var v = $('#addForm').form('validate');
if(v){
$('#addForm').submit();
}
});
});
</script>
</div>
</div>
        <div style="padding:5px;" border="false">
<form id="addForm" method="post"
action="<%=basePath%>R_action/sgjd/sgjd_add.action?j_type=<%=request.getParameter("j_type")%>">
<table class="table-edit" width="80%" align="center">
<tr class="title">
<td colspan="2">进度信息</td>
</tr>
<!-- <tr>
<td>进度类型</td>
<td><input type="text" name="j_type" class="easyui-validatebox" /></td>
</tr> -->
<tr>
<td>施工单位</td>
<td>
<input type="text" name="j_danwei" class="easyui-validatebox" />  
</td>
</tr>
<tr>
<td>开始桩号</td>
<td><input type="text" name="j_starthao" class="easyui-validatebox" /></td>
</tr>
<tr>
<td>开始偏移量</td>
<td><input type="text" name="j_startpianyi" class="easyui-validatebox" /></td>
</tr>
<tr>
<td>结束桩号</td>
<td><input type="text" name="j_endhao" class="easyui-validatebox" /></td>
</tr>
<tr>
<td>结束偏移量</td>
<td><input type="text" name="j_endpianyi" class="easyui-validatebox" /></td>
</tr>
<tr>
<td>填报人</td>
<td><input type="text" name="j_informant" class="easyui-validatebox" /></td>
</tr>
<tr>
<td>填报日期</td>
<td><input type="text" name="j_date" class="easyui-datebox" /></td>
</tr>
<tr>
<td>备注</td>
<td><input type="text" name="j_description" class="easyui-validatebox" /></td>
</tr>
</table>
</form>
</div>
</div>
<!-- 修改用户 -->
    <div class="easyui-window" title="用户修改" id="editWindow" style="top:20px;left:200px">
<div style="height:31px">
<div class="datagrid-toolbar">
<a id="edit" icon="icon-save" href="#" class="easyui-linkbutton">保存</a>
<script type="text/javascript">
$(function(){
$('#editWindow').window({
       title: '用户修改',
       width: 600,
       modal: true,
       shadow: true,
       closed: true,
       height: 600,
       resizable:false
   });

$('#edit').click(function(){
var v = $('#editForm').form('validate');
if(v){
$('#editForm').submit();
}

})
});
</script>
</div>
</div>
        <div style="padding:5px;" border="false">
<form id="editForm" method="post"
action="<%=basePath%>R_action/sgjd/sgjd_edit.action">
<table class="table-edit" width="80%" align="center">
<tr class="title">
<td colspan="2">用户信息</td>
</tr>
<tr>
    <td><input type="hidden" name="f_id"></td>
</tr>
<tr>
<td>进度类型</td>
<td><input type="text" name="j_type" class="easyui-validatebox" /></td>
</tr>
<tr>
<td>施工单位</td>
<td>
<input type="text" name="j_danwei" class="easyui-validatebox" />  
</td>
</tr>
<tr>
<td>开始桩号</td>
<td><input type="text" name="j_starthao" class="easyui-validatebox" /></td>
</tr>
<tr>
<td>开始偏移量</td>
<td><input type="text" name="j_startpianyi" class="easyui-validatebox" /></td>
</tr>
<tr>
<td>结束桩号</td>
<td><input type="text" name="j_endhao" class="easyui-validatebox" /></td>
</tr>
<tr>
<td>结束偏移量</td>
<td><input type="text" name="j_endpianyi" class="easyui-validatebox" /></td>
</tr>
<tr>
<td>填报人</td>
<td><input type="text" name="j_informant" class="easyui-validatebox" /></td>
</tr>
<tr>
<td>填报日期</td>
<td><input type="text" name="j_date" class="easyui-datebox" /></td>
</tr>
<tr>
<td>备注</td>
<td><input type="text" name="j_description" class="easyui-validatebox" /></td>
</tr>
</table>
</form>
</div>
</div>
</body>
</html>


原创粉丝点击