feat(rpa): 实现库存源路由与 RPA Driver 方案
- 添加库存源解析逻辑,根据发货通知目的地解析 RPA 源 - 实现 DSV 360 和 Crane FootPrint 的库存源配置 - 增加自动登录功能,优化浏览器操作 - 更新本地启动脚本,支持跳过 Worker 启动 - 添加后端测试,验证库存源解析与任务取消逻辑 - 编写文档,描述库存源路由与 RPA Driver 方案
This commit is contained in:
commit
1921959fc1
61 files changed
+2347
-473
No files matched your search
@@ -35,6 +35,12 @@ export const workspaceRoutes: RouteRecordRaw[] = [
|
||||
component: () => import('@/features/workspace/pages/KnowledgeBasePage.vue'),
|
||||
meta: { title: '知识库' },
|
||||
},
|
||||
{
|
||||
path: 'knowledge-base/groups/:groupId',
|
||||
name: 'workspace-knowledge-base-group',
|
||||
component: () => import('@/features/workspace/pages/KnowledgeBasePage.vue'),
|
||||
meta: { title: '知识库' },
|
||||
},
|
||||
{
|
||||
path: 'schedule-runs',
|
||||
name: 'workspace-schedule-runs',
|
||||
|
||||
@@ -13,6 +13,8 @@ export const SHIPPING_ACTION_IDS = [
|
||||
'reparse_inventory',
|
||||
'rematch',
|
||||
'retry_rpa',
|
||||
'confirm_inventory_source',
|
||||
'retry_resolve_inventory_source',
|
||||
'upload_inventory_file',
|
||||
'retry_upload',
|
||||
'download_excel',
|
||||
@@ -51,6 +53,8 @@ export const SHIPPING_INTERNAL_STATUS_TOKENS = [
|
||||
'export_ready',
|
||||
'upload_req',
|
||||
'inventory_pending',
|
||||
'inventory_source_review',
|
||||
'inventory_source_unresolved',
|
||||
'map_ok',
|
||||
'parse_ok',
|
||||
'needs_human',
|
||||
|
||||
@@ -99,6 +99,28 @@ export async function uploadWorkspaceShippingInventory(taskNo: string, file: Fil
|
||||
return body;
|
||||
}
|
||||
|
||||
/**
|
||||
* 确认当前任务的库存 RPA 来源。
|
||||
* @param taskNo - 发货任务编号
|
||||
* @param sourceCode - 已配置的库存源编码
|
||||
* @returns RPA 库存导出触发结果
|
||||
*/
|
||||
export async function confirmWorkspaceShippingInventorySource(taskNo: string, sourceCode: string) {
|
||||
const res = await fetch(
|
||||
`/api/workspace/shipping-tasks/${encodeURIComponent(taskNo)}/confirm-inventory-source`,
|
||||
{
|
||||
method: 'POST',
|
||||
headers: { ...getAuthHeaders(), 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ source_code: sourceCode }),
|
||||
},
|
||||
);
|
||||
const body = (await res.json().catch(() => ({}))) as ShippingDecisionResponse & { error?: string };
|
||||
if (!res.ok || body.status === 'failed') {
|
||||
throw new Error(body.error || body.message || res.statusText);
|
||||
}
|
||||
return body;
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交库存字段映射。
|
||||
* @param taskNo - 发货任务编号
|
||||
|
||||
@@ -103,45 +103,24 @@ const getMessageKey = (msg: ChatMessage, index: number) => (
|
||||
@regenerate="emit('regenerate')"
|
||||
@open-feedback="emit('open-feedback', index)"
|
||||
/>
|
||||
<ToolRunProgressCard
|
||||
v-if="shouldRenderMessage(msg) && shouldShowToolRunProgressAfterMessage(msg, index)"
|
||||
:run="getMessageRunProgress(msg)"
|
||||
:loading="isMessageRunProgressLoading(msg)"
|
||||
:waiting="false"
|
||||
:error="getMessageRunProgressError(msg)"
|
||||
:fallback-title="toolRunProgressTitle"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<template v-for="(msg, index) in messages" :key="index">
|
||||
<ChatMessageBubble
|
||||
v-if="shouldRenderMessage(msg)"
|
||||
:message="msg"
|
||||
:index="index"
|
||||
:message-count="messages.length"
|
||||
:is-thinking="isThinking"
|
||||
:show-chat-rating="showChatRating"
|
||||
:copied-index="copiedIndex"
|
||||
:is-shipping-notice-agent="isShippingNoticeAgent"
|
||||
:handlers="handlers"
|
||||
:leave-handlers="leaveHandlers"
|
||||
:shipping-handlers="shippingHandlers"
|
||||
@copy="emit('copy', { message: msg, index })"
|
||||
@edit="emit('edit', $event)"
|
||||
@resend="emit('resend', $event)"
|
||||
@regenerate="emit('regenerate')"
|
||||
@open-feedback="emit('open-feedback', index)"
|
||||
/>
|
||||
<ToolRunProgressCard
|
||||
v-if="shouldRenderMessage(msg) && shouldShowToolRunProgressAfterMessage(msg, index)"
|
||||
:run="getMessageRunProgress(msg)"
|
||||
:loading="isMessageRunProgressLoading(msg)"
|
||||
:waiting="false"
|
||||
:error="getMessageRunProgressError(msg)"
|
||||
:fallback-title="toolRunProgressTitle"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<ChatThinkingBubble v-if="showThinkingBubble" />
|
||||
<div v-if="messages.length > 0" class="h-2 md:h-3" />
|
||||
</div>
|
||||
<ChatThinkingBubble v-if="showThinkingBubble" />
|
||||
<div v-if="messages.length > 0" class="h-2 md:h-3" />
|
||||
</div>
|
||||
|
||||
<button
|
||||
v-if="showScrollToBottom"
|
||||
type="button"
|
||||
class="absolute bottom-4 left-1/2 z-10 flex h-10 w-10 -translate-x-1/2 items-center justify-center rounded-full border border-slate-100 bg-white text-[28px] font-light leading-none text-slate-500 shadow-[0_10px_28px_rgba(15,23,42,0.16)] transition hover:-translate-y-0.5 hover:border-slate-200 hover:text-slate-700 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-300 dark:shadow-black/30 md:bottom-5"
|
||||
class="sticky bottom-4 left-1/2 z-30 flex h-10 w-10 -translate-x-1/2 items-center justify-center rounded-full border border-slate-100 bg-white text-[28px] font-light leading-none text-slate-500 shadow-[0_10px_28px_rgba(15,23,42,0.16)] transition hover:-translate-y-0.5 hover:border-slate-200 hover:text-slate-700 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-300 dark:shadow-black/30 md:bottom-6"
|
||||
:title="$t('chat.scrollToLatest')"
|
||||
@click="emit('scroll-to-bottom')"
|
||||
>
|
||||
|
||||
@@ -290,14 +290,11 @@ export function useChat() {
|
||||
context?: { task_id?: string; batch_no?: string; display_query?: string },
|
||||
hooks?: SendMessageLifecycleHooks,
|
||||
) => {
|
||||
<<<<<<< HEAD
|
||||
const displayQuery = String(context?.display_query || query || '').trim();
|
||||
=======
|
||||
clearLikelyCompletedStreamTimer();
|
||||
cancelActiveStream();
|
||||
const controller = new AbortController();
|
||||
activeStreamController.value = controller;
|
||||
>>>>>>> dev
|
||||
const runViewId = viewId.value;
|
||||
const runMessages = messages.value;
|
||||
const run: ChatRun = {
|
||||
|
||||
@@ -66,7 +66,7 @@ export function resolveShippingNumericChoice(
|
||||
}
|
||||
|
||||
export function normalizeApiShippingButtons(
|
||||
apiButtons: Array<{ id: string; label: string; message: string; variant?: string }> | null,
|
||||
apiButtons: Array<{ id: string; label: string; message: string; variant?: string; source_code?: string }> | null,
|
||||
): ShippingActionButton[] {
|
||||
return (apiButtons || []).map((button) => ({
|
||||
...button,
|
||||
@@ -81,7 +81,7 @@ export function normalizeApiShippingButtons(
|
||||
*/
|
||||
export function resolveShippingActionButtons(
|
||||
content: string,
|
||||
apiButtons: Array<{ id: string; label: string; message: string; variant?: string }> | null,
|
||||
apiButtons: Array<{ id: string; label: string; message: string; variant?: string; source_code?: string }> | null,
|
||||
opts?: { apiResolved?: boolean },
|
||||
) {
|
||||
const directive = extractShippingActionsDirective(String(content || ''));
|
||||
|
||||
@@ -5,7 +5,9 @@
|
||||
* 逻辑:由 useChatShipping 调用本文件;本文件根据 action.id 决定触发后端接口、本地消息落库或前端 UI 行为。
|
||||
*/
|
||||
import {
|
||||
confirmWorkspaceShippingInventorySource,
|
||||
generateWorkspaceShippingExcel,
|
||||
getWorkspaceShippingTask,
|
||||
matchWorkspaceShippingInventory,
|
||||
retryWorkspaceShippingUpload,
|
||||
type ShippingDecisionResponse,
|
||||
@@ -14,7 +16,7 @@ import {
|
||||
import { SHIPPING_DECISION_ACTIONS } from '../constants/shipping';
|
||||
import { downloadWorkspaceShippingExcelFile } from './shippingDownload';
|
||||
import type { ChatMessage } from '../types/chat.types';
|
||||
import type { ShippingMatchResultPayload } from '../types/shipping.types';
|
||||
import type { ShippingActionButton, ShippingMatchResultPayload } from '../types/shipping.types';
|
||||
import type { Ref } from 'vue';
|
||||
|
||||
export interface ShippingMenuHandlerContext {
|
||||
@@ -42,9 +44,53 @@ export interface ShippingMenuHandlerContext {
|
||||
* @returns 菜单动作与按钮点击处理函数
|
||||
*/
|
||||
export function createShippingMenuHandlers(ctx: ShippingMenuHandlerContext) {
|
||||
const normalizeInventorySourceText = (value: string) =>
|
||||
String(value || '')
|
||||
.toUpperCase()
|
||||
.replace(/[^A-Z0-9]+/g, '');
|
||||
|
||||
const recentInventorySourceHint = () => {
|
||||
const parts: string[] = [];
|
||||
for (let i = ctx.messages.value.length - 1; i >= 0 && parts.length < 6; i -= 1) {
|
||||
const content = String(ctx.messages.value[i]?.content || '').trim();
|
||||
if (content) parts.push(content);
|
||||
}
|
||||
return parts.join('\n');
|
||||
};
|
||||
|
||||
const resolveInventorySourceCodeFromContext = async (taskId: string): Promise<string> => {
|
||||
const detail = await getWorkspaceShippingTask(taskId);
|
||||
const resolution = detail.inventory_source_resolution;
|
||||
const candidates = resolution && typeof resolution === 'object'
|
||||
? (resolution as { candidates?: unknown }).candidates
|
||||
: null;
|
||||
if (!Array.isArray(candidates) || candidates.length === 0) return '';
|
||||
if (candidates.length === 1) {
|
||||
const only = candidates[0];
|
||||
return only && typeof only === 'object'
|
||||
? String((only as { source_code?: unknown }).source_code || '').trim().toUpperCase()
|
||||
: '';
|
||||
}
|
||||
const hint = normalizeInventorySourceText(recentInventorySourceHint());
|
||||
if (!hint) return '';
|
||||
const matches = candidates.filter((item) => {
|
||||
if (!item || typeof item !== 'object') return false;
|
||||
const source = item as { source_code?: unknown; display_name?: unknown; warehouse_code?: unknown; program_name?: unknown };
|
||||
const values = [
|
||||
source.source_code,
|
||||
source.display_name,
|
||||
source.warehouse_code,
|
||||
source.program_name,
|
||||
].map((value) => normalizeInventorySourceText(String(value || ''))).filter(Boolean);
|
||||
return values.some((value) => hint.includes(value) || value.includes(hint));
|
||||
});
|
||||
if (matches.length !== 1) return '';
|
||||
return String((matches[0] as { source_code?: unknown }).source_code || '').trim().toUpperCase();
|
||||
};
|
||||
|
||||
const buildMatchResultPayload = (
|
||||
taskId: string,
|
||||
result: ShippingDecisionResponse & { action_buttons?: Array<{ id: string; label: string; message: string; variant?: 'primary' | 'secondary' | 'danger' }> },
|
||||
result: ShippingDecisionResponse & { action_buttons?: Array<{ id: string; label: string; message: string; variant?: 'primary' | 'secondary' | 'danger'; source_code?: string }> },
|
||||
): ShippingMatchResultPayload => {
|
||||
const data = (result?.data && typeof result.data === 'object') ? result.data as Record<string, unknown> : {};
|
||||
const lineResults = Array.isArray(data.line_results)
|
||||
@@ -68,7 +114,7 @@ export function createShippingMenuHandlers(ctx: ShippingMenuHandlerContext) {
|
||||
};
|
||||
|
||||
const handleShippingMenuAction = async (
|
||||
action: { id?: string; message: string },
|
||||
action: ShippingActionButton | { id?: string; message: string },
|
||||
chatMsg?: ChatMessage & { shipping_actions_used?: boolean },
|
||||
) => {
|
||||
if (ctx.isThinking.value) return;
|
||||
@@ -163,6 +209,57 @@ export function createShippingMenuHandlers(ctx: ShippingMenuHandlerContext) {
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (action.id === 'confirm_inventory_source') {
|
||||
if (chatMsg?.shipping_actions_used) return;
|
||||
if (chatMsg) chatMsg.shipping_actions_used = true;
|
||||
const taskId = ctx.getActiveShippingTaskId();
|
||||
if (!taskId) {
|
||||
ctx.msg.warning(ctx.t('chat.shippingNoticeMissingTaskId'));
|
||||
return;
|
||||
}
|
||||
try {
|
||||
let sourceCode = String((action as { source_code?: unknown }).source_code || '').trim().toUpperCase();
|
||||
if (!sourceCode) {
|
||||
sourceCode = await resolveInventorySourceCodeFromContext(taskId);
|
||||
}
|
||||
if (!sourceCode) {
|
||||
ctx.msg.warning('请直接输入要使用的库存源线索,例如 AWSDU、Dublin 或 Singapore。');
|
||||
if (chatMsg) chatMsg.shipping_actions_used = false;
|
||||
return;
|
||||
}
|
||||
const result = await confirmWorkspaceShippingInventorySource(taskId, sourceCode);
|
||||
const label = String(('label' in action ? action.label : '') || sourceCode).trim();
|
||||
const userText = `确认库存查询来源:${label}`;
|
||||
const userMsg: ChatMessage = {
|
||||
role: 'user',
|
||||
type: 'text',
|
||||
content: `${userText}\n任务编号:${taskId}`,
|
||||
local_id: ctx.newLocalMessageId('shipping-user'),
|
||||
local_only: true,
|
||||
};
|
||||
const assistantMsg: ChatMessage = {
|
||||
role: 'assistant',
|
||||
type: 'text',
|
||||
content: String(result.message || '').trim(),
|
||||
local_id: ctx.newLocalMessageId('shipping-assistant'),
|
||||
local_only: true,
|
||||
};
|
||||
ctx.messages.value.push(userMsg, assistantMsg);
|
||||
await ctx.saveLocalMessageToBackend(userMsg, userText);
|
||||
await ctx.saveLocalMessageToBackend(assistantMsg, userText);
|
||||
void ctx.refreshShippingActions();
|
||||
} catch (e: unknown) {
|
||||
const errorMessage = e instanceof Error ? e.message : '确认库存源失败';
|
||||
ctx.msg.warning(errorMessage);
|
||||
if (chatMsg) chatMsg.shipping_actions_used = false;
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (action.id === 'retry_resolve_inventory_source') {
|
||||
await ctx.refreshShippingActions();
|
||||
ctx.msg.info('已重新刷新库存源状态');
|
||||
return;
|
||||
}
|
||||
if (action.id === 'edit_inventory_mapping') {
|
||||
const taskId = ctx.getActiveShippingTaskId();
|
||||
if (!taskId) {
|
||||
@@ -246,7 +343,7 @@ export function createShippingMenuHandlers(ctx: ShippingMenuHandlerContext) {
|
||||
|
||||
const handleShippingActionClick = async (
|
||||
chatMsg: ChatMessage & { shipping_actions_used?: boolean },
|
||||
action: { id?: string; message: string },
|
||||
action: ShippingActionButton,
|
||||
) => {
|
||||
await handleShippingMenuAction(action, chatMsg);
|
||||
};
|
||||
|
||||
@@ -6,8 +6,10 @@
|
||||
*/
|
||||
import {
|
||||
applyWorkspaceShippingInventoryMapping,
|
||||
confirmWorkspaceShippingInventorySource,
|
||||
generateWorkspaceShippingExcel,
|
||||
getWorkspaceShippingBatch,
|
||||
getWorkspaceShippingTask,
|
||||
switchWorkspaceShippingBatchFocusTask,
|
||||
} from '@/features/chat/api/shipping.api';
|
||||
import { SHIPPING_DECISION_ACTIONS, SHIPPING_MENU_ACTION_SPECS } from '../constants/shipping';
|
||||
@@ -79,6 +81,59 @@ export interface ShippingSendHandlerContext {
|
||||
* @returns 发送前文本与附件自动流程处理函数;返回 true 表示已消费本次发送
|
||||
*/
|
||||
export function createShippingSendHandlers(ctx: ShippingSendHandlerContext) {
|
||||
const normalizeInventorySourceText = (value: string) =>
|
||||
String(value || '')
|
||||
.toUpperCase()
|
||||
.replace(/[^A-Z0-9]+/g, '');
|
||||
|
||||
const tryConfirmInventorySourceFromText = async (content: string): Promise<boolean> => {
|
||||
const taskId = ctx.getActiveShippingTaskId();
|
||||
if (!taskId) return false;
|
||||
const normalized = normalizeInventorySourceText(content);
|
||||
if (!normalized) return false;
|
||||
try {
|
||||
const detail = await getWorkspaceShippingTask(taskId);
|
||||
if (detail.pending_human_reason !== 'inventory_source_unresolved') return false;
|
||||
const resolution = detail.inventory_source_resolution;
|
||||
const candidates = resolution && typeof resolution === 'object'
|
||||
? (resolution as { candidates?: unknown }).candidates
|
||||
: null;
|
||||
if (!Array.isArray(candidates) || candidates.length === 0) return false;
|
||||
const hit = candidates.find((item) => {
|
||||
if (!item || typeof item !== 'object') return false;
|
||||
const source = item as { source_code?: unknown; display_name?: unknown; warehouse_code?: unknown; program_name?: unknown };
|
||||
const values = [
|
||||
source.source_code,
|
||||
source.display_name,
|
||||
source.warehouse_code,
|
||||
source.program_name,
|
||||
].map((value) => normalizeInventorySourceText(String(value || ''))).filter(Boolean);
|
||||
return values.some((value) => normalized === value || normalized.includes(value) || value.includes(normalized));
|
||||
}) as { source_code?: unknown; display_name?: unknown } | undefined;
|
||||
const sourceCode = String(hit?.source_code || '').trim().toUpperCase();
|
||||
if (!sourceCode) return false;
|
||||
if (typeof content !== 'string') return false;
|
||||
ctx.input.value = '';
|
||||
ctx.attachments.value = [];
|
||||
const label = String(hit?.display_name || sourceCode).trim();
|
||||
await ctx.pushShippingLocalUserMessage(content.trim());
|
||||
const result = await confirmWorkspaceShippingInventorySource(taskId, sourceCode);
|
||||
await ctx.pushShippingLocalAssistantMessage(
|
||||
[
|
||||
String(result.message || '').trim(),
|
||||
`已确认库存查询来源:${label}`,
|
||||
`任务编号:${taskId}`,
|
||||
].filter(Boolean).join('\n'),
|
||||
);
|
||||
void ctx.refreshShippingActions();
|
||||
return true;
|
||||
} catch (e: unknown) {
|
||||
const errorMessage = e instanceof Error ? e.message : '确认库存源失败';
|
||||
ctx.msg.warning(errorMessage);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
const trySwitchShippingTask = async (content: string): Promise<boolean> => {
|
||||
const intent = parseShippingTaskSwitchIntent(content);
|
||||
if (!intent) return false;
|
||||
@@ -187,6 +242,11 @@ export function createShippingSendHandlers(ctx: ShippingSendHandlerContext) {
|
||||
ctx.attachments.value = [];
|
||||
return true;
|
||||
}
|
||||
if (await tryConfirmInventorySourceFromText(content)) {
|
||||
if (typeof textOrEvent !== 'string') ctx.input.value = '';
|
||||
ctx.attachments.value = [];
|
||||
return true;
|
||||
}
|
||||
const assistantCtx = ctx.lastAssistantMessageContent();
|
||||
const numericText = content.trim();
|
||||
if (/^[1-91-9](?:[\.\、\)::]?)$/.test(numericText)) {
|
||||
|
||||
@@ -31,6 +31,8 @@ export interface ShippingTaskSummary {
|
||||
step_payload?: Record<string, unknown> & {
|
||||
current_step_progress?: ShippingCurrentStepProgress;
|
||||
};
|
||||
rpa_inventory_source?: Record<string, unknown> | null;
|
||||
inventory_source_resolution?: Record<string, unknown> | null;
|
||||
created_at?: string | null;
|
||||
updated_at?: string | null;
|
||||
}
|
||||
@@ -104,6 +106,7 @@ export interface ShippingChatAction {
|
||||
label: string;
|
||||
message: string;
|
||||
variant: 'primary' | 'secondary' | 'danger';
|
||||
source_code?: string;
|
||||
}
|
||||
|
||||
export interface ShippingChatActionsResponse {
|
||||
|
||||
@@ -82,6 +82,7 @@ export interface ShippingMatchResultPayload {
|
||||
label: string;
|
||||
message: string;
|
||||
variant: 'primary' | 'secondary' | 'danger';
|
||||
source_code?: string;
|
||||
}>;
|
||||
}
|
||||
|
||||
@@ -90,4 +91,5 @@ export interface ShippingActionButton {
|
||||
label: string;
|
||||
message: string;
|
||||
variant?: ShippingActionVariant;
|
||||
source_code?: string;
|
||||
}
|
||||
@@ -77,9 +77,9 @@ export function createKbWorkspaceState(options: CreateKbWorkspaceStateOptions =
|
||||
const failureModalPage = ref(1);
|
||||
const retryingFailureKey = ref('');
|
||||
|
||||
const documentStageFilter = ref<'all' | 'upload' | 'clean' | 'sync'>('all');
|
||||
const documentStageFilter = ref<'all' | 'pending_clean' | 'cleaning' | 'pending_sync' | 'failed'>('all');
|
||||
const documentListPage = ref(1);
|
||||
const documentListPageSize = ref(20);
|
||||
const documentListPageSize = ref(10);
|
||||
const documentKeyword = ref('');
|
||||
const batchSubmitting = ref(false);
|
||||
const selectedDocumentIds = ref<number[]>([]);
|
||||
|
||||
@@ -98,17 +98,20 @@ export function useKbWorkspaceComputed(state: KbWorkspaceState) {
|
||||
|
||||
const matchesDocumentStageFilter = (
|
||||
doc: KbDocumentItem,
|
||||
filter: 'all' | 'upload' | 'clean' | 'sync',
|
||||
filter: 'all' | 'pending_clean' | 'cleaning' | 'pending_sync' | 'failed',
|
||||
) => {
|
||||
const workflow = resolveWorkflowState(doc);
|
||||
if (filter === 'all') return true;
|
||||
if (filter === 'upload') {
|
||||
return workflow.upload.code !== 'success';
|
||||
if (filter === 'pending_clean') {
|
||||
return workflow.clean.code === 'pending';
|
||||
}
|
||||
if (filter === 'clean') {
|
||||
return ['pending', 'queued', 'running', 'failed'].includes(workflow.clean.code);
|
||||
if (filter === 'cleaning') {
|
||||
return ['queued', 'running'].includes(workflow.clean.code);
|
||||
}
|
||||
return ['pending', 'running', 'failed'].includes(workflow.sync.code);
|
||||
if (filter === 'pending_sync') {
|
||||
return workflow.sync.code === 'pending';
|
||||
}
|
||||
return [workflow.upload.code, workflow.clean.code, workflow.sync.code].includes('failed');
|
||||
};
|
||||
|
||||
const matchesDocumentKeyword = (doc: KbDocumentItem, keyword: string) => {
|
||||
@@ -125,11 +128,12 @@ export function useKbWorkspaceComputed(state: KbWorkspaceState) {
|
||||
};
|
||||
|
||||
const stageFilterTabs = computed(() => {
|
||||
const filters: Array<{ key: 'all' | 'upload' | 'clean' | 'sync'; label: string }> = [
|
||||
const filters: Array<{ key: 'all' | 'pending_clean' | 'cleaning' | 'pending_sync' | 'failed'; label: string }> = [
|
||||
{ key: 'all', label: t('kbWorkspace.filters.all') },
|
||||
{ key: 'upload', label: t('kbWorkspace.filters.upload') },
|
||||
{ key: 'clean', label: t('kbWorkspace.filters.clean') },
|
||||
{ key: 'sync', label: t('kbWorkspace.filters.sync') },
|
||||
{ key: 'pending_clean', label: t('kbWorkspace.filters.pendingClean') },
|
||||
{ key: 'cleaning', label: t('kbWorkspace.filters.cleaning') },
|
||||
{ key: 'pending_sync', label: t('kbWorkspace.filters.pendingSync') },
|
||||
{ key: 'failed', label: t('kbWorkspace.filters.failed') },
|
||||
];
|
||||
return filters.map((item) => ({
|
||||
...item,
|
||||
|
||||
@@ -46,6 +46,7 @@ export function useKbWorkspaceData(
|
||||
selectedDocumentIds,
|
||||
showPathUploadDetails,
|
||||
selectedPathUploadHistoryJobId,
|
||||
router,
|
||||
} = state;
|
||||
|
||||
const { t } = state;
|
||||
@@ -189,6 +190,9 @@ export function useKbWorkspaceData(
|
||||
};
|
||||
|
||||
const openGroupDetail = async (groupId: number) => {
|
||||
if (viewMode.value === 'group_overview') {
|
||||
await router.push({ name: 'workspace-knowledge-base-group', params: { groupId } });
|
||||
}
|
||||
selectedGroupId.value = groupId;
|
||||
viewMode.value = 'group_detail';
|
||||
feedback.value = '';
|
||||
@@ -197,6 +201,9 @@ export function useKbWorkspaceData(
|
||||
};
|
||||
|
||||
const backToGroupOverview = () => {
|
||||
if (viewMode.value === 'group_detail') {
|
||||
void router.push({ name: 'workspace-knowledge-base' });
|
||||
}
|
||||
viewMode.value = 'group_overview';
|
||||
selectedGroupId.value = null;
|
||||
documents.value = [];
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* features/kb/composables/useKbWorkspace.ts
|
||||
* 知识库作业面编排入口:组合 state / computed / data / pathUpload / documents / modals。
|
||||
*/
|
||||
import { onMounted, onUnmounted, reactive, watch } from 'vue';
|
||||
import { computed as vueComputed, onMounted, onUnmounted, reactive, watch } from 'vue';
|
||||
import {
|
||||
DOCUMENT_PAGE_SIZE_OPTIONS,
|
||||
FAILURE_PAGE_SIZE,
|
||||
@@ -76,6 +76,29 @@ export function useKbWorkspace(options: UseKbWorkspaceOptions = {}) {
|
||||
} = computed;
|
||||
|
||||
const { applyPathUploadJob } = pathUpload;
|
||||
const routeGroupId = vueComputed(() => {
|
||||
const raw = state.router.currentRoute.value.params.groupId;
|
||||
const value = Array.isArray(raw) ? raw[0] : raw;
|
||||
const parsed = Number(value);
|
||||
return Number.isInteger(parsed) && parsed > 0 ? parsed : null;
|
||||
});
|
||||
|
||||
const syncViewModeFromRoute = () => {
|
||||
const groupId = routeGroupId.value;
|
||||
if (groupId) {
|
||||
state.viewMode.value = 'group_detail';
|
||||
if (selectedGroupId.value !== groupId) {
|
||||
selectedGroupId.value = groupId;
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (state.embedded) {
|
||||
state.viewMode.value = 'group_overview';
|
||||
if (selectedGroupId.value !== null) {
|
||||
selectedGroupId.value = null;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// --- 筛选/分页/路径上传历史联动 ---
|
||||
watch(selectedGroupId, (groupId) => {
|
||||
@@ -90,6 +113,10 @@ export function useKbWorkspace(options: UseKbWorkspaceOptions = {}) {
|
||||
applyPathUploadJob(latestPathUploadJob.value);
|
||||
});
|
||||
|
||||
watch(routeGroupId, () => {
|
||||
syncViewModeFromRoute();
|
||||
});
|
||||
|
||||
watch(documentStageFilter, () => {
|
||||
documentListPage.value = 1;
|
||||
});
|
||||
@@ -117,6 +144,7 @@ export function useKbWorkspace(options: UseKbWorkspaceOptions = {}) {
|
||||
});
|
||||
|
||||
onMounted(async () => {
|
||||
syncViewModeFromRoute();
|
||||
await Promise.all([data.loadGroups(), data.loadJobs()]);
|
||||
if (state.viewMode.value === 'group_detail') {
|
||||
await data.loadDocuments(selectedGroupId.value);
|
||||
|
||||
@@ -52,7 +52,7 @@ export const FAILURE_PAGE_SIZE = 15;
|
||||
export const PATH_UPLOAD_BATCH_SIZE = 30;
|
||||
export const PATH_UPLOAD_BATCH_INTERVAL_MS = 500;
|
||||
export const PATH_UPLOAD_CONCURRENCY = 3;
|
||||
export const DOCUMENT_PAGE_SIZE_OPTIONS = [20, 50, 100, 200] as const;
|
||||
export const DOCUMENT_PAGE_SIZE_OPTIONS = [10, 20, 50, 100] as const;
|
||||
|
||||
/** 未开始阶段的徽标样式,与 getStatusBadgeClass 默认一致 */
|
||||
export const IDLE_BADGE_CLASS = 'border-default bg-surface-soft text-muted';
|
||||
@@ -46,11 +46,12 @@ const kb = useKbWorkspace({ embedded: props.embedded });
|
||||
</div>
|
||||
<div class="flex flex-wrap items-center gap-3">
|
||||
<button
|
||||
v-if="kb.viewMode !== 'group_overview'"
|
||||
@click="kb.refreshCurrentView"
|
||||
class="btn-secondary"
|
||||
>
|
||||
<RefreshCw class="h-4 w-4" />
|
||||
{{ kb.viewMode === 'group_overview' ? kb.t('kbWorkspace.actions.refreshGroups') : kb.t('kbWorkspace.actions.refreshDocuments') }}
|
||||
{{ kb.t('kbWorkspace.actions.refreshDocuments') }}
|
||||
</button>
|
||||
<button
|
||||
v-if="kb.viewMode === 'group_overview'"
|
||||
@@ -66,9 +67,8 @@ const kb = useKbWorkspace({ embedded: props.embedded });
|
||||
|
||||
<template v-if="kb.viewMode === 'group_overview'">
|
||||
<section class="kb-ws-section">
|
||||
<div class="mb-4 flex items-center justify-between">
|
||||
<div class="mb-4 flex items-center">
|
||||
<h2 class="text-lg font-semibold text-primary">{{ kb.t('kbWorkspace.overview.title') }}</h2>
|
||||
<span class="text-xs text-muted">`/api/kb/groups`</span>
|
||||
</div>
|
||||
<div v-if="kb.isLoading" class="py-10 text-center text-sm text-muted">{{ kb.t('kbWorkspace.overview.loadingGroups') }}</div>
|
||||
<div v-else-if="kb.groups.length === 0" class="kb-ws-empty py-10 text-center text-sm text-muted">
|
||||
@@ -101,29 +101,6 @@ const kb = useKbWorkspace({ embedded: props.embedded });
|
||||
</template>
|
||||
|
||||
<template v-else>
|
||||
<div class="kb-ws-stat-grid">
|
||||
<div
|
||||
v-for="item in kb.groupSummaryItems"
|
||||
:key="item.label"
|
||||
class="kb-ws-stat-tile "
|
||||
:class="[
|
||||
item.wide ? 'col-span-2 xl:col-span-2' : '',
|
||||
item.clickable
|
||||
? 'cursor-pointer hover:bg-rose-50 hover:bg-rose-50'
|
||||
: '',
|
||||
]"
|
||||
@click="item.clickable && item.failureType ? kb.openFailureModal(item.failureType) : undefined"
|
||||
>
|
||||
<div
|
||||
class="text-base font-semibold text-primary break-words"
|
||||
:style="item.wide ? '-webkit-line-clamp: 2; -webkit-box-orient: vertical; display: -webkit-box; overflow: hidden;' : undefined"
|
||||
>
|
||||
{{ item.value }}
|
||||
</div>
|
||||
<div class="mt-1 text-xs text-muted">{{ item.label }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid grid-cols-1 gap-6 lg:grid-cols-[320px_minmax(0,1fr)]">
|
||||
<input
|
||||
:ref="(el) => { kb.fileInputRef = el as HTMLInputElement | null }"
|
||||
type="file"
|
||||
@@ -140,54 +117,49 @@ const kb = useKbWorkspace({ embedded: props.embedded });
|
||||
class="hidden"
|
||||
@change="kb.handlePathFilesSelected"
|
||||
/>
|
||||
<section class="kb-ws-section">
|
||||
<div class="mb-4 flex items-center justify-between">
|
||||
<h2 class="text-lg font-semibold text-primary">{{ kb.t('kbWorkspace.sidebar.groupsTitle') }}</h2>
|
||||
</div>
|
||||
|
||||
<div v-if="kb.isLoading" class="py-10 text-center text-sm text-muted">{{ kb.t('kbWorkspace.sidebar.loadingGroups') }}</div>
|
||||
<div v-else-if="kb.groups.length === 0" class="rounded-2xl border border-dashed border-default px-4 py-8 text-center text-sm text-muted ">
|
||||
{{ kb.t('kbWorkspace.sidebar.emptyGroups') }}
|
||||
</div>
|
||||
<div v-else class="space-y-3">
|
||||
<button
|
||||
v-for="group in kb.groups"
|
||||
:key="group.id"
|
||||
@click="kb.selectedGroupId = group.id"
|
||||
class="kb-ws-group-list-btn"
|
||||
:class="{ 'kb-ws-group-list-btn--active': kb.selectedGroupId === group.id }"
|
||||
>
|
||||
<div class="flex items-start justify-between gap-3">
|
||||
<div class="min-w-0">
|
||||
<div class="truncate font-semibold">{{ group.name }}</div>
|
||||
<div class="mt-1 text-sm opacity-80">{{ group.description || kb.t('kbWorkspace.sidebar.noDescription') }}</div>
|
||||
</div>
|
||||
<span class="rounded-full bg-surface/70 px-2 py-1 text-xs ">
|
||||
{{ group.document_count ?? 0 }}
|
||||
</span>
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="space-y-6">
|
||||
<div class="kb-ws-section">
|
||||
<div class="flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between">
|
||||
<div class="min-w-0">
|
||||
<div class="text-xs font-medium text-muted">{{ kb.t('kbWorkspace.summary.currentGroup') }}</div>
|
||||
<h2 class="mt-1 text-2xl font-bold text-primary break-words">{{ kb.selectedGroup?.name || '--' }}</h2>
|
||||
<p class="mt-2 max-w-3xl text-sm text-muted">
|
||||
{{ kb.selectedGroup?.description || kb.t('kbWorkspace.overview.noDescription') }}
|
||||
</p>
|
||||
</div>
|
||||
<div class="grid min-w-full grid-cols-2 gap-2 sm:grid-cols-5 lg:min-w-[520px]">
|
||||
<button
|
||||
v-for="item in kb.groupSummaryItems.filter((summary) => !summary.wide)"
|
||||
:key="item.label"
|
||||
type="button"
|
||||
class="rounded-2xl border border-default bg-surface-soft px-3 py-3 text-left transition-colors"
|
||||
:class="item.clickable ? 'hover:border-rose-200 hover:bg-rose-50' : ''"
|
||||
@click="item.clickable && item.failureType ? kb.openFailureModal(item.failureType) : undefined"
|
||||
>
|
||||
<div class="text-lg font-semibold text-primary">{{ item.value }}</div>
|
||||
<div class="mt-1 text-xs text-muted">{{ item.label }}</div>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="kb-ws-section">
|
||||
<div class="mb-4 space-y-3">
|
||||
<div class="flex flex-wrap items-center justify-between gap-3">
|
||||
<div class="flex items-center gap-2">
|
||||
<h2 class="text-lg font-semibold text-primary">{{ kb.t('kbWorkspace.documents.title') }}</h2>
|
||||
<div class="group relative">
|
||||
<button
|
||||
type="button"
|
||||
class="inline-flex h-6 w-6 items-center justify-center rounded-full border border-default text-muted transition-colors hover:border-brand-300 hover:text-brand-500 hover:border-brand-300 hover:text-brand-600"
|
||||
>
|
||||
<Info class="h-3.5 w-3.5" />
|
||||
</button>
|
||||
<div class="pointer-events-none absolute left-0 top-8 z-10 hidden w-80 rounded-2xl border border-default bg-surface px-4 py-3 text-sm text-muted shadow-xl group-hover:block">
|
||||
{{ kb.t('kbWorkspace.documents.infoTip') }}
|
||||
<h2 class="text-lg font-semibold text-primary">{{ kb.t('kbWorkspace.documents.title') }}</h2>
|
||||
<div class="group relative">
|
||||
<button
|
||||
type="button"
|
||||
class="inline-flex h-6 w-6 items-center justify-center rounded-full border border-default text-muted transition-colors hover:border-brand-300 hover:text-brand-600"
|
||||
>
|
||||
<Info class="h-3.5 w-3.5" />
|
||||
</button>
|
||||
<div class="pointer-events-none absolute left-0 top-8 z-10 hidden w-80 rounded-2xl border border-default bg-surface px-4 py-3 text-sm text-muted shadow-xl group-hover:block">
|
||||
{{ kb.t('kbWorkspace.documents.infoTip') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-wrap items-center gap-3">
|
||||
<button
|
||||
v-if="kb.selectedGroupId"
|
||||
@@ -209,62 +181,6 @@ const kb = useKbWorkspace({ embedded: props.embedded });
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-wrap items-center gap-3">
|
||||
<button
|
||||
v-if="kb.isKbAdmin && kb.selectedGroupId"
|
||||
@click="kb.handleBatchClean"
|
||||
:disabled="kb.batchSubmitting || kb.selectedDocuments.length === 0"
|
||||
class="inline-flex items-center gap-2 rounded-2xl border border-amber-200 px-4 py-2.5 text-sm font-medium text-amber-700 transition-colors hover:bg-amber-50 disabled:cursor-not-allowed disabled:opacity-60"
|
||||
>
|
||||
<RefreshCw class="h-4 w-4" />
|
||||
{{ kb.batchActionLabel('clean', kb.batchSubmitting, kb.selectedDocuments.length) }}
|
||||
</button>
|
||||
<button
|
||||
v-if="kb.isKbAdmin && kb.selectedGroupId"
|
||||
@click="kb.handleBatchSync"
|
||||
:disabled="kb.batchSubmitting || kb.selectedDocuments.length === 0"
|
||||
class="inline-flex items-center gap-2 rounded-2xl border border-emerald-200 px-4 py-2.5 text-sm font-medium text-emerald-700 transition-colors hover:bg-emerald-50 disabled:cursor-not-allowed disabled:opacity-60 border-emerald-200"
|
||||
>
|
||||
<RefreshCw class="h-4 w-4" />
|
||||
{{ kb.batchActionLabel('sync', kb.batchSubmitting, kb.selectedDocuments.length) }}
|
||||
</button>
|
||||
<button
|
||||
v-if="kb.selectedGroupId"
|
||||
@click="kb.handleBatchDelete"
|
||||
:disabled="kb.batchSubmitting || kb.selectedDocuments.length === 0"
|
||||
class="inline-flex items-center gap-2 rounded-2xl border border-rose-200 px-4 py-2.5 text-sm font-medium text-rose-600 transition-colors hover:bg-rose-50 disabled:cursor-not-allowed disabled:opacity-60 border-rose-200 hover:bg-rose-50"
|
||||
>
|
||||
<Trash2 class="h-4 w-4" />
|
||||
{{ kb.batchActionLabel('delete', kb.batchSubmitting, kb.selectedDocuments.length) }}
|
||||
</button>
|
||||
<button
|
||||
v-if="kb.selectedGroupId"
|
||||
@click="kb.openPathUploadHistoryModal()"
|
||||
class="btn-secondary"
|
||||
>
|
||||
<FileText class="h-4 w-4" />
|
||||
{{ kb.t('kbWorkspace.documents.historyBatches') }}
|
||||
</button>
|
||||
</div>
|
||||
<div v-if="kb.selectedGroupId" class="flex flex-wrap items-center gap-3">
|
||||
<label class="relative w-full max-w-md">
|
||||
<Search class="pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted" />
|
||||
<input
|
||||
v-model.trim="kb.documentKeyword"
|
||||
type="text"
|
||||
class="w-full rounded-2xl border border-default bg-surface py-2.5 pl-10 pr-4 text-sm text-primary outline-none transition-colors focus:border-brand-300"
|
||||
:placeholder="kb.t('kbWorkspace.documents.searchPlaceholder')"
|
||||
/>
|
||||
</label>
|
||||
<button
|
||||
v-if="kb.documentKeyword"
|
||||
type="button"
|
||||
@click="kb.documentKeyword = ''"
|
||||
class="inline-flex items-center rounded-xl border border-default px-3 py-2 text-sm font-medium text-secondary transition-colors hover:bg-surface-soft"
|
||||
>
|
||||
{{ kb.t('kbWorkspace.documents.clearSearch') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p
|
||||
@@ -373,41 +289,99 @@ const kb = useKbWorkspace({ embedded: props.embedded });
|
||||
</div>
|
||||
<div
|
||||
v-if="kb.selectedGroupId"
|
||||
class="mb-4 flex flex-wrap items-center justify-between gap-3 rounded-2xl bg-surface-soft px-4 py-3 "
|
||||
>
|
||||
<div class="flex flex-wrap items-center gap-2">
|
||||
<button
|
||||
@click="kb.toggleSelectAllFiltered"
|
||||
class="inline-flex items-center gap-2 rounded-full border border-default bg-surface px-4 py-2 text-sm font-medium text-secondary transition-colors hover:bg-surface-soft hover-surface-soft"
|
||||
>
|
||||
{{ kb.isAllFilteredSelected ? kb.t('kbWorkspace.pathUpload.deselectAllFiltered') : kb.t('kbWorkspace.pathUpload.selectAllFiltered') }}
|
||||
</button>
|
||||
<button
|
||||
v-for="tab in kb.stageFilterTabs"
|
||||
:key="tab.key"
|
||||
@click="kb.documentStageFilter = tab.key"
|
||||
class="inline-flex items-center gap-2 rounded-full border px-4 py-2 text-sm font-medium transition-colors"
|
||||
:class="kb.documentStageFilter === tab.key
|
||||
? 'border-brand-200 bg-brand-50 text-brand-700 border-brand-200 '
|
||||
: 'border-default bg-surface text-secondary hover:bg-surface-soft hover-surface-soft'"
|
||||
>
|
||||
<span>{{ tab.label }}</span>
|
||||
<span class="rounded-full bg-surface-soft px-2 py-0.5 text-xs ">{{ tab.count }}</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="flex flex-wrap items-center gap-3 text-sm text-muted">
|
||||
<label class="inline-flex items-center gap-2">
|
||||
<span>{{ kb.t('kbWorkspace.common.perPage') }}</span>
|
||||
<select
|
||||
v-model.number="kb.documentListPageSize"
|
||||
class="rounded-xl border border-default bg-surface px-3 py-1.5 text-sm text-secondary outline-none transition-colors focus:border-brand-300"
|
||||
class="mb-4 space-y-3 rounded-2xl bg-surface-soft px-4 py-3"
|
||||
>
|
||||
<div class="flex flex-col gap-3 xl:flex-row xl:items-center xl:justify-between">
|
||||
<div class="flex flex-wrap items-center gap-2">
|
||||
<button
|
||||
v-for="tab in kb.stageFilterTabs"
|
||||
:key="tab.key"
|
||||
@click="kb.documentStageFilter = tab.key"
|
||||
class="inline-flex items-center gap-2 rounded-full border px-4 py-2 text-sm font-medium transition-colors"
|
||||
:class="kb.documentStageFilter === tab.key
|
||||
? 'border-brand-200 bg-brand-50 text-brand-700'
|
||||
: 'border-default bg-surface text-secondary hover:bg-surface-soft'"
|
||||
>
|
||||
<option v-for="size in kb.DOCUMENT_PAGE_SIZE_OPTIONS" :key="size" :value="size">{{ size }}</option>
|
||||
</select>
|
||||
<span>{{ kb.t('kbWorkspace.common.countUnit') }}</span>
|
||||
</label>
|
||||
<span>{{ kb.t('kbWorkspace.documents.selectedCount', { selected: kb.selectedDocuments.length, total: kb.filteredDocuments.length }) }}</span>
|
||||
<span v-if="kb.filteredDocuments.length > 0">{{ kb.t('kbWorkspace.documents.showingRange', { start: kb.pagedDocumentRange.start, end: kb.pagedDocumentRange.end }) }}</span>
|
||||
<span>{{ tab.label }}</span>
|
||||
<span class="rounded-full bg-surface-soft px-2 py-0.5 text-xs">{{ tab.count }}</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="flex flex-wrap items-center gap-3 text-sm text-muted">
|
||||
<label class="relative min-w-[260px] flex-1 xl:w-80 xl:flex-none">
|
||||
<Search class="pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted" />
|
||||
<input
|
||||
v-model.trim="kb.documentKeyword"
|
||||
type="text"
|
||||
class="w-full rounded-2xl border border-default bg-surface py-2.5 pl-10 pr-4 text-sm text-primary outline-none transition-colors focus:border-brand-300"
|
||||
:placeholder="kb.t('kbWorkspace.documents.searchPlaceholder')"
|
||||
/>
|
||||
</label>
|
||||
<button
|
||||
v-if="kb.documentKeyword"
|
||||
type="button"
|
||||
@click="kb.documentKeyword = ''"
|
||||
class="inline-flex items-center rounded-xl border border-default bg-surface px-3 py-2 text-sm font-medium text-secondary transition-colors hover:bg-surface-soft"
|
||||
>
|
||||
{{ kb.t('kbWorkspace.documents.clearSearch') }}
|
||||
</button>
|
||||
<label class="inline-flex items-center gap-2">
|
||||
<span>{{ kb.t('kbWorkspace.common.perPage') }}</span>
|
||||
<select
|
||||
v-model.number="kb.documentListPageSize"
|
||||
class="rounded-xl border border-default bg-surface px-3 py-1.5 text-sm text-secondary outline-none transition-colors focus:border-brand-300"
|
||||
>
|
||||
<option v-for="size in kb.DOCUMENT_PAGE_SIZE_OPTIONS" :key="size" :value="size">{{ size }}</option>
|
||||
</select>
|
||||
<span>{{ kb.t('kbWorkspace.common.countUnit') }}</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-col gap-3 border-t border-default pt-3 lg:flex-row lg:items-center lg:justify-between">
|
||||
<div class="flex flex-wrap items-center gap-2">
|
||||
<button
|
||||
@click="kb.toggleSelectAllFiltered"
|
||||
class="inline-flex items-center gap-2 rounded-full border border-default bg-surface px-4 py-2 text-sm font-medium text-secondary transition-colors hover:bg-surface-soft"
|
||||
>
|
||||
{{ kb.isAllFilteredSelected ? kb.t('kbWorkspace.pathUpload.deselectAllFiltered') : kb.t('kbWorkspace.pathUpload.selectAllFiltered') }}
|
||||
</button>
|
||||
<button
|
||||
v-if="kb.isKbAdmin"
|
||||
@click="kb.handleBatchClean"
|
||||
:disabled="kb.batchSubmitting || kb.selectedDocuments.length === 0"
|
||||
class="inline-flex items-center gap-2 rounded-full border border-amber-200 bg-surface px-4 py-2 text-sm font-medium text-amber-700 transition-colors hover:bg-amber-50 disabled:cursor-not-allowed disabled:opacity-60"
|
||||
>
|
||||
<RefreshCw class="h-4 w-4" />
|
||||
{{ kb.batchActionLabel('clean', kb.batchSubmitting, kb.selectedDocuments.length) }}
|
||||
</button>
|
||||
<button
|
||||
v-if="kb.isKbAdmin"
|
||||
@click="kb.handleBatchSync"
|
||||
:disabled="kb.batchSubmitting || kb.selectedDocuments.length === 0"
|
||||
class="inline-flex items-center gap-2 rounded-full border border-emerald-200 bg-surface px-4 py-2 text-sm font-medium text-emerald-700 transition-colors hover:bg-emerald-50 disabled:cursor-not-allowed disabled:opacity-60"
|
||||
>
|
||||
<RefreshCw class="h-4 w-4" />
|
||||
{{ kb.batchActionLabel('sync', kb.batchSubmitting, kb.selectedDocuments.length) }}
|
||||
</button>
|
||||
<button
|
||||
@click="kb.handleBatchDelete"
|
||||
:disabled="kb.batchSubmitting || kb.selectedDocuments.length === 0"
|
||||
class="inline-flex items-center gap-2 rounded-full border border-rose-200 bg-surface px-4 py-2 text-sm font-medium text-rose-600 transition-colors hover:bg-rose-50 disabled:cursor-not-allowed disabled:opacity-60"
|
||||
>
|
||||
<Trash2 class="h-4 w-4" />
|
||||
{{ kb.batchActionLabel('delete', kb.batchSubmitting, kb.selectedDocuments.length) }}
|
||||
</button>
|
||||
<button
|
||||
@click="kb.openPathUploadHistoryModal()"
|
||||
class="inline-flex items-center gap-2 rounded-full border border-default bg-surface px-4 py-2 text-sm font-medium text-secondary transition-colors hover:bg-surface-soft"
|
||||
>
|
||||
<FileText class="h-4 w-4" />
|
||||
{{ kb.t('kbWorkspace.documents.historyBatches') }}
|
||||
</button>
|
||||
</div>
|
||||
<div class="flex flex-wrap items-center gap-3 text-sm text-muted">
|
||||
<span>{{ kb.t('kbWorkspace.documents.selectedCount', { selected: kb.selectedDocuments.length, total: kb.filteredDocuments.length }) }}</span>
|
||||
<span v-if="kb.filteredDocuments.length > 0">{{ kb.t('kbWorkspace.documents.showingRange', { start: kb.pagedDocumentRange.start, end: kb.pagedDocumentRange.end }) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -424,13 +398,13 @@ const kb = useKbWorkspace({ embedded: props.embedded });
|
||||
<div
|
||||
v-for="doc in kb.pagedFilteredDocuments"
|
||||
:key="doc.id"
|
||||
class="rounded-2xl border px-4 py-4 transition-colors"
|
||||
class="rounded-2xl border px-4 py-3 transition-colors"
|
||||
:class="kb.selectedDocumentId === doc.id
|
||||
? 'border-brand-200 bg-brand-50/50 border-brand-200'
|
||||
: 'border-default'"
|
||||
>
|
||||
<div class="flex items-start justify-between gap-3">
|
||||
<div class="flex min-w-0 flex-1 gap-3">
|
||||
<div class="grid gap-3 xl:grid-cols-[minmax(0,1.3fr)_minmax(360px,0.9fr)_auto] xl:items-center">
|
||||
<div class="flex min-w-0 gap-3">
|
||||
<label class="mt-1 inline-flex shrink-0 cursor-pointer items-center">
|
||||
<input
|
||||
type="checkbox"
|
||||
@@ -440,35 +414,53 @@ const kb = useKbWorkspace({ embedded: props.embedded });
|
||||
/>
|
||||
</label>
|
||||
<div class="min-w-0 flex-1">
|
||||
<button
|
||||
@click="kb.openMarkdownEditor(doc)"
|
||||
class="block max-w-full truncate text-left font-semibold text-primary transition-colors hover:text-brand-600 hover:text-brand-600"
|
||||
>
|
||||
{{ kb.getDocumentDisplayTitle(doc) }}
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
@click="kb.openSourceInfo(doc)"
|
||||
class="mt-1 block max-w-full text-left text-sm text-muted transition-colors hover:text-brand-600 hover:text-brand-600"
|
||||
>
|
||||
{{ kb.getDocumentDisplayDescription(doc) }}
|
||||
</button>
|
||||
<div class="mt-2 text-xs text-muted">
|
||||
<span>{{ kb.t('kbWorkspace.documents.versionCount', { count: doc.version_count ?? 0 }) }}</span>
|
||||
<span v-if="doc.latest_version">
|
||||
<span>{{ kb.t('kbWorkspace.documents.currentVersion', { version: doc.latest_version.version_no }) }}</span>
|
||||
<button
|
||||
@click="kb.openMarkdownEditor(doc)"
|
||||
class="block max-w-full truncate text-left font-semibold text-primary transition-colors hover:text-brand-600 hover:text-brand-600"
|
||||
>
|
||||
{{ kb.getDocumentDisplayTitle(doc) }}
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
@click="kb.openSourceInfo(doc)"
|
||||
class="mt-1 block max-w-full truncate text-left text-sm text-muted transition-colors hover:text-brand-600 hover:text-brand-600"
|
||||
>
|
||||
{{ kb.getDocumentDisplayDescription(doc) }}
|
||||
</button>
|
||||
<div class="mt-2 flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-muted">
|
||||
<span>{{ kb.t('kbWorkspace.documents.versionCount', { count: doc.version_count ?? 0 }) }}</span>
|
||||
<span v-if="doc.latest_version">{{ kb.t('kbWorkspace.documents.currentVersion', { version: doc.latest_version.version_no }) }}</span>
|
||||
<button
|
||||
v-if="doc.latest_version"
|
||||
type="button"
|
||||
@click="kb.openSourceInfo(doc)"
|
||||
class="inline text-xs text-muted underline-offset-2 transition-colors hover:text-brand-600 hover:underline hover:text-brand-600"
|
||||
>
|
||||
class="max-w-full truncate text-xs text-muted underline-offset-2 transition-colors hover:text-brand-600 hover:underline hover:text-brand-600"
|
||||
>
|
||||
{{ doc.latest_version.source_file_name }}
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
<span>{{ kb.t('kbWorkspace.documents.updatedAt', { time: kb.formatDateTime(doc.updated_at) }) }}</span>
|
||||
</div>
|
||||
<div
|
||||
v-if="kb.getDocumentWorkflowState(doc).primaryError"
|
||||
class="mt-1 max-w-xl text-xs text-rose-500"
|
||||
>
|
||||
{{ kb.t('kbWorkspace.common.failureReason', { reason: kb.getDocumentWorkflowState(doc).primaryError }) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center gap-2">
|
||||
|
||||
<div class="flex flex-wrap items-center gap-2 xl:justify-end">
|
||||
<div
|
||||
v-for="badge in kb.getWorkflowBadges(doc)"
|
||||
:key="`${doc.id}-${badge.label}`"
|
||||
class="inline-flex items-center rounded-full border px-3 py-1 text-xs font-semibold"
|
||||
:class="badge.className"
|
||||
>
|
||||
{{ badge.label }}:{{ badge.value }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-wrap items-center gap-2 xl:justify-end">
|
||||
<button
|
||||
@click="kb.openDocumentDetail(doc.id)"
|
||||
class="inline-flex items-center gap-1 rounded-xl border border-violet-200 px-3 py-2 text-xs font-medium text-violet-700 transition-colors hover:bg-violet-50"
|
||||
@@ -501,32 +493,9 @@ const kb = useKbWorkspace({ embedded: props.embedded });
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-4 flex items-end justify-between gap-3 border-t border-default pt-3 ">
|
||||
<div class="space-y-1">
|
||||
<div class="text-xs text-muted">
|
||||
{{ kb.t('kbWorkspace.documents.updatedAt', { time: kb.formatDateTime(doc.updated_at) }) }}
|
||||
</div>
|
||||
<div
|
||||
v-if="kb.getDocumentWorkflowState(doc).primaryError"
|
||||
class="max-w-xl text-xs text-rose-500"
|
||||
>
|
||||
{{ kb.t('kbWorkspace.common.failureReason', { reason: kb.getDocumentWorkflowState(doc).primaryError }) }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-wrap items-center justify-end gap-2">
|
||||
<div
|
||||
v-for="badge in kb.getWorkflowBadges(doc)"
|
||||
:key="`${doc.id}-${badge.label}`"
|
||||
class="inline-flex items-center rounded-full border px-3 py-1 text-sm font-semibold"
|
||||
:class="badge.className"
|
||||
>
|
||||
{{ badge.label }}:{{ badge.value }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
v-if="kb.filteredDocuments.length > kb.documentListPageSize"
|
||||
v-if="kb.filteredDocuments.length > 0"
|
||||
class="flex flex-wrap items-center justify-between gap-3 rounded-2xl border border-default px-4 py-3 "
|
||||
>
|
||||
<div class="text-sm text-muted">
|
||||
@@ -552,7 +521,6 @@ const kb = useKbWorkspace({ embedded: props.embedded });
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -6,11 +6,15 @@
|
||||
import { inject } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import {
|
||||
LayoutGrid, Bot, FileText, User, LogOut, Edit, Megaphone, Clock, Package,
|
||||
LayoutGrid, Bot, FileText, User, LogOut, Edit, Megaphone, Clock, Package, PanelLeftClose, PanelLeftOpen,
|
||||
} from 'lucide-vue-next';
|
||||
import { WORKSPACE_PATHS } from '../constants/routes';
|
||||
import { WORKSPACE_KEY } from '../composables/workspace.context';
|
||||
|
||||
defineProps<{
|
||||
collapsed?: boolean;
|
||||
}>();
|
||||
|
||||
const ws = inject(WORKSPACE_KEY)! as any;
|
||||
const route = useRoute();
|
||||
|
||||
@@ -30,54 +34,97 @@ function isActive(match: readonly string[]) {
|
||||
|
||||
<template>
|
||||
<aside class="lg:sticky lg:top-0 lg:h-screen">
|
||||
<div class="flex h-full flex-col border-r border-default bg-surface px-5 py-6 shadow-sm">
|
||||
<div class="border-b border-subtle pb-6">
|
||||
<div class="flex items-center gap-3">
|
||||
<div class="flex h-12 w-12 items-center justify-center rounded-2xl bg-gradient-to-br from-brand-500 via-brand-600 to-purple-600 text-white shadow-lg shadow-brand-500/25">
|
||||
<Bot class="h-6 w-6" />
|
||||
<div
|
||||
class="flex h-full flex-col border-r border-default bg-surface shadow-sm transition-all duration-200"
|
||||
:class="collapsed ? 'px-3 py-4' : 'px-4 py-4'"
|
||||
>
|
||||
<template v-if="collapsed">
|
||||
<button
|
||||
type="button"
|
||||
class="mb-6 inline-flex h-10 w-full items-center justify-center rounded-xl text-muted transition-colors hover:bg-surface-soft hover:text-secondary"
|
||||
:title="$t('workspace.expandSidebar')"
|
||||
@click="ws.toggleSidebarCollapsed"
|
||||
>
|
||||
<PanelLeftOpen class="h-5 w-5" />
|
||||
</button>
|
||||
</template>
|
||||
|
||||
<div class="border-b border-subtle pb-4">
|
||||
<div class="flex items-center gap-3" :class="collapsed ? 'justify-center' : ''">
|
||||
<div class="flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-gradient-to-br from-brand-500 via-brand-600 to-sky-600 text-sm font-bold text-white shadow-sm shadow-brand-500/25">
|
||||
AI
|
||||
</div>
|
||||
<div class="min-w-0">
|
||||
<div class="text-2xl font-extrabold tracking-tight text-primary">{{ $t('workspace.brandTitle') }}</div>
|
||||
<div class="truncate text-xs font-medium text-muted">
|
||||
<div v-if="!collapsed" class="min-w-0 flex-1">
|
||||
<div class="truncate text-lg font-bold text-primary">{{ $t('workspace.brandTitle') }}</div>
|
||||
<div class="mt-1 truncate text-[11px] text-muted">
|
||||
{{ ws.currentUser?.username }} / {{ ws.currentUser?.role }}
|
||||
</div>
|
||||
</div>
|
||||
<button
|
||||
v-if="!collapsed"
|
||||
type="button"
|
||||
class="ml-2 inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-xl text-muted transition-colors hover:bg-surface-soft hover:text-secondary"
|
||||
:title="$t('workspace.collapseSidebar')"
|
||||
@click="ws.toggleSidebarCollapsed"
|
||||
>
|
||||
<PanelLeftClose class="h-5 w-5" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex-1 py-6">
|
||||
<div class="flex-1 py-4">
|
||||
<nav class="space-y-2">
|
||||
<RouterLink
|
||||
v-for="item in linkItems"
|
||||
:key="item.path"
|
||||
:to="item.path"
|
||||
class="ws-nav-btn"
|
||||
:class="{ 'ws-nav-btn--active': isActive(item.match) }"
|
||||
:class="[
|
||||
{ 'ws-nav-btn--active': isActive(item.match) },
|
||||
collapsed ? 'justify-center px-0' : '',
|
||||
]"
|
||||
:title="$t(item.labelKey)"
|
||||
>
|
||||
<component :is="item.icon" class="h-4 w-4" />
|
||||
<span>{{ $t(item.labelKey) }}</span>
|
||||
<component :is="item.icon" class="h-[18px] w-[18px]" />
|
||||
<span v-if="!collapsed">{{ $t(item.labelKey) }}</span>
|
||||
</RouterLink>
|
||||
<button
|
||||
type="button"
|
||||
class="ws-nav-btn w-full"
|
||||
:class="{ 'ws-nav-btn--active': isActive(['workspace-knowledge-base']) }"
|
||||
:class="[
|
||||
{ 'ws-nav-btn--active': isActive(['workspace-knowledge-base', 'workspace-knowledge-base-group']) },
|
||||
collapsed ? 'justify-center px-0' : '',
|
||||
]"
|
||||
:title="$t('workspace.nav.knowledgeBase')"
|
||||
@click="ws.navigateToKnowledgeBase"
|
||||
>
|
||||
<FileText class="h-4 w-4" />
|
||||
<span>{{ $t('workspace.nav.knowledgeBase') }}</span>
|
||||
<FileText class="h-[18px] w-[18px]" />
|
||||
<span v-if="!collapsed">{{ $t('workspace.nav.knowledgeBase') }}</span>
|
||||
</button>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="border-t border-subtle pt-6">
|
||||
<div class="border-t border-subtle pt-4">
|
||||
<div class="space-y-2">
|
||||
<button type="button" @click="ws.navigateToGeneralChat" class="ws-nav-btn">
|
||||
<Bot class="h-4 w-4" />
|
||||
<span>{{ $t('workspace.nav.backToChat') }}</span>
|
||||
<button
|
||||
type="button"
|
||||
@click="ws.navigateToGeneralChat"
|
||||
class="ws-nav-btn"
|
||||
:class="collapsed ? 'justify-center px-0' : ''"
|
||||
:title="$t('workspace.nav.backToChat')"
|
||||
>
|
||||
<Bot class="h-[18px] w-[18px]" />
|
||||
<span v-if="!collapsed">{{ $t('workspace.nav.backToChat') }}</span>
|
||||
</button>
|
||||
<button type="button" @click="ws.handleLogout" class="ws-nav-btn ws-nav-btn--danger">
|
||||
<LogOut class="h-4 w-4" />
|
||||
<span>{{ $t('workspace.nav.logout') }}</span>
|
||||
<button
|
||||
type="button"
|
||||
@click="ws.handleLogout"
|
||||
class="ws-nav-btn ws-nav-btn--danger"
|
||||
:class="collapsed ? 'justify-center px-0' : ''"
|
||||
:title="$t('workspace.nav.logout')"
|
||||
>
|
||||
<LogOut class="h-[18px] w-[18px]" />
|
||||
<span v-if="!collapsed">{{ $t('workspace.nav.logout') }}</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -30,6 +30,7 @@ export function useWorkspace() {
|
||||
const deps = { t, locale, msg, router, route, setThemePreference, appliedTheme };
|
||||
const isLoading = ref(true);
|
||||
const currentUser = ref<WorkspaceUser | null>(null);
|
||||
const isSidebarCollapsed = ref(false);
|
||||
|
||||
const sessionRef: { handleLogout?: () => void } = {};
|
||||
const home = useWorkspaceHome(deps, {
|
||||
@@ -65,6 +66,7 @@ export function useWorkspace() {
|
||||
onMounted(async () => {
|
||||
window.addEventListener('hxops:logout', session.onAuthLogout);
|
||||
localeApi.loadLanguagePreference();
|
||||
isSidebarCollapsed.value = localStorage.getItem('hxops.workspace.sidebarCollapsed') === 'true';
|
||||
|
||||
session.loadAuthUser();
|
||||
if (!session.isLoggedIn.value) {
|
||||
@@ -88,6 +90,11 @@ export function useWorkspace() {
|
||||
window.removeEventListener('hxops:logout', session.onAuthLogout);
|
||||
});
|
||||
|
||||
const toggleSidebarCollapsed = () => {
|
||||
isSidebarCollapsed.value = !isSidebarCollapsed.value;
|
||||
localStorage.setItem('hxops.workspace.sidebarCollapsed', String(isSidebarCollapsed.value));
|
||||
};
|
||||
|
||||
return reactive({
|
||||
config,
|
||||
msg,
|
||||
@@ -95,6 +102,8 @@ export function useWorkspace() {
|
||||
route,
|
||||
isMobile,
|
||||
isLoading,
|
||||
isSidebarCollapsed,
|
||||
toggleSidebarCollapsed,
|
||||
...localeApi,
|
||||
...session,
|
||||
...home,
|
||||
|
||||
@@ -17,6 +17,7 @@ const ROUTE_NAME_TO_SIDEBAR: Record<string, WorkspaceSidebarItem> = {
|
||||
'workspace-applications': 'applications',
|
||||
'workspace-updates': 'updates',
|
||||
'workspace-knowledge-base': 'knowledge_base',
|
||||
'workspace-knowledge-base-group': 'knowledge_base',
|
||||
'workspace-schedule-runs': 'schedule_runs',
|
||||
'workspace-shipping-notice': 'shipping_notice',
|
||||
'workspace-feedback': 'feedback',
|
||||
@@ -173,7 +174,7 @@ export function useWorkspaceNavigation(deps: WorkspaceDeps, options: NavigationO
|
||||
if (name === 'workspace-schedule-runs') {
|
||||
await loadWorkspaceScheduleRuns();
|
||||
}
|
||||
if (name === 'workspace-knowledge-base' && !hasKnowledgeBaseAccess.value) {
|
||||
if (['workspace-knowledge-base', 'workspace-knowledge-base-group'].includes(name) && !hasKnowledgeBaseAccess.value) {
|
||||
showKnowledgeBaseAccessDenied();
|
||||
await router.replace(WORKSPACE_PATHS.applications);
|
||||
}
|
||||
|
||||
@@ -42,8 +42,11 @@ const mobileTabs = [
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div class="grid min-h-screen gap-0 lg:grid-cols-[232px_minmax(0,1fr)]">
|
||||
<WorkspaceSidebar v-if="!ws.isMobile" />
|
||||
<div
|
||||
class="grid min-h-screen gap-0 transition-[grid-template-columns] duration-200"
|
||||
:class="ws.isMobile ? '' : (ws.isSidebarCollapsed ? 'lg:grid-cols-[72px_minmax(0,1fr)]' : 'lg:grid-cols-[320px_minmax(0,1fr)]')"
|
||||
>
|
||||
<WorkspaceSidebar v-if="!ws.isMobile" :collapsed="ws.isSidebarCollapsed" />
|
||||
|
||||
<section class="ws-main" :class="ws.isMobile ? 'pb-20' : ''">
|
||||
<RouterView />
|
||||
|
||||
@@ -144,9 +144,10 @@
|
||||
},
|
||||
"filters": {
|
||||
"all": "All",
|
||||
"upload": "Upload",
|
||||
"clean": "Clean",
|
||||
"sync": "Sync"
|
||||
"pendingClean": "Pending clean",
|
||||
"cleaning": "Cleaning",
|
||||
"pendingSync": "Pending sync",
|
||||
"failed": "Failed"
|
||||
},
|
||||
"common": {
|
||||
"processing": "Processing...",
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
{
|
||||
"title": "AI Workspace",
|
||||
"brandTitle": "Hexin AI Workspace",
|
||||
"collapseSidebar": "Collapse sidebar",
|
||||
"expandSidebar": "Expand sidebar",
|
||||
"languageLabel": "Language",
|
||||
"userTitle": "{username}'s AI Workspace",
|
||||
"subtitle": "Choose an agent or click a quick question to start",
|
||||
|
||||
@@ -144,9 +144,10 @@
|
||||
},
|
||||
"filters": {
|
||||
"all": "ทั้งหมด",
|
||||
"upload": "อัปโหลด",
|
||||
"clean": "ทำความสะอาด",
|
||||
"sync": "ซิงค์"
|
||||
"pendingClean": "รอทำความสะอาด",
|
||||
"cleaning": "กำลังทำความสะอาด",
|
||||
"pendingSync": "รอซิงค์",
|
||||
"failed": "ผิดปกติ"
|
||||
},
|
||||
"common": {
|
||||
"processing": "กำลังดำเนินการ...",
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
{
|
||||
"title": "พื้นที่ทำงาน AI",
|
||||
"brandTitle": "Hexin AI Workspace",
|
||||
"collapseSidebar": "ยุบแถบนำทาง",
|
||||
"expandSidebar": "ขยายแถบนำทาง",
|
||||
"languageLabel": "ภาษา",
|
||||
"userTitle": "พื้นที่ทำงาน AI ของ {username}",
|
||||
"subtitle": "เลือกผู้ช่วยหรือคลิกคำถามด่วนเพื่อเริ่ม",
|
||||
|
||||
@@ -144,9 +144,10 @@
|
||||
},
|
||||
"filters": {
|
||||
"all": "全部",
|
||||
"upload": "上传",
|
||||
"clean": "清洗",
|
||||
"sync": "同步"
|
||||
"pendingClean": "待清洗",
|
||||
"cleaning": "清洗中",
|
||||
"pendingSync": "待同步",
|
||||
"failed": "异常"
|
||||
},
|
||||
"common": {
|
||||
"processing": "处理中...",
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
{
|
||||
"title": "AI 工作台",
|
||||
"brandTitle": "AI工作台",
|
||||
"collapseSidebar": "折叠导航栏",
|
||||
"expandSidebar": "展开导航栏",
|
||||
"languageLabel": "语言",
|
||||
"userTitle": "{username} 的 AI 工作台",
|
||||
"subtitle": "选择一个助手,或点击常用问题快速开始",
|
||||
|
||||
@@ -144,9 +144,10 @@
|
||||
},
|
||||
"filters": {
|
||||
"all": "全部",
|
||||
"upload": "上傳",
|
||||
"clean": "清洗",
|
||||
"sync": "同步"
|
||||
"pendingClean": "待清洗",
|
||||
"cleaning": "清洗中",
|
||||
"pendingSync": "待同步",
|
||||
"failed": "異常"
|
||||
},
|
||||
"common": {
|
||||
"processing": "處理中...",
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
{
|
||||
"title": "AI 工作台",
|
||||
"brandTitle": "AI工作台",
|
||||
"collapseSidebar": "折疊導航欄",
|
||||
"expandSidebar": "展開導航欄",
|
||||
"languageLabel": "語言",
|
||||
"userTitle": "{username} 的 AI 工作台",
|
||||
"subtitle": "選擇一個助手,或點擊常用問題快速開始",
|
||||
|
||||
@@ -765,7 +765,7 @@
|
||||
}
|
||||
|
||||
.ws-nav-btn {
|
||||
@apply flex w-full items-center gap-3 rounded-2xl px-4 py-3 text-left text-[15px] font-medium transition-all;
|
||||
@apply flex w-full items-center gap-3 rounded-xl px-4 py-3 text-left text-sm font-medium transition-all;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user