| | |
| | | columns: [], |
| | | cols: [ |
| | | { origin: true, uuid: Utils.getuuid(), Align: 'left', label: 'label1', field: '', Hide: 'false', type: 'text', Width: 120 }, |
| | | { origin: true, uuid: Utils.getuuid(), Align: 'left', label: 'label2', field: '', Hide: 'false', IsSort: 'true', type: 'text', Width: 120 }, |
| | | { origin: true, uuid: Utils.getuuid(), Align: 'left', label: 'label3', field: '', Hide: 'false', IsSort: 'true', type: 'text', Width: 120 }, |
| | | { origin: true, uuid: Utils.getuuid(), Align: 'left', label: 'label2', field: '', Hide: 'false', IsSort: 'false', type: 'text', Width: 120 }, |
| | | { origin: true, uuid: Utils.getuuid(), Align: 'left', label: 'label3', field: '', Hide: 'false', IsSort: 'false', type: 'text', Width: 120 }, |
| | | ], |
| | | scripts: [], |
| | | isNew: true |
| | |
| | | if (card.errors.length === 0) { |
| | | card.$tables = getTables(card) |
| | | } |
| | | |
| | | delete card.$c_ds |
| | | delete card.$c_ac |
| | | delete card.$c_cl |
| | | } |
| | | |
| | | this.setState({ |
| | |
| | | addSearch = () => { |
| | | const { card } = this.state |
| | | |
| | | MKEmitter.emit('plusSearch', card.uuid, {uuid: Utils.getuuid(), focus: true, label: 'label', type: 'text', match: '='}, 'simple') |
| | | let ratio = 6 |
| | | |
| | | if (card.search.length) { |
| | | ratio = card.search[card.search.length - 1].ratio |
| | | } |
| | | |
| | | MKEmitter.emit('plusSearch', card.uuid, {uuid: Utils.getuuid(), focus: true, label: 'label', type: 'text', match: '=', ratio}, 'simple') |
| | | } |
| | | |
| | | addButton = () => { |
| | |
| | | } |
| | | |
| | | getWrapForms = () => { |
| | | const { wrap, action, columns, cols } = this.state.card |
| | | const { card } = this.state |
| | | |
| | | let _actions = [] |
| | | |
| | | cols.forEach(col => { |
| | | card.cols.forEach(col => { |
| | | if (col.type === 'custom') { |
| | | col.elements.forEach(cell => { |
| | | if (cell.eleType !== 'button') return |
| | |
| | | } |
| | | }) |
| | | |
| | | return getWrapForm(wrap, _actions, columns, action) |
| | | return getWrapForm(card.wrap, _actions, card.columns, card.action, card.supNodes || [], card.uuid) |
| | | } |
| | | |
| | | updateWrap = (res) => { |
| | |
| | | res.borderRadius = card.wrap.borderRadius || 0 |
| | | res.resetContrl = card.wrap.resetContrl || 'init' |
| | | |
| | | this.updateComponent({...card, wrap: res}) |
| | | let _card = {...card, wrap: res} |
| | | |
| | | if (res.supNodes) { |
| | | _card.supNodes = res.supNodes |
| | | _card.supNodes = _card.supNodes.map(item => { |
| | | item.componentId = item.nodes[item.nodes.length - 1] |
| | | return item |
| | | }) |
| | | |
| | | delete res.supNodes |
| | | } else { |
| | | delete _card.supNodes |
| | | } |
| | | |
| | | this.updateComponent(_card) |
| | | } |
| | | |
| | | 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) |
| | | } |
| | | config.hasExtend = false |
| | | config.parCtrl = false |
| | | let mapCol = (cols) => { |
| | | cols.forEach(col => { |
| | | if (col.type === 'number') { |
| | | if (col.format === 'abs') { |
| | | config.absFields.push(col.field) |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | } else if (col.type === 'extend') { |
| | | config.hasExtend = true |
| | | if (col.supField) { |
| | | config.parCtrl = true |
| | | } |
| | | } else if (col.type === 'colspan' && col.subcols) { |
| | | mapCol(col.subcols) |
| | | } |
| | | }) |
| | | } |
| | | mapCol(config.cols) |
| | | |
| | | if (config.absFields.length) { |
| | | config.absFields = Array.from(new Set(config.absFields)) |
| | |
| | | </Popover> |
| | | {appType !== 'mob' ? <SearchComponent config={card} updatesearch={this.updateComponent}/> : null} |
| | | <ActionComponent config={card} setSubConfig={this.setSubConfig} updateaction={this.updateComponent}/> |
| | | <ColumnComponent config={card} updatecolumn={this.updateComponent}/> |
| | | <ColumnComponent config={card} updatecolumn={this.updatecolumn}/> |
| | | <div className="component-name"> |
| | | <div className="center"> |
| | | <div className="title" onDoubleClick={() => { |