invoiceModule.directive('issuedInvoiceBdView', ['$log', 'SweetAlert', '$translate',
    function ($log, SweetAlert, $translate) {
        'use strict';
        $log.debug('issuedInvoiceBdView.ctor()...');

        return {
            restrict: 'E',
            templateUrl: '/app/vat/output-invoice/issued-Invoice-Bd-View/issued-Invoice-Bd-View.html' + '?_=' + Math.random(),
            scope:
            {

            },
            controller: 'issuedInvoiceBdViewController',
            link: function (scope, element) {

                //计算datagrid的高度
                scope.setInvoiceGridHeight = function () {
                    var pageHeight = $(document).height();
                    var pageSearchHeight = $('.page-search-container').outerHeight();
                    var pageFastSearchHeight = $('.page-fast-search-container').outerHeight();
                    var dataGridPagerHeight = $('.page-footer').outerHeight();
                    var subHeight = pageHeight - pageSearchHeight - pageFastSearchHeight - dataGridPagerHeight;
                    scope.dataGridHeight = subHeight - 80;

                    try {
                        $('#dxIssuedInvoiceDataGridContainer').dxDataGrid('instance').repaint();
                    }
                    catch (e) {
                        console.log(e);
                    }
                };

                $(window).on('resize', function () {
                    scope.setInvoiceGridHeight();
                });
            }//# end of link
        };
    }
]);