epx-frame 5.2.7 → 5.3.0-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +222 -96
- package/lib/0.js +1 -1
- package/lib/1.js +1 -1
- package/lib/121.js +1 -0
- package/lib/140.js +3 -0
- package/lib/141.js +1 -0
- package/lib/142.js +1 -0
- package/lib/2.js +1 -1
- package/lib/components/Link.js +1 -1
- package/lib/components/act-process-form-item.js +3 -0
- package/lib/components/add-form-item.js +1 -1
- package/lib/components/add-form.js +2 -2
- package/lib/components/ai-agent-page.js +3 -1
- package/lib/components/ai-chat-page.js +3 -1
- package/lib/components/ai-import-page.js +2 -2
- package/lib/components/ai-import.js +3 -1
- package/lib/components/ai-metadata-assistant.js +1 -0
- package/lib/components/alert.js +1 -1
- package/lib/components/app-index.js +1 -1
- package/lib/components/app-nav.js +2 -2
- package/lib/components/app-tabs.js +1 -1
- package/lib/components/apply-form.js +1 -1
- package/lib/components/approval-index-page.js +2 -2
- package/lib/components/approval-index.js +2 -2
- package/lib/components/base-page.js +2 -2
- package/lib/components/button.js +1 -1
- package/lib/components/card-form-item.js +3 -1
- package/lib/components/card.js +1 -1
- package/lib/components/carousel.js +3 -1
- package/lib/components/category-list.js +1 -1
- package/lib/components/chart.js +2 -2
- package/lib/components/check-history.js +2 -2
- package/lib/components/collapse.js +3 -1
- package/lib/components/color-picker.js +1 -1
- package/lib/components/component.js +1 -1
- package/lib/components/config-page.js +2 -2
- package/lib/components/contacts.js +1 -1
- package/lib/components/dashboard.js +2 -2
- package/lib/components/div.js +1 -1
- package/lib/components/dropdown.js +2 -2
- package/lib/components/edit-entity-list.js +1 -1
- package/lib/components/entity-add-page.js +2 -2
- package/lib/components/entity-apply-page.js +2 -2
- package/lib/components/entity-card-list.js +1 -1
- package/lib/components/entity-list-find-page.js +2 -2
- package/lib/components/entity-list-find.js +2 -2
- package/lib/components/entity-list-page.js +2 -2
- package/lib/components/entity-list.js +2 -2
- package/lib/components/entity-no-submit-sub-list.js +1 -1
- package/lib/components/entity-sub-grid.js +2 -2
- package/lib/components/entity-sub-list.js +2 -2
- package/lib/components/entity-tree-find-page.js +2 -2
- package/lib/components/entity-tree-find.js +2 -2
- package/lib/components/export-file.js +1 -1
- package/lib/components/export.js +2 -2
- package/lib/components/flow-num.js +1 -1
- package/lib/components/footer.js +1 -1
- package/lib/components/form-field.js +1 -1
- package/lib/components/form-item.js +2 -2
- package/lib/components/form.js +2 -2
- package/lib/components/formula-editor.js +3 -0
- package/lib/components/formula.js +1 -1
- package/lib/components/gauge.js +1 -1
- package/lib/components/grid.js +1 -1
- package/lib/components/header.js +1 -1
- package/lib/components/html.js +1 -1
- package/lib/components/icon.js +1 -1
- package/lib/components/iframe.js +1 -1
- package/lib/components/image.js +1 -1
- package/lib/components/import-file.js +1 -1
- package/lib/components/import.js +2 -2
- package/lib/components/layout.js +3 -1
- package/lib/components/list.js +3 -1
- package/lib/components/load-page.js +1 -1
- package/lib/components/m-entity-add-page.js +2 -2
- package/lib/components/m-entity-dept-find.js +1 -1
- package/lib/components/m-entity-list-find.js +3 -1
- package/lib/components/m-entity-list.js +1 -1
- package/lib/components/m-entity-no-submit-sub-list.js +2 -2
- package/lib/components/m-entity-tree-find.js +1 -1
- package/lib/components/m-entity-user-find.js +1 -1
- package/lib/components/menu-index.js +1 -1
- package/lib/components/menu.js +1 -1
- package/lib/components/mine.js +1 -1
- package/lib/components/module-index-page.js +2 -2
- package/lib/components/module-list-page.js +2 -2
- package/lib/components/module-list.js +1 -1
- package/lib/components/module-tabs-page.js +2 -2
- package/lib/components/nav-add-form.js +1 -1
- package/lib/components/num.js +1 -1
- package/lib/components/org-chart.js +1 -1
- package/lib/components/page-help.js +1 -1
- package/lib/components/page-tabs.js +1 -1
- package/lib/components/page.js +2 -2
- package/lib/components/pagination.js +1 -1
- package/lib/components/progress-chart.js +1 -1
- package/lib/components/progress.js +1 -1
- package/lib/components/report-chart.js +2 -2
- package/lib/components/report-html.js +2 -2
- package/lib/components/report-preview.js +2 -2
- package/lib/components/report.js +2 -2
- package/lib/components/router-view.js +1 -1
- package/lib/components/scope.js +2 -2
- package/lib/components/search-bar.js +1 -1
- package/lib/components/search-list.js +1 -1
- package/lib/components/search.js +2 -2
- package/lib/components/step-item.js +1 -1
- package/lib/components/step.js +1 -1
- package/lib/components/tab-bar.js +1 -1
- package/lib/components/tab-tags.js +1 -1
- package/lib/components/tabs.js +3 -1
- package/lib/components/tag.js +1 -1
- package/lib/components/task-list-page.js +2 -2
- package/lib/components/task-list.js +2 -2
- package/lib/components/template.js +2 -2
- package/lib/components/text-editor.js +1 -1
- package/lib/components/text.js +1 -1
- package/lib/components/title.js +1 -1
- package/lib/components/update-form-item.js +1 -1
- package/lib/components/update-form.js +2 -2
- package/lib/components/update-sub-list.js +1 -1
- package/lib/components/video.js +1 -1
- package/lib/components/visual-config-page.js +2 -2
- package/lib/epx-frame.common.js +2 -2
- package/lib/http.js +2 -2
- package/lib/media/ai_bg.jpg +0 -0
- package/lib/media/ai_index.webp +0 -0
- package/lib/media/topbg.png +0 -0
- package/lib/router.js +2 -2
- package/lib/store.js +2 -2
- package/lib/utils/Config.js +1 -1
- package/lib/utils/axios.js +2 -2
- package/lib/utils/chartTheme.js +1 -1
- package/lib/utils/fieldFactory.js +2 -2
- package/lib/utils/formula.js +1 -1
- package/lib/utils/index.js +2 -2
- package/lib/utils/loadComponent.js +1 -1
- package/lib/utils/loadLibrary.js +1 -1
- package/lib/utils/meta.js +1 -1
- package/lib/utils/mixins/component.js +2 -2
- package/lib/utils/mixins/global.js +2 -2
- package/lib/utils/mixins/index.js +2 -2
- package/lib/utils/mixins/methods-to-prototype.js +3 -0
- package/lib/utils/mixins/optimized-global.js +1 -0
- package/lib/utils/page.js +1 -1
- package/lib/utils/pdf.viewer.js +2 -2
- package/lib/utils/security.js +1 -1
- package/lib/utils/util.js +1 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -1,108 +1,234 @@
|
|
|
1
|
-
#
|
|
2
|
-
## module容器
|
|
3
|
-
moduleRouters存储跳转记录,如果不存在则显示主模块
|
|
4
|
-
## moduleIndex 菜单容器
|
|
5
|
-
具有左侧菜单,在module容器内部,menuRouters存储菜单路由,如果不存在则显示module容器页面
|
|
6
|
-
## 跳转方式处理
|
|
7
|
-
如果是新标签页方式,则以路由跳转的方式打开新模块,其他情况则调用容器跳转方式,在menu容器内部使用menuRouters跳转,否则使用moduleRouters
|
|
8
|
-
## 容器销毁后清空routers
|
|
1
|
+
# EPX Frame - 低代码开发平台
|
|
9
2
|
|
|
3
|
+
## 项目简介
|
|
4
|
+
|
|
5
|
+
EPX Frame 是一个基于 Vue 2.7 的低代码开发平台,通过代码和页面组件配置相结合的方式,实现快速构建企业级应用。平台采用配置驱动的架构,开发者可以通过可视化配置页面和组件,无需编写大量重复代码即可构建完整的业务系统。
|
|
6
|
+
|
|
7
|
+
## 技术栈
|
|
8
|
+
|
|
9
|
+
- **前端框架**: Vue 2.7
|
|
10
|
+
- **状态管理**: Vuex 3.6
|
|
11
|
+
- **路由管理**: Vue Router 3.6
|
|
12
|
+
- **UI 框架**:
|
|
13
|
+
- Element UI 2.15 (PC 端)
|
|
14
|
+
- Vant 2.12 (移动端)
|
|
15
|
+
- **构建工具**: Webpack 4
|
|
16
|
+
- **其他核心库**:
|
|
17
|
+
- BPMN.js (流程设计)
|
|
18
|
+
- X6 (流程图)
|
|
19
|
+
- CodeMirror (代码编辑器)
|
|
20
|
+
- Canvas Editor (富文本编辑器)
|
|
10
21
|
|
|
11
|
-
##
|
|
12
|
-
createpage
|
|
13
|
-
## ~~返回上一级方法~~
|
|
22
|
+
## 核心架构
|
|
14
23
|
|
|
15
|
-
|
|
24
|
+
### 1. 配置驱动机制
|
|
16
25
|
|
|
26
|
+
平台采用**配置驱动**的开发模式,页面和组件通过 JSON 配置来定义:
|
|
17
27
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
* ID默认为隐藏?
|
|
22
|
-
* 按钮显示问题
|
|
28
|
+
- **页面配置**: 存储在数据库中,通过 API 获取,包含组件列表、布局、样式、事件等
|
|
29
|
+
- **组件配置**: 每个组件都有独立的配置项,支持属性、样式、事件等配置
|
|
30
|
+
- **动态渲染**: 根据配置动态加载和渲染组件,支持组件嵌套和动态组合
|
|
23
31
|
|
|
24
|
-
|
|
32
|
+
**配置示例**:
|
|
33
|
+
```javascript
|
|
34
|
+
{
|
|
35
|
+
component: "entity-list", // 组件类型
|
|
36
|
+
configs: { // 组件配置
|
|
37
|
+
metaId: "FM_USER",
|
|
38
|
+
searchFields: [...],
|
|
39
|
+
keywords: "name"
|
|
40
|
+
},
|
|
41
|
+
items: [...] // 子组件列表
|
|
42
|
+
}
|
|
43
|
+
```
|
|
25
44
|
|
|
45
|
+
### 2. 组件系统
|
|
26
46
|
|
|
27
|
-
|
|
47
|
+
#### 2.1 组件包 (packages)
|
|
48
|
+
位于 `src/frame/packages/`,包含丰富的预定义组件:
|
|
49
|
+
|
|
50
|
+
- **数据组件**: `entity-list` (列表), `entity-form` (表单), `entity-tree` (树形)
|
|
51
|
+
- **布局组件**: `dashboard` (仪表盘), `grid` (网格), `tabs` (标签页)
|
|
52
|
+
- **业务组件**: `approval-index` (审批), `task-list` (任务列表)
|
|
53
|
+
- **容器组件**: `page` (页面), `component` (组件容器)
|
|
54
|
+
|
|
55
|
+
#### 2.2 组件核心机制
|
|
56
|
+
- **Component Mixin**: 所有组件都通过 `src/utils/mixins/component.js` 提供统一的基础能力
|
|
57
|
+
- **配置注入**: 组件配置通过 `compConfigs` prop 注入,支持动态更新
|
|
58
|
+
- **事件系统**: 支持自定义事件和 JS 事件配置
|
|
59
|
+
- **样式隔离**: 支持组件级 CSS,通过动态注入实现样式隔离
|
|
60
|
+
|
|
61
|
+
### 3. 容器系统
|
|
62
|
+
|
|
63
|
+
平台采用**容器化**的页面管理机制,支持多层级容器嵌套:
|
|
64
|
+
|
|
65
|
+
#### 3.1 Module 容器 (模块容器)
|
|
66
|
+
- **功能**: 管理模块级别的页面路由
|
|
67
|
+
- **路由存储**: `moduleRouters` 存储跳转记录
|
|
68
|
+
- **默认行为**: 如果不存在路由记录,则显示主模块页面
|
|
69
|
+
- **实现位置**: `src/frame/views/Module.vue`
|
|
70
|
+
|
|
71
|
+
#### 3.2 Menu 容器 (菜单容器)
|
|
72
|
+
- **功能**: 在 Module 容器内部提供左侧菜单导航
|
|
73
|
+
- **路由存储**: `menuRouters` 存储菜单路由记录
|
|
74
|
+
- **默认行为**: 如果不存在路由记录,则显示 Module 容器页面
|
|
75
|
+
- **实现位置**: `src/frame/packages/menu-index/`
|
|
76
|
+
|
|
77
|
+
#### 3.3 路由跳转机制
|
|
78
|
+
- **新标签页方式**: 使用 Vue Router 进行路由跳转
|
|
79
|
+
- **容器内跳转**:
|
|
80
|
+
- Menu 容器内使用 `menuRouters` 管理
|
|
81
|
+
- Module 容器内使用 `moduleRouters` 管理
|
|
82
|
+
- **容器销毁**: 容器销毁时自动清空对应的路由记录
|
|
83
|
+
|
|
84
|
+
### 4. 页面设计器 (Page Designer)
|
|
85
|
+
|
|
86
|
+
位于 `src/frame/page-designer/`,提供可视化页面设计能力:
|
|
87
|
+
|
|
88
|
+
- **组件库**: 提供可拖拽的组件库
|
|
89
|
+
- **属性配置**: 可视化配置组件属性
|
|
90
|
+
- **样式编辑**: CSS 编辑器支持自定义样式
|
|
91
|
+
- **JS 事件**: 支持编写 JS 事件处理逻辑
|
|
92
|
+
- **模板库**: 支持保存和复用页面模板
|
|
93
|
+
|
|
94
|
+
### 5. 状态管理 (Vuex)
|
|
95
|
+
|
|
96
|
+
#### 5.1 核心模块
|
|
97
|
+
|
|
98
|
+
- **page**: 页面配置管理 (`src/store/modules/page.js`)
|
|
99
|
+
- 页面配置缓存
|
|
100
|
+
- 模板库管理
|
|
101
|
+
- 组件库管理
|
|
102
|
+
|
|
103
|
+
- **router**: 路由状态管理 (`src/store/modules/router.js`)
|
|
104
|
+
- Module 路由管理
|
|
105
|
+
- Menu 路由管理
|
|
106
|
+
- 全局参数管理
|
|
107
|
+
|
|
108
|
+
- **meta**: 对象元数据管理 (`src/store/modules/meta.js`)
|
|
109
|
+
- 对象定义缓存
|
|
110
|
+
- 字段配置管理
|
|
111
|
+
|
|
112
|
+
- **config**: 系统配置管理 (`src/store/modules/config.js`)
|
|
113
|
+
- 系统配置
|
|
114
|
+
- 应用配置
|
|
115
|
+
- 菜单管理
|
|
116
|
+
|
|
117
|
+
### 6. 参数传递机制
|
|
118
|
+
|
|
119
|
+
#### 6.1 参数类型
|
|
120
|
+
|
|
121
|
+
- **当前页面参数**: 页面 props → menuRoute → moduleRoute
|
|
122
|
+
- **全局参数**: globalQuery (存储在 Vuex 中)
|
|
123
|
+
|
|
124
|
+
#### 6.2 动态参数
|
|
125
|
+
|
|
126
|
+
支持动态参数替换,使用 `#{variable}` 语法:
|
|
127
|
+
|
|
128
|
+
- `#{user.id}`: 获取当前登录用户 ID
|
|
129
|
+
- `#{query.moduleId}`: 从查询参数获取 moduleId
|
|
130
|
+
- `#{meta.field}`: 从对象元数据获取字段值
|
|
131
|
+
|
|
132
|
+
参数解析逻辑:解析符合 `/#{.+}/` 格式的参数,替换为真实变量值
|
|
133
|
+
|
|
134
|
+
## 目录结构
|
|
135
|
+
|
|
136
|
+
```
|
|
137
|
+
src/
|
|
138
|
+
├── api/ # API 接口定义
|
|
139
|
+
├── assets/ # 静态资源
|
|
140
|
+
├── frame/ # 核心框架代码
|
|
141
|
+
│ ├── base/ # 基础页面组件
|
|
142
|
+
│ ├── components/ # 通用组件
|
|
143
|
+
│ ├── packages/ # 组件包 (核心组件库)
|
|
144
|
+
│ │ ├── entity-list/ # 列表组件
|
|
145
|
+
│ │ ├── form/ # 表单组件
|
|
146
|
+
│ │ ├── page/ # 页面组件
|
|
147
|
+
│ │ ├── menu-index/ # 菜单容器
|
|
148
|
+
│ │ └── ... # 其他组件
|
|
149
|
+
│ ├── page-designer/ # 页面设计器
|
|
150
|
+
│ └── views/ # 视图页面
|
|
151
|
+
├── plugins/ # 插件配置
|
|
152
|
+
├── router/ # 路由配置
|
|
153
|
+
├── store/ # Vuex 状态管理
|
|
154
|
+
│ └── modules/ # 状态模块
|
|
155
|
+
├── styles/ # 全局样式
|
|
156
|
+
├── utils/ # 工具函数
|
|
157
|
+
│ └── mixins/ # Mixin (组件核心逻辑)
|
|
158
|
+
└── main.js # 入口文件
|
|
159
|
+
```
|
|
28
160
|
|
|
161
|
+
## 核心概念
|
|
162
|
+
|
|
163
|
+
### 页面 (Page)
|
|
164
|
+
- 页面的基本容器,通过 `epx-page` 组件加载
|
|
165
|
+
- 支持通过 `pageId` 或 `metaId + flag` 加载配置
|
|
166
|
+
- 支持嵌套和动态加载
|
|
167
|
+
|
|
168
|
+
### 组件 (Component)
|
|
169
|
+
- 可配置的页面元素
|
|
170
|
+
- 通过 `epx-component` 动态渲染
|
|
171
|
+
- 支持嵌套组合,形成复杂的页面结构
|
|
172
|
+
|
|
173
|
+
### 对象 (Meta)
|
|
174
|
+
- 业务对象的元数据定义
|
|
175
|
+
- 包含字段定义、验证规则等
|
|
176
|
+
- 支持关联、子集等复杂关系
|
|
177
|
+
|
|
178
|
+
### 模板 (Template)
|
|
179
|
+
- 可复用的页面模板
|
|
180
|
+
- 支持保存和加载模板配置
|
|
181
|
+
- 用于快速创建相似页面
|
|
29
182
|
|
|
30
|
-
##
|
|
31
|
-
|
|
32
|
-
## ~~登录页面返回到最近页面~~
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
## 头部显示逻辑(后续开发)
|
|
36
|
-
|
|
37
|
-
## 打包发布
|
|
38
|
-
|
|
39
|
-
## 页面设置
|
|
40
|
-
|
|
41
|
-
## 对象设置
|
|
42
|
-
|
|
43
|
-
## 列表
|
|
44
|
-
* 关键词搜索
|
|
45
|
-
* ~~操作列~~
|
|
46
|
-
* 筛选项
|
|
47
|
-
* ~~按钮组配置~~
|
|
48
|
-
|
|
49
|
-
## 表单
|
|
50
|
-
* ~~子集操作~~
|
|
51
|
-
* 对齐方式
|
|
52
|
-
* ~~单行显示模板~~
|
|
53
|
-
|
|
54
|
-
## 页面显示
|
|
55
|
-
|
|
56
|
-
## ~~增加审核流程显示~~
|
|
57
|
-
## ~~增加意见输入~~
|
|
58
|
-
|
|
59
|
-
# 配置跳转 动态传递参数
|
|
60
|
-
|
|
61
|
-
# ~~全局query参数 存放当前页面的参数~~
|
|
62
|
-
|
|
63
|
-
## ~~参数传递~~
|
|
64
|
-
`#{user.id}`, 获取登录user的id
|
|
65
|
-
`#{query.moduleId}` 从参数获取moduleId
|
|
66
|
-
|
|
67
|
-
## ~~动态获取参数逻辑~~
|
|
68
|
-
解析符合 /#{.+}/的参数替换为真实变量
|
|
69
|
-
|
|
70
|
-
## ~~同步方法~~
|
|
71
|
-
|
|
72
|
-
## ~~增加对象树类型~~
|
|
73
|
-
|
|
74
|
-
## 查询对象树类型可多选
|
|
75
|
-
|
|
76
|
-
## ~~容器~~
|
|
77
|
-
|
|
78
|
-
## ~~返回逻辑- 是否需要改变~~
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
## 筛选模板
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
## 参数传递
|
|
86
|
-
* 当前页面参数- 页面props-> menuRoute -> moduleRoute
|
|
87
|
-
* 全局参数 - globalQuery
|
|
88
|
-
|
|
89
|
-
## 子集列表、子集新增模板调整
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
## ~~返回逻辑~~
|
|
93
|
-
## ~~新疆大学打包~~
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
## 子集新增编辑组件传递
|
|
97
|
-
|
|
98
|
-
## 报表组件 + 高基报表组件
|
|
99
|
-
|
|
100
|
-
## 容器修改 /多个容器嵌套
|
|
101
|
-
* 页面在容器展示
|
|
102
|
-
* 打开页面在容器打开
|
|
103
|
-
* 该容器没有页面会被销毁
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
## 新增模板修改
|
|
183
|
+
## 开发指南
|
|
107
184
|
|
|
185
|
+
### 启动项目
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
# 安装依赖
|
|
189
|
+
yarn install
|
|
190
|
+
|
|
191
|
+
# 开发环境
|
|
192
|
+
yarn serve
|
|
108
193
|
|
|
194
|
+
# 构建生产版本
|
|
195
|
+
yarn build:prd
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### 创建新组件
|
|
199
|
+
|
|
200
|
+
1. 在 `src/frame/packages/` 下创建组件目录
|
|
201
|
+
2. 实现组件逻辑,使用 `component` mixin
|
|
202
|
+
3. 定义组件配置项
|
|
203
|
+
4. 在组件库中注册
|
|
204
|
+
|
|
205
|
+
### 配置页面
|
|
206
|
+
|
|
207
|
+
1. 使用页面设计器可视化配置
|
|
208
|
+
2. 或直接编辑 JSON 配置
|
|
209
|
+
3. 配置保存到数据库
|
|
210
|
+
4. 运行时动态加载渲染
|
|
211
|
+
|
|
212
|
+
## 特性说明
|
|
213
|
+
|
|
214
|
+
### 容器系统特性
|
|
215
|
+
- ✅ 支持 Module 容器和 Menu 容器嵌套
|
|
216
|
+
- ✅ 容器内页面路由管理
|
|
217
|
+
- ✅ 容器销毁自动清理路由
|
|
218
|
+
- ✅ 支持新标签页和容器内跳转
|
|
219
|
+
|
|
220
|
+
### 参数传递特性
|
|
221
|
+
- ✅ 支持多层级参数传递
|
|
222
|
+
- ✅ 动态参数替换
|
|
223
|
+
- ✅ 全局参数管理
|
|
224
|
+
|
|
225
|
+
### 组件系统特性
|
|
226
|
+
- ✅ 丰富的预定义组件库
|
|
227
|
+
- ✅ 组件配置驱动
|
|
228
|
+
- ✅ 支持组件嵌套
|
|
229
|
+
- ✅ 样式隔离
|
|
230
|
+
- ✅ 事件系统
|
|
231
|
+
|
|
232
|
+
## 版本信息
|
|
233
|
+
|
|
234
|
+
当前版本: **5.2.0-beta**
|