feat:【antd】【mall】diy-editor 代码风格统一 & 逐个测试 20%

This commit is contained in:
YunaiV
2025-11-10 19:13:25 +08:00
parent a3356a0a5e
commit fadad35b20
47 changed files with 195 additions and 263 deletions

View File

@@ -1 +1 @@
export { default as ProductCategorySelect } from './category-select.vue';
export { default as ProductCategorySelect } from './select.vue';

View File

@@ -1,5 +1,4 @@
<script lang="ts" setup>
// TODO @AI一些 modal 是否使用 Modal 组件,而不是 el-modal
import { ref, watch } from 'vue';
import { ElButton, ElInput } from 'element-plus';

View File

@@ -24,7 +24,7 @@ import { AppLinkInput, Draggable } from '#/views/mall/promotion/components';
import ComponentContainerProperty from '../../component-container-property.vue';
// 轮播图属性面板
/** 轮播图属性面板 */
defineOptions({ name: 'CarouselProperty' });
const props = defineProps<{ modelValue: CarouselProperty }>();

View File

@@ -39,7 +39,7 @@ export interface ProductCardFieldProperty {
export const component = {
id: 'ProductCard',
name: '商品卡片',
icon: 'fluent:text-column-two-left-24-filled',
icon: 'lucide:grid-3x3',
property: {
layoutType: 'oneColBigImg',
fields: {

View File

@@ -9,7 +9,7 @@ import { fenToYuan } from '@vben/utils';
import { ElImage, ElScrollbar } from 'element-plus';
import * as ProductSpuApi from '#/api/mall/product/spu';
import { getSpuDetailList } from '#/api/mall/product/spu';
/** 商品栏 */
defineOptions({ name: 'ProductList' });
@@ -21,7 +21,7 @@ const spuList = ref<MallSpuApi.Spu[]>([]);
watch(
() => props.property.spuIds,
async () => {
spuList.value = await ProductSpuApi.getSpuDetailList(props.property.spuIds);
spuList.value = await getSpuDetailList(props.property.spuIds);
},
{
immediate: true,

View File

@@ -20,7 +20,7 @@ export type PlaceholderPosition = 'center' | 'left';
export const component = {
id: 'SearchBar',
name: '搜索框',
icon: 'ep:search',
icon: 'lucide:search',
property: {
height: 28,
showScan: false,

View File

@@ -30,7 +30,7 @@ defineProps<{ property: SearchProperty }>();
justifyContent: property.placeholderPosition,
}"
>
<IconifyIcon icon="ep:search" />
<IconifyIcon icon="lucide:search" />
<span>{{ property.placeholder || '搜索商品' }}</span>
</div>
<div class="absolute right-2 flex items-center justify-center gap-2">
@@ -39,10 +39,7 @@ defineProps<{ property: SearchProperty }>();
{{ keyword }}
</span>
<!-- 扫一扫 -->
<IconifyIcon
icon="ant-design:scan-outlined"
v-show="property.showScan"
/>
<IconifyIcon icon="lucide:scan-barcode" v-show="property.showScan" />
</div>
</div>
</div>

View File

@@ -5,7 +5,7 @@ import { IconifyIcon } from '@vben/icons';
import { ElImage } from 'element-plus';
/** 底部导航 */
/** 页面底部导航 */
defineOptions({ name: 'TabBar' });
defineProps<{ property: TabBarProperty }>();
@@ -26,7 +26,7 @@ defineProps<{ property: TabBarProperty }>();
<div
v-for="(item, index) in property.items"
:key="index"
class="tab-bar-item flex w-full flex-col items-center justify-center text-xs"
class="flex w-full flex-col items-center justify-center text-xs"
>
<ElImage
:src="index === 0 ? item.activeIconUrl : item.iconUrl"
@@ -35,7 +35,7 @@ defineProps<{ property: TabBarProperty }>();
<template #error>
<div class="flex h-full w-full items-center justify-center">
<IconifyIcon
icon="ep:picture"
icon="lucide:image"
class="h-[26px] w-[26px] rounded"
/>
</div>

View File

@@ -44,7 +44,7 @@ const handleThemeChange = () => {
</script>
<template>
<div class="tab-bar">
<div>
<ElForm :model="formData" label-width="80px">
<ElFormItem label="主题" prop="theme">
<ElSelect v-model="formData!.theme" @change="handleThemeChange">

View File

@@ -2,15 +2,14 @@ import type { ComponentStyle, DiyComponent } from '../../../util';
/** 用户卡券属性 */
export interface UserCouponProperty {
// 组件样式
style: ComponentStyle;
style: ComponentStyle; // 组件样式
}
// 定义组件
/** 定义组件 */
export const component = {
id: 'UserCoupon',
name: '用户卡券',
icon: 'ep:ticket',
icon: 'lucide:ticket',
property: {
style: {
bgType: 'color',

View File

@@ -9,7 +9,7 @@ export interface UserOrderProperty {
export const component = {
id: 'UserOrder',
name: '用户订单',
icon: 'ep:list',
icon: 'lucide:clipboard-list',
property: {
style: {
bgType: 'color',

View File

@@ -9,7 +9,7 @@ export interface UserWalletProperty {
export const component = {
id: 'UserWallet',
name: '用户资产',
icon: 'ep:wallet-filled',
icon: 'lucide:wallet',
property: {
style: {
bgType: 'color',

View File

@@ -17,7 +17,7 @@ export interface VideoPlayerStyle extends ComponentStyle {
export const component = {
id: 'VideoPlayer',
name: '视频播放',
icon: 'ep:video-play',
icon: 'lucide:video',
property: {
videoUrl: '',
posterUrl: '',

View File

@@ -63,9 +63,8 @@ const handleDelete = function (index: number) {
>
<ElTooltip content="拖动排序">
<IconifyIcon
icon="ic:round-drag-indicator"
class="drag-icon cursor-move"
style="color: #8a909c"
icon="lucide:move"
class="drag-icon cursor-move text-gray-500"
/>
</ElTooltip>
<ElTooltip content="删除">
@@ -90,7 +89,7 @@ const handleDelete = function (index: number) {
:disabled="limit > 0 && formData.length >= limit"
@click="handleAdd"
>
<IconifyIcon icon="ep:plus" /><span>添加</span>
<IconifyIcon icon="lucide:plus" /><span>添加</span>
</ElButton>
</ElTooltip>
</template>

View File

@@ -183,7 +183,7 @@ function exitHotAreaSelectMode() {
* 迭代魔方矩阵
* @param callback 回调
*/
const eachCube = (callback: (x: number, y: number, cube: Cube) => void) => {
function eachCube(callback: (x: number, y: number, cube: Cube) => void) {
for (const [x, row] of cubes.value.entries()) {
if (!row) continue;
for (const [y, cube] of row.entries()) {
@@ -192,7 +192,7 @@ const eachCube = (callback: (x: number, y: number, cube: Cube) => void) => {
}
}
}
};
}
</script>
<template>
<div class="relative">