| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { Transfer } from 'antd' |
| | | |
| | | import zhCN from '@/locales/zh-CN/share.js' |
| | | import enUS from '@/locales/en-US/share.js' |
| | | import './index.scss' |
| | | |
| | | class TransferForm extends Component { |
| | | static propTypes = { |
| | | menulist: PropTypes.array, |
| | | dict: PropTypes.object, // 字典项 |
| | | menulist: PropTypes.array |
| | | } |
| | | |
| | | state = { |
| | | dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, |
| | | targetKeys: [], |
| | | selectedKeys: [] |
| | | } |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { targetKeys, selectedKeys } = this.state |
| | | const { targetKeys, selectedKeys, dict } = this.state |
| | | |
| | | return ( |
| | | <div className="trawmenutransfer"> |
| | | <Transfer |
| | | dataSource={this.props.menulist} |
| | | titles={[this.props.dict['header.menu.thawmenu.source'], this.props.dict['header.menu.thawmenu.target']]} |
| | | titles={[dict['thawmenu.source'], dict['thawmenu.target']]} |
| | | targetKeys={targetKeys} |
| | | locale={{itemUnit: this.props.dict['header.menu.thawmenu.itemUnit'], itemsUnit: this.props.dict['header.menu.thawmenu.itemsUnit']}} |
| | | locale={{itemUnit: dict['thawmenu.itemUnit'], itemsUnit: dict['thawmenu.itemsUnit']}} |
| | | selectedKeys={selectedKeys} |
| | | onChange={this.handleChange} |
| | | onSelectChange={this.handleSelectChange} |