| | |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | | return !is(fromJS(this.props.data), fromJS(nextProps.data)) || (nextProps.syncData && !is(fromJS(this.props.syncData), fromJS(nextProps.syncData))) |
| | | return !is(fromJS(this.props.data), fromJS(nextProps.data)) || (nextProps.syncData ? !is(fromJS(this.props.syncData), fromJS(nextProps.syncData)) : false) |
| | | } |
| | | |
| | | /** |
| | |
| | | val = card.tooltip |
| | | } |
| | | |
| | | if (/\\n|\n/.test(val)) { |
| | | val = val.replace(/(\\n|\n)$/, '') |
| | | |
| | | if (val) { |
| | | val = val.split(/\\n|\n/) |
| | | |
| | | val = <div>{val.map((cell, i) => <div style={{marginBottom: 2}} key={i}>{cell}</div>)}</div> |
| | | } |
| | | } |
| | | |
| | | if (card.tipType === 'text') { |
| | | contents.push( |
| | | <div className={'ant-col ant-col-' + card.width} key={card.uuid} style={_style_} span={card.width}> |
| | |
| | | let func = new Function('data', card.formula) |
| | | val = func(_data) |
| | | } catch (e) { |
| | | if (window.debugger) { |
| | | console.warn(e) |
| | | } |
| | | console.warn(e) |
| | | val = '' |
| | | } |
| | | } else if (card.$sync) { |
| | |
| | | // eslint-disable-next-line |
| | | _val = eval(_val) |
| | | } catch (e) { |
| | | if (window.debugger) { |
| | | console.info(_val) |
| | | console.warn(e) |
| | | } |
| | | console.info(_val) |
| | | console.warn(e) |
| | | _val = 0 |
| | | } |
| | | } |
| | |
| | | // eslint-disable-next-line |
| | | _val = eval(_val) |
| | | } catch (e) { |
| | | if (window.debugger) { |
| | | console.info(_val) |
| | | console.warn(e) |
| | | } |
| | | console.info(_val) |
| | | console.warn(e) |
| | | _val = '' |
| | | } |
| | | } |
| | |
| | | |
| | | if (data.$$type === 'extendCard') { |
| | | _data = data.$$selectedData || [] |
| | | if (card.Ot === 'notRequired' && _data.length === 0) { |
| | | _data = [data] |
| | | } |
| | | } else if (card.$sync) { |
| | | _data = this.props.syncData || [] |
| | | } else if (data.$$empty) { |