From 592ff0aa0f2d45d143872b672a1468e268d3157f Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期六, 22 二月 2020 17:25:20 +0800 Subject: [PATCH] 2020-02-22 --- src/templates/ushare/editable/index.jsx | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/src/templates/ushare/editable/index.jsx b/src/templates/ushare/editable/index.jsx index 856c600..a5b94a1 100644 --- a/src/templates/ushare/editable/index.jsx +++ b/src/templates/ushare/editable/index.jsx @@ -307,6 +307,22 @@ UNSAFE_componentWillReceiveProps (nextProps) { if (!is(fromJS(this.props.linkSubFields), fromJS(nextProps.linkSubFields)) || this.props.type !== nextProps.type) { this.resetColumn(nextProps.type, nextProps.linkSubFields) + } else if (!is(fromJS(this.props.data), fromJS(nextProps.data))) { + let _data = [] + nextProps.data.forEach(item => { + let _item = {key: Utils.getuuid()} + this.state.columns.forEach(col => { + _item[col.dataIndex] = item[col.dataIndex] || '' + if (col.dataIndex !== 'ParentID' && !_item[col.dataIndex]) { + _item[col.dataIndex] = item.Text + } + }) + _data.push(_item) + }) + this.setState({ + dataSource: _data, + count: nextProps.data.length + }) } } -- Gitblit v1.8.0