From 21d03d8bace63b26d728644ef09d997092d71b75 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sun, 26 Oct 2025 10:11:36 +0800 Subject: [PATCH 01/22] =?UTF-8?q?feat=EF=BC=9A=E3=80=90antd=E3=80=91?= =?UTF-8?q?=E3=80=90mall=E3=80=91diy-editor=20=E4=BF=AE=E5=A4=8D=20element?= =?UTF-8?q?-plus=20=E7=BB=84=E4=BB=B6=E4=B9=8B=E8=B7=AF=EF=BC=9A=E9=83=A8?= =?UTF-8?q?=E5=88=86=E8=A7=A3=E5=86=B3=2020%?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/color-input/index.vue | 4 +- .../components/mobile/hot-zone/property.vue | 16 +- .../components/mobile/image-bar/property.vue | 14 +- .../components/mobile/menu-grid/property.vue | 63 +++--- .../mobile/page-config/property.vue | 6 +- .../mobile/product-list/property.vue | 119 +++++------ .../mobile/promotion-article/property.vue | 27 ++- .../mobile/promotion-combination/property.vue | 184 +++++++++--------- .../components/mobile/tab-bar/property.vue | 20 +- .../mobile/video-player/property.vue | 4 +- .../components/input-with-color/index.vue | 4 +- .../components/component-container.vue | 8 +- .../components/component-library.vue | 5 +- .../components/mobile/Carousel/config.ts | 5 +- .../components/mobile/Carousel/property.vue | 3 +- .../components/mobile/coupon-card/config.ts | 5 +- .../mobile/coupon-card/property.vue | 3 +- .../components/hot-zone-edit-dialog/index.vue | 2 +- .../components/mobile/hot-zone/config.ts | 5 +- .../components/mobile/hot-zone/property.vue | 2 +- .../components/mobile/image-bar/config.ts | 5 +- .../components/mobile/image-bar/property.vue | 3 +- .../components/mobile/magic-cube/config.ts | 5 +- .../components/mobile/magic-cube/property.vue | 3 +- .../components/mobile/menu-grid/config.ts | 5 +- .../components/mobile/menu-grid/property.vue | 2 +- .../components/mobile/menu-list/config.ts | 5 +- .../components/mobile/menu-list/property.vue | 2 +- .../components/mobile/menu-swiper/config.ts | 5 +- .../mobile/menu-swiper/property.vue | 2 +- .../mobile/navigation-bar/index.vue | 4 +- .../components/mobile/notice-bar/config.ts | 5 +- .../components/mobile/notice-bar/property.vue | 3 +- .../components/mobile/product-card/config.ts | 5 +- .../components/mobile/product-list/config.ts | 5 +- .../mobile/product-list/property.vue | 3 +- .../mobile/promotion-article/config.ts | 5 +- .../mobile/promotion-article/property.vue | 1 + .../mobile/promotion-combination/config.ts | 5 +- .../mobile/promotion-point/config.ts | 5 +- .../mobile/promotion-seckill/config.ts | 5 +- .../components/mobile/search-bar/config.ts | 5 +- .../components/mobile/search-bar/property.vue | 3 +- .../components/mobile/title-bar/config.ts | 5 +- .../components/mobile/title-bar/property.vue | 3 +- .../components/mobile/user-card/config.ts | 5 +- .../components/mobile/user-coupon/config.ts | 5 +- .../components/mobile/user-order/config.ts | 5 +- .../components/mobile/user-wallet/config.ts | 5 +- .../components/mobile/video-player/config.ts | 5 +- .../mobile/video-player/property.vue | 3 +- .../promotion/components/diy-editor/index.vue | 78 +++----- 52 files changed, 325 insertions(+), 379 deletions(-) diff --git a/apps/web-antd/src/views/mall/promotion/components/color-input/index.vue b/apps/web-antd/src/views/mall/promotion/components/color-input/index.vue index 192dfab15..1ce5abf52 100644 --- a/apps/web-antd/src/views/mall/promotion/components/color-input/index.vue +++ b/apps/web-antd/src/views/mall/promotion/components/color-input/index.vue @@ -1,7 +1,7 @@ + + + + diff --git a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/notice-bar/index.vue b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/notice-bar/index.vue index eef5a37d8..d74b741d4 100644 --- a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/notice-bar/index.vue +++ b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/notice-bar/index.vue @@ -1,12 +1,23 @@ diff --git a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/product-card/index.vue b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/product-card/index.vue index fb064c366..13f1c0fbc 100644 --- a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/product-card/index.vue +++ b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/product-card/index.vue @@ -7,6 +7,8 @@ import { ref, watch } from 'vue'; import { fenToYuan } from '@vben/utils'; +import { Image } from 'ant-design-vue'; + import * as ProductSpuApi from '#/api/mall/product/spu'; /** 商品卡片 */ diff --git a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/promotion-combination/index.vue b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/promotion-combination/index.vue index 566bb5d07..08ff86d1e 100644 --- a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/promotion-combination/index.vue +++ b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/promotion-combination/index.vue @@ -8,6 +8,8 @@ import { ref, watch } from 'vue'; import { fenToYuan } from '@vben/utils'; +import { Image } from 'ant-design-vue'; + import * as ProductSpuApi from '#/api/mall/product/spu'; import * as CombinationActivityApi from '#/api/mall/promotion/combination/combinationActivity'; diff --git a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/promotion-point/index.vue b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/promotion-point/index.vue index a33969044..174b20218 100644 --- a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/promotion-point/index.vue +++ b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/promotion-point/index.vue @@ -7,6 +7,8 @@ import { ref, watch } from 'vue'; import { fenToYuan } from '@vben/utils'; +import { Image } from 'ant-design-vue'; + import * as ProductSpuApi from '#/api/mall/product/spu'; import * as PointActivityApi from '#/api/mall/promotion/point'; diff --git a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/promotion-seckill/index.vue b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/promotion-seckill/index.vue index 8a9eb5a00..0c1226df7 100644 --- a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/promotion-seckill/index.vue +++ b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/promotion-seckill/index.vue @@ -8,6 +8,8 @@ import { ref, watch } from 'vue'; import { fenToYuan } from '@vben/utils'; +import { Image } from 'ant-design-vue'; + import * as ProductSpuApi from '#/api/mall/product/spu'; import * as SeckillActivityApi from '#/api/mall/promotion/seckill/seckillActivity'; diff --git a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/tab-bar/index.vue b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/tab-bar/index.vue index 59fda8a81..827c7358d 100644 --- a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/tab-bar/index.vue +++ b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/tab-bar/index.vue @@ -3,6 +3,8 @@ import type { TabBarProperty } from './config'; import { IconifyIcon } from '@vben/icons'; +import { Image } from 'ant-design-vue'; + /** 页面底部导航栏 */ defineOptions({ name: 'TabBar' }); diff --git a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/title-bar/index.vue b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/title-bar/index.vue index c3464c2b0..5bd0eb977 100644 --- a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/title-bar/index.vue +++ b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/title-bar/index.vue @@ -3,6 +3,8 @@ import type { TitleBarProperty } from './config'; import { IconifyIcon } from '@vben/icons'; +import { Image } from 'ant-design-vue'; + /** 标题栏 */ defineOptions({ name: 'TitleBar' }); diff --git a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/video-player/index.vue b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/video-player/index.vue index b1846cc32..f7a105c4a 100644 --- a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/video-player/index.vue +++ b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/video-player/index.vue @@ -1,6 +1,8 @@ @@ -70,13 +72,13 @@ function reset() { -// TODO @gjd:应该是 modules 模块,然后小写 import type { AiWriteApi } from '#/api/ai/write'; import { ref } from 'vue'; @@ -11,7 +10,7 @@ import { IconifyIcon } from '@vben/icons'; import { createReusableTemplate } from '@vueuse/core'; import { Button, message, Textarea } from 'ant-design-vue'; -import Tag from './Tag.vue'; +import Tag from './tag.vue'; type TabType = AiWriteApi.Write['type']; @@ -34,6 +33,7 @@ function omit(obj: Record, keysToOmit: string[]) { } return result; } + /** 点击示例的时候,将定义好的文章作为示例展示出来 */ function example(type: 'reply' | 'write') { formData.value = { @@ -79,13 +79,11 @@ const initData: AiWriteApi.Write = { length: 1, format: 1, }; - const formData = ref({ ...initData }); +const recordFormData = {} as Record; // 用来记录切换之前所填写的数据,切换的时候给赋值回来 -/** 用来记录切换之前所填写的数据,切换的时候给赋值回来 */ -const recordFormData = {} as Record; -/** 切换tab */ -function switchTab(value: TabType) { +/** 切换 tab */ +function handleSwitchTab(value: TabType) { if (value !== selectedTab.value) { // 保存之前的久数据 recordFormData[selectedTab.value] = formData.value; @@ -96,8 +94,11 @@ function switchTab(value: TabType) { } /** 提交写作 */ -function submit() { - if (selectedTab.value === 2 && !formData.value.originalContent) { +function handleSubmit() { + if ( + selectedTab.value === AiWriteTypeEnum.REPLY && + !formData.value.originalContent + ) { message.warning('请输入原文'); return; } @@ -105,12 +106,13 @@ function submit() { message.warning(`请输入${selectedTab.value === 1 ? '写作' : '回复'}内容`); return; } + emit('submit', { - /** 撰写的时候没有 originalContent 字段*/ + // 撰写的时候没有 originalContent 字段 ...(selectedTab.value === 1 ? omit(formData.value, ['originalContent']) : formData.value), - /** 使用选中 tab 值覆盖当前的 type 类型 */ + // 使用选中 tab 值覆盖当前的 type 类型 type: selectedTab.value, }); } @@ -156,7 +158,7 @@ function submit() { v-for="tab in tabs" :key="tab.value" :active="tab.value === selectedTab" - :item-click="() => switchTab(tab.value)" + :item-click="() => handleSwitchTab(tab.value)" :text="tab.text" class="relative z-20" /> @@ -167,7 +169,7 @@ function submit() { class="bg-card box-border h-full w-96 flex-grow overflow-y-auto px-7 pb-2 lg:block" >
-