From bd1dfc9e6c9b9f8076ca2783ce598e0936b4c664 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 22 十二月 2021 14:36:03 +0800 Subject: [PATCH] 2021-12-22 --- src/templates/menuconfig/editthdmenu/index.jsx | 33 +++++++++++++++++++++------------ 1 files changed, 21 insertions(+), 12 deletions(-) diff --git a/src/templates/menuconfig/editthdmenu/index.jsx b/src/templates/menuconfig/editthdmenu/index.jsx index 72cc5e2..1c9c99f 100644 --- a/src/templates/menuconfig/editthdmenu/index.jsx +++ b/src/templates/menuconfig/editthdmenu/index.jsx @@ -5,7 +5,8 @@ import { DndProvider } from 'react-dnd' import { withRouter } from 'react-router-dom' import HTML5Backend from 'react-dnd-html5-backend' -import { notification, Modal, Button, Spin, Icon, Col, Card, Tabs, Row, Input } from 'antd' +import { notification, Modal, Button, Spin, Col, Card, Tabs, Row, Input } from 'antd' +import { PlusOutlined } from '@ant-design/icons' import moment from 'moment' import Api from '@/api' @@ -16,7 +17,7 @@ import treepage from '@/assets/img/treepage.jpg' import calendar from '@/assets/img/calendar.jpg' import customImg from '@/assets/img/custom.jpg' - +import MkIcon from '@/components/mk-icon' import Preview from './preview' import MenuForm from './menuform' import TransferForm from '@/templates/zshare/basetransferform' @@ -79,6 +80,7 @@ btnTabConfig: null, // 鎵撳紑鏂版爣绛炬寜閽厤缃� handleMVisible: false, // 娣诲姞鎴栦慨鏀硅彍鍗曟ā鎬佹锛堣鑹叉潈闄愬垎閰嶇瓑锛� sysMenu: false, // 娣诲姞鎴栫紪杈戣彍鍗曪紙瑙掕壊鏉冮檺鍒嗛厤绛夛級 + targetKeys: [] // 瑙e喕鑿滃崟鍒楄〃 } /** @@ -191,7 +193,7 @@ if (_Template.length === 0) { notification.warning({ top: 92, - message: this.state.dict['model.menu.template.empty'], + message: '鑿滃崟妯℃澘涓㈠け锛岃閲嶆柊閫夋嫨妯℃澘锛�', duration: 5 }) @@ -268,7 +270,8 @@ return } this.setState({ - thawMvisible: true + thawMvisible: true, + targetKeys: [] }) Api.getSystemConfig({ func: 'sPC_Get_FrozenMenu', @@ -347,8 +350,9 @@ } thawMemuSubmit = () => { + const { targetKeys } = this.state // 涓夌骇鑿滃崟瑙i櫎鍐荤粨 - if (this.refs.trawmenu.state.targetKeys.length === 0) { + if (targetKeys.length === 0) { notification.warning({ top: 92, message: this.state.dict['form.required.select'] + this.state.dict['model.menu'], @@ -358,7 +362,7 @@ 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', @@ -384,6 +388,7 @@ this.setState({ confirmLoading: false, thawMvisible: false, + targetKeys: [], thawmenulist: null }) this.props.reload() @@ -396,7 +401,8 @@ // 瑙i櫎鍐荤粨-鍙栨秷 this.setState({ thawMvisible: false, - thawmenulist: null + thawmenulist: null, + targetKeys: [] }) } @@ -560,7 +566,7 @@ } else if (temp.Template === 'CustomPage' && memberLevel < 20) { return } - + _templates.push({ uuid: temp.MenuID, title: temp.MenuName, @@ -612,7 +618,7 @@ let sysTemplates = fromJS(this.state.sysTemplates).toJS() // 瑙掕壊鏉冮檺鍒嗛厤妯℃澘锛屽彧鍙互娣诲姞涓�娆� - if (sysMenu.isSystem && sysMenu.Template === 'RolePermission') { + if (sysMenu.isSystem && (sysMenu.Template === 'RolePermission')) { sysTemplates = sysTemplates.map(temp => { if (temp.type === sysMenu.type) { temp.hidden = true @@ -673,6 +679,7 @@ }) this.props.reload() + document.getElementById('root').style.overflowY = 'unset' } else { this.setState({ confirmLoading: false @@ -711,6 +718,7 @@ config.MenuNo = param.MenuNo config.easyCode = '' config.components = MenuUtils.resetConfig(config.components) + config.enabled = false param.LongParam = window.btoa(window.encodeURIComponent(JSON.stringify(config))) } @@ -725,6 +733,7 @@ }) this.props.reload() + document.getElementById('root').style.overflowY = 'unset' } else { this.setState({ confirmLoading: false @@ -792,7 +801,7 @@ </div> : null } <div className="cus-submenu-title"> - <Icon type={this.props.supMenu.PageParam.Icon} /> + <MkIcon type={this.props.supMenu.PageParam.Icon} /> <span>{this.props.supMenu.MenuName}</span> </div> <DndProvider backend={HTML5Backend}> @@ -803,7 +812,7 @@ /> </DndProvider> <div className="menu-add" onClick={() => {this.handleSubBtn('add')}}> - <Icon type="plus" /> + <PlusOutlined /> </div> <div className="menu-btn"> <Button type="primary" onClick={() => {this.handleSubBtn('thaw')}}>{dict['model.thaw'] + dict['model.menu']}</Button> @@ -932,7 +941,7 @@ destroyOnClose > {!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> {/* 娣诲姞绯荤粺鑿滃崟 */} <Modal -- Gitblit v1.8.0