From bb348d1ca8802f35c77cd00c79068238a8ee601a Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 23 十一月 2021 09:47:13 +0800 Subject: [PATCH] 2021-11-23 --- src/menu/popview/index.jsx | 80 +++++++++++++++++++++++++++++----------- 1 files changed, 58 insertions(+), 22 deletions(-) diff --git a/src/menu/popview/index.jsx b/src/menu/popview/index.jsx index 9f1a385..413f6e9 100644 --- a/src/menu/popview/index.jsx +++ b/src/menu/popview/index.jsx @@ -268,13 +268,29 @@ _sort++ }) }) - } else if (item.type === 'line' || item.type === 'bar') { + } else if (item.type === 'carousel' || item.type === 'timeline') { + item.subcards.forEach(card => { + card.elements && card.elements.forEach(cell => { + if (cell.eleType !== 'button') return + this.checkBtn(cell) + buttons.push(`select '${cell.uuid}' as menuid, '${item.name + '-' + cell.label}' as menuname, '${_sort * 10}' as Sort`) + _sort++ + }) + }) + } else if (item.type === 'balcony') { + item.elements && item.elements.forEach(cell => { + if (cell.eleType !== 'button') return + this.checkBtn(cell) + buttons.push(`select '${cell.uuid}' as menuid, '${item.name + '-' + cell.label}' as menuname, '${_sort * 10}' as Sort`) + _sort++ + }) + } else if (item.type === 'line' || item.type === 'bar' || item.type === 'chart') { item.action && item.action.forEach(btn => { this.checkBtn(btn) buttons.push(`select '${btn.uuid}' as menuid, '${item.name + '-' + btn.label}' as menuname, '${_sort * 10}' as Sort`) _sort++ }) - } else if (item.type === 'table' && item.subtype === 'normaltable') { + } else if (item.type === 'table' && (item.subtype === 'normaltable' || item.subtype === 'editable')) { item.action && item.action.forEach(btn => { this.checkBtn(btn) buttons.push(`select '${btn.uuid}' as menuid, '${item.name + '-' + btn.label}' as menuname, '${_sort * 10}' as Sort`) @@ -497,27 +513,47 @@ const { config } = 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', 'stepform', 'tabform'].includes(item.subtype) && item.wrap.datatype === 'static') return + if (['balcony'].includes(item.type) && 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.primaryKey) { + error = `缁勪欢銆�${item.name}銆嬫湭璁剧疆涓婚敭锛乣 + } else if (!item.setting.supModule && item.type !== 'balcony') { + error = `缁勪欢銆�${item.name}銆嬫湭璁剧疆涓婄骇缁勪欢锛乣 + } + } + if (item.type === 'bar' || item.type === 'line' || item.type === 'pie') { + if (!item.plot.Xaxis) { + error = `缁勪欢銆�${item.name}銆嬪浘琛ㄥ瓧娈靛皻鏈缃紒` + } + } else if (item.type === 'dashboard' && !item.plot.valueField) { + error = `缁勪欢銆�${item.name}銆嬫樉绀哄�煎皻鏈缃紒` + } else if (item.type === 'scatter' && (!item.plot.Xaxis || !item.plot.Yaxis || !item.plot.gender)) { + error = `缁勪欢銆�${item.name}銆嬪潗鏍囪酱灏氭湭璁剧疆锛乣 + } else if (item.type === 'tree' && (!item.wrap.valueField || !item.wrap.labelField || !item.wrap.parentField)) { + 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) { - error = `缁勪欢銆�${item.name}銆嬫湭璁剧疆涓婚敭锛乣 - } else if (!item.setting.supModule) { - 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