| | |
| | | import './index.scss' |
| | | |
| | | const CardItem = asyncComponent(() => import('../cardItem')) |
| | | const NormalHeader = asyncComponent(() => import('@/tabviews/custom/components/share/normalheader')) |
| | | |
| | | class PropCard extends Component { |
| | | static propTpyes = { |
| | |
| | | _cols.set(item.field, item) |
| | | }) |
| | | |
| | | if (!_config.wrap.height) { // 兼容 |
| | | _config.wrap.height = _config.style.height || '300px' |
| | | delete _config.style.height |
| | | } |
| | | |
| | | _config.subcards.forEach(card => { |
| | | card.style.height = _config.style.height |
| | | card.style.height = _config.wrap.height |
| | | if (card.setting.click) { |
| | | card.style.cursor = 'pointer' |
| | | } |
| | |
| | | } |
| | | |
| | | componentDidMount () { |
| | | const { config } = this.state |
| | | const { config, sync } = this.state |
| | | |
| | | MKEmitter.addListener('reloadData', this.reloadData) |
| | | MKEmitter.addListener('resetSelectLine', this.resetParentParam) |
| | |
| | | this.timer = new TimerTask() |
| | | this.timer.init(config.uuid, config.timer, config.timerRepeats, () => { |
| | | this.loadData('timer') |
| | | }) |
| | | } |
| | | |
| | | if (config.$cache && (config.setting.sync !== 'true' || sync)) { |
| | | Api.getLCacheConfig(config.uuid).then(res => { |
| | | if (!res) return |
| | | |
| | | let _data = res[0] |
| | | _data.$$uuid = _data[config.setting.primaryKey] || '' |
| | | |
| | | this.setState({data: _data}) |
| | | }) |
| | | } |
| | | } |
| | |
| | | this.openModal() |
| | | } |
| | | }) |
| | | } else if (config.setting.syncRefresh && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | } else if (config.setting.useMSearch && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | this.setState({}, () => { |
| | | this.loadData() |
| | | }) |
| | |
| | | if (result.status) { |
| | | let _data = {} |
| | | |
| | | if (config.$cache) { |
| | | Api.writeCacheConfig(config.uuid, result.data || '') |
| | | } |
| | | |
| | | if (!result.data || !result.data[0]) { |
| | | _data.$$empty = true |
| | | } else { |
| | |
| | | destroyOnClose |
| | | > |
| | | <div className="custom-prop-carousel-box" style={config.style}> |
| | | {config.subcards.length > 1 && config.wrap.autoplay === 'false' ? <div className="prev" onClick={() => this.node && this.node.prev()}><LeftOutlined /></div> : null} |
| | | {config.subcards.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} |
| | | > |
| | | {config.subcards.map((item, index) => ( |
| | | <div key={index}> |
| | | <CardItem card={item} cards={config} data={data}/> |
| | | </div> |
| | | ))} |
| | | </Carousel> |
| | | <NormalHeader config={config}/> |
| | | <div className="carousel-wrap" style={{height: config.wrap.height}}> |
| | | {config.subcards.length > 1 && config.wrap.autoplay === 'false' ? <div className="prev" onClick={() => this.node && this.node.prev()}><LeftOutlined /></div> : null} |
| | | {config.subcards.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} |
| | | > |
| | | {config.subcards.map((item, index) => ( |
| | | <div key={index}> |
| | | <CardItem card={item} cards={config} data={data}/> |
| | | </div> |
| | | ))} |
| | | </Carousel> |
| | | </div> |
| | | </div> |
| | | {config.wrap.modalContent !== 'update' ? <div className="mk-footer"> |
| | | <Checkbox defaultChecked={false} onChange={this.onTipChange}>不在提醒</Checkbox> |
| | |
| | | <Spin /> |
| | | </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} |
| | | > |
| | | {config.subcards.map((item, index) => ( |
| | | <div key={index}> |
| | | <CardItem card={item} cards={config} data={data}/> |
| | | </div> |
| | | ))} |
| | | </Carousel> |
| | | <NormalHeader config={config}/> |
| | | <div className="carousel-wrap" style={{height: config.wrap.height}}> |
| | | <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} |
| | | > |
| | | {config.subcards.map((item, index) => ( |
| | | <div key={index}> |
| | | <CardItem card={item} cards={config} data={data}/> |
| | | </div> |
| | | ))} |
| | | </Carousel> |
| | | </div> |
| | | </div> |
| | | ) |
| | | } |