Skip to content

Commit 0386cca

Browse files
feat: workflow
1 parent f21ebe1 commit 0386cca

42 files changed

Lines changed: 6254 additions & 12 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎ui/AGENTS.md‎

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ Before making changes, determine which areas the task touches and read the corre
1717
organization, and API type ownership.
1818
- Views: `src/views/VIEW_README.md` is the source of truth for page responsibilities and
1919
feature-local code organization.
20+
- Workflow canvas: `src/workflow-canvas/README.md` is the source of truth for LogicFlow canvas
21+
responsibilities, configuration boundaries, node maintenance, and View integration.
2022

2123
Follow this maintenance flow:
2224

@@ -66,12 +68,15 @@ ui/
6668
│ │ └── CONSTANT_README.md # Shared constant placement and naming rules
6769
│ ├── layout/ # Shared application shells, headers, sidebars, and layout types
6870
│ ├── locales/ # Reserved for internationalization messages and locale setup
69-
│ ├── mk-workflow/ # LogicFlow canvas and workflow domain components
70-
│ │ ├── components/ # Reusable workflow canvas UI
71-
│ │ ├── core/ # Shared canvas behavior and node infrastructure
71+
│ ├── workflow-canvas/ # LogicFlow canvas and workflow domain components
72+
│ │ ├── component/ # Reusable workflow canvas UI
73+
│ │ ├── config/ # Maintainable node data, menus, mappings, and constants
74+
│ │ ├── core/ # Stable canvas behavior and shared node infrastructure
7275
│ │ ├── icons/ # Workflow node icons
7376
│ │ ├── nodes/ # Workflow node definitions and components
7477
│ │ ├── plugins/ # Canvas-local plugins
78+
│ │ ├── README.md # Canvas boundaries and maintenance rules
79+
│ │ ├── types.ts # Workflow canvas protocol types
7580
│ │ └── index.vue # MkWorkflow canvas entry
7681
│ ├── router/ # Vue Router routes and router instance
7782
│ │ └── ROUTE_README.md # Routing conventions and rules
@@ -105,8 +110,9 @@ Structural responsibilities:
105110
- Put cross-page business components in `components/business/`, name them after their business
106111
responsibility without the `Mk` prefix, and keep page-specific components in their owning View.
107112
- Put reusable application chrome in `layout/`, not in individual route views.
108-
- Keep LogicFlow initialization, node registration, and canvas behavior inside `mk-workflow/`.
109-
Full-screen Workflow Views own the page header and page-level actions around `MkWorkflow`.
113+
- Keep LogicFlow initialization, node registration, and canvas behavior inside `workflow-canvas/`.
114+
Every page rendering this canvas belongs in `views/workflow/`; those Views own the page header,
115+
route and page-level actions around `MkWorkflow`.
110116
- Put server communication in `api/`, isolate Admin and Chat request systems, and group business APIs
111117
by domain and resource according to `src/api/API_README.md`.
112118
- Put constants shared by most pages or multiple business modules in `constants/`, and split files by a specific domain. Keep constants used by only one page or feature with their owning code.

‎ui/package.json‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,11 @@
2525
"dingtalk-jsapi": "^3.2.9",
2626
"element-plus": "^2.14.2",
2727
"jsencrypt": "^3.5.4",
28+
"nanoid": "^6.0.1",
2829
"nprogress": "^0.2.0",
2930
"pinia": "^3.0.4",
3031
"vue": "^3.5.38",
32+
"vue-demi": "^0.14.10",
3133
"vue-router": "^5.1.0"
3234
},
3335
"devDependencies": {

‎ui/src/utils/common.ts‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { nanoid } from 'nanoid'
2+
/*
3+
随机id
4+
*/
5+
export function randomId() {
6+
return nanoid()
7+
}

‎ui/src/views/VIEW_README.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
`helpers.ts` 等含义模糊的名称。
2424
- 只有代码确实跨多个功能复用时,才按对应专项规则上移到 `src/components`、`src/constants`、
2525
`src/utils`、`src/stores` 或 `src/api`。
26+
- 所有使用 `src/workflow-canvas/` 渲染画布的路由页面统一放在 `views/workflow/`。这些页面负责
27+
路由参数、页面头部、保存或发布等页面动作以及后续接口编排;LogicFlow 初始化、节点注册和
28+
画布内部行为遵循 `src/workflow-canvas/README.md`,不移入 View。
2629
- 页面目录存在多个层级时,目录名应表达业务层级,例如
2730
`system/identity/groups/UserGroupListView.vue`,不要创建无业务含义的分组目录。
2831
- 页面脚本中的状态、计算属性和处理方法按照同一业务流程集中放置,并使用简短的业务备注划分

0 commit comments

Comments
 (0)