| | |
| | | static propTpyes = { |
| | | menu: PropTypes.object, // 三级菜单信息 |
| | | config: PropTypes.object, // 配置信息 |
| | | pasteContent: PropTypes.object, // 粘贴配置信息 |
| | | sysRoles: PropTypes.array, // 角色列表,权限分配 |
| | | updatecolumn: PropTypes.func // 更新 |
| | | } |
| | | |
| | |
| | | const { config } = this.props |
| | | const { columnlist } = this.state |
| | | |
| | | if ( |
| | | nextProps.pasteContent && |
| | | nextProps.pasteContent.columns && |
| | | nextProps.pasteContent.copyType === 'columns' && |
| | | nextProps.pasteContent.columns.length > 0 |
| | | ) { |
| | | if (columnlist.filter(col => !col.origin).length === 0) { |
| | | this.setState({columnlist: nextProps.pasteContent.columns}, () => { |
| | | this.props.updatecolumn({...config, columns: nextProps.pasteContent.columns}) |
| | | }) |
| | | } |
| | | } else if (!is(fromJS(nextProps.config.columns), fromJS(config.columns)) && !is(fromJS(nextProps.config.columns), fromJS(columnlist))) { |
| | | if (!is(fromJS(nextProps.config.columns), fromJS(config.columns)) && !is(fromJS(nextProps.config.columns), fromJS(columnlist))) { |
| | | this.setState({columnlist: fromJS(nextProps.config.columns).toJS()}) |
| | | } |
| | | } |
| | |
| | | this.setState({ |
| | | modaltype: 'columns', |
| | | card: card, |
| | | formlist: getColumnForm(card, this.props.sysRoles, menulist) |
| | | formlist: getColumnForm(card, menulist) |
| | | }) |
| | | } else { |
| | | this.setState({ |