diff --git a/ai_knowledge_base_v2/apps/admin-web/src/App.vue b/ai_knowledge_base_v2/apps/admin-web/src/App.vue index 8ba1598..fadb300 100644 --- a/ai_knowledge_base_v2/apps/admin-web/src/App.vue +++ b/ai_knowledge_base_v2/apps/admin-web/src/App.vue @@ -1137,8 +1137,8 @@ async function clearFeishuCache() { :can-detail="can('feedback.detail')" :can-export="can('feedback.export')" /> - - + + diff --git a/ai_knowledge_base_v2/apps/admin-web/src/components/AgentBatchTestPanel.vue b/ai_knowledge_base_v2/apps/admin-web/src/components/AgentBatchTestPanel.vue index 961c4d4..0437d19 100644 --- a/ai_knowledge_base_v2/apps/admin-web/src/components/AgentBatchTestPanel.vue +++ b/ai_knowledge_base_v2/apps/admin-web/src/components/AgentBatchTestPanel.vue @@ -5,6 +5,7 @@ import { computed, onBeforeUnmount, onMounted, reactive, ref } from "vue"; import { api } from "../services/api"; import type { AgentBatchItem, AgentBatchJob, AgentBatchJobDetail } from "../types/api"; import AdminPagination from "./AdminPagination.vue"; +import { formatDateTime } from "../utils/dateTime"; const props = defineProps<{ config: Record; @@ -165,10 +166,6 @@ function executionLabel(job: AgentBatchJob) { return job.executionMode === "concurrent" ? `并发 · ${job.concurrencyLimit} 路` : "逐条串行"; } -function formatDate(value?: string | null) { - return value ? new Date(value).toLocaleString("zh-CN", { hour12: false }) : "—"; -} - function itemDuration(item: AgentBatchItem) { return item.durationMs == null ? "—" : `${(item.durationMs / 1000).toFixed(1)} 秒`; } @@ -213,7 +210,7 @@ function errorMessage(error: unknown, fallback: string) {

测试记录

任务在后台执行,离开页面不会中断。

刷新
- + diff --git a/ai_knowledge_base_v2/apps/admin-web/src/components/AgentManagementView.vue b/ai_knowledge_base_v2/apps/admin-web/src/components/AgentManagementView.vue index a8284ac..9848d6f 100644 --- a/ai_knowledge_base_v2/apps/admin-web/src/components/AgentManagementView.vue +++ b/ai_knowledge_base_v2/apps/admin-web/src/components/AgentManagementView.vue @@ -9,6 +9,7 @@ import AgentBatchTestPanel from "./AgentBatchTestPanel.vue"; import AgentResponseDepthControl from "./AgentResponseDepthControl.vue"; import AdminPagination from "./AdminPagination.vue"; import StreamingMarkdownMessage from "./StreamingMarkdownMessage.vue"; +import { formatDateTime } from "../utils/dateTime"; const props = withDefaults(defineProps<{ previewKnowledgeId?: number | null; canBatch?: boolean }>(), { canBatch: false }); const emit = defineEmits<{ consumedPreview: [] }>(); @@ -479,11 +480,6 @@ function changeTypeTag(value?: string) { return "info"; } -function formatDate(value?: string | null) { - if (!value) return "尚未保存"; - return new Date(value).toLocaleString("zh-CN", { hour12: false }); -} - function errorMessage(error: unknown, fallback: string) { return error instanceof Error ? error.message : fallback; } @@ -497,7 +493,7 @@ function errorMessage(error: unknown, fallback: string) {
当前版本 {{ prompt?.id ? `#${prompt.id}` : "系统默认" }} - {{ prompt?.updatedByName || "系统默认" }} · {{ formatDate(prompt?.updatedAt) }} + {{ prompt?.updatedByName || "系统默认" }} · {{ formatDateTime(prompt?.updatedAt, "尚未保存") }}
@@ -697,7 +693,7 @@ function errorMessage(error: unknown, fallback: string) { 版本 #{{ item.id }} 当前 {{ changeTypeLabel(item.changeType) }} - {{ item.updatedByName }} · {{ formatDate(item.updatedAt) }} + {{ item.updatedByName }} · {{ formatDateTime(item.updatedAt, "尚未保存") }}

{{ item.preview || "空内容" }}

@@ -759,7 +755,7 @@ function errorMessage(error: unknown, fallback: string) {
diff --git a/ai_knowledge_base_v2/apps/admin-web/src/components/AiLogDetailDrawer.vue b/ai_knowledge_base_v2/apps/admin-web/src/components/AiLogDetailDrawer.vue index 9b0b50b..4e6c19a 100644 --- a/ai_knowledge_base_v2/apps/admin-web/src/components/AiLogDetailDrawer.vue +++ b/ai_knowledge_base_v2/apps/admin-web/src/components/AiLogDetailDrawer.vue @@ -3,6 +3,7 @@ import { ElMessage } from "element-plus"; import { ref, watch } from "vue"; import { api } from "../services/api"; import type { AiLogRecord } from "../types/api"; +import { formatDateTime } from "../utils/dateTime"; const props = defineProps<{ modelValue: boolean; logId: number | null }>(); const emit = defineEmits<{ "update:modelValue": [value: boolean] }>(); @@ -77,7 +78,7 @@ function formatMoney(value?: number | null, currency = "CNY") { >知识命中:{{ detail.knowledgeHit ? "是" : "否" }}路由原因:{{ detail.routeReason || "-" }}耗时:{{ detail.costMs || "-" }}ms时间:{{ detail.createdAt }} + >时间:{{ formatDateTime(detail.createdAt) }}

{{ detail.errorMessage }} diff --git a/ai_knowledge_base_v2/apps/admin-web/src/components/AttentionManagementView.vue b/ai_knowledge_base_v2/apps/admin-web/src/components/AttentionManagementView.vue index f07ba28..faf2224 100644 --- a/ai_knowledge_base_v2/apps/admin-web/src/components/AttentionManagementView.vue +++ b/ai_knowledge_base_v2/apps/admin-web/src/components/AttentionManagementView.vue @@ -6,19 +6,28 @@ import type { AttentionItem } from "../types/api"; import AdminPagination from "./AdminPagination.vue"; import AttentionRuleConfigPanel from "./AttentionRuleConfigPanel.vue"; import ChatDetailDrawer from "./ChatDetailDrawer.vue"; +import { formatDateTime, toUtcIsoFromBusinessDate } from "../utils/dateTime"; defineProps<{ canConfig: boolean; canPreview: boolean }>(); const loading = ref(false); const records = ref([]); const pager = reactive({ page: 1, pageSize: 20, total: 0 }); +const filters = reactive({ priority: "", dateFrom: "", dateTo: "" }); const chatDetailOpen = ref(false); const sessionId = ref(null); +const focusMessageId = ref(null); onMounted(() => loadRecords()); async function loadRecords(page = 1, pageSize = pager.pageSize) { loading.value = true; try { - const result = await api.attentionList({ page, pageSize }); + const result = await api.attentionList({ + priority: filters.priority || undefined, + dateFrom: toUtcIsoFromBusinessDate(filters.dateFrom, "start"), + dateTo: toUtcIsoFromBusinessDate(filters.dateTo, "end"), + page, + pageSize, + }); records.value = result.items; Object.assign(pager, { page: result.page, @@ -29,6 +38,17 @@ async function loadRecords(page = 1, pageSize = pager.pageSize) { loading.value = false; } } +function applyFilters() { + if (filters.dateFrom && filters.dateTo && filters.dateFrom > filters.dateTo) { + ElMessage.warning("开始日期不能晚于结束日期"); + return; + } + void loadRecords(1, pager.pageSize); +} +function resetFilters() { + Object.assign(filters, { priority: "", dateFrom: "", dateTo: "" }); + void loadRecords(1, pager.pageSize); +} async function updateStatus(row: AttentionItem, status: string) { await api.updateAttention(row.id, status); ElMessage.success("人工关注状态已更新"); @@ -52,8 +72,9 @@ async function deleteRecord(row: AttentionItem) { ElMessage.success("人工关注记录已删除"); await loadRecords(pager.page, pager.pageSize); } -function openChat(id: number) { - sessionId.value = id; +function openChat(row: AttentionItem) { + sessionId.value = row.sessionId; + focusMessageId.value = row.messageId; chatDetailOpen.value = true; } function priorityLabel(priority: string) { @@ -73,6 +94,22 @@ function priorityLabel(priority: string) {

+
+ + + + + +
+ + + +
+
+ 查询 + 重置 +
+