From 4b467effbc0e3a9199146573c0ceedf404bd07c5 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 07 九月 2023 17:16:01 +0800 Subject: [PATCH] 2023-09-07 --- src/utils/utils-custom.js | 54 +++++++++++------------------------------------------- 1 files changed, 11 insertions(+), 43 deletions(-) diff --git a/src/utils/utils-custom.js b/src/utils/utils-custom.js index edd4314..e6dd77b 100644 --- a/src/utils/utils-custom.js +++ b/src/utils/utils-custom.js @@ -1227,50 +1227,16 @@ * @description 鑾峰彇鎺ュ彛鍙婂嚱鏁� */ export function getFuncsAndInters (config) { - let inters = [] - // let funcs = [] + let inters = 'false' let filterBtn = (cell) => { - if (cell.intertype === 'inner') { - // funcs.push(cell.innerFunc) - } else if (cell.intertype === 'outer' || cell.intertype === 'custom') { - // if (cell.innerFunc) { - // funcs.push(cell.innerFunc) - // } - // if (cell.outerFunc) { - // funcs.push(cell.outerFunc) - // } - if (cell.interface && cell.sysInterface !== 'true') { - inters.push(cell.interface) - } - if (cell.proInterface) { - inters.push(cell.proInterface) - } - // if (cell.callbackFunc) { - // funcs.push(cell.callbackFunc) - // } - } - } - - let filterSetting = (item) => { - if (!item.setting) return - if (item.setting.interType === 'inner') { - // funcs.push(item.setting.innerFunc) - } else if (item.setting.interType === 'outer') { - // if (item.setting.outerFunc) { - // funcs.push(item.setting.outerFunc) - // } - if (item.setting.interface && item.setting.sysInterface !== 'true') { - inters.push(item.setting.interface) - } - if (item.setting.proInterface) { - inters.push(item.setting.proInterface) - } + if ((cell.intertype === 'outer' && cell.sysInterface !== 'true') || cell.intertype === 'custom') { + inters = 'true' } } let traversal = (components) => { - if (!components) return + if (!components || inters === 'true') return components.forEach(item => { if (item.type === 'tabs') { @@ -1280,7 +1246,9 @@ } else if (item.type === 'group') { traversal(item.components) } else { - filterSetting(item) + if (item.setting && item.setting.interType === 'outer' && item.setting.sysInterface !== 'true') { + inters = 'true' + } if (item.action) { item.action.forEach(cell => { @@ -1363,15 +1331,15 @@ if (config.interfaces) { config.interfaces.forEach(item => { - filterSetting(item) + if (item.setting && item.setting.interType === 'outer' && item.setting.sysInterface !== 'true') { + inters = 'true' + } }) } traversal(config.components) - // inters = Array.from(new Set(inters)) - - return inters.length > 0 ? 'true' : 'false' + return inters } /** -- Gitblit v1.8.0