| | |
| | | import Card from './card' |
| | | import './index.scss' |
| | | |
| | | const Container = ({list, showField, handleList, handleMenu, deleteMenu }) => { |
| | | const Container = ({list, setting, handleList, handleMenu, deleteMenu }) => { |
| | | const [cards, setCards] = useState(list) |
| | | const moveCard = (id, atIndex) => { |
| | | const { card, index } = findCard(id) |
| | |
| | | drop() {} |
| | | }) |
| | | |
| | | const appType = sessionStorage.getItem('appType') |
| | | let labelwidth = setting.searchLwidth !== undefined ? setting.searchLwidth : 33.3 |
| | | let advanceType = setting.advanceType || 'modal' |
| | | |
| | | return ( |
| | | <div ref={drop} className="ant-row"> |
| | | {cards.length > 0 ? <Col key="preaction" className="action pre-action" span={6}> |
| | | <div className="ant-row ant-form-item" style={{lineHeight: '40px', height: '55px', marginBottom: 0}}> |
| | | <div className="ant-col ant-form-item-label ant-col-xs-24 ant-col-sm-8"> |
| | | </div> |
| | | <div className="ant-col ant-form-item-control-wrapper ant-col-xs-24 ant-col-sm-16" style={{whiteSpace: 'nowrap'}}> |
| | | <Button type="primary">搜索</Button> |
| | | {appType !== 'mob' ? <Button style={{ marginLeft: 8 }}>重置</Button> : null} |
| | | <div style={{position: 'absolute', top: 0, bottom: 0, left: 0, right: 0}}></div> |
| | | </div> |
| | | </div> |
| | | </Col> : null} |
| | | {cards.map(card => ( |
| | | <Col key={card.uuid} span={card.ratio || 6}> |
| | | {cards.map(card => { |
| | | let _ratio = card.ratio || 6 |
| | | if (card.advanced === 'true' && advanceType !== 'pulldown') { |
| | | _ratio = 6 |
| | | } |
| | | return ( |
| | | <Col className="mk-search-item-wrap" key={card.uuid} span={_ratio}> |
| | | <Card |
| | | id={`${card.uuid}`} |
| | | card={card} |
| | | showField={showField} |
| | | moveCard={moveCard} |
| | | copyCard={copyCard} |
| | | editCard={editCard} |
| | |
| | | findCard={findCard} |
| | | /> |
| | | </Col> |
| | | ))} |
| | | {cards.length > 0 ? <Col key="nextaction" className="action next-action" span={6}> |
| | | ) |
| | | })} |
| | | {cards.length > 0 ? <Col key="nextaction" className={'mk-search-item-wrap action' + (setting.show === 'false' ? ' hide-button' : '')} span={setting.searchRatio || 6}> |
| | | <div className="ant-row ant-form-item" style={{lineHeight: '40px', height: '55px', marginBottom: 0}}> |
| | | <div className="ant-col ant-form-item-label ant-col-xs-24 ant-col-sm-8"> |
| | | </div> |
| | | <div className="ant-col ant-form-item-control-wrapper ant-col-xs-24 ant-col-sm-16" style={{whiteSpace: 'nowrap'}}> |
| | | <div className="ant-col ant-form-item-label" style={{width: labelwidth + '%'}}></div> |
| | | <div className="ant-col ant-form-item-control-wrapper" style={{whiteSpace: 'nowrap'}}> |
| | | <Button type="primary">搜索</Button> |
| | | {appType !== 'mob' ? <Button style={{ marginLeft: 8 }}>重置</Button> : null} |
| | | <Button style={{ marginLeft: 8 }}>重置</Button> |
| | | <div style={{position: 'absolute', top: 0, bottom: 0, left: 0, right: 0}}></div> |
| | | </div> |
| | | </div> |