From df6e9ae6e67d9535a4349bf2a427a67a9372b732 Mon Sep 17 00:00:00 2001 From: wangdan-fit2cloud Date: Wed, 24 Dec 2025 15:40:35 +0800 Subject: [PATCH] feat: Knowledge base workflow icons and styles --- ui/src/api/knowledge/knowledge.ts | 20 ++++++++------ ui/src/components/app-icon/index.ts | 21 +++++++++++++++ ui/src/locales/lang/en-US/ai-chat.ts | 2 ++ ui/src/locales/lang/en-US/common.ts | 2 ++ ui/src/locales/lang/en-US/views/document.ts | 1 - ui/src/locales/lang/en-US/workflow.ts | 2 ++ ui/src/locales/lang/zh-CN/ai-chat.ts | 2 ++ ui/src/locales/lang/zh-CN/common.ts | 2 ++ ui/src/locales/lang/zh-CN/views/document.ts | 1 - ui/src/locales/lang/zh-CN/workflow.ts | 2 ++ ui/src/locales/lang/zh-Hant/ai-chat.ts | 2 ++ ui/src/locales/lang/zh-Hant/common.ts | 2 ++ ui/src/locales/lang/zh-Hant/views/document.ts | 1 - ui/src/locales/lang/zh-Hant/workflow.ts | 2 ++ ui/src/views/document/component/Status.vue | 2 +- .../ExecutionDetailDrawer.vue | 4 +-- .../ExecutionRecordDrawer.vue | 26 ++++++++++++------- ui/src/views/knowledge-workflow/index.vue | 17 ++++++------ 18 files changed, 80 insertions(+), 31 deletions(-) diff --git a/ui/src/api/knowledge/knowledge.ts b/ui/src/api/knowledge/knowledge.ts index 7e880210a..3b8b624a4 100644 --- a/ui/src/api/knowledge/knowledge.ts +++ b/ui/src/api/knowledge/knowledge.ts @@ -406,13 +406,13 @@ const putKnowledgeWorkflow: ( const exportKnowledgeWorkflow = ( knowledge_id: string, knowledge_name: string, - loading?: Ref + loading?: Ref, ) => { return exportFile( knowledge_name + '.kbwf', `${prefix.value}/${knowledge_id}/workflow/export`, undefined, - loading + loading, ) } /** @@ -421,12 +421,11 @@ const exportKnowledgeWorkflow = ( const importKnowledgeWorkflow: ( knowledge_id: string, data: any, - loading?:Ref -) => Promise> = (knowledge_id, data, loading)=>{ - return post(`${prefix.value}/${knowledge_id}/workflow/import`,data,undefined,loading) + loading?: Ref, +) => Promise> = (knowledge_id, data, loading) => { + return post(`${prefix.value}/${knowledge_id}/workflow/import`, data, undefined, loading) } - const listKnowledgeVersion: ( knowledge_id: string, loading?: Ref, @@ -470,7 +469,12 @@ const cancelWorkflowAction: ( knowledge_action_id: string, loading?: Ref, ) => Promise> = (knowledge_id: string, knowledge_action_id, loading) => { - return post(`${prefix.value}/${knowledge_id}/action/${knowledge_action_id}/cancel`, {}, loading) + return post( + `${prefix.value}/${knowledge_id}/action/${knowledge_action_id}/cancel`, + {}, + undefined, + loading, + ) } /** * mcp 节点 @@ -520,5 +524,5 @@ export default { getWorkflowActionPage, cancelWorkflowAction, exportKnowledgeWorkflow, - importKnowledgeWorkflow + importKnowledgeWorkflow, } diff --git a/ui/src/components/app-icon/index.ts b/ui/src/components/app-icon/index.ts index f8887cc12..05521823d 100644 --- a/ui/src/components/app-icon/index.ts +++ b/ui/src/components/app-icon/index.ts @@ -230,6 +230,27 @@ export const iconMap: any = { ]) }, }, + 'app-import': { + iconReader: () => { + return h('i', [ + h( + 'svg', + { + style: { height: '100%', width: '100%' }, + viewBox: '0 0 1024 1024', + version: '1.1', + xmlns: 'http://www.w3.org/2000/svg', + }, + [ + h('path', { + d: 'M519.381333 554.24l92.416 90.325333c8.533333 8.32 8.533333 21.845333 0 30.165334l-30.848 30.165333a22.186667 22.186667 0 0 1-30.890666 0L411.178667 569.173333l-30.890667-30.165333a41.984 41.984 0 0 1 0-60.330667l169.813333-165.973333a22.186667 22.186667 0 0 1 30.848 0l30.848 30.208c8.533333 8.32 8.533333 21.845333 0 30.165333l-100.437333 98.133334 405.376-1.706667h0.213333c12.032 0 21.76 9.642667 21.717334 21.418667l-0.170667 40.405333a21.589333 21.589333 0 0 1-21.76 21.248l-397.354667 1.706667zM674.688 170.666667H172.629333v682.666666h502.058667c12.032 0 21.802667 9.557333 21.802667 21.333334v42.666666c0 11.776-9.770667 21.333333-21.845334 21.333334H129.024A43.178667 43.178667 0 0 1 85.333333 896V128c0-23.552 19.541333-42.666667 43.648-42.666667h545.706667c12.032 0 21.802667 9.557333 21.802667 21.333334v42.666666c0 11.776-9.770667 21.333333-21.845334 21.333334z', + fill: 'currentColor', + }), + ], + ), + ]) + }, + }, 'app-404': { iconReader: () => { return h('i', [ diff --git a/ui/src/locales/lang/en-US/ai-chat.ts b/ui/src/locales/lang/en-US/ai-chat.ts index fc866f0b4..045d0acfa 100644 --- a/ui/src/locales/lang/en-US/ai-chat.ts +++ b/ui/src/locales/lang/en-US/ai-chat.ts @@ -110,6 +110,8 @@ export default { documentSplitTip: 'Each document can preview only the first five segments', paragraphRules: 'Segmentation Rules', writeContent: 'Content Written', + cancel: 'Cancel Execution', + cancelExecutionTip: 'Are you sure you want to cancel the selected task? ', }, KnowledgeSource: { title: 'Knowledge Source', diff --git a/ui/src/locales/lang/en-US/common.ts b/ui/src/locales/lang/en-US/common.ts index 88eed8c0f..1797c31a4 100644 --- a/ui/src/locales/lang/en-US/common.ts +++ b/ui/src/locales/lang/en-US/common.ts @@ -76,6 +76,8 @@ export default { fail: 'Failed', all: 'All', padding: 'Padding', + REVOKED: 'Cancelled', + REVOKE: 'Cancelling', }, param: { outputParam: 'Output Parameters', diff --git a/ui/src/locales/lang/en-US/views/document.ts b/ui/src/locales/lang/en-US/views/document.ts index 34d4b151b..c6459a61f 100644 --- a/ui/src/locales/lang/en-US/views/document.ts +++ b/ui/src/locales/lang/en-US/views/document.ts @@ -130,7 +130,6 @@ export default { PENDING: 'Queuing', GENERATE: 'Generating', SYNC: 'Syncing', - REVOKE: 'Cancelling', finish: 'Finish', }, enableStatus: { diff --git a/ui/src/locales/lang/en-US/workflow.ts b/ui/src/locales/lang/en-US/workflow.ts index 73e3822f9..37245bc55 100644 --- a/ui/src/locales/lang/en-US/workflow.ts +++ b/ui/src/locales/lang/en-US/workflow.ts @@ -11,6 +11,8 @@ export default { }, operation: { toImportDoc: 'Go to Import Documents', + importWorkflow: 'Import Workflow', + exportWorkflow: 'Export Workflow', }, setting: { restoreVersion: 'Restore Previous Version"', diff --git a/ui/src/locales/lang/zh-CN/ai-chat.ts b/ui/src/locales/lang/zh-CN/ai-chat.ts index 2a221f51e..f95ca8c87 100644 --- a/ui/src/locales/lang/zh-CN/ai-chat.ts +++ b/ui/src/locales/lang/zh-CN/ai-chat.ts @@ -108,6 +108,8 @@ export default { documentSplitTip: '每个文档仅能预览前五个分段', paragraphRules: '分段规则', writeContent: '写入内容', + cancel: '取消执行', + cancelExecutionTip: '确定取消所选的任务?', }, KnowledgeSource: { title: '知识来源', diff --git a/ui/src/locales/lang/zh-CN/common.ts b/ui/src/locales/lang/zh-CN/common.ts index 2c4ee9282..c690463ec 100644 --- a/ui/src/locales/lang/zh-CN/common.ts +++ b/ui/src/locales/lang/zh-CN/common.ts @@ -77,6 +77,8 @@ export default { fail: '失败', all: '全部', padding: '执行中', + REVOKED: '已取消', + REVOKE: '取消中', }, param: { outputParam: '输出参数', diff --git a/ui/src/locales/lang/zh-CN/views/document.ts b/ui/src/locales/lang/zh-CN/views/document.ts index e2ec12304..942b0b133 100644 --- a/ui/src/locales/lang/zh-CN/views/document.ts +++ b/ui/src/locales/lang/zh-CN/views/document.ts @@ -122,7 +122,6 @@ export default { PENDING: '排队中', GENERATE: '生成中', SYNC: '同步中', - REVOKE: '取消中', finish: '完成', }, enableStatus: { diff --git a/ui/src/locales/lang/zh-CN/workflow.ts b/ui/src/locales/lang/zh-CN/workflow.ts index 5e4fcb4e4..58cceb67f 100644 --- a/ui/src/locales/lang/zh-CN/workflow.ts +++ b/ui/src/locales/lang/zh-CN/workflow.ts @@ -11,6 +11,8 @@ export default { }, operation: { toImportDoc: '去导入文档', + importWorkflow: '导入工作流', + exportWorkflow: '导出工作流', }, setting: { restoreVersion: '恢复版本', diff --git a/ui/src/locales/lang/zh-Hant/ai-chat.ts b/ui/src/locales/lang/zh-Hant/ai-chat.ts index 7822c8fe4..506f5d487 100644 --- a/ui/src/locales/lang/zh-Hant/ai-chat.ts +++ b/ui/src/locales/lang/zh-Hant/ai-chat.ts @@ -108,6 +108,8 @@ export default { documentSplitTip: '每個文件僅能預覽前五個段落', paragraphRules: '分段規則', writeContent: '寫入內容', + cancel: '取消執行', + cancelExecutionTip: '確定取消所選的任務?', }, KnowledgeSource: { title: '知識來源', diff --git a/ui/src/locales/lang/zh-Hant/common.ts b/ui/src/locales/lang/zh-Hant/common.ts index 01b7de384..589d30528 100644 --- a/ui/src/locales/lang/zh-Hant/common.ts +++ b/ui/src/locales/lang/zh-Hant/common.ts @@ -76,6 +76,8 @@ export default { fail: '失敗', all: '全部', padding: '執行中', + REVOKED: '已取消', + REVOKE: '取消中', }, param: { outputParam: '輸出參數', diff --git a/ui/src/locales/lang/zh-Hant/views/document.ts b/ui/src/locales/lang/zh-Hant/views/document.ts index 18a5c48bb..fc3222a50 100644 --- a/ui/src/locales/lang/zh-Hant/views/document.ts +++ b/ui/src/locales/lang/zh-Hant/views/document.ts @@ -123,7 +123,6 @@ export default { PENDING: '排隊中', GENERATE: '生成中', SYNC: '同步中', - REVOKE: '取消中', finish: '完圓', }, enableStatus: { diff --git a/ui/src/locales/lang/zh-Hant/workflow.ts b/ui/src/locales/lang/zh-Hant/workflow.ts index dbcf80140..3568ea320 100644 --- a/ui/src/locales/lang/zh-Hant/workflow.ts +++ b/ui/src/locales/lang/zh-Hant/workflow.ts @@ -11,6 +11,8 @@ export default { }, operation: { toImportDoc: '去導入文檔', + importWorkflow: '導入工作流', + exportWorkflow: '導出工作流', }, setting: { restoreVersion: '恢復版本', diff --git a/ui/src/views/document/component/Status.vue b/ui/src/views/document/component/Status.vue index 68476c255..06c1443cc 100644 --- a/ui/src/views/document/component/Status.vue +++ b/ui/src/views/document/component/Status.vue @@ -78,7 +78,7 @@ const taskTypeMap = { const stateMap: any = { [State.PENDING]: (type: number) => t('views.document.fileStatus.PENDING'), [State.STARTED]: (type: number) => startedMap[type], - [State.REVOKE]: (type: number) => t('views.document.fileStatus.REVOKE'), + [State.REVOKE]: (type: number) => t('common.status.REVOKE'), [State.REVOKED]: (type: number) => t('common.status.success'), [State.FAILURE]: (type: number) => t('common.status.fail'), [State.SUCCESS]: (type: number) => t('common.status.success'), diff --git a/ui/src/views/knowledge-workflow/component/execution-record/ExecutionDetailDrawer.vue b/ui/src/views/knowledge-workflow/component/execution-record/ExecutionDetailDrawer.vue index ee8b79957..6ce0ce827 100644 --- a/ui/src/views/knowledge-workflow/component/execution-record/ExecutionDetailDrawer.vue +++ b/ui/src/views/knowledge-workflow/component/execution-record/ExecutionDetailDrawer.vue @@ -52,14 +52,14 @@ v-else-if="props.currentContent?.state === 'REVOKED'" > - {{ $t('common.status.REVOKED', '已取消') }} + {{ $t('common.status.REVOKED') }} - {{ $t('views.document.fileStatus.REVOKE', '取消中') }} + {{ $t('common.status.REVOKE') }} diff --git a/ui/src/views/knowledge-workflow/component/execution-record/ExecutionRecordDrawer.vue b/ui/src/views/knowledge-workflow/component/execution-record/ExecutionRecordDrawer.vue index e236fcdbf..1a61c8dc1 100644 --- a/ui/src/views/knowledge-workflow/component/execution-record/ExecutionRecordDrawer.vue +++ b/ui/src/views/knowledge-workflow/component/execution-record/ExecutionRecordDrawer.vue @@ -66,11 +66,11 @@ - {{ $t('common.status.REVOKED', '已取消') }} + {{ $t('common.status.REVOKED') }} - {{ $t('views.document.fileStatus.REVOKE', '取消中') }} + {{ $t('common.status.REVOKE') }} @@ -93,7 +93,7 @@ - +