<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>

<html>
  <head>
    <title></title>

   <%--  富客户端环境引用文件  --%> 
<%@ include file="/gaowj/header-simple-app-1.0.jsp"%>
<script type="text/javascript" src="jwapp/pages/unit/js/jwAppUnitModule.js"  charset="utf-8"></script>
<script type="text/javascript" src="gaowj/ria/jquery/zTree_v3/js/jquery.ztree.core-3.5.js"  charset="utf-8"></script>
<link rel="stylesheet" type="text/css" href="gaowj/ria/jquery/zTree_v3/css/zTreeStyle/zTreeStyle.css" charset="utf-8"></link>
  </head><br/>
  <body class="gaowj">
  <div class="easyui-layout" style="width:99%;height:90%;margin:0 5px;">

		<div data-options="region:'center',iconCls:'icon-ext-10_15'" title="操作人员列表">
        <%@ include file="menuoperate.jsp"%>
  <table cellpadding="0" cellspacing="0">
        <tr><td>
  <table id ="resizabletable" class="sortable"  border="0" cellpadding="0" cellspacing="1" bgcolor="#f4f4f4">
        <thead>
        
        <tr bgcolor="#c0c0c0">
          <th width="60" align="center" class="sort-alpha">序号</th>
          <th width="60" align="center" class="sort-alpha">登陆码</th>
          <th width="60" align="center" class="sort-alpha">姓名</th>
          <th width="86" align="center" class="sort-alpha">单位</th>
          <th width="98" align="center" class="sort-alpha">注册时间</th>
          <th width="98" align="center" class="sort-alpha">注册IP</th>
          <th width="120" align="center" class="sort-alpha">每页最多记录</th>
          <th width="70" align="center" class="sort-alpha">接口调用</th>
          <th width="70" align="center" class="sort-alpha">外网登陆</th>
          <th width="56" align="center" class="sort-alpha">类型</th>
          <th width="62" align="center" class="sort-alpha">是否使用</th>
          <th width="50" align="center" class="sort-alpha">状态</th>
        </tr>
        </thead>
        <tbody>
        <s:set name="j" value="0"></s:set>
        <s:iterator value="listdata">
        <s:set name="j" value="#j+1"></s:set>
        <tr  ondblclick="g_dbclick();" onclick="ls_choice('<s:property value="CODE"/>');" onMouseOver="this.style.backgroundColor='#D0E6EE';" onMouseOut="this.style.backgroundColor='#FFFFFF'" bgcolor="#FFFFFF">
          <td align="center">
          <input id="<s:property value="CODE"/>" type="checkbox" name="checkbox" value="checkbox"><span id="<s:property value="CODE"/>value"><s:property value="#j"/></span>
          </td>
          <td align="center"><s:property value="EMID"/></td>
          <td align="center"><s:property value="EMNAME"/></td>
          <td align="center"><s:property value="EMDEPARTNAME"/></td>
          <td align="center"><fmt:formatDate value="${REGDATE}" pattern="${dateZH}" /></td>
          <td align="center"><s:property value="REMOTE_IP"/></td>
          <td align="center"><s:property value="PAGESIZE"/></td>
          <td align="center"><s:if test='O_ENABLE=="Y"'>允许</s:if><s:else>禁止</s:else></td>
          <td align="center"><s:if test='W_ENABLE=="Y"'>允许</s:if><s:else>禁止</s:else></td>
          <td align="center"><s:if test='TYPE=="O"'>员工</s:if><s:elseif test='TYPE=="W"'>客户</s:elseif><s:else>停用</s:else></td>
          <td align="center"><s:if test='STATE==0'>有效</s:if><s:else>失效</s:else></td>
          <td align="center" id="del<s:property value="CODE"/>"><s:if test='YSY>0'>已用</s:if><s:else>未用</s:else></td>
        </tr>
        </s:iterator>
         </tbody>
         <tfoot>
        <tr>
          <td colspan="12" align="left" valign="middle" style="background:url(image/img_vk/bg001.png);"> 
          <form name="p" action="user_grid" method="post">
           <table border="0"><tr><td>　
             
         <select name="pageSize" onChange="submit();">　
        <s:iterator value="listPageSize">
          <option <s:if test="pageSize==pageSizec">selected</s:if>  value="<s:property value="pageSizec"/>"><s:property value="pageSizec"/></option>
        </s:iterator>
        </select>
          
          </td>
          <td>       
        <s:a action="user_grid"><img src="image/img_vk/first.png" border="0"/>
         <s:param name='pageNo'>1</s:param>
         <s:param name='pageSize' value="pageSize"></s:param>
        </s:a>&nbsp;&nbsp;&nbsp;&nbsp;
        <s:if test="pageNo>1">
        <s:a action="user_grid"><img src="image/img_vk/previous.png" border="0"/>
         <s:param name='pageNo' value="pageNo-1"></s:param>
         <s:param name='pageSize' value="pageSize"></s:param>
        </s:a>　
        </s:if>
        </td>
        <td valign="top">
                    第 <s:property value="pageNo"/>共 
        <s:property value="pageCount"/> 页 
        </td>
        <td>
        <s:if test="pageNo<pageCount">
        <s:a action="user_grid"><img src="image/img_vk/next.png" border="0"/>
         <s:param name='pageNo' value="pageNo+1"></s:param>
         <s:param name='pageSize' value="pageSize"></s:param>
        </s:a>
        </s:if>&nbsp;&nbsp;&nbsp;&nbsp;
        <s:a action="user_grid"><img src="image/img_vk/last.png" border="0"/>
          <s:param name='pageNo' value="pageCount"></s:param>
          <s:param name='pageSize' value="pageSize"></s:param>
        </s:a>
         </td></tr></table>
         </form>
          </td>
        </tr>
       </tfoot>
      </table>
 </td></tr></table>
      </div>
  </div>
  <div id="SendProduct" style="width:100px;height:100px;" >
  </body>
  <script type="text/javascript">
    document.getElementById("g_list").style.display='none';
    document.getElementById("g_password").style.display='none';
    document.getElementById("g_add").style.display='';
    document.getElementById("g_open").style.display='';
    document.getElementById("g_copy").style.display='none';
    document.getElementById("g_delete").style.display='';
    document.getElementById("g_preview").style.display='none';
    document.getElementById("g_taoda").style.display='none';
    document.getElementById("g_refresh").style.display='';
    document.getElementById("g_save").style.display='none';
    document.getElementById("g_return").style.display='none';
    document.getElementById("g_groupCmodule").style.display='none';
    document.getElementById("g_groupCuser").style.display='none';
    document.getElementById("g_userCuser").style.display='';
    var ls_code;
    var ls_old,ls_new
    var page="<s:property value='pageNo'/>";
    var pageSize="<s:property value='pageSize'/>";
    function ls_choice(ls_current){
     if(ls_old!=null){
       ls_old.checked=false;
     }
     ls_new = document.getElementById(ls_current);
     ls_new.checked=true;
     ls_old = ls_new;
    }
    function g_add(){
     var modifyUrl = gaowj.WEB_APP_NAME+"/user_insert?pageNo="+page+"&pageSize="+pageSize+"&method=insert";
     $('#SendProduct').window({
			  title : "人员编辑",
			  iconCls:'icon-ext-05_41',
			  width : 750,
			  height : 530,
			  content : '<iframe scrolling="yes" frameborder="0"  src="'+ modifyUrl+ '" style="width:100%;height:98%;"></iframe>',
			  modal : true,
			  minimizable : false,
			  maximizable : false,
			  shadow : false,
			  cache : false,
			  closed : false,
			  collapsible : false,
			  resizable : false,
			  loadingMessage : '正在加载数据，请稍等片刻......'
       });
    }
    function g_dbclick(){
     var modifyUrl = gaowj.WEB_APP_NAME+"/user_update?pageNo="+page+"&pageSize="+pageSize+"&method=update&myzd_id="+ls_new.id;
     $('#SendProduct').window({
			  title : "人员编辑",
			  iconCls:'icon-ext-05_41',
			  width : 750,
			  height : 530,
			  content : '<iframe scrolling="yes" frameborder="0"  src="'+ modifyUrl+ '" style="width:100%;height:98%;"></iframe>',
			  modal : true,
			  minimizable : false,
			  maximizable : false,
			  shadow : false,
			  cache : false,
			  closed : false,
			  collapsible : false,
			  resizable : false,
			  loadingMessage : '正在加载数据，请稍等片刻......'
       });
    }
    function g_open(){
     if(ls_new!=null){
      var modifyUrl = gaowj.WEB_APP_NAME+"/user_update?pageNo="+page+"&pageSize="+pageSize+"&method=update&myzd_id="+ls_new.id;
      $('#SendProduct').window({
			  title : "人员编辑",
			  iconCls:'icon-ext-05_41',
			  width : 750,
			  height : 530,
			  content : '<iframe scrolling="yes" frameborder="0"  src="'+ modifyUrl+ '" style="width:100%;height:98%;"></iframe>',
			  modal : true,
			  minimizable : false,
			  maximizable : false,
			  shadow : false,
			  cache : false,
			  closed : false,
			  collapsible : false,
			  resizable : false,
			  loadingMessage : '正在加载数据，请稍等片刻......'
       });
     }
    }
    function g_copy(){
     if(ls_new!=null){
      var ls_xh = document.getElementById(ls_new.id + "value");
      $.messager.confirm('提示', '确定复制第'+ls_xh.innerHTML+'条记录?', function(r) {
		if (r) {
       var modifyUrl = gaowj.WEB_APP_NAME+"/user_copy?pageNo="+page+"&pageSize="+pageSize+"&method=insert&myzd_id="+ls_new.id;
       $('#SendProduct').window({
			  title : "人员编辑",
			  iconCls:'icon-ext-05_41',
			  width : 750,
			  height : 530,
			  content : '<iframe scrolling="yes" frameborder="0"  src="'+ modifyUrl+ '" style="width:100%;height:98%;"></iframe>',
			  modal : true,
			  minimizable : false,
			  maximizable : false,
			  shadow : false,
			  cache : false,
			  closed : false,
			  collapsible : false,
			  resizable : false,
			  loadingMessage : '正在加载数据，请稍等片刻......'
       });
      }
      });
     }
    }
    function g_delete(){
     if(ls_new!=null){
      var ls_sfsy = document.all.item("del"+ls_new.id).innerHTML;
      var ls_xh = document.getElementById(ls_new.id + "value");
      if(ls_sfsy=="已用"){
       $.messager.alert('提示','第'+ls_xh.innerHTML+'条记录已在使用中,不能删除!','info');
      }else{
         $.messager.confirm('提示', '确定删除第'+ls_xh.innerHTML+'条记录?', function(r) {
		if (r) {
           window.location="user_delete?pageNo="+page+"&pageSize="+pageSize+"&myzd_id="+ls_new.id;
         }
         });
      }
     }
    }
    function g_preview(){
     if(ls_new!=null){
      var ls_xh = document.getElementById(ls_new.id + "value");
      alert("将预览第"+ls_xh.innerHTML+"条记录!");
     }
    }
    function g_refresh(){
     window.location="user_grid?pageNo="+page+"&pageSize="+pageSize;
    }
    function g_save(){
     alert('g_save');
    }
    function g_return(){
     alert("g_return");
    }
    function g_groupCmodule(){
    
   }
   function g_groupCuser(){
    
   }
   function g_userCuser(){
     if(ls_new!=null){
    	 var modifyUrl = gaowj.WEB_APP_NAME+"/personChoiceLinguser?myzd_id="+ls_new.id+"&qxlx=YBYW";
   	    $('#SendProduct').window({
			  title : "人员管辖设定",
			  iconCls:'icon-ext-05_41',
			  width : 330,
			  height : 550,
			  content : '<iframe scrolling="yes" frameborder="0"  src="'+ modifyUrl+ '" style="width:100%;height:98%;"></iframe>',
			  modal : true,
			  minimizable : false,
			  maximizable : false,
			  shadow : false,
			  cache : false,
			  closed : false,
			  collapsible : false,
			  resizable : false,
			  loadingMessage : '正在加载数据，请稍等片刻......'
           });
     }
   }
   
   
   /**------------------------构建机构树---------------------------------**/
