From 176c6e1da22e96a1110fa91f8fc8eb8ad2881e08 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 08 八月 2022 18:13:37 +0800 Subject: [PATCH] 2022-08-08 --- src/views/mobdesign/index.jsx | 34 +++++++++++++++++++++++++++------- 1 files changed, 27 insertions(+), 7 deletions(-) diff --git a/src/views/mobdesign/index.jsx b/src/views/mobdesign/index.jsx index f22b547..424b0e0 100644 --- a/src/views/mobdesign/index.jsx +++ b/src/views/mobdesign/index.jsx @@ -1625,16 +1625,16 @@ 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}銆嬫湭璁剧疆鑿滃崟鍙傛暟锛乣 @@ -1649,7 +1649,8 @@ } } 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 => { @@ -1659,7 +1660,7 @@ }) } - check(config.components) + check(config.components, 1, 'view') // if (!error && viewType === 'userbind' && config.components.filter(item => item.type === 'login').length === 0) { // error = '鐢ㄦ埛缁戝畾椤甸潰蹇呴』娣诲姞鐧诲綍銆�' @@ -1667,8 +1668,27 @@ 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) { -- Gitblit v1.8.0