| | |
| | | const VerifyPrint = asyncComponent(() => import('@/menu/actioncomponent/verifyprint')) |
| | | const VerifyExcelIn = asyncComponent(() => import('@/menu/actioncomponent/verifyexcelin')) |
| | | const VerifyExcelOut = asyncComponent(() => import('@/menu/actioncomponent/verifyexcelout')) |
| | | // const ModalConfig = asyncComponent(() => import('@/menu/modalconfig')) |
| | | |
| | | class CardCellComponent extends Component { |
| | | static propTpyes = { |
| | |
| | | elements: null, // 按钮组 |
| | | visible: false, // 模态框控制 |
| | | actvisible: false, // 按钮编辑模态框 |
| | | profVisible: false |
| | | profVisible: false, // 验证信息编辑 |
| | | } |
| | | |
| | | /** |
| | |
| | | componentDidMount () { |
| | | MKEmitter.addListener('cardAddElement', this.cardAddElement) |
| | | MKEmitter.addListener('submitStyle', this.getStyle) |
| | | MKEmitter.addListener('submitModal', this.handleSave) |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | |
| | | return |
| | | } |
| | | MKEmitter.removeListener('cardAddElement', this.cardAddElement) |
| | | MKEmitter.removeListener('submitStyle', this.getStyle) |
| | | MKEmitter.removeListener('submitModal', this.handleSave) |
| | | } |
| | | |
| | | cardAddElement = (ids, element) => { |
| | |
| | | this.actionFormRef.handleConfirm().then(ele => { |
| | | let _elements = elements.map(cell => { |
| | | if (cell.uuid === ele.uuid) { |
| | | ele.eleType = 'button' |
| | | ele.style = cell.style || {} |
| | | ele.btnstyle = cell.btnstyle || {} |
| | | ele = {...cell, ...ele} |
| | | return ele |
| | | } |
| | | |
| | |
| | | * @description 验证信息保存 |
| | | */ |
| | | verifySubmit = () => { |
| | | const { elements } = this.state |
| | | |
| | | const { elements, card } = this.state |
| | | |
| | | this.verifyRef.handleConfirm().then(res => { |
| | | let _elements = elements.map(cell => { |
| | | if (cell.uuid === res.uuid) { |
| | | res.eleType = 'button' |
| | | res.style = cell.style || {} |
| | | return res |
| | | if (cell.uuid === card.uuid) { |
| | | cell.verify = res |
| | | } |
| | | |
| | | return cell |
| | |
| | | |
| | | this.setState({ |
| | | elements: _elements, |
| | | actvisible: false |
| | | profVisible: false |
| | | }, () => { |
| | | this.props.updateElement(_elements) |
| | | }) |
| | |
| | | } |
| | | |
| | | handleSubConfig = (item) => { |
| | | const { cards } = this.props |
| | | |
| | | if (item.eleType !== 'button') return |
| | | if (item.OpenType === 'pop') { |
| | | let btn = fromJS(item).toJS() |
| | | 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', cards, btn) |
| | | } |
| | | } |
| | | |
| | | handleSave = (_cards, btn, modal) => { |
| | | const { cards } = this.props |
| | | const { elements } = this.state |
| | | |
| | | if (cards.uuid !== _cards.uuid) return |
| | | |
| | | let _elements = elements.map(cell => { |
| | | if (cell.uuid === btn.uuid) { |
| | | cell.modal = modal |
| | | } |
| | | |
| | | return cell |
| | | }) |
| | | |
| | | this.setState({ |
| | | elements: _elements |
| | | }, () => { |
| | | this.props.updateElement(_elements) |
| | | }) |
| | | } |
| | | |
| | | render() { |
| | |
| | | handleSubConfig={this.handleSubConfig} |
| | | deleteMenu={this.deleteElement} |
| | | /> |
| | | {/* <ModalConfig |
| | | menu={this.state.editMenu} |
| | | editTab={this.state.editTab} |
| | | tabConfig={this.state.tabConfig} |
| | | editSubTab={this.state.editSubTab} |
| | | subTabConfig={this.state.subTabConfig} |
| | | btnTab={this.state.btnTab} |
| | | btnTabConfig={this.state.btnTabConfig} |
| | | editAction={this.state.editAction} |
| | | subConfig={this.state.subConfig} |
| | | handleView={this.handleView} |
| | | /> */} |
| | | {/* 编辑按钮:复制、编辑 */} |
| | | <Modal |
| | | title={'编辑元素'} |
| | |
| | | > |
| | | {card && !card.execMode && card.OpenType !== 'excelIn' && card.OpenType !== 'excelOut' ? |
| | | <VerifyCard |
| | | // floor={this.props.type} |
| | | card={card} |
| | | dict={dict} |
| | | config={cards} |