king
2022-09-06 bdfec44c9f3a37dbbe05bf14a252ffec04132a86
src/views/design/sidemenu/index.jsx
@@ -46,8 +46,15 @@
    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({
@@ -117,6 +124,11 @@
      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
@@ -295,7 +307,7 @@
                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>
                }