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 = []) {
|
function renderFields(selectedFields = [], sumFields = []) {
|
||||||
const fieldsList = document.getElementById('fields-list');
|
const fieldsList = document.getElementById('field-list');
|
||||||
const sumFieldsList = document.getElementById('sum-fields-list');
|
const sumFieldsList = document.getElementById('sum-fields-list');
|
||||||
|
|
||||||
fieldsList.innerHTML = allFields.map(field => {
|
fieldsList.innerHTML = allFields.map(field => {
|
||||||
@@ -145,7 +145,7 @@ function onFieldCheckboxChange(cb) {
|
|||||||
const item = cb.closest('.checkbox-item');
|
const item = cb.closest('.checkbox-item');
|
||||||
if (item) item.classList.toggle('checked', cb.checked);
|
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);
|
const checkedFields = Array.from(fieldsList.querySelectorAll('input:checked')).map(c => c.value);
|
||||||
|
|
||||||
// 保留当前求和字段的选择状态
|
// 保留当前求和字段的选择状态
|
||||||
@@ -161,7 +161,7 @@ let fieldCustomNames = {};
|
|||||||
|
|
||||||
// 刷新已选字段顺序列表
|
// 刷新已选字段顺序列表
|
||||||
function refreshSelectedFieldsOrder(selectedFields, customNames = null) {
|
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');
|
const orderList = document.getElementById('selected-fields-order');
|
||||||
if (!orderList) return;
|
if (!orderList) return;
|
||||||
|
|
||||||
@@ -397,7 +397,7 @@ function updateCellDisplay(hour, periodKey) {
|
|||||||
|
|
||||||
// 更新时段摘要
|
// 更新时段摘要
|
||||||
function updateTimePeriodSummary() {
|
function updateTimePeriodSummary() {
|
||||||
const summaryEl = document.getElementById('tp-summary');
|
const summaryEl = document.getElementById('time-period-summary');
|
||||||
const parts = TIME_PERIODS.map(p => {
|
const parts = TIME_PERIODS.map(p => {
|
||||||
const hours = timePeriodConfig[p.key];
|
const hours = timePeriodConfig[p.key];
|
||||||
const count = hours.length;
|
const count = hours.length;
|
||||||
@@ -832,3 +832,13 @@ function setDefaultTimePeriods() {
|
|||||||
};
|
};
|
||||||
updateTimePeriodSummary();
|
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();
|
selectedEntityIds.clear();
|
||||||
loadEntities(1, '');
|
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();
|
loadConfigs();
|
||||||
loadFields();
|
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;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|||||||
@@ -195,7 +195,8 @@
|
|||||||
<button type="button" class="btn btn-sm" onclick="clearTimePeriods()">清空</button>
|
<button type="button" class="btn btn-sm" onclick="clearTimePeriods()">清空</button>
|
||||||
<button type="button" class="btn btn-sm" onclick="setDefaultTimePeriods()">默认配置</button>
|
<button type="button" class="btn btn-sm" onclick="setDefaultTimePeriods()">默认配置</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="time-period-grid" id="time-period-grid"></div>
|
<div id="tp-hours-row" style="display: grid; grid-template-columns: 60px repeat(24, 1fr); gap: 2px; margin-bottom: 10px;"></div>
|
||||||
|
<div id="tp-period-rows"></div>
|
||||||
<div class="time-period-summary" id="time-period-summary"></div>
|
<div class="time-period-summary" id="time-period-summary"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user