<%@ page contentType="text/html; charset=GBK" %>
<%@ page import = "zr.zrpower.common.util.SysPreperty" %>
<%@ page import = "zr.zrpower.entity.sys.SessionUser" %>
<%@ page import = "zr.zrpower.ejb.sys.UIService" %>
<%@ page import = "zr.zrpower.flowengine.mode.base.Package"%>
<%@ page import = "zr.zrpower.flowengine.service.FlowSetup"%>
<%@ page import = "zr.zrpower.flowengine.service.FlowControl"%>
<%@ page import = "zr.zrpower.ejb.sys.UserService"%>
<%@ page import = "zr.zrpower.entity.sys.BPIP_USER"%>

<%@ page import = "zr.zrpower.common.util.DateWork" %>
<%@ page import = "java.lang.Object"%>

<HTML>
<%
SessionUser user = (SessionUser)session.getAttribute("userinfo");
UIService userUI =new UIService();
DateWork dw=new DateWork();
Package[] FlowPk = null;
FlowSetup FlowPackage= new FlowSetup();
FlowControl FControl = new FlowControl();
UserService name=new UserService();


int intPageSize;
intPageSize = user.getUserPageSize();
String strFID = request.getParameter("FID");
if (strFID ==null)
{strFID = "";}



/**得到查询的记录
/*枚举值1
*/
      FlowPk = FlowPackage.GetFlowPackageList2(strFID);


      String strshow_data ="";
      String strDate = "";
      if (FlowPk!=null && FlowPk.length>0){
        strshow_data = strshow_data + "[";
        for(int i=0;i<FlowPk.length;i++){
          strshow_data = strshow_data + "[";
          strshow_data = strshow_data + "\""+FlowPk[i].getID()+"\",";
          strshow_data = strshow_data + "\""+FlowPk[i].getIDENTIFICATION()+"\",";
          strshow_data = strshow_data + "\""+FlowPk[i].getNAME()+"\",";

          strDate = String.valueOf(FlowPk[i].getCREATEDATE());
          if (strDate==null){strDate="";}
          if (strDate.length()>10)
          {
             strDate = strDate.substring(0,10);
          }

          if (i < FlowPk.length-1 )
          {
             strshow_data = strshow_data + "\""+strDate+"\"],\r\n";
          }else
          {
             strshow_data = strshow_data + "\""+strDate+"\"]";
          }
        }

        strshow_data = strshow_data + "]";
        }else
        {
          strshow_data = "null";
        }


%>
<HTML>
<HEAD>
<TITLE></TITLE>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META http-equiv="Content-Type" content="text/html; charset=GBK">
<LINK type="text/css" rel="stylesheet" href="../../../zrsysmanage/css/<%=user.getUserCSS()%>">

<SCRIPT LANGUAGE="JavaScript" src="../../js/Workflow.js"></SCRIPT>

<link rel="stylesheet" type="text/css" media="all" href="../../../ZrwebGui/sigma_grid/grid/calendar/calendar-blue.css">
<script type="text/javascript" src="../../../ZrwebGui/sigma_grid/grid/calendar/calendar.js"></script>
<script type="text/javascript" src="../../../ZrwebGui/sigma_grid/grid/calendar/calendar-setup.js"></script>
<link rel="stylesheet" type="text/css" href="../../../ZrwebGui/sigma_grid/grid/gt_grid.css">
<link rel="stylesheet" type="text/css" href="../../../ZrwebGui/sigma_grid/grid/skin/vista/skinstyle.css">
<link rel="stylesheet" type="text/css" href="../../../ZrwebGui/sigma_grid/grid/skin/pink/skinstyle.css">
<link rel="stylesheet" type="text/css" href="../../../ZrwebGui/sigma_grid/grid/skin/mac/skinstyle.css">
<script type="text/javascript" src="../../../ZrwebGui/sigma_grid/grid/gt_msg_en.js"></script>
<script type="text/javascript" src="../../../ZrwebGui/sigma_grid/grid/gt_const.js"></script>
<script type="text/javascript" src="../../../ZrwebGui/sigma_grid/grid/gt_grid_all.js"></script>

<SCRIPT LANGUAGE="JavaScript" src="../../../zrsysmanage/script/Public.js"></SCRIPT>
<LINK type="text/css" rel="stylesheet" href="../../../zrsysmanage/html5/css/style_tables.css">
<SCRIPT LANGUAGE="JavaScript" src="../../../zrsysmanage/html5/script/jquery-2.0.3.min.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" src="../../../zrsysmanage/html5/layer/layer.js"></SCRIPT>
<SCRIPT language=jscript src="../../js/ControlPackage.js"></SCRIPT>

<script type="text/javascript" >
var css = "<%=user.getUserCSS()%>";
var skincss = "vista";

if (css=="Blue.css")
{skincss = "vista";}
if (css=="Public.css")
{skincss = "default";}
if (css=="Window.css" || css=="nBlue.css")
{skincss = "mac";}
if (css=="Yellow.css")
{skincss = "pink";}


var grid_demo_id = "myGrid1" ;
var show_data= <%=strshow_data%>;

var dsOption= {

	fields :[
		{name : 'NAME1'  },
		{name : 'NAME2'  },
		{name : 'NAME3'  },
		{name : 'NAME4'  }
	],

	recordType : 'array',
	data : show_data
}



var colsOption = [
           {id: 'NAME1' , header: "<center>流程包ID</center>" , width :80 , align : 'center'  },
           {id: 'NAME2' , header: "<center>流程包标识</center>" , width :100,  align : 'center'  },
	   {id: 'NAME3' , header: "<center>流程包名称</center>" , width :300 ,align : 'center'  },
	   {id: 'NAME4' , header: "<center>创建日期</center>" , width :120 , align : 'center'   }
];


var gridOption={
	id : grid_demo_id,
	width: "99%",
	height: "92%",
	container : 'gridbox',
	replaceContainer : true,
	dataset : dsOption ,
	columns : colsOption,
	pageSize : 2000,
	toolbarContent : null,
        skin : skincss,

        onCellDblClick:function(value, record , cell, row,  colNO, rowNO,columnObj,grid){
           OpenFlow();
        },

       showIndexColumn : true
};

<%if(!user.getUserWINDOWTYPE().equals("6")){%>
var mygrid=new Sigma.Grid( gridOption );
Sigma.Util.onLoad( Sigma.Grid.render(mygrid));
<%}%>

</script>



</HEAD>
<BODY class="BodyMain">
<form name="recordfrm" action="PackageList1.jsp">
<input type="hidden" id="selectID" name="selectID" value="">
<input type="hidden" name="CSSTYPE" value="<%=user.getUserWINDOWTYPE()%>">

<%if(user.getUserWINDOWTYPE().equals("6")){ %>

  <div id="mianRole" style="height: 90%;overflow: auto;">
  <table class="bordered" id="html5_table">

<thead>
<tr>
<th style="width:20%;">流程包ID</th>
<th style="width:20%;">流程包标识</th>
<th style="width:40%;">流程包名称</th>
<th style="width:20%;">创建日期</th>
</tr>
</thead>

<%
  if (FlowPk!=null && FlowPk.length>0){
        for(int i=0;i<FlowPk.length;i++){
          strshow_data = strshow_data + "\""+FlowPk[i].getID()+"\",";
          strshow_data = strshow_data + "\""+FlowPk[i].getIDENTIFICATION()+"\",";
          strshow_data = strshow_data + "\""+FlowPk[i].getNAME()+"\",";

          strDate = String.valueOf(FlowPk[i].getCREATEDATE());
          if (strDate==null){strDate="";}
          if (strDate.length()>10)
          {
             strDate = strDate.substring(0,10);
          }
%>
        <tr  ondblclick="OpenFlow();" onclick="click_color(this,'<%=FlowPk[i].getID()%>');">
        <td style="text-align:center;"><%=FlowPk[i].getID()%></td>
        <td style="text-align:center;"><%=FlowPk[i].getIDENTIFICATION()%></td>
        <td style="text-align:center;"><%=FlowPk[i].getNAME()%></td>
        <td style="text-align:center;"><%=strDate%></td>
        </tr>

<%
        }
 }
%>

</table>
<br>
</div>

<%}else{%>


<div id="gridbox" style="border:0px solid #cccccc;background-color:#f3f3f3;padding:5px;height:200px;width:700px;" ></div>

<%}%>

 <form>
</BODY>
<script language="JavaScript" type="text/JavaScript">
<!--
var allvalue="";
function clickValue(value){
    allvalue=value;
}
function AddPackage(){
    var url="../Other/PackageAdd.jsp";
    OpenSetup(url);
}
function OpenFlow(){
    <%if(user.getUserWINDOWTYPE().equals("6")){ %>
     var strID = allvalue;

   <%}else{%>
     var allvalue = mygrid.getSelectedRecords()+",0";
     var strID = allvalue.split(",")[0];
   <%}%>
    parent.location.href="../FlowProcess/openIs.jsp?ID="+strID;
}
function EditPackage(){
    var strID = allvalue;
    var url="../Other/PackageEdit.jsp?SelectedItems="+strID;
    <%if(user.getUserWINDOWTYPE().equals("6")){ %>

      if (strID=="" || strID.length==0)
      {
        layer.alert('请先选择流程分类！', {icon: 7});
      }else
      {
        OpenSetup(url);
      }

   <%}else{%>
     var allvalue = mygrid.getSelectedRecords()+",0";
     var strID = allvalue.split(",")[0];
     OpenSetup(url);
   <%}%>

}
//--
</script>
</HTML>
<%
//清空相关对象
user = null;
userUI = null;
FlowPk = null;
FlowPackage = null;
FControl = null;
name = null;
%>
