feat(form): 新增动态表单设计与数据收集功能

- src/api/form: 新增表单定义、渲染、数据收集、菜单发布接口与类型
- src/views/dynamic-form: 新增表单列表、设计器、预览、内嵌填写、公开填写、数据页
- src/plugins/form-create: 注册 form-create 渲染器、设计器与业务组件拖拽规则
- src/router: 新增公开表单分享路由 /f/:formKey,并加入登录守卫白名单
- src/enums/business: 新增 FormStatus 表单状态枚举
- src/layouts/components/LayoutSidebarItem: 支持渲染菜单角标,取自 sys_menu.params.badge
- src/main.ts: 应用启动时调用 setupFormCreate
- package.json: 新增 @form-create/element-ui 与 @form-create/designer 依赖
This commit is contained in:
Ray.Hao committed 2026-09-01 00:17:11 +08:00
1 parent 17ca4c1b7b
commit d36ccf54d5
22 files changed
+7991 -3822

No files matched your search

+6 -2
View File
@@ -11,7 +11,8 @@ import { isTenantEnabled } from "@/utils/tenant";
* 处理登录验证、动态路由生成、404检测等
*/
export function setupPermissionGuard() {
const whiteList = ["/login"];
// 白名单支持前缀匹配:/f 命中所有公开表单分享页 /f/:formKey
const whiteList = ["/login", "/f"];
router.beforeEach(async (to, _from) => {
NProgress.start();
@@ -21,7 +22,10 @@ export function setupPermissionGuard() {
// 未登录处理
if (!isLoggedIn) {
if (whiteList.includes(to.path)) {
const isWhiteListed = whiteList.some(
(path) => to.path === path || to.path.startsWith(`${path}/`)
);
if (isWhiteListed) {
return;
}
NProgress.done();