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/comtableconfig/updatetable/index.jsx | 49 +++++++++++++++++++++++++++++++++++++++++-------- 1 files changed, 41 insertions(+), 8 deletions(-) diff --git a/src/templates/comtableconfig/updatetable/index.jsx b/src/templates/comtableconfig/updatetable/index.jsx index df7ef53..eb1cc76 100644 --- a/src/templates/comtableconfig/updatetable/index.jsx +++ b/src/templates/comtableconfig/updatetable/index.jsx @@ -110,7 +110,11 @@ let _tbs = [] if (config.tabgroups && config.tabgroups.length > 0) { config.tabgroups.forEach(m => { - 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(), @@ -119,7 +123,7 @@ setting: {}, style: {}, subtabs: m.sublist.map(n => { - let tab = { uuid: Utils.getuuid(), label: n.label, icon: n.icon, permission: 'false', components: [ + let tab = { uuid: Utils.getuuid(), label: n.label, icon: n.icon, permission: 'true', components: [ { uuid: Utils.getuuid(), linkTab: n.linkTab, @@ -187,11 +191,29 @@ } }) + 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 }) } @@ -790,7 +812,7 @@ action: [], subtype: 'basetable', setting: { useMSearch: newCon.useMSearch }, - wrap: {}, + wrap: {name: newCon.name}, style: {}, headerStyle: {}, columns: [], @@ -819,7 +841,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 @@ -890,7 +916,7 @@ if (_colspan.includes(col.field)) { _col.Hide = 'true' } - + _col.uuid = Utils.getuuid() _card.cols.push(_col) } @@ -901,14 +927,21 @@ 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' @@ -928,7 +961,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