| | |
| | | import './index.scss' |
| | | |
| | | const CardCellComponent = asyncComponent(() => import('../cardcellList')) |
| | | const MainAction = asyncComponent(() => import('@/tabviews/zshare/actionList')) |
| | | const NormalHeader = asyncComponent(() => import('@/tabviews/custom/components/share/normalheader')) |
| | | |
| | | class TableCard extends Component { |
| | |
| | | |
| | | config.subcards.forEach((item, index) => { |
| | | let display = item.setting.condition !== 'true' |
| | | let type = '' |
| | | |
| | | if (!display && item.setting.controlField) { |
| | | let val = data[item.setting.controlField] |
| | |
| | | } else if (item.setting.controlType === '<' && val < item.setting.controlValue) { |
| | | display = true |
| | | } |
| | | |
| | | type = 'mk_tb_' + val |
| | | } |
| | | |
| | | if (!display) return |
| | | |
| | | line.push( |
| | | <Col key={index} span={24}> |
| | | <Col key={index} className={type} span={24}> |
| | | <div className="card-item-box" style={item.style} onClick={() => {this.openView(item, data)}}> |
| | | <CardCellComponent data={data} cards={config} cardCell={item} elements={item.elements}/> |
| | | </div> |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { config, loading, data, BID, pageIndex, total } = this.state |
| | | const { config, loading, data, BID, pageIndex, total, BData } = this.state |
| | | |
| | | if (config.wrap.empty === 'hidden' && (!data || data.length === 0)) return null |
| | | |
| | |
| | | </div> : null |
| | | } |
| | | <NormalHeader config={config} BID={BID} refresh={this.refreshSearch} /> |
| | | {config.action && config.action.length > 0 ? |
| | | <MainAction |
| | | BID={BID} |
| | | BData={BData} |
| | | setting={config.setting} |
| | | actions={config.action} |
| | | columns={config.columns} |
| | | selectedData={[]} |
| | | /> : null |
| | | } |
| | | {data && data.length > 0 ? <Row className={'card-row-list' + (config.wrap.parity === 'true' ? ' mk-parity' : '')} style={{height: config.wrap.contentHeight}}> |
| | | {data.map(item => this.getLines(item))} |
| | | </Row> : null} |