| | |
| | | _data = _data[0] || {$$empty: true} |
| | | } |
| | | _sync = false |
| | | _data.$$uuid = _data[config.setting.primaryKey] || '' |
| | | } |
| | | } else { |
| | | _data = {$$empty: true} |
| | |
| | | |
| | | let _groups = config.subcards.filter(item => item.setting.status === _status)[0] |
| | | _group = _groups || _group |
| | | } |
| | | |
| | | config.titleStyle = {} |
| | | config.sortStyle = {} |
| | | |
| | | if (config.style.fontSize) { |
| | | let size = parseInt(config.style.fontSize) |
| | | config.titleStyle = {fontSize: size} |
| | | let s = size * 1.5 + 'px' |
| | | config.sortStyle = {width: s, height: s, lineHeight: s, borderRadius: s} |
| | | } |
| | | |
| | | this.setState({ |
| | |
| | | _data = _data[0] || {$$empty: true} |
| | | } |
| | | } |
| | | |
| | | _data.$$uuid = _data[config.setting.primaryKey] || '' |
| | | |
| | | if (config.wrap.statusControl && _data[config.wrap.statusControl]) { |
| | | let _status = _data[config.wrap.statusControl] |
| | |
| | | let _data = result.data && result.data[0] ? result.data[0] : {$$empty: true} |
| | | let _group = this.state.group |
| | | |
| | | _data.$$uuid = _data[config.setting.primaryKey] || '' |
| | | |
| | | if (type === 'refresh') { |
| | | _group = config.subcards[0] |
| | | } |
| | |
| | | render() { |
| | | const { config, loading, BID, BData, data, group, dict, step } = this.state |
| | | |
| | | if (config.wrap.empty === 'hidden' && (!data || data.$$empty)) return null |
| | | if (config.idCtrl && (!data || data.$$empty)) return null |
| | | |
| | | return ( |
| | | <div className="custom-normal-form-box" id={'anchor' + config.uuid} style={{...config.style}}> |
| | | {loading ? |
| | |
| | | } |
| | | {config.wrap.groupLabel !== 'hidden' ? <div className="mk-normal-form-title"> |
| | | {config.subcards.map(card => ( |
| | | <div key={card.uuid} className={'form-title' + (card.sort <= step ? ' active' : '')}> |
| | | <span className="form-sort" style={{background: config.wrap.color}}>{card.sort}</span> |
| | | <div key={card.uuid} style={config.titleStyle} className={'form-title' + (card.sort <= step ? ' active' : '')}> |
| | | <span className="form-sort" style={{background: config.wrap.color, ...config.sortStyle}}>{card.sort}</span> |
| | | <span className="before-line" style={{background: config.wrap.color}}></span> |
| | | <span className="after-line" style={{background: config.wrap.color}}></span> |
| | | {card.setting.title} |