invoiceModule.directive('outputReconciliationConfiguration', ['$log',
    function ($log) {
        return {
            restrict: 'E',
            templateUrl: '/app/vat/output-invoice/outputReconciliationConfiguration/output-reconciliation-configuration.html' + '?_=' + Math.random(),
            replace: true,
            scope: {},
            controller: 'outputReconciliationConfigurationController',
            link: function (scope, element, attr) {


                //计算datagrid的高度
                scope.setInvoiceGridHeight = function () {
                    var pageHeight = $(document).height();
                    //var smallTitleHeight = $('#litterTitle').outerHeight();
                    var topTitleHeight = $('.menu-header').outerHeight();
                    //var pageSearchHeight = $('.query-panel').outerHeight();
                    //var pageFastSearchHeight = $('.action-row').outerHeight();
                    ////var dataGridLineHeight = $('.grid-container .prompt-line').outerHeight();
                    //var dataGridPagerHeight = $('.page-footer').outerHeight();
                    //if (dataGridPagerHeight === 0) dataGridPagerHeight = 60;
                    //var subHeight = pageHeight - topTitleHeight - pageSearchHeight - pageFastSearchHeight - dataGridPagerHeight;
                    //scope.height = subHeight - 50;
                    var containerHeight = $('.content-container').outerHeight();
                    if (containerHeight === 0) dataGridPagerHeight = 660;
                    scope.gridTable = containerHeight - 30;
                    try {

                        $('#reconciliation-grid').dxDataGrid('instance').repaint();
                    }
                    catch (e) {
                        console.log(e);
                    }
                };

                $(window).on('resize', function () {
                    scope.setInvoiceGridHeight();
                });
            }
        }
    }]);