<!-- 设置计算式 -->
<div id="generate-data" class="modal" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title">选择需要对比造价文件</h5>
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
            </div>
            <div class="modal-body">
                <div class="modal-height-500-scroll">
                    <table class="table table-bordered">
                        <tr><th>造价文件</th><th>选择</th></tr>
                        <% if(libList.length > 0) { %>
                        <% libList.forEach(function(lib) { %>
                        <tr class="table-secondary" lib_id = "<%= lib.id %>"><td><%= lib.filename %></td><td><input type="checkbox"></td></tr>
                        <% }) %>
                        <% } %>
                    </table>
                </div>
            </div>
            <div class="modal-footer">
                <button class="btn btn-primary" id="generate-ok">确定</button>
                <button class="btn btn-secondary" data-dismiss="modal" aria-hidden="true">取消</button>
            </div>
        </div>
    </div>
</div>
<!-- JS. -->
<script type="text/javascript">
    $(document).ready(function () {
        $('#generate-data').modal('show');
        $('input[type=checkbox]').bind('click', function () {
            if (this.checked) {
                $(this).parent().parent().removeClass('table-secondary');
            } else {
                $(this).parent().parent().addClass('table-secondary');
            }
        });
    });
</script>