diff --git a/apps/jingrow/frontend/src/locales/zh-CN.json b/apps/jingrow/frontend/src/locales/zh-CN.json index 146c2d4..e879e63 100644 --- a/apps/jingrow/frontend/src/locales/zh-CN.json +++ b/apps/jingrow/frontend/src/locales/zh-CN.json @@ -700,6 +700,9 @@ "Create Frontend": "创建前端", "Create Backend": "创建后端", "Please select PageType": "请选择页面类型", + "Toolbar": "工具栏", + "Sidebar": "侧边栏", + "Page": "页面", "Media Resources": "媒体资源", "Attachments": "附件", diff --git a/apps/jingrow/frontend/src/views/dev/CreatePagetypeTemplate.vue b/apps/jingrow/frontend/src/views/dev/CreatePagetypeTemplate.vue index 6b1135a..15745e4 100644 --- a/apps/jingrow/frontend/src/views/dev/CreatePagetypeTemplate.vue +++ b/apps/jingrow/frontend/src/views/dev/CreatePagetypeTemplate.vue @@ -6,7 +6,17 @@ - + + + + + + + + + + + @@ -16,7 +26,10 @@ - {{ t('Frontend') }}: {{ frontendPath }} + + {{ t('Frontend') }}: + {{ frontendPath }} + {{ t('Backend') }}: {{ backendPath }} @@ -37,31 +50,41 @@ \n", encoding="utf-8") - frontend_path = str(fp) + # 工具栏 + if "toolbar" in frontend_options: + fp = root / "apps" / app / "frontend" / "src" / "views" / "pagetype" / slug / f"{slug}_toolbar.vue" + fp.parent.mkdir(parents=True, exist_ok=True) + if fp.exists(): + frontend_exists = True + else: + toolbar_content = "\n \n\n\n" + fp.write_text(toolbar_content, encoding="utf-8") + frontend_paths.append(str(fp)) + + # 侧边栏 + if "sidebar" in frontend_options: + fp = root / "apps" / app / "frontend" / "src" / "views" / "pagetype" / slug / f"{slug}_sidebar.vue" + fp.parent.mkdir(parents=True, exist_ok=True) + if fp.exists(): + frontend_exists = True + else: + sidebar_content = "\n \n\n\n\n" + fp.write_text(sidebar_content, encoding="utf-8") + frontend_paths.append(str(fp)) + + # 页面 + if "page" in frontend_options: + fp = root / "apps" / app / "frontend" / "src" / "views" / "pagetype" / slug / f"{slug}.vue" + fp.parent.mkdir(parents=True, exist_ok=True) + if fp.exists(): + frontend_exists = True + else: + page_content = "\n \n\n\n\n" + fp.write_text(page_content, encoding="utf-8") + frontend_paths.append(str(fp)) + + # 字段类型控件目录 + if "field_types" in frontend_options: + fp = root / "apps" / app / "frontend" / "src" / "views" / "pagetype" / slug / "form" / "controls" + fp.mkdir(parents=True, exist_ok=True) + frontend_paths.append(f"{str(fp)} (创建自定义字段控件)") + + frontend_path = "\n".join(frontend_paths) if frontend_paths else None + else: + frontend_path = None if create_backend: bp = root / "apps" / app / app / module / "pagetype" / slug / f"{slug}.py"
{{ frontendPath }}