//定义ztree参数
    var setting = {
		view: {
			  showLine: true,
			  selectedMulti: false
			},
		data: {
			  key: {
			    title:"NAME",
			    name:"NAME"
			  },
			  simpleData: {
			    enable: true,
			    idKey: "UUID",
			    pIdKey: "PARENT_ID",
			    rootPId: ""
			  }
			},
		callback: {
				beforeClick: beforeClick,
				onClick: onClick
			}
		};
	   function beforeClick(treeId, treeNode) {
		  return (treeNode.click != false);
	   }
	   function onClick(event, treeId, treeNode) { 
		  modifyNode(treeNode);
	   }
	   function modifyNode(treeNode){
		   window.location="user_grid?pageNo="+page+"&pageSize="+pageSize+"&FIELD_EMDEPART="+treeNode.UNIT_ID;
	   }
	   
	   //展现左边机构树

	var data = jwAppUnitModel.jwAppsUnitDataAction.listAll({});
	var zTree = $.fn.zTree.init($("#user_unit_tree"), setting, data.rowSet);
	var treeNode = zTree.getNodeByParam("UUID","1", null);
	zTree.expandNode(treeNode,null,null,null,null);

  </script>
  <script type="text/javascript" src="<%=request.getContextPath() %>/js/openwindow.js"></script>
</html>
