/** * 报告期下拉切换:按 data-url 模板与 data-date-format 生成目标地址。 */ (function ($) { 'use strict'; $(document).on('change', '.js-period-select', function () { var template = $(this).attr('data-url'); if (!template) { return; } var value = String(this.value); if ($(this).attr('data-date-format') === 'yyyyMMdd') { value = value.replace(/-/g, ''); } location = template.replace('{date}', value); }); }(jQuery));