| | |
| | | |
| | | state = { |
| | | dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, |
| | | menulist: null, // 菜单列表 |
| | | type: '', // 编辑类型,add or edit |
| | | title: '', // 模态框标题 |
| | | visible: null, // 模态框是否可见 |
| | | formlist: null, // 表单信息 |
| | | editMenu: null, // 编辑菜单 |
| | | thawmenulist: null, // 已冻结的二级菜单 |
| | | thawMvisible: false, // 解除冻结模态框 |
| | | confirmLoading: false // 提交中。。。 |
| | | menulist: null, // 菜单列表 |
| | | type: '', // 编辑类型,add or edit |
| | | title: '', // 模态框标题 |
| | | visible: null, // 模态框是否可见 |
| | | formlist: null, // 表单信息 |
| | | editMenu: null, // 编辑菜单 |
| | | thawmenulist: null, // 已冻结的二级菜单 |
| | | thawMvisible: false, // 解除冻结模态框 |
| | | confirmLoading: false, // 提交中。。。 |
| | | targetKeys: [] // 解冻菜单列表 |
| | | } |
| | | |
| | | handlePreviewList = (List) => { |
| | |
| | | }) |
| | | } else if (type === 'thaw') { // 解冻已有菜单 |
| | | this.setState({ |
| | | thawMvisible: true |
| | | thawMvisible: true, |
| | | targetKeys: [] |
| | | }) |
| | | Api.getSystemConfig({ |
| | | func: 'sPC_Get_FrozenMenu', |
| | |
| | | } |
| | | |
| | | thawMemuSubmit = () => { // 解冻菜单,提交,存在多个时,循环提交 |
| | | if (this.refs.trawmenu.state.targetKeys.length === 0) { |
| | | const { targetKeys } = this.state |
| | | |
| | | if (targetKeys.length === 0) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: this.state.dict['form.required.select'] + this.state.dict['model.menu'], |
| | |
| | | this.setState({ |
| | | confirmLoading: true |
| | | }) |
| | | let defers = this.refs.trawmenu.state.targetKeys.map(item => { |
| | | let defers = targetKeys.map(item => { |
| | | return new Promise((resolve) => { |
| | | Api.getSystemConfig({ |
| | | func: 'sPC_MainMenu_ReDel', |
| | |
| | | this.setState({ |
| | | confirmLoading: false, |
| | | thawMvisible: false, |
| | | targetKeys: [], |
| | | thawmenulist: null |
| | | }) |
| | | this.props.reload() |
| | |
| | | thawMemuCancel = () => { // 解冻菜单取消 |
| | | this.setState({ |
| | | thawMvisible: false, |
| | | targetKeys: [], |
| | | thawmenulist: null |
| | | }) |
| | | } |
| | |
| | | onCancel={this.thawMemuCancel} |
| | | > |
| | | {!this.state.thawmenulist && <Spin style={{marginLeft: 'calc(50% - 22px)', marginTop: '70px', marginBottom: '70px'}} size="large" />} |
| | | {this.state.thawmenulist && <TransferForm ref="trawmenu" menulist={this.state.thawmenulist}/>} |
| | | {this.state.thawmenulist && <TransferForm onChange={(vals) => this.setState({targetKeys: vals})} menulist={this.state.thawmenulist}/>} |
| | | </Modal> |
| | | </div> |
| | | ) |