Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ui/src/assets/iconfont.js

Large diffs are not rendered by default.

10 changes: 9 additions & 1 deletion ui/src/components/global/markdown-editor/MdEditorMagnify.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,12 @@ async function submitEditorDialog() {
</MkDialog>
</template>

<style scoped lang="scss"></style>
<style scoped lang="scss">
/* 可编辑区域铺满输入区,让空白位置也能按点击位置落光标。 */
.magnify-dialog-editor,
.magnify-md-editor {
:deep(.cm-content) {
min-height: 100% !important;
}
}
</style>
11 changes: 1 addition & 10 deletions ui/src/components/mk-dynamics-form/items/table/TableCheckbox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,7 @@ const activeText = computed(() => {
<div class="title">{{ title }}</div>

<!-- 搜索表格选项 -->
<MkSearchInput
v-model="filterText"
:validate-event="false"
placeholder="请输入关键词搜索"
class="input-with-select"
style="--el-color-danger: #c0c4cc"
/>
<MkSearchInput v-model="filterText" :validate-event="false" />
</div>

<el-table
Expand Down Expand Up @@ -184,9 +178,6 @@ const activeText = computed(() => {
font-size: 14px;
line-height: 22px;
}
.input-with-select {
width: 45%;
}
}
.msg {
margin-top: 12px;
Expand Down
11 changes: 1 addition & 10 deletions ui/src/components/mk-dynamics-form/items/table/TableRadio.vue
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,7 @@ const activeText = computed(() => {
<div class="title">{{ title }}</div>

<!-- 搜索表格选项 -->
<MkSearchInput
v-model="filterText"
:validate-event="false"
placeholder="请输入关键词搜索"
class="input-with-select"
style="--el-color-danger: #c0c4cc"
/>
<MkSearchInput v-model="filterText" :validate-event="false" />
</div>

<el-table
Expand Down Expand Up @@ -174,9 +168,6 @@ const activeText = computed(() => {
font-size: 14px;
line-height: 22px;
}
.input-with-select {
width: 45%;
}
}
.msg {
margin-top: 12px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function handleOpenAiGenerate() {
<!-- AI 生成智能体工作流 -->
<el-button plain :disabled="disabled" @click="handleOpenAiGenerate">
<!-- // TODO 图标 -->
<MkIcon name="icon_star" />
<MkIcon name="icon_star_colorful" />
<span>{{ label }}</span>
</el-button>
<AiGeneratePanel
Expand Down
10 changes: 7 additions & 3 deletions ui/src/workflow-canvas/WORKFLOW_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ LogicFlow 的节点拖拽;仅拦截 `mousedown` 无法隔离当前版本的 Po
工作流 Store 的 `getToolListWithShared` 用于包含已授权共享工具的选项查询,MCP 节点使用
`tool_type: 'MCP'` 筛选;AI 对话的 `McpSettingDialog` 每次打开通过
`store.force.getToolListWithShared` 刷新同类选项,通过 `loaded`
将工具详情提供给资源区回显;取消不修改已选配置。文件夹菜单继续使用 `getAllTool`,不复用这一路查询。
将工具详情提供给资源区回显;取消不修改已选配置。Workspace 文件夹菜单继续使用 `getAllTool`;系统范围的工具菜单通过 `store.force.getToolListWithShared` 查询。

知识库及知识库循环模式的“数据源”页签复用工具资源菜单和工具文件夹,通过 `dataSource`
区分查询:数据源传 `tool_type: TOOL_TYPE.DATA_SOURCE`,普通工具传
Expand All @@ -118,6 +118,10 @@ LogicFlow 的节点拖拽;仅拦截 `mousedown` 无法隔离当前版本的 Po
不要从页签是否存在推断节点能否粘贴;粘贴还使用 `config/node-mapping.ts` 的
`workflowModelDict` 过滤资源节点。

智能体菜单通过 `store.force.getAllApplication(query)` 刷新列表,由 Store 按 `resourceScope`
选择 Workspace 或 System 资源管理的 Application API;保留文件夹条件、已发布筛选与排除当前智能体。
未适配智能体查询的范围返回空列表,不回退 Workspace 接口。

### 画布工具与快捷键

左上角工具栏挂载 `NodeAdd` 和 `NodeSearch`。搜索按 `properties.stepName` 忽略大小写匹配,
Expand All @@ -143,9 +147,9 @@ System 资源管理合并普通与共享模型,System 共享范围仅返回标
`getSelectModelList` 注入使用该能力,循环体转发同名注入。
主画布从 `resourceScope` 注入读取范围(默认 `workspace`),通过节点上下文传递为 `resourceScope`。

当前 `workspace` 适配模型、供应商、模型参数、MCP 工具、共享工具选项、工具详情和标签查询;
当前 `workspace` 适配智能体列表、模型、供应商、模型参数、MCP 工具、共享工具选项、工具详情和标签查询;
`system-resource` 与 `system-shared` 独立提供系统模型、供应商、参数表单、工具选项与详情、MCP 和标签查询,
不继承 Workspace 适配器,不要求路由工作空间。System MCP 查询要求部署提供对应
`system-resource` 另提供智能体列表查询;两者不继承 Workspace 适配器,不要求路由工作空间。System MCP 查询要求部署提供对应
`/system/resource/<resourceType>/<id>/mcp_tools` 或 `/system/shared/<resourceType>/<id>/mcp_tools` 扩展接口,尚未完成运行验证。
`workspace-shared` 仍为空占位。选择弹窗的资源范围和交互以组件文档为准。
节点资源查询可调用此适配器或既有业务 API;工作流加载、保存与发布仍由 View 编排,核心层不承载请求。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ defineExpose({ open, close })
>
<div class="flex-between shrink-0 border-b border-N300 px-4 py-3">
<h4 class="flex-align-center gap-2">
<MkIcon name="icon_star" class="text-primary!" />
<MkIcon name="icon_star_colorful" />
AI 生成
</h4>
<div class="flex-align-center gap-1">
Expand Down
5 changes: 1 addition & 4 deletions ui/src/workflow-canvas/node-menu/ResourceNodeMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import { TOOLTIP_SHOW_DELAY } from '@/components/global/mk-tooltip/constants'
import { computed, inject, onMounted, ref } from 'vue'
import { cloneDeep } from 'lodash'
import ApplicationApi from '@/api/admin/workspace/application/application'
import SharedToolApi from '@/api/admin/workspace/shared/tool'
import ToolApi from '@/api/admin/workspace/tool/tool'
import { RESOURCE_TYPE, TOOL_TYPE } from '@/api/enums'
Expand Down Expand Up @@ -108,10 +107,8 @@ function loadTools(folder?: FolderItem) {
}

function loadApplications(folder?: FolderItem) {
// TODO 共享资源和资源管理需要不同的api,后续需要拆分
const folderQuery = { folder_id: folder?.id || FOLDER_ENTRY_ID.ALL }
// TODO 接口
return ApplicationApi.getAllApplication({ ...folderQuery, publish_status: 'published' }).then((res) => {
return store.force.getAllApplication({ ...folderQuery, publish_status: 'published' }).then((res) => {
resourceItems.value = res
.filter((application) => application.id !== route.params?.applicationId)
.map((application) => ({
Expand Down
2 changes: 2 additions & 0 deletions ui/src/workflow-canvas/store/api/system-resource/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import ApplicationApi from '@/api/admin/system/resource-management/application/application'
import { get, post } from '@/api/admin/core/request'
import type { KnowledgeTagGroup } from '@/api/types'
import type { McpTool } from '@/workflow-canvas/store'
Expand All @@ -13,6 +14,7 @@ const getMcpTools = (resourceType: string, resourceId: string, mcpServers: strin
const getAllTags = (knowledgeIds: string[]) => get<KnowledgeTagGroup[]>('/system/resource/knowledge/tags', { 'knowledge_ids[]': knowledgeIds })

export default {
getAllApplication: ApplicationApi.getAllApplication,
postPromptGenerate: ModelApi.postPromptGenerate,
postChatCompletion: ModelApi.postChatCompletion,
getMcpTools,
Expand Down
2 changes: 2 additions & 0 deletions ui/src/workflow-canvas/store/api/workspace/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import ApplicationApi from '@/api/admin/workspace/application/application'
import { get, post } from '@/api/admin/core/request'
import type { KnowledgeTagGroup } from '@/api/types'
import modelAPI from '@/api/admin/workspace/model'
Expand All @@ -20,6 +21,7 @@ const getAllTags = (knowledgeIds: string[]) => {
}

export default {
getAllApplication: ApplicationApi.getAllApplication,
postPromptGenerate: modelAPI.postPromptGenerate,
postChatCompletion: modelAPI.postChatCompletion,
getModelListWithShared: modelAPI.getModelListWithShared,
Expand Down
7 changes: 7 additions & 0 deletions ui/src/workflow-canvas/store/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type {
ApplicationDetail,
ChatCompletionPayload,
Dict,
DynamicFormField,
Expand All @@ -18,6 +19,7 @@ export interface McpTool {

// 底层 api/*/index.ts 提供的原始接口实现,不含缓存层能力。
type ApiModule = {
getAllApplication?: (query?: Dict<unknown>) => Promise<ApplicationDetail[]>
getAllTags?: (knowledgeIds: string[]) => Promise<KnowledgeTagGroup[]>
getModelListWithShared: (query?: Dict<unknown>) => Promise<ModelItem[]>
getProviderList: () => Promise<ModelProviderItem[]>
Expand All @@ -32,6 +34,7 @@ type ApiModule = {

// 查询默认走缓存,通过 store.force.xxx() 强制刷新;生成请求始终直接转发。
export type WorkflowStoreApi = {
getAllApplication: (query?: Dict<unknown>) => Promise<ApplicationDetail[]>
getAllTags: (knowledgeIds: string[]) => Promise<KnowledgeTagGroup[]>
getModelListWithShared: (query?: Dict<unknown>) => Promise<ModelItem[]>
getProviderList: () => Promise<ModelProviderItem[]>
Expand Down Expand Up @@ -95,6 +98,10 @@ export function useWorkflowStore(resourceScope: string): WorkflowStore {
if (!requestApi.postChatCompletion) return Promise.reject(new Error(`当前资源范围不支持流式补全: ${resourceScope}`))
return requestApi.postChatCompletion(modelId, payload, signal)
},
getAllApplication(query?: Dict<unknown>): Promise<ApplicationDetail[]> {
if (!requestApi.getAllApplication) return Promise.resolve([])
return withCache(`application-list:${JSON.stringify(query ?? {})}`, () => requestApi.getAllApplication!(query), force)
},
getAllTags(knowledgeIds: string[]): Promise<KnowledgeTagGroup[]> {
if (!requestApi.getAllTags) return Promise.resolve([])
return withCache(`knowledge-tags:${JSON.stringify(knowledgeIds)}`, () => requestApi.getAllTags!(knowledgeIds), force)
Expand Down
Loading