| | |
| | | delete _menu.src |
| | | delete _menu.text |
| | | |
| | | if (!this.state.fstMenuId) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '未获取到一级菜单信息,请稍等或刷新重试。', |
| | | duration: 10 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | _menu.ParentID = this.props.supMenu.MenuID |
| | | _menu.supMenuList = this.props.supMenuList |
| | | _menu.fstMenuId = this.state.fstMenuId |
| | | _menu.fstMenuList = this.state.fstMenuList |
| | | _menu.roleList = this.state.roleList |
| | | |
| | | if (_menu.PageParam && _menu.PageParam.Template === 'RolePermission') { // 单页面修改 |
| | | _menu.Template = _menu.PageParam.Template |
| | | |
| | | if (!this.state.fstMenuId) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '菜单加载中,请稍后重试!', |
| | | duration: 10 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | _menu.ParentID = this.props.supMenu.MenuID |
| | | _menu.supMenuList = this.props.supMenuList |
| | | _menu.fstMenuId = this.state.fstMenuId || '' |
| | | _menu.fstMenuList = this.state.fstMenuList || [] |
| | | _menu.roleList = this.state.roleList |
| | | |
| | | this.setState({ |
| | | handleMVisible: true, |
| | |
| | | } |
| | | |
| | | _menu.LongParam = _LongParam |
| | | |
| | | _menu.ParentID = this.props.supMenu.MenuID |
| | | _menu.supMenuList = this.props.supMenuList |
| | | _menu.fstMenuId = this.state.fstMenuId || '' |
| | | _menu.fstMenuList = this.state.fstMenuList || [] |
| | | _menu.roleList = this.state.roleList |
| | | |
| | | // 检测模板是否存在 |
| | | let _Template = this.state.sysTemplates.filter(temp => temp.type === _menu.PageParam.Template) |
| | |
| | | }, () => { |
| | | document.getElementById('root').style.overflowY = 'hidden' |
| | | }) |
| | | } else { |
| | | } else if (_menu.fstMenuId) { |
| | | this.setState({ |
| | | type: 'edit', |
| | | editMenu: _menu, |
| | |
| | | tabview: _menu.PageParam.Template |
| | | }, () => { |
| | | document.getElementById('root').style.overflowY = 'hidden' |
| | | }) |
| | | } else { |
| | | _menu.loadingFstMenuId = true |
| | | this.setState({ |
| | | type: 'edit', |
| | | editMenu: _menu, |
| | | optionLibs: new Map() |
| | | }) |
| | | } |
| | | } else { |
| | |
| | | if (!this.state.fstMenuId) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '未获取到一级菜单信息,请稍等或刷新重试', |
| | | message: '菜单加载中,请稍后重试!', |
| | | duration: 10 |
| | | }) |
| | | return |
| | |
| | | * 2、使用已有菜单模板时,获取菜单配置信息,标记为user(复制菜单按钮) |
| | | */ |
| | | useTemplate = (template, useType) => { |
| | | const { editMenu } = this.state |
| | | let editMenu = JSON.parse(JSON.stringify(this.state.editMenu)) |
| | | |
| | | if (!this.state.fstMenuId) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '菜单加载中,请稍后重试!', |
| | | duration: 10 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | if (!editMenu.fstMenuId) { |
| | | editMenu.fstMenuId = this.state.fstMenuId |
| | | editMenu.fstMenuList = this.state.fstMenuList |
| | | } |
| | | |
| | | if (useType === 'sys' && template.type === 'RolePermission') { // 独立页面 |
| | | let _menu = { |
| | | ...template, |
| | | ...editMenu, |
| | | MenuID: Utils.getuuid(), |
| | | MenuName: template.title, |
| | | Template: template.type, |
| | |
| | | Promise.all([menuDefer, roleDefer]).then(() => { |
| | | this.setState({ |
| | | loading: false |
| | | }, () => { |
| | | let _menu = JSON.parse(JSON.stringify(this.state.editMenu)) |
| | | |
| | | if (!_menu || !_menu.loadingFstMenuId) { |
| | | return |
| | | } |
| | | |
| | | delete _menu.loadingFstMenuId |
| | | _menu.fstMenuId = this.state.fstMenuId |
| | | _menu.fstMenuList = this.state.fstMenuList |
| | | |
| | | this.setState({ |
| | | type: 'edit', |
| | | editMenu: _menu, |
| | | loading: false, |
| | | optionLibs: new Map(), // 编辑时,初始化为空 |
| | | tabview: _menu.PageParam.Template |
| | | }, () => { |
| | | document.getElementById('root').style.overflowY = 'hidden' |
| | | }) |
| | | }) |
| | | }) |
| | | } |