| | |
| | | } |
| | | |
| | | state = { |
| | | dict: localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, |
| | | dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, |
| | | sourcelist: [], |
| | | searches: [], |
| | | visible: false, |
| | |
| | | confirm({ |
| | | title: '确定删除数据源吗?', |
| | | content: '', |
| | | okText: _this.state.dict['mob.confirm'], |
| | | cancelText: _this.state.dict['mob.cancel'], |
| | | onOk() { |
| | | _this.setState({sourcelist}) |
| | | _this.props.updateConfig({...config, sourcelist: fromJS(sourcelist).toJS()}) |
| | |
| | | } |
| | | |
| | | render () { |
| | | const { config } = this.props |
| | | const { sourcelist, visible, source, dict, searches, loading } = this.state |
| | | |
| | | let addable = true |
| | | if (config.components && config.components.length === 1 && config.components[0].type === 'login') { |
| | | addable = false |
| | | } |
| | | |
| | | return ( |
| | | <div className="mob-datasource"> |
| | |
| | | </span> |
| | | </span> |
| | | ))} |
| | | <span className="mob-input-group-wrapper"> |
| | | {addable ? <span className="mob-input-group-wrapper"> |
| | | <span className="mob-input-wrapper"> |
| | | <span className="mob-input-insert" onClick={() => this.editDataSource()}> |
| | | <Icon type="plus" /> |
| | | </span> |
| | | </span> |
| | | </span> |
| | | </span> : null} |
| | | <Modal |
| | | wrapClassName="mob-datasource-verify-modal" |
| | | wrapClassName="mob-datasource-verify-modal popview-modal" |
| | | title={'数据源配置'} |
| | | visible={visible} |
| | | width={'75vw'} |
| | | maskClosable={false} |
| | | style={{minWidth: '900px', maxWidth: '1200px'}} |
| | | okText={dict['mob.submit']} |
| | | cancelText={dict['mob.cancel']} |
| | | onOk={this.verifySubmit} |
| | | confirmLoading={loading} |
| | | onCancel={() => { this.setState({ visible: false }) }} |