From 91e232bb0b910f3670bdbccd65cc218d55e1eda9 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 06 十二月 2022 16:08:20 +0800 Subject: [PATCH] Merge branch 'develop' --- src/menu/menushell/card.jsx | 44 +++++++++++++++++++++++++++++++++----------- 1 files changed, 33 insertions(+), 11 deletions(-) diff --git a/src/menu/menushell/card.jsx b/src/menu/menushell/card.jsx index 8195ed1..3af7dc8 100644 --- a/src/menu/menushell/card.jsx +++ b/src/menu/menushell/card.jsx @@ -19,16 +19,22 @@ const TableCard = asyncComponent(() => import('@/menu/components/card/table-card')) const NormalTable = asyncComponent(() => import('@/menu/components/table/normal-table')) const EditTable = asyncComponent(() => import('@/menu/components/table/edit-table')) -const NormalForm = asyncComponent(() => import('@/menu/components/form/normal-form')) +const SimpleForm = asyncComponent(() => import('@/menu/components/form/simple-form')) +const StepForm = asyncComponent(() => import('@/menu/components/form/step-form')) const TabForm = asyncComponent(() => import('@/menu/components/form/tab-form')) const NormalGroup = asyncComponent(() => import('@/menu/components/group/normal-group')) const BraftEditor = asyncComponent(() => import('@/menu/components/editor/braft-editor')) const CodeSandbox = asyncComponent(() => import('@/menu/components/code/sandbox')) +const CustomChart = asyncComponent(() => import('@/menu/components/chart/chart-custom')) +const Timeline = asyncComponent(() => import('@/menu/components/timeline/normal-timeline')) +const Voucher = asyncComponent(() => import('@/menu/components/module/voucher')) +const Iframe = asyncComponent(() => import('@/menu/components/iframe')) +const AntvG6 = asyncComponent(() => import('@/menu/components/chart/antv-G6')) const Card = ({ id, card, moveCard, findCard, delCard, updateConfig }) => { const originalIndex = findCard(id).index const [{ isDragging }, drag] = useDrag({ - item: { type: 'menu', id, originalIndex, floor: card.floor }, + item: { type: 'menu', id, originalIndex }, collect: monitor => ({ isDragging: monitor.isDragging(), }), @@ -37,10 +43,10 @@ accept: 'menu', canDrop: () => true, drop: (item) => { - const { id: draggedId, originalIndex, floor } = item + const { id: draggedId, originalIndex } = item if (originalIndex === undefined) { item.dropTargetId = id - } else if (draggedId && floor === card.floor) { + } else if (draggedId) { if (draggedId === id) return const { index: originIndex } = findCard(draggedId) @@ -58,8 +64,16 @@ style = { opacity: 0.3} } + if (card.style && card.style.clear === 'left') { + style.clear = 'left' + } + const getCardComponent = () => { - if (card.type === 'bar' || card.type === 'line') { + if (card.type === 'card' && card.subtype === 'datacard') { + return (<DataCard card={card} updateConfig={updateConfig} deletecomponent={delCard}/>) + } else if (card.type === 'card' && card.subtype === 'propcard') { + return (<PropCard card={card} updateConfig={updateConfig} deletecomponent={delCard}/>) + } else if (card.type === 'bar' || card.type === 'line') { return (<AntvBar card={card} updateConfig={updateConfig} deletecomponent={delCard}/>) } else if (card.type === 'search') { return (<MainSearch card={card} updateConfig={updateConfig} deletecomponent={delCard}/>) @@ -71,21 +85,19 @@ return (<NormalTree card={card} updateConfig={updateConfig} deletecomponent={delCard}/>) } else if (card.type === 'scatter') { return (<AntvScatter card={card} updateConfig={updateConfig} deletecomponent={delCard}/>) + } else if (card.type === 'form' && card.subtype === 'simpleform') { + return (<SimpleForm card={card} updateConfig={updateConfig} deletecomponent={delCard}/>) } else if (card.type === 'form' && card.subtype === 'stepform') { - return (<NormalForm card={card} updateConfig={updateConfig} deletecomponent={delCard}/>) + return (<StepForm card={card} updateConfig={updateConfig} deletecomponent={delCard}/>) } else if (card.type === 'form' && card.subtype === 'tabform') { return (<TabForm card={card} updateConfig={updateConfig} deletecomponent={delCard}/>) } else if (card.type === 'tabs') { return (<AntvTabs tabs={card} updateConfig={updateConfig} deletecomponent={delCard}/>) - } else if (card.type === 'card' && card.subtype === 'datacard') { - return (<DataCard card={card} updateConfig={updateConfig} deletecomponent={delCard}/>) - } else if (card.type === 'card' && card.subtype === 'propcard') { - return (<PropCard card={card} updateConfig={updateConfig} deletecomponent={delCard}/>) } else if (card.type === 'carousel' && card.subtype === 'datacard') { return (<CarouselDataCard card={card} updateConfig={updateConfig} deletecomponent={delCard}/>) } else if (card.type === 'carousel' && card.subtype === 'propcard') { return (<CarouselPropCard card={card} updateConfig={updateConfig} deletecomponent={delCard}/>) - } else if (card.type === 'table' && card.subtype === 'tablecard') { + } else if (card.type === 'card' && card.subtype === 'tablecard') { return (<TableCard card={card} updateConfig={updateConfig} deletecomponent={delCard}/>) } else if (card.type === 'table' && card.subtype === 'normaltable') { return (<NormalTable card={card} updateConfig={updateConfig} deletecomponent={delCard}/>) @@ -99,6 +111,16 @@ return (<CodeSandbox card={card} updateConfig={updateConfig} deletecomponent={delCard}/>) } else if (card.type === 'balcony') { return (<Balcony card={card} updateConfig={updateConfig} deletecomponent={delCard}/>) + } else if (card.type === 'timeline') { + return (<Timeline card={card} updateConfig={updateConfig} deletecomponent={delCard}/>) + } else if (card.type === 'chart') { + return (<CustomChart card={card} updateConfig={updateConfig} deletecomponent={delCard}/>) + } else if (card.type === 'iframe') { + return (<Iframe card={card} updateConfig={updateConfig} deletecomponent={delCard}/>) + } else if (card.type === 'antvG6') { + return (<AntvG6 card={card} updateConfig={updateConfig} deletecomponent={delCard}/>) + } else if (card.type === 'module' && card.subtype === 'voucher') { + return (<Voucher card={card} updateConfig={updateConfig} deletecomponent={delCard}/>) } } return ( -- Gitblit v1.8.0