countadd.html
2.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<!-- 统计数据 -->
<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>