| | |
| | | */ |
| | | UNSAFE_componentWillReceiveProps (nextProps) { |
| | | const { actionlist } = this.state |
| | | |
| | | if (!is(fromJS(nextProps.config.action), fromJS(this.props.config.action)) && !is(fromJS(nextProps.config.action), fromJS(actionlist))) { |
| | | this.setState({actionlist: fromJS(nextProps.config.action).toJS()}) |
| | | } |
| | |
| | | const { config } = this.props |
| | | const { card, actionlist } = this.state |
| | | |
| | | if (comIds.length !== 2 || comIds[0] !== config.uuid || comIds[1] === 'header') return |
| | | if (comIds[0] !== config.uuid || comIds[1] !== 'actionlist') return |
| | | |
| | | let _card = fromJS(card).toJS() |
| | | _card.btnstyle = style |
| | |
| | | card: element |
| | | }) |
| | | |
| | | MKEmitter.emit('changeStyle', [config.uuid, element.uuid], options, _style) |
| | | MKEmitter.emit('changeStyle', [config.uuid, 'actionlist', element.uuid], options, _style) |
| | | } |
| | | |
| | | addButton = (cardId, element) => { |
| | |
| | | |
| | | _actionlist = _actionlist.filter(item => item.uuid !== card.uuid) |
| | | |
| | | let delButtons = sessionStorage.getItem('delButtons') |
| | | try { |
| | | delButtons = JSON.parse(delButtons) |
| | | delButtons.push(card.uuid) |
| | | } catch { |
| | | delButtons = [card.uuid] |
| | | if (!card.origin) { |
| | | MKEmitter.emit('delButtons', [card.uuid]) |
| | | } |
| | | sessionStorage.setItem('delButtons', JSON.stringify(delButtons)) |
| | | |
| | | let btnlog = config.btnlog || [] |
| | | if (card.OpenType === 'popview' || card.verify || card.modal) { |
| | | btnlog.push(card) |
| | | } |
| | | |
| | | _this.setState({ |
| | | actionlist: _actionlist |
| | | }, () => { |
| | | _this.props.updateaction({...config, action: _actionlist}) |
| | | _this.props.updateaction({...config, action: _actionlist, btnlog}) |
| | | }) |
| | | }, |
| | | onCancel() {} |