@@ -282,8 +282,7 @@
|
||||
const tab = document.querySelector('.mgmt-tab[data-panel="' + panelId + '"]');
|
||||
if (tab) tab.classList.add('active');
|
||||
if (panelId === 'panel-greeting') loadCustomerTagsForGreeting();
|
||||
if (panelId === 'panel-push') loadPushTasks();
|
||||
if (panelId === 'panel-ai-reply') { loadAiReplyConfig(); loadAiReplyStatus(); }
|
||||
if (panelId === 'panel-ai-reply') { loadAiReplyConfig(); loadAiReplyStatus(); loadCallbackStatus(); }
|
||||
}
|
||||
|
||||
function _parseWxidLines(ta) {
|
||||
@@ -591,21 +590,6 @@
|
||||
} catch (e) { $('push-group-list').innerHTML = '<p class="small-label">加载失败</p>'; }
|
||||
}
|
||||
|
||||
async function loadPushTasks() {
|
||||
const key = $('key').value.trim();
|
||||
const el = $('push-task-list');
|
||||
if (!el) return;
|
||||
if (!key) { el.innerHTML = '<p class="small-label">请先登录。</p>'; return; }
|
||||
try {
|
||||
const data = await callApi('/api/push-tasks?key=' + encodeURIComponent(key) + '&limit=100');
|
||||
const list = data.items || [];
|
||||
el.innerHTML = list.length
|
||||
? '<table class="mgmt-table"><thead><tr><th>时间</th><th>群组</th><th>状态</th><th>内容摘要</th></tr></thead><tbody>'
|
||||
+ list.map(t => '<tr><td>' + escapeHtml((t.created_at || t.send_at || '-').toString().slice(0, 19)) + '</td><td>' + escapeHtml((t.group_id || '-').toString().slice(0, 12)) + '</td><td>' + escapeHtml((t.status || 'pending').toString()) + '</td><td>' + escapeHtml((t.content || '').toString().slice(0, 40)) + (t.content && t.content.length > 40 ? '…' : '') + '</td></tr>').join('') + '</tbody></table>'
|
||||
: '<p class="small-label">暂无推送任务记录。</p>';
|
||||
} catch (e) { el.innerHTML = '<p class="small-label">加载失败: ' + escapeHtml(e.message) + '</p>'; }
|
||||
}
|
||||
|
||||
function fillPushSelects() {
|
||||
const key = $('key').value.trim();
|
||||
if (!key) return;
|
||||
@@ -890,7 +874,6 @@
|
||||
const items = wxids.map(wxid => ({ to_user_name: wxid, content }));
|
||||
await callApi('/api/send-batch', { method: 'POST', body: JSON.stringify({ key, items }) });
|
||||
await callApi('/api/push-tasks', { method: 'POST', body: JSON.stringify({ key, product_tag_id: tagId || '', group_id: groupId, content }) });
|
||||
loadPushTasks();
|
||||
alert('已推送至 ' + items.length + ' 人');
|
||||
$('push-content').value = '';
|
||||
} catch (e) { alert(e.message); }
|
||||
@@ -960,7 +943,6 @@
|
||||
loadGreetingTasks();
|
||||
loadProductTags();
|
||||
loadPushGroups();
|
||||
loadPushTasks();
|
||||
|
||||
(function wsStatusCheck() {
|
||||
let wasConnected = false;
|
||||
|
||||
Reference in New Issue
Block a user