feat:【antd】【mall】diy-editor 初始化(暂时不可用,保证界面先有。。。)linter

This commit is contained in:
YunaiV
2025-10-25 23:40:03 +08:00
parent db1b3be27a
commit 0fb4f0f9eb
75 changed files with 137 additions and 235 deletions

View File

@@ -120,8 +120,9 @@ function handleGroupSelected(group: string) {
/** 自动滚动分组按钮,确保分组按钮保持在可视区域内 */ /** 自动滚动分组按钮,确保分组按钮保持在可视区域内 */
function scrollToGroupBtn(group: string) { function scrollToGroupBtn(group: string) {
const groupBtn = groupBtnRefs.value const groupBtn = groupBtnRefs.value.find(
.find((ref: HTMLButtonElement | undefined) => ref?.textContent === group); (ref: HTMLButtonElement | undefined) => ref?.textContent === group,
);
if (groupBtn && groupScrollbar.value) { if (groupBtn && groupScrollbar.value) {
groupScrollbar.value.scrollTop = groupBtn.offsetTop; groupScrollbar.value.scrollTop = groupBtn.offsetTop;
} }
@@ -150,14 +151,11 @@ function handleProductCategorySelected(id: number) {
<Modal v-model:open="dialogVisible" title="选择链接" width="65%"> <Modal v-model:open="dialogVisible" title="选择链接" width="65%">
<div class="flex h-[500px] gap-2"> <div class="flex h-[500px] gap-2">
<!-- 左侧分组列表 --> <!-- 左侧分组列表 -->
<div <div class="flex h-full flex-col overflow-y-auto" ref="groupScrollbar">
class="h-full overflow-y-auto flex flex-col"
ref="groupScrollbar"
>
<Button <Button
v-for="(group, groupIndex) in APP_LINK_GROUP_LIST" v-for="(group, groupIndex) in APP_LINK_GROUP_LIST"
:key="groupIndex" :key="groupIndex"
class="ml-0 mr-4 w-[90px] justify-start mb-1" class="mb-1 ml-0 mr-4 w-[90px] justify-start"
:class="[{ active: activeGroup === group.name }]" :class="[{ active: activeGroup === group.name }]"
ref="groupBtnRefs" ref="groupBtnRefs"
:type="activeGroup === group.name ? 'primary' : 'default'" :type="activeGroup === group.name ? 'primary' : 'default'"

View File

@@ -39,7 +39,11 @@ watch(
</script> </script>
<template> <template>
<InputGroup compact> <InputGroup compact>
<Input v-model:value="appLink" placeholder="输入或选择链接" class="flex-1" /> <Input
v-model:value="appLink"
placeholder="输入或选择链接"
class="flex-1"
/>
<Button @click="handleOpenDialog">选择</Button> <Button @click="handleOpenDialog">选择</Button>
</InputGroup> </InputGroup>

View File

@@ -122,7 +122,11 @@ const handleSliderChange = (prop: string) => {
<!-- 每个组件的通用内容 --> <!-- 每个组件的通用内容 -->
<TabPane tab="样式" key="style"> <TabPane tab="样式" key="style">
<Card title="组件样式" class="property-group"> <Card title="组件样式" class="property-group">
<Form :model="formData" labelCol="{ span: 6 }" wrapperCol="{ span: 18 }"> <Form
:model="formData"
label-col="{ span: 6 }"
wrapper-col="{ span: 18 }"
>
<FormItem label="组件背景" name="bgType"> <FormItem label="组件背景" name="bgType">
<RadioGroup v-model:value="formData.bgType"> <RadioGroup v-model:value="formData.bgType">
<Radio value="color">纯色</Radio> <Radio value="color">纯色</Radio>

View File

@@ -1,16 +1,13 @@
<script setup lang="ts"> <script setup lang="ts">
import type { import type { ComponentStyle, DiyComponent } from '../util';
ComponentStyle,
DiyComponent,
} from '../util';
import { computed } from 'vue'; import { computed } from 'vue';
import { IconifyIcon } from '@vben/icons'; import { IconifyIcon } from '@vben/icons';
import { VerticalButtonGroup } from '#/views/mall/promotion/components';
import { components } from './mobile'; import { components } from './mobile';
import { VerticalButtonGroup } from '#/views/mall/promotion/components';
/** /**
* 组件容器:目前在中间部分 * 组件容器:目前在中间部分

View File

@@ -1,8 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import type { import type { DiyComponent, DiyComponentLibrary } from '../util';
DiyComponent,
DiyComponentLibrary,
} from '../util';
import { reactive, watch } from 'vue'; import { reactive, watch } from 'vue';
@@ -66,7 +63,7 @@ const handleCloneComponent = (component: DiyComponent<any>) => {
<template> <template>
<div class="editor-left w-[261px]"> <div class="editor-left w-[261px]">
<div class="h-full overflow-y-auto"> <div class="h-full overflow-y-auto">
<Collapse v-model:activeKey="extendGroups"> <Collapse v-model:active-key="extendGroups">
<CollapsePanel <CollapsePanel
v-for="group in groups" v-for="group in groups"
:key="group.name" :key="group.name"

View File

@@ -1,7 +1,4 @@
import type { import type { ComponentStyle, DiyComponent } from '../../../util';
ComponentStyle,
DiyComponent,
} from '../../../util';
/** 轮播图属性 */ /** 轮播图属性 */
export interface CarouselProperty { export interface CarouselProperty {

View File

@@ -5,7 +5,6 @@ import { ref } from 'vue';
import { IconifyIcon } from '@vben/icons'; import { IconifyIcon } from '@vben/icons';
/** 轮播图 */ /** 轮播图 */
defineOptions({ name: 'Carousel' }); defineOptions({ name: 'Carousel' });
@@ -27,13 +26,17 @@ const handleIndexChange = (index: number) => {
<div v-else class="relative"> <div v-else class="relative">
<Carousel <Carousel
:autoplay="property.autoplay" :autoplay="property.autoplay"
:autoplaySpeed="property.interval * 1000" :autoplay-speed="property.interval * 1000"
:dots="property.indicator !== 'number'" :dots="property.indicator !== 'number'"
@change="handleIndexChange" @change="handleIndexChange"
class="h-[174px]" class="h-[174px]"
> >
<div v-for="(item, index) in property.items" :key="index"> <div v-for="(item, index) in property.items" :key="index">
<Image class="h-full w-full object-cover" :src="item.imgUrl" :preview="false" /> <Image
class="h-full w-full object-cover"
:src="item.imgUrl"
:preview="false"
/>
</div> </div>
</Carousel> </Carousel>
<div <div

View File

@@ -5,11 +5,12 @@ import { IconifyIcon } from '@vben/icons';
import { useVModel } from '@vueuse/core'; import { useVModel } from '@vueuse/core';
import ComponentContainerProperty from '../../component-container-property.vue';
import UploadFile from '#/components/upload/file-upload.vue'; import UploadFile from '#/components/upload/file-upload.vue';
import UploadImg from '#/components/upload/image-upload.vue'; import UploadImg from '#/components/upload/image-upload.vue';
import { AppLinkInput, Draggable } from '#/views/mall/promotion/components'; import { AppLinkInput, Draggable } from '#/views/mall/promotion/components';
import ComponentContainerProperty from '../../component-container-property.vue';
// 轮播图属性面板 // 轮播图属性面板
defineOptions({ name: 'CarouselProperty' }); defineOptions({ name: 'CarouselProperty' });

View File

@@ -1,6 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import type { DividerProperty } from './config';
import { IconifyIcon } from '@vben/icons';
import { useVModel } from '@vueuse/core';

View File

@@ -5,7 +5,6 @@ import { ref } from 'vue';
import { IconifyIcon } from '@vben/icons'; import { IconifyIcon } from '@vben/icons';
/** 弹窗广告 */ /** 弹窗广告 */
defineOptions({ name: 'Popover' }); defineOptions({ name: 'Popover' });
// 定义属性 // 定义属性

View File

@@ -1,4 +1,3 @@
<script setup lang="ts"> <script setup lang="ts">
import type { PopoverProperty } from './config';
import { useVModel } from '@vueuse/core';

View File

@@ -1,7 +1,4 @@
import type { import type { ComponentStyle, DiyComponent } from '../../../util';
ComponentStyle,
DiyComponent,
} from '../../../util';
/** 商品卡片属性 */ /** 商品卡片属性 */
export interface CouponCardProperty { export interface CouponCardProperty {

View File

@@ -5,7 +5,6 @@ import type { MallCouponTemplateApi } from '#/api/mall/promotion/coupon/couponTe
import { onMounted, ref, watch } from 'vue'; import { onMounted, ref, watch } from 'vue';
import * as CouponTemplateApi from '#/api/mall/promotion/coupon/couponTemplate'; import * as CouponTemplateApi from '#/api/mall/promotion/coupon/couponTemplate';
import { import {

View File

@@ -1,7 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import type { CouponCardProperty } from './config';
import type { MallCouponTemplateApi } from '#/api/mall/promotion/coupon/couponTemplate';
import { ref, watch } from 'vue';

View File

@@ -1,4 +1,3 @@
<script setup lang="ts"> <script setup lang="ts">
import type { FloatingActionButtonProperty } from './config';
import { useVModel } from '@vueuse/core';

View File

@@ -1,11 +1,8 @@
<script setup lang="ts"> <script setup lang="ts">
import type { ControlDot } from './controller';
import type { HotZoneItemProperty } from '../../config';
import type { AppLink } from '#/views/mall/promotion/components/app-link-input/data';
import { ref } from 'vue';
import { IconifyIcon } from '@vben/icons';

View File

@@ -1,7 +1,4 @@
import type { import type { ComponentStyle, DiyComponent } from '../../../util';
ComponentStyle,
DiyComponent,
} from '../../../util';
/** 热区属性 */ /** 热区属性 */
export interface HotZoneProperty { export interface HotZoneProperty {

View File

@@ -1,7 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import type { HotZoneProperty } from './config'; import type { HotZoneProperty } from './config';
/** 热区 */ /** 热区 */
defineOptions({ name: 'HotZone' }); defineOptions({ name: 'HotZone' });
const props = defineProps<{ property: HotZoneProperty }>(); const props = defineProps<{ property: HotZoneProperty }>();

View File

@@ -5,9 +5,9 @@ import { ref } from 'vue';
import { useVModel } from '@vueuse/core'; import { useVModel } from '@vueuse/core';
import ComponentContainerProperty from '../../component-container-property.vue';
import UploadImg from '#/components/upload/image-upload.vue'; import UploadImg from '#/components/upload/image-upload.vue';
import ComponentContainerProperty from '../../component-container-property.vue';
import HotZoneEditDialog from './components/hot-zone-edit-dialog/index.vue'; import HotZoneEditDialog from './components/hot-zone-edit-dialog/index.vue';
/** 热区属性面板 */ /** 热区属性面板 */

View File

@@ -1,7 +1,4 @@
import type { import type { ComponentStyle, DiyComponent } from '../../../util';
ComponentStyle,
DiyComponent,
} from '../../../util';
/** 图片展示属性 */ /** 图片展示属性 */
export interface ImageBarProperty { export interface ImageBarProperty {

View File

@@ -3,7 +3,6 @@ import type { ImageBarProperty } from './config';
import { IconifyIcon } from '@vben/icons'; import { IconifyIcon } from '@vben/icons';
/** 图片展示 */ /** 图片展示 */
defineOptions({ name: 'ImageBar' }); defineOptions({ name: 'ImageBar' });
@@ -17,7 +16,12 @@ defineProps<{ property: ImageBarProperty }>();
> >
<IconifyIcon icon="ep:picture" class="text-3xl text-gray-600" /> <IconifyIcon icon="ep:picture" class="text-3xl text-gray-600" />
</div> </div>
<Image class="min-h-8 w-full" v-else :src="property.imgUrl" :preview="false" /> <Image
class="min-h-8 w-full"
v-else
:src="property.imgUrl"
:preview="false"
/>
</template> </template>
<style scoped lang="scss"> <style scoped lang="scss">

View File

@@ -3,10 +3,11 @@ import type { ImageBarProperty } from './config';
import { useVModel } from '@vueuse/core'; import { useVModel } from '@vueuse/core';
import ComponentContainerProperty from '../../component-container-property.vue';
import UploadImg from '#/components/upload/image-upload.vue'; import UploadImg from '#/components/upload/image-upload.vue';
import { AppLinkInput } from '#/views/mall/promotion/components'; import { AppLinkInput } from '#/views/mall/promotion/components';
import ComponentContainerProperty from '../../component-container-property.vue';
// 图片展示属性面板 // 图片展示属性面板
defineOptions({ name: 'ImageBarProperty' }); defineOptions({ name: 'ImageBarProperty' });

View File

@@ -1,7 +1,4 @@
import type { import type { ComponentStyle, DiyComponent } from '../../../util';
ComponentStyle,
DiyComponent,
} from '../../../util';
/** 广告魔方属性 */ /** 广告魔方属性 */
export interface MagicCubeProperty { export interface MagicCubeProperty {

View File

@@ -5,7 +5,6 @@ import { computed } from 'vue';
import { IconifyIcon } from '@vben/icons'; import { IconifyIcon } from '@vben/icons';
/** 广告魔方 */ /** 广告魔方 */
defineOptions({ name: 'MagicCube' }); defineOptions({ name: 'MagicCube' });
const props = defineProps<{ property: MagicCubeProperty }>(); const props = defineProps<{ property: MagicCubeProperty }>();

View File

@@ -1,9 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import type { MagicCubeProperty } from './config';
import { ref } from 'vue';
import { useVModel } from '@vueuse/core';
import ComponentContainerProperty from '../../component-container-property.vue';
import UploadImg from '#/components/upload/image-upload.vue';

View File

@@ -1,7 +1,4 @@
import type { import type { ComponentStyle, DiyComponent } from '../../../util';
ComponentStyle,
DiyComponent,
} from '../../../util';
import { cloneDeep } from '@vben/utils'; import { cloneDeep } from '@vben/utils';

View File

@@ -1,7 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import type { MenuGridProperty } from './config'; import type { MenuGridProperty } from './config';
/** 宫格导航 */ /** 宫格导航 */
defineOptions({ name: 'MenuGrid' }); defineOptions({ name: 'MenuGrid' });
defineProps<{ property: MenuGridProperty }>(); defineProps<{ property: MenuGridProperty }>();
@@ -26,7 +25,12 @@ defineProps<{ property: MenuGridProperty }>();
> >
{{ item.badge.text }} {{ item.badge.text }}
</span> </span>
<Image v-if="item.iconUrl" class="h-7 w-7" :src="item.iconUrl" :preview="false" /> <Image
v-if="item.iconUrl"
class="h-7 w-7"
:src="item.iconUrl"
:preview="false"
/>
<span <span
class="mt-2 h-4 text-xs leading-4" class="mt-2 h-4 text-xs leading-4"
:style="{ color: item.titleColor }" :style="{ color: item.titleColor }"

View File

@@ -1,7 +1,4 @@
import type { import type { ComponentStyle, DiyComponent } from '../../../util';
ComponentStyle,
DiyComponent,
} from '../../../util';
import { cloneDeep } from '@vben/utils'; import { cloneDeep } from '@vben/utils';

View File

@@ -3,7 +3,6 @@ import type { MenuListProperty } from './config';
import { IconifyIcon } from '@vben/icons'; import { IconifyIcon } from '@vben/icons';
/** 列表导航 */ /** 列表导航 */
defineOptions({ name: 'MenuList' }); defineOptions({ name: 'MenuList' });
defineProps<{ property: MenuListProperty }>(); defineProps<{ property: MenuListProperty }>();

View File

@@ -1,7 +1,4 @@
<script setup lang="ts"> <script setup lang="ts">
import type { MenuListProperty } from './config';
import { useVModel } from '@vueuse/core';
import ComponentContainerProperty from '../../component-container-property.vue';
import UploadImg from '#/components/upload/image-upload.vue';

View File

@@ -1,7 +1,4 @@
import type { import type { ComponentStyle, DiyComponent } from '../../../util';
ComponentStyle,
DiyComponent,
} from '../../../util';
import { cloneDeep } from '@vben/utils'; import { cloneDeep } from '@vben/utils';

View File

@@ -3,7 +3,6 @@ import type { MenuSwiperItemProperty, MenuSwiperProperty } from './config';
import { ref, watch } from 'vue'; import { ref, watch } from 'vue';
/** 菜单导航 */ /** 菜单导航 */
defineOptions({ name: 'MenuSwiper' }); defineOptions({ name: 'MenuSwiper' });
const props = defineProps<{ property: MenuSwiperProperty }>(); const props = defineProps<{ property: MenuSwiperProperty }>();

View File

@@ -1,6 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import type { MenuSwiperProperty } from './config';
import { cloneDeep } from '@vben/utils';
import { useVModel } from '@vueuse/core';

View File

@@ -1,8 +1,6 @@
<script lang="ts" setup> <script lang="ts" setup>
import type { NavigationBarCellProperty } from '../config';
import type { Rect } from '#/views/mall/promotion/components/magic-cube-editor/util';
import { computed, ref } from 'vue';
import { useVModel } from '@vueuse/core';

View File

@@ -1,16 +1,16 @@
<script setup lang="ts"> <script setup lang="ts">
import type { StyleValue } from 'vue'; import type { StyleValue } from 'vue';
import type { SearchProperty } from '../search-bar/config';
import type { import type {
NavigationBarCellProperty, NavigationBarCellProperty,
NavigationBarProperty, NavigationBarProperty,
} from './config'; } from './config';
import type { SearchProperty } from '../search-bar/config';
import { computed } from 'vue'; import { computed } from 'vue';
import appNavbarMp from '#/assets/imgs/diy/app-nav-bar-mp.png'; import appNavbarMp from '#/assets/imgs/diy/app-nav-bar-mp.png';
import SearchBar from '../search-bar/index.vue'; import SearchBar from '../search-bar/index.vue';
/** 页面顶部导航栏 */ /** 页面顶部导航栏 */

View File

@@ -1,7 +1,4 @@
import type { import type { ComponentStyle, DiyComponent } from '../../../util';
ComponentStyle,
DiyComponent,
} from '../../../util';
/** 公告栏属性 */ /** 公告栏属性 */
export interface NoticeBarProperty { export interface NoticeBarProperty {

View File

@@ -3,7 +3,6 @@ import type { NoticeBarProperty } from './config';
import { IconifyIcon } from '@vben/icons'; import { IconifyIcon } from '@vben/icons';
/** 公告栏 */ /** 公告栏 */
defineOptions({ name: 'NoticeBar' }); defineOptions({ name: 'NoticeBar' });

View File

@@ -1,7 +1,4 @@
<script setup lang="ts"> <script setup lang="ts">
import type { NoticeBarProperty } from './config';
import { useVModel } from '@vueuse/core';
import ComponentContainerProperty from '../../component-container-property.vue';
import UploadImg from '#/components/upload/image-upload.vue';

View File

@@ -19,7 +19,12 @@ const formData = useVModel(props, 'modelValue', emit);
</script> </script>
<template> <template>
<Form :model="formData" :rules="rules" labelCol="{ span: 6 }" wrapperCol="{ span: 18 }"> <Form
:model="formData"
:rules="rules"
label-col="{ span: 6 }"
wrapper-col="{ span: 18 }"
>
<FormItem label="页面描述" name="description"> <FormItem label="页面描述" name="description">
<Textarea <Textarea
v-model:value="formData!.description" v-model:value="formData!.description"

View File

@@ -1,7 +1,4 @@
import type { import type { ComponentStyle, DiyComponent } from '../../../util';
ComponentStyle,
DiyComponent,
} from '../../../util';
/** 商品卡片属性 */ /** 商品卡片属性 */
export interface ProductCardProperty { export interface ProductCardProperty {

View File

@@ -7,7 +7,6 @@ import { ref, watch } from 'vue';
import { fenToYuan } from '@vben/utils'; import { fenToYuan } from '@vben/utils';
import * as ProductSpuApi from '#/api/mall/product/spu'; import * as ProductSpuApi from '#/api/mall/product/spu';
/** 商品卡片 */ /** 商品卡片 */

View File

@@ -1,6 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import type { ProductCardProperty } from './config';
import { IconifyIcon } from '@vben/icons';
import { useVModel } from '@vueuse/core';

View File

@@ -1,7 +1,4 @@
import type { import type { ComponentStyle, DiyComponent } from '../../../util';
ComponentStyle,
DiyComponent,
} from '../../../util';
/** 商品栏属性 */ /** 商品栏属性 */
export interface ProductListProperty { export interface ProductListProperty {

View File

@@ -7,7 +7,6 @@ import { onMounted, ref, watch } from 'vue';
import { fenToYuan } from '@vben/utils'; import { fenToYuan } from '@vben/utils';
import * as ProductSpuApi from '#/api/mall/product/spu'; import * as ProductSpuApi from '#/api/mall/product/spu';
/** 商品栏 */ /** 商品栏 */

View File

@@ -5,9 +5,10 @@ import { IconifyIcon } from '@vben/icons';
import { useVModel } from '@vueuse/core'; import { useVModel } from '@vueuse/core';
import ComponentContainerProperty from '../../component-container-property.vue';
import UploadImg from '#/components/upload/image-upload.vue'; import UploadImg from '#/components/upload/image-upload.vue';
import { InputWithColor as ColorInput } from '#/views/mall/promotion/components'; import { InputWithColor as ColorInput } from '#/views/mall/promotion/components';
import ComponentContainerProperty from '../../component-container-property.vue';
// TODO: 添加组件 // TODO: 添加组件
// import SpuShowcase from '#/views/mall/product/spu/components/spu-showcase.vue'; // import SpuShowcase from '#/views/mall/product/spu/components/spu-showcase.vue';

View File

@@ -1,7 +1,4 @@
import type { import type { ComponentStyle, DiyComponent } from '../../../util';
ComponentStyle,
DiyComponent,
} from '../../../util';
/** 营销文章属性 */ /** 营销文章属性 */
export interface PromotionArticleProperty { export interface PromotionArticleProperty {

View File

@@ -8,6 +8,7 @@ import { onMounted, ref } from 'vue';
import { useVModel } from '@vueuse/core'; import { useVModel } from '@vueuse/core';
import * as ArticleApi from '#/api/mall/promotion/article/index'; import * as ArticleApi from '#/api/mall/promotion/article/index';
import ComponentContainerProperty from '../../component-container-property.vue'; import ComponentContainerProperty from '../../component-container-property.vue';
// 营销文章属性面板 // 营销文章属性面板

View File

@@ -1,7 +1,4 @@
import type { import type { ComponentStyle, DiyComponent } from '../../../util';
ComponentStyle,
DiyComponent,
} from '../../../util';
/** 拼团属性 */ /** 拼团属性 */
export interface PromotionCombinationProperty { export interface PromotionCombinationProperty {

View File

@@ -8,7 +8,6 @@ import { ref, watch } from 'vue';
import { fenToYuan } from '@vben/utils'; import { fenToYuan } from '@vben/utils';
import * as ProductSpuApi from '#/api/mall/product/spu'; import * as ProductSpuApi from '#/api/mall/product/spu';
import * as CombinationActivityApi from '#/api/mall/promotion/combination/combinationActivity'; import * as CombinationActivityApi from '#/api/mall/promotion/combination/combinationActivity';

View File

@@ -1,7 +1,4 @@
import type { import type { ComponentStyle, DiyComponent } from '../../../util';
ComponentStyle,
DiyComponent,
} from '../../../util';
/** 积分商城属性 */ /** 积分商城属性 */
export interface PromotionPointProperty { export interface PromotionPointProperty {

View File

@@ -7,7 +7,6 @@ import { ref, watch } from 'vue';
import { fenToYuan } from '@vben/utils'; import { fenToYuan } from '@vben/utils';
import * as ProductSpuApi from '#/api/mall/product/spu'; import * as ProductSpuApi from '#/api/mall/product/spu';
import * as PointActivityApi from '#/api/mall/promotion/point'; import * as PointActivityApi from '#/api/mall/promotion/point';

View File

@@ -1,6 +1,5 @@
<script lang="ts" setup> <script lang="ts" setup>
import type { PromotionPointProperty } from './config';
import { IconifyIcon } from '@vben/icons';
import { useVModel } from '@vueuse/core';

View File

@@ -1,7 +1,4 @@
import type { import type { ComponentStyle, DiyComponent } from '../../../util';
ComponentStyle,
DiyComponent,
} from '../../../util';
/** 秒杀属性 */ /** 秒杀属性 */
export interface PromotionSeckillProperty { export interface PromotionSeckillProperty {

View File

@@ -8,7 +8,6 @@ import { ref, watch } from 'vue';
import { fenToYuan } from '@vben/utils'; import { fenToYuan } from '@vben/utils';
import * as ProductSpuApi from '#/api/mall/product/spu'; import * as ProductSpuApi from '#/api/mall/product/spu';
import * as SeckillActivityApi from '#/api/mall/promotion/seckill/seckillActivity'; import * as SeckillActivityApi from '#/api/mall/promotion/seckill/seckillActivity';

View File

@@ -1,11 +1,8 @@
<script setup lang="ts"> <script setup lang="ts">
import type { PromotionSeckillProperty } from './config';
import type { MallSeckillActivityApi } from '#/api/mall/promotion/seckill/seckillActivity';
import { onMounted, ref } from 'vue';
import { CommonStatusEnum } from '@vben/constants';
import { IconifyIcon } from '@vben/icons';
import { useVModel } from '@vueuse/core';

View File

@@ -1,7 +1,4 @@
import type { import type { ComponentStyle, DiyComponent } from '../../../util';
ComponentStyle,
DiyComponent,
} from '../../../util';
/** 搜索框属性 */ /** 搜索框属性 */
export interface SearchProperty { export interface SearchProperty {

View File

@@ -1,9 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import type { SearchProperty } from './config';
import { watch } from 'vue';
import { IconifyIcon } from '@vben/icons';
import { isString } from '@vben/utils';
import { useVModel } from '@vueuse/core';

View File

@@ -3,8 +3,6 @@ import type { TabBarProperty } from './config';
import { IconifyIcon } from '@vben/icons'; import { IconifyIcon } from '@vben/icons';
/** 页面底部导航栏 */ /** 页面底部导航栏 */
defineOptions({ name: 'TabBar' }); defineOptions({ name: 'TabBar' });

View File

@@ -35,7 +35,7 @@ const handleThemeChange = () => {
<template> <template>
<div class="tab-bar"> <div class="tab-bar">
<!-- 表单 --> <!-- 表单 -->
<Form :model="formData" labelCol="{ span: 6 }" wrapperCol="{ span: 18 }"> <Form :model="formData" label-col="{ span: 6 }" wrapper-col="{ span: 18 }">
<FormItem label="主题" name="theme"> <FormItem label="主题" name="theme">
<Select v-model:value="formData!.theme" @change="handleThemeChange"> <Select v-model:value="formData!.theme" @change="handleThemeChange">
<SelectOption <SelectOption
@@ -78,8 +78,8 @@ const handleThemeChange = () => {
</UploadImg> </UploadImg>
</FormItem> </FormItem>
<div class="text-base mb-2">图标设置</div> <div class="mb-2 text-base">图标设置</div>
<div class="text-xs text-gray-500 mb-2"> <div class="mb-2 text-xs text-gray-500">
拖动左上角的小圆点可对其排序, 图标建议尺寸 44*44 拖动左上角的小圆点可对其排序, 图标建议尺寸 44*44
</div> </div>
<Draggable v-model="formData.items" :limit="5"> <Draggable v-model="formData.items" :limit="5">
@@ -106,10 +106,22 @@ const handleThemeChange = () => {
<div class="text-xs">已选中</div> <div class="text-xs">已选中</div>
</div> </div>
</div> </div>
<FormItem name="text" label="文字" labelCol="{ span: 4 }" wrapperCol="{ span: 20 }" class="mb-2"> <FormItem
name="text"
label="文字"
label-col="{ span: 4 }"
wrapper-col="{ span: 20 }"
class="mb-2"
>
<Input v-model:value="element.text" placeholder="请输入文字" /> <Input v-model:value="element.text" placeholder="请输入文字" />
</FormItem> </FormItem>
<FormItem name="url" label="链接" labelCol="{ span: 4 }" wrapperCol="{ span: 20 }" class="mb-0"> <FormItem
name="url"
label="链接"
label-col="{ span: 4 }"
wrapper-col="{ span: 20 }"
class="mb-0"
>
<AppLinkInput v-model="element.url" /> <AppLinkInput v-model="element.url" />
</FormItem> </FormItem>
</template> </template>

View File

@@ -1,7 +1,4 @@
import type { import type { ComponentStyle, DiyComponent } from '../../../util';
ComponentStyle,
DiyComponent,
} from '../../../util';
/** 标题栏属性 */ /** 标题栏属性 */
export interface TitleBarProperty { export interface TitleBarProperty {

View File

@@ -3,7 +3,6 @@ import type { TitleBarProperty } from './config';
import { IconifyIcon } from '@vben/icons'; import { IconifyIcon } from '@vben/icons';
/** 标题栏 */ /** 标题栏 */
defineOptions({ name: 'TitleBar' }); defineOptions({ name: 'TitleBar' });

View File

@@ -1,6 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import type { TitleBarProperty } from './config';
import { IconifyIcon } from '@vben/icons';
import { useVModel } from '@vueuse/core';

View File

@@ -1,7 +1,4 @@
import type { import type { ComponentStyle, DiyComponent } from '../../../util';
ComponentStyle,
DiyComponent,
} from '../../../util';
/** 用户卡片属性 */ /** 用户卡片属性 */
export interface UserCardProperty { export interface UserCardProperty {

View File

@@ -3,7 +3,6 @@ import type { UserCardProperty } from './config';
import { IconifyIcon } from '@vben/icons'; import { IconifyIcon } from '@vben/icons';
/** 用户卡片 */ /** 用户卡片 */
defineOptions({ name: 'UserCard' }); defineOptions({ name: 'UserCard' });
// 定义属性 // 定义属性

View File

@@ -1,7 +1,4 @@
import type { import type { ComponentStyle, DiyComponent } from '../../../util';
ComponentStyle,
DiyComponent,
} from '../../../util';
/** 用户卡券属性 */ /** 用户卡券属性 */
export interface UserCouponProperty { export interface UserCouponProperty {

View File

@@ -1,7 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import type { UserCouponProperty } from './config'; import type { UserCouponProperty } from './config';
/** 用户卡券 */ /** 用户卡券 */
defineOptions({ name: 'UserCoupon' }); defineOptions({ name: 'UserCoupon' });
// 定义属性 // 定义属性

View File

@@ -1,7 +1,4 @@
import type { import type { ComponentStyle, DiyComponent } from '../../../util';
ComponentStyle,
DiyComponent,
} from '../../../util';
/** 用户订单属性 */ /** 用户订单属性 */
export interface UserOrderProperty { export interface UserOrderProperty {

View File

@@ -1,7 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import type { UserOrderProperty } from './config'; import type { UserOrderProperty } from './config';
/** 用户订单 */ /** 用户订单 */
defineOptions({ name: 'UserOrder' }); defineOptions({ name: 'UserOrder' });
// 定义属性 // 定义属性

View File

@@ -1,7 +1,4 @@
import type { import type { ComponentStyle, DiyComponent } from '../../../util';
ComponentStyle,
DiyComponent,
} from '../../../util';
/** 用户资产属性 */ /** 用户资产属性 */
export interface UserWalletProperty { export interface UserWalletProperty {

View File

@@ -1,7 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import type { UserWalletProperty } from './config'; import type { UserWalletProperty } from './config';
/** 用户资产 */ /** 用户资产 */
defineOptions({ name: 'UserWallet' }); defineOptions({ name: 'UserWallet' });
// 定义属性 // 定义属性

View File

@@ -1,7 +1,4 @@
import type { import type { ComponentStyle, DiyComponent } from '../../../util';
ComponentStyle,
DiyComponent,
} from '../../../util';
/** 视频播放属性 */ /** 视频播放属性 */
export interface VideoPlayerProperty { export interface VideoPlayerProperty {

View File

@@ -1,7 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import type { VideoPlayerProperty } from './config'; import type { VideoPlayerProperty } from './config';
/** 视频播放 */ /** 视频播放 */
defineOptions({ name: 'VideoPlayer' }); defineOptions({ name: 'VideoPlayer' });
@@ -9,11 +8,7 @@ defineProps<{ property: VideoPlayerProperty }>();
</script> </script>
<template> <template>
<div class="w-full" :style="{ height: `${property.style.height}px` }"> <div class="w-full" :style="{ height: `${property.style.height}px` }">
<Image <Image class="w-full" :src="property.posterUrl" v-if="property.posterUrl" />
class="w-full"
:src="property.posterUrl"
v-if="property.posterUrl"
/>
<video <video
v-else v-else
class="w-full" class="w-full"

View File

@@ -3,10 +3,11 @@ import type { VideoPlayerProperty } from './config';
import { useVModel } from '@vueuse/core'; import { useVModel } from '@vueuse/core';
import ComponentContainerProperty from '../../component-container-property.vue';
import UploadFile from '#/components/upload/file-upload.vue'; import UploadFile from '#/components/upload/file-upload.vue';
import UploadImg from '#/components/upload/image-upload.vue'; import UploadImg from '#/components/upload/image-upload.vue';
import ComponentContainerProperty from '../../component-container-property.vue';
// 视频播放属性面板 // 视频播放属性面板
defineOptions({ name: 'VideoPlayerProperty' }); defineOptions({ name: 'VideoPlayerProperty' });
@@ -19,14 +20,10 @@ const formData = useVModel(props, 'modelValue', emit);
<ComponentContainerProperty v-model="formData.style"> <ComponentContainerProperty v-model="formData.style">
<template #style> <template #style>
<FormItem label="高度" name="height"> <FormItem label="高度" name="height">
<Slider <Slider v-model:value="formData.style.height" :max="500" :min="100" />
v-model:value="formData.style.height"
:max="500"
:min="100"
/>
</FormItem> </FormItem>
</template> </template>
<Form :model="formData" labelCol="{ span: 6 }" wrapperCol="{ span: 18 }"> <Form :model="formData" label-col="{ span: 6 }" wrapper-col="{ span: 18 }">
<FormItem label="上传视频" name="videoUrl"> <FormItem label="上传视频" name="videoUrl">
<UploadFile <UploadFile
v-model="formData.videoUrl" v-model="formData.videoUrl"

View File

@@ -11,15 +11,12 @@ import { useQRCode } from '@vueuse/integrations/useQRCode';
import draggable from 'vuedraggable'; import draggable from 'vuedraggable';
import statusBarImg from '#/assets/imgs/diy/statusBar.png'; import statusBarImg from '#/assets/imgs/diy/statusBar.png';
import {
componentConfigs,
components,
} from './components/mobile';
import { component as PAGE_CONFIG_COMPONENT } from './components/mobile/page-config/config';
import ComponentContainer from './components/component-container.vue'; import ComponentContainer from './components/component-container.vue';
import ComponentLibrary from './components/component-library.vue'; import ComponentLibrary from './components/component-library.vue';
import { componentConfigs, components } from './components/mobile';
import { component as NAVIGATION_BAR_COMPONENT } from './components/mobile/navigation-bar/config'; import { component as NAVIGATION_BAR_COMPONENT } from './components/mobile/navigation-bar/config';
import { component as PAGE_CONFIG_COMPONENT } from './components/mobile/page-config/config';
import { component as TAB_BAR_COMPONENT } from './components/mobile/tab-bar/config'; import { component as TAB_BAR_COMPONENT } from './components/mobile/tab-bar/config';
/** 页面装修详情页 */ /** 页面装修详情页 */
defineOptions({ defineOptions({
@@ -290,7 +287,7 @@ onMounted(() => {
</script> </script>
<template> <template>
<div> <div>
<div class="editor flex flex-col h-full"> <div class="editor flex h-full flex-col">
<!-- 顶部工具栏 --> <!-- 顶部工具栏 -->
<div class="editor-header flex items-center"> <div class="editor-header flex items-center">
<!-- 左侧操作区 --> <!-- 左侧操作区 -->
@@ -360,11 +357,11 @@ onMounted(() => {
</div> </div>
<!-- 手机页面编辑区域 --> <!-- 手机页面编辑区域 -->
<div <div
class="editor-design-center page-prop-area overflow-y-auto phone-container" class="editor-design-center page-prop-area phone-container overflow-y-auto"
:style="{ :style="{
backgroundColor: pageConfigComponent.property.backgroundColor, backgroundColor: pageConfigComponent.property.backgroundColor,
backgroundImage: `url(${pageConfigComponent.property.backgroundImage})`, backgroundImage: `url(${pageConfigComponent.property.backgroundImage})`,
height: 'calc(100vh - 135px - 120px)' height: 'calc(100vh - 135px - 120px)',
}" }"
> >
<draggable <draggable
@@ -440,13 +437,10 @@ onMounted(() => {
</div> </div>
</div> </div>
<!-- 右侧属性面板ComponentContainerProperty --> <!-- 右侧属性面板ComponentContainerProperty -->
<div <div v-if="selectedComponent?.property" class="editor-right w-[350px]">
v-if="selectedComponent?.property"
class="editor-right w-[350px]"
>
<Card <Card
class="h-full" class="h-full"
:bodyStyle="{ height: 'calc(100% - 57px)', padding: 0 }" :body-style="{ height: 'calc(100% - 57px)', padding: 0 }"
> >
<!-- 组件名称 --> <!-- 组件名称 -->
<template #title> <template #title>
@@ -455,9 +449,7 @@ onMounted(() => {
<span>{{ selectedComponent?.name }}</span> <span>{{ selectedComponent?.name }}</span>
</div> </div>
</template> </template>
<div <div class="property h-full overflow-y-auto p-4">
class="h-full overflow-y-auto p-4 property"
>
<component <component
:is="`${selectedComponent?.id}Property`" :is="`${selectedComponent?.id}Property`"
:key="selectedComponent?.uid || selectedComponent?.id" :key="selectedComponent?.uid || selectedComponent?.id"

View File

@@ -46,7 +46,7 @@ const handleDelete = function (index: number) {
</script> </script>
<template> <template>
<div class="text-xs text-gray-500"> 拖动左上角的小圆点可对其排序 </div> <div class="text-xs text-gray-500">拖动左上角的小圆点可对其排序</div>
<VueDraggable <VueDraggable
:list="formData" :list="formData"
:force-fallback="true" :force-fallback="true"