From 1da6506bf58270bacc2a4345002c6b082835580e Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 21 十月 2021 23:17:08 +0800 Subject: [PATCH] 2021-10-21 --- src/templates/sharecomponent/searchcomponent/dragsearch/index.jsx | 11 ++++++++--- 1 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/templates/sharecomponent/searchcomponent/dragsearch/index.jsx b/src/templates/sharecomponent/searchcomponent/dragsearch/index.jsx index d65fdec..06a1df7 100644 --- a/src/templates/sharecomponent/searchcomponent/dragsearch/index.jsx +++ b/src/templates/sharecomponent/searchcomponent/dragsearch/index.jsx @@ -7,7 +7,7 @@ import Card from './card' import './index.scss' -const Container = ({list, placeholder, showField, handleList, handleMenu, deleteMenu }) => { +const Container = ({list, show, placeholder, showField, handleList, handleMenu, deleteMenu }) => { const [cards, setCards] = useState(list) const moveCard = (id, atIndex) => { const { card, index } = findCard(id) @@ -52,7 +52,7 @@ try { _val.uuid = Utils.getuuid() _val = window.btoa(window.encodeURIComponent(JSON.stringify(_val))) - } catch { + } catch (e) { console.warn('Stringify Failure') _val = '' } @@ -123,6 +123,11 @@ } }) + let radio = 6 + if (cards.length > 0) { + radio = cards[cards.length - 1].ratio || 6 + } + return ( <div ref={drop} className="ant-row"> {cards.map(card => ( @@ -139,7 +144,7 @@ /> </Col> ))} - {cards.length > 0 ? <Col key="action" className="action" span={6}> + {cards.length > 0 && show !== 'false' ? <Col key="action" className="action" span={radio < 6 ? 6 : radio}> <div className="ant-row ant-form-item" style={{whiteSpace: 'nowrap', lineHeight: '40px', height: '55px', marginBottom: 0}}> <div className="ant-col ant-form-item-label ant-col-xs-24 ant-col-sm-8"> </div> -- Gitblit v1.8.0