| | |
| | | import { DndProvider } from 'react-dnd' |
| | | import HTML5Backend from 'react-dnd-html5-backend' |
| | | import { Button, Card, Modal, Collapse, Switch, message, Popover } from 'antd' |
| | | import { SettingOutlined, CopyOutlined, SwapOutlined, DeleteOutlined, VerticalRightOutlined } from '@ant-design/icons' |
| | | import { SettingOutlined, CopyOutlined, SwapOutlined, DeleteOutlined } from '@ant-design/icons' |
| | | |
| | | import { getModalForm } from '@/templates/zshare/formconfig' |
| | | import SourceElement from '@/templates/modalconfig/dragelement/source' |
| | |
| | | }) |
| | | } |
| | | |
| | | toLower = () => { |
| | | let _config = fromJS(this.state.config).toJS() |
| | | let that = this |
| | | |
| | | _config.fields = _config.fields.map(item => { |
| | | if (item.field) { |
| | | item.field = item.field.toLowerCase() |
| | | } |
| | | return item |
| | | }) |
| | | |
| | | confirm({ |
| | | content: `确定将字段转为小写吗?`, |
| | | onOk() { |
| | | that.setState({ |
| | | config: _config |
| | | }) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | | } |
| | | |
| | | triggerCopy = () => { |
| | | const { config } = this.state |
| | | |
| | |
| | | } trigger="hover"> |
| | | <SwapOutlined /> |
| | | </Popover> |
| | | <VerticalRightOutlined style={{color: 'orange', transform: 'rotate(270deg)'}} title="字段转小写" onClick={this.toLower}/> |
| | | <FormFork forms={config.fields}/> |
| | | <CopyOutlined title="复制" onClick={this.triggerCopy} /> |
| | | <Switch checkedChildren="开" unCheckedChildren="关" defaultChecked={this.state.showField} onChange={(val) => this.setState({showField: val})} /> |