This commit is contained in:
dylanmay
2025-11-06 23:34:08 +08:00
389 changed files with 6249 additions and 4781 deletions

View File

@@ -30,7 +30,7 @@ jobs:
run: pnpm build:play run: pnpm build:play
- name: Sync Playground files - name: Sync Playground files
uses: SamKirkland/FTP-Deploy-Action@v4.3.5 uses: SamKirkland/FTP-Deploy-Action@v4.3.6
with: with:
server: ${{ secrets.PRO_FTP_HOST }} server: ${{ secrets.PRO_FTP_HOST }}
username: ${{ secrets.WEB_PLAYGROUND_FTP_ACCOUNT }} username: ${{ secrets.WEB_PLAYGROUND_FTP_ACCOUNT }}
@@ -54,7 +54,7 @@ jobs:
run: pnpm build:docs run: pnpm build:docs
- name: Sync Docs files - name: Sync Docs files
uses: SamKirkland/FTP-Deploy-Action@v4.3.5 uses: SamKirkland/FTP-Deploy-Action@v4.3.6
with: with:
server: ${{ secrets.PRO_FTP_HOST }} server: ${{ secrets.PRO_FTP_HOST }}
username: ${{ secrets.WEBSITE_FTP_ACCOUNT }} username: ${{ secrets.WEBSITE_FTP_ACCOUNT }}
@@ -85,7 +85,7 @@ jobs:
run: pnpm run build:antd run: pnpm run build:antd
- name: Sync files - name: Sync files
uses: SamKirkland/FTP-Deploy-Action@v4.3.5 uses: SamKirkland/FTP-Deploy-Action@v4.3.6
with: with:
server: ${{ secrets.PRO_FTP_HOST }} server: ${{ secrets.PRO_FTP_HOST }}
username: ${{ secrets.WEB_ANTD_FTP_ACCOUNT }} username: ${{ secrets.WEB_ANTD_FTP_ACCOUNT }}
@@ -116,7 +116,7 @@ jobs:
run: pnpm run build:ele run: pnpm run build:ele
- name: Sync files - name: Sync files
uses: SamKirkland/FTP-Deploy-Action@v4.3.5 uses: SamKirkland/FTP-Deploy-Action@v4.3.6
with: with:
server: ${{ secrets.PRO_FTP_HOST }} server: ${{ secrets.PRO_FTP_HOST }}
username: ${{ secrets.WEB_ELE_FTP_ACCOUNT }} username: ${{ secrets.WEB_ELE_FTP_ACCOUNT }}
@@ -147,7 +147,7 @@ jobs:
run: pnpm run build:naive run: pnpm run build:naive
- name: Sync files - name: Sync files
uses: SamKirkland/FTP-Deploy-Action@v4.3.5 uses: SamKirkland/FTP-Deploy-Action@v4.3.6
with: with:
server: ${{ secrets.PRO_FTP_HOST }} server: ${{ secrets.PRO_FTP_HOST }}
username: ${{ secrets.WEB_NAIVE_FTP_ACCOUNT }} username: ${{ secrets.WEB_NAIVE_FTP_ACCOUNT }}

2
.npmrc
View File

@@ -1,4 +1,4 @@
registry = "https://registry.npmmirror.com" registry=https://registry.npmmirror.com
public-hoist-pattern[]=lefthook public-hoist-pattern[]=lefthook
public-hoist-pattern[]=eslint public-hoist-pattern[]=eslint
public-hoist-pattern[]=prettier public-hoist-pattern[]=prettier

View File

@@ -0,0 +1,56 @@
version: '1.0'
name: pipeline-20251103
displayName: master-build
triggers:
trigger: auto
push:
branches:
prefix:
- ''
pr:
branches:
prefix:
- ''
schedule:
- cron: '* * * 1 * ? *'
stages:
- name: stage-72bb5db9
displayName: build
strategy: naturally
trigger: auto
executor: []
steps:
- step: build@nodejs
name: build_nodejs
displayName: Nodejs 构建
nodeVersion: 24.5.0
commands:
- '# 设置NPM源提升安装速度'
- npm config set registry https://registry.npmmirror.com
- '# 安装pnpm'
- npm add -g pnpm
- '# 安装依赖'
- pnpm i
- '# 检查lint'
- pnpm lint
- '# 检查check'
- pnpm check
- '# 执行编译命令antd'
- pnpm build:antd
- '# 执行编译命令ele'
- pnpm build:ele
- '# 执行编译命令naive'
- pnpm build:naive
artifacts:
- name: BUILD_ARTIFACT
path:
- ./apps/web-antd/dist/
- ./apps/web-ele/dist/
- ./apps/web-naive/dist/
caches:
- ~/.npm
- ~/.yarn
- ~/.pnpm
notify: []
strategy:
retry: '0'

View File

@@ -0,0 +1,12 @@
import { eventHandler } from 'h3';
import { verifyAccessToken } from '~/utils/jwt-utils';
import { unAuthorizedResponse, useResponseSuccess } from '~/utils/response';
import { getTimezone } from '~/utils/timezone-utils';
export default eventHandler((event) => {
const userinfo = verifyAccessToken(event);
if (!userinfo) {
return unAuthorizedResponse(event);
}
return useResponseSuccess(getTimezone());
});

View File

@@ -0,0 +1,11 @@
import { eventHandler } from 'h3';
import { TIME_ZONE_OPTIONS } from '~/utils/mock-data';
import { useResponseSuccess } from '~/utils/response';
export default eventHandler(() => {
const data = TIME_ZONE_OPTIONS.map((o) => ({
label: `${o.timezone} (GMT${o.offset >= 0 ? `+${o.offset}` : o.offset})`,
value: o.timezone,
}));
return useResponseSuccess(data);
});

View File

@@ -0,0 +1,22 @@
import { eventHandler, readBody } from 'h3';
import { verifyAccessToken } from '~/utils/jwt-utils';
import { TIME_ZONE_OPTIONS } from '~/utils/mock-data';
import { unAuthorizedResponse, useResponseSuccess } from '~/utils/response';
import { setTimezone } from '~/utils/timezone-utils';
export default eventHandler(async (event) => {
const userinfo = verifyAccessToken(event);
if (!userinfo) {
return unAuthorizedResponse(event);
}
const body = await readBody<{ timezone?: unknown }>(event);
const timezone =
typeof body?.timezone === 'string' ? body.timezone : undefined;
const allowed = TIME_ZONE_OPTIONS.some((o) => o.timezone === timezone);
if (!timezone || !allowed) {
setResponseStatus(event, 400);
return useResponseError('Bad Request', 'Invalid timezone');
}
setTimezone(timezone);
return useResponseSuccess({});
});

View File

