king
2022-11-14 5ec0f02101cb4255c6398856bbf17a2a0b2c9a7e
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>
    )
  }