countadd.html 2.19 KB
<!-- 统计数据 -->
<div class="modal fade" id="countadd_mobal" tabindex="-1" role="basic" aria-hidden="true">
	<div class="modal-dialog" style="margin-left: 400px;">
		<div class="modal-content" style="width: 700px;">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
				<h4 class="modal-title">统计数据 </h4>
			</div>
			<div class="modal-body">
				<div class="portlet-body">
					<div class="table-container" style="margin-top: 10px">
						<table class="table table-striped table-bordered table-hover table-checkable" id="datatable_countadd">
							<thead>
								<tr role="row" class="heading">
									<th width="1%">序号</th>
									<th width="45%">统计项目</th>
									<th width="15%">统计数值</th>
								</tr>
							</thead>
							<tbody></tbody>
						</table>
					</div>
				</div>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn default" data-dismiss="modal">关闭</button>
			</div>
        </div>
    </div>
</div>
<script type="text/html" id="countAdd_temp">
{{each list as obj i }}
	<tr role="row" class="filter">
		<td>{{i+1}}</td>
		<td>
			{{obj.name}}
		</td>
		<td style="vertical-align:middle; text-align:center;">
			{{if obj.name == '综合评估'}}
				<div id="star"></div>
			{{else}}
				{{obj.value}}
			{{/if}}
		</td>
	</tr>
{{/each}}
{{if list.length == 0}}
		<tr>
			<td colspan=3><h6 class="muted">没有找到相关数据</h6></td>
		</tr>
{{/if}}
</script>
<script type="text/javascript">
$('#countadd_mobal').on('countAddMobal.show', function(e,countDate){
	// 加载延迟200毫秒显示mobal
	setTimeout(function(){$('#countadd_mobal').modal({show : true,backdrop: 'static', keyboard: false});},200);
	// 当模态框对用户可见时触发(将等待 CSS 过渡效果完成)。
	$('#countadd_mobal').on('show.bs.modal', function () {
		// 把数据填充到模版中
		var tbodyHtml = template('countAdd_temp',{list:countDate});
		// 把渲染好的模版html文本追加到表格中
		$('#datatable_countadd tbody').html(tbodyHtml);
		$('#star').raty({ readOnly: true,score: 4.5 });
	});
});
</script>