| | |
| | | const ShareCode = asyncComponent(() => import('@/mob/components/sharecode')) |
| | | const Iframe = asyncComponent(() => import('@/menu/components/iframe')) |
| | | |
| | | const Card = ({ id, card, moveCard, findCard, delCard, updateConfig }) => { |
| | | const Card = ({ id, card, moveCard, findCard, delCard, unGroup, updateConfig }) => { |
| | | const originalIndex = findCard(id).index |
| | | const [{ isDragging }, drag] = useDrag({ |
| | | item: { type: 'menu', id, originalIndex }, |
| | |
| | | } |
| | | |
| | | let col = 'ant-col-' + (card.width || 24) |
| | | if (card.type === 'login') { |
| | | let height = '' |
| | | if (card.wrap && card.wrap.height) { |
| | | // scaleview |
| | | height = card.wrap.height.replace(/\d+vw/ig, (word) => { |
| | | return parseFloat(word) * (window.GLOB.winWidth || 420) / 100 + 'px' |
| | | // return parseFloat(word) * 350 / 100 + 'px' |
| | | }).replace(/\d+vh/ig, (word) => { |
| | | return parseFloat(word) * (window.GLOB.winHeight || 738) / 100 + 'px' |
| | | // return parseFloat(word) * 615 / 100 + 'px' |
| | | }) |
| | | } |
| | | // if (card.type === 'login') { |
| | | // let height = '' |
| | | // if (card.wrap && card.wrap.height) { |
| | | // // scaleview |
| | | // height = card.wrap.height.replace(/\d+vw/ig, (word) => { |
| | | // return parseFloat(word) * (window.GLOB.winWidth || 420) / 100 + 'px' |
| | | // // return parseFloat(word) * 350 / 100 + 'px' |
| | | // }).replace(/\d+vh/ig, (word) => { |
| | | // return parseFloat(word) * (window.GLOB.winHeight || 738) / 100 + 'px' |
| | | // // return parseFloat(word) * 615 / 100 + 'px' |
| | | // }) |
| | | // } |
| | | |
| | | style.minHeight = height |
| | | } |
| | | // style.minHeight = height |
| | | // } |
| | | |
| | | const getCardComponent = () => { |
| | | if (card.type === 'bar' || card.type === 'line') { |
| | |
| | | } else if (card.type === 'table' && card.subtype === 'normaltable') { |
| | | return (<NormalTable card={card} updateConfig={updateConfig} deletecomponent={delCard}/>) |
| | | } else if (card.type === 'group' && card.subtype === 'normalgroup') { |
| | | return (<NormalGroup group={card} updateConfig={updateConfig} deletecomponent={delCard}/>) |
| | | return (<NormalGroup group={card} updateConfig={updateConfig} unGroup={unGroup} deletecomponent={delCard}/>) |
| | | } else if (card.type === 'code') { |
| | | return (<CodeSandbox card={card} updateConfig={updateConfig} deletecomponent={delCard}/>) |
| | | } else if (card.type === 'editor') { |