From 21d92eff0e23974d76e3e5a79ba50e3fc1c0b879 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 15 四月 2022 01:08:15 +0800 Subject: [PATCH] 2022-04-15 --- src/views/mobdesign/index.jsx | 67 +++++++++++++++++++++++++-------- 1 files changed, 50 insertions(+), 17 deletions(-) diff --git a/src/views/mobdesign/index.jsx b/src/views/mobdesign/index.jsx index f630a78..98854e4 100644 --- a/src/views/mobdesign/index.jsx +++ b/src/views/mobdesign/index.jsx @@ -857,34 +857,58 @@ const { config } = this.state let traversal = (components) => { - let list = components.map(item => { + let list = [] + components.forEach(item => { let m = { key: item.uuid, title: item.name, children: [] } - if (item.type === 'topbar' || item.type === 'login' || item.type === 'navbar') { + if (item.type === 'topbar' || item.type === 'login' || item.type === 'navbar' || (item.type === 'menubar' && item.subtype === 'commonbar')) { return null } else if (item.type === 'tabs') { let tabs = [] + let mm = [] item.subtabs.forEach(tab => { let s = traversal(tab.components) if (s.length === 0) return - + tabs.push({ key: tab.uuid, title: tab.label, children: s }) + + mm.push(...s) }) if (tabs.length > 0) { m.children = tabs } + + if (item.setting.permission === 'true') { + list.push(m) + } else if (mm.length) { + list.push(...mm) + } + + return null } else if (item.type === 'group') { m.children = traversal(item.components) + + if (item.setting.permission === 'true') { + list.push(m) + } else if (m.children.length) { + list.push(...m.children) + } + + return null + } if (item.plot && item.plot.permission !== 'true') { + return null + } if (item.wrap && item.wrap.permission !== 'true') { + return null } else if (item.type === 'card' || (item.type === 'table' && item.subtype === 'tablecard')) { item.action && item.action.forEach(btn => { this.checkBtn(btn) @@ -961,10 +985,8 @@ }) } - return m + list.push(m) }) - - list = list.filter(Boolean) return list } @@ -1101,14 +1123,20 @@ config.enabled = false } - let roleParam = {type: 'view', key: config.uuid, title: config.MenuName, children: []} + let roleParam = {type: 'view', version: '1.0', key: config.uuid, title: config.MenuName, children: []} roleParam.children = this.getMenuMessage() config.loginview = false config.tabview = false + if (config.permission !== 'true') { + roleParam.pass = true + roleParam.children = [] + } + config.components.forEach(item => { if (item.type === 'login') { roleParam.login = true + roleParam.children = [] config.loginview = true } else if (item.type === 'navbar') { config.tabview = true @@ -1172,17 +1200,22 @@ let roles = { type: 'navbar', + version: '1.0', key: item.uuid, title: item.name, children: [] } - roles.children = item.menus.map(menu => { - return { - key: menu.MenuID, - title: menu.name - } - }) + if (item.wrap.permission === 'true') { + roles.children = item.menus.map(menu => { + return { + key: menu.MenuID, + title: menu.name + } + }) + } else { + roles.pass = true + } let _param = { func: 'sPC_TrdMenu_AddUpt', @@ -1369,7 +1402,7 @@ } verifyConfig = (show) => { - const { config, viewType } = this.state + const { config } = this.state let error = '' let searchSum = 0 let swipes = [] @@ -1437,9 +1470,9 @@ check(config.components) - if (!error && viewType === 'userbind' && config.components.filter(item => item.type === 'login').length === 0) { - error = '鐢ㄦ埛缁戝畾椤甸潰蹇呴』娣诲姞鐧诲綍銆�' - } + // if (!error && viewType === 'userbind' && config.components.filter(item => item.type === 'login').length === 0) { + // error = '鐢ㄦ埛缁戝畾椤甸潰蹇呴』娣诲姞鐧诲綍銆�' + // } if (!error && searchSum > 1) { error = '鎼滅储缁勪欢涓庡鑸爮鐨勬悳绱㈠姛鑳戒笉鍙悓鏃朵娇鐢ㄣ��' -- Gitblit v1.8.0