fix(ui): 调整任务卡片和上传模态框的样式

修复任务卡片圆角大小和背景色不一致问题
优化文件上传模态框的按钮布局和样式
调整OCR控制项的间距和按钮类型
This commit is contained in:
Wenjie Zhang 2025-12-19 00:41:51 +08:00
parent b3d15c5f57
commit be3abc00b5
4 changed files with 26 additions and 16 deletions

View File

@ -155,7 +155,7 @@ class MinerUParser(BaseDocumentProcessor):
self.parse_endpoint, self.parse_endpoint,
files=files, files=files,
data=data, data=data,
timeout=300, # 5分钟超时 timeout=os.environ.get("MINERU_TIMEOUT", 600), # 10分钟超时
) )
# 检查响应状态 # 检查响应状态
@ -221,7 +221,7 @@ class MinerUParser(BaseDocumentProcessor):
except DocumentParserException: except DocumentParserException:
raise raise
except requests.exceptions.Timeout: except requests.exceptions.Timeout:
error_msg = f"MinerU 处理超时 ({time.time() - start_time:.2f}s)" error_msg = f"MinerU 处理超时 ({time.time() - start_time:.2f}s), 可以配置 MINERU_TIMEOUT 环境变量。"
logger.error(error_msg) logger.error(error_msg)
raise DocumentParserException(error_msg, self.get_service_name(), "timeout") raise DocumentParserException(error_msg, self.get_service_name(), "timeout")
except requests.exceptions.ConnectionError: except requests.exceptions.ConnectionError:

View File

@ -636,10 +636,10 @@ const _processStreamChunk = (chunk, threadId) => {
} }
// //
fetchThreadMessages({ agentId: currentAgentId.value, threadId: threadId, delay: 500 }) fetchThreadMessages({ agentId: currentAgentId.value, threadId: threadId, delay: 500 })
.finally(() => { .finally(() => {
// //
resetOnGoingConv(threadId, true); resetOnGoingConv(threadId, true);
}); });
return true; return true;
case 'interrupted': case 'interrupted':
// //
@ -651,7 +651,7 @@ const _processStreamChunk = (chunk, threadId) => {
message.info(chunkMessage); message.info(chunkMessage);
} }
fetchThreadMessages({ agentId: currentAgentId.value, threadId: threadId, delay: 1000 }) fetchThreadMessages({ agentId: currentAgentId.value, threadId: threadId, delay: 1000 })
.finally(() => { .finally(() => {
resetOnGoingConv(threadId, true); resetOnGoingConv(threadId, true);
}); });
return true; return true;

View File

@ -30,16 +30,15 @@
/> />
</div> </div>
<div class="config-controls"> <div class="config-controls">
<a-button type="link" class="doc-link-btn" @click="openDocLink">
<InfoCircleOutlined /> 文档处理与 OCR 说明
</a-button>
<a-button <a-button
type="dashed"
@click="showChunkConfigModal" @click="showChunkConfigModal"
:disabled="isGraphBased" :disabled="isGraphBased"
> >
<SettingOutlined /> 分块参数 ({{ chunkParams.chunk_size }}/{{ chunkParams.chunk_overlap }}) <SettingOutlined /> 分块参数 ({{ chunkParams.chunk_size }}/{{ chunkParams.chunk_overlap }})
</a-button> </a-button>
<a-button type="link" class="doc-link-btn" @click="openDocLink">
<InfoCircleOutlined /> 文档处理与 OCR 说明
</a-button>
</div> </div>
</div> </div>
@ -50,12 +49,10 @@
<a-select <a-select
v-model:value="chunkParams.enable_ocr" v-model:value="chunkParams.enable_ocr"
:options="enableOcrOptions" :options="enableOcrOptions"
style="width: 220px; margin-right: 12px;" style="width: 220px;"
:disabled="ocrHealthChecking" :disabled="ocrHealthChecking"
/> />
<a-button <a-button
size="small"
type="dashed"
@click="checkOcrHealth" @click="checkOcrHealth"
:loading="ocrHealthChecking" :loading="ocrHealthChecking"
:icon="h(CheckCircleOutlined)" :icon="h(CheckCircleOutlined)"
@ -781,6 +778,13 @@ const chunkData = async () => {
.config-controls { .config-controls {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 8px;
}
.doc-link-btn {
color: var(--main-600);
display: flex;
align-items: center;
} }
.source-segmented { .source-segmented {
@ -817,6 +821,12 @@ const chunkData = async () => {
padding: 16px; padding: 16px;
background-color: var(--gray-50); background-color: var(--gray-50);
border-radius: 6px; border-radius: 6px;
.ocr-controls {
display: flex;
align-items: center;
gap: 12px;
}
} }
.param-description { .param-description {

View File

@ -481,12 +481,12 @@ function canCancel(task) {
.task-card-error { .task-card-error {
font-size: 13px; font-size: 13px;
line-height: 1.45; line-height: 1.45;
border-radius: 10px; border-radius: 6px;
padding: 10px 12px; padding: 10px 12px;
} }
.task-card-message { .task-card-message {
background: var(--gray-50); background: var(--gray-100);
color: var(--gray-800); color: var(--gray-800);
} }