| | |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { DndProvider, DragSource, DropTarget } from 'react-dnd' |
| | | import { Table, Popover, Modal, message } from 'antd' |
| | | import { Table, Popover, Modal, message, notification } from 'antd' |
| | | import { PlusOutlined, EditOutlined, CopyOutlined, DeleteOutlined, FontColorsOutlined, CloseCircleOutlined, AntDesignOutlined } from '@ant-design/icons' |
| | | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | |
| | | } |
| | | } |
| | | |
| | | submitCol = (col) => { |
| | | const { card } = this.state |
| | | submitCol = (col, resolve) => { |
| | | const { card, columns } = this.state |
| | | |
| | | col.uuid = card.uuid |
| | | col.isSub = card.isSub === true |
| | |
| | | col.elements = card.type === 'action' ? (card.elements || []) : [] |
| | | } |
| | | |
| | | if (!col.field || col.isSub) { |
| | | resolve() |
| | | } else { |
| | | let _cols = [] |
| | | columns.forEach(c => { |
| | | if (c.field && col.uuid !== c.uuid) { |
| | | _cols.push(c.field.toLowerCase()) |
| | | } |
| | | }) |
| | | |
| | | if (_cols.includes(col.field.toLowerCase())) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '字段已存在!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } else { |
| | | resolve() |
| | | } |
| | | } |
| | | |
| | | this.setState({card: null}) |
| | | this.updateCol(col) |
| | | } |