@@ -7,6 +7,11 @@ export interface UserInfo {
homePath?: string; homePath?: string;
} }
export interface TimezoneOption {
offset: number;
timezone: string;
}
export const MOCK_USERS: UserInfo[] = [ export const MOCK_USERS: UserInfo[] = [
{ {
id: 0, id: 0,
@@ -276,7 +281,7 @@ export const MOCK_MENU_LIST = [
children: [ children: [
{ {
id: 20_401, id: 20_401,
pid: 201, pid: 202,
name: 'SystemDeptCreate', name: 'SystemDeptCreate',
status: 1, status: 1,
type: 'button', type: 'button',
@@ -285,7 +290,7 @@ export const MOCK_MENU_LIST = [
}, },
{ {
id: 20_402, id: 20_402,
pid: 201, pid: 202,
name: 'SystemDeptEdit', name: 'SystemDeptEdit',
status: 1, status: 1,
type: 'button', type: 'button',
@@ -294,7 +299,7 @@ export const MOCK_MENU_LIST = [
}, },
{ {
id: 20_403, id: 20_403,
pid: 201, pid: 202,
name: 'SystemDeptDelete', name: 'SystemDeptDelete',
status: 1, status: 1,
type: 'button', type: 'button',
@@ -388,3 +393,29 @@ export function getMenuIds(menus: any[]) {
}); });
return ids; return ids;
} }
/**
* 时区选项
*/
export const TIME_ZONE_OPTIONS: TimezoneOption[] = [
{
offset: -5,
timezone: 'America/New_York',
},
{
offset: 0,
timezone: 'Europe/London',
},
{
offset: 8,
timezone: 'Asia/Shanghai',
},
{
offset: 9,
timezone: 'Asia/Tokyo',
},
{
offset: 9,
timezone: 'Asia/Seoul',
},
];

View File

@@ -0,0 +1,9 @@
let mockTimeZone: null | string = null;
export const setTimezone = (timeZone: string) => {
mockTimeZone = timeZone;
};
export const getTimezone = () => {
return mockTimeZone;
};

View File

@@ -1,36 +0,0 @@
<script lang="ts" setup>
defineOptions({ name: 'CardTitle' });
// TODO @jawe from xingyuhttps://gitee.com/yudaocode/yudao-ui-admin-vben/pulls/243/files#diff_note_47350213这个组件没有必要直接用antdv card 的slot去做就行了只有这一个地方用没有必要单独写一个组件
defineProps({
title: {
type: String,
required: true,
},
});
</script>
<template>
<span class="card-title">{{ title }}</span>
</template>
<style scoped lang="scss">
.card-title {
font-size: 14px;
font-weight: 600;
&::before {
position: relative;
top: 8px;
left: -5px;
display: inline-block;
width: 3px;
height: 14px;
content: '';
//background-color: #105cfb;
background: var(--el-color-primary);
border-radius: 5px;
transform: translateY(-50%);
}
}
</style>

View File

@@ -1 +0,0 @@
export { default as CardTitle } from './CardTitle.vue';

View File

@@ -420,7 +420,7 @@ function inputChange() {
@input="inputChange" @input="inputChange"
> >
<template #addonAfter> <template #addonAfter>
<Select v-model:value="select" placeholder="生成器" style="width: 115px"> <Select v-model:value="select" placeholder="生成器" class="w-36">
<Select.Option value="0 * * * * ?">每分钟</Select.Option> <Select.Option value="0 * * * * ?">每分钟</Select.Option>
<Select.Option value="0 0 * * * ?">每小时</Select.Option> <Select.Option value="0 0 * * * ?">每小时</Select.Option>
<Select.Option value="0 0 0 * * ?">每天零点</Select.Option> <Select.Option value="0 0 0 * * ?">每天零点</Select.Option>
@@ -946,20 +946,20 @@ function inputChange() {
padding: 0 15px; padding: 0 15px;
font-size: 12px; font-size: 12px;
line-height: 30px; line-height: 30px;
background: var(--ant-primary-color-active-bg); background: hsl(var(--primary) / 10%);
border-radius: 4px; border-radius: 4px;
} }
.sc-cron :deep(.ant-tabs-tab.ant-tabs-tab-active) .sc-cron-num h4 { .sc-cron :deep(.ant-tabs-tab.ant-tabs-tab-active) .sc-cron-num h4 {
color: #fff; color: #fff;
background: var(--ant-primary-color); background: hsl(var(--primary));
} }
[data-theme='dark'] .sc-cron-num h4 { [data-theme='dark'] .sc-cron-num h4 {
background: var(--ant-color-white); background: hsl(var(--white));
} }
.input-with-select .ant-input-group-addon { .input-with-select .ant-input-group-addon {
background-color: var(--ant-color-fill-alter); background-color: hsl(var(--muted));
} }
</style> </style>

View File

@@ -81,7 +81,7 @@ onMounted(() => {
:value-format="rangePickerProps.valueFormat" :value-format="rangePickerProps.valueFormat"
:placeholder="rangePickerProps.placeholder" :placeholder="rangePickerProps.placeholder"
:presets="rangePickerProps.presets" :presets="rangePickerProps.presets"
class="!w-[235px]" class="!w-full !max-w-96"
@change="handleDateRangeChange" @change="handleDateRangeChange"
/> />
<slot></slot> <slot></slot>

View File

@@ -8,12 +8,14 @@ import { $t } from '#/locales';
const appName = computed(() => preferences.app.name); const appName = computed(() => preferences.app.name);
const logo = computed(() => preferences.logo.source); const logo = computed(() => preferences.logo.source);
const logoDark = computed(() => preferences.logo.sourceDark);
</script> </script>
<template> <template>
<AuthPageLayout <AuthPageLayout
:app-name="appName" :app-name="appName"
:logo="logo" :logo="logo"
:logo-dark="logoDark"
:page-description="$t('authentication.pageDesc')" :page-description="$t('authentication.pageDesc')"
:page-title="$t('authentication.pageTitle')" :page-title="$t('authentication.pageTitle')"
> >

View File

@@ -343,9 +343,9 @@ onMounted(async () => {
v-if="conversationMap[conversationKey].length > 0" v-if="conversationMap[conversationKey].length > 0"
class="classify-title pt-2" class="classify-title pt-2"
> >
<b class="mx-1"> <p class="mx-1">
{{ conversationKey }} {{ conversationKey }}
</b> </p>
</div> </div>
<div <div
@@ -357,11 +357,9 @@ onMounted(async () => {
class="mt-1" class="mt-1"
> >
<div <div
class="flex cursor-pointer flex-row items-center justify-between rounded-lg px-2 leading-10" class="mb-2 flex cursor-pointer flex-row items-center justify-between rounded-lg px-2 leading-10"
:class="[ :class="[
conversation.id === activeConversationId conversation.id === activeConversationId ? 'bg-success' : '',
? 'bg-success-600'
: '',
]" ]"
> >
<div class="flex items-center"> <div class="flex items-center">

View File

@@ -514,7 +514,7 @@ onMounted(async () => {
<!-- 右侧详情部分 --> <!-- 右侧详情部分 -->
<Layout class="bg-card mx-4"> <Layout class="bg-card mx-4">
<Layout.Header <Layout.Header
class="!bg-card border-border flex items-center justify-between border-b" class="!bg-card border-border flex !h-12 items-center justify-between border-b"
> >
<div class="text-lg font-bold"> <div class="text-lg font-bold">
{{ activeConversation?.title ? activeConversation?.title : '对话' }} {{ activeConversation?.title ? activeConversation?.title : '对话' }}
@@ -574,11 +574,9 @@ onMounted(async () => {
</Layout.Content> </Layout.Content>
<Layout.Footer class="!bg-card m-0 flex flex-col p-0"> <Layout.Footer class="!bg-card m-0 flex flex-col p-0">
<form <form class="border-border m-2 flex flex-col rounded-xl border p-2">
class="border-border my-5 mb-5 mt-2 flex flex-col rounded-xl border px-2 py-2.5"
>
<textarea <textarea
class="box-border h-24 resize-none overflow-auto rounded-md px-0 py-1 focus:outline-none" class="box-border h-24 resize-none overflow-auto rounded-md p-2 focus:outline-none"
v-model="prompt" v-model="prompt"
@keydown="handleSendByKeydown" @keydown="handleSendByKeydown"
@input="handlePromptInput" @input="handlePromptInput"

View File

@@ -246,7 +246,7 @@ watch(
<Input <Input
v-model:value="condition" v-model:value="condition"
:placeholder="placeholder" :placeholder="placeholder"
style="width: calc(100% - 100px)" class="w-[calc(100vw-25%)]"
:readonly="type !== 'duration' && type !== 'cycle'" :readonly="type !== 'duration' && type !== 'cycle'"
@focus="handleInputFocus" @focus="handleInputFocus"
@blur="updateNode" @blur="updateNode"

View File

@@ -1,5 +1,4 @@
import type { VxeTableGridOptions } from '#/adapter/vxe-table'; import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { BpmProcessDefinitionApi } from '#/api/bpm/definition';
import { DICT_TYPE } from '@vben/constants'; import { DICT_TYPE } from '@vben/constants';

View File

@@ -772,12 +772,12 @@ defineExpose({ loadTodoTask });
name="signPicUrl" name="signPicUrl"
ref="approveSignFormRef" ref="approveSignFormRef"
> >
<Button @click="openSignatureModal" type="primary"> <div class="flex items-center gap-2">
{{ approveReasonForm.signPicUrl ? '重新签名' : '点击签名' }} <Button @click="openSignatureModal" type="primary">
</Button> {{ approveReasonForm.signPicUrl ? '重新签名' : '点击签名' }}
<div class="mt-2"> </Button>
<Image <Image
class="float-left h-40 w-80" class="!h-10 !w-40 object-contain"
v-if="approveReasonForm.signPicUrl" v-if="approveReasonForm.signPicUrl"
:src="approveReasonForm.signPicUrl" :src="approveReasonForm.signPicUrl"
/> />

View File

@@ -5,7 +5,7 @@ import { useVbenModal } from '@vben/common-ui';
import { IconifyIcon } from '@vben/icons'; import { IconifyIcon } from '@vben/icons';
import { base64ToFile } from '@vben/utils'; import { base64ToFile } from '@vben/utils';
import { Button, message, Space, Tooltip } from 'ant-design-vue'; import { Button, Space, Tooltip } from 'ant-design-vue';
import Vue3Signature from 'vue3-signature'; import Vue3Signature from 'vue3-signature';
import { uploadFile } from '#/api/infra/file'; import { uploadFile } from '#/api/infra/file';
@@ -20,28 +20,22 @@ const signature = ref<InstanceType<typeof Vue3Signature>>();
const [Modal, modalApi] = useVbenModal({ const [Modal, modalApi] = useVbenModal({
async onConfirm() { async onConfirm() {
// TODO @jason这里需要使用类似 modalApi.lock() 么?类似别的模块 modalApi.lock();
message.success({ try {
content: '签名上传中,请稍等...', const signFileUrl = await uploadFile({
}); file: base64ToFile(signature?.value?.save('image/jpeg') || '', '签名'),
const signFileUrl = await uploadFile({ });
file: base64ToFile(signature?.value?.save('image/jpeg') || '', '签名'), emits('success', signFileUrl);
}); await modalApi.close();
emits('success', signFileUrl); } finally {
// TODO @jason是不是不用主动 close modalApi.unlock();
await modalApi.close();
},
// TODO @jason这个是不是下面方法可以删除
onOpenChange(visible) {
if (!visible) {
modalApi.close();
} }
}, },
}); });
</script> </script>
<template> <template>
<Modal title="流程签名" class="h-2/5 w-3/5"> <Modal title="流程签名" class="w-3/5">
<div class="mb-2 flex justify-end"> <div class="mb-2 flex justify-end">
<Space> <Space>
<Tooltip title="撤销上一步操作"> <Tooltip title="撤销上一步操作">
@@ -64,10 +58,8 @@ const [Modal, modalApi] = useVbenModal({
</div> </div>
<Vue3Signature <Vue3Signature
class="mx-auto border border-solid border-gray-300" class="mx-auto !h-80 border border-solid border-gray-300"
ref="signature" ref="signature"
w="874px"
h="324px"
/> />
</Modal> </Modal>
</template> </template>

View File

@@ -109,11 +109,11 @@ function getApprovalNodeIcon(taskStatus: number, nodeType: BpmNodeTypeEnum) {
} }
if ( if (
[ [
BpmNodeTypeEnum.START_USER_NODE,
BpmNodeTypeEnum.USER_TASK_NODE,
BpmNodeTypeEnum.TRANSACTOR_NODE,
BpmNodeTypeEnum.CHILD_PROCESS_NODE, BpmNodeTypeEnum.CHILD_PROCESS_NODE,
BpmNodeTypeEnum.END_EVENT_NODE, BpmNodeTypeEnum.END_EVENT_NODE,
BpmNodeTypeEnum.START_USER_NODE,
BpmNodeTypeEnum.TRANSACTOR_NODE,
BpmNodeTypeEnum.USER_TASK_NODE,
].includes(nodeType) ].includes(nodeType)
) { ) {
return statusIconMap[taskStatus]?.icon || 'mdi:clock-outline'; return statusIconMap[taskStatus]?.icon || 'mdi:clock-outline';

View File

@@ -6,8 +6,6 @@ import { DocAlert, Page } from '@vben/common-ui';
import { message } from 'ant-design-vue'; import { message } from 'ant-design-vue';
import { $t } from '#/locales';
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
import { getTaskDonePage, withdrawTask } from '#/api/bpm/task'; import { getTaskDonePage, withdrawTask } from '#/api/bpm/task';
import { router } from '#/router'; import { router } from '#/router';

View File

@@ -181,7 +181,7 @@ function handleAuthInfoDialogClose() {
style="width: calc(100% - 80px)" style="width: calc(100% - 80px)"
/> />
<Button @click="copyToClipboard(authInfo.clientId)" type="primary"> <Button @click="copyToClipboard(authInfo.clientId)" type="primary">
<IconifyIcon icon="ph:copy" /> <IconifyIcon icon="lucide:copy" />
</Button> </Button>
</Input.Group> </Input.Group>
</Form.Item> </Form.Item>
@@ -193,7 +193,7 @@ function handleAuthInfoDialogClose() {
style="width: calc(100% - 80px)" style="width: calc(100% - 80px)"
/> />
<Button @click="copyToClipboard(authInfo.username)" type="primary"> <Button @click="copyToClipboard(authInfo.username)" type="primary">
<IconifyIcon icon="ph:copy" /> <IconifyIcon icon="lucide:copy" />
</Button> </Button>
</Input.Group> </Input.Group>
</Form.Item> </Form.Item>
@@ -210,11 +210,11 @@ function handleAuthInfoDialogClose() {
type="primary" type="primary"
> >
<IconifyIcon <IconifyIcon
:icon="authPasswordVisible ? 'ph:eye-slash' : 'ph:eye'" :icon="authPasswordVisible ? 'lucide:eye-off' : 'lucide:eye'"
/> />
</Button> </Button>
<Button @click="copyToClipboard(authInfo.password)" type="primary"> <Button @click="copyToClipboard(authInfo.password)" type="primary">
<IconifyIcon icon="ph:copy" /> <IconifyIcon icon="lucide:copy" />
</Button> </Button>
</Input.Group> </Input.Group>
</Form.Item> </Form.Item>

View File

@@ -165,18 +165,15 @@ onMounted(() => {
> >
<!-- 添加渐变背景层 --> <!-- 添加渐变背景层 -->
<div <div
class="pointer-events-none absolute left-0 right-0 top-0 h-[50px] bg-gradient-to-b from-[#eefaff] to-transparent" class="from-muted pointer-events-none absolute left-0 right-0 top-0 h-12 bg-gradient-to-b to-transparent"
></div> ></div>
<div class="relative p-4"> <div class="relative p-4">
<!-- 标题区域 --> <!-- 标题区域 -->
<div class="mb-3 flex items-center"> <div class="mb-3 flex items-center">
<div class="mr-2.5 flex items-center"> <div class="mr-2.5 flex items-center">
<IconifyIcon <IconifyIcon icon="ep:cpu" class="text-primary text-lg" />
icon="ep:cpu"
class="text-[18px] text-[#0070ff]"
/>
</div> </div>
<div class="font-600 flex-1 text-[16px]">{{ item.name }}</div> <div class="flex-1 text-base font-bold">{{ item.name }}</div>
<!-- 标识符 --> <!-- 标识符 -->
<div class="mr-2 inline-flex items-center"> <div class="mr-2 inline-flex items-center">
<Tag size="small" color="blue"> <Tag size="small" color="blue">
@@ -198,22 +195,22 @@ onMounted(() => {
> >
<IconifyIcon <IconifyIcon
icon="ep:data-line" icon="ep:data-line"
class="text-[18px] text-[#0070ff]" class="text-primary text-lg"
/> />
</div> </div>
</div> </div>
<!-- 信息区域 --> <!-- 信息区域 -->
<div class="text-[14px]"> <div class="text-sm">
<div class="mb-2.5 last:mb-0"> <div class="mb-2.5 last:mb-0">
<span class="mr-2.5 text-[#717c8e]">属性值</span> <span class="text-muted-foreground mr-2.5">属性值</span>
<span class="font-600 text-[#0b1d30]"> <span class="text-foreground font-bold">
{{ formatValueWithUnit(item) }} {{ formatValueWithUnit(item) }}
</span> </span>
</div> </div>
<div class="mb-2.5 last:mb-0"> <div class="mb-2.5 last:mb-0">
<span class="mr-2.5 text-[#717c8e]">更新时间</span> <span class="text-muted-foreground mr-2.5">更新时间</span>
<span class="text-[12px] text-[#0b1d30]"> <span class="text-foreground text-sm">
{{ item.updateTime ? formatDate(item.updateTime) : '-' }} {{ item.updateTime ? formatDate(item.updateTime) : '-' }}
</span> </span>
</div> </div>

View File

@@ -102,7 +102,7 @@ defineExpose({
<template> <template>
<div class="product-card-view"> <div class="product-card-view">
<!-- 产品卡片列表 --> <!-- 产品卡片列表 -->
<div v-loading="loading" class="min-h-[400px]"> <div v-loading="loading" class="min-h-96">
<Row v-if="list.length > 0" :gutter="[16, 16]"> <Row v-if="list.length > 0" :gutter="[16, 16]">
<Col <Col
v-for="item in list" v-for="item in list"
@@ -119,7 +119,7 @@ defineExpose({
<div class="product-icon"> <div class="product-icon">
<IconifyIcon <IconifyIcon
:icon="item.icon || 'ant-design:inbox-outlined'" :icon="item.icon || 'ant-design:inbox-outlined'"
class="text-[32px]" class="text-3xl"
/> />
</div> </div>
<div class="ml-3 min-w-0 flex-1"> <div class="ml-3 min-w-0 flex-1">
@@ -162,7 +162,7 @@ defineExpose({
<div class="product-3d-icon"> <div class="product-3d-icon">
<IconifyIcon <IconifyIcon
icon="ant-design:box-plot-outlined" icon="ant-design:box-plot-outlined"
class="text-[80px]" class="text-2xl"
/> />
</div> </div>
</div> </div>
@@ -201,11 +201,11 @@ defineExpose({
size="small" size="small"
danger danger
disabled disabled
class="action-btn action-btn-delete !w-[32px]" class="action-btn action-btn-delete !w-8"
> >
<IconifyIcon <IconifyIcon
icon="ant-design:delete-outlined" icon="ant-design:delete-outlined"
class="text-[14px]" class="text-sm"
/> />
</Button> </Button>
</Tooltip> </Tooltip>
@@ -217,11 +217,11 @@ defineExpose({
<Button <Button
size="small" size="small"
danger danger
class="action-btn action-btn-delete !w-[32px]" class="action-btn action-btn-delete !w-8"
> >
<IconifyIcon <IconifyIcon
icon="ant-design:delete-outlined" icon="ant-design:delete-outlined"
class="text-[14px]" class="text-sm"
/> />
</Button> </Button>
</Popconfirm> </Popconfirm>

View File

@@ -170,7 +170,7 @@ watch(
</script> </script>
<template> <template>
<div class="gap-16px flex flex-col"> <div class="flex flex-col gap-4">
<Row :gutter="16"> <Row :gutter="16">
<!-- 时间操作符选择 --> <!-- 时间操作符选择 -->
<Col :span="8"> <Col :span="8">
@@ -190,7 +190,7 @@ watch(
:value="option.value" :value="option.value"
> >
<div class="flex w-full items-center justify-between"> <div class="flex w-full items-center justify-between">
<div class="gap-8px flex items-center"> <div class="flex items-center gap-2">
<IconifyIcon :icon="option.icon" :class="option.iconClass" /> <IconifyIcon :icon="option.icon" :class="option.iconClass" />
<span>{{ option.label }}</span> <span>{{ option.label }}</span>
</div> </div>
@@ -225,9 +225,7 @@ watch(
value-format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss"
class="w-full" class="w-full"
/> />
<div v-else class="text-14px text-[var(--el-text-color-placeholder)]"> <div v-else class="text-secondary text-sm">无需设置时间值</div>
无需设置时间值
</div>
</Form.Item> </Form.Item>
</Col> </Col>

View File

@@ -161,11 +161,11 @@ function removeConditionGroup() {
@click="addSubGroup" @click="addSubGroup"
:disabled="(trigger.conditionGroups?.length || 0) >= maxSubGroups" :disabled="(trigger.conditionGroups?.length || 0) >= maxSubGroups"
> >
<IconifyIcon icon="ep:plus" /> <IconifyIcon icon="lucide:plus" />
添加子条件组 添加子条件组
</Button> </Button>
<Button danger size="small" text @click="removeConditionGroup"> <Button danger size="small" text @click="removeConditionGroup">
<IconifyIcon icon="ep:delete" /> <IconifyIcon icon="lucide:trash-2" />
删除条件组 删除条件组
</Button> </Button>
</div> </div>
@@ -215,7 +215,7 @@ function removeConditionGroup() {
@click="removeSubGroup(subGroupIndex)" @click="removeSubGroup(subGroupIndex)"
class="hover:bg-red-50" class="hover:bg-red-50"
> >
<IconifyIcon icon="ep:delete" /> <IconifyIcon icon="lucide:trash-2" />
删除组 删除组
</Button> </Button>
</div> </div>
@@ -258,7 +258,7 @@ function removeConditionGroup() {
class="p-24px rounded-8px border-2 border-dashed border-orange-200 bg-orange-50 text-center" class="p-24px rounded-8px border-2 border-dashed border-orange-200 bg-orange-50 text-center"
> >
<div class="gap-12px flex flex-col items-center"> <div class="gap-12px flex flex-col items-center">
<IconifyIcon icon="ep:plus" class="text-32px text-orange-400" /> <IconifyIcon icon="lucide:plus" class="text-32px text-orange-400" />
<div class="text-orange-600"> <div class="text-orange-600">
<p class="text-14px font-500 mb-4px">暂无子条件组</p> <p class="text-14px font-500 mb-4px">暂无子条件组</p>
<p class="text-12px">点击上方"添加子条件组"按钮开始配置</p> <p class="text-12px">点击上方"添加子条件组"按钮开始配置</p>

View File

@@ -173,7 +173,7 @@ function handlePropertyChange(propertyInfo: any) {
</script> </script>
<template> <template>
<div class="space-y-16px"> <div class="space-y-4">
<!-- 触发事件类型选择 --> <!-- 触发事件类型选择 -->
<Form.Item label="触发事件类型" required> <Form.Item label="触发事件类型" required>
<Select <Select
@@ -192,7 +192,7 @@ function handlePropertyChange(propertyInfo: any) {
</Form.Item> </Form.Item>
<!-- 设备属性条件配置 --> <!-- 设备属性条件配置 -->
<div v-if="isDevicePropertyTrigger" class="space-y-16px"> <div v-if="isDevicePropertyTrigger" class="space-y-4">
<!-- 产品设备选择 --> <!-- 产品设备选择 -->
<Row :gutter="16"> <Row :gutter="16">
<Col :span="12"> <Col :span="12">
@@ -292,7 +292,7 @@ function handlePropertyChange(propertyInfo: any) {
</div> </div>
<!-- 设备状态条件配置 --> <!-- 设备状态条件配置 -->
<div v-else-if="isDeviceStatusTrigger" class="space-y-16px"> <div v-else-if="isDeviceStatusTrigger" class="space-y-4">
<!-- 设备状态触发器使用简化的配置 --> <!-- 设备状态触发器使用简化的配置 -->
<Row :gutter="16"> <Row :gutter="16">
<Col :span="12"> <Col :span="12">
@@ -364,13 +364,11 @@ function handlePropertyChange(propertyInfo: any) {
</div> </div>
<!-- 其他触发类型的提示 --> <!-- 其他触发类型的提示 -->
<div v-else class="py-20px text-center"> <div v-else class="py-5 text-center">
<p class="text-14px mb-4px text-[var(--el-text-color-secondary)]"> <p class="text-secondary mb-1 text-sm">
当前触发事件类型:{{ getTriggerTypeLabel(triggerType) }} 当前触发事件类型:{{ getTriggerTypeLabel(triggerType) }}
</p> </p>
<p class="text-12px text-[var(--el-text-color-placeholder)]"> <p class="text-secondary text-xs">此触发类型暂不需要配置额外条件</p>
此触发类型暂不需要配置额外条件
</p>
</div> </div>
</div> </div>
</template> </template>

View File

@@ -83,27 +83,24 @@ function updateCondition(index: number, condition: TriggerCondition) {
</script> </script>
<template> <template>
<div class="p-16px"> <div class="p-4">
<!-- 空状态 --> <!-- 空状态 -->
<div v-if="!subGroup || subGroup.length === 0" class="py-24px text-center"> <div v-if="!subGroup || subGroup.length === 0" class="py-6 text-center">
<div class="gap-12px flex flex-col items-center"> <div class="flex flex-col items-center gap-3">
<IconifyIcon <IconifyIcon icon="lucide:plus" class="text-8 text-secondary" />
icon="ep:plus" <div class="text-secondary">
class="text-32px text-[var(--el-text-color-placeholder)]" <p class="mb-1 text-base font-bold">暂无条件</p>
/> <p class="text-xs">点击下方按钮添加第一个条件</p>
<div class="text-[var(--el-text-color-secondary)]">
<p class="text-14px font-500 mb-4px">暂无条件</p>
<p class="text-12px">点击下方按钮添加第一个条件</p>
</div> </div>
<Button type="primary" @click="addCondition"> <Button type="primary" @click="addCondition">
<IconifyIcon icon="ep:plus" /> <IconifyIcon icon="lucide:plus" />
添加条件 添加条件
</Button> </Button>
</div> </div>
</div> </div>
<!-- 条件列表 --> <!-- 条件列表 -->
<div v-else class="space-y-16px"> <div v-else class="space-y-4">
<div <div
v-for="(condition, conditionIndex) in subGroup" v-for="(condition, conditionIndex) in subGroup"
:key="`condition-${conditionIndex}`" :key="`condition-${conditionIndex}`"
@@ -111,20 +108,18 @@ function updateCondition(index: number, condition: TriggerCondition) {
> >
<!-- 条件配置 --> <!-- 条件配置 -->
<div <div
class="rounded-6px border border-[var(--el-border-color-lighter)] bg-[var(--el-fill-color-blank)] shadow-sm" class="rounded-3px border-border bg-fill-color-blank border shadow-sm"
> >
<div <div
class="p-12px rounded-t-4px flex items-center justify-between border-b border-[var(--el-border-color-lighter)] bg-[var(--el-fill-color-light)]" class="rounded-t-1 border-border bg-fill-color-blank flex items-center justify-between border-b p-3"
> >
<div class="gap-8px flex items-center"> <div class="flex items-center gap-2">
<div <div
class="w-20px h-20px text-10px flex items-center justify-center rounded-full bg-blue-500 font-bold text-white" class="bg-primary flex size-5 items-center justify-center rounded-full text-xs font-bold text-white"
> >
{{ conditionIndex + 1 }} {{ conditionIndex + 1 }}
</div> </div>
<span <span class="text-primary text-base font-bold">
class="text-12px font-500 text-[var(--el-text-color-primary)]"
>
条件 {{ conditionIndex + 1 }} 条件 {{ conditionIndex + 1 }}
</span> </span>
</div> </div>
@@ -136,11 +131,11 @@ function updateCondition(index: number, condition: TriggerCondition) {
v-if="subGroup!.length > 1" v-if="subGroup!.length > 1"
class="hover:bg-red-50" class="hover:bg-red-50"
> >
<IconifyIcon icon="ep:delete" /> <IconifyIcon icon="lucide:trash-2" />
</Button> </Button>
</div> </div>
<div class="p-12px"> <div class="p-3">
<ConditionConfig <ConditionConfig
:model-value="condition" :model-value="condition"
@update:model-value=" @update:model-value="
@@ -158,15 +153,13 @@ function updateCondition(index: number, condition: TriggerCondition) {
v-if=" v-if="
subGroup && subGroup.length > 0 && subGroup.length < maxConditions subGroup && subGroup.length > 0 && subGroup.length < maxConditions
" "
class="py-16px text-center" class="py-4 text-center"
> >
<Button type="primary" plain @click="addCondition"> <Button type="primary" plain @click="addCondition">
<IconifyIcon icon="ep:plus" /> <IconifyIcon icon="lucide:plus" />
继续添加条件 继续添加条件
</Button> </Button>
<span <span class="text-secondary mt-2 block text-xs">
class="mt-8px text-12px block text-[var(--el-text-color-secondary)]"
>
最多可添加 {{ maxConditions }} 个条件 最多可添加 {{ maxConditions }} 个条件
</span> </span>
</div> </div>

View File

@@ -197,27 +197,6 @@ const emptyMessage = computed(() => {
} }
}); });
// 计算属性:无配置消息
const noConfigMessage = computed(() => {
switch (props.type) {
case JsonParamsInputTypeEnum.CUSTOM: {
return JSON_PARAMS_INPUT_CONSTANTS.NO_CONFIG_MESSAGES.CUSTOM;
}
case JsonParamsInputTypeEnum.EVENT: {
return JSON_PARAMS_INPUT_CONSTANTS.NO_CONFIG_MESSAGES.EVENT;
}
case JsonParamsInputTypeEnum.PROPERTY: {
return JSON_PARAMS_INPUT_CONSTANTS.NO_CONFIG_MESSAGES.PROPERTY;
}
case JsonParamsInputTypeEnum.SERVICE: {
return JSON_PARAMS_INPUT_CONSTANTS.NO_CONFIG_MESSAGES.SERVICE;
}
default: {
return JSON_PARAMS_INPUT_CONSTANTS.NO_CONFIG_MESSAGES.DEFAULT;
}
}
});
/** /**
* 处理参数变化事件 * 处理参数变化事件
*/ */
@@ -415,7 +394,7 @@ watch(
<template> <template>
<!-- 参数配置 --> <!-- 参数配置 -->
<div class="space-y-12px w-full"> <div class="w-full space-y-3">
<!-- JSON 输入框 --> <!-- JSON 输入框 -->
<div class="relative"> <div class="relative">
<Input.TextArea <Input.TextArea
@@ -427,7 +406,7 @@ watch(
:class="{ 'is-error': jsonError }" :class="{ 'is-error': jsonError }"
/> />
<!-- 查看详细示例弹出层 --> <!-- 查看详细示例弹出层 -->
<div class="top-8px right-8px absolute"> <div class="absolute right-2 top-2">
<Popover <Popover
placement="leftTop" placement="leftTop"
:width="450" :width="450"
@@ -450,79 +429,64 @@ watch(
<!-- 弹出层内容 --> <!-- 弹出层内容 -->
<div class="json-params-detail-content"> <div class="json-params-detail-content">
<div class="gap-8px mb-16px flex items-center"> <div class="mb-4 flex items-center gap-2">
<IconifyIcon <IconifyIcon :icon="titleIcon" class="text-primary text-lg" />
:icon="titleIcon" <span class="text-primary text-base font-bold">
class="text-18px text-[var(--el-color-primary)]"
/>
<span
class="text-16px font-600 text-[var(--el-text-color-primary)]"
>
{{ title }} {{ title }}
</span> </span>
</div> </div>
<div class="space-y-16px"> <div class="space-y-4">
<!-- 参数列表 --> <!-- 参数列表 -->
<div v-if="paramsList.length > 0"> <div v-if="paramsList.length > 0">
<div class="gap-8px mb-8px flex items-center"> <div class="mb-2 flex items-center gap-2">
<IconifyIcon <IconifyIcon
:icon="paramsIcon" :icon="paramsIcon"
class="text-14px text-[var(--el-color-primary)]" class="text-primary text-base"
/> />
<span <span class="text-primary text-base font-bold">
class="text-14px font-500 text-[var(--el-text-color-primary)]"
>
{{ paramsLabel }} {{ paramsLabel }}
</span> </span>
</div> </div>
<div class="ml-22px space-y-8px"> <div class="ml-6 space-y-2">
<div <div
v-for="param in paramsList" v-for="param in paramsList"
:key="param.identifier" :key="param.identifier"
class="p-8px rounded-4px flex items-center justify-between bg-[var(--el-fill-color-lighter)]" class="bg-card flex items-center justify-between rounded-lg p-2"
> >
<div class="flex-1"> <div class="flex-1">
<div <div class="text-primary text-base font-bold">
class="text-12px font-500 text-[var(--el-text-color-primary)]"
>
{{ param.name }} {{ param.name }}
<Tag <Tag
v-if="param.required" v-if="param.required"
size="small" size="small"
type="danger" type="danger"
class="ml-4px" class="ml-1"
> >
{{ JSON_PARAMS_INPUT_CONSTANTS.REQUIRED_TAG }} {{ JSON_PARAMS_INPUT_CONSTANTS.REQUIRED_TAG }}
</Tag> </Tag>
</div> </div>
<div <div class="text-secondary text-xs">
class="text-11px text-[var(--el-text-color-secondary)]"
>
{{ param.identifier }} {{ param.identifier }}
</div> </div>
</div> </div>
<div class="gap-8px flex items-center"> <div class="flex items-center gap-2">
<Tag :type="getParamTypeTag(param.dataType)" size="small"> <Tag :type="getParamTypeTag(param.dataType)" size="small">
{{ getParamTypeName(param.dataType) }} {{ getParamTypeName(param.dataType) }}
</Tag> </Tag>
<span <span class="text-secondary text-xs">
class="text-11px text-[var(--el-text-color-secondary)]"
>
{{ getExampleValue(param) }} {{ getExampleValue(param) }}
</span> </span>
</div> </div>
</div> </div>
</div> </div>
<div class="mt-12px ml-22px"> <div class="ml-6 mt-3">
<div <div class="text-secondary mb-1 text-xs">
class="text-12px mb-6px text-[var(--el-text-color-secondary)]"
>
{{ JSON_PARAMS_INPUT_CONSTANTS.COMPLETE_JSON_FORMAT }} {{ JSON_PARAMS_INPUT_CONSTANTS.COMPLETE_JSON_FORMAT }}
</div> </div>
<pre <pre
class="p-12px rounded-4px text-11px border-l-3px overflow-x-auto border-[var(--el-color-primary)] bg-[var(--el-fill-color-light)] text-[var(--el-text-color-primary)]" class="bg-card border-l-3px border-primary text-primary overflow-x-auto rounded-lg p-3 text-sm"
> >
<code>{{ generateExampleJson() }}</code> <code>{{ generateExampleJson() }}</code>
</pre> </pre>
@@ -531,8 +495,8 @@ watch(
<!-- 无参数提示 --> <!-- 无参数提示 -->
<div v-else> <div v-else>
<div class="py-16px text-center"> <div class="py-4 text-center">
<p class="text-14px text-[var(--el-text-color-secondary)]"> <p class="text-secondary text-sm">
{{ emptyMessage }} {{ emptyMessage }}
</p> </p>
</div> </div>
@@ -545,37 +509,29 @@ watch(
<!-- 验证状态和错误提示 --> <!-- 验证状态和错误提示 -->
<div class="flex items-center justify-between"> <div class="flex items-center justify-between">
<div class="gap-8px flex items-center"> <div class="flex items-center gap-2">
<IconifyIcon <IconifyIcon
:icon=" :icon="
jsonError jsonError
? JSON_PARAMS_INPUT_ICONS.STATUS_ICONS.ERROR ? JSON_PARAMS_INPUT_ICONS.STATUS_ICONS.ERROR
: JSON_PARAMS_INPUT_ICONS.STATUS_ICONS.SUCCESS : JSON_PARAMS_INPUT_ICONS.STATUS_ICONS.SUCCESS
" "
:class=" :class="jsonError ? 'text-danger' : 'text-success'"
jsonError class="text-sm"
? 'text-[var(--el-color-danger)]'
: 'text-[var(--el-color-success)]'
"
class="text-14px"
/> />
<span <span
:class=" :class="jsonError ? 'text-danger' : 'text-success'"
jsonError class="text-xs"
? 'text-[var(--el-color-danger)]'
: 'text-[var(--el-color-success)]'
"
class="text-12px"
> >
{{ jsonError || JSON_PARAMS_INPUT_CONSTANTS.JSON_FORMAT_CORRECT }} {{ jsonError || JSON_PARAMS_INPUT_CONSTANTS.JSON_FORMAT_CORRECT }}
</span> </span>
</div> </div>
<!-- 快速填充按钮 --> <!-- 快速填充按钮 -->
<div v-if="paramsList.length > 0" class="gap-8px flex items-center"> <div v-if="paramsList.length > 0" class="flex items-center gap-2">
<span class="text-12px text-[var(--el-text-color-secondary)]">{{ <span class="text-secondary text-xs">
JSON_PARAMS_INPUT_CONSTANTS.QUICK_FILL_LABEL {{ JSON_PARAMS_INPUT_CONSTANTS.QUICK_FILL_LABEL }}
}}</span> </span>
<Button size="small" type="primary" plain @click="fillExampleJson"> <Button size="small" type="primary" plain @click="fillExampleJson">
{{ JSON_PARAMS_INPUT_CONSTANTS.EXAMPLE_DATA_BUTTON }} {{ JSON_PARAMS_INPUT_CONSTANTS.EXAMPLE_DATA_BUTTON }}
</Button> </Button>

View File

@@ -186,7 +186,7 @@ watch(
operator === operator ===
IotRuleSceneTriggerConditionParameterOperatorEnum.BETWEEN.value IotRuleSceneTriggerConditionParameterOperatorEnum.BETWEEN.value
" "
class="w-full! gap-8px flex items-center" class="w-full! flex items-center gap-2"
> >
<Input <Input
v-model="rangeStart" v-model="rangeStart"
@@ -196,11 +196,7 @@ watch(
class="min-w-0 flex-1" class="min-w-0 flex-1"
style="width: auto !important" style="width: auto !important"
/> />
<span <span class="text-secondary whitespace-nowrap text-xs"> 至 </span>
class="text-12px whitespace-nowrap text-[var(--el-text-color-secondary)]"
>
</span>
<Input <Input
v-model="rangeEnd" v-model="rangeEnd"
:type="getInputType()" :type="getInputType()"
@@ -226,18 +222,16 @@ watch(
<Tooltip content="多个值用逗号分隔1,2,3" placement="top"> <Tooltip content="多个值用逗号分隔1,2,3" placement="top">
<IconifyIcon <IconifyIcon
icon="ep:question-filled" icon="ep:question-filled"
class="cursor-help text-[var(--el-text-color-placeholder)]" class="cursor-help text-gray-400"
/> />
</Tooltip> </Tooltip>
</template> </template>
</Input> </Input>
<div <div
v-if="listPreview.length > 0" v-if="listPreview.length > 0"
class="mt-8px gap-6px flex flex-wrap items-center" class="mt-2 flex flex-wrap items-center gap-1"
> >
<span class="text-12px text-[var(--el-text-color-secondary)]"> <span class="text-secondary text-xs"> 解析结果: </span>
解析结果:
</span>
<Tag <Tag
v-for="(item, index) in listPreview" v-for="(item, index) in listPreview"
:key="index" :key="index"
@@ -288,7 +282,7 @@ watch(
:content="`单位:${propertyConfig.unit}`" :content="`单位:${propertyConfig.unit}`"
placement="top" placement="top"
> >
<span class="text-12px px-4px text-[var(--el-text-color-secondary)]"> <span class="text-secondary px-1 text-xs">
{{ propertyConfig.unit }} {{ propertyConfig.unit }}
</span> </span>
</Tooltip> </Tooltip>

View File

@@ -100,7 +100,7 @@ function removeAction(index: number) {
* @param type 执行器类型 * @param type 执行器类型
*/ */
function updateActionType(index: number, type: number) { function updateActionType(index: number, type: number) {
actions.value[index].type = type.toString(); actions.value[index]!.type = type.toString();
onActionTypeChange(actions.value[index] as Action, type); onActionTypeChange(actions.value[index] as Action, type);
} }
@@ -119,7 +119,7 @@ function updateAction(index: number, action: Action) {
* @param alertConfigId 告警配置ID * @param alertConfigId 告警配置ID
*/ */
function updateActionAlertConfig(index: number, alertConfigId?: number) { function updateActionAlertConfig(index: number, alertConfigId?: number) {
actions.value[index].alertConfigId = alertConfigId; actions.value[index]!.alertConfigId = alertConfigId;
if (actions.value[index]) { if (actions.value[index]) {
actions.value[index].alertConfigId = alertConfigId; actions.value[index].alertConfigId = alertConfigId;
} }
@@ -153,7 +153,7 @@ function onActionTypeChange(action: Action, type: any) {
</script> </script>
<template> <template>
<Card class="rounded-8px border-primary border" shadow="never"> <Card class="border-primary rounded-lg border" shadow="never">
<template #title> <template #title>
<div class="flex items-center justify-between"> <div class="flex items-center justify-between">
<div class="gap-8px flex items-center"> <div class="gap-8px flex items-center">
@@ -186,18 +186,18 @@ function onActionTypeChange(action: Action, type: any) {
<div <div
v-for="(action, index) in actions" v-for="(action, index) in actions"
:key="`action-${index}`" :key="`action-${index}`"
class="rounded-8px border-2 border-blue-200 bg-blue-50 shadow-sm transition-shadow hover:shadow-md" class="rounded-lg border-2 border-blue-200 bg-blue-50 shadow-sm transition-shadow hover:shadow-md"
> >
<!-- 执行器头部 - 蓝色主题 --> <!-- 执行器头部 - 蓝色主题 -->
<div <div
class="p-16px rounded-t-6px flex items-center justify-between border-b border-blue-200 bg-gradient-to-r from-blue-50 to-sky-50" class="flex items-center justify-between rounded-t-lg border-b border-blue-200 bg-gradient-to-r from-blue-50 to-sky-50 p-4"
> >
<div class="gap-12px flex items-center"> <div class="gap-12px flex items-center">
<div <div
class="gap-8px text-16px font-600 flex items-center text-blue-700" class="font-600 flex items-center gap-2 text-base text-blue-700"
> >
<div <div
class="w-24px h-24px text-12px flex items-center justify-center rounded-full bg-blue-500 font-bold text-white" class="flex size-6 items-center justify-center rounded-full bg-blue-500 text-xs font-bold text-white"
> >
{{ index + 1 }} {{ index + 1 }}
</div> </div>
@@ -220,7 +220,7 @@ function onActionTypeChange(action: Action, type: any) {
@click="removeAction(index)" @click="removeAction(index)"
class="hover:bg-red-50" class="hover:bg-red-50"
> >
<IconifyIcon icon="ep:delete" /> <IconifyIcon icon="lucide:trash-2" />
删除 删除
</Button> </Button>
</div> </div>
@@ -275,16 +275,14 @@ function onActionTypeChange(action: Action, type: any) {
action.type === action.type ===
IotRuleSceneActionTypeEnum.ALERT_TRIGGER.toString() IotRuleSceneActionTypeEnum.ALERT_TRIGGER.toString()
" "
class="rounded-6px p-16px border-border bg-fill-color-blank border" class="border-border bg-fill-color-blank rounded-lg border p-4"
> >
<div class="gap-8px mb-8px flex items-center"> <div class="mb-2 flex items-center gap-2">
<IconifyIcon icon="ep:warning" class="text-16px text-warning" /> <IconifyIcon icon="ep:warning" class="text-warning text-base" />
<span class="text-14px font-600 text-primary">触发告警</span> <span class="font-600 text-primary text-sm">触发告警</span>
<Tag size="small" type="warning">自动执行</Tag> <Tag size="small" type="warning">自动执行</Tag>
</div> </div>
<div <div class="text-secondary text-xs leading-relaxed">
class="text-12px leading-relaxed text-[var(--el-text-color-secondary)]"
>
当触发条件满足时,系统将自动发送告警通知,可在菜单 [告警中心 -> 当触发条件满足时,系统将自动发送告警通知,可在菜单 [告警中心 ->
告警配置] 管理。 告警配置] 管理。
</div> </div>

View File

@@ -71,7 +71,7 @@ function removeTrigger(index: number) {
* @param type 触发器类型 * @param type 触发器类型
*/ */
function updateTriggerType(index: number, type: number) { function updateTriggerType(index: number, type: number) {
triggers.value[index].type = type; triggers.value[index]!.type = type.toString();
onTriggerTypeChange(index, type); onTriggerTypeChange(index, type);
} }
@@ -90,7 +90,7 @@ function updateTriggerDeviceConfig(index: number, newTrigger: Trigger) {
* @param cronExpression CRON 表达式 * @param cronExpression CRON 表达式
*/ */
function updateTriggerCronConfig(index: number, cronExpression?: string) { function updateTriggerCronConfig(index: number, cronExpression?: string) {
triggers.value[index].cronExpression = cronExpression; triggers.value[index]!.cronExpression = cronExpression;
} }
/** /**
@@ -99,7 +99,7 @@ function updateTriggerCronConfig(index: number, cronExpression?: string) {
* @param _ 触发器类型(未使用) * @param _ 触发器类型(未使用)
*/ */
function onTriggerTypeChange(index: number, _: number) { function onTriggerTypeChange(index: number, _: number) {
const triggerItem = triggers.value[index]; const triggerItem = triggers.value[index]!;
triggerItem.productId = undefined; triggerItem.productId = undefined;
triggerItem.deviceId = undefined; triggerItem.deviceId = undefined;
triggerItem.identifier = undefined; triggerItem.identifier = undefined;
@@ -127,7 +127,7 @@ onMounted(() => {
<Tag size="small" type="info"> {{ triggers.length }} 个触发器 </Tag> <Tag size="small" type="info"> {{ triggers.length }} 个触发器 </Tag>
</div> </div>
<Button type="primary" size="small" @click="addTrigger"> <Button type="primary" size="small" @click="addTrigger">
<IconifyIcon icon="ep:plus" /> <IconifyIcon icon="lucide:plus" />
添加触发器 添加触发器
</Button> </Button>
</div> </div>
@@ -173,7 +173,7 @@ onMounted(() => {
@click="removeTrigger(index)" @click="removeTrigger(index)"
class="hover:bg-red-50" class="hover:bg-red-50"
> >
<IconifyIcon icon="ep:delete" /> <IconifyIcon icon="lucide:trash-2" />
删除 删除
</Button> </Button>
</div> </div>
@@ -203,7 +203,10 @@ onMounted(() => {
<div <div
class="gap-8px p-12px px-16px rounded-6px border-primary bg-background flex items-center border" class="gap-8px p-12px px-16px rounded-6px border-primary bg-background flex items-center border"
> >
<IconifyIcon icon="ep:timer" class="text-18px text-danger" /> <IconifyIcon
icon="lucide:timer"
class="text-18px text-danger"
/>
<span class="text-14px font-500 text-primary"> <span class="text-14px font-500 text-primary">
定时触发配置 定时触发配置
</span> </span>

View File

@@ -14,7 +14,7 @@ const router = useRouter();
const menuList = [ const menuList = [
{ {
name: '用户管理', name: '用户管理',
icon: 'ep:user-filled', icon: 'lucide:user',
bgColor: 'bg-red-400', bgColor: 'bg-red-400',
routerName: 'MemberUser', routerName: 'MemberUser',
}, },
@@ -26,7 +26,7 @@ const menuList = [
}, },
{ {
name: '订单管理', name: '订单管理',
icon: 'ep:list', icon: 'lucide:list',
bgColor: 'bg-yellow-500', bgColor: 'bg-yellow-500',
routerName: 'TradeOrder', routerName: 'TradeOrder',
}, },
@@ -44,13 +44,13 @@ const menuList = [
}, },
{ {
name: '优惠券', name: '优惠券',
icon: 'ep:ticket', icon: 'lucide:ticket',
bgColor: 'bg-blue-500', bgColor: 'bg-blue-500',
routerName: 'PromotionCoupon', routerName: 'PromotionCoupon',
}, },
{ {
name: '拼团活动', name: '拼团活动',
icon: 'fa:group', icon: 'lucide:users',
bgColor: 'bg-purple-500', bgColor: 'bg-purple-500',
routerName: 'PromotionBargainActivity', routerName: 'PromotionBargainActivity',
}, },

View File

@@ -3,6 +3,8 @@ import { computed, onMounted, ref } from 'vue';
import { handleTree } from '@vben/utils'; import { handleTree } from '@vben/utils';
import { TreeSelect } from 'ant-design-vue';
import { getCategoryList } from '#/api/mall/product/category'; import { getCategoryList } from '#/api/mall/product/category';
/** 商品分类选择组件 */ /** 商品分类选择组件 */

View File

@@ -145,7 +145,7 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
cellRender: { cellRender: {
name: 'CellDict', name: 'CellDict',
props: { props: {
dictType: DICT_TYPE.COMMON_STATUS, type: DICT_TYPE.COMMON_STATUS,
}, },
}, },
}, },
@@ -156,7 +156,7 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
cellRender: { cellRender: {
name: 'CellDict', name: 'CellDict',
props: { props: {
dictType: DICT_TYPE.PROMOTION_BANNER_POSITION, type: DICT_TYPE.PROMOTION_BANNER_POSITION,
}, },
}, },
}, },

View File

@@ -161,25 +161,22 @@ function handleProductCategorySelected(id: number) {
@ok="handleSubmit" @ok="handleSubmit"
> >
<div class="flex h-[500px] gap-2"> <div class="flex h-[500px] gap-2">
<div class="flex flex-col"> <!-- 左侧分组列表 -->
<!-- 左侧分组列表 --> <div
<div class="flex h-full flex-col overflow-y-auto border-r border-gray-200 pr-2"
class="h-full overflow-y-auto border-r border-gray-200 pr-2" ref="groupScrollbar"
ref="groupScrollbar" >
<Button
v-for="(group, groupIndex) in APP_LINK_GROUP_LIST"
:key="groupIndex"
class="!ml-0 mb-1 mr-4 !justify-start"
:class="[{ active: activeGroup === group.name }]"
ref="groupBtnRefs"
:type="activeGroup === group.name ? 'primary' : 'default'"
@click="handleGroupSelected(group.name)"
> >
<Button {{ group.name }}
v-for="(group, groupIndex) in APP_LINK_GROUP_LIST" </Button>
:key="groupIndex"
class="!ml-0 mb-1 mr-4 !justify-start"
:class="[{ active: activeGroup === group.name }]"
ref="groupBtnRefs"
:type="activeGroup === group.name ? 'primary' : 'default'"
:ghost="activeGroup !== group.name"
@click="handleGroupSelected(group.name)"
>
{{ group.name }}
</Button>
</div>
</div> </div>
<!-- 右侧链接列表 --> <!-- 右侧链接列表 -->
<div <div

View File

@@ -48,17 +48,13 @@ watch(
<template> <template>
<Input v-model:value="appLink" placeholder="输入或选择链接"> <Input v-model:value="appLink" placeholder="输入或选择链接">
<template #addonAfter> <template #addonAfter>
<Button @click="handleOpenDialog" class="!border-none">选择</Button> <Button
@click="handleOpenDialog"
class="!border-none !bg-transparent !p-0"
>
选择
</Button>
</template> </template>
</Input> </Input>
<AppLinkSelectDialog ref="dialogRef" @change="handleLinkSelected" /> <AppLinkSelectDialog ref="dialogRef" @change="handleLinkSelected" />
</template> </template>
<style scoped lang="scss">
:deep(.ant-input-group-addon) {
padding: 0;
background: transparent;
border: 0;
}
</style>

View File

@@ -3,11 +3,13 @@ import type { ComponentStyle } from '../util';
import { useVModel } from '@vueuse/core'; import { useVModel } from '@vueuse/core';
import { import {
Card, Col,
Form, Form,
FormItem, FormItem,
InputNumber,
Radio, Radio,
RadioGroup, RadioGroup,
Row,
Slider, Slider,
TabPane, TabPane,
Tabs, Tabs,
@@ -27,7 +29,7 @@ const props = defineProps<{ modelValue: ComponentStyle }>();
const emit = defineEmits(['update:modelValue']); const emit = defineEmits(['update:modelValue']);
const formData = useVModel(props, 'modelValue', emit); const formData = useVModel(props, 'modelValue', emit);
const treeData = [ const treeData: any[] = [
{ {
label: '外部边距', label: '外部边距',
prop: 'margin', prop: 'margin',
@@ -96,7 +98,7 @@ const treeData = [
}, },
]; ];
const handleSliderChange = (prop: string) => { function handleSliderChange(prop: string) {
switch (prop) { switch (prop) {
case 'borderRadius': { case 'borderRadius': {
formData.value.borderTopLeftRadius = formData.value.borderRadius; formData.value.borderTopLeftRadius = formData.value.borderRadius;
@@ -120,7 +122,7 @@ const handleSliderChange = (prop: string) => {
break; break;
} }
} }
}; }
</script> </script>
<template> <template>
@@ -132,7 +134,8 @@ const handleSliderChange = (prop: string) => {
<!-- 每个组件的通用内容 --> <!-- 每个组件的通用内容 -->
<TabPane tab="样式" key="style" force-render> <TabPane tab="样式" key="style" force-render>
<Card title="组件样式" class="property-group"> <p class="text-lg font-bold">组件样式</p>
<div class="flex flex-col gap-2 rounded-md p-4 shadow-lg">
<Form :model="formData"> <Form :model="formData">
<FormItem label="组件背景" name="bgType"> <FormItem label="组件背景" name="bgType">
<RadioGroup v-model:value="formData.bgType"> <RadioGroup v-model:value="formData.bgType">
@@ -156,29 +159,44 @@ const handleSliderChange = (prop: string) => {
<template #tip>建议宽度 750px</template> <template #tip>建议宽度 750px</template>
</UploadImg> </UploadImg>
</FormItem> </FormItem>
<Tree :tree-data="treeData" default-expand-all> <Tree :tree-data="treeData" default-expand-all :block-node="true">
<template #title="{ dataRef }"> <template #title="{ dataRef }">
<FormItem <FormItem
:label="dataRef.label" :label="dataRef.label"
:name="dataRef.prop" :name="dataRef.prop"
:label-col="dataRef.children ? { span: 6 } : { span: 5, offset: 1 }" :label-col="
dataRef.children ? { span: 6 } : { span: 5, offset: 1 }
"
:wrapper-col="dataRef.children ? { span: 18 } : { span: 18 }" :wrapper-col="dataRef.children ? { span: 18 } : { span: 18 }"
class="mb-0 w-full" class="mb-0 w-full"
> >
<Slider <Row>
v-model:value=" <Col :span="12">
formData[dataRef.prop as keyof ComponentStyle] as number <Slider
" v-model:value="
:max="100" formData[dataRef.prop as keyof ComponentStyle]
:min="0" "
@change="handleSliderChange(dataRef.prop)" :max="100"
/> :min="0"
@change="handleSliderChange(dataRef.prop)"
/>
</Col>
<Col :span="4">
<InputNumber
:max="100"
:min="0"
v-model:value="
formData[dataRef.prop as keyof ComponentStyle]
"
/>
</Col>
</Row>
</FormItem> </FormItem>
</template> </template>
</Tree> </Tree>
<slot name="style" :style="formData"></slot> <slot name="style" :style="formData"></slot>
</Form> </Form>
</Card> </div>
</TabPane> </TabPane>
</Tabs> </Tabs>
</template> </template>

View File

@@ -5,7 +5,7 @@ import { computed } from 'vue';
import { IconifyIcon } from '@vben/icons'; import { IconifyIcon } from '@vben/icons';
import { Button, Tooltip } from 'ant-design-vue'; import { Button } from 'ant-design-vue';
import { VerticalButtonGroup } from '#/views/mall/promotion/components'; import { VerticalButtonGroup } from '#/views/mall/promotion/components';
@@ -96,7 +96,9 @@ const handleDeleteComponent = () => {
<div :style="style"> <div :style="style">
<component :is="component.id" :property="component.property" /> <component :is="component.id" :property="component.property" />
</div> </div>
<div class="component-wrap absolute left-[-2px] top-0 block h-full w-full"> <div
class="component-wrap absolute -bottom-1 -left-0.5 -right-0.5 -top-1 block h-full w-full"
>
<!-- 左侧组件名悬浮的小贴条 --> <!-- 左侧组件名悬浮的小贴条 -->
<div class="component-name" v-if="component.name"> <div class="component-name" v-if="component.name">
{{ component.name }} {{ component.name }}
@@ -106,33 +108,61 @@ const handleDeleteComponent = () => {
class="component-toolbar" class="component-toolbar"
v-if="showToolbar && component.name && active" v-if="showToolbar && component.name && active"
> >
<VerticalButtonGroup type="primary"> <VerticalButtonGroup size="small">
<Tooltip title="上移" placement="right"> <Button
<Button :disabled="!canMoveUp"
:disabled="!canMoveUp" type="primary"
@click.stop="handleMoveComponent(-1)" size="small"
> @click.stop="handleMoveComponent(-1)"
<IconifyIcon icon="ep:arrow-up" /> v-tippy="{
</Button> content: '上移',
</Tooltip> delay: 100,
<Tooltip title="下移" placement="right"> placement: 'right',
<Button arrow: true,
:disabled="!canMoveDown" }"
@click.stop="handleMoveComponent(1)" >
> <IconifyIcon icon="lucide:arrow-up" />
<IconifyIcon icon="ep:arrow-down" /> </Button>
</Button> <Button
</Tooltip> :disabled="!canMoveDown"
<Tooltip title="复制" placement="right"> type="primary"
<Button @click.stop="handleCopyComponent()"> size="small"
<IconifyIcon icon="ep:copy-document" /> @click.stop="handleMoveComponent(1)"
</Button> v-tippy="{
</Tooltip> content: '下移',
<Tooltip title="删除" placement="right"> delay: 100,
<Button @click.stop="handleDeleteComponent()"> placement: 'right',
<IconifyIcon icon="ep:delete" /> arrow: true,
</Button> }"
</Tooltip> >
<IconifyIcon icon="lucide:arrow-down" />
</Button>
<Button
type="primary"
size="small"
@click.stop="handleCopyComponent()"
v-tippy="{
content: '复制',
delay: 100,
placement: 'right',
arrow: true,
}"
>
<IconifyIcon icon="lucide:copy" />
</Button>
<Button
type="primary"
size="small"
@click.stop="handleDeleteComponent()"
v-tippy="{
content: '删除',
delay: 100,
placement: 'right',
arrow: true,
}"
>
<IconifyIcon icon="lucide:trash-2" />
</Button>
</VerticalButtonGroup> </VerticalButtonGroup>
</div> </div>
</div> </div>
@@ -149,7 +179,7 @@ $toolbar-position: -55px;
.component-wrap { .component-wrap {
/* 鼠标放到组件上时 */ /* 鼠标放到组件上时 */
&:hover { &:hover {
border: $hover-border-width dashed var(--ant-color-primary); border: $hover-border-width dashed hsl(var(--primary));
box-shadow: 0 0 5px 0 rgb(24 144 255 / 30%); box-shadow: 0 0 5px 0 rgb(24 144 255 / 30%);
.component-name { .component-name {
@@ -170,9 +200,9 @@ $toolbar-position: -55px;
height: 25px; height: 25px;
font-size: 12px; font-size: 12px;
line-height: 25px; line-height: 25px;
color: #6a6a6a; color: hsl(var(--text-color));
text-align: center; text-align: center;
background: #fff; background: hsl(var(--background));
box-shadow: box-shadow:
0 0 4px #00000014, 0 0 4px #00000014,
0 2px 6px #0000000f, 0 2px 6px #0000000f,
@@ -187,7 +217,7 @@ $toolbar-position: -55px;
height: 0; height: 0;
content: ' '; content: ' ';
border: 5px solid transparent; border: 5px solid transparent;
border-left-color: #fff; border-left-color: hsl(var(--background));
} }
} }
@@ -207,7 +237,7 @@ $toolbar-position: -55px;
height: 0; height: 0;
content: ' '; content: ' ';
border: 5px solid transparent; border: 5px solid transparent;
border-right-color: #2d8cf0; border-right-color: hsl(var(--primary));
} }
} }
} }
@@ -218,7 +248,7 @@ $toolbar-position: -55px;
.component-wrap { .component-wrap {
margin-bottom: $active-border-width + $active-border-width; margin-bottom: $active-border-width + $active-border-width;
border: $active-border-width solid var(--ant-color-primary) !important; border: $active-border-width solid hsl(var(--primary)) !important;
box-shadow: 0 0 10px 0 rgb(24 144 255 / 30%); box-shadow: 0 0 10px 0 rgb(24 144 255 / 30%);
.component-name { .component-name {
@@ -227,10 +257,10 @@ $toolbar-position: -55px;
/* 防止加了边框之后位置移动 */ /* 防止加了边框之后位置移动 */
left: $name-position - $active-border-width !important; left: $name-position - $active-border-width !important;
color: #fff; color: #fff;
background: var(--ant-color-primary); background: hsl(var(--primary));
&::after { &::after {
border-left-color: var(--ant-color-primary); border-left-color: hsl(var(--primary));
} }
} }

View File

@@ -1,12 +1,12 @@
<script setup lang="ts"> <script setup lang="ts">
import type { DiyComponent, DiyComponentLibrary } from '../util'; import type { DiyComponent, DiyComponentLibrary } from '../util';
import { reactive, watch } from 'vue'; import { ref, watch } from 'vue';
import { IconifyIcon } from '@vben/icons'; import { IconifyIcon } from '@vben/icons';
import { cloneDeep } from '@vben/utils'; import { cloneDeep } from '@vben/utils';
import { Collapse, CollapsePanel } from 'ant-design-vue'; import { Collapse } from 'ant-design-vue';
import draggable from 'vuedraggable'; import draggable from 'vuedraggable';
import { componentConfigs } from './mobile/index'; import { componentConfigs } from './mobile/index';
@@ -19,28 +19,28 @@ const props = defineProps<{
list: DiyComponentLibrary[]; list: DiyComponentLibrary[];
}>(); }>();
const groups = reactive<any[]>([]); // 组件分组 const groups = ref<any[]>([]); // 组件分组
const extendGroups = reactive<string[]>([]); // 展开的折叠面板 const extendGroups = ref<string[]>([]); // 展开的折叠面板
/** 监听 list 属性,按照 DiyComponentLibrary 的 name 分组 */ /** 监听 list 属性,按照 DiyComponentLibrary 的 name 分组 */
watch( watch(
() => props.list, () => props.list,
() => { () => {
// 清除旧数据 // 清除旧数据
extendGroups.length = 0; extendGroups.value = [];
groups.length = 0; groups.value = [];
// 重新生成数据 // 重新生成数据
props.list.forEach((group) => { props.list.forEach((group) => {
// 是否展开分组 // 是否展开分组
if (group.extended) { if (group.extended) {
extendGroups.push(group.name); extendGroups.value.push(group.name);
} }
// 查找组件 // 查找组件
const components = group.components const components = group.components
.map((name) => componentConfigs[name] as DiyComponent<any>) .map((name) => componentConfigs[name] as DiyComponent<any>)
.filter(Boolean); .filter(Boolean);
if (components.length > 0) { if (components.length > 0) {
groups.push({ groups.value.push({
name: group.name, name: group.name,
components, components,
}); });
@@ -53,137 +53,50 @@ watch(
); );
/** 克隆组件 */ /** 克隆组件 */
const handleCloneComponent = (component: DiyComponent<any>) => { function handleCloneComponent(component: DiyComponent<any>) {
const instance = cloneDeep(component); const instance = cloneDeep(component);
instance.uid = Date.now(); instance.uid = Date.now();
return instance; return instance;
}; }
</script> </script>
<template> <template>
<aside <div class="z-[1] max-h-[calc(80vh)] shrink-0 select-none overflow-y-auto">
class="editor-left z-[1] w-[261px] shrink-0 select-none shadow-[8px_0_8px_-8px_rgb(0_0_0/0.12)]" <Collapse
> v-model:active-key="extendGroups"
<div class="h-full overflow-y-auto"> :bordered="false"
<Collapse v-model:active-key="extendGroups"> class="bg-card"
<CollapsePanel >
v-for="group in groups" <Collapse.Panel
:key="group.name" v-for="(group, index) in groups"
:header="group.name" :key="group.name"
:header="group.name"
:force-render="true"
>
<draggable
class="flex flex-wrap items-center"
ghost-class="draggable-ghost"
:item-key="index.toString()"
:list="group.components"
:sort="false"
:group="{ name: 'component', pull: 'clone', put: false }"
:clone="handleCloneComponent"
:animation="200"
:force-fallback="false"
> >
<draggable <template #item="{ element }">
class="flex flex-wrap items-center" <div
ghost-class="draggable-ghost" class="component flex h-20 w-20 cursor-move flex-col items-center justify-center hover:border-2 hover:border-blue-500"
item-key="index" >
:list="group.components" <IconifyIcon
:sort="false" :icon="element.icon"
:group="{ name: 'component', pull: 'clone', put: false }" class="mb-1 size-8 text-gray-500"
:clone="handleCloneComponent" />
:animation="200" <span class="mt-1 text-xs">{{ element.name }}</span>
:force-fallback="false" </div>
> </template>
<template #item="{ element }"> </draggable>
<div> </Collapse.Panel>
<div class="hidden text-white">组件放置区域</div> </Collapse>
<div </div>
class="component flex h-[86px] w-[86px] cursor-move flex-col items-center justify-center border-b border-r [&:nth-of-type(3n)]:border-r-0"
:style="{
borderColor: 'var(--ant-color-split)',
}"
>
<IconifyIcon
:icon="element.icon"
:size="32"
class="mb-1 text-gray-500"
/>
<span class="mt-1 text-xs">{{ element.name }}</span>
</div>
</div>
</template>
</draggable>
</CollapsePanel>
</Collapse>
</div>
</aside>
</template> </template>
<style scoped lang="scss">
.editor-left {
:deep(.ant-collapse) {
border-top: none;
}
:deep(.ant-collapse-item) {
border-bottom: none;
}
:deep(.ant-collapse-content-box) {
padding: 0;
}
:deep(.ant-collapse-header) {
height: 32px;
padding: 0 24px !important;
line-height: 32px;
background-color: var(--ant-color-bg-layout);
border-bottom: none;
}
/* 组件 hover 和 active 状态(需要 CSS 变量)*/
.component.active,
.component:hover {
color: var(--ant-color-white);
background: var(--ant-color-primary);
:deep(.iconify) {
color: var(--ant-color-white);
}
}
}
/* 拖拽区域全局样式 */
.drag-area {
/* 拖拽到手机区域时的样式 */
.draggable-ghost {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 40px;
/* 条纹背景 */
background: linear-gradient(
45deg,
#91a8d5 0,
#91a8d5 10%,
#94b4eb 10%,
#94b4eb 50%,
#91a8d5 50%,
#91a8d5 60%,
#94b4eb 60%,
#94b4eb
);
background-size: 1rem 1rem;
transition: all 0.5s;
span {
display: inline-block;
width: 140px;
height: 25px;
font-size: 12px;
line-height: 25px;
color: #fff;
text-align: center;
background: #5487df;
}
.component {
display: none; /* 拖拽时隐藏组件 */
}
.hidden {
display: block !important; /* 拖拽时显示占位提示 */
}
}
}
</style>

View File

@@ -5,6 +5,8 @@ import { ref } from 'vue';
import { IconifyIcon } from '@vben/icons'; import { IconifyIcon } from '@vben/icons';
import { Carousel, Image } from 'ant-design-vue';
/** 轮播图 */ /** 轮播图 */
defineOptions({ name: 'Carousel' }); defineOptions({ name: 'Carousel' });
@@ -16,36 +18,36 @@ const handleIndexChange = (index: number) => {
}; };
</script> </script>
<template> <template>
<!-- 无图片 --> <div>
<div <!-- 无图片 -->
class="flex h-[250px] items-center justify-center bg-gray-300"
v-if="property.items.length === 0"
>
<IconifyIcon icon="tdesign:image" class="text-[120px] text-gray-800" />
</div>
<div v-else class="relative">
<Carousel
:autoplay="property.autoplay"
:autoplay-speed="property.interval * 1000"
:dots="property.indicator !== 'number'"
@change="handleIndexChange"
class="h-[174px]"
>
<div v-for="(item, index) in property.items" :key="index">
<Image
class="h-full w-full object-cover"
:src="item.imgUrl"
:preview="false"
/>
</div>
</Carousel>
<div <div
v-if="property.indicator === 'number'" class="bg-card flex h-64 items-center justify-center"
class="absolute bottom-[10px] right-[10px] rounded-xl bg-black px-[8px] py-[2px] text-[10px] text-white opacity-40" v-if="property.items.length === 0"
> >
{{ currentIndex }} / {{ property.items.length }} <IconifyIcon icon="tdesign:image" class="size-6 text-gray-800" />
</div>
<div v-else class="relative">
<Carousel
:autoplay="property.autoplay"
:autoplay-speed="property.interval * 1000"
:dots="property.indicator !== 'number'"
@change="handleIndexChange"
class="h-44"
>
<div v-for="(item, index) in property.items" :key="index">
<Image
class="h-full w-full object-cover"
:src="item.imgUrl"
:preview="false"
/>
</div>
</Carousel>
<div
v-if="property.indicator === 'number'"
class="absolute bottom-2.5 right-2.5 rounded-xl bg-black px-2 py-1 text-xs text-white opacity-40"
>
{{ currentIndex }} / {{ property.items.length }}
</div>
</div> </div>
</div> </div>
</template> </template>
<style scoped lang="scss"></style>

View File

@@ -4,6 +4,16 @@ import type { CarouselProperty } from './config';
import { IconifyIcon } from '@vben/icons'; import { IconifyIcon } from '@vben/icons';
import { useVModel } from '@vueuse/core'; import { useVModel } from '@vueuse/core';
import {
Form,
FormItem,
Radio,
RadioButton,
RadioGroup,
Slider,
Switch,
Tooltip,
} from 'ant-design-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';
@@ -21,33 +31,34 @@ const formData = useVModel(props, 'modelValue', emit);
<template> <template>
<ComponentContainerProperty v-model="formData.style"> <ComponentContainerProperty v-model="formData.style">
<ElForm label-width="80px" :model="formData"> <Form label-width="80px" :model="formData">
<ElCard header="样式设置" class="property-group" shadow="never"> <p class="text-base font-bold">样式设置</p>
<ElFormItem label="样式" prop="type"> <div class="flex flex-col gap-2 rounded-md p-4 shadow-lg">
<ElRadioGroup v-model="formData.type"> <FormItem label="样式" prop="type">
<ElTooltip class="item" content="默认" placement="bottom"> <RadioGroup v-model="formData.type">
<ElRadioButton value="default"> <Tooltip class="item" content="默认" placement="bottom">
<IconifyIcon icon="system-uicons:carousel" /> <RadioButton value="default">
</ElRadioButton> <IconifyIcon icon="system-uicons:carousel" class="size-6" />
</ElTooltip> </RadioButton>
<ElTooltip class="item" content="卡片" placement="bottom"> </Tooltip>
<ElRadioButton value="card"> <Tooltip class="item" content="卡片" placement="bottom">
<IconifyIcon icon="ic:round-view-carousel" /> <RadioButton value="card">
</ElRadioButton> <IconifyIcon icon="ic:round-view-carousel" class="size-6" />
</ElTooltip> </RadioButton>
</ElRadioGroup> </Tooltip>
</ElFormItem> </RadioGroup>
<ElFormItem label="指示器" prop="indicator"> </FormItem>
<ElRadioGroup v-model="formData.indicator"> <FormItem label="指示器" prop="indicator">
<ElRadio value="dot">小圆点</ElRadio> <RadioGroup v-model="formData.indicator">
<ElRadio value="number">数字</ElRadio> <Radio value="dot">小圆点</Radio>
</ElRadioGroup> <Radio value="number">数字</Radio>
</ElFormItem> </RadioGroup>
<ElFormItem label="是否轮播" prop="autoplay"> </FormItem>
<ElSwitch v-model="formData.autoplay" /> <FormItem label="是否轮播" prop="autoplay">
</ElFormItem> <Switch v-model="formData.autoplay" />
<ElFormItem label="播放间隔" prop="interval" v-if="formData.autoplay"> </FormItem>
<ElSlider <FormItem label="播放间隔" prop="interval" v-if="formData.autoplay">
<Slider
v-model="formData.interval" v-model="formData.interval"
:max="10" :max="10"
:min="0.5" :min="0.5"
@@ -56,24 +67,20 @@ const formData = useVModel(props, 'modelValue', emit);
input-size="small" input-size="small"
:show-input-controls="false" :show-input-controls="false"
/> />
<ElText type="info">单位</ElText> <p class="text-info">单位</p>
</ElFormItem> </FormItem>
</ElCard> </div>
<ElCard header="内容设置" class="property-group" shadow="never"> <p class="text-base font-bold">内容设置</p>
<div class="flex flex-col gap-2 rounded-md p-4 shadow-lg">
<Draggable v-model="formData.items" :empty-item="{ type: 'img' }"> <Draggable v-model="formData.items" :empty-item="{ type: 'img' }">
<template #default="{ element }"> <template #default="{ element }">
<ElFormItem <FormItem label="类型" prop="type" class="mb-2" label-width="40px">
label="类型" <RadioGroup v-model="element.type">
prop="type" <Radio value="img">图片</Radio>
class="mb-2" <Radio value="video">视频</Radio>
label-width="40px" </RadioGroup>
> </FormItem>
<ElRadioGroup v-model="element.type"> <FormItem
<ElRadio value="img">图片</ElRadio>
<ElRadio value="video">视频</ElRadio>
</ElRadioGroup>
</ElFormItem>
<ElFormItem
label="图片" label="图片"
class="mb-2" class="mb-2"
label-width="40px" label-width="40px"
@@ -84,39 +91,37 @@ const formData = useVModel(props, 'modelValue', emit);
draggable="false" draggable="false"
height="80px" height="80px"
width="100%" width="100%"
class="min-w-[80px]" class="min-w-20"
:show-description="false" :show-description="false"
/> />
</ElFormItem> </FormItem>
<template v-else> <template v-else>
<ElFormItem label="封面" class="mb-2" label-width="40px"> <FormItem label="封面" class="mb-2" label-width="40px">
<UploadImg <UploadImg
v-model="element.imgUrl" v-model="element.imgUrl"
draggable="false" draggable="false"
:show-description="false" :show-description="false"
height="80px" height="80px"
width="100%" width="100%"
class="min-w-[80px]" class="min-w-20"
/> />
</ElFormItem> </FormItem>
<ElFormItem label="视频" class="mb-2" label-width="40px"> <FormItem label="视频" class="mb-2" label-width="40px">
<UploadFile <UploadFile
v-model="element.videoUrl" v-model="element.videoUrl"
:file-type="['mp4']" :file-type="['mp4']"
:limit="1" :limit="1"
:file-size="100" :file-size="100"
class="min-w-[80px]" class="min-w-20"
/> />
</ElFormItem> </FormItem>
</template> </template>
<ElFormItem label="链接" class="mb-2" label-width="40px"> <FormItem label="链接" class="mb-2" label-width="40px">
<AppLinkInput v-model="element.url" /> <AppLinkInput v-model="element.url" />
</ElFormItem> </FormItem>
</template> </template>
</Draggable> </Draggable>
</ElCard> </div>
</ElForm> </Form>
</ComponentContainerProperty> </ComponentContainerProperty>
</template> </template>
<style scoped lang="scss"></style>

View File

@@ -25,5 +25,3 @@ defineProps<{ property: DividerProperty }>();
></div> ></div>
</div> </div>
</template> </template>
<style scoped lang="scss"></style>

View File

@@ -50,11 +50,7 @@ const formData = useVModel(props, 'modelValue', emit);
<template> <template>
<Form :model="formData"> <Form :model="formData">
<FormItem label="高度" name="height"> <FormItem label="高度" name="height">
<Slider <Slider v-model:value="formData.height" :min="1" :max="100" />
v-model:value="formData.height"
:min="1"
:max="100"
/>
</FormItem> </FormItem>
<FormItem label="选择样式" name="borderType"> <FormItem label="选择样式" name="borderType">
<RadioGroup v-model:value="formData!.borderType"> <RadioGroup v-model:value="formData!.borderType">
@@ -65,29 +61,34 @@ const formData = useVModel(props, 'modelValue', emit);
:title="item.text" :title="item.text"
> >
<RadioButton :value="item.type"> <RadioButton :value="item.type">
<IconifyIcon :icon="item.icon" /> <IconifyIcon
:icon="item.icon"
class="inset-0 size-6 items-center"
/>
</RadioButton> </RadioButton>
</Tooltip> </Tooltip>
</RadioGroup> </RadioGroup>
</FormItem> </FormItem>
<template v-if="formData.borderType !== 'none'"> <template v-if="formData.borderType !== 'none'">
<FormItem label="线宽" name="lineWidth"> <FormItem label="线宽" name="lineWidth">
<Slider <Slider v-model:value="formData.lineWidth" :min="1" :max="30" />
v-model:value="formData.lineWidth"
:min="1"
:max="30"
/>
</FormItem> </FormItem>
<FormItem label="左右边距" name="paddingType"> <FormItem label="左右边距" name="paddingType">
<RadioGroup v-model:value="formData!.paddingType"> <RadioGroup v-model:value="formData!.paddingType">
<Tooltip title="无边距" placement="top"> <Tooltip title="无边距" placement="top">
<RadioButton value="none"> <RadioButton value="none">
<IconifyIcon icon="tabler:box-padding" /> <IconifyIcon
icon="tabler:box-padding"
class="inset-0 size-6 items-center"
/>
</RadioButton> </RadioButton>
</Tooltip> </Tooltip>
<Tooltip title="左右留边" placement="top"> <Tooltip title="左右留边" placement="top">
<RadioButton value="horizontal"> <RadioButton value="horizontal">
<IconifyIcon icon="vaadin:padding" /> <IconifyIcon
icon="vaadin:padding"
class="inset-0 size-6 items-center"
/>
</RadioButton> </RadioButton>
</Tooltip> </Tooltip>
</RadioGroup> </RadioGroup>

View File

@@ -33,7 +33,7 @@ const handleActive = (index: number) => {
<Image :src="item.imgUrl" fit="contain" class="h-full w-full"> <Image :src="item.imgUrl" fit="contain" class="h-full w-full">
<template #error> <template #error>
<div class="flex h-full w-full items-center justify-center"> <div class="flex h-full w-full items-center justify-center">
<IconifyIcon icon="ep:picture" /> <IconifyIcon icon="lucide:image" />
</div> </div>
</template> </template>
</Image> </Image>

View File

@@ -2,13 +2,7 @@
import type { PopoverProperty } from './config'; import type { PopoverProperty } from './config';
import { useVModel } from '@vueuse/core'; import { useVModel } from '@vueuse/core';
import { import { Form, FormItem, Radio, RadioGroup, Tooltip } from 'ant-design-vue';
Form,
FormItem,
Radio,
RadioGroup,
Tooltip,
} from 'ant-design-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';
@@ -40,10 +34,7 @@ const formData = useVModel(props, 'modelValue', emit);
</FormItem> </FormItem>
<FormItem label="显示次数" :name="`list[${index}].showType`"> <FormItem label="显示次数" :name="`list[${index}].showType`">
<RadioGroup v-model:value="element.showType"> <RadioGroup v-model:value="element.showType">
<Tooltip <Tooltip title="只显示一次,下次打开时不显示" placement="bottom">
title="只显示一次,下次打开时不显示"
placement="bottom"
>
<Radio value="once">一次</Radio> <Radio value="once">一次</Radio>
</Tooltip> </Tooltip>
<Tooltip title="每次打开时都会显示" placement="bottom"> <Tooltip title="每次打开时都会显示" placement="bottom">

View File

@@ -23,7 +23,7 @@ export const CouponDiscountDesc = defineComponent({
const discountDesc = const discountDesc =
coupon.discountType === PromotionDiscountTypeEnum.PRICE.type coupon.discountType === PromotionDiscountTypeEnum.PRICE.type
? `${floatToFixed2(coupon.discountPrice)}` ? `${floatToFixed2(coupon.discountPrice)}`
: `${coupon.discountPercent / 10}`; : `${(coupon.discountPercent ?? 0) / 10}`;
return () => ( return () => (
<div> <div>
<span>{useCondition}</span> <span>{useCondition}</span>

View File

@@ -17,7 +17,7 @@ export const CouponDiscount = defineComponent({
setup(props) { setup(props) {
const coupon = props.coupon as MallCouponTemplateApi.CouponTemplate; const coupon = props.coupon as MallCouponTemplateApi.CouponTemplate;
// 折扣 // 折扣
let value = `${coupon.discountPercent / 10}`; let value = `${(coupon.discountPercent ?? 0) / 10}`;
let suffix = ' 折'; let suffix = ' 折';
// 满减 // 满减
if (coupon.discountType === PromotionDiscountTypeEnum.PRICE.type) { if (coupon.discountType === PromotionDiscountTypeEnum.PRICE.type) {

View File

@@ -5,6 +5,8 @@ import type { MallCouponTemplateApi } from '#/api/mall/promotion/coupon/couponTe
import { onMounted, ref, watch } from 'vue'; import { onMounted, ref, watch } from 'vue';
import { getCouponTemplateList } from '#/api/mall/promotion/coupon/couponTemplate';
import { import {
CouponDiscount, CouponDiscount,
CouponDiscountDesc, CouponDiscountDesc,
@@ -31,13 +33,13 @@ watch(
); );
// 手机宽度 // 手机宽度
const phoneWidth = ref(375); const phoneWidth = ref(384);
// 容器 // 容器
const containerRef = ref(); const containerRef = ref();
// 滚动条宽度 // 滚动条宽度
const scrollbarWidth = ref('100%'); const scrollbarWidth = ref('100%');
// 优惠券的宽度 // 优惠券的宽度
const couponWidth = ref(375); const couponWidth = ref(384);
// 计算布局参数 // 计算布局参数
watch( watch(
() => [props.property, phoneWidth, couponList.value.length], () => [props.property, phoneWidth, couponList.value.length],
@@ -56,11 +58,11 @@ watch(
); );
onMounted(() => { onMounted(() => {
// 提取手机宽度 // 提取手机宽度
phoneWidth.value = containerRef.value?.wrapRef?.offsetWidth || 375; phoneWidth.value = containerRef.value?.wrapRef?.offsetWidth || 384;
}); });
</script> </script>
<template> <template>
<div class="z-10 min-h-[30px]" wrap-class="w-full" ref="containerRef"> <div class="z-10 min-h-8" wrap-class="w-full" ref="containerRef">
<div <div
class="flex flex-row text-xs" class="flex flex-row text-xs"
:style="{ :style="{
@@ -153,4 +155,3 @@ onMounted(() => {
</div> </div>
</div> </div>
</template> </template>
<style scoped lang="scss"></style>

View File

@@ -16,7 +16,6 @@ import { floatToFixed2 } from '@vben/utils';
import { useVModel } from '@vueuse/core'; import { useVModel } from '@vueuse/core';
import { import {
Button, Button,
Card,
Form, Form,
FormItem, FormItem,
RadioButton, RadioButton,
@@ -33,8 +32,6 @@ import CouponSelect from '#/views/mall/promotion/coupon/components/select.vue';
import ComponentContainerProperty from '../../component-container-property.vue'; import ComponentContainerProperty from '../../component-container-property.vue';
const { Text: ATypographyText } = Typography;
/** 优惠券卡片属性面板 */ /** 优惠券卡片属性面板 */
defineOptions({ name: 'CouponCardProperty' }); defineOptions({ name: 'CouponCardProperty' });
@@ -84,26 +81,31 @@ watch(
<template> <template>
<ComponentContainerProperty v-model="formData.style"> <ComponentContainerProperty v-model="formData.style">
<Form :model="formData"> <Form :model="formData">
<Card title="优惠券列表" class="property-group"> <p class="text-base font-bold">优惠券列表</p>
<div class="flex flex-col gap-2 rounded-md p-4 shadow-lg">
<div <div
v-for="(coupon, index) in couponList" v-for="(coupon, index) in couponList"
:key="index" :key="index"
class="flex items-center justify-between" class="flex items-center justify-between"
> >
<ATypographyText ellipsis class="text-base">{{ coupon.name }}</ATypographyText> <Typography>
<ATypographyText type="secondary" ellipsis> <Typography.Title :level="5">
<span v-if="coupon.usePrice > 0"> {{ coupon.name }}
{{ floatToFixed2(coupon.usePrice) }} </Typography.Title>
</span> <Typography.Text type="secondary">
<span <span v-if="coupon.usePrice > 0">
v-if=" {{ floatToFixed2(coupon.usePrice) }}
coupon.discountType === PromotionDiscountTypeEnum.PRICE.type </span>
" <span
> v-if="
减{{ floatToFixed2(coupon.discountPrice) }}元 coupon.discountType === PromotionDiscountTypeEnum.PRICE.type
</span> "
<span v-else> 打{{ coupon.discountPercent }}折 </span> >
</ATypographyText> 减{{ floatToFixed2(coupon.discountPrice) }}元
</span>
<span v-else> 打{{ (coupon.discountPercent ?? 0) / 10 }}折 </span>
</Typography.Text>
</Typography>
</div> </div>
<FormItem> <FormItem>
<Button <Button
@@ -112,29 +114,37 @@ watch(
ghost ghost
class="mt-2 w-full" class="mt-2 w-full"
> >
<template #icon> <IconifyIcon icon="lucide:plus" />
<IconifyIcon icon="ep:plus" />
</template>
添加 添加
</Button> </Button>
</FormItem> </FormItem>
</Card> </div>
<Card title="优惠券样式" class="property-group"> <p class="text-base font-bold">优惠券样式:</p>
<div class="flex flex-col gap-2 rounded-md p-4 shadow-lg">
<FormItem label="列数" name="type"> <FormItem label="列数" name="type">
<RadioGroup v-model:value="formData.columns"> <RadioGroup v-model:value="formData.columns">
<Tooltip title="一列" placement="bottom"> <Tooltip title="一列" placement="bottom">
<RadioButton :value="1"> <RadioButton :value="1">
<IconifyIcon icon="fluent:text-column-one-24-filled" /> <IconifyIcon
icon="fluent:text-column-one-24-filled"
class="inset-0 size-6 items-center"
/>
</RadioButton> </RadioButton>
</Tooltip> </Tooltip>
<Tooltip title="二列" placement="bottom"> <Tooltip title="二列" placement="bottom">
<RadioButton :value="2"> <RadioButton :value="2">
<IconifyIcon icon="fluent:text-column-two-24-filled" /> <IconifyIcon
icon="fluent:text-column-two-24-filled"
class="size-6"
/>
</RadioButton> </RadioButton>
</Tooltip> </Tooltip>
<Tooltip title="三列" placement="bottom"> <Tooltip title="三列" placement="bottom">
<RadioButton :value="3"> <RadioButton :value="3">
<IconifyIcon icon="fluent:text-column-three-24-filled" /> <IconifyIcon
icon="fluent:text-column-three-24-filled"
class="size-6"
/>
</RadioButton> </RadioButton>
</Tooltip> </Tooltip>
</RadioGroup> </RadioGroup>
@@ -158,13 +168,9 @@ watch(
<ColorInput v-model="formData.button.color" /> <ColorInput v-model="formData.button.color" />
</FormItem> </FormItem>
<FormItem label="间隔" name="space"> <FormItem label="间隔" name="space">
<Slider <Slider v-model:value="formData.space" :max="100" :min="0" />
v-model:value="formData.space"
:max="100"
:min="0"
/>
</FormItem> </FormItem>
</Card> </div>
</Form> </Form>
</ComponentContainerProperty> </ComponentContainerProperty>

View File

@@ -5,7 +5,7 @@ import { ref } from 'vue';
import { IconifyIcon } from '@vben/icons'; import { IconifyIcon } from '@vben/icons';
import { Image, message } from 'ant-design-vue'; import { Button, Image, message } from 'ant-design-vue';
/** 悬浮按钮 */ /** 悬浮按钮 */
defineOptions({ name: 'FloatingActionButton' }); defineOptions({ name: 'FloatingActionButton' });
@@ -25,7 +25,7 @@ const handleActive = (index: number) => {
</script> </script>
<template> <template>
<div <div
class="absolute bottom-8 right-[calc(50%-375px/2+32px)] z-20 flex items-center gap-3" class="absolute bottom-8 right-[calc(50%-384px/2+32px)] z-20 flex items-center gap-3"
:class="[ :class="[
{ {
'flex-row': property.direction === 'horizontal', 'flex-row': property.direction === 'horizontal',
@@ -43,7 +43,11 @@ const handleActive = (index: number) => {
<Image :src="item.imgUrl" fit="contain" class="h-7 w-7"> <Image :src="item.imgUrl" fit="contain" class="h-7 w-7">
<template #error> <template #error>
<div class="flex h-full w-full items-center justify-center"> <div class="flex h-full w-full items-center justify-center">
<IconifyIcon icon="ep:picture" :color="item.textColor" /> <IconifyIcon
icon="lucide:image"
:color="item.textColor"
class="inset-0 size-6 items-center"
/>
</div> </div>
</template> </template>
</Image> </Image>
@@ -57,13 +61,13 @@ const handleActive = (index: number) => {
</div> </div>
</template> </template>
<!-- todo: @owen 使用APP主题色 --> <!-- todo: @owen 使用APP主题色 -->
<el-button type="primary" size="large" circle @click="handleToggleFab"> <Button type="primary" size="large" circle @click="handleToggleFab">
<IconifyIcon <IconifyIcon
icon="ep:plus" icon="lucide:plus"
class="fab-icon" class="fab-icon"
:class="[{ active: expanded }]" :class="[{ active: expanded }]"
/> />
</el-button> </Button>
</div> </div>
<!-- 模态背景展开时显示点击后折叠 --> <!-- 模态背景展开时显示点击后折叠 -->
<div v-if="expanded" class="modal-bg" @click="handleToggleFab"></div> <div v-if="expanded" class="modal-bg" @click="handleToggleFab"></div>
@@ -74,9 +78,9 @@ const handleActive = (index: number) => {
.modal-bg { .modal-bg {
position: absolute; position: absolute;
top: 0; top: 0;
left: calc(50% - 375px / 2); left: calc(50% - 384px / 2);
z-index: 11; z-index: 11;
width: 375px; width: 384px;
height: 100%; height: 100%;
background-color: rgb(0 0 0 / 40%); background-color: rgb(0 0 0 / 40%);
} }

View File

@@ -2,14 +2,7 @@
import type { FloatingActionButtonProperty } from './config'; import type { FloatingActionButtonProperty } from './config';
import { useVModel } from '@vueuse/core'; import { useVModel } from '@vueuse/core';
import { import { Form, FormItem, Radio, RadioGroup, Switch } from 'ant-design-vue';
Card,
Form,
FormItem,
Radio,
RadioGroup,
Switch,
} from 'ant-design-vue';
import UploadImg from '#/components/upload/image-upload.vue'; import UploadImg from '#/components/upload/image-upload.vue';
import { import {
@@ -30,7 +23,8 @@ const formData = useVModel(props, 'modelValue', emit);
<template> <template>
<Form :model="formData"> <Form :model="formData">
<Card title="按钮配置" class="property-group"> <p class="text-base font-bold">按钮配置</p>
<div class="flex flex-col gap-2 rounded-md p-4 shadow-lg">
<FormItem label="展开方向" name="direction"> <FormItem label="展开方向" name="direction">
<RadioGroup v-model:value="formData.direction"> <RadioGroup v-model:value="formData.direction">
<Radio value="vertical">垂直</Radio> <Radio value="vertical">垂直</Radio>
@@ -40,8 +34,9 @@ const formData = useVModel(props, 'modelValue', emit);
<FormItem label="显示文字" name="showText"> <FormItem label="显示文字" name="showText">
<Switch v-model:checked="formData.showText" /> <Switch v-model:checked="formData.showText" />
</FormItem> </FormItem>
</Card> </div>
<Card title="按钮列表" class="property-group"> <p class="text-base font-bold">按钮列表</p>
<div class="flex flex-col gap-2 rounded-md p-4 shadow-lg">
<Draggable v-model="formData.list" :empty-item="{ textColor: '#fff' }"> <Draggable v-model="formData.list" :empty-item="{ textColor: '#fff' }">
<template #default="{ element, index }"> <template #default="{ element, index }">
<FormItem label="图标" :name="`list[${index}].imgUrl`"> <FormItem label="图标" :name="`list[${index}].imgUrl`">
@@ -63,6 +58,6 @@ const formData = useVModel(props, 'modelValue', emit);
</FormItem> </FormItem>
</template> </template>
</Draggable> </Draggable>
</Card> </div>
</Form> </Form>
</template> </template>

View File

@@ -11,7 +11,7 @@ import { IconifyIcon } from '@vben/icons';
import { Button, Image } from 'ant-design-vue'; import { Button, Image } from 'ant-design-vue';
import { AppLinkSelectDialog } from '#/views/mall/promotion/components'; import AppLinkSelectDialog from '#/views/mall/promotion/components/app-link-input/app-link-select-dialog.vue';
import { import {
CONTROL_DOT_LIST, CONTROL_DOT_LIST,
@@ -200,9 +200,10 @@ const handleAppLinkChange = (appLink: AppLink) => {
height: `${item.height}px`, height: `${item.height}px`,
top: `${item.top}px`, top: `${item.top}px`,
left: `${item.left}px`, left: `${item.left}px`,
color: 'var(--ant-color-primary)', color: 'hsl(var(--primary))',
background: 'color-mix(in srgb, var(--ant-color-primary) 30%, transparent)', background:
borderColor: 'var(--ant-color-primary)', 'color-mix(in srgb, hsl(var(--primary)) 30%, transparent)',
borderColor: 'hsl(var(--primary))',
}" }"
@mousedown="handleMove(item, $event)" @mousedown="handleMove(item, $event)"
@dblclick="handleShowAppLinkDialog(item)" @dblclick="handleShowAppLinkDialog(item)"
@@ -211,10 +212,9 @@ const handleAppLinkChange = (appLink: AppLink) => {
{{ item.name || '双击选择链接' }} {{ item.name || '双击选择链接' }}
</span> </span>
<IconifyIcon <IconifyIcon
icon="ep:close" icon="lucide:x"
class="absolute right-0 top-0 hidden cursor-pointer rounded-bl-[80%] p-[2px_2px_6px_6px] text-right text-white group-hover:block" class="absolute inset-0 right-0 top-0 hidden size-6 cursor-pointer items-center rounded-bl-[80%] p-[2px_2px_6px_6px] text-right text-white group-hover:block"
:style="{ backgroundColor: 'var(--ant-color-primary)' }" :style="{ backgroundColor: 'hsl(var(--primary))' }"
:size="14"
@click="handleRemove(item)" @click="handleRemove(item)"
/> />
@@ -231,7 +231,7 @@ const handleAppLinkChange = (appLink: AppLink) => {
<template #prepend-footer> <template #prepend-footer>
<Button @click="handleAdd" type="primary" ghost> <Button @click="handleAdd" type="primary" ghost>
<template #icon> <template #icon>
<IconifyIcon icon="ep:plus" /> <IconifyIcon icon="lucide:plus" />
</template> </template>
添加热区 添加热区
</Button> </Button>

View File

@@ -1,6 +1,7 @@
<script setup lang="ts"> <script setup lang="ts">
import type { HotZoneProperty } from './config'; import type { HotZoneProperty } from './config';
import { Image } from 'ant-design-vue';
/** 热区 */ /** 热区 */
defineOptions({ name: 'HotZone' }); defineOptions({ name: 'HotZone' });
const props = defineProps<{ property: HotZoneProperty }>(); const props = defineProps<{ property: HotZoneProperty }>();
@@ -15,7 +16,7 @@ const props = defineProps<{ property: HotZoneProperty }>();
<div <div
v-for="(item, index) in props.property.list" v-for="(item, index) in props.property.list"
:key="index" :key="index"
class="hot-zone" class="bg-primary-700 absolute z-10 flex cursor-move items-center justify-center border text-sm opacity-80"
:style="{ :style="{
width: `${item.width}px`, width: `${item.width}px`,
height: `${item.height}px`, height: `${item.height}px`,
@@ -23,23 +24,9 @@ const props = defineProps<{ property: HotZoneProperty }>();
left: `${item.left}px`, left: `${item.left}px`,
}" }"
> >
{{ item.name }} <p class="text-primary">
{{ item.name }}
</p>
</div> </div>
</div> </div>
</template> </template>
<style scoped lang="scss">
.hot-zone {
position: absolute;
z-index: 10;
display: flex;
align-items: center;
justify-content: center;
font-size: 14px;
color: var(--el-color-primary);
cursor: move;
background: var(--el-color-primary-light-7);
border: 1px solid var(--el-color-primary);
opacity: 0.8;
}
</style>

View File

@@ -4,7 +4,7 @@ import type { HotZoneProperty } from './config';
import { ref } from 'vue'; import { ref } from 'vue';
import { useVModel } from '@vueuse/core'; import { useVModel } from '@vueuse/core';
import { Button, Form, FormItem, Typography } from 'ant-design-vue'; import { Button, Form, FormItem } from 'ant-design-vue';
import UploadImg from '#/components/upload/image-upload.vue'; import UploadImg from '#/components/upload/image-upload.vue';
@@ -40,19 +40,14 @@ const handleOpenEditDialog = () => {
v-model="formData.imgUrl" v-model="formData.imgUrl"
height="50px" height="50px"
width="auto" width="auto"
class="min-w-[80px]" class="min-w-20"
:show-description="false" :show-description="false"
> />
<template #tip>
<Typography.Text type="secondary" class="text-xs">
推荐宽度 750
</Typography.Text>
</template>
</UploadImg>
</FormItem> </FormItem>
<p class="text-center text-sm text-gray-500">推荐宽度 750</p>
</Form> </Form>
<Button type="primary" class="w-full" @click="handleOpenEditDialog"> <Button type="primary" class="mt-4 w-full" @click="handleOpenEditDialog">
设置热区 设置热区
</Button> </Button>
</ComponentContainerProperty> </ComponentContainerProperty>
@@ -71,10 +66,10 @@ const handleOpenEditDialog = () => {
align-items: center; align-items: center;
justify-content: center; justify-content: center;
font-size: 12px; font-size: 12px;
color: #fff; color: hsl(var(--text-color));
cursor: move; cursor: move;
background: #409effbf; background: color-mix(in srgb, hsl(var(--primary)) 30%, transparent);
border: 1px solid var(--el-color-primary); border: 1px solid hsl(var(--primary));
/* 控制点 */ /* 控制点 */
.ctrl-dot { .ctrl-dot {

View File

@@ -11,7 +11,7 @@ export interface ImageBarProperty {
export const component = { export const component = {
id: 'ImageBar', id: 'ImageBar',
name: '图片展示', name: '图片展示',
icon: 'ep:picture', icon: 'lucide:image',
property: { property: {
imgUrl: '', imgUrl: '',
url: '', url: '',

View File

@@ -3,6 +3,8 @@ import type { ImageBarProperty } from './config';
import { IconifyIcon } from '@vben/icons'; import { IconifyIcon } from '@vben/icons';
import { Image } from 'ant-design-vue';
/** 图片展示 */ /** 图片展示 */
defineOptions({ name: 'ImageBar' }); defineOptions({ name: 'ImageBar' });
@@ -11,24 +13,15 @@ defineProps<{ property: ImageBarProperty }>();
<template> <template>
<!-- 无图片 --> <!-- 无图片 -->
<div <div
class="flex h-12 items-center justify-center bg-gray-300" class="bg-card flex h-12 items-center justify-center"
v-if="!property.imgUrl" v-if="!property.imgUrl"
> >
<IconifyIcon icon="ep:picture" class="text-3xl text-gray-600" /> <IconifyIcon icon="lucide:image" class="text-3xl text-gray-600" />
</div> </div>
<Image <Image
class="min-h-8 w-full" class="block h-full min-h-8 w-full"
v-else v-else
:src="property.imgUrl" :src="property.imgUrl"
:preview="false" :preview="false"
/> />
</template> </template>
<style scoped lang="scss">
/* 图片 */
img {
display: block;
width: 100%;
height: 100%;
}
</style>

View File

@@ -30,11 +30,9 @@ const formData = useVModel(props, 'modelValue', emit);
draggable="false" draggable="false"
height="80px" height="80px"
width="100%" width="100%"
class="min-w-[80px]" class="min-w-20"
:show-description="false" :show-description="false"
> />
<template #tip> 建议宽度750 </template>
</UploadImg>
</FormItem> </FormItem>
<FormItem label="链接" prop="url"> <FormItem label="链接" prop="url">
<AppLinkInput v-model="formData.url" /> <AppLinkInput v-model="formData.url" />
@@ -42,5 +40,3 @@ const formData = useVModel(props, 'modelValue', emit);
</Form> </Form>
</ComponentContainerProperty> </ComponentContainerProperty>
</template> </template>
<style scoped lang="scss"></style>

View File

@@ -5,6 +5,8 @@ import { computed } from 'vue';
import { IconifyIcon } from '@vben/icons'; import { IconifyIcon } from '@vben/icons';
import { Image } from 'ant-design-vue';
/** 广告魔方 */ /** 广告魔方 */
defineOptions({ name: 'MagicCube' }); defineOptions({ name: 'MagicCube' });
const props = defineProps<{ property: MagicCubeProperty }>(); const props = defineProps<{ property: MagicCubeProperty }>();
@@ -78,5 +80,3 @@ const rowCount = computed(() => {
</div> </div>
</div> </div>
</template> </template>
<style scoped lang="scss"></style>

View File

@@ -4,7 +4,7 @@ import type { MagicCubeProperty } from './config';
import { ref } from 'vue'; import { ref } from 'vue';
import { useVModel } from '@vueuse/core'; import { useVModel } from '@vueuse/core';
import { Form, FormItem, Slider, Typography } from 'ant-design-vue'; import { Form, FormItem, Slider } from 'ant-design-vue';
import UploadImg from '#/components/upload/image-upload.vue'; import UploadImg from '#/components/upload/image-upload.vue';
import { import {
@@ -14,8 +14,6 @@ import {
import ComponentContainerProperty from '../../component-container-property.vue'; import ComponentContainerProperty from '../../component-container-property.vue';
const { Text: ATypographyText } = Typography;
/** 广告魔方属性面板 */ /** 广告魔方属性面板 */
defineOptions({ name: 'MagicCubeProperty' }); defineOptions({ name: 'MagicCubeProperty' });
@@ -36,8 +34,7 @@ const handleHotAreaSelected = (_: any, index: number) => {
<template> <template>
<ComponentContainerProperty v-model="formData.style"> <ComponentContainerProperty v-model="formData.style">
<Form :model="formData" class="mt-2"> <Form :model="formData" class="mt-2">
<ATypographyText tag="p"> 魔方设置 </ATypographyText> <p class="text-base font-bold">魔方设置</p>
<ATypographyText type="secondary" class="text-sm"> 每格尺寸187 * 187 </ATypographyText>
<MagicCubeEditor <MagicCubeEditor
class="my-4" class="my-4"
v-model="formData.list" v-model="formData.list"
@@ -61,11 +58,7 @@ const handleHotAreaSelected = (_: any, index: number) => {
</template> </template>
</template> </template>
<FormItem label="上圆角" name="borderRadiusTop"> <FormItem label="上圆角" name="borderRadiusTop">
<Slider <Slider v-model:value="formData.borderRadiusTop" :max="100" :min="0" />
v-model:value="formData.borderRadiusTop"
:max="100"
:min="0"
/>
</FormItem> </FormItem>
<FormItem label="下圆角" name="borderRadiusBottom"> <FormItem label="下圆角" name="borderRadiusBottom">
<Slider <Slider
@@ -75,11 +68,7 @@ const handleHotAreaSelected = (_: any, index: number) => {
/> />
</FormItem> </FormItem>
<FormItem label="间隔" name="space"> <FormItem label="间隔" name="space">
<Slider <Slider v-model:value="formData.space" :max="100" :min="0" />
v-model:value="formData.space"
:max="100"
:min="0"
/>
</FormItem> </FormItem>
</Form> </Form>
</ComponentContainerProperty> </ComponentContainerProperty>

View File

@@ -1,6 +1,8 @@
<script setup lang="ts"> <script setup lang="ts">
import type { MenuGridProperty } from './config'; import type { MenuGridProperty } from './config';
import { Image } from 'ant-design-vue';
/** 宫格导航 */ /** 宫格导航 */
defineOptions({ name: 'MenuGrid' }); defineOptions({ name: 'MenuGrid' });
defineProps<{ property: MenuGridProperty }>(); defineProps<{ property: MenuGridProperty }>();
@@ -11,13 +13,13 @@ defineProps<{ property: MenuGridProperty }>();
<div <div
v-for="(item, index) in property.list" v-for="(item, index) in property.list"
:key="index" :key="index"
class="relative flex flex-col items-center pb-3.5 pt-5" class="relative flex flex-col items-center pb-4 pt-4"
:style="{ width: `${100 * (1 / property.column)}%` }" :style="{ width: `${100 * (1 / property.column)}%` }"
> >
<!-- 右上角角标 --> <!-- 右上角角标 -->
<span <span
v-if="item.badge?.show" v-if="item.badge?.show"
class="absolute left-1/2 top-2.5 z-10 h-5 rounded-full px-1.5 text-center text-xs leading-5" class="absolute left-1/2 top-2 z-10 h-4 rounded-full px-2 text-center text-xs leading-5"
:style="{ :style="{
color: item.badge.textColor, color: item.badge.textColor,
backgroundColor: item.badge.bgColor, backgroundColor: item.badge.bgColor,
@@ -27,7 +29,7 @@ defineProps<{ property: MenuGridProperty }>();
</span> </span>
<Image <Image
v-if="item.iconUrl" v-if="item.iconUrl"
class="h-7 w-7" :width="32"
:src="item.iconUrl" :src="item.iconUrl"
:preview="false" :preview="false"
/> />
@@ -46,5 +48,3 @@ defineProps<{ property: MenuGridProperty }>();
</div> </div>
</div> </div>
</template> </template>
<style scoped lang="scss"></style>

View File

@@ -2,19 +2,16 @@
import type { MenuGridProperty } from './config'; import type { MenuGridProperty } from './config';
import { useVModel } from '@vueuse/core'; import { useVModel } from '@vueuse/core';
import { Form, FormItem, Radio, RadioGroup, Switch } from 'ant-design-vue';
import UploadImg from '#/components/upload/image-upload.vue';
import { import {
Card, AppLinkInput,
Form, ColorInput,
FormItem, Draggable,
Radio, } from '#/views/mall/promotion/components';
RadioGroup,
Switch,
} from 'ant-design-vue';
import ComponentContainerProperty from '../../component-container-property.vue'; import ComponentContainerProperty from '../../component-container-property.vue';
import UploadImg from '#/components/upload/image-upload.vue';
import { AppLinkInput, Draggable } from '#/views/mall/promotion/components';
import { EMPTY_MENU_GRID_ITEM_PROPERTY } from './config'; import { EMPTY_MENU_GRID_ITEM_PROPERTY } from './config';
/** 宫格导航属性面板 */ /** 宫格导航属性面板 */
@@ -36,7 +33,8 @@ const formData = useVModel(props, 'modelValue', emit);
</RadioGroup> </RadioGroup>
</FormItem> </FormItem>
<Card header="菜单设置" class="property-group" shadow="never"> <p class="text-base font-bold">菜单设置</p>
<div class="flex flex-col gap-2 rounded-md p-4 shadow-lg">
<Draggable <Draggable
v-model="formData.list" v-model="formData.list"
:empty-item="EMPTY_MENU_GRID_ITEM_PROPERTY" :empty-item="EMPTY_MENU_GRID_ITEM_PROPERTY"
@@ -53,13 +51,13 @@ const formData = useVModel(props, 'modelValue', emit);
</UploadImg> </UploadImg>
</FormItem> </FormItem>
<FormItem label="标题" prop="title"> <FormItem label="标题" prop="title">
<InputWithColor <ColorInput
v-model="element.title" v-model="element.title"
v-model:color="element.titleColor" v-model:color="element.titleColor"
/> />
</FormItem> </FormItem>
<FormItem label="副标题" prop="subtitle"> <FormItem label="副标题" prop="subtitle">
<InputWithColor <ColorInput
v-model="element.subtitle" v-model="element.subtitle"
v-model:color="element.subtitleColor" v-model:color="element.subtitleColor"
/> />
@@ -72,7 +70,7 @@ const formData = useVModel(props, 'modelValue', emit);
</FormItem> </FormItem>
<template v-if="element.badge.show"> <template v-if="element.badge.show">
<FormItem label="角标内容" prop="badge.text"> <FormItem label="角标内容" prop="badge.text">
<InputWithColor <ColorInput
v-model="element.badge.text" v-model="element.badge.text"
v-model:color="element.badge.textColor" v-model:color="element.badge.textColor"
/> />
@@ -83,9 +81,7 @@ const formData = useVModel(props, 'modelValue', emit);
</template> </template>
</template> </template>
</Draggable> </Draggable>
</Card> </div>
</Form> </Form>
</ComponentContainerProperty> </ComponentContainerProperty>
</template> </template>
<style scoped lang="scss"></style>

View File

@@ -11,30 +11,24 @@ defineProps<{ property: MenuListProperty }>();
</script> </script>
<template> <template>
<div class="flex min-h-[42px] flex-col"> <div class="flex min-h-10 flex-col">
<div <div
v-for="(item, index) in property.list" v-for="(item, index) in property.list"
:key="index" :key="index"
class="item flex h-[42px] flex-row items-center justify-between gap-1 px-3" class="flex h-10 flex-row items-center justify-between gap-1 border-t border-gray-200 px-3 first:border-t-0"
> >
<div class="flex flex-1 flex-row items-center gap-2"> <div class="flex flex-1 flex-row items-center gap-2">
<Image v-if="item.iconUrl" class="h-4 w-4" :src="item.iconUrl" /> <Image v-if="item.iconUrl" class="h-4 w-4" :src="item.iconUrl" />
<span class="text-base" :style="{ color: item.titleColor }">{{ <span class="text-base" :style="{ color: item.titleColor }">
item.title {{ item.title }}
}}</span> </span>
</div> </div>
<div class="item-center flex flex-row justify-center gap-1"> <div class="item-center flex flex-row justify-center gap-1">
<span class="text-xs" :style="{ color: item.subtitleColor }">{{ <span class="text-xs" :style="{ color: item.subtitleColor }">
item.subtitle {{ item.subtitle }}
}}</span> </span>
<IconifyIcon icon="ep:arrow-right" color="#000" :size="16" /> <IconifyIcon icon="lucide:arrow-right" class="size-4" />
</div> </div>
</div> </div>
</div> </div>
</template> </template>
<style scoped lang="scss">
.item + .item {
border-top: 1px solid #eee;
}
</style>

View File

@@ -2,7 +2,7 @@
import type { MenuListProperty } from './config'; import type { MenuListProperty } from './config';
import { useVModel } from '@vueuse/core'; import { useVModel } from '@vueuse/core';
import { Form, Typography } from 'ant-design-vue'; import { Form, FormItem } from 'ant-design-vue';
import UploadImg from '#/components/upload/image-upload.vue'; import UploadImg from '#/components/upload/image-upload.vue';
import { import {
@@ -14,8 +14,6 @@ import {
import ComponentContainerProperty from '../../component-container-property.vue'; import ComponentContainerProperty from '../../component-container-property.vue';
import { EMPTY_MENU_LIST_ITEM_PROPERTY } from './config'; import { EMPTY_MENU_LIST_ITEM_PROPERTY } from './config';
const { Text: ATypographyText } = Typography;
/** 列表导航属性面板 */ /** 列表导航属性面板 */
defineOptions({ name: 'MenuListProperty' }); defineOptions({ name: 'MenuListProperty' });
@@ -28,8 +26,7 @@ const formData = useVModel(props, 'modelValue', emit);
<template> <template>
<ComponentContainerProperty v-model="formData.style"> <ComponentContainerProperty v-model="formData.style">
<ATypographyText tag="p"> 菜单设置 </ATypographyText> <p class="text-base font-bold">菜单设置</p>
<ATypographyText type="secondary" class="text-sm"> 拖动左侧的小圆点可以调整顺序 </ATypographyText>
<Form :model="formData" class="mt-2"> <Form :model="formData" class="mt-2">
<Draggable <Draggable
v-model="formData.list" v-model="formData.list"
@@ -42,9 +39,8 @@ const formData = useVModel(props, 'modelValue', emit);
height="80px" height="80px"
width="80px" width="80px"
:show-description="false" :show-description="false"
> />
<template #tip> 建议尺寸44 * 44 </template> <p class="text-sm text-gray-500">建议尺寸44 * 44</p>
</UploadImg>
</FormItem> </FormItem>
<FormItem label="标题" name="title"> <FormItem label="标题" name="title">
<InputWithColor <InputWithColor

View File

@@ -3,6 +3,8 @@ import type { MenuSwiperItemProperty, MenuSwiperProperty } from './config';
import { ref, watch } from 'vue'; import { ref, watch } from 'vue';
import { Image } from 'ant-design-vue';
/** 菜单导航 */ /** 菜单导航 */
defineOptions({ name: 'MenuSwiper' }); defineOptions({ name: 'MenuSwiper' });
const props = defineProps<{ property: MenuSwiperProperty }>(); const props = defineProps<{ property: MenuSwiperProperty }>();
@@ -122,14 +124,14 @@ watch(
button { button {
width: 6px; width: 6px;
height: 6px; height: 6px;
background: #ff6000; background: hsl(var(--red));
border-radius: 6px; border-radius: 6px;
} }
} }
.ant-carousel-dot-active button { .ant-carousel-dot-active button {
width: 12px; width: 12px;
background: #ff6000; background: hsl(var(--red));
} }
} }
</style> </style>

View File

@@ -6,7 +6,14 @@ import type { Rect } from '#/views/mall/promotion/components/magic-cube-editor/u
import { computed, ref } from 'vue'; import { computed, ref } from 'vue';
import { useVModel } from '@vueuse/core'; import { useVModel } from '@vueuse/core';
import { FormItem, Input, Radio, RadioGroup, Slider } from 'ant-design-vue'; import {
FormItem,
Image,
Input,
Radio,
RadioGroup,
Slider,
} from 'ant-design-vue';
import appNavBarMp from '#/assets/imgs/diy/app-nav-bar-mp.png'; import appNavBarMp from '#/assets/imgs/diy/app-nav-bar-mp.png';
import UploadImg from '#/components/upload/image-upload.vue'; import UploadImg from '#/components/upload/image-upload.vue';
@@ -71,12 +78,7 @@ const handleHotAreaSelected = (
class="m-b-16px" class="m-b-16px"
@hot-area-selected="handleHotAreaSelected" @hot-area-selected="handleHotAreaSelected"
/> />
<img <Image v-if="isMp" alt="" class="w-19 h-8" :src="appNavBarMp" />
v-if="isMp"
alt=""
style="width: 76px; height: 30px"
:src="appNavBarMp"
/>
</div> </div>
<template v-for="(cell, cellIndex) in cellList" :key="cellIndex"> <template v-for="(cell, cellIndex) in cellList" :key="cellIndex">
<template v-if="selectedHotAreaIndex === Number(cellIndex)"> <template v-if="selectedHotAreaIndex === Number(cellIndex)">
@@ -105,12 +107,10 @@ const handleHotAreaSelected = (
<UploadImg <UploadImg
v-model="cell.imgUrl" v-model="cell.imgUrl"
:limit="1" :limit="1"
height="56px"
width="56px"
:show-description="false" :show-description="false"
> class="size-14"
<template #tip>建议尺寸 56*56</template> />
</UploadImg> <span class="text-xs text-gray-500">建议尺寸 56*56</span>
</FormItem> </FormItem>
<FormItem label="链接"> <FormItem label="链接">
<AppLinkInput v-model="cell.url" /> <AppLinkInput v-model="cell.url" />
@@ -128,5 +128,3 @@ const handleHotAreaSelected = (
</template> </template>
</template> </template>
</template> </template>
<style lang="scss" scoped></style>

View File

@@ -35,8 +35,8 @@ const cellList = computed(() =>
// 单元格宽度 // 单元格宽度
const cellWidth = computed(() => { const cellWidth = computed(() => {
return props.property._local?.previewMp return props.property._local?.previewMp
? (375 - 80 - 86) / 6 ? (384 - 80 - 86) / 6
: (375 - 90) / 8; : (384 - 90) / 8;
}); });
// 获得单元格样式 // 获得单元格样式
const getCellStyle = (cell: NavigationBarCellProperty) => { const getCellStyle = (cell: NavigationBarCellProperty) => {
@@ -78,7 +78,7 @@ const getSearchProp = computed(() => (cell: NavigationBarCellProperty) => {
v-if="property._local?.previewMp" v-if="property._local?.previewMp"
:src="appNavbarMp" :src="appNavbarMp"
alt="" alt=""
style="width: 86px; height: 30px" class="w-22 h-8"
/> />
</div> </div>
</template> </template>

View File

@@ -130,5 +130,3 @@ if (!formData.value._local) {
</Card> </Card>
</Form> </Form>
</template> </template>
<style scoped lang="scss"></style>

View File

@@ -19,7 +19,7 @@ export interface NoticeContentProperty {
export const component = { export const component = {
id: 'NoticeBar', id: 'NoticeBar',
name: '公告栏', name: '公告栏',
icon: 'ep:bell', icon: 'lucide:bell',
property: { property: {
iconUrl: 'http://mall.yudao.iocoder.cn/static/images/xinjian.png', iconUrl: 'http://mall.yudao.iocoder.cn/static/images/xinjian.png',
contents: [ contents: [

View File

@@ -33,7 +33,7 @@ setInterval(() => {
<div class="h-6 flex-1 truncate pr-2 leading-6"> <div class="h-6 flex-1 truncate pr-2 leading-6">
{{ property.contents?.[activeIndex]?.text }} {{ property.contents?.[activeIndex]?.text }}
</div> </div>
<IconifyIcon icon="ep:arrow-right" /> <IconifyIcon icon="lucide:arrow-right" />
</div> </div>
</template> </template>

View File

@@ -11,7 +11,7 @@ export interface PageConfigProperty {
export const component = { export const component = {
id: 'PageConfig', id: 'PageConfig',
name: '页面设置', name: '页面设置',
icon: 'ep:document', icon: 'lucide:file-text',
property: { property: {
description: '', description: '',
backgroundColor: '#f5f5f5', backgroundColor: '#f5f5f5',

View File

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

View File

@@ -32,7 +32,7 @@ watch(
* 计算商品的间距 * 计算商品的间距
* @param index 商品索引 * @param index 商品索引
*/ */
const calculateSpace = (index: number) => { function calculateSpace(index: number) {
// 商品的列数 // 商品的列数
const columns = props.property.layoutType === 'twoCol' ? 2 : 1; const columns = props.property.layoutType === 'twoCol' ? 2 : 1;
// 第一列没有左边距 // 第一列没有左边距
@@ -41,19 +41,19 @@ const calculateSpace = (index: number) => {
const marginTop = index < columns ? '0' : `${props.property.space}px`; const marginTop = index < columns ? '0' : `${props.property.space}px`;
return { marginLeft, marginTop }; return { marginLeft, marginTop };
}; }
// 容器 // 容器
const containerRef = ref(); const containerRef = ref();
// 计算商品的宽度 // 计算商品的宽度
const calculateWidth = () => { function calculateWidth() {
let width = '100%'; let width = '100%';
// 双列时每列的宽度为:(总宽度 - 间距)/ 2 // 双列时每列的宽度为:(总宽度 - 间距)/ 2
if (props.property.layoutType === 'twoCol') { if (props.property.layoutType === 'twoCol') {
width = `${(containerRef.value.offsetWidth - props.property.space) / 2}px`; width = `${(containerRef.value.offsetWidth - props.property.space) / 2}px`;
} }
return { width }; return { width };
}; }
</script> </script>
<template> <template>
<div <div
@@ -61,7 +61,7 @@ const calculateWidth = () => {
ref="containerRef" ref="containerRef"
> >
<div <div
class="relative box-content flex flex-row flex-wrap overflow-hidden bg-white" class="bg-card relative box-content flex flex-row flex-wrap overflow-hidden"
:style="{ :style="{
...calculateSpace(index), ...calculateSpace(index),
...calculateWidth(), ...calculateWidth(),
@@ -78,30 +78,26 @@ const calculateWidth = () => {
v-if="property.badge.show && property.badge.imgUrl" v-if="property.badge.show && property.badge.imgUrl"
class="absolute left-0 top-0 z-[1] items-center justify-center" class="absolute left-0 top-0 z-[1] items-center justify-center"
> >
<Image <Image fit="cover" :src="property.badge.imgUrl" class="h-6 w-8" />
fit="cover"
:src="property.badge.imgUrl"
class="h-[26px] w-[38px]"
/>
</div> </div>
<!-- 商品封面图 --> <!-- 商品封面图 -->
<div <div
class="h-[140px]" class="h-36"
:class="[ :class="[
{ {
'w-full': property.layoutType !== 'oneColSmallImg', 'w-full': property.layoutType !== 'oneColSmallImg',
'w-[140px]': property.layoutType === 'oneColSmallImg', 'w-36': property.layoutType === 'oneColSmallImg',
}, },
]" ]"
> >
<Image fit="cover" class="h-full w-full" :src="spu.picUrl" /> <Image fit="cover" class="h-full w-full" :src="spu.picUrl" />
</div> </div>
<div <div
class="box-border flex flex-col gap-[8px] p-[8px]" class="box-border flex flex-col gap-2 p-2"
:class="[ :class="[
{ {
'w-full': property.layoutType !== 'oneColSmallImg', 'w-full': property.layoutType !== 'oneColSmallImg',
'w-[calc(100%-140px-16px)]': 'w-[calc(100vh-140px-16px)]':
property.layoutType === 'oneColSmallImg', property.layoutType === 'oneColSmallImg',
}, },
]" ]"
@@ -109,7 +105,7 @@ const calculateWidth = () => {
<!-- 商品名称 --> <!-- 商品名称 -->
<div <div
v-if="property.fields.name.show" v-if="property.fields.name.show"
class="text-[14px]" class="text-sm"
:class="[ :class="[
{ {
truncate: property.layoutType !== 'oneColSmallImg', truncate: property.layoutType !== 'oneColSmallImg',
@@ -124,7 +120,7 @@ const calculateWidth = () => {
<!-- 商品简介 --> <!-- 商品简介 -->
<div <div
v-if="property.fields.introduction.show" v-if="property.fields.introduction.show"
class="truncate text-[12px]" class="truncate text-xs"
:style="{ color: property.fields.introduction.color }" :style="{ color: property.fields.introduction.color }"
> >
{{ spu.introduction }} {{ spu.introduction }}
@@ -133,7 +129,7 @@ const calculateWidth = () => {
<!-- 价格 --> <!-- 价格 -->
<span <span
v-if="property.fields.price.show" v-if="property.fields.price.show"
class="text-[16px]" class="text-base"
:style="{ color: property.fields.price.color }" :style="{ color: property.fields.price.color }"
> >
{{ fenToYuan(spu.price as any) }} {{ fenToYuan(spu.price as any) }}
@@ -141,12 +137,12 @@ const calculateWidth = () => {
<!-- 市场价 --> <!-- 市场价 -->
<span <span
v-if="property.fields.marketPrice.show && spu.marketPrice" v-if="property.fields.marketPrice.show && spu.marketPrice"
class="ml-[4px] text-[10px] line-through" class="ml-1 text-xs line-through"
:style="{ color: property.fields.marketPrice.color }" :style="{ color: property.fields.marketPrice.color }"
>{{ fenToYuan(spu.marketPrice) }} >{{ fenToYuan(spu.marketPrice) }}
</span> </span>
</div> </div>
<div class="text-[12px]"> <div class="text-xs">
<!-- 销量 --> <!-- 销量 -->
<span <span
v-if="property.fields.salesCount.show" v-if="property.fields.salesCount.show"
@@ -164,11 +160,11 @@ const calculateWidth = () => {
</div> </div>
</div> </div>
<!-- 购买按钮 --> <!-- 购买按钮 -->
<div class="absolute bottom-[8px] right-[8px]"> <div class="absolute bottom-2 right-2">
<!-- 文字按钮 --> <!-- 文字按钮 -->
<span <span
v-if="property.btnBuy.type === 'text'" v-if="property.btnBuy.type === 'text'"
class="rounded-full px-[12px] py-[4px] text-[12px] text-white" class="rounded-full px-3 py-1 text-sm text-white"
:style="{ :style="{
background: `linear-gradient(to right, ${property.btnBuy.bgBeginColor}, ${property.btnBuy.bgEndColor}`, background: `linear-gradient(to right, ${property.btnBuy.bgBeginColor}, ${property.btnBuy.bgEndColor}`,
}" }"
@@ -178,7 +174,7 @@ const calculateWidth = () => {
<!-- 图片按钮 --> <!-- 图片按钮 -->
<Image <Image
v-else v-else
class="h-[28px] w-[28px] rounded-full" class="size-7 rounded-full"
fit="cover" fit="cover"
:src="property.btnBuy.imgUrl" :src="property.btnBuy.imgUrl"
/> />
@@ -186,5 +182,3 @@ const calculateWidth = () => {
</div> </div>
</div> </div>
</template> </template>
<style scoped lang="scss"></style>

View File

@@ -44,17 +44,26 @@ const formData = useVModel(props, 'modelValue', emit);
<RadioGroup v-model:value="formData.layoutType"> <RadioGroup v-model:value="formData.layoutType">
<Tooltip title="单列大图" placement="bottom"> <Tooltip title="单列大图" placement="bottom">
<RadioButton value="oneColBigImg"> <RadioButton value="oneColBigImg">
<IconifyIcon icon="fluent:text-column-one-24-filled" /> <IconifyIcon
icon="fluent:text-column-one-24-filled"
class="size-6"
/>
</RadioButton> </RadioButton>
</Tooltip> </Tooltip>
<Tooltip title="单列小图" placement="bottom"> <Tooltip title="单列小图" placement="bottom">
<RadioButton value="oneColSmallImg"> <RadioButton value="oneColSmallImg">
<IconifyIcon icon="fluent:text-column-two-left-24-filled" /> <IconifyIcon
icon="fluent:text-column-two-left-24-filled"
class="size-6"
/>
</RadioButton> </RadioButton>
</Tooltip> </Tooltip>
<Tooltip title="双列" placement="bottom"> <Tooltip title="双列" placement="bottom">
<RadioButton value="twoCol"> <RadioButton value="twoCol">
<IconifyIcon icon="fluent:text-column-two-24-filled" /> <IconifyIcon
icon="fluent:text-column-two-24-filled"
class="size-6"
/>
</RadioButton> </RadioButton>
</Tooltip> </Tooltip>
</RadioGroup> </RadioGroup>
@@ -158,11 +167,7 @@ const formData = useVModel(props, 'modelValue', emit);
/> />
</FormItem> </FormItem>
<FormItem label="间隔" name="space"> <FormItem label="间隔" name="space">
<Slider <Slider v-model:value="formData.space" :max="100" :min="0" />
v-model:value="formData.space"
:max="100"
:min="0"
/>
</FormItem> </FormItem>
</Card> </Card>
</Form> </Form>

View File

@@ -7,6 +7,8 @@ import { onMounted, ref, watch } from 'vue';
import { fenToYuan } from '@vben/utils'; import { fenToYuan } from '@vben/utils';
import { Image } from 'ant-design-vue';
import { getSpuDetailList } from '#/api/mall/product/spu'; import { getSpuDetailList } from '#/api/mall/product/spu';
/** 商品栏 */ /** 商品栏 */
@@ -26,7 +28,7 @@ watch(
}, },
); );
// 手机宽度 // 手机宽度
const phoneWidth = ref(375); const phoneWidth = ref(384);
// 容器 // 容器
const containerRef = ref(); const containerRef = ref();
// 商品的列数 // 商品的列数
@@ -69,7 +71,7 @@ watch(
); );
onMounted(() => { onMounted(() => {
// 提取手机宽度 // 提取手机宽度
phoneWidth.value = containerRef.value?.wrapRef?.offsetWidth || 375; phoneWidth.value = containerRef.value?.wrapRef?.offsetWidth || 384;
}); });
</script> </script>
<template> <template>

View File

@@ -46,17 +46,23 @@ const formData = useVModel(props, 'modelValue', emit);
<RadioGroup v-model:value="formData.layoutType"> <RadioGroup v-model:value="formData.layoutType">
<Tooltip title="双列" placement="bottom"> <Tooltip title="双列" placement="bottom">
<RadioButton value="twoCol"> <RadioButton value="twoCol">
<IconifyIcon icon="fluent:text-column-two-24-filled" /> <IconifyIcon
icon="fluent:text-column-two-24-filled"
class="size-6"
/>
</RadioButton> </RadioButton>
</Tooltip> </Tooltip>
<Tooltip title="三列" placement="bottom"> <Tooltip title="三列" placement="bottom">
<RadioButton value="threeCol"> <RadioButton value="threeCol">
<IconifyIcon icon="fluent:text-column-three-24-filled" /> <IconifyIcon
icon="fluent:text-column-three-24-filled"
class="size-6"
/>
</RadioButton> </RadioButton>
</Tooltip> </Tooltip>
<Tooltip title="水平滑动" placement="bottom"> <Tooltip title="水平滑动" placement="bottom">
<RadioButton value="horizSwiper"> <RadioButton value="horizSwiper">
<IconifyIcon icon="system-uicons:carousel" /> <IconifyIcon icon="system-uicons:carousel" class="size-6" />
</RadioButton> </RadioButton>
</Tooltip> </Tooltip>
</RadioGroup> </RadioGroup>

View File

@@ -27,7 +27,5 @@ watch(
); );
</script> </script>
<template> <template>
<div class="min-h-[30px]" v-dompurify-html="article?.content"></div> <div class="min-h-8" v-dompurify-html="article?.content"></div>
</template> </template>
<style scoped lang="scss"></style>

View File

@@ -56,7 +56,7 @@ onMounted(() => {
filterable filterable
:loading="loading" :loading="loading"
:options=" :options="
articles.map((item) => ({ label: item.title, value: item.id })) articles.map((item: any) => ({ label: item.title, value: item.id }))
" "
@search="queryArticleList" @search="queryArticleList"
/> />
@@ -64,5 +64,3 @@ onMounted(() => {
</Form> </Form>
</ComponentContainerProperty> </ComponentContainerProperty>
</template> </template>
<style scoped lang="scss"></style>

View File

@@ -97,11 +97,11 @@ const calculateWidth = () => {
</script> </script>
<template> <template>
<div <div
class="box-content flex min-h-[30px] w-full flex-row flex-wrap" class="box-content flex min-h-8 w-full flex-row flex-wrap"
ref="containerRef" ref="containerRef"
> >
<div <div
class="relative box-content flex flex-row flex-wrap overflow-hidden bg-white" class="bg-card relative box-content flex flex-row flex-wrap overflow-hidden"
:style="{ :style="{
...calculateSpace(index), ...calculateSpace(index),
...calculateWidth(), ...calculateWidth(),
@@ -118,19 +118,15 @@ const calculateWidth = () => {
v-if="property.badge.show" v-if="property.badge.show"
class="absolute left-0 top-0 z-[1] items-center justify-center" class="absolute left-0 top-0 z-[1] items-center justify-center"
> >
<Image <Image fit="cover" :src="property.badge.imgUrl" class="h-6 w-8" />
fit="cover"
:src="property.badge.imgUrl"
class="h-[26px] w-[38px]"
/>
</div> </div>
<!-- 商品封面图 --> <!-- 商品封面图 -->
<div <div
class="h-[140px]" class="h-36"
:class="[ :class="[
{ {
'w-full': property.layoutType !== 'oneColSmallImg', 'w-full': property.layoutType !== 'oneColSmallImg',
'w-[140px]': property.layoutType === 'oneColSmallImg', 'w-36': property.layoutType === 'oneColSmallImg',
}, },
]" ]"
> >
@@ -141,7 +137,7 @@ const calculateWidth = () => {
:class="[ :class="[
{ {
'w-full': property.layoutType !== 'oneColSmallImg', 'w-full': property.layoutType !== 'oneColSmallImg',
'w-[calc(100%-140px-16px)]': 'w-[calc(100vw-36px-16px)]':
property.layoutType === 'oneColSmallImg', property.layoutType === 'oneColSmallImg',
}, },
]" ]"
@@ -149,7 +145,7 @@ const calculateWidth = () => {
<!-- 商品名称 --> <!-- 商品名称 -->
<div <div
v-if="property.fields.name.show" v-if="property.fields.name.show"
class="text-[14px]" class="text-sm"
:class="[ :class="[
{ {
truncate: property.layoutType !== 'oneColSmallImg', truncate: property.layoutType !== 'oneColSmallImg',
@@ -164,7 +160,7 @@ const calculateWidth = () => {
<!-- 商品简介 --> <!-- 商品简介 -->
<div <div
v-if="property.fields.introduction.show" v-if="property.fields.introduction.show"
class="truncate text-[12px]" class="truncate text-xs"
:style="{ color: property.fields.introduction.color }" :style="{ color: property.fields.introduction.color }"
> >
{{ spu.introduction }} {{ spu.introduction }}
@@ -173,7 +169,7 @@ const calculateWidth = () => {
<!-- 价格 --> <!-- 价格 -->
<span <span
v-if="property.fields.price.show" v-if="property.fields.price.show"
class="text-[16px]" class="text-base"
:style="{ color: property.fields.price.color }" :style="{ color: property.fields.price.color }"
> >
{{ fenToYuan(spu.price || Infinity) }} {{ fenToYuan(spu.price || Infinity) }}
@@ -181,13 +177,13 @@ const calculateWidth = () => {
<!-- 市场价 --> <!-- 市场价 -->
<span <span
v-if="property.fields.marketPrice.show && spu.marketPrice" v-if="property.fields.marketPrice.show && spu.marketPrice"
class="ml-[4px] text-[10px] line-through" class="ml-1 text-xs line-through"
:style="{ color: property.fields.marketPrice.color }" :style="{ color: property.fields.marketPrice.color }"
> >
{{ fenToYuan(spu.marketPrice) }} {{ fenToYuan(spu.marketPrice) }}
</span> </span>
</div> </div>
<div class="text-[12px]"> <div class="text-xs">
<!-- 销量 --> <!-- 销量 -->
<span <span
v-if="property.fields.salesCount.show" v-if="property.fields.salesCount.show"
@@ -205,11 +201,11 @@ const calculateWidth = () => {
</div> </div>
</div> </div>
<!-- 购买按钮 --> <!-- 购买按钮 -->
<div class="absolute bottom-[8px] right-[8px]"> <div class="absolute bottom-2 right-2">
<!-- 文字按钮 --> <!-- 文字按钮 -->
<span <span
v-if="property.btnBuy.type === 'text'" v-if="property.btnBuy.type === 'text'"
class="rounded-full px-[12px] py-[4px] text-[12px] text-white" class="rounded-full px-3 py-1 text-sm text-white"
:style="{ :style="{
background: `linear-gradient(to right, ${property.btnBuy.bgBeginColor}, ${property.btnBuy.bgEndColor}`, background: `linear-gradient(to right, ${property.btnBuy.bgBeginColor}, ${property.btnBuy.bgEndColor}`,
}" }"
@@ -219,7 +215,7 @@ const calculateWidth = () => {
<!-- 图片按钮 --> <!-- 图片按钮 -->
<Image <Image
v-else v-else
class="h-[28px] w-[28px] rounded-full" class="size-7 rounded-full"
fit="cover" fit="cover"
:src="property.btnBuy.imgUrl" :src="property.btnBuy.imgUrl"
/> />
@@ -227,5 +223,3 @@ const calculateWidth = () => {
</div> </div>
</div> </div>
</template> </template>
<style scoped lang="scss"></style>

View File

@@ -60,17 +60,26 @@ onMounted(async () => {
<RadioGroup v-model:value="formData.layoutType"> <RadioGroup v-model:value="formData.layoutType">
<Tooltip title="单列大图" placement="bottom"> <Tooltip title="单列大图" placement="bottom">
<RadioButton value="oneColBigImg"> <RadioButton value="oneColBigImg">
<IconifyIcon icon="fluent:text-column-one-24-filled" /> <IconifyIcon
icon="fluent:text-column-one-24-filled"
class="size-6"
/>
</RadioButton> </RadioButton>
</Tooltip> </Tooltip>
<Tooltip title="单列小图" placement="bottom"> <Tooltip title="单列小图" placement="bottom">
<RadioButton value="oneColSmallImg"> <RadioButton value="oneColSmallImg">
<IconifyIcon icon="fluent:text-column-two-left-24-filled" /> <IconifyIcon
icon="fluent:text-column-two-left-24-filled"
class="size-6"
/>
</RadioButton> </RadioButton>
</Tooltip> </Tooltip>
<Tooltip title="双列" placement="bottom"> <Tooltip title="双列" placement="bottom">
<RadioButton value="twoCol"> <RadioButton value="twoCol">
<IconifyIcon icon="fluent:text-column-two-24-filled" /> <IconifyIcon
icon="fluent:text-column-two-24-filled"
class="size-6"
/>
</RadioButton> </RadioButton>
</Tooltip> </Tooltip>
</RadioGroup> </RadioGroup>

View File

@@ -95,7 +95,7 @@ const calculateWidth = () => {
<template> <template>
<div <div
ref="containerRef" ref="containerRef"
class="box-content flex min-h-[30px] w-full flex-row flex-wrap" class="box-content flex min-h-9 w-full flex-row flex-wrap"
> >
<div <div
v-for="(spu, index) in spuList" v-for="(spu, index) in spuList"
@@ -108,26 +108,22 @@ const calculateWidth = () => {
borderBottomLeftRadius: `${property.borderRadiusBottom}px`, borderBottomLeftRadius: `${property.borderRadiusBottom}px`,
borderBottomRightRadius: `${property.borderRadiusBottom}px`, borderBottomRightRadius: `${property.borderRadiusBottom}px`,
}" }"
class="relative box-content flex flex-row flex-wrap overflow-hidden bg-white" class="bg-card relative box-content flex flex-row flex-wrap overflow-hidden"
> >
<!-- 角标 --> <!-- 角标 -->
<div <div
v-if="property.badge.show" v-if="property.badge.show"
class="absolute left-0 top-0 z-[1] items-center justify-center" class="absolute left-0 top-0 z-[1] items-center justify-center"
> >
<Image <Image :src="property.badge.imgUrl" class="h-6 w-10" fit="cover" />
:src="property.badge.imgUrl"
class="h-[26px] w-[38px]"
fit="cover"
/>
</div> </div>
<!-- 商品封面图 --> <!-- 商品封面图 -->
<div <div
class="h-[140px]" class="h-36"
:class="[ :class="[
{ {
'w-full': property.layoutType !== 'oneColSmallImg', 'w-full': property.layoutType !== 'oneColSmallImg',
'w-[140px]': property.layoutType === 'oneColSmallImg', 'w-36': property.layoutType === 'oneColSmallImg',
}, },
]" ]"
> >
@@ -146,7 +142,7 @@ const calculateWidth = () => {
<!-- 商品名称 --> <!-- 商品名称 -->
<div <div
v-if="property.fields.name.show" v-if="property.fields.name.show"
class="text-[14px]" class="text-sm"
:class="[ :class="[
{ {
truncate: property.layoutType !== 'oneColSmallImg', truncate: property.layoutType !== 'oneColSmallImg',
@@ -162,7 +158,7 @@ const calculateWidth = () => {
<div <div
v-if="property.fields.introduction.show" v-if="property.fields.introduction.show"
:style="{ color: property.fields.introduction.color }" :style="{ color: property.fields.introduction.color }"
class="truncate text-[12px]" class="truncate text-xs"
> >
{{ spu.introduction }} {{ spu.introduction }}
</div> </div>
@@ -171,7 +167,7 @@ const calculateWidth = () => {
<span <span
v-if="property.fields.price.show" v-if="property.fields.price.show"
:style="{ color: property.fields.price.color }" :style="{ color: property.fields.price.color }"
class="text-[16px]" class="text-base"
> >
{{ spu.point }}积分 {{ spu.point }}积分
{{ {{
@@ -184,12 +180,12 @@ const calculateWidth = () => {
<span <span
v-if="property.fields.marketPrice.show && spu.marketPrice" v-if="property.fields.marketPrice.show && spu.marketPrice"
:style="{ color: property.fields.marketPrice.color }" :style="{ color: property.fields.marketPrice.color }"
class="ml-[4px] text-[10px] line-through" class="ml-1 text-xs line-through"
> >
{{ fenToYuan(spu.marketPrice) }} {{ fenToYuan(spu.marketPrice) }}
</span> </span>
</div> </div>
<div class="text-[12px]"> <div class="text-xs">
<!-- 销量 --> <!-- 销量 -->
<span <span
v-if="property.fields.salesCount.show" v-if="property.fields.salesCount.show"
@@ -207,14 +203,14 @@ const calculateWidth = () => {
</div> </div>
</div> </div>
<!-- 购买按钮 --> <!-- 购买按钮 -->
<div class="absolute bottom-[8px] right-[8px]"> <div class="absolute bottom-2 right-2">
<!-- 文字按钮 --> <!-- 文字按钮 -->
<span <span
v-if="property.btnBuy.type === 'text'" v-if="property.btnBuy.type === 'text'"
:style="{ :style="{
background: `linear-gradient(to right, ${property.btnBuy.bgBeginColor}, ${property.btnBuy.bgEndColor}`, background: `linear-gradient(to right, ${property.btnBuy.bgBeginColor}, ${property.btnBuy.bgEndColor}`,
}" }"
class="rounded-full px-[12px] py-[4px] text-[12px] text-white" class="rounded-full px-3 py-1 text-sm text-white"
> >
{{ property.btnBuy.text }} {{ property.btnBuy.text }}
</span> </span>
@@ -222,12 +218,10 @@ const calculateWidth = () => {
<Image <Image
v-else v-else
:src="property.btnBuy.imgUrl" :src="property.btnBuy.imgUrl"
class="h-[28px] w-[28px] rounded-full" class="size-7 rounded-full"
fit="cover" fit="cover"
/> />
</div> </div>
</div> </div>
</div> </div>
</template> </template>
<style lang="scss" scoped></style>

View File

@@ -42,17 +42,26 @@ const formData = useVModel(props, 'modelValue', emit);
<RadioGroup v-model:value="formData.layoutType"> <RadioGroup v-model:value="formData.layoutType">
<Tooltip title="单列大图" placement="bottom"> <Tooltip title="单列大图" placement="bottom">
<RadioButton value="oneColBigImg"> <RadioButton value="oneColBigImg">
<IconifyIcon icon="fluent:text-column-one-24-filled" /> <IconifyIcon
icon="fluent:text-column-one-24-filled"
class="size-6"
/>
</RadioButton> </RadioButton>
</Tooltip> </Tooltip>
<Tooltip title="单列小图" placement="bottom"> <Tooltip title="单列小图" placement="bottom">
<RadioButton value="oneColSmallImg"> <RadioButton value="oneColSmallImg">
<IconifyIcon icon="fluent:text-column-two-left-24-filled" /> <IconifyIcon
icon="fluent:text-column-two-left-24-filled"
class="size-6"
/>
</RadioButton> </RadioButton>
</Tooltip> </Tooltip>
<Tooltip title="双列" placement="bottom"> <Tooltip title="双列" placement="bottom">
<RadioButton value="twoCol"> <RadioButton value="twoCol">
<IconifyIcon icon="fluent:text-column-two-24-filled" /> <IconifyIcon
icon="fluent:text-column-two-24-filled"
class="size-6"
/>
</RadioButton> </RadioButton>
</Tooltip> </Tooltip>
</RadioGroup> </RadioGroup>
@@ -156,11 +165,7 @@ const formData = useVModel(props, 'modelValue', emit);
/> />
</FormItem> </FormItem>
<FormItem label="间隔" name="space"> <FormItem label="间隔" name="space">
<Slider <Slider v-model:value="formData.space" :max="100" :min="0" />
v-model:value="formData.space"
:max="100"
:min="0"
/>
</FormItem> </FormItem>
</Card> </Card>
</Form> </Form>

View File

@@ -95,11 +95,11 @@ const calculateWidth = () => {
</script> </script>
<template> <template>
<div <div
class="box-content flex min-h-[30px] w-full flex-row flex-wrap" class="box-content flex min-h-9 w-full flex-row flex-wrap"
ref="containerRef" ref="containerRef"
> >
<div <div
class="relative box-content flex flex-row flex-wrap overflow-hidden bg-white" class="bg-card relative box-content flex flex-row flex-wrap overflow-hidden"
:style="{ :style="{
...calculateSpace(index), ...calculateSpace(index),
...calculateWidth(), ...calculateWidth(),
@@ -116,19 +116,15 @@ const calculateWidth = () => {
v-if="property.badge.show" v-if="property.badge.show"
class="absolute left-0 top-0 z-[1] items-center justify-center" class="absolute left-0 top-0 z-[1] items-center justify-center"
> >
<Image <Image fit="cover" :src="property.badge.imgUrl" class="h-6 w-8" />
fit="cover"
:src="property.badge.imgUrl"
class="h-[26px] w-[38px]"
/>
</div> </div>
<!-- 商品封面图 --> <!-- 商品封面图 -->
<div <div
class="h-[140px]" class="h-36"
:class="[ :class="[
{ {
'w-full': property.layoutType !== 'oneColSmallImg', 'w-full': property.layoutType !== 'oneColSmallImg',
'w-[140px]': property.layoutType === 'oneColSmallImg', 'w-36': property.layoutType === 'oneColSmallImg',
}, },
]" ]"
> >
@@ -139,7 +135,7 @@ const calculateWidth = () => {
:class="[ :class="[
{ {
'w-full': property.layoutType !== 'oneColSmallImg', 'w-full': property.layoutType !== 'oneColSmallImg',
'w-[calc(100%-140px-16px)]': 'w-[calc(100vw-140px-16px)]':
property.layoutType === 'oneColSmallImg', property.layoutType === 'oneColSmallImg',
}, },
]" ]"
@@ -179,7 +175,7 @@ const calculateWidth = () => {
<!-- 市场价 --> <!-- 市场价 -->
<span <span
v-if="property.fields.marketPrice.show && spu.marketPrice" v-if="property.fields.marketPrice.show && spu.marketPrice"
class="ml-1 text-[10px] line-through" class="ml-1 text-xs line-through"
:style="{ color: property.fields.marketPrice.color }" :style="{ color: property.fields.marketPrice.color }"
> >
{{ fenToYuan(spu.marketPrice) }} {{ fenToYuan(spu.marketPrice) }}
@@ -217,7 +213,7 @@ const calculateWidth = () => {
<!-- 图片按钮 --> <!-- 图片按钮 -->
<Image <Image
v-else v-else
class="h-7 w-7 rounded-full" class="size-7 rounded-full"
fit="cover" fit="cover"
:src="property.btnBuy.imgUrl" :src="property.btnBuy.imgUrl"
/> />
@@ -225,5 +221,3 @@ const calculateWidth = () => {
</div> </div>
</div> </div>
</template> </template>
<style scoped lang="scss"></style>

View File

@@ -19,7 +19,8 @@ import {
import UploadImg from '#/components/upload/image-upload.vue'; import UploadImg from '#/components/upload/image-upload.vue';
import { ColorInput } from '#/views/mall/promotion/components'; import { ColorInput } from '#/views/mall/promotion/components';
import { SeckillShowcase } from '#/views/mall/promotion/seckill/components'; // TODO: 添加组件
// import { SeckillShowcase } from '#/views/mall/promotion/seckill/components';
import ComponentContainerProperty from '../../component-container-property.vue'; import ComponentContainerProperty from '../../component-container-property.vue';
@@ -44,17 +45,26 @@ const formData = useVModel(props, 'modelValue', emit);
<RadioGroup v-model:value="formData.layoutType"> <RadioGroup v-model:value="formData.layoutType">
<Tooltip title="单列大图" placement="bottom"> <Tooltip title="单列大图" placement="bottom">
<RadioButton value="oneColBigImg"> <RadioButton value="oneColBigImg">
<IconifyIcon icon="fluent:text-column-one-24-filled" /> <IconifyIcon
icon="fluent:text-column-one-24-filled"
class="size-6"
/>
</RadioButton> </RadioButton>
</Tooltip> </Tooltip>
<Tooltip title="单列小图" placement="bottom"> <Tooltip title="单列小图" placement="bottom">
<RadioButton value="oneColSmallImg"> <RadioButton value="oneColSmallImg">
<IconifyIcon icon="fluent:text-column-two-left-24-filled" /> <IconifyIcon
icon="fluent:text-column-two-left-24-filled"
class="size-6"
/>
</RadioButton> </RadioButton>
</Tooltip> </Tooltip>
<Tooltip title="双列" placement="bottom"> <Tooltip title="双列" placement="bottom">
<RadioButton value="twoCol"> <RadioButton value="twoCol">
<IconifyIcon icon="fluent:text-column-two-24-filled" /> <IconifyIcon
icon="fluent:text-column-two-24-filled"
class="size-6"
/>
</RadioButton> </RadioButton>
</Tooltip> </Tooltip>
</RadioGroup> </RadioGroup>
@@ -158,11 +168,7 @@ const formData = useVModel(props, 'modelValue', emit);
/> />
</FormItem> </FormItem>
<FormItem label="间隔" name="space"> <FormItem label="间隔" name="space">
<Slider <Slider v-model:value="formData.space" :max="100" :min="0" />
v-model:value="formData.space"
:max="100"
:min="0"
/>
</FormItem> </FormItem>
</Card> </Card>
</Form> </Form>

View File

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

View File

@@ -30,19 +30,16 @@ defineProps<{ property: SearchProperty }>();
justifyContent: property.placeholderPosition, justifyContent: property.placeholderPosition,
}" }"
> >
<IconifyIcon icon="ep:search" /> <IconifyIcon icon="lucide:search" />
<span>{{ property.placeholder || '搜索商品' }}</span> <span>{{ property.placeholder || '搜索商品' }}</span>
</div> </div>
<div class="right"> <div class="right">
<!-- 搜索热词 --> <!-- 搜索热词 -->
<span v-for="(keyword, index) in property.hotKeywords" :key="index">{{ <span v-for="(keyword, index) in property.hotKeywords" :key="index">
keyword {{ keyword }}
}}</span> </span>
<!-- 扫一扫 --> <!-- 扫一扫 -->
<IconifyIcon <IconifyIcon icon="lucide:scan-barcode" v-show="property.showScan" />
icon="ant-design:scan-outlined"
v-show="property.showScan"
/>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -70,12 +70,12 @@ watch(
<RadioGroup v-model:value="formData!.borderRadius"> <RadioGroup v-model:value="formData!.borderRadius">
<Tooltip title="方形" placement="top"> <Tooltip title="方形" placement="top">
<RadioButton :value="0"> <RadioButton :value="0">
<IconifyIcon icon="tabler:input-search" /> <IconifyIcon icon="tabler:input-search" class="size-6" />
</RadioButton> </RadioButton>
</Tooltip> </Tooltip>
<Tooltip title="圆形" placement="top"> <Tooltip title="圆形" placement="top">
<RadioButton :value="10"> <RadioButton :value="10">
<IconifyIcon icon="iconoir:input-search" /> <IconifyIcon icon="iconoir:input-search" class="size-6" />
</RadioButton> </RadioButton>
</Tooltip> </Tooltip>
</RadioGroup> </RadioGroup>
@@ -87,12 +87,18 @@ watch(
<RadioGroup v-model:value="formData!.placeholderPosition"> <RadioGroup v-model:value="formData!.placeholderPosition">
<Tooltip title="居左" placement="top"> <Tooltip title="居左" placement="top">
<RadioButton value="left"> <RadioButton value="left">
<IconifyIcon icon="ant-design:align-left-outlined" /> <IconifyIcon
icon="ant-design:align-left-outlined"
class="size-6"
/>
</RadioButton> </RadioButton>
</Tooltip> </Tooltip>
<Tooltip title="居中" placement="top"> <Tooltip title="居中" placement="top">
<RadioButton value="center"> <RadioButton value="center">
<IconifyIcon icon="ant-design:align-center-outlined" /> <IconifyIcon
icon="ant-design:align-center-outlined"
class="size-6"
/>
</RadioButton> </RadioButton>
</Tooltip> </Tooltip>
</RadioGroup> </RadioGroup>
@@ -101,11 +107,7 @@ watch(
<Switch v-model:checked="formData!.showScan" /> <Switch v-model:checked="formData!.showScan" />
</FormItem> </FormItem>
<FormItem label="框体高度" name="height"> <FormItem label="框体高度" name="height">
<Slider <Slider v-model:value="formData!.height" :max="50" :min="28" />
v-model:value="formData!.height"
:max="50"
:min="28"
/>
</FormItem> </FormItem>
<FormItem label="框体颜色" name="backgroundColor"> <FormItem label="框体颜色" name="backgroundColor">
<ColorInput v-model="formData.backgroundColor" /> <ColorInput v-model="formData.backgroundColor" />

View File

@@ -31,7 +31,7 @@ defineProps<{ property: TabBarProperty }>();
<Image :src="index === 0 ? item.activeIconUrl : item.iconUrl"> <Image :src="index === 0 ? item.activeIconUrl : item.iconUrl">
<template #error> <template #error>
<div class="flex h-full w-full items-center justify-center"> <div class="flex h-full w-full items-center justify-center">
<IconifyIcon icon="ep:picture" /> <IconifyIcon icon="lucide:image" />
</div> </div>
</template> </template>
</Image> </Image>

View File

@@ -60,7 +60,10 @@ defineProps<{ property: TitleBarProperty }>();
<span v-if="property.more.type !== 'icon'"> <span v-if="property.more.type !== 'icon'">
{{ property.more.text }} {{ property.more.text }}
</span> </span>
<IconifyIcon icon="ep:arrow-right" v-if="property.more.type !== 'text'" /> <IconifyIcon
icon="lucide:arrow-right"
v-if="property.more.type !== 'text'"
/>
</div> </div>
</div> </div>
</template> </template>

View File

@@ -54,29 +54,27 @@ const rules = {}; // 表单校验
<RadioGroup v-model:value="formData!.textAlign"> <RadioGroup v-model:value="formData!.textAlign">
<Tooltip title="居左" placement="top"> <Tooltip title="居左" placement="top">
<RadioButton value="left"> <RadioButton value="left">
<IconifyIcon icon="ant-design:align-left-outlined" /> <IconifyIcon
icon="ant-design:align-left-outlined"
class="size-6"
/>
</RadioButton> </RadioButton>
</Tooltip> </Tooltip>
<Tooltip title="居中" placement="top"> <Tooltip title="居中" placement="top">
<RadioButton value="center"> <RadioButton value="center">
<IconifyIcon icon="ant-design:align-center-outlined" /> <IconifyIcon
icon="ant-design:align-center-outlined"
class="size-6"
/>
</RadioButton> </RadioButton>
</Tooltip> </Tooltip>
</RadioGroup> </RadioGroup>
</FormItem> </FormItem>
<FormItem label="偏移量" name="marginLeft"> <FormItem label="偏移量" name="marginLeft">
<Slider <Slider v-model:value="formData.marginLeft" :max="100" :min="0" />
v-model:value="formData.marginLeft"
:max="100"
:min="0"
/>
</FormItem> </FormItem>
<FormItem label="高度" name="height"> <FormItem label="高度" name="height">
<Slider <Slider v-model:value="formData.height" :max="200" :min="20" />
v-model:value="formData.height"
:max="200"
:min="20"
/>
</FormItem> </FormItem>
</Card> </Card>
<Card title="主标题" class="property-group"> <Card title="主标题" class="property-group">
@@ -89,11 +87,7 @@ const rules = {}; // 表单校验
/> />
</FormItem> </FormItem>
<FormItem label="大小" name="titleSize"> <FormItem label="大小" name="titleSize">
<Slider <Slider v-model:value="formData.titleSize" :max="60" :min="10" />
v-model:value="formData.titleSize"
:max="60"
:min="10"
/>
</FormItem> </FormItem>
<FormItem label="粗细" name="titleWeight"> <FormItem label="粗细" name="titleWeight">
<Slider <Slider

View File

@@ -3,6 +3,8 @@ import type { UserCardProperty } from './config';
import { IconifyIcon } from '@vben/icons'; import { IconifyIcon } from '@vben/icons';
import { Avatar } from 'ant-design-vue';
/** 用户卡片 */ /** 用户卡片 */
defineOptions({ name: 'UserCard' }); defineOptions({ name: 'UserCard' });
// 定义属性 // 定义属性
@@ -10,24 +12,20 @@ defineProps<{ property: UserCardProperty }>();
</script> </script>
<template> <template>
<div class="flex flex-col"> <div class="flex flex-col">
<div class="flex items-center justify-between px-[18px] py-[24px]"> <div class="flex items-center justify-between px-4 py-6">
<div class="flex flex-1 items-center gap-[16px]"> <div class="flex flex-1 items-center gap-4">
<Avatar :size="60"> <Avatar class="size-14">
<IconifyIcon icon="ep:avatar" :size="60" /> <IconifyIcon icon="lucide:user" class="size-14" />
</Avatar> </Avatar>
<span class="text-[18px] font-bold">芋道源码</span> <span class="text-lg font-bold">芋道源码</span>
</div> </div>
<IconifyIcon icon="tdesign:qrcode" :size="20" /> <IconifyIcon icon="lucide:qr-code" class="size-5" />
</div> </div>
<div <div class="bg-card flex items-center justify-between px-5 py-2 text-xs">
class="flex items-center justify-between bg-white px-[20px] py-[8px] text-[12px]" <span class="text-orange-500">点击绑定手机号</span>
> <span class="rounded-lg bg-orange-500 px-2 py-1 text-white">
<span class="text-[#ff690d]">点击绑定手机号</span>
<span class="rounded-[26px] bg-[#ff6100] px-[8px] py-[5px] text-white">
去绑定 去绑定
</span> </span>
</div> </div>
</div> </div>
</template> </template>
<style scoped lang="scss"></style>

View File

@@ -16,5 +16,3 @@ const formData = useVModel(props, 'modelValue', emit);
<template> <template>
<ComponentContainerProperty v-model="formData.style" /> <ComponentContainerProperty v-model="formData.style" />
</template> </template>
<style scoped lang="scss"></style>

View File

@@ -10,7 +10,7 @@ export interface UserCouponProperty {
export const component = { export const component = {
id: 'UserCoupon', id: 'UserCoupon',
name: '用户卡券', name: '用户卡券',
icon: 'ep:ticket', icon: 'lucide:ticket',
property: { property: {
style: { style: {
bgType: 'color', bgType: 'color',

View File

@@ -1,6 +1,8 @@
<script setup lang="ts"> <script setup lang="ts">
import type { UserCouponProperty } from './config'; import type { UserCouponProperty } from './config';
import { Image } from 'ant-design-vue';
/** 用户卡券 */ /** 用户卡券 */
defineOptions({ name: 'UserCoupon' }); defineOptions({ name: 'UserCoupon' });
// 定义属性 // 定义属性
@@ -11,5 +13,3 @@ defineProps<{ property: UserCouponProperty }>();
src="https://shopro.sheepjs.com/admin/static/images/shop/decorate/couponCardStyle.png" src="https://shopro.sheepjs.com/admin/static/images/shop/decorate/couponCardStyle.png"
/> />
</template> </template>
<style scoped lang="scss"></style>

View File

@@ -16,5 +16,3 @@ const formData = useVModel(props, 'modelValue', emit);
<template> <template>
<ComponentContainerProperty v-model="formData.style" /> <ComponentContainerProperty v-model="formData.style" />
</template> </template>
<style scoped lang="scss"></style>

View File

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

View File

@@ -1,6 +1,8 @@
<script setup lang="ts"> <script setup lang="ts">
import type { UserOrderProperty } from './config'; import type { UserOrderProperty } from './config';
import { Image } from 'ant-design-vue';
/** 用户订单 */ /** 用户订单 */
defineOptions({ name: 'UserOrder' }); defineOptions({ name: 'UserOrder' });
// 定义属性 // 定义属性
@@ -11,5 +13,3 @@ defineProps<{ property: UserOrderProperty }>();
src="https://shopro.sheepjs.com/admin/static/images/shop/decorate/orderCardStyle.png" src="https://shopro.sheepjs.com/admin/static/images/shop/decorate/orderCardStyle.png"
/> />
</template> </template>
<style scoped lang="scss"></style>

View File

@@ -16,5 +16,3 @@ const formData = useVModel(props, 'modelValue', emit);
<template> <template>
<ComponentContainerProperty v-model="formData.style" /> <ComponentContainerProperty v-model="formData.style" />
</template> </template>
<style scoped lang="scss"></style>

View File

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

View File

@@ -1,6 +1,8 @@
<script setup lang="ts"> <script setup lang="ts">
import type { UserWalletProperty } from './config'; import type { UserWalletProperty } from './config';
import { Image } from 'ant-design-vue';
/** 用户资产 */ /** 用户资产 */
defineOptions({ name: 'UserWallet' }); defineOptions({ name: 'UserWallet' });
// 定义属性 // 定义属性
@@ -11,5 +13,3 @@ defineProps<{ property: UserWalletProperty }>();
src="https://shopro.sheepjs.com/admin/static/images/shop/decorate/walletCardStyle.png" src="https://shopro.sheepjs.com/admin/static/images/shop/decorate/walletCardStyle.png"
/> />
</template> </template>
<style scoped lang="scss"></style>

Some files were not shown because too many files have changed in this diff Show More