码迷,mamicode.com
首页 > 其他好文 > 详细

业务操作系统(二)

时间:2016-08-10 14:19:54      阅读:218      评论:0      收藏:0      [点我收藏+]

标签:

目录

    1.layout

    2.accordion

    3.tabs

    4.Ztree

一、EasyUI相关组件

1.layout(布局)

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>    
    <title>layout布局的使用</title>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/js/easyui/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/js/easyui/themes/icon.css">
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.8.3.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/easyui/jquery.easyui.min.js"></script>
  </head>
  
  <body class="easyui-layout" >
      <!-- 每个div是一个区域 -->
      <div data-options="region:‘north‘,title:‘北‘" style="height:150px;">北部区域</div>
      <div data-options="region:‘south‘,title:‘南‘" style="height:150px;">南部区域</div>
      <div data-options="region:‘east‘,title:‘东‘" style="width:150px;">南部区域</div>
      <div data-options="region:‘west‘,title:‘西‘" style="width:150px;">南部区域</div>
      <div title="中心" data-options="region:‘center‘" >中心区域</div>
  </body>

</html>

效果:

     技术分享

 

2.accordion(折叠面板)

<body class="easyui-layout" >
      <!-- 每个div是一个区域 -->
      <div data-options="region:‘north‘,title:‘北‘" style="height:150px;">北部区域</div>
      <div data-options="region:‘south‘,title:‘南‘" style="height:150px;">南部区域</div>
      <div data-options="region:‘east‘,title:‘东‘" style="width:150px;">东部区域</div>
      <div data-options="region:‘west‘,title:‘西‘" style="width:150px;">
      
          <!-- 折叠面板 -->
          <div class="easyui-accordion" data-options="fit:‘true‘">
              <!-- 每个div是其中一个面板 -->
              <div title="标题1" data-options="iconCls:‘icon-add‘">面板1</div>
              <div title="标题2" data-options="iconCls:‘icon-cut‘">面板2</div>
              <div title="标题3" data-options="iconCls:‘icon-save‘">面板3</div>
          </div>
          
      </div>
      <div title="中心" data-options="region:‘center‘" >中心区域</div>
</body>

效果:

技术分享

 

3.tabs(选项卡)

<body class="easyui-layout" >
      <!-- 每个div是一个区域 -->
      <div data-options="region:‘north‘,title:‘北‘" style="height:150px;">北部区域</div>
      <div data-options="region:‘south‘,title:‘南‘" style="height:150px;">南部区域</div>
      <div data-options="region:‘east‘,title:‘东‘" style="width:150px;">东部区域</div>
      <div data-options="region:‘west‘,title:‘西‘" style="width:150px;">
      
          <!-- 折叠面板 -->
          <div class="easyui-accordion" data-options="fit:‘true‘">
              <!-- 每个div是其中一个面板 -->
              <div title="标题1" data-options="iconCls:‘icon-add‘">面板1</div>
              <div title="标题2" data-options="iconCls:‘icon-cut‘">面板2</div>
              <div title="标题3" data-options="iconCls:‘icon-save‘">面板3</div>
          </div>
          
      </div>
      <div title="中心" data-options="region:‘center‘" >
          
          <!-- 选项卡 -->
          <div class="easyui-tabs" data-options="fit:‘true‘">
              
              <div title="面板一" data-options="closable:‘true‘">内容1</div>
              <div title="面板二" data-options="closable:‘true‘">内容2</div>
              <div title="面板三" data-options="closable:‘true‘">内容3</div>
              
          </div>
      
      </div>
  </body>

效果:

      技术分享

 

(1)动态的打开选项卡

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    <title>layout布局的使用</title>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/js/easyui/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/js/easyui/themes/icon.css">
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.8.3.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/easyui/jquery.easyui.min.js"></script>
    
    <script type="text/javascript">
    
        $(function(){
            
            //为按钮绑定事件
            $("#linkone").click(function(){
                
                //判断当前选项卡是否打开
                var ifExists = $("#tabs").tabs("exists","百度");
                
                if(ifExists){
                    //如果已经打开就选中它
                    $("#tabs").tabs("select","百度");
                }
                else{
                    
                    //如果没有打开就添加一个新的选项卡
                    $("#tabs").tabs("add",{
                        
                        title:"百度",
                        iconCls:"icon-add",
                        closable:true,
                        content:<iframe width="100%" height="100%" frameborder="0" src="http://www.baidu.com" />
                    });
                }
                
            });
        });
    
    </script>
        
  </head>
  
  <body class="easyui-layout" >
      
      <!-- 每个div是一个区域 -->
      <div data-options="region:‘north‘,title:‘北‘" style="height:150px;">北部区域</div>
      <div data-options="region:‘south‘,title:‘南‘" style="height:150px;">南部区域</div>
      <div data-options="region:‘east‘,title:‘东‘" style="width:150px;">东部区域</div>
      <div data-options="region:‘west‘,title:‘西‘" style="width:150px;">
      
          <!-- 折叠面板 -->
          <div class="easyui-accordion" data-options="fit:‘true‘">
              <!-- 每个div是其中一个面板 -->
              <div title="标题1" data-options="iconCls:‘icon-add‘">
              
                  <a id="linkone" class="easyui-linkbutton">面板一</a>
                  
              </div>
              <div title="标题2" data-options="iconCls:‘icon-cut‘">面板2</div>
              <div title="标题3" data-options="iconCls:‘icon-save‘">面板3</div>
          </div>
          
      </div>
      <div title="中心" data-options="region:‘center‘" >
          
          <!-- 选项卡 -->
          <div class="easyui-tabs" data-options="fit:‘true‘" id="tabs">
              
              <div title="面板一" data-options="closable:‘true‘">内容1</div>
              <div title="面板二" data-options="closable:‘true‘">内容2</div>
              <div title="面板三" data-options="closable:‘true‘">内容3</div>
              
          </div>
      
      </div>
  </body>
</html>

效果:

      技术分享

 

4.Ztree

menu.json

[
        { "id":"11", "pId":"0", "name":"基础数据",  "click":false},
        { "id":"112", "pId":"11", "name":"收派标准",  "page":"page_base_standard.action"},
        { "id":"113", "pId":"11", "name":"取派员设置",  "page":"page_base_staff.action"},
        { "id":"114", "pId":"11", "name":"区域设置","page":"page_base_region.action"},
        { "id":"115", "pId":"11", "name":"管理分区", "page":"page_base_subarea.action"},
        { "id":"116", "pId":"11", "name":"管理定区/调度排班","page":"page_base_decidedzone.action"},
        { "id":"12", "pId":"0", "name":"受理","click":false },
        { "id":"121", "pId":"12", "name":"业务受理" ,"page":"page_qupai_noticebill_add.action"},
        { "id":"122", "pId":"12", "name":"工作单快速录入" ,"page":"page_qupai_quickworkorder.action"},
        { "id":"124", "pId":"12", "name":"工作单导入" ,"page":"page_qupai_workorderimport.action"},
        { "id":"13", "pId":"0", "name":"调度","click":false },
        { "id":"131", "pId":"13", "name":"查台转单","page":""},
        { "id":"132", "pId":"13", "name":"人工调度","page":"page_qupai_diaodu.action"},
        { "id":"14", "pId":"0" , "name":"中转配送流程管理","click":false },
        { "id":"141", "pId":"14", "name":"工作单审核" ,"page":"page_zhongzhuan_check.action"},
        { "id":"142", "pId":"14", "name":"查看个人任务" ,"page":"page_workflow_personaltask.action"},
        { "id":"143", "pId":"14", "name":"查看组任务","page":"page_workflow_grouptask.action"}
]

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    <title>layout布局的使用</title>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/js/easyui/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/js/easyui/themes/icon.css">
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.8.3.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/easyui/jquery.easyui.min.js"></script>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/js/ztree/zTreeStyle.css">
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/ztree/jquery.ztree.all-3.5.js"></script>

    
    <script type="text/javascript">
    
        $(function(){
                        
            function zTreeClick(event,treeId,treeNode){
                
                var name = treeNode.name;
                var page = treeNode.page;
                
                if(undefined != page){
                    //判断当前选项卡是否打开或存在
                    var ifOpen = $("#tabs").tabs("exists",name);
                    if(ifOpen){
                        //存在就选中
                        $("#tabs").tabs("select",name);
                    }
                    else{
                        //动态打开一个选项卡面板
                        $("#tabs").tabs("add",{
                            title:name,
                            iconCls:icon-add,
                            closable:true,
                            content:<iframe frameborder="0" width="100%" height="100%" src="+page+"></iframe>
                        });
                    }

                }
                
            }
            
            var url = "${pageContext.request.contextPath}/json/menu.json"
            
            $.post(url,{},function(data){
                
                //动态的创建Ztree
                var setting = {
                        
                        //使用简单json
                        data:{
                            simpleData:{
                                enable:true
                            }
                        },
                        //点击事件的回调函数
                        callback:{
                            onClick:zTreeClick
                        }
                }
                
                //初始化Ztree
                $.fn.zTree.init($("#tree"),setting,data);
                
            });
            
            
            
        });
    
    </script>
        
  </head>
  
  <body class="easyui-layout" >
      
      <!-- 每个div是一个区域 -->
      <div data-options="region:‘north‘,title:‘北‘" style="height:150px;">北部区域</div>
      <div data-options="region:‘south‘,title:‘南‘" style="height:150px;">南部区域</div>
      <div data-options="region:‘east‘,title:‘东‘" style="width:150px;">东部区域</div>
      <div data-options="region:‘west‘,title:‘西‘" style="width:150px;">
      
          <!-- 折叠面板 -->
          <div class="easyui-accordion" data-options="fit:‘true‘">
              <!-- 每个div是其中一个面板 -->
              <div title="标题1" data-options="iconCls:‘icon-add‘">
                  
                  <!-- 树形菜单 -->
                  <ul id="tree" class="ztree"></ul>
              
              </div>
              <div title="标题2" data-options="iconCls:‘icon-cut‘">面板2</div>
              <div title="标题3" data-options="iconCls:‘icon-save‘">面板3</div>
          </div>
          
      </div>
      <div title="中心" data-options="region:‘center‘" >
          
          <!-- 选项卡 -->
          <div class="easyui-tabs" data-options="fit:‘true‘" id="tabs">
              
              <div title="面板一" data-options="closable:‘true‘">内容1</div>
              <div title="面板二" data-options="closable:‘true‘">内容2</div>
              <div title="面板三" data-options="closable:‘true‘">内容3</div>
              
          </div>
      
      </div>
  </body>
</html>

效果:

     技术分享

业务操作系统(二)

标签:

原文地址:http://www.cnblogs.com/yangang2013/p/5756277.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!