| | |
| | | } |
| | | |
| | | let _groups = null |
| | | let fieldrepet = false // 字段重复 |
| | | let fieldrepet = false // 字段重复 |
| | | let labelrepeat = false // 提示文字重复 |
| | | |
| | | if (card.iscopy) { |
| | | _groups = _config.groups.map(group => { |
| | |
| | | |
| | | if (item.uuid !== res.uuid && item.field === res.field) { |
| | | fieldrepet = true |
| | | } else if (item.uuid !== res.uuid && item.field && item.label === res.label) { |
| | | labelrepeat = true |
| | | } |
| | | }) |
| | | |
| | |
| | | group.sublist = group.sublist.map(item => { |
| | | if (item.uuid !== res.uuid && item.field === res.field) { |
| | | fieldrepet = true |
| | | } else if (item.uuid !== res.uuid && item.field && item.label === res.label) { |
| | | labelrepeat = true |
| | | } |
| | | |
| | | if (item.uuid === res.uuid) { |
| | |
| | | if (fieldrepet) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '字段名重复!', |
| | | message: '字段已存在!', |
| | | duration: 10 |
| | | }) |
| | | return |
| | | } else if (labelrepeat) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '名称已存在!', |
| | | duration: 10 |
| | | }) |
| | | return |
| | |
| | | |
| | | this.pasteFormRef.handleConfirm().then(res => { |
| | | if (res.copyType === 'form') { |
| | | let repeat = false |
| | | |
| | | _config.groups.forEach(group => { |
| | | let item = group.sublist.filter(cell => cell.field === res.field)[0] |
| | | if (item) { |
| | | repeat = true |
| | | } |
| | | |
| | | if (group.isDefault) { |
| | | group.sublist.push(res) |
| | | } |
| | |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '不支持此表单类型!', |
| | | duration: 10 |
| | | }) |
| | | return |
| | | } else if (repeat) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '此表单字段已存在!', |
| | | duration: 10 |
| | | }) |
| | | return |