| | |
| | | const PopupButton = asyncComponent(() => import('@/tabviews/zshare/actionList/popupbutton')) |
| | | const TabButton = asyncComponent(() => import('@/tabviews/zshare/actionList/tabbutton')) |
| | | const NewPageButton = asyncComponent(() => import('@/tabviews/zshare/actionList/newpagebutton')) |
| | | const ImgScale = asyncComponent(() => import('@/tabviews/zshare/imgScale')) |
| | | |
| | | class NormalTable extends Component { |
| | | static propTpyes = { |
| | |
| | | pageSize: 10, // 每页数据条数 |
| | | columns: null, // 显示列 |
| | | imgShow: false, // 图片放大模态框 |
| | | imgSrc: '', // 图片路径 |
| | | imgData: {}, // 图片集 |
| | | lineMarks: null, // 行标记 |
| | | activeIndex: null, // 标记当前选中行 |
| | | rowspans: null // 行合并字段信息 |
| | |
| | | if (item.rowspan === 'true') { |
| | | rowspans.push(item.field) |
| | | } |
| | | if (_format && !Math.floor(Math.random() * radio)) { |
| | | if (item.type === 'index') { |
| | | item.field = '$Index' |
| | | item.type = 'text' |
| | | } else if (_format && !Math.floor(Math.random() * radio)) { |
| | | item.blur = true |
| | | } |
| | | |
| | |
| | | render: (text, record) => { |
| | | return this.getContent(item, record) |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (item.fixed === true || item.fixed === 'true') { |
| | | if (index < columns.length / 2) { |
| | | cell.fixed = 'left' |
| | | } else { |
| | | cell.fixed = 'right' |
| | | } |
| | | } |
| | | |
| | |
| | | let photos = '' |
| | | if (item.field && record.hasOwnProperty(item.field)) { |
| | | photos = record[item.field] + '' |
| | | photos = photos.split(',') |
| | | photos = photos.split(',').filter(Boolean) |
| | | } else { |
| | | photos = '' |
| | | } |
| | |
| | | <div className="picture-col"> |
| | | {photos && photos.map((url, i) => { |
| | | if (item.scale === 'true') { |
| | | return <img style={{maxHeight: maxHeight}} className="image-scale" onClick={this.imgScale} key={`${i}`} src={url} alt=""/> |
| | | return <img style={{maxHeight: maxHeight}} className="image-scale" onClick={() => this.imgScale(photos, i)} key={`${i}`} src={url} alt=""/> |
| | | } else { |
| | | return <img style={{maxHeight: maxHeight}} key={`${i}`} src={url} alt=""/> |
| | | } |
| | |
| | | let photos = [] |
| | | try { |
| | | photos = record[col.field] + '' |
| | | photos = photos.split(',') |
| | | photos = photos.split(',').filter(Boolean) |
| | | } catch { |
| | | photos = [] |
| | | } |
| | |
| | | <div className="content-fence"> |
| | | <div className="content-fence-top" style={images[0] ? {textAlign: images[0].align} : null}> |
| | | {images.map((_img, index) => { |
| | | if (!_img.url) return '' |
| | | if (_img.scale) { |
| | | return <img style={{maxHeight: _img.maxHeight}} className="image-scale" onClick={this.imgScale} key={`${index}`} src={_img.url} alt=""/> |
| | | return <img style={{maxHeight: _img.maxHeight}} className="image-scale" onClick={() => this.imgScale(images, index)} key={`${index}`} src={_img.url} alt=""/> |
| | | } else { |
| | | return (<img style={{maxHeight: _img.maxHeight}} key={`${index}`} src={_img.url} alt=""/>) |
| | | } |
| | |
| | | <div className="content-fence"> |
| | | <div className="content-fence-left" style={images[0] ? {textAlign: images[0].align} : null}> |
| | | {images.map((_img, index) => { |
| | | if (!_img.url) return '' |
| | | if (_img.scale) { |
| | | return <img style={{maxHeight: _img.maxHeight}} className="image-scale" onClick={this.imgScale} key={`${index}`} src={_img.url} alt=""/> |
| | | return <img style={{maxHeight: _img.maxHeight}} className="image-scale" onClick={() => this.imgScale(images, index)} key={`${index}`} src={_img.url} alt=""/> |
| | | } else { |
| | | return (<img style={{maxHeight: _img.maxHeight}} key={`${index}`} src={_img.url} alt=""/>) |
| | | } |
| | |
| | | /** |
| | | * @description 图片缩放 |
| | | */ |
| | | imgScaleClose = () => { |
| | | imgScale = (images, index) => { |
| | | this.setState({ |
| | | imgShow: false |
| | | imgShow: true, |
| | | imgData: { |
| | | list: images.map(item => { |
| | | if (typeof(item) === 'string') { |
| | | return item |
| | | } |
| | | return item.url |
| | | }), |
| | | index |
| | | } |
| | | }) |
| | | } |
| | | imgScale = (e) => { |
| | | if (e.target.nodeName === 'IMG') { |
| | | this.setState({ |
| | | imgShow: true, |
| | | imgSrc: e.target.src |
| | | }) |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | visible={this.state.imgShow} |
| | | width="70vw" |
| | | maskClosable={true} |
| | | onCancel={this.imgScaleClose} |
| | | onCancel={() => {this.setState({ imgShow: false })}} |
| | | title={this.props.dict['main.form.picture.check']} |
| | | footer={[<span key="close" onClick={this.imgScaleClose}>{this.props.dict['main.close']}</span>]} |
| | | footer={[<span key="close" onClick={() => {this.setState({ imgShow: false })}}>{this.props.dict['main.close']}</span>]} |
| | | destroyOnClose |
| | | > |
| | | <img style={{maxWidth:'100%'}} src={this.state.imgSrc} alt="" /> |
| | | <ImgScale data={this.state.imgData}/> |
| | | </Modal> |
| | | </div> |
| | | ) |