更新数据截止日2025.12.15

This commit is contained in:
lychang
2025-12-16 21:18:45 +08:00
parent f0ee65fc53
commit 7169b568dd
12 changed files with 874 additions and 109 deletions

View File

@@ -7,7 +7,7 @@ let groupList = []; // 存储群组列表
// 加载群组列表
async function loadGroupList() {
try {
const response = await fetch('/api/groups');
const response = await fetch('api/groups');
const result = await response.json();
if (result.success) {
@@ -100,7 +100,7 @@ async function loadQAList() {
const endTime = endDateFilter ? endDateFilter.value : '';
// 构建查询URL
let url = '/api/qa';
let url = 'api/qa';
const params = new URLSearchParams();
if (keyword) params.append('keyword', keyword);
@@ -183,7 +183,7 @@ async function displayQAList(qaList) {
let messageMap = {};
if (allMessageIds.length > 0) {
try {
const response = await fetch('/api/messages_by_ids', {
const response = await fetch('api/messages_by_ids', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
@@ -280,7 +280,7 @@ async function searchMessages() {
const qaListContainer = document.getElementById('qaList');
qaListContainer.innerHTML = '<div class="loading">搜索中...</div>';
const response = await fetch(`/api/search_messages?keyword=${encodeURIComponent(keyword)}`);
const response = await fetch(`api/search_messages?keyword=${encodeURIComponent(keyword)}`);
const result = await response.json();
if (result.success) {
@@ -321,7 +321,7 @@ async function advancedSearch() {
if (startDate) params.append('start_time', startDate);
if (endDate) params.append('end_time', endDate);
const response = await fetch(`/api/qa?${params.toString()}`);
const response = await fetch(`api/qa?${params.toString()}`);
const result = await response.json();
if (result.success) {
@@ -411,7 +411,7 @@ async function showSearchSuggestions() {
try {
// 调用后端API获取搜索建议
const response = await fetch(`/api/search_suggestions?keyword=${encodeURIComponent(keyword)}`);
const response = await fetch(`api/search_suggestions?keyword=${encodeURIComponent(keyword)}`);
const result = await response.json();
if (result.success && result.suggestions.length > 0) {
@@ -512,7 +512,7 @@ function openCreateModal() {
// 编辑QA
async function editQA(qaId) {
try {
const response = await fetch(`/api/qa/${qaId}`);
const response = await fetch(`api/qa/${qaId}`);
const result = await response.json();
if (result.success) {
@@ -620,7 +620,7 @@ async function batchDeleteQA() {
}
try {
const response = await fetch('/api/qa/batch', {
const response = await fetch('api/qa/batch', {
method: 'DELETE',
headers: {
'Content-Type': 'application/json'
@@ -665,7 +665,7 @@ async function searchQuestionMessages() {
const groupIdSelect = document.getElementById('groupId');
const groupId = groupIdSelect.value;
try {
const url = `/api/search_messages?keyword=${encodeURIComponent(keyword)}&limit=20${groupId ? `&group_id=${groupId}` : ''}`;
const url = `api/search_messages?keyword=${encodeURIComponent(keyword)}&limit=20${groupId ? `&group_id=${groupId}` : ''}`;
const response = await fetch(url);
const result = await response.json();
if (result.success) {
@@ -721,7 +721,7 @@ async function searchAnswerMessages() {
const groupId = groupIdSelect.value;
try {
const url = `/api/search_messages?keyword=${encodeURIComponent(keyword)}&limit=20${groupId ? `&group_id=${groupId}` : ''}`;
const url = `api/search_messages?keyword=${encodeURIComponent(keyword)}&limit=20${groupId ? `&group_id=${groupId}` : ''}`;
const response = await fetch(url);
const result = await response.json();
@@ -829,7 +829,7 @@ async function saveQA() {
};
try {
const url = currentQA ? `/api/qa/${currentQA.id}` : '/api/qa';
const url = currentQA ? `api/qa/${currentQA.id}` : '/api/qa';
const method = currentQA ? 'PUT' : 'POST';
const response = await fetch(url, {
@@ -859,7 +859,7 @@ async function saveQA() {
// 预览QA
async function previewQA(qaId) {
try {
const response = await fetch(`/api/qa/${qaId}`);
const response = await fetch(`api/qa/${qaId}`);
const result = await response.json();
if (result.success) {
displayPreview(result.qa);
@@ -882,7 +882,7 @@ async function displayPreview(qa) {
if (allMessageIds.length > 0) {
try {
const response = await fetch('/api/messages_by_ids', {
const response = await fetch('api/messages_by_ids', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
@@ -972,7 +972,7 @@ async function deleteQA(qaId) {
}
try {
const response = await fetch(`/api/qa/${qaId}`, {
const response = await fetch(`api/qa/${qaId}`, {
method: 'DELETE'
});