PageSourceSearch

https://erus.ru/Areas/JR/Content/js/jr.report.result.js

js erus.ru collected 2026-10-07 19:35:38 UTC 2,498 bytes, 73 lines download raw bytes

1(function($)
2{
3	$.ETC = $.ETC || {};
4	$.ETC.JR = $.ETC.JR || {};
5	// Ожидание выполнения отчёта с обновлением грида
6	$.ETC.JR.RefreshResult = function(frm, args)
7	{
8		stateUrl = args.StateUrl;	// url возвращающий текущее состояние отчёта
9		_frm = frm;
10		executionVersion = args.ExecutionVersion;	// версия отчёта, в которой он выполняется
11		resultUrl = args.ResultUrl;	// url показывающий результат отчёта без динамического обновления
12		progressBar = $('<tr class="executing_report"><td colspan="2">' +
13			'<span class="loading"><div class="progress"></div></span><div class="executing_indicator"></div></td></tr>');
14		frm.container.find('table.values').prepend(progressBar);
15		refreshPeriod = 2000;
16		setTimeout(waitRefresh, refreshPeriod);
17	}
18
19	var _frm;
20	var stateUrl;
21	var executionVersion;
22	var resultUrl;
23	var refreshPeriod;
24	var progressBar;
25
26	function waitRefresh()
27	{
28		refreshPeriod += 1000;
29		$.ajax({
30			url: stateUrl,
31			type: 'post',
32			success: function(data)
33			{
34				var progressMessage = data.ProgressMessage == null ? '' : data.ProgressMessage;
35				$('.executing_indicator', progressBar).text(progressMessage);
36				updateGrid();
37
38				if (data.Version == 0)
39				{
40					$('.loading', progressBar).remove();
41					$.Dm.Notify('Отчёт не найден. Запустите отчёт на выполнение ещё раз.');
42				}
43				else if (data.Version <= executionVersion)
44				{
45					setTimeout(waitRefresh, refreshPeriod);
46				}
47				else if (data.Version > executionVersion)
48				{
49					progressBar.remove();
50					if (data.ModelState == "Ready")
51						$.Dm.Notify("Отчёт сформирован");
52					else // произошла ошибка, необходимо показать formModel.Messages.Errors
53						$.Dm.AjaxNav.go(resultUrl);
54				}
55			},
56			error: function(jqhxr, status, message)
57			{
58				$('.loading', progressBar).remove();
59				$('.executing_indicator', progressBar).text('Обновите страницу. Ajax статуc: ' + status +', ' + message);
60			}
61		});
62	}
63
64	function updateGrid()
65	{
66		var gridDiv = _frm.container.find('.dataContent');
67		var updateUrl = gridDiv.find("table").data('updateurl').main;
68		$.get(updateUrl, function(gridHtml)
69		{
70			gridDiv.parent().html(gridHtml);
71		});
72	}
73})(jQuery);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.