| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import {connect} from 'react-redux' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Icon, Modal } from 'antd' |
| | | |
| | |
| | | } |
| | | |
| | | state = { |
| | | dict: localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, |
| | | dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, |
| | | sourcelist: [], |
| | | mainSearch: [], |
| | | visible: false, |
| | |
| | | } |
| | | |
| | | editDataSource = () => { |
| | | const { config, menu } = this.props |
| | | const { config } = this.props |
| | | |
| | | let search = [] |
| | | let parents = [] |
| | |
| | | _conf = item |
| | | |
| | | if (_conf.parentId && _conf.tabId) { |
| | | getParents(menu) |
| | | getParents(tab) |
| | | } |
| | | } else { |
| | | getParents(tab) |
| | |
| | | } |
| | | |
| | | if (config.parentId && config.tabId) { |
| | | getParents(menu) |
| | | getParents(window.GLOB.customMenu) |
| | | } |
| | | |
| | | parents.unshift(menu) |
| | | parents.unshift(window.GLOB.customMenu) |
| | | |
| | | parents.forEach(parent => { |
| | | parent.components.forEach(item => { |
| | |
| | | } |
| | | |
| | | render () { |
| | | const { config, menu } = this.props |
| | | const { config } = this.props |
| | | const { visible, dict, loading, mainSearch } = this.state |
| | | |
| | | return ( |
| | |
| | | visible={visible} |
| | | width={'75vw'} |
| | | maskClosable={false} |
| | | style={{minWidth: '900px', maxWidth: '1200px'}} |
| | | okText={dict['model.submit']} |
| | | onOk={this.verifySubmit} |
| | | confirmLoading={loading} |
| | |
| | | > |
| | | <VerifyCard |
| | | dict={dict} |
| | | menu={menu} |
| | | menu={window.GLOB.customMenu} |
| | | mainSearch={mainSearch} |
| | | config={config} |
| | | wrappedComponentRef={(inst) => this.verifyRef = inst} |
| | |
| | | } |
| | | } |
| | | |
| | | const mapStateToProps = (state) => { |
| | | return { |
| | | menu: state.customMenu |
| | | } |
| | | } |
| | | |
| | | const mapDispatchToProps = () => { |
| | | return {} |
| | | } |
| | | |
| | | export default connect(mapStateToProps, mapDispatchToProps)(DataSource) |
| | | export default DataSource |