From 4c6bdfe1f3557e49a315c1564bcb6164c0bc7faa Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 03 四月 2020 18:27:22 +0800 Subject: [PATCH] 2020-04-03 --- src/templates/formtabconfig/index.jsx | 30 ++++++++++++++---------------- 1 files changed, 14 insertions(+), 16 deletions(-) diff --git a/src/templates/formtabconfig/index.jsx b/src/templates/formtabconfig/index.jsx index 6ad7d4f..06f41ef 100644 --- a/src/templates/formtabconfig/index.jsx +++ b/src/templates/formtabconfig/index.jsx @@ -658,7 +658,8 @@ } let _groups = null - let fieldrepet = false // 瀛楁閲嶅 + let fieldrepet = false // 瀛楁閲嶅 + let labelrepeat = false // 鎻愮ず鏂囧瓧閲嶅 if (card.iscopy) { _groups = _config.groups.map(group => { @@ -670,6 +671,8 @@ 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 } }) @@ -687,6 +690,8 @@ 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) { @@ -705,7 +710,14 @@ if (fieldrepet) { notification.warning({ top: 92, - message: '瀛楁鍚嶉噸澶嶏紒', + message: '瀛楁宸插瓨鍦紒', + duration: 10 + }) + return + } else if (labelrepeat) { + notification.warning({ + top: 92, + message: '鍚嶇О宸插瓨鍦紒', duration: 10 }) return @@ -1871,14 +1883,7 @@ 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) } @@ -1888,13 +1893,6 @@ notification.warning({ top: 92, message: '涓嶆敮鎸佹琛ㄥ崟绫诲瀷锛�', - duration: 10 - }) - return - } else if (repeat) { - notification.warning({ - top: 92, - message: '姝よ〃鍗曞瓧娈靛凡瀛樺湪锛�', duration: 10 }) return -- Gitblit v1.8.0