From 16abb964a59920f2961bce5365304619cb76040c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=BC=A0?= <2091066548@qq.com> Date: Sun, 21 Sep 2025 00:27:58 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E9=97=A8=E6=88=B7=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E9=83=A8=E5=88=86=E6=90=AC=E8=BF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../online-design/portal/DesignEditor.vue | 539 +++++++++++ .../aiol/online-design/portal/Preview.vue | 224 +++++ .../portal/components/ComponentLibrary.vue | 328 +++++++ .../portal/components/DesignCanvas.vue | 831 +++++++++++++++++ .../portal/components/PropertyEditor.vue | 854 ++++++++++++++++++ .../design-components/ButtonComponent.vue | 232 +++++ .../design-components/CarouselComponent.vue | 230 +++++ .../design-components/ImageComponent.vue | 211 +++++ .../design-components/TextComponent.vue | 223 +++++ .../components/design-components/index.ts | 143 +++ .../views/aiol/online-design/portal/index.vue | 519 +++++++++++ .../src/views/aiol/online-design/test.vue | 135 +++ 12 files changed, 4469 insertions(+) create mode 100644 jeecgboot-vue3/src/views/aiol/online-design/portal/DesignEditor.vue create mode 100644 jeecgboot-vue3/src/views/aiol/online-design/portal/Preview.vue create mode 100644 jeecgboot-vue3/src/views/aiol/online-design/portal/components/ComponentLibrary.vue create mode 100644 jeecgboot-vue3/src/views/aiol/online-design/portal/components/DesignCanvas.vue create mode 100644 jeecgboot-vue3/src/views/aiol/online-design/portal/components/PropertyEditor.vue create mode 100644 jeecgboot-vue3/src/views/aiol/online-design/portal/components/design-components/ButtonComponent.vue create mode 100644 jeecgboot-vue3/src/views/aiol/online-design/portal/components/design-components/CarouselComponent.vue create mode 100644 jeecgboot-vue3/src/views/aiol/online-design/portal/components/design-components/ImageComponent.vue create mode 100644 jeecgboot-vue3/src/views/aiol/online-design/portal/components/design-components/TextComponent.vue create mode 100644 jeecgboot-vue3/src/views/aiol/online-design/portal/components/design-components/index.ts create mode 100644 jeecgboot-vue3/src/views/aiol/online-design/portal/index.vue create mode 100644 jeecgboot-vue3/src/views/aiol/online-design/test.vue diff --git a/jeecgboot-vue3/src/views/aiol/online-design/portal/DesignEditor.vue b/jeecgboot-vue3/src/views/aiol/online-design/portal/DesignEditor.vue new file mode 100644 index 00000000..54e8d9e7 --- /dev/null +++ b/jeecgboot-vue3/src/views/aiol/online-design/portal/DesignEditor.vue @@ -0,0 +1,539 @@ + + + + + + + + + + 返回 + + + {{ pageTitle }} + + + + + + + + 预览 + + + + + + 保存 + + + + + + + + + + + + + + 组件库 + + + + + + + 组件库 + + + + + + + + + + + + + + + + + + + 属性设置 + + + + + + + + + + + + + + + diff --git a/jeecgboot-vue3/src/views/aiol/online-design/portal/Preview.vue b/jeecgboot-vue3/src/views/aiol/online-design/portal/Preview.vue new file mode 100644 index 00000000..18298681 --- /dev/null +++ b/jeecgboot-vue3/src/views/aiol/online-design/portal/Preview.vue @@ -0,0 +1,224 @@ + + + + + + + + + + 返回 + + + {{ pageTitle }} - 预览 + + + + + + + + 编辑 + + + + + + 刷新 + + + + + + + + + + + + + + + + + + + + + + diff --git a/jeecgboot-vue3/src/views/aiol/online-design/portal/components/ComponentLibrary.vue b/jeecgboot-vue3/src/views/aiol/online-design/portal/components/ComponentLibrary.vue new file mode 100644 index 00000000..fb923ce3 --- /dev/null +++ b/jeecgboot-vue3/src/views/aiol/online-design/portal/components/ComponentLibrary.vue @@ -0,0 +1,328 @@ + + + + 组件库 + + + + + + + + 基础组件 + + + + + + + + + + 轮播图 + 图片轮播展示 + + + + + + + + + + + + + 文本 + 文字内容展示 + + + + + + + + + + + + + 图片 + 单张图片展示 + + + + + + + + + + + + + 按钮 + 交互按钮 + + + + + + + + + + + + + 布局组件 + + + + + + + + + + 容器 + 内容容器 + + + + + + + + + + 分栏 + 多列布局 + + + + + + + + + + + diff --git a/jeecgboot-vue3/src/views/aiol/online-design/portal/components/DesignCanvas.vue b/jeecgboot-vue3/src/views/aiol/online-design/portal/components/DesignCanvas.vue new file mode 100644 index 00000000..ec8abc7c --- /dev/null +++ b/jeecgboot-vue3/src/views/aiol/online-design/portal/components/DesignCanvas.vue @@ -0,0 +1,831 @@ + + + + + + 设计画布 + + + + + + 网格 + + + + + + {{ Math.round(zoomLevel * 100) }}% + + + + + + + + + + + + 清空 + + + + + + + + + + + + + + + + + + 从左侧组件库拖拽组件到网格中开始设计 + 支持网格布局和组件缩放 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/jeecgboot-vue3/src/views/aiol/online-design/portal/components/PropertyEditor.vue b/jeecgboot-vue3/src/views/aiol/online-design/portal/components/PropertyEditor.vue new file mode 100644 index 00000000..27698735 --- /dev/null +++ b/jeecgboot-vue3/src/views/aiol/online-design/portal/components/PropertyEditor.vue @@ -0,0 +1,854 @@ + + + + 属性编辑 + + + + + + + + + 请选择一个组件来编辑属性 + + + + + + + + + 基本信息 + + + 组件类型 + + + + 组件ID + + + + + + + + + + 轮播设置 + + + 自动播放 + + + + 显示指示点 + + + + 显示箭头 + + + + + + + + 图片管理 + + + + + + + + + + + + + + + + + + + + 点击上传图片 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 添加图片 + + + + + + + + + + + 文本内容 + + + 标签类型 + + 段落 (p) + 标题1 (h1) + 标题2 (h2) + 标题3 (h3) + 标题4 (h4) + 行内文本 (span) + + + + 文本内容 + + + + + + + + + + + 图片设置 + + + 图片 + + + + + + + + + + + + + + + + + 点击上传图片 + 支持 JPG、PNG、GIF 格式 + + + + + + + + + + + + + + 选择文件 + + + + + 替代文本 + + + + 显示方式 + + 覆盖 + 包含 + 填充 + 原始 + 缩小 + + + + + + + + + + + 按钮设置 + + + 按钮文字 + + + + 按钮类型 + + 主要按钮 + 默认按钮 + 虚线按钮 + 文本按钮 + 链接按钮 + + + + 按钮大小 + + 大 + 中 + 小 + + + + + + + + + + 样式设置 + + + 宽度 + + + + 高度 + + + + 外边距 + + + + 内边距 + + + + + + + 字体大小 + + + + 字体颜色 + + + + 文本对齐 + + 左对齐 + 居中 + 右对齐 + 两端对齐 + + + + + + + + + + + + diff --git a/jeecgboot-vue3/src/views/aiol/online-design/portal/components/design-components/ButtonComponent.vue b/jeecgboot-vue3/src/views/aiol/online-design/portal/components/design-components/ButtonComponent.vue new file mode 100644 index 00000000..9f32918c --- /dev/null +++ b/jeecgboot-vue3/src/views/aiol/online-design/portal/components/design-components/ButtonComponent.vue @@ -0,0 +1,232 @@ + + + + + + + {{ text }} + + + + + + + 按钮组件 + 请在右侧属性面板设置按钮文字 + + + + + + + + diff --git a/jeecgboot-vue3/src/views/aiol/online-design/portal/components/design-components/CarouselComponent.vue b/jeecgboot-vue3/src/views/aiol/online-design/portal/components/design-components/CarouselComponent.vue new file mode 100644 index 00000000..c2bbae0e --- /dev/null +++ b/jeecgboot-vue3/src/views/aiol/online-design/portal/components/design-components/CarouselComponent.vue @@ -0,0 +1,230 @@ + + + + + + + + {{ image.title }} + {{ image.description }} + + + + + + + + + + 轮播图组件 + 请在右侧属性面板添加图片 + + + + + + + + diff --git a/jeecgboot-vue3/src/views/aiol/online-design/portal/components/design-components/ImageComponent.vue b/jeecgboot-vue3/src/views/aiol/online-design/portal/components/design-components/ImageComponent.vue new file mode 100644 index 00000000..484029e5 --- /dev/null +++ b/jeecgboot-vue3/src/views/aiol/online-design/portal/components/design-components/ImageComponent.vue @@ -0,0 +1,211 @@ + + + + + + + + + + 图片组件 + 请在右侧属性面板设置图片URL + + + + + + + + + diff --git a/jeecgboot-vue3/src/views/aiol/online-design/portal/components/design-components/TextComponent.vue b/jeecgboot-vue3/src/views/aiol/online-design/portal/components/design-components/TextComponent.vue new file mode 100644 index 00000000..7a0ca7af --- /dev/null +++ b/jeecgboot-vue3/src/views/aiol/online-design/portal/components/design-components/TextComponent.vue @@ -0,0 +1,223 @@ + + + + + + + + + 文本组件 + 请在右侧属性面板编辑文本内容 + + + + + + + + diff --git a/jeecgboot-vue3/src/views/aiol/online-design/portal/components/design-components/index.ts b/jeecgboot-vue3/src/views/aiol/online-design/portal/components/design-components/index.ts new file mode 100644 index 00000000..ef68bda5 --- /dev/null +++ b/jeecgboot-vue3/src/views/aiol/online-design/portal/components/design-components/index.ts @@ -0,0 +1,143 @@ +import { App } from 'vue'; +import CarouselComponent from './CarouselComponent.vue'; +import TextComponent from './TextComponent.vue'; +import ImageComponent from './ImageComponent.vue'; +import ButtonComponent from './ButtonComponent.vue'; + +// 组件映射表 +export const componentMap = { + carousel: CarouselComponent, + text: TextComponent, + image: ImageComponent, + button: ButtonComponent, +}; + +// 获取组件类型 +export function getComponentType(type: string) { + return componentMap[type] || 'div'; +} + +// 注册所有设计组件 +export function registerDesignComponents(app: App) { + Object.entries(componentMap).forEach(([name, component]) => { + app.component(`Design${name.charAt(0).toUpperCase() + name.slice(1)}Component`, component); + }); +} + +// 导出所有组件 +export { + CarouselComponent, + TextComponent, + ImageComponent, + ButtonComponent, +}; + +// 组件配置信息 +export const componentConfigs = { + carousel: { + name: '轮播图', + icon: 'ion:images-outline', + description: '图片轮播展示', + category: 'basic', + defaultProps: { + autoplay: true, + dots: true, + arrows: false, + effect: 'scrollx', + dotPosition: 'bottom', + }, + defaultData: { + images: [ + { + url: 'https://via.placeholder.com/800x300/4CAF50/white?text=Slide+1', + alt: 'Slide 1' + }, + { + url: 'https://via.placeholder.com/800x300/2196F3/white?text=Slide+2', + alt: 'Slide 2' + }, + ], + }, + defaultStyle: { + width: '100%', + height: '300px', + marginBottom: '20px', + }, + }, + text: { + name: '文本', + icon: 'ion:text-outline', + description: '文字内容展示', + category: 'basic', + defaultProps: { + tag: 'p', + }, + defaultData: { + content: '这是一段文本内容,点击右侧属性面板可以编辑。', + }, + defaultStyle: { + fontSize: '16px', + color: '#333', + lineHeight: '1.6', + marginBottom: '16px', + }, + }, + image: { + name: '图片', + icon: 'ion:image-outline', + description: '单张图片展示', + category: 'basic', + defaultProps: { + alt: '图片', + objectFit: 'cover', + }, + defaultData: { + src: 'https://via.placeholder.com/400x200/FF9800/white?text=Image', + }, + defaultStyle: { + width: '400px', + height: '200px', + marginBottom: '16px', + }, + }, + button: { + name: '按钮', + icon: 'ion:radio-button-on-outline', + description: '交互按钮', + category: 'basic', + defaultProps: { + type: 'primary', + size: 'middle', + shape: 'default', + }, + defaultData: { + text: '按钮文字', + }, + defaultStyle: { + marginBottom: '16px', + }, + }, +}; + +// 根据类型获取组件配置 +export function getComponentConfig(type: string) { + return componentConfigs[type]; +} + +// 创建新组件实例 +export function createComponentInstance(type: string) { + const config = getComponentConfig(type); + if (!config) { + throw new Error(`Unknown component type: ${type}`); + } + + const id = `${type}_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`; + + return { + id, + type, + props: { ...config.defaultProps }, + data: { ...config.defaultData }, + style: { ...config.defaultStyle }, + }; +} diff --git a/jeecgboot-vue3/src/views/aiol/online-design/portal/index.vue b/jeecgboot-vue3/src/views/aiol/online-design/portal/index.vue new file mode 100644 index 00000000..7c313377 --- /dev/null +++ b/jeecgboot-vue3/src/views/aiol/online-design/portal/index.vue @@ -0,0 +1,519 @@ + + + + + + + 门户设计 + 创建和管理您的门户页面设计 + + + + + + + + 新建门户 + + + + + + + + + + + + + + + + 新建门户 + + + + + + + + + + {{ portal.name }} + + + + + + + + + + 设计 + + + + + + 预览 + + + + + + + + {{ portal.name }} + + + {{ portal.status === 1 ? '已发布' : '草稿' }} + + {{ formatTime(portal.updateTime) }} + + + + + + + + + + + + + + 编辑设计 + + + + 预览 + + + + 复制 + + + + + 删除 + + + + + + + + + + + + + + + 还没有门户设计 + 点击"新建门户"开始创建您的第一个门户页面 + + + + + + 新建门户 + + + + + + + + + + diff --git a/jeecgboot-vue3/src/views/aiol/online-design/test.vue b/jeecgboot-vue3/src/views/aiol/online-design/test.vue new file mode 100644 index 00000000..f8d27dff --- /dev/null +++ b/jeecgboot-vue3/src/views/aiol/online-design/test.vue @@ -0,0 +1,135 @@ + + + 在线设计模块测试页面 + + + 组件测试 + + + + 轮播图组件 + + + + + + 文本组件 + + + + + + + 图片组件 + + + + + + 按钮组件 + + + + + + + + 功能测试 + 请访问 /online-design/portal 测试完整的在线设计功能。 + + + + + + +
从左侧组件库拖拽组件到网格中开始设计
支持网格布局和组件缩放
请选择一个组件来编辑属性
点击上传图片
支持 JPG、PNG、GIF 格式
按钮组件
请在右侧属性面板设置按钮文字
{{ image.description }}
轮播图组件
请在右侧属性面板添加图片
图片组件
请在右侧属性面板设置图片URL
文本组件
请在右侧属性面板编辑文本内容
创建和管理您的门户页面设计
点击"新建门户"开始创建您的第一个门户页面
请访问 /online-design/portal 测试完整的在线设计功能。