<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>

<%@ taglib uri="/struts-tags" prefix="s" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
      <%--  富客户端环境引用文件  --%> 
<%@ include file="/gaowj/header-simple-app-1.0.jsp"%>
    <title></title>
 <script type="text/javascript">
 
 </script>

  </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-11_48'" 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="33" align="center" class="sort-alpha">
          序号</th>
          <th width="81" align="center" class="sort-alpha">编码</th>
          <th width="79" align="center" class="sort-alpha">名称</th>
          <th width="199" align="center" class="sort-alpha">注释</th>
          <th width="71" align="center" class="sort-alpha">排序</th>
          <th width="71" align="center" class="sort-alpha">是否使用</th>
          <th width="70" align="center" class="sort-alpha">选模状态</th>
          <th width="70" 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="G_ID"/>');" onMouseOver="this.style.backgroundColor='#D0E6EE';" onMouseOut="this.style.backgroundColor='#FFFFFF'" bgcolor="#FFFFFF">
          <td align="center">
          <input id="<s:property value="G_ID"/>" type="checkbox" name="checkbox" value="checkbox"><span id="<s:property value="G_ID"/>value"><s:property value='#j'/></span>
          </td>
          <td align="center"><s:property value="G_ID"/></td>
          <td align="center"><s:property value="G_NAME"/></td>
          <td align="center"><s:property value="G_TITLE"/></td>
          <td align="center"><s:property value="G_SORT"/></td>
          <td align="center"><s:if test="G_STATE!=null && G_STATE==0">有效 </s:if><s:else>失效</s:else></td>
          <td align="center" id="delm<s:property value="G_ID"/>"><s:if test="MSY!=null && MSY>0">已用 </s:if><s:else>未用</s:else></td>
          <td align="center" id="delu<s:property value="G_ID"/>"><s:if test="USY!=null && USY>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="groups_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="groups_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="groups_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="groups_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="groups_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;" >  
  </div> 
  </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='';
    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='';
    document.getElementById("g_groupCuser").style.display='';
    document.getElementById("g_userCuser").style.display='none';
    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+"/groups_insert?pageNo="+page+"&pageSize="+pageSize+"&method=insert";
     $('#SendProduct').window({
			  title : "角色编辑",
			  iconCls:'icon-ext-05_41',
			  width : 750,
			  height : 330,
			  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+"/groups_update?pageNo="+page+"&pageSize="+pageSize+"&method=update&myzd_id="+ls_new.id;
     $('#SendProduct').window({
			  title : "角色编辑",
			  iconCls:'icon-ext-05_41',
			  width : 750,
			  height : 330,
			  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+"/groups_update?pageNo="+page+"&pageSize="+pageSize+"&method=update&myzd_id="+ls_new.id;
      $('#SendProduct').window({
			  title : "角色编辑",
			  iconCls:'icon-ext-05_41',
			  width : 750,
			  height : 330,
			  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+"/groups_copy?pageNo="+page+"&pageSize="+pageSize+"&method=insert&myzd_id="+ls_new.id;
       $('#SendProduct').window({
			  title : "角色编辑",
			  iconCls:'icon-ext-05_41',
			  width : 750,
			  height : 330,
			  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_sfsym = document.all.item("delm"+ls_new.id).innerHTML;
      var ls_sfsyu = document.all.item("delu"+ls_new.id).innerHTML;
      var ls_xh = document.getElementById(ls_new.id + "value");
      if(trim(ls_sfsym)=="已用" || trim(ls_sfsyu)=="已用"){
       $.messager.alert('提示','第'+ls_xh.innerHTML+'条记录已在使用中,不能删除!','info');
      }else{
         $.messager.confirm('提示', '确定删除第'+ls_xh.innerHTML+'条记录?', function(r) {
		if (r) {
           window.location="groups_delete?pageNo="+page+"&pageSize="+pageSize+"&myzd_id="+ls_new.id;
         }
         });
      }
     }
    }
    function g_preview(){
     
    }
    function g_refresh(){
     //document.body.execCommand('Refresh');
     window.location="groups_grid?pageNo="+page+"&pageSize="+pageSize;
    }
    function g_save(){
     alert('g_save');
    }
    function g_return(){
     
    }
    
    function g_groupCmodule(){
      if(ls_new!=null){
    	  var modifyUrl = gaowj.WEB_APP_NAME+"/groupChoiceModule?myzd_id="+ls_new.id;
    	  $('#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 : '正在加载数据，请稍等片刻......'
           });
		}
	}
	function g_groupCuser() {
		if (ls_new != null) {
			var modifyUrl = gaowj.WEB_APP_NAME+ "/groupChoiceLinguser?myzd_id=" + ls_new.id;
			$('#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 : '正在加载数据，请稍等片刻......'
           });
		}
	}
			function g_userCuser() {
				parent.frames["main"].g_userCuser();
			}
		</script>
  <script type="text/javascript" src="<%=request.getContextPath() %>/js/openwindow.js"></script>
</html>
