From da34633b25d16359cd91a656acad5e811f9972b7 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 14 三月 2023 18:09:54 +0800 Subject: [PATCH] 2023-03-14 --- src/menu/components/card/cardcellcomponent/dragaction/card.jsx | 43 ++++++++++++++++++++++++++++++++----------- 1 files changed, 32 insertions(+), 11 deletions(-) diff --git a/src/menu/components/card/cardcellcomponent/dragaction/card.jsx b/src/menu/components/card/cardcellcomponent/dragaction/card.jsx index 92e5b0e..8069bcf 100644 --- a/src/menu/components/card/cardcellcomponent/dragaction/card.jsx +++ b/src/menu/components/card/cardcellcomponent/dragaction/card.jsx @@ -57,10 +57,10 @@ }, }) - let _style = {opacity: isDragging ? 0 : 1} + let _style = {opacity: isDragging ? 0.3 : 1} if (card.style) { - _style = {...card.style, opacity: isDragging ? 0 : 1} + _style = {...card.style, opacity: isDragging ? 0.3 : 1} _style = resetStyle(_style) } if (card.eleType === 'picture' && card.maxWidth) { @@ -101,21 +101,23 @@ // </div> // ) } else if (card.eleType === 'picture') { - let _imagestyle = {} + let _imagestyle = { + backgroundSize: card.style.backgroundSize || 'cover', + backgroundPosition: card.style.backgroundPosition || 'center', + backgroundRepeat: card.style.backgroundRepeat || 'no-repeat', + borderRadius: card.style.borderRadius || 0 + } let url = card.url !== '@icon@' ? card.url : sessionStorage.getItem('CloudAvatar') if (url) { - _imagestyle = {backgroundImage: `url('${url}')`} + url = url.replace(/@mywebsite@\//ig, window.GLOB.baseurl) + _imagestyle.backgroundImage = `url('${url}')` } else { let index = card.uuid.match(/\d{1}/g) index = index.slice(-1)[0] % 5 let demos = [demo1, demo2, demo3, demo4, demo5] - _imagestyle = {backgroundImage: `url('${demos[index]}')`} - } - - if (card.style && card.style.borderRadius) { - _imagestyle.borderRadius = card.style.borderRadius + _imagestyle.backgroundImage = `url('${demos[index]}')` } if (PicRadio[card.lenWidRadio]) { @@ -175,6 +177,19 @@ {val} </div> ) + } else if (card.eleType === 'color') { + _style.overflow = 'hidden' + let _bgstyle = {backgroundColor: card.value || '#1890ff'} + + if (PicRadio[card.lenWidRadio]) { + _bgstyle.paddingTop = PicRadio[card.lenWidRadio] + } else { + _bgstyle.paddingTop = '100%' + } + + return ( + <div style={_bgstyle}></div> + ) } } @@ -186,8 +201,14 @@ } let able = true - if ((appType === 'mob' || appType === 'pc') && (parent.setting.click === 'menu' || parent.setting.click === 'menus')) { + if ((appType === 'mob' || appType === 'pc') && parent.setting && (parent.setting.click === 'menu' || parent.setting.click === 'menus')) { able = false + } + + let _style_ = null + + if (card.style && card.style.clear === 'left') { + _style_ = {clear: 'left'} } return ( @@ -200,7 +221,7 @@ {['text', 'number', 'slider', 'sequence', 'formula'].includes(card.eleType) ? <MarkColumn field={card.field || ''} columns={fields} type={card.eleType} marks={card.marks} onSubmit={(vals) => updateMarks({...card, marks: vals})} /> : null } </div> } trigger="hover"> - <div ref={node => drag(drop(node))} className={'ant-col card-cell ant-col-' + card.width}> + <div ref={node => drag(drop(node))} style={_style_} className={'ant-col card-cell ant-col-' + card.width}> <div style={_style} onClick={clickComponent} onDoubleClick={() => able && editCard(id)} id={card.uuid}> {getContent()} </div> -- Gitblit v1.8.0