| | |
| | | } |
| | | |
| | | if (content !== '') { |
| | | let decimal = col.decimal || 0 |
| | | if (col.round) { |
| | | content = Math.round(content * col.round) / col.round |
| | | } |
| | | if (col.format === 'percent') { |
| | | content = content * 100 |
| | | decimal = decimal > 2 ? decimal - 2 : 0 |
| | | } else if (col.format === 'abs') { |
| | | content = Math.abs(content) |
| | | } |
| | | |
| | | content = content.toFixed(decimal) |
| | | if (col.round) { |
| | | content = content.toFixed(col.decimal) |
| | | } |
| | | |
| | | if (col.format === 'thdSeparator') { |
| | | content = content.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,') |
| | |
| | | photos = photos.split(',').filter(Boolean) |
| | | } |
| | | |
| | | let cols = 24 / (col.picSort || 1) |
| | | let paddingTop = '100%' |
| | | let scale = col.scale === 'true' |
| | | |
| | |
| | | |
| | | resProps.children = ( |
| | | <div> |
| | | {photos && photos.map((url, i) => ( |
| | | <Col key={i} span={cols}> |
| | | {photos.map((url, i) => ( |
| | | <Col key={i} span={col.span || 24}> |
| | | <div className={'ant-mk-picture' + (scale ? ' scale' : '')} onClick={() => { |
| | | if (!scale) return |
| | | MKEmitter.emit('mkImageScale', url, photos) |