| | |
| | | * @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') { |
| | |
| | | } 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 => { |
| | |
| | | |
| | | 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 |
| | | } |
| | | |
| | | /** |