/**
 * 页面显示部件component
 * 包含模板和行为
 */

//快捷方式
var linkTemple = template(
	'<li><a href ="<%=url%>" class="appbtn widget-link" type="app" id="<%=id%>" appid="<%=appid%>" style="top:<%=top%>px;left:<%=left%>px">'+
		'<i class="widget-img widget-img-<%=clazz%>"></i><%=name%></a>'+
	'</li>'
);

//KPI
var kpiTemple = template(
	'<li><a href ="<%=url%>" class="appbtn <%=clazz%>" type="<%=type%>" id="<%=id%>" appid="<%=appid%>" style="top:<%=top%>px;left:<%=left%>px">'+
		'<%=name%></a>'+
	'</li>'
);
//运营部首页中间大图  波动监控分析模板 平行坐标图+简单表格
var operatotsTemple = template(
		'<div id="<%=id%>" appid="<%=appid%>" class="widget mid-content mid-widget mid-widget-<%=clazz%>" style="top:12%;left:25%">'+
		'<div class=""><a class="close">×</a><h3 class="title move">'+
		'<%=name%><span class="tip">(<%=recordDay%>)</span>'+
		'</h3></div>'+
		'<div class="zhibiao-content">'+
		'</div>'+
		'<div class="content-bottom">'+
		'</div>'+
		'</div>'
	);
/*
*   普通表格模板
*   参数结构如下：
*   {  
*       title: '图书情况一览',
*       more: { label: '查看详细数据' ,value:'/more/sdf.action'}    
*   }
*/
//运营部首页中间大图 表格tr
var operatotsTrTemple = template(
	'<tr>'+
		'<td><%=id%></td>'+
		'<td><%=recordDay%></td>'+
		'<td><%=pageUc%></td>'+
		'<td><%=orderUc%></td>'+
		'<td><p><span style="width:<%=ratio%>%;"><%=ratio%>%</span></p></td>'+
		'<td><p><span style="width:<%=pvRatio%>%;"><%=pvRatio%>%</span></p></td>'+
		'<td><%=sapackUc%></td>'+
	'</tr>'
);

//桌面右侧 spark widget 
var sparkWidgetTemp = template(
	'<div id="<%=id%>" appid="<%=appid%>" class="right-widget widget"> <div class=""><a class="close">×</a><h3 class="title move"> <%=name%><span class="tip">(<%=recordDay%>)</span></h3></div>'+
	'<div class="content component-spark"><div class="left spark" id="dashboard_<%=id%>"></div><div class="right"><div class="ratio-<%=ratioclazz%> right"><%=ratio%>%</div>'+
	'<div class="kpi"><%=data%></div></div><div class="clear"></div></div>'
);
//桌面右侧 dashbord widget 
var dashbordWidgetTemp = template(
	'<div id="<%=id%>" appid="<%=appid%>" class="right-widget widget"> <div class=""><a class="close">×</a><h3 class="title move"> <%=name%><span class="tip">(<%=recordDay%>)</span></h3></div>'+
	'<div class="content component-dashboard"><div class="dashboard" id="dashboard_<%=id%>"></div>'+
	'<div class="desc">  <%=name%>： <%=ratio%>% </div></div></div>'
);
//桌面右侧组件 hLinearGauge widget 
var hLinearGaugeWidgetTemp = template(
	'<div id="<%=id%>" appid="<%=appid%>" class="right-widget widget"> <div class=""><a class="close">×</a><h3 class="title move"> <%=name%><span class="tip">(<%=recordDay%>)</span></h3></div>'+
	'<div class="content component-HLinearGauge"><div class="HLinearGauge" id="HLinearGauge_<%=id%>"></div>'+
	'</div></div>'
);
//桌面右侧组件 子弹图 widget 
var hbulletWidgetTemp = template(
	'<div id="<%=id%>" appid="<%=appid%>" class="right-widget widget"> <div class=""><a class="close">×</a><h3 class="title move"><%=name%><span class="tip">(<%=recordDay%>)</span></h3></div>'+
	'<div class="content component-hbullet"><div class="hbullet" id="hbullet_<%=id%>"></div>'+
	'</div></div>'
);

//中间widget 流图
var pvAnalysisWidgetTemp = template(
	'<div id="<%=id%>" appid="<%=appid%>" class="widget mid-content mid-widget mid-widget-<%=clazz%>" style="top:12%;left:25%">'+
	'<div class=""><a class="close">×</a><h3 class="title move">'+
	'<%=name%><span class="tip">(<%=recordDay%>)</span>'+
	'</h3></div>'+
	'<div id="chart_<%=id%>" class="clearfix monitor-content">'+
	'</div></div>'	
);
//中间widget 访问用户分析，fusioncharts Combi2D+简单表格
var fcCom2DTableTemp = template(
		'<div id="<%=id%>" appid="<%=appid%>" class="widget mid-content mid-widget mid-widget-<%=clazz%>" style="top:12%;left:25%">'+
		'<div class=""><a class="close">×</a><h3 class="title move">'+
		'<%=name%><span class="tip">(<%=recordDay%>)</span>'+
		'</h3></div>'+
		'<div class="zhibiao-content">'+
		'</div>'+
		'<div class="content-bottom">'+
		'</div>'+
		'</div>'	
);
//修改密码对话框
var modifyPasswordTemp = template(
		'<div id="<%=id%>" appid="<%=appid%>" realappid="<%=realappid%>" type="<%=type%>" state="show" class="window-container" style="<% if(isopenmax){ %>width:100%;height:100%;left:0;top:0;<% }else{ %>width:<%=width%>px;height:<%=height%>px;top:<%=top%>px;left:<%=left%>px;<% } %>z-index:<%=zIndex%>" ismax="<% if(isopenmax){ %>1<% }else{ %>0<% } %>">'+
		'<div style="height:100%">'+
			'<div class="title-bar" style="background-image: -moz-linear-gradient(center top , #E8E8E8, #CECECE);">'+
				'<span class="title"><%=title%></span>'+
			'</div>'+
			'<div class="title-handle">'+
				'<a class="ha-close" btn="close" href="javascript:;" title="关闭" class="close guanbi">×</a>'+
			'</div>'+
			'<div class="window-frame">'+
				'<div class="window-mask window-mask-noflash"></div>'+
				'<div class="window-loading"></div>'+
				'<div class="container">'+
					'<%=html%>'+	
				'</div>'+
			'</div>'+
		'</div>'+
		'<% if(isresize){ %>'+
			'<div class="window-resize window-resize-t" resize="t"></div>'+
			'<div class="window-resize window-resize-r" resize="r"></div>'+
			'<div class="window-resize window-resize-b" resize="b"></div>'+
			'<div class="window-resize window-resize-l" resize="l"></div>'+
			'<div class="window-resize window-resize-rt" resize="rt"></div>'+
			'<div class="window-resize window-resize-rb" resize="rb"></div>'+
			'<div class="window-resize window-resize-lt" resize="lt"></div>'+
			'<div class="window-resize window-resize-lb" resize="lb"></div>'+
		'<% } %>'+
	'</div>'
);