From ab262bbe2c64ba086a14f181e5a27eba4b46b555 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 13 十月 2023 17:59:53 +0800 Subject: [PATCH] 2023-10-13 --- src/menu/components/share/pastecomponent/index.jsx | 16 ++++++++++++++-- 1 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/menu/components/share/pastecomponent/index.jsx b/src/menu/components/share/pastecomponent/index.jsx index 5c2b417..d809808 100644 --- a/src/menu/components/share/pastecomponent/index.jsx +++ b/src/menu/components/share/pastecomponent/index.jsx @@ -170,11 +170,23 @@ let keys = config.cols.map(col => (col.field || '$empty')) + let cols = [] res.cols.forEach(col => { - if (!keys.includes(col.field)) { - config.cols.push(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