// 报表项目页外层（仅包含头部）
// 因为调用的apicloud的刷新组件只能刷新整个页面，
//所以将所有要进行刷新的页面分成两部分
apiready = function() {
	var ctrl = {
		init : {},
		bind : {},
	};
	ctrl.init = function() {
		// 适配安卓状态栏
		CommonModel.fitInStatusBar();
		ctrl.bind();
	}
	ctrl.bind = function() {
		//点击返回按钮
		$api.addEvt($api.dom("#back"), "touchend", function() {
			api.closeWin();
		})
		//打开frame
		var time = api.pageParam.time; // 当前报表的时间

		//计算frame显示的位置和尺寸
		var windowWidth = parseInt($api.cssVal($api.dom("body"), "width"));
		var windowHeight = parseInt($api.cssVal($api.dom("body"), "height"));
		var headerHeight = parseInt($api.cssVal($api.dom("#header"), "height"));
		var frameX = 0;
		var frameY = headerHeight;
		var frameWidth = windowWidth;
		var frameHeight = windowHeight - headerHeight;
		api.openFrame({
			name: 'reportProjectFrame',
			url: './reportProjectFrame.html',
			rect: {
				x: frameX,
				y: frameY,
				w: frameWidth,
				h: frameHeight
			},
			scaleEnabled:true,
			pageParam: {
					time: time
			}
	});

	}
	ctrl.init();

}
