list.jsp 5.64 KB
<%@ page contentType="text/html; charset=UTF-8"%>
<%@page import="weaver.formmode.service.AppInfoService"%>
<%@page import="weaver.formmode.service.CustomSearchService"%>
<%@page import="net.sf.json.JSONArray"%>
<%@ include file="/formmode/pub.jsp"%>

<%
int appId=Util.getIntValue(request.getParameter("appid"),0);
AppInfoService appInfoService=new AppInfoService();
Map<String, Object> appInfo = appInfoService.getAppInfoById(appId);
String treeFieldName = Util.null2String(appInfo.get("treefieldname"));
String treelevel = Util.null2String(appInfo.get("treelevel"));
int subCompanyId = Util.getIntValue(Util.null2String(appInfo.get("subcompanyid")),-1);
String userRightStr = "FORMMODEAPP:ALL";
Map rightMap = getCheckRightSubCompanyParam(userRightStr,user,fmdetachable, subCompanyId,"",request,response,session);
int operatelevel = Util.getIntValue(Util.null2String(rightMap.get("operatelevel")),-1);
subCompanyId = Util.getIntValue(Util.null2String(rightMap.get("subCompanyId")),-1);
String subCompanyId3 = ""+subCompanyId;
int currentSubCompanyId = Util.getIntValue(Util.null2String(rightMap.get("currentSubCompanyId")),-1);

CustomSearchService customSearchService=new CustomSearchService();
JSONArray customSearchData = new JSONArray();
if(fmdetachable.equals("1")){
	customSearchData = customSearchService.getCustomSearchByAppIdWithJSONDetach(appId,currentSubCompanyId);
}else{
	customSearchData = customSearchService.getCustomSearchByAppIdWithJSON(appId);
}

String titlename=SystemEnv.getHtmlLabelName(82065,user.getLanguage());//查询设置
%>
<html>
<head>
	<title></title>
	<link rel="stylesheet" type="text/css" href="/formmode/js/ext-3.4.1/resources/css/ext-all_wev8.css" />
	<script type="text/javascript" src="/formmode/js/ext-3.4.1/adapter/ext/ext-base_wev8.js"></script>
	<script type="text/javascript" src="/formmode/js/ext-3.4.1/ext-all_wev8.js"></script>
	<script type="text/javascript" src="/formmode/js/ext-3.4.1/ux/miframe_wev8.js"></script>
	
	<script type="text/javascript" src="/formmode/js/jquery/pagination/jquery.pagination_wev8.js"></script>
	<script type="text/javascript" src="/formmode/js/jquery/hoverIntent/jquery.hoverIntent.minified_wev8.js"></script>
	
	<link rel="stylesheet" href="/formmode/js/jquery/zTree3.5.15/css/zTreeStyle/zTreeStyle_wev8.css" type="text/css">
	<script type="text/javascript" src="/formmode/js/jquery/zTree3.5.15/js/jquery.ztree.all-3.5.min_wev8.js"></script>
	
	<link rel="stylesheet" type="text/css" href="/formmode/css/leftPartTemplate_wev8.css" />
	<script type="text/javascript" src="/formmode/js/leftPartTemplate_wev8.js"></script>
	<link rel="stylesheet" href="/wui/theme/ecology8/jquery/js/e8_zDialog_btn_wev8.css" type="text/css" />
	
	
	<script type="text/javascript">
	
		var datas = <%=customSearchData.toString()%>;
		
		var currentDatas;
		
		var currCustomSearchId = null;
		
		$(document).ready(function () {
			
			currCustomSearchId = FormmodeUtil.getLastId(FormModeConstant._CURRENT_CUSTOMSEARCH, datas, "id");
			currPageIndex = FormmodeUtil.getLastIdPageIndex(currCustomSearchId,datas,"id",pageSize);
			
			//去掉左菜单边框
			try{
				top.document.getElementById("leftmenuTD").style.borderRight = "#e6e6e6 1px solid";
			}catch(e){}
			
			var leftPanel = new Ext.Panel({
				contentEl: "leftPart",
				header: false,
				region: "west",
				width:250,
				border: false,
            	split:true,
            	collapsible: true,
           		collapsed : false
			});
			
			var url = "";
			//if(currCustomSearchId != null){
				url = "/formmode/setup/customSearchInfo.jsp?id="+currCustomSearchId+"&appid=<%=appId%>";
			//}
			

			
			initSearchText(onSearchTextChange);
			
			currentDatas = datas;
			doSearchTextChange();

		});

		function doSearchTextChange(){
			var st = $(".e8_searchText").val();
			onSearchTextChange(st);
		}
		
		var srarchData;
		function onSearchTextChange(text){
			text = text.toLowerCase();
			if(text == ""){
				srarchData = currentDatas;
			}else{
				srarchData = [];
				for(var i = 0; i < currentDatas.length; i++){
					if(currentDatas[i].customname.toLowerCase().indexOf(text) != -1 || currentDatas[i].customdesc.toLowerCase().indexOf(text) != -1){
						srarchData.push(currentDatas[i]);
					}
				}
			}
			doPagination(srarchData, pagedDataRender);
		}
		
		function changeRightFrameUrl(id){
            var $AElement = $("#A_" + id);
            var $li = $AElement.parent();
            $li.siblings().removeClass("selected");
            $li.addClass("selected");
            var type = window.parent.tabs;
            var list = window.parent.document.getElementById("indexFrame");
            $(list).attr('src','/formmode/charts/index.jsp?customid='+id+"&type="+type);
		}


		function pagedDataRender(data){
			return "<a id=\"A_"+data["id"]+"\" href=\"javascript:void(0);\" onclick=\"javascript:changeRightFrameUrl("+data["id"]+",this);\">" +
						"<div class=\"e8_data_label\">"+data["customname"]+"</div>" +
                		"<div class=\"e8_data_label2\">"+data["customdesc"]+"</div>" +
					"</a>";
		}




	</script>
</head>
  
<body>
	<%@ include file="/systeminfo/TopTitle_wev8.jsp" %>
	<%@ include file="/systeminfo/RightClickMenuConent_wev8.jsp" %>

	<%@ include file="/formmode/setup/leftPartTemplate.jsp" %>

	<%@ include file="/systeminfo/RightClickMenu_wev8.jsp" %>
</body>
<script type="text/javascript">
window.onload = function (){
	//changePageMenuDiaplay(1);
}

</script>
<style type="text/css">
	.pagination{
		text-align: left !important;
	}
	#leftPart{
		background-color: #fff !important;
	}
	.e8_left_center ul li{
		/*border-bottom: 1px solid #dad8d8;*/
	}
	.e8_left_center ul li a{
		/*border-bottom: none;*/
	}
	.e8_left_center ul li a .e8_data_label{
		line-height: 25px;
	}

</style>

</html>