HEL-230: 按确认样图通栏重排提醒管理页
页面改为待提醒清单 → 提醒历史 → 发送处理提醒三块通栏;发送区按样图做成三步横向流程,窄屏竖排,保留原发送与历史留痕能力。 Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
co-authored by
Cursor
multica-agent
parent
85e11a4f72
commit
f5e0915f63
+32
-5
@@ -1143,16 +1143,15 @@ function fillCompanySelects(names, companies) {
|
||||
if (reminderList && companies?.length) {
|
||||
reminderList.replaceChildren(...companies.map((company) => {
|
||||
const label = document.createElement("label");
|
||||
label.className = "row";
|
||||
label.style.cssText = "gap:6px;font-size:13px;";
|
||||
label.className = "pick";
|
||||
const input = document.createElement("input");
|
||||
input.type = "checkbox";
|
||||
input.name = "company";
|
||||
input.value = String(company.id);
|
||||
input.style.width = "auto";
|
||||
label.append(input, document.createTextNode(company.name));
|
||||
return label;
|
||||
}));
|
||||
syncPendingPicks();
|
||||
}
|
||||
setSelectOptions($('#openingDialog [name="from"]'), names);
|
||||
setSelectOptions($('#openingDialog [name="to"]'), names);
|
||||
@@ -1809,6 +1808,23 @@ function reminderStatusLabel(statusUi) {
|
||||
return { unread: "未读", doing: "处理中", done: "已完成" }[statusUi] || statusUi;
|
||||
}
|
||||
|
||||
function updatePickCount() {
|
||||
const countEl = $("#pick-count");
|
||||
if (!countEl) return;
|
||||
const n = $$('#reminderCompanyList input[name="company"]:checked').length;
|
||||
countEl.textContent = "已选 " + n + " 家";
|
||||
}
|
||||
|
||||
function syncPendingPicks() {
|
||||
$$(".pending-check:checked").forEach((input) => {
|
||||
const companyId = input.closest(".list-row")?.dataset.companyId;
|
||||
if (!companyId) return;
|
||||
const chip = document.querySelector('#reminderCompanyList input[name="company"][value="' + companyId + '"]');
|
||||
if (chip) chip.checked = true;
|
||||
});
|
||||
updatePickCount();
|
||||
}
|
||||
|
||||
async function loadAdminRemindersPending() {
|
||||
const list = $("#pending-list");
|
||||
const empty = $("#pending-empty");
|
||||
@@ -1839,6 +1855,7 @@ async function loadAdminRemindersPending() {
|
||||
const row = document.createElement("div");
|
||||
row.className = "list-row";
|
||||
row.dataset.dedupeKey = item.dedupe_key;
|
||||
row.dataset.companyId = String(item.company_id);
|
||||
const sentHint = item.send_count > 0 ? ` · 已提醒 ${item.send_count} 次` : "";
|
||||
row.innerHTML =
|
||||
'<label class="row" style="gap:6px;flex:none;"><input type="checkbox" class="pending-check" style="width:auto;" /></label>' +
|
||||
@@ -1994,8 +2011,17 @@ function initAdminReminders() {
|
||||
if (!event.target.classList.contains("pending-check")) return;
|
||||
const checked = $$(".pending-check:checked").length;
|
||||
const sendAll = $("#pending-send-all");
|
||||
if (!sendAll) return;
|
||||
sendAll.textContent = checked ? `发送选中(${checked})` : "全部一键发送";
|
||||
if (sendAll) sendAll.textContent = checked ? `发送选中(${checked})` : "全部一键发送";
|
||||
if (event.target.checked) {
|
||||
const companyId = event.target.closest(".list-row")?.dataset.companyId;
|
||||
const chip = companyId && document.querySelector('#reminderCompanyList input[name="company"][value="' + companyId + '"]');
|
||||
if (chip) chip.checked = true;
|
||||
}
|
||||
updatePickCount();
|
||||
});
|
||||
|
||||
$("#reminderCompanyList")?.addEventListener("change", (event) => {
|
||||
if (event.target.name === "company") updatePickCount();
|
||||
});
|
||||
|
||||
$("#reminderForm")?.addEventListener("submit", async (event) => {
|
||||
@@ -2031,6 +2057,7 @@ function initAdminReminders() {
|
||||
return company?.name || c.value;
|
||||
}).join("、");
|
||||
form.querySelectorAll('input[name="company"]').forEach((c) => { c.checked = false; });
|
||||
updatePickCount();
|
||||
const sendHint = $("#send-hint");
|
||||
sendHint.style.display = "";
|
||||
sendHint.textContent = `已发送给 ${companies},共 ${checked.length} 家公司。`;
|
||||
|
||||
Reference in New Issue
Block a user