From d941738da5fae4e27488b09933e76cdce2c50fe9 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 13 七月 2023 22:44:25 +0800 Subject: [PATCH] 2023-07-13 --- src/templates/treepageconfig/updatetable/index.jsx | 47 +++++++++++++++++++++++++++++++++++++++-------- 1 files changed, 39 insertions(+), 8 deletions(-) diff --git a/src/templates/treepageconfig/updatetable/index.jsx b/src/templates/treepageconfig/updatetable/index.jsx index 20a6753..5dc8c61 100644 --- a/src/templates/treepageconfig/updatetable/index.jsx +++ b/src/templates/treepageconfig/updatetable/index.jsx @@ -149,7 +149,11 @@ let _tbs = [] if (config.tabgroups && config.tabgroups.length > 0) { config.tabgroups.forEach((m, i) => { - if (!m.sublist || m.sublist.length === 0) return + if (!m.sublist) return + + m.sublist = m.sublist.filter(c => !!c.linkTab) + + if (m.sublist.length === 0) return let tabs = { uuid: Utils.getuuid(), @@ -179,7 +183,7 @@ } } - let tab = { uuid: Utils.getuuid(), controlVal: level, label: n.label, icon: n.icon, permission: 'false', components: [ + let tab = { uuid: Utils.getuuid(), controlVal: level, label: n.label, icon: n.icon, permission: 'true', components: [ { uuid: Utils.getuuid(), linkTab: n.linkTab, @@ -247,11 +251,28 @@ } }) + let supIds = [] _config.components = _config.components.map(item => { if (item.type === 'tabs') { item.subtabs = item.subtabs.map(tab => { tab.components[0] = this.getTable(menus[tab.components[0].linkTab], tab.components[0], errors, formActions, popActions, oldtabs) + supIds.push([item.uuid, tab.uuid, tab.components[0].uuid]) + return tab + }) + } + return item + }) + _config.components = _config.components.map(item => { + if (item.type === 'tabs') { + item.subtabs = item.subtabs.map(tab => { + if (tab.components[0].setting.supModule && tab.components[0].setting.supModule.length === 1) { + supIds.forEach(ids => { + if (ids[2] === tab.components[0].setting.supModule[0]) { + tab.components[0].setting.supModule = ids + } + }) + } return tab }) } @@ -833,7 +854,7 @@ action: [], subtype: 'normaltable', setting: { useMSearch: 'false', sync: 'false', onload: 'true' }, - wrap: {}, + wrap: {name: newCon.name}, style: {}, headerStyle: {}, columns: [], @@ -862,7 +883,11 @@ let lineMarks = [] config.columns.forEach(col => { if (col.type === 'colspan') { - _colspan.push(...col.subfield.split(', ')) + if (col.subfield) { + _colspan.push(...col.subfield.split(', ')) + } else if (col.sublist && col.sublist.length > 0) { + _colspan.push(...col.sublist) + } } if (!col.field) return @@ -933,7 +958,7 @@ if (_colspan.includes(col.field)) { _col.Hide = 'true' } - + _col.uuid = Utils.getuuid() _card.cols.push(_col) } @@ -944,14 +969,20 @@ label: col.label, marks: [], isSub: false, - uuid: col.uuid, + uuid: Utils.getuuid(), blacklist: [] + } + let _subs = [] + if (col.subfield) { + _subs = col.subfield.split(', ') + } else if (col.sublist) { + _subs = col.sublist } if (col.unfold === 'true') { ucol.type = 'colspan' ucol.subcols = [] - col.subfield.split(', ').forEach(sub => { + _subs.forEach(sub => { if (_cols[sub]) { let _col = fromJS(_cols[sub]).toJS() _col.Hide = 'false' @@ -971,7 +1002,7 @@ ucol.elements = [] ucol.style = {paddingTop: '12px', paddingLeft: '8px', paddingBottom: '12px', paddingRight: '8px'} - col.subfield.split(', ').forEach(sub => { + _subs.forEach(sub => { if (_cols[sub]) { let _col = { copyable: 'false', -- Gitblit v1.8.0