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
16 changes: 11 additions & 5 deletions ui/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ Before making changes, determine which areas the task touches and read the corre
organization, and API type ownership.
- Views: `src/views/VIEW_README.md` is the source of truth for page responsibilities and
feature-local code organization.
- Workflow canvas: `src/workflow-canvas/README.md` is the source of truth for LogicFlow canvas
responsibilities, configuration boundaries, node maintenance, and View integration.

Follow this maintenance flow:

Expand Down Expand Up @@ -66,12 +68,15 @@ ui/
│ │ └── CONSTANT_README.md # Shared constant placement and naming rules
│ ├── layout/ # Shared application shells, headers, sidebars, and layout types
│ ├── locales/ # Reserved for internationalization messages and locale setup
│ ├── mk-workflow/ # LogicFlow canvas and workflow domain components
│ │ ├── components/ # Reusable workflow canvas UI
│ │ ├── core/ # Shared canvas behavior and node infrastructure
│ ├── workflow-canvas/ # LogicFlow canvas and workflow domain components
│ │ ├── component/ # Reusable workflow canvas UI
│ │ ├── config/ # Maintainable node data, menus, mappings, and constants
│ │ ├── core/ # Stable canvas behavior and shared node infrastructure
│ │ ├── icons/ # Workflow node icons
│ │ ├── nodes/ # Workflow node definitions and components
│ │ ├── plugins/ # Canvas-local plugins
│ │ ├── README.md # Canvas boundaries and maintenance rules
│ │ ├── types.ts # Workflow canvas protocol types
│ │ └── index.vue # MkWorkflow canvas entry
│ ├── router/ # Vue Router routes and router instance
│ │ └── ROUTE_README.md # Routing conventions and rules
Expand Down Expand Up @@ -105,8 +110,9 @@ Structural responsibilities:
- Put cross-page business components in `components/business/`, name them after their business
responsibility without the `Mk` prefix, and keep page-specific components in their owning View.
- Put reusable application chrome in `layout/`, not in individual route views.
- Keep LogicFlow initialization, node registration, and canvas behavior inside `mk-workflow/`.
Full-screen Workflow Views own the page header and page-level actions around `MkWorkflow`.
- Keep LogicFlow initialization, node registration, and canvas behavior inside `workflow-canvas/`.
Every page rendering this canvas belongs in `views/workflow/`; those Views own the page header,
route and page-level actions around `MkWorkflow`.
- Put server communication in `api/`, isolate Admin and Chat request systems, and group business APIs
by domain and resource according to `src/api/API_README.md`.
- 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.
Expand Down
2 changes: 2 additions & 0 deletions ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@
"dingtalk-jsapi": "^3.2.9",
"element-plus": "^2.14.2",
"jsencrypt": "^3.5.4",
"nanoid": "^6.0.1",
"nprogress": "^0.2.0",
"pinia": "^3.0.4",
"vue": "^3.5.38",
"vue-demi": "^0.14.10",
"vue-router": "^5.1.0"
},
"devDependencies": {
Expand Down
7 changes: 7 additions & 0 deletions ui/src/utils/common.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { nanoid } from 'nanoid'
/*
随机id
*/
export function randomId() {
return nanoid()
}
3 changes: 3 additions & 0 deletions ui/src/views/VIEW_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
`helpers.ts` 等含义模糊的名称。
- 只有代码确实跨多个功能复用时,才按对应专项规则上移到 `src/components`、`src/constants`、
`src/utils`、`src/stores` 或 `src/api`。
- 所有使用 `src/workflow-canvas/` 渲染画布的路由页面统一放在 `views/workflow/`。这些页面负责
路由参数、页面头部、保存或发布等页面动作以及后续接口编排;LogicFlow 初始化、节点注册和
画布内部行为遵循 `src/workflow-canvas/README.md`,不移入 View。
- 页面目录存在多个层级时,目录名应表达业务层级,例如
`system/identity/groups/UserGroupListView.vue`,不要创建无业务含义的分组目录。
- 页面脚本中的状态、计算属性和处理方法按照同一业务流程集中放置,并使用简短的业务备注划分
Expand Down
Loading
Loading