From 5ec0f02101cb4255c6398856bbf17a2a0b2c9a7e Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 14 十一月 2022 17:33:55 +0800 Subject: [PATCH] 2022-11-14 --- src/tabviews/custom/components/carousel/data-card/index.jsx | 73 ++++++++++++++++++++---------------- 1 files changed, 40 insertions(+), 33 deletions(-) diff --git a/src/tabviews/custom/components/carousel/data-card/index.jsx b/src/tabviews/custom/components/carousel/data-card/index.jsx index 723b495..90a5d5b 100644 --- a/src/tabviews/custom/components/carousel/data-card/index.jsx +++ b/src/tabviews/custom/components/carousel/data-card/index.jsx @@ -12,6 +12,7 @@ import './index.scss' const CardItem = asyncComponent(() => import('../cardItem')) +const NormalHeader = asyncComponent(() => import('@/tabviews/custom/components/share/normalheader')) class DataCard extends Component { static propTpyes = { @@ -76,8 +77,6 @@ _cols.set(item.field, item) }) - _card.style.height = _config.style.height - if (_card.setting.click) { _card.style.cursor = 'pointer' } @@ -88,6 +87,9 @@ } return item }) + + _card.style.height = _config.wrap.height + _config.style.height = 'auto' _config.wrap.speed = (_config.wrap.speed || 3) * 1000 @@ -329,23 +331,26 @@ footer={null} destroyOnClose > - {data && data.length > 0 ? <div className="custom-data-carousel-box" style={config.style}> - {data.length > 1 && config.wrap.autoplay === 'false' ? <div className="prev" onClick={() => this.node && this.node.prev()}><LeftOutlined /></div> : null} - {data.length > 1 && config.wrap.autoplay === 'false' ? <div className="next" onClick={() => this.node && this.node.next()}><RightOutlined /></div> : null} - <Carousel - autoplay={config.wrap.autoplay !== 'false'} - dots={config.wrap.dots !== 'false'} - dotPosition={config.wrap.dotPosition || 'bottom'} - effect={config.wrap.effect || 'scrollx'} - autoplaySpeed={config.wrap.speed} - ref={ref => this.node = ref} - > - {data.map((item, index) => ( - <div key={index}> - <CardItem card={card} cards={config} data={item}/> - </div> - ))} - </Carousel> + {visible ? <div className="custom-data-carousel-box" style={config.style}> + <NormalHeader config={config}/> + <div className="carousel-wrap" style={{height: config.wrap.height}}> + {data.length > 1 && config.wrap.autoplay === 'false' ? <div className="prev" onClick={() => this.node && this.node.prev()}><LeftOutlined /></div> : null} + {data.length > 1 && config.wrap.autoplay === 'false' ? <div className="next" onClick={() => this.node && this.node.next()}><RightOutlined /></div> : null} + <Carousel + autoplay={config.wrap.autoplay !== 'false'} + dots={config.wrap.dots !== 'false'} + dotPosition={config.wrap.dotPosition || 'bottom'} + effect={config.wrap.effect || 'scrollx'} + autoplaySpeed={config.wrap.speed} + ref={ref => this.node = ref} + > + {data.map((item, index) => ( + <div key={index}> + <CardItem card={card} cards={config} data={item}/> + </div> + ))} + </Carousel> + </div> </div> : null} {config.wrap.modalContent !== 'update' ? <div className="mk-footer"> <Checkbox defaultChecked={false} onChange={this.onTipChange}>涓嶅湪鎻愰啋</Checkbox> @@ -364,20 +369,22 @@ <Spin /> </div> : null } - {data && data.length > 0 ? <Carousel - autoplay={config.wrap.autoplay !== 'false'} - dots={config.wrap.dots !== 'false'} - dotPosition={config.wrap.dotPosition || 'bottom'} - effect={config.wrap.effect || 'scrollx'} - autoplaySpeed={config.wrap.speed} - > - {data.map((item, index) => ( - <div key={index}> - <CardItem card={card} cards={config} data={item}/> - </div> - ))} - </Carousel> : null} - {!data || data.length === 0 ? <Empty description={false}/> : null} + <NormalHeader config={config}/> + <div className="carousel-wrap" style={{height: config.wrap.height}}> + {data && data.length > 0 ? <Carousel + autoplay={config.wrap.autoplay !== 'false'} + dots={config.wrap.dots !== 'false'} + dotPosition={config.wrap.dotPosition || 'bottom'} + effect={config.wrap.effect || 'scrollx'} + autoplaySpeed={config.wrap.speed} + > + {data.map((item, index) => ( + <div key={index}> + <CardItem card={card} cards={config} data={item}/> + </div> + ))} + </Carousel> : <Empty description={false}/>} + </div> </div> ) } -- Gitblit v1.8.0