fix: 修复配置管理页面多个DOM元素ID不匹配和缺失函数问题
Coze-Commit-Type: user Coze-User-ID: 3722323274763196 Coze-Conversation-ID: 9894087
This commit is contained in:
@@ -104,7 +104,7 @@ const SUMMABLE_FIELD_KEYS = [
|
||||
|
||||
// 渲染字段列表
|
||||
function renderFields(selectedFields = [], sumFields = []) {
|
||||
const fieldsList = document.getElementById('fields-list');
|
||||
const fieldsList = document.getElementById('field-list');
|
||||
const sumFieldsList = document.getElementById('sum-fields-list');
|
||||
|
||||
fieldsList.innerHTML = allFields.map(field => {
|
||||
@@ -145,7 +145,7 @@ function onFieldCheckboxChange(cb) {
|
||||
const item = cb.closest('.checkbox-item');
|
||||
if (item) item.classList.toggle('checked', cb.checked);
|
||||
|
||||
const fieldsList = document.getElementById('fields-list');
|
||||
const fieldsList = document.getElementById('field-list');
|
||||
const checkedFields = Array.from(fieldsList.querySelectorAll('input:checked')).map(c => c.value);
|
||||
|
||||
// 保留当前求和字段的选择状态
|
||||
@@ -161,7 +161,7 @@ let fieldCustomNames = {};
|
||||
|
||||
// 刷新已选字段顺序列表
|
||||
function refreshSelectedFieldsOrder(selectedFields, customNames = null) {
|
||||
const orderGroup = document.getElementById('selected-fields-order-group');
|
||||
const orderGroup = document.getElementById('field-order-section');
|
||||
const orderList = document.getElementById('selected-fields-order');
|
||||
if (!orderList) return;
|
||||
|
||||
@@ -397,7 +397,7 @@ function updateCellDisplay(hour, periodKey) {
|
||||
|
||||
// 更新时段摘要
|
||||
function updateTimePeriodSummary() {
|
||||
const summaryEl = document.getElementById('tp-summary');
|
||||
const summaryEl = document.getElementById('time-period-summary');
|
||||
const parts = TIME_PERIODS.map(p => {
|
||||
const hours = timePeriodConfig[p.key];
|
||||
const count = hours.length;
|
||||
@@ -832,3 +832,13 @@ function setDefaultTimePeriods() {
|
||||
};
|
||||
updateTimePeriodSummary();
|
||||
}
|
||||
|
||||
// 拆分方式改变时加载实体列表
|
||||
function onSplitTypeChange() {
|
||||
const splitType = document.getElementById('split-type').value;
|
||||
if (splitType) {
|
||||
loadEntities(1, '');
|
||||
} else {
|
||||
document.getElementById('entity-list').innerHTML = '<div class="empty">请先选择拆分方式</div>';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -171,3 +171,11 @@ function onSplitTypeChange() {
|
||||
selectedEntityIds.clear();
|
||||
loadEntities(1, '');
|
||||
}
|
||||
|
||||
// 处理搜索框回车事件
|
||||
function handleSearchEnter(event) {
|
||||
if (event.key === 'Enter') {
|
||||
const search = document.getElementById('entity-search').value;
|
||||
loadEntities(1, search);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -222,3 +222,12 @@ async function loadHistoryWithDate(page, startDate, endDate) {
|
||||
// 初始化
|
||||
loadConfigs();
|
||||
loadFields();
|
||||
|
||||
// 全选/取消全选历史记录
|
||||
function toggleSelectAllHistory() {
|
||||
const selectAllCheckbox = document.getElementById('select-all-history');
|
||||
const checkboxes = document.querySelectorAll('#history-list input[type="checkbox"]');
|
||||
checkboxes.forEach(cb => {
|
||||
cb.checked = selectAllCheckbox.checked;
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user