From 2031a460f6c0827fe80f8c625dd98333d1631d2f Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 08 五月 2020 22:10:48 +0800 Subject: [PATCH] 2020-05-08 --- src/tabviews/managetable/index.jsx | 29 +++++++++++++++++++++++------ 1 files changed, 23 insertions(+), 6 deletions(-) diff --git a/src/tabviews/managetable/index.jsx b/src/tabviews/managetable/index.jsx index 33ac0d0..9016520 100644 --- a/src/tabviews/managetable/index.jsx +++ b/src/tabviews/managetable/index.jsx @@ -159,11 +159,28 @@ }) } + // 鍏煎鏍囩 + if (!config.tabgroups) { + config.tabgroups = [{ uuid: 'tabs', sublist: [] }] + } else if (typeof(config.tabgroups[0]) === 'string') { + let _tabgroups = [] + config.tabgroups.forEach(groupId => { + let _group = { + uuid: groupId, + sublist: fromJS(config[groupId]).toJS() + } + + delete config[groupId] + + _tabgroups.push(_group) + }) + + config.tabgroups = _tabgroups + } + let custabs = ['1586577325055l2ng7t75g7i4ek2ng8o'] config.tabgroups.forEach(group => { - if (!config[group]) return - - config[group] = config[group].map(tab => { + group.sublist = group.sublist.map(tab => { if (custabs.includes(tab.linkTab)) { tab.type = 'SecretKeyTable' } @@ -882,11 +899,11 @@ } {setting && setting.onload !== 'false' && config.tabgroups.map(group => { - if (config[group].length === 0) return null + if (group.sublist.length === 0) return null return ( - <Tabs defaultActiveKey="0" key={group}> - {config[group].map((_tab, index) => { + <Tabs defaultActiveKey="0" key={group.uuid}> + {group.sublist.map((_tab, index) => { return ( <TabPane tab={ <span> -- Gitblit v1.8.0