| | |
| | | }) |
| | | } |
| | | |
| | | let fieldrepet = false // 字段重复 |
| | | |
| | | if (modalType === 'copy' && card.originUuid) { |
| | | if (_config.groups.length > 0) { |
| | | _config.groups = _config.groups.map(group => { |
| | |
| | | group.sublist.forEach((item, index) => { |
| | | if (item.uuid === card.originUuid) { |
| | | _index = index |
| | | } |
| | | |
| | | if (item.uuid !== res.uuid && item.field === res.field) { |
| | | fieldrepet = true |
| | | } |
| | | }) |
| | | |
| | |
| | | if (item.uuid === card.originUuid) { |
| | | _index = index |
| | | } |
| | | |
| | | if (item.uuid !== res.uuid && item.field === res.field) { |
| | | fieldrepet = true |
| | | } |
| | | }) |
| | | |
| | | _config.fields.splice(_index + 1, 0, res) |
| | |
| | | if (_config.groups.length > 0) { |
| | | _config.groups.forEach(group => { |
| | | group.sublist = group.sublist.map(item => { |
| | | if (item.uuid !== res.uuid && item.field === res.field) { |
| | | fieldrepet = true |
| | | } |
| | | |
| | | if (item.uuid === res.uuid) { |
| | | return res |
| | | } else { |
| | |
| | | }) |
| | | } else { |
| | | _config.fields = _config.fields.map(item => { |
| | | if (item.uuid !== res.uuid && item.field === res.field) { |
| | | fieldrepet = true |
| | | } |
| | | |
| | | if (item.uuid === res.uuid) { |
| | | return res |
| | | } else { |
| | |
| | | }) |
| | | } |
| | | } |
| | | |
| | | if (fieldrepet) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '字段名重复!', |
| | | duration: 10 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | _config.fields = _config.fields.filter(item => !item.origin) |
| | | |