| | |
| | | pageSize: 12, |
| | | filpictures: [], |
| | | filvideos: [], |
| | | colorlist: [], |
| | | piclist: [], |
| | | vidlist: [], |
| | | picIndex: 1, |
| | |
| | | trigger = () => { |
| | | let pictures = sessionStorage.getItem('app_pictures') |
| | | let videos = sessionStorage.getItem('app_videos') |
| | | let colorlist = sessionStorage.getItem('app_colors') |
| | | |
| | | try { |
| | | pictures = JSON.parse(pictures) |
| | | videos = JSON.parse(videos) |
| | | colorlist = JSON.parse(colorlist) |
| | | } catch { |
| | | pictures = [] |
| | | videos = [] |
| | | colorlist = [] |
| | | } |
| | | |
| | | let filpictures = pictures |
| | |
| | | videoKey: '', |
| | | piclist, |
| | | vidlist, |
| | | colorlist, |
| | | videos |
| | | }) |
| | | } |
| | |
| | | if (card.typecharone === 'image') { |
| | | sessionStorage.setItem('app_pictures', JSON.stringify(result.data || [])) |
| | | this.resetPicture(result.data || []) |
| | | } else { |
| | | } else if (card.typecharone === 'video') { |
| | | sessionStorage.setItem('app_videos', JSON.stringify(result.data || [])) |
| | | this.resetVideo(result.data || []) |
| | | } else if (card.typecharone === 'color') { |
| | | sessionStorage.setItem('app_colors', JSON.stringify(result.data || [])) |
| | | this.resetColor(result.data || []) |
| | | } |
| | | this.setState({editvisible: false}) |
| | | } else { |
| | |
| | | if (item.typecharone === 'image') { |
| | | sessionStorage.setItem('app_pictures', JSON.stringify(res.data || [])) |
| | | _this.resetPicture(res.data || []) |
| | | } else { |
| | | } else if (item.typecharone === 'video') { |
| | | sessionStorage.setItem('app_videos', JSON.stringify(res.data || [])) |
| | | _this.resetVideo(res.data || []) |
| | | } else if (item.typecharone === 'color') { |
| | | sessionStorage.setItem('app_colors', JSON.stringify(res.data || [])) |
| | | _this.resetColor(res.data || []) |
| | | } |
| | | } else { |
| | | notification.warning({ |
| | |
| | | let vidlist = filvideos.filter((item, index) => index < pageSize) |
| | | |
| | | this.setState({vidIndex: 1, filvideos, vidlist, videos: data}) |
| | | } |
| | | |
| | | resetColor = (data) => { |
| | | this.setState({colorlist: data}) |
| | | } |
| | | |
| | | filterPicture = () => { |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { visible, editvisible, card, filpictures, filvideos, piclist, vidlist, imageKey, videoKey, pageSize, picIndex, vidIndex } = this.state |
| | | const { visible, editvisible, card, filpictures, filvideos, piclist, vidlist, imageKey, videoKey, pageSize, picIndex, vidIndex, colorlist } = this.state |
| | | |
| | | return ( |
| | | <div style={{display: 'inline-block'}}> |
| | |
| | | </Row> |
| | | {filvideos.length > pageSize ? <Pagination size="small" current={vidIndex} pageSize={pageSize} onChange={this.changeVidSize} total={filvideos.length} /> : null} |
| | | </TabPane> |
| | | <TabPane tab="颜色管理" key="color"> |
| | | <Row style={{marginBottom: '15px'}}> |
| | | <Col span={24}> |
| | | 可添加应用中常用的颜色,可以是英文代码、HEX格式、RGB格式,最多可添加25种。 |
| | | {colorlist.length < 25 ? <Button className="picture-plus mk-green" icon="plus" onClick={() => this.handleSource({typecharone: 'color'})}> |
| | | 添加 |
| | | </Button> : null} |
| | | </Col> |
| | | </Row> |
| | | <Row gutter={16} style={{height: '340px'}}> |
| | | {colorlist.length > 0 && colorlist.map(item => ( |
| | | <Col span={4} key={item.id}> |
| | | <div className="image-video-box"> |
| | | <div className="image-video-box-body" style={{background: item.linkurl}}> |
| | | </div> |
| | | <div className="image-video-control"> |
| | | <Icon type="copy" onClick={() => this.copySource(item)}/> |
| | | <Icon type="delete" onClick={() => this.deleteSource(item)}/> |
| | | </div> |
| | | </div> |
| | | <p className="image-video-remark">{item.remark}</p> |
| | | </Col> |
| | | ))} |
| | | {!colorlist.length ? <Empty description={null}/> : null} |
| | | </Row> |
| | | </TabPane> |
| | | </Tabs> |
| | | </Modal> |
| | | <Modal |