| | |
| | | if (appType === 'mob') { |
| | | _card.search = [] |
| | | } |
| | | |
| | | this.setState({ |
| | | card: _card |
| | | }) |
| | |
| | | } |
| | | |
| | | componentDidMount () { |
| | | MKEmitter.addListener('submitModal', this.handleSave) |
| | | MKEmitter.addListener('completeSave', this.completeSave) |
| | | } |
| | | |
| | |
| | | this.setState = () => { |
| | | return |
| | | } |
| | | MKEmitter.removeListener('submitModal', this.handleSave) |
| | | MKEmitter.removeListener('completeSave', this.completeSave) |
| | | } |
| | | |
| | |
| | | style.fontSize = card.wrap.fontSize || 14 |
| | | style.fontWeight = card.wrap.fontWeight || 'normal' |
| | | |
| | | MKEmitter.emit('changeStyle', ['font1', 'background', 'border', 'padding', 'margin', 'shadow'], style, this.getStyle) |
| | | MKEmitter.emit('changeStyle', ['font1', 'background', 'border', 'padding', 'margin', 'shadow', 'clear'], style, this.getStyle) |
| | | } |
| | | |
| | | getStyle = (style) => { |
| | |
| | | } |
| | | } |
| | | |
| | | 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.updateComponent(card) |
| | | } |
| | | |
| | | getWrapForms = () => { |
| | | const { wrap, action, columns, cols } = this.state.card |
| | | |
| | |
| | | this.updateComponent({...card, wrap: res}) |
| | | } |
| | | |
| | | updatecolumn = (config) => { |
| | | config.absFields = [] |
| | | config.cols.forEach(col => { |
| | | if (col.type === 'number') { |
| | | if (col.format === 'abs') { |
| | | config.absFields.push(col.field) |
| | | } |
| | | } else if (col.type === 'colspan' && col.subcols) { |
| | | col.subcols.forEach(scol => { |
| | | if (scol.type === 'number') { |
| | | if (scol.format === 'abs') { |
| | | config.absFields.push(scol.field) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | |
| | | if (config.absFields.length) { |
| | | config.absFields = Array.from(new Set(config.absFields)) |
| | | } else { |
| | | config.absFields = null |
| | | } |
| | | |
| | | this.updateComponent(config) |
| | | } |
| | | |
| | | clickComponent = (e) => { |
| | | if (sessionStorage.getItem('style-control') === 'true' || sessionStorage.getItem('style-control') === 'component') { |
| | | e.stopPropagation() |