| | |
| | | sysMenu: false, // 添加或编辑菜单(角色权限分配等) |
| | | optionLibs: [], // 自定义下拉选项库 |
| | | fstMenuId: null, // 一级菜单Id |
| | | fstMenuList: null, // 一级菜单列表 |
| | | roleList: null // 角色列表,建立黑名单 |
| | | fstMenuList: null // 一级菜单列表 |
| | | } |
| | | |
| | | /** |
| | |
| | | _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.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) |
| | |
| | | isSubtable: '', // 是否为主子表 |
| | | ParentID: this.props.supMenu.MenuID, |
| | | supMenuList: this.props.supMenuList, |
| | | roleList: this.state.roleList || [], |
| | | fstMenuId: this.state.fstMenuId, |
| | | fstMenuList: this.state.fstMenuList, |
| | | menuSort: (this.props.menulist.length + 1) * 10 // 新建菜单设置排序 |
| | |
| | | if (!editMenu.fstMenuId) { |
| | | editMenu.fstMenuId = this.state.fstMenuId |
| | | editMenu.fstMenuList = this.state.fstMenuList |
| | | editMenu.roleList = this.state.roleList || [] |
| | | } |
| | | |
| | | if (useType === 'sys' && template.type === 'RolePermission') { // 独立页面 |
| | |
| | | loading: true |
| | | }) |
| | | |
| | | let menuDefer = new Promise(resolve => { |
| | | Api.getSystemConfig(_param).then(result => { |
| | | if (result.status) { |
| | | this.setState({ |
| | | loading: false, |
| | | fstMenuId: result.FstIDSeleted, |
| | | fstMenuList: result.data.map(smenu => { |
| | | let _smenu = { |
| | |
| | | |
| | | return _smenu |
| | | }) |
| | | }) |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: result.message, |
| | | duration: 10 |
| | | }) |
| | | } |
| | | resolve() |
| | | }) |
| | | }) |
| | | |
| | | let roleDefer = new Promise(resolve => { |
| | | Api.getSystemConfig({func: 'sPC_Get_RolesMenu'}).then(res => { |
| | | if (res.status) { |
| | | this.setState({ |
| | | roleList: res.Roles.map(role => { |
| | | return { |
| | | uuid: Utils.getuuid(), |
| | | value: role.RoleID, |
| | | text: role.RoleName |
| | | } |
| | | }) |
| | | }) |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: res.message, |
| | | duration: 10 |
| | | }) |
| | | } |
| | | resolve() |
| | | }) |
| | | }) |
| | | |
| | | Promise.all([menuDefer, roleDefer]).then(() => { |
| | | this.setState({ |
| | | loading: false |
| | | }, () => { |
| | | let _menu = JSON.parse(JSON.stringify(this.state.editMenu)) |
| | | |
| | |
| | | delete _menu.loadingFstMenuId |
| | | _menu.fstMenuId = this.state.fstMenuId |
| | | _menu.fstMenuList = this.state.fstMenuList |
| | | _menu.roleList = this.state.roleList || [] |
| | | |
| | | this.setState({ |
| | | type: 'edit', |
| | |
| | | document.getElementById('root').style.overflowY = 'hidden' |
| | | }) |
| | | }) |
| | | } else { |
| | | this.setState({ |
| | | loading: false |
| | | }) |
| | | notification.warning({ |
| | | top: 92, |
| | | message: result.message, |
| | | duration: 10 |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |