| | |
| | | { origin: true, uuid: Utils.getuuid(), label: 'label', type: 'date', match: 'greater' } |
| | | ], |
| | | action: [ |
| | | { origin: true, uuid: Utils.getuuid(), label: '添加', intertype: 'system', OpenType: 'pop', icon: 'plus', class: 'green' }, |
| | | { origin: true, uuid: Utils.getuuid(), label: '修改', intertype: 'system', OpenType: 'pop', icon: 'form', class: 'purple' }, |
| | | { origin: true, uuid: Utils.getuuid(), label: '删除', intertype: 'system', OpenType: 'prompt', icon: 'delete', class: 'red' } |
| | | { origin: true, uuid: Utils.getuuid(), label: '添加', intertype: 'system', OpenType: 'pop', icon: 'plus', class: 'green', btnstyle: {color: 'rgb(255, 255, 255)', background: 'rgb(38, 194, 129)', marginRight: '15px'} }, |
| | | { origin: true, uuid: Utils.getuuid(), label: '修改', intertype: 'system', OpenType: 'pop', icon: 'form', class: 'purple', btnstyle: {color: 'rgb(255, 255, 255)', background: 'rgb(142, 68, 173)', marginRight: '15px'} }, |
| | | { origin: true, uuid: Utils.getuuid(), label: '删除', intertype: 'system', OpenType: 'prompt', icon: 'delete', class: 'danger', btnstyle: {color: 'rgb(255, 255, 255)', background: 'rgb(255, 77, 79)', marginRight: '15px'} } |
| | | ], |
| | | name: card.name, |
| | | subtype: card.subtype, |
| | |
| | | |
| | | componentDidMount () { |
| | | MKEmitter.addListener('submitStyle', this.getStyle) |
| | | MKEmitter.addListener('submitModal', this.handleSave) |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | |
| | | return |
| | | } |
| | | MKEmitter.removeListener('submitStyle', this.getStyle) |
| | | MKEmitter.removeListener('submitModal', this.handleSave) |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | setSubConfig = (btn) => { |
| | | const { card } = this.state |
| | | |
| | | if (btn.OpenType === 'pop') { |
| | | if (!btn.modal) { |
| | | btn.modal = { |
| | | setting: { |
| | | title: btn.label, |
| | | width: 60, |
| | | cols: '2', |
| | | container: 'tab', |
| | | focus: '', |
| | | finish: 'close', |
| | | clickouter: 'unclose', |
| | | display: 'modal' |
| | | }, |
| | | tables: [], |
| | | groups: [], |
| | | fields: [] |
| | | } |
| | | } |
| | | MKEmitter.emit('changeModal', card, btn) |
| | | } |
| | | } |
| | | |
| | | handleSave = (_cards, btn, modal) => { |
| | | let card = fromJS(this.state.card).toJS() |
| | | |
| | | if (card.uuid !== _cards.uuid) return |
| | | |
| | | let _index = card.action.findIndex(cell => cell.uuid === btn.uuid) |
| | | |
| | | if (_index === -1) return |
| | | |
| | | card.action = card.action.map(cell => { |
| | | if (cell.uuid === btn.uuid) { |
| | | cell.modal = modal |
| | | } |
| | | |
| | | return cell |
| | | }) |
| | | |
| | | this.setState({card}) |
| | | this.props.updateConfig(card) |
| | | } |
| | | |
| | | render() { |