From e1dd5c756a849811518d2155ebaa1ec0094f31d4 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 08 四月 2021 14:39:24 +0800 Subject: [PATCH] 2021-04-08 --- src/views/menudesign/index.jsx | 49 +++++++++++++++++++++++++++++++------------------ 1 files changed, 31 insertions(+), 18 deletions(-) diff --git a/src/views/menudesign/index.jsx b/src/views/menudesign/index.jsx index 84cee4d..d474522 100644 --- a/src/views/menudesign/index.jsx +++ b/src/views/menudesign/index.jsx @@ -830,25 +830,38 @@ const { config, MenuType } = this.state let error = '' - config.components.forEach(item => { - if (error) return - if (['propcard', 'brafteditor', 'sandbox'].includes(item.subtype) && item.wrap.datatype === 'static') return + let check = (components) => { + components.forEach(item => { + if (error) return + if (item.type === 'tabs') { + item.subtabs.forEach(tab => { + check(tab.components) + }) + return + } else if (item.type === 'group') { + check(item.components) + return + } + if (['propcard', 'brafteditor', 'sandbox'].includes(item.subtype) && item.wrap.datatype === 'static') return + + if (item.setting) { + if (item.setting.interType === 'system' && item.setting.execute !== 'false' && !item.setting.dataresource) { + error = `缁勪欢銆�${item.name}銆嬫湭璁剧疆鏁版嵁婧愶紒` + } else if (item.setting.interType === 'system' && item.setting.execute === 'false' && item.scripts.length === 0) { + error = `缁勪欢銆�${item.name}銆嬫湭璁剧疆鏁版嵁婧愶紒` + } else if (item.setting.interType && !item.setting.primaryKey && MenuType !== 'billPrint') { + error = `缁勪欢銆�${item.name}銆嬫湭璁剧疆涓婚敭锛乣 + } + } + if (item.type === 'bar' || item.type === 'line' || item.type === 'pie') { + if (!item.plot.Xaxis) { + error = `缁勪欢銆�${item.name}銆嬪浘琛ㄥ瓧娈靛皻鏈缃紒` + } + } + }) + } - if (item.setting) { - if (item.setting.interType === 'system' && item.setting.execute !== 'false' && !item.setting.dataresource) { - error = `缁勪欢銆�${item.name}銆嬫湭璁剧疆鏁版嵁婧愶紒` - } else if (item.setting.interType === 'system' && item.setting.execute === 'false' && item.scripts.length === 0) { - error = `缁勪欢銆�${item.name}銆嬫湭璁剧疆鏁版嵁婧愶紒` - } else if (item.setting.interType && !item.setting.primaryKey && MenuType !== 'billPrint') { - error = `缁勪欢銆�${item.name}銆嬫湭璁剧疆涓婚敭锛乣 - } - } - if (item.type === 'bar' || item.type === 'line' || item.type === 'pie') { - if (!item.plot.Xaxis) { - error = `缁勪欢銆�${item.name}銆嬪浘琛ㄥ瓧娈靛皻鏈缃紒` - } - } - }) + check(config.components) if (show && error) { notification.warning({ -- Gitblit v1.8.0