初始化

This commit is contained in:
2026-08-08 18:28:49 +08:00
parent 9bef4420e0
commit f082037a6e
854 changed files with 217171 additions and 11 deletions
+19
View File
@@ -0,0 +1,19 @@
// admin_config.js — 系统配置页:序列号前缀规则 增/删 行交互
// 由 app/views/Admin/config.php 以 nonce 方式加载(配合 CSP script-src 'nonce-***'
// 注意:本文件由外部引入,不再依赖 'unsafe-inline'。
$(function () {
// 添加前缀规则行
$('#addPrefixRow').click(function () {
var row = '<div class="prefix-rule-row" style="display:flex; gap:10px; margin-bottom:8px; align-items:center;">' +
'<input type="text" name="prefix_types[]" class="form-control" style="flex:1;" placeholder="产品类型(如:成品、电芯、PCBA">' +
'<input type="text" name="prefix_values[]" class="form-control" style="width:120px;" placeholder="前缀(如:CP">' +
'<button type="button" class="btn btn-danger btn-sm remove-prefix-row" title="删除"><i class="fa fa-trash"></i></button>' +
'</div>';
$('#prefixRulesContainer').append(row);
});
// 删除前缀规则行(事件委托)
$('#prefixRulesContainer').on('click', '.remove-prefix-row', function () {
$(this).closest('.prefix-rule-row').remove();
});
});