| | |
| | | import DragElement from './dragelement' |
| | | import MenuForm from './menuform' |
| | | import Utils from '@/utils/utils.js' |
| | | import zhCN from '@/locales/zh-CN/header.js' |
| | | import enUS from '@/locales/en-US/header.js' |
| | | import zhCN from '@/locales/zh-CN/model.js' |
| | | import enUS from '@/locales/en-US/model.js' |
| | | import Api from '@/api' |
| | | import './index.scss' |
| | | |
| | |
| | | if (previewList && !is(fromJS(previewList), fromJS(this.props.menulist))) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: this.state.dict['header.menu.presave'], |
| | | message: this.state.dict['model.menu.presave'], |
| | | duration: 5 |
| | | }) |
| | | } else { |
| | |
| | | deleteMemu = () => { |
| | | let _this = this |
| | | confirm({ |
| | | title: this.state.dict['header.menu.close'].replace('@M', this.state.editMenu.MenuName), |
| | | title: this.state.dict['model.menu.close'].replace('@M', this.state.editMenu.MenuName), |
| | | content: '', |
| | | okText: this.state.dict['header.confirm'], |
| | | cancelText: this.state.dict['header.cancel'], |
| | | okText: this.state.dict['model.confirm'], |
| | | cancelText: this.state.dict['model.cancel'], |
| | | onOk() { |
| | | let param = { |
| | | func: 'sPC_MainMenu_Del', |
| | |
| | | if (this.refs.trawmenu.state.targetKeys.length === 0) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: this.state.dict['header.menu.thawmenu.select'], |
| | | message: this.state.dict['form.required.select'] + this.state.dict['model.menu'], |
| | | duration: 5 |
| | | }) |
| | | } else { |
| | |
| | | if ((type === 'add' || type === 'thawmenu') && _menuchange) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: this.state.dict['header.menu.presave'], |
| | | message: this.state.dict['model.menu.presave'], |
| | | duration: 5 |
| | | }) |
| | | } else if (type === 'add') { |
| | |
| | | param.secretkey = Utils.encrypt(param.LText, param.timestamp) // md5密钥 |
| | | |
| | | confirm({ |
| | | title: this.state.dict['header.menu.resetorder'], |
| | | title: this.state.dict['model.menu.resetorder'], |
| | | content: '', |
| | | okText: this.state.dict['header.confirm'], |
| | | cancelText: this.state.dict['header.cancel'], |
| | | okText: this.state.dict['model.confirm'], |
| | | cancelText: this.state.dict['model.cancel'], |
| | | onOk() { |
| | | return Api.getSystemConfig(param).then(res => { |
| | | if (res.status) { |
| | |
| | | } |
| | | |
| | | render () { |
| | | const { dict } = this.state |
| | | |
| | | return ( |
| | | <div className="header-edit-box"> |
| | | <div className="mask"> |
| | |
| | | </div> |
| | | {this.props.menulist && <DndProvider backend={HTML5Backend}> |
| | | <DragElement |
| | | dict={this.state.dict} |
| | | dict={dict} |
| | | list={this.props.menulist} |
| | | handlePreviewList={this.handlePreviewList} |
| | | handleMenu={this.editMenuModal} |
| | |
| | | </DndProvider>} |
| | | {/* 新建菜单模态框 */} |
| | | <Modal |
| | | title={this.state.dict['header.menu.addtitle']} |
| | | okText={this.state.dict['header.confirm']} |
| | | cancelText={this.state.dict['header.cancel']} |
| | | title={dict['model.add'] + dict['model.menu']} |
| | | okText={dict['model.confirm']} |
| | | cancelText={dict['model.cancel']} |
| | | visible={this.state.addMvisible} |
| | | onOk={this.addMemuSubmit} |
| | | confirmLoading={this.state.confirmLoading} |
| | |
| | | destroyOnClose |
| | | > |
| | | <MenuForm |
| | | dict={this.state.dict} |
| | | dict={dict} |
| | | type="add" |
| | | menu={null} |
| | | wrappedComponentRef={(inst) => this.addMenuFormRef = inst} |
| | |
| | | </Modal> |
| | | {/* 解除冻结菜单模态框 */} |
| | | <Modal |
| | | title={this.state.dict['header.thawmenu']} |
| | | okText={this.state.dict['header.confirm']} |
| | | cancelText={this.state.dict['header.cancel']} |
| | | title={dict['model.thaw'] + dict['model.menu']} |
| | | okText={dict['model.confirm']} |
| | | cancelText={dict['model.cancel']} |
| | | visible={this.state.thawMvisible} |
| | | onOk={this.thawMemuSubmit} |
| | | confirmLoading={this.state.confirmLoading} |
| | |
| | | </Modal> |
| | | {/* 编辑菜单模态框 */} |
| | | <Modal |
| | | title={this.state.dict['header.menu.editTitle']} |
| | | title={dict['model.edit'] + dict['model.menu']} |
| | | visible={this.state.editMvisible} |
| | | footer={[ |
| | | <Button key="cancel" onClick={this.editMemuCancel}>{this.state.dict['header.cancel']}</Button>, |
| | | <Button key="confirm" type="primary" onClick={this.editMemuSubmit} loading={this.state.confirmLoading}>{this.state.dict['header.confirm']}</Button>, |
| | | <Button key="delete" type="danger" onClick={this.deleteMemu}>{this.state.dict['header.delete']}</Button> |
| | | <Button key="cancel" onClick={this.editMemuCancel}>{dict['model.cancel']}</Button>, |
| | | <Button key="confirm" type="primary" onClick={this.editMemuSubmit} loading={this.state.confirmLoading}>{dict['model.confirm']}</Button>, |
| | | <Button key="delete" type="danger" onClick={this.deleteMemu}>{dict['model.delete']}</Button> |
| | | ]} |
| | | onCancel={this.editMemuCancel} |
| | | destroyOnClose |
| | | > |
| | | <MenuForm |
| | | dict={this.state.dict} |
| | | dict={dict} |
| | | type="edit" |
| | | menu={this.state.editMenu} |
| | | wrappedComponentRef={(inst) => this.editMenuFormRef = inst} |