| | |
| | | } |
| | | |
| | | // 权限过滤 |
| | | 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] |