From 696d85238a734a4b691f486fde05c93fc5dba3ab Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 07 一月 2021 19:16:18 +0800 Subject: [PATCH] 2021-01-07 --- src/tabviews/custom/index.jsx | 129 ++++++++++++++++++++----------------------- 1 files changed, 60 insertions(+), 69 deletions(-) diff --git a/src/tabviews/custom/index.jsx b/src/tabviews/custom/index.jsx index 10940f8..47a8849 100644 --- a/src/tabviews/custom/index.jsx +++ b/src/tabviews/custom/index.jsx @@ -248,87 +248,78 @@ } // 鏉冮檺杩囨护 - if (this.props.menuType !== 'HS') { - if (item.action && item.action.length > 0) { - item.action = item.action.filter(cell => { - cell.logLabel = item.name + '-' + cell.label - cell.ContainerId = this.state.ContainerId - cell.$menuId = item.uuid + let isHS = this.props.menuType === 'HS' + if (item.action && item.action.length > 0) { + item.action = item.action.filter(cell => { + cell.logLabel = item.name + '-' + cell.label + cell.ContainerId = this.state.ContainerId + cell.$menuId = item.uuid - return permAction[cell.uuid] - }) - } - if (item.type === 'card') { - item.subcards.forEach(card => { - let _hasheight = card.style.height && card.style.height !== 'auto' + return isHS || permAction[cell.uuid] + }) + } + if (item.type === 'card') { + item.subcards.forEach(card => { + let _hasheight = card.style.height && card.style.height !== 'auto' - if (card.style.shadow) { // 鍗$墖闃村奖 - card.style.boxShadow = '0 0 4px ' + card.style.shadow - delete card.style.shadow - } + if (card.style.shadow) { // 鍗$墖闃村奖 + card.style.boxShadow = '0 0 4px ' + card.style.shadow + delete card.style.shadow + } - card.elements = card.elements.filter(cell => { - if (cell.eleType === 'button') { - cell.logLabel = item.name + '-' + cell.label - cell.Ot = 'requiredSgl' - cell.ContainerId = this.state.ContainerId - cell.$menuId = item.uuid - } else if (['text', 'number', 'link'].includes(cell.eleType) && !cell.height && _hasheight) { - cell.innerHeight = 'auto' - } - - return cell.eleType !== 'button' || permAction[cell.uuid] - }) - card.backElements = card.backElements.filter(cell => { - if (cell.eleType === 'button') { - cell.logLabel = item.name + '-' + cell.label - cell.Ot = 'requiredSgl' - cell.ContainerId = this.state.ContainerId - cell.$menuId = item.uuid - } else if (['text', 'number', 'link'].includes(cell.eleType) && !cell.height && _hasheight) { - cell.innerHeight = 'auto' - } - return cell.eleType !== 'button' || permAction[cell.uuid] - }) - }) - } else if (item.type === 'table' && item.subtype === 'tablecard') { - item.subcards.forEach(card => { - let _hasheight = card.style.height && card.style.height !== 'auto' - card.elements = card.elements.filter(cell => { - if (cell.eleType === 'button') { - cell.logLabel = item.name + '-' + cell.label - cell.Ot = 'requiredSgl' - cell.ContainerId = this.state.ContainerId - cell.$menuId = item.uuid - } else if (['text', 'number', 'link'].includes(cell.eleType) && !cell.height && _hasheight) { - cell.innerHeight = 'auto' - } - return cell.eleType !== 'button' || permAction[cell.uuid] - }) - }) - } else if (item.type === 'table' && item.subtype === 'normaltable') { - item.cols = item.cols.filter(col => { - if (col.type !== 'action') return true - col.elements = col.elements.filter(cell => { + card.elements = card.elements.filter(cell => { + if (cell.eleType === 'button') { cell.logLabel = item.name + '-' + cell.label cell.Ot = 'requiredSgl' cell.ContainerId = this.state.ContainerId cell.$menuId = item.uuid + } else if (['text', 'number', 'link'].includes(cell.eleType) && !cell.height && _hasheight) { + cell.innerHeight = 'auto' + } - return permAction[cell.uuid] - }) - return col.elements.length !== 0 + return cell.eleType !== 'button' || isHS || permAction[cell.uuid] }) - } - } else { - if (item.action && item.action.length > 0) { - item.action = item.action.map(cell => { + card.backElements = card.backElements.filter(cell => { + if (cell.eleType === 'button') { + cell.logLabel = item.name + '-' + cell.label + cell.Ot = 'requiredSgl' + cell.ContainerId = this.state.ContainerId + cell.$menuId = item.uuid + } else if (['text', 'number', 'link'].includes(cell.eleType) && !cell.height && _hasheight) { + cell.innerHeight = 'auto' + } + return cell.eleType !== 'button' || isHS || permAction[cell.uuid] + }) + }) + } else if (item.type === 'table' && item.subtype === 'tablecard') { + item.subcards.forEach(card => { + let _hasheight = card.style.height && card.style.height !== 'auto' + card.elements = card.elements.filter(cell => { + if (cell.eleType === 'button') { + cell.logLabel = item.name + '-' + cell.label + cell.Ot = 'requiredSgl' + cell.ContainerId = this.state.ContainerId + cell.$menuId = item.uuid + } else if (['text', 'number', 'link'].includes(cell.eleType) && !cell.height && _hasheight) { + cell.innerHeight = 'auto' + } + return cell.eleType !== 'button' || isHS || permAction[cell.uuid] + }) + }) + } else if (item.type === 'table' && item.subtype === 'normaltable') { + item.cols = item.cols.filter(col => { + if (col.type !== 'action') return true + col.elements = col.elements.filter(cell => { cell.logLabel = item.name + '-' + cell.label + cell.Ot = 'requiredSgl' + cell.ContainerId = this.state.ContainerId cell.$menuId = item.uuid - return cell + + return isHS || permAction[cell.uuid] }) - } - } + return col.elements.length !== 0 + }) + } if (item.setting && item.setting.supModule) { let pid = item.setting.supModule.slice(-1)[0] -- Gitblit v1.8.0