feat: 主页对话功能完善 — 会话列表、工作流执行、样式优化
- 新增会话列表 API(getSessionList)及类型定义 - 修复对话记录为空:兼容 API 返回 data.list 结构 - 删除接口改为 DELETE 方法,参数统一使用 id - 实现工作流执行逻辑,与内容创作对齐(含表单参数、文件上传、flowContent) - 动态表单样式优化:三段式布局防溢出、上传区支持拖拽、节点分组显示 - 对话记录时间格式化:当天显示 HH:mm,非当天显示日期 - 对话记录默认展示全部,移除分页展开 - 发送按钮支持选中工作流时空文本可点击 - 默认占位展示引导提示,替代空状态 - 添加对话记录删除确认弹窗 - 下载改用后端代理,避免跨域问题
This commit is contained in:
@@ -349,3 +349,45 @@ export function executeFlow(data: ExecuteFlowParams | FormData, requestOptions?:
|
||||
requestOptions,
|
||||
});
|
||||
}
|
||||
/** 删除工作空间结果(单个文件) */
|
||||
export function deleteExecutionResult(data: { id: string | number }, requestOptions?: RequestOptions) {
|
||||
return request({
|
||||
url: '/ai-agent/flow/execution/deleteResult',
|
||||
method: 'delete',
|
||||
data,
|
||||
requestOptions,
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除会话记录 */
|
||||
export function deleteExecutionSession(data: { id: string }, requestOptions?: RequestOptions) {
|
||||
return request({
|
||||
url: '/ai-agent/flow/execution/deleteSession',
|
||||
method: 'delete',
|
||||
data,
|
||||
requestOptions,
|
||||
});
|
||||
}
|
||||
|
||||
export interface SessionListResponse {
|
||||
code: number;
|
||||
message: string;
|
||||
data: SessionListItem[];
|
||||
}
|
||||
|
||||
export interface SessionListItem {
|
||||
id: string;
|
||||
flowName: string;
|
||||
sessionId: string;
|
||||
createDate: string;
|
||||
}
|
||||
|
||||
/** 获取会话记录列表 */
|
||||
export function getSessionList(requestOptions?: RequestOptions) {
|
||||
return request({
|
||||
url: '/ai-agent/flow/execution/sessionList',
|
||||
method: 'get',
|
||||
requestOptions,
|
||||
}) as Promise<SessionListResponse>;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user