From c39fc1db18c6d754312ccbc187f11076c203392b Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 22 十二月 2023 17:59:47 +0800 Subject: [PATCH] 2023-12-22 --- src/menu/components/share/pastecomponent/index.jsx | 28 ++++++++++++++++++++++------ 1 files changed, 22 insertions(+), 6 deletions(-) diff --git a/src/menu/components/share/pastecomponent/index.jsx b/src/menu/components/share/pastecomponent/index.jsx index 5c2b417..7f0b88c 100644 --- a/src/menu/components/share/pastecomponent/index.jsx +++ b/src/menu/components/share/pastecomponent/index.jsx @@ -168,13 +168,29 @@ } else if (type === 'cols') { config.cols = config.cols.filter(col => !col.origin) - let keys = config.cols.map(col => (col.field || '$empty')) - - res.cols.forEach(col => { - if (!keys.includes(col.field)) { - config.cols.push(col) + if (config.subtype === 'normaltable' && res.cols.length === 1) { + config.cols.push(...res.cols) + } else { + let keys = config.cols.map(col => (col.field || '$empty')) + + let cols = [] + res.cols.forEach(col => { + if (!col.field || !keys.includes(col.field)) { + cols.push(col) + } + }) + + if (cols.length === 0) { + notification.warning({ + top: 92, + message: '鏄剧ず鍒楀凡瀛樺湪锛�', + duration: 5 + }) + return + } else { + config.cols.push(...cols) } - }) + } } this.props.updateConfig(config, type) -- Gitblit v1.8.0