| | |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Popover, Modal, Button, Switch, notification, message } from 'antd' |
| | | import { PlusOutlined, SettingOutlined, EditOutlined, ToolOutlined, DeleteOutlined, SwapOutlined, FontColorsOutlined, VerticalRightOutlined } from '@ant-design/icons' |
| | | import { PlusOutlined, SettingOutlined, EditOutlined, ToolOutlined, DeleteOutlined, SwapOutlined, FontColorsOutlined } from '@ant-design/icons' |
| | | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import asyncIconComponent from '@/utils/asyncIconComponent' |
| | |
| | | } |
| | | } |
| | | |
| | | toLower = () => { |
| | | let group = fromJS(this.state.group).toJS() |
| | | let card = fromJS(this.state.card).toJS() |
| | | let that = this |
| | | |
| | | group.fields = group.fields.map(item => { |
| | | if (item.field) { |
| | | item.field = item.field.toLowerCase() |
| | | } |
| | | return item |
| | | }) |
| | | |
| | | card.subcards = card.subcards.map(item => { |
| | | if (item.uuid === group.uuid) { |
| | | return group |
| | | } |
| | | return item |
| | | }) |
| | | |
| | | confirm({ |
| | | content: `确定将字段转为小写吗?`, |
| | | onOk() { |
| | | that.setState({group}) |
| | | that.updateComponent(card) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | | } |
| | | |
| | | clickComponent = (e) => { |
| | | if (sessionStorage.getItem('style-control') === 'true' || sessionStorage.getItem('style-control') === 'component') { |
| | | e.stopPropagation() |
| | |
| | | } trigger="hover"> |
| | | <SwapOutlined /> |
| | | </Popover> : null} |
| | | <VerticalRightOutlined style={{color: 'orange', transform: 'rotate(270deg)'}} title="字段转小写" onClick={this.toLower}/> |
| | | <FormFork forms={group.fields}/> |
| | | {/* <CopyOutlined title="复制" onClick={this.triggerCopy} /> */} |
| | | <Switch checkedChildren="开" unCheckedChildren="关" defaultChecked={this.state.showField} onChange={(val) => this.setState({showField: val})} /> |