美化表格

This commit is contained in:
2026-07-14 14:39:38 +08:00
parent ccc041604a
commit fdd232989b
7 changed files with 356 additions and 49 deletions

View File

@@ -80,6 +80,11 @@ function showCreateModal() {
loadFields();
initTimePeriodEditor();
clearAllTimePeriods();
// 重置月度总计开关
const showMonthlyTotalCheckbox = document.getElementById('show-monthly-total');
if (showMonthlyTotalCheckbox) showMonthlyTotalCheckbox.checked = false;
document.getElementById('config-modal').classList.add('active');
}
@@ -469,6 +474,9 @@ async function saveConfig() {
// 获取合并特来电配置
const mergeTelecom = document.getElementById('merge-telecom')?.checked || false;
const telecomVehicleNo = document.getElementById('telecom-vehicle-no')?.value.trim() || '';
// 获取月度总计开关
const showMonthlyTotal = document.getElementById('show-monthly-total')?.checked || false;
if (!configName || !splitType || !splitValue) {
alert('请填写所有必填字段');
@@ -508,7 +516,8 @@ async function saveConfig() {
time_periods: timePeriods,
merge_telecom: mergeTelecom,
telecom_vehicle_no: telecomVehicleNo,
field_custom_names: fieldCustomNamesData
field_custom_names: fieldCustomNamesData,
show_monthly_total: showMonthlyTotal
};
try {
@@ -583,6 +592,12 @@ async function editConfig(configId) {
telecomVehicleNoInput.value = config.telecom_vehicle_no || '';
}
// 加载月度总计开关
const showMonthlyTotalCheckbox = document.getElementById('show-monthly-total');
if (showMonthlyTotalCheckbox) {
showMonthlyTotalCheckbox.checked = config.show_monthly_total === 1 || config.show_monthly_total === true;
}
document.getElementById('config-modal').classList.add('active');
}
}