| | |
| | | import './index.scss' |
| | | |
| | | const { Paragraph } = Typography |
| | | const CardCellComponent = asyncComponent(() => import('@/tabviews/custom/components/card/cardcellList')) |
| | | const Video = asyncComponent(() => import('@/components/video')) |
| | | const MkPicture = asyncComponent(() => import('@/components/mkPicture')) |
| | | const CardCellComponent = asyncComponent(() => import('@/tabviews/custom/components/card/cardcellList')) |
| | | const PicRadio = { |
| | | '4:3': '75%', '3:2': '66.67%', '16:9': '56.25%', '2:1': '50%', '3:1': '33.33%', '4:1': '25%', |
| | | '5:1': '20%', '6:1': '16.67%', '7:1': '14.29%', '8:1': '12.5%', '9:1': '11.11%', |
| | |
| | | } |
| | | class BodyRow extends React.Component { |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | | return !is(fromJS(this.props.data), fromJS(nextProps.data)) || !is(fromJS(this.props.className), fromJS(nextProps.className)) |
| | | return !is(fromJS(this.props.data), fromJS(nextProps.data)) || this.props.className !== nextProps.className |
| | | } |
| | | |
| | | render() { |
| | |
| | | ))} |
| | | </div> |
| | | ) |
| | | } else if (col.type === 'video') { |
| | | let url = record[col.field] || '' |
| | | |
| | | resProps.children = ( |
| | | <div className="video-wrap"> |
| | | {url ? <Video card={col} value={url}/> : null} |
| | | </div> |
| | | ) |
| | | } else if (col.type === 'textarea') { |
| | | let content = '' |
| | | if (record[col.field] !== undefined) { |
| | |
| | | } |
| | | } |
| | | |
| | | let _columns = [] |
| | | |
| | | if (setting.tableMode !== 'fast') { |
| | | let getColumns = (cols) => { |
| | | return cols.map(item => { |
| | | let cell = null |
| | |
| | | return cell |
| | | }) |
| | | } |
| | | _columns = getColumns(columns) |
| | | } else { |
| | | let fields = [] |
| | | columns.forEach(item => { |
| | | if (!item.field || fields.includes(item.field)) return |
| | | fields.push(item.field) |
| | | |
| | | let _columns = getColumns(columns) |
| | | _columns.push({ |
| | | align: item.Align, |
| | | dataIndex: item.field, |
| | | title: item.label, |
| | | sorter: item.IsSort === 'true', |
| | | width: item.Width || 120 |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | if (rowspans.length === 0) { |
| | | rowspans = null |
| | |
| | | } |
| | | return uuid.join('') |
| | | }) () |
| | | |
| | | // if (setting.borderColor) { // 边框颜色 |
| | | // let style = `#${tableId} table, #${tableId} tr, #${tableId} th, #${tableId} td {border-color: ${setting.borderColor}}` |
| | | // let ele = document.createElement('style') |
| | | // ele.innerHTML = style |
| | | // document.getElementsByTagName('head')[0].appendChild(ele) |
| | | // } |
| | | |
| | | let size = (setting.pageSize || 10) + '' |
| | | let pageOptions = ['10', '25', '50', '100', '500', '1000'] |
| | |
| | | } |
| | | } |
| | | |
| | | const components = { |
| | | let components = { |
| | | body: { |
| | | row: BodyRow, |
| | | cell: BodyCell |
| | | row: BodyRow |
| | | } |
| | | } |
| | | |
| | | if (setting.tableMode !== 'fast') { |
| | | components.body.cell = BodyCell |
| | | } |
| | | |
| | | // 数据收起时,过滤已选数据 |
| | |
| | | } |
| | | <Table |
| | | components={components} |
| | | // style={setting.style} |
| | | size={setting.size || 'middle'} |
| | | bordered={setting.bordered !== 'false'} |
| | | rowSelection={rowSelection} |
| | |
| | | scroll={{ x: '100%', y: height }} |
| | | onRow={(record, index) => { |
| | | return { |
| | | lineMarks, |
| | | lineMarks: setting.tableMode !== 'fast' ? lineMarks : null, |
| | | data: record, |
| | | className: index === activeIndex ? ' mk-row-active ' : '', |
| | | onClick: () => {this.changeRow(record, index)}, |