| | |
| | | menu = fromJS(menu).toJS() |
| | | let openKey = '' |
| | | |
| | | if (menu.children[0]) { |
| | | openKey = menu.openId || menu.children[0].MenuID |
| | | // 菜单更新时,展开原二级菜单 |
| | | if (this.props.mainMenu && menu.MenuID === this.props.mainMenu.MenuID && this.state.openKeys && this.state.openKeys[0]) { |
| | | openKey = this.state.openKeys[0] |
| | | if (menu.children.filter(m => m.MenuID === openKey).length === 0) { |
| | | openKey = '' |
| | | } |
| | | } |
| | | if (!openKey && menu.children[0]) { |
| | | openKey = menu.children[0].MenuID |
| | | } |
| | | |
| | | this.setState({ |
| | |
| | | let _param = window.btoa(window.encodeURIComponent(JSON.stringify(cell))) |
| | | |
| | | window.open(`#/basedesign/${_param}`) |
| | | } else if (cell.type === 'BaseTable') { |
| | | sessionStorage.setItem('menuTree', JSON.stringify(this.props.menuTree)) |
| | | let _param = window.btoa(window.encodeURIComponent(JSON.stringify(cell))) |
| | | |
| | | window.open(`#/tabledesign/${_param}`) |
| | | } else if (['RolePermission', 'NewPage'].includes(cell.type)) { |
| | | let _cell = fromJS(cell).toJS() |
| | | _cell.Template = _cell.PageParam.Template |
| | |
| | | key={item.MenuID} |
| | | title={ |
| | | <span className={!editLevel && index === 0 ? 'edit-control' : ''}> |
| | | <MkIcon type={item.PageParam.Icon} /> |
| | | <MkIcon type={item.PageParam ? item.PageParam.Icon : 'folder'} /> |
| | | <span>{item.MenuName}</span> |
| | | </span> |
| | | } |