Files
MES/app/views/layouts/station_footer.php
T
2026-08-08 18:28:49 +08:00

174 lines
6.6 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
// 防御性检查:防止 footer 被重复 include
if (!empty($GLOBALS['_station_footer_rendered'])) {
error_log('[station_footer] WARNING: Already rendered, skipping duplicate include.');
return;
}
$GLOBALS['_station_footer_rendered'] = true;
?><div class="footer">
&copy;2026深圳市云创芯电子有限公司版权所有
<br><span class="beian">备案号:<a href="https://beian.miit.gov.cn/" target="_blank" rel="noopener">粤ICP备16118477号-1</a></span>
<br><span class="beian">公安网备:<a href="https://beian.mps.gov.cn/#/query/webSearch?code=44030002015390" target="_blank" rel="noopener" style="display:inline-flex;align-items:center;gap:4px;"><img src="<?php echo BASE_URL; ?>/static/images/gongan_badge.png" width="16" height="17" alt="公安网备" loading="lazy" style="vertical-align:middle;" onerror="this.onerror=null;this.outerHTML='<svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;16&quot; height=&quot;17&quot; viewBox=&quot;0 0 24 24&quot;><path d=&quot;M12 2l8 3v6c0 5-4 9-8 11-4-2-8-6-8-11V5l8-3z&quot; fill=&quot;#1a3a8f&quot; stroke=&quot;#d4af37&quot; stroke-width=&quot;1&quot;/><polygon points=&quot;12,7 13.5,10.5 17,10.5 14,12.8 15,16.5 12,14.5 9,16.5 10,12.8 7,10.5 10.5,10.5&quot; fill=&quot;#ffffff&quot;/></svg>'">粤公网安备44030002015390号</a></span>
</div>
<script>
// ========== 实时时钟 ==========
function updateClock() {
var now = new Date();
var str = now.getFullYear() + '-' +
String(now.getMonth() + 1).padStart(2, '0') + '-' +
String(now.getDate()).padStart(2, '0') + ' ' +
String(now.getHours()).padStart(2, '0') + ':' +
String(now.getMinutes()).padStart(2, '0') + ':' +
String(now.getSeconds()).padStart(2, '0');
var el = document.getElementById('liveClock');
if (el) el.textContent = str;
}
setInterval(updateClock, 1000);
updateClock();
// ========== 工位网格列数调节(Front/index ==========
(function() {
var $grid = $('#stationGrid');
if (!$grid.length) return;
var COL_KEY = 'station_grid_cols';
function applyColumns(cols) {
$grid.attr('data-columns', cols);
$('.column-adjuster .col-btn').removeClass('active');
$('.column-adjuster .col-btn[data-cols="' + cols + '"]').addClass('active');
try { localStorage.setItem(COL_KEY, cols); } catch(e) {}
}
var savedCols = localStorage.getItem(COL_KEY) || 'auto';
applyColumns(savedCols);
$('.column-adjuster .col-btn').click(function() {
applyColumns($(this).data('cols'));
});
})();
// ========== 表格列选择器 ==========
(function() {
var STORAGE_PREFIX = 'table_cols_';
function initColSelector(pageKey, allCols) {
var $dropdown = $('#colDropdown_' + pageKey);
var $btn = $('#colSelectBtn_' + pageKey);
if (!$dropdown.length || !$btn.length) return;
var storageKey = STORAGE_PREFIX + pageKey;
var defaultVisible = {};
allCols.forEach(function(c) { defaultVisible[c.key] = true; });
// 读取保存的偏好
var saved = null;
try { saved = JSON.parse(localStorage.getItem(storageKey)); } catch(e) {}
function getVisible() {
if (saved && typeof saved === 'object') {
var merged = {};
allCols.forEach(function(c) {
merged[c.key] = (saved[c.key] !== undefined) ? saved[c.key] : true;
});
return merged;
}
return $.extend({}, defaultVisible);
}
function saveVisible(visible) {
try { localStorage.setItem(storageKey, JSON.stringify(visible)); } catch(e) {}
}
function applyVisible(visible) {
// 更新表头
$('table.table thead th').each(function() {
var col = $(this).data('col');
if (col && visible[col] === false) {
$(this).addClass('col-hidden');
} else {
$(this).removeClass('col-hidden');
}
});
// 更新表体
$('table.table tbody td').each(function() {
var col = $(this).data('col');
if (col && visible[col] === false) {
$(this).addClass('col-hidden');
} else {
$(this).removeClass('col-hidden');
}
});
// 更新复选框状态
$dropdown.find('.col-check-item').each(function() {
var col = $(this).data('col');
$(this).prop('checked', visible[col] !== false);
});
$dropdown.find('.col-check-all').prop('checked',
allCols.every(function(c) { return visible[c.key] !== false; })
);
}
function refreshUI() {
var visible = getVisible();
applyVisible(visible);
}
// 初始化
refreshUI();
// 全选/取消全选
$dropdown.find('.col-check-all').on('change', function() {
var checked = $(this).prop('checked');
var visible = getVisible();
allCols.forEach(function(c) { visible[c.key] = checked; });
saveVisible(visible);
applyVisible(visible);
});
// 单项切换
$dropdown.find('.col-check-item').on('change', function() {
var col = $(this).data('col');
var checked = $(this).prop('checked');
var visible = getVisible();
visible[col] = checked;
saveVisible(visible);
applyVisible(visible);
});
// 恢复默认
$dropdown.find('.col-reset-btn').on('click', function() {
var visible = $.extend({}, defaultVisible);
saveVisible(visible);
applyVisible(visible);
});
// 按钮点击切换面板显示
$btn.on('click', function(e) {
e.stopPropagation();
$dropdown.toggle();
});
// 点击面板外部关闭
$(document).on('click', function(e) {
if (!$btn.is(e.target) && $btn.has(e.target).length === 0 &&
!$dropdown.is(e.target) && $dropdown.has(e.target).length === 0) {
$dropdown.hide();
}
});
}
// 处理队列中的列选择器初始化(延迟到 DOM 完全就绪)
$(function() {
if (window._colSelectorQueue && window._colSelectorQueue.length) {
window._colSelectorQueue.forEach(function(item) {
initColSelector(item.pageKey, item.cols);
});
window._colSelectorQueue = [];
}
});
})();
</script>
</body>
</html>