| | |
| | | let searchSum = 0 |
| | | let swipes = [] |
| | | |
| | | let check = (components) => { |
| | | let check = (components, level, sign) => { |
| | | components.forEach(item => { |
| | | if (error) return |
| | | if (item.type === 'tabs') { |
| | | item.subtabs.forEach(tab => { |
| | | check(tab.components) |
| | | check(tab.components, level + 1, tab.uuid) |
| | | }) |
| | | return |
| | | } else if (item.type === 'group') { |
| | | check(item.components) |
| | | check(item.components, level, sign) |
| | | return |
| | | } else if (item.type === 'navbar' && !item.wrap.MenuNo) { |
| | | error = `导航栏《${item.name}》未设置菜单参数!` |
| | |
| | | } |
| | | } |
| | | if (item.wrap && item.wrap.pagestyle === 'slide' && item.pageable && item.setting.laypage !== 'false') { |
| | | swipes.push(item.name) |
| | | // swipes.push(item.name) |
| | | swipes.push({level, name: item.name, sign}) |
| | | } |
| | | |
| | | item.errors && item.errors.forEach(err => { |
| | |
| | | }) |
| | | } |
| | | |
| | | check(config.components) |
| | | check(config.components, 1, 'view') |
| | | |
| | | // if (!error && viewType === 'userbind' && config.components.filter(item => item.type === 'login').length === 0) { |
| | | // error = '用户绑定页面必须添加登录。' |
| | |
| | | |
| | | if (!error && searchSum > 1) { |
| | | error = '搜索组件与导航栏的搜索功能不可同时使用。' |
| | | } else if (!error && swipes.length > 1) { |
| | | error = `页面中不可同时使用多个滑动加载组件。(${swipes.join('、')})` |
| | | } else if (!error && swipes.length > 0) { |
| | | swipes.forEach(cell => { |
| | | if (!error && cell.level > 2) { |
| | | error = `不可在多层标签页中使用滑动加载组件。(${cell.name})` |
| | | } |
| | | }) |
| | | if (!error) { |
| | | let levels = swipes.map(s => s.level) |
| | | levels = Array.from(new Set(levels)) |
| | | if (levels.length > 1) { |
| | | error = `不可在页面与标签页中同时使用滑动加载组件。(${swipes.map(s => s.name).join('、')})` |
| | | } |
| | | } |
| | | |
| | | if (!error) { |
| | | let signs = swipes.map(s => s.sign) |
| | | signs = Array.from(new Set(signs)) |
| | | if (signs.length !== swipes.length) { |
| | | error = `页面中(或同一标签页中)不可同时使用多个滑动加载组件。(${swipes.map(s => s.name).join('、')})` |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (show && error) { |