| | |
| | | 'header.menu.config.placeholder': 'Configuration has been modified, do you want to save configuration information ?', |
| | | 'header.menu.config.notsave': 'The menu has not been saved, please save the menu configuration first!', |
| | | 'header.menu.config.update': 'Menu configuration has been modified, please save!', |
| | | 'model.menu.presave': 'Menu order has been adjusted, Please save!', |
| | | 'header.menu.form': 'The form', |
| | | 'header.menu.group.add': 'Add a group', |
| | | 'header.menu.search': 'Search', |
| | |
| | | 'header.menu.config.placeholder': '配置已修改,是否保存配置信息?', |
| | | 'header.menu.config.notsave': '菜单尚未保存,请先保存菜单配置!', |
| | | 'header.menu.config.update': '菜单配置已修改,请保存!', |
| | | 'model.menu.presave': '菜单顺序已调整,请保存!', |
| | | 'header.menu.form': '表单', |
| | | 'header.menu.group.add': '添加分组', |
| | | 'header.menu.search': '搜索', |
| | |
| | | const MobDesign = asyncLoadComponent(() => import('@/views/mobdesign')) |
| | | const ImDesign = asyncLoadComponent(() => import('@/views/imdesign')) |
| | | const MenuDesign = asyncLoadComponent(() => import('@/views/menudesign')) |
| | | const BaseDesign = asyncLoadComponent(() => import('@/views/basedesign')) |
| | | const BillPrint = asyncLoadComponent(() => import('@/views/billprint')) |
| | | const PrintT = asyncLoadComponent(() => import('@/views/printTemplate')) |
| | | const Interface = asyncLoadComponent(() => import('@/views/interface')) |
| | |
| | | {path: '/mobdesign/:param', name: 'mobdesign', component: MobDesign, auth: true}, |
| | | {path: '/imdesign/:param', name: 'imdesign', component: ImDesign, auth: true}, |
| | | {path: '/menudesign/:param', name: 'menudesign', component: MenuDesign, auth: true}, |
| | | {path: '/basedesign/:param', name: 'basedesign', component: BaseDesign, auth: true}, |
| | | {path: '/billprint/:param', name: 'billprint', component: BillPrint, auth: true}, |
| | | {path: '/docprint/:menuId', name: 'docprint', component: BillPrint, auth: false}, |
| | | {path: '/docprint/:menuId/:id', name: 'docprint', component: BillPrint, auth: false}, |
New file |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | // import { is, fromJS } from 'immutable' |
| | | import { connect } from 'react-redux' |
| | | import { withRouter } from 'react-router-dom' |
| | | import { notification, Spin } from 'antd' |
| | | // import moment from 'moment' |
| | | |
| | | import Api from '@/api' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import zhCN from '@/locales/zh-CN/model.js' |
| | | import enUS from '@/locales/en-US/model.js' |
| | | // import Utils from '@/utils/utils.js' |
| | | import MenuUtils from '@/utils/utils-custom.js' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import asyncLoadComponent from '@/utils/asyncLoadComponent' |
| | | import './index.scss' |
| | | |
| | | const Header = asyncComponent(() => import('@/menu/header')) |
| | | const ComTableConfig = asyncLoadComponent(() => import('@/templates/comtableconfig')) |
| | | const TreePageConfig = asyncLoadComponent(() => import('@/templates/treepageconfig')) |
| | | const CalendarPageConfig = asyncLoadComponent(() => import('@/templates/calendarconfig')) |
| | | const FormTabConfig = asyncLoadComponent(() => import('@/templates/formtabconfig')) |
| | | const ModalConfig = asyncLoadComponent(() => import('@/templates/modalconfig')) |
| | | const SubTable = asyncLoadComponent(() => import('@/templates/subtableconfig')) |
| | | |
| | | class BaseDesign extends Component { |
| | | static propTpyes = { |
| | | menulist: PropTypes.any, // 三级菜单列表 |
| | | exitEdit: PropTypes.func, // 退出编辑状态 |
| | | supMenu: PropTypes.object, // 对应的上级菜单 |
| | | supMenuList: PropTypes.array // 上级菜单列表,用于三级菜单切换上级菜单 |
| | | } |
| | | |
| | | state = { |
| | | dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, |
| | | loading: false, // 编辑菜单或使用已使用模板时,获取配置信息 |
| | | btnParam: null, // 编辑按钮的配置信息 |
| | | menulist: null, // 编辑中的菜单 |
| | | tabview: '', // 选择模板窗口(template)、基础表格配置(CommonTable)、表单(Modal)、子表(SubTable) |
| | | editMenu: null, // 编辑菜单 |
| | | editAction: null, // 编辑按钮 |
| | | editTab: null, // 编辑标签 |
| | | tabConfig: null, // 标签配置信息 |
| | | editSubTab: null, // 编辑子标签(标签中的标签) |
| | | subTabConfig: null, // 子标签配置信息 |
| | | subConfig: null, // 子配置信息 |
| | | btnTab: null, // 打开新标签或当前页面刷新的按钮 |
| | | btnTabConfig: null, // 打开新标签按钮配置 |
| | | handleMVisible: false, // 添加或修改菜单模态框(角色权限分配等) |
| | | sysMenu: null, // 添加或编辑菜单(角色权限分配等) |
| | | change: false |
| | | } |
| | | |
| | | UNSAFE_componentWillMount() { |
| | | try { |
| | | let param = JSON.parse(window.decodeURIComponent(window.atob(this.props.match.params.param))) |
| | | |
| | | this.getMenuParam(param) |
| | | } catch (e) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '菜单信息解析错误!', |
| | | duration: 5 |
| | | }) |
| | | } |
| | | } |
| | | |
| | | getMenuParam = (editMenu) => { |
| | | editMenu.fstMenuId = editMenu.FstId |
| | | editMenu.supMenuList = [] |
| | | editMenu.fstMenuList = [] |
| | | |
| | | let tree = sessionStorage.getItem('menuTree') |
| | | if (tree) { |
| | | tree = JSON.parse(tree) |
| | | editMenu.fstMenuList = tree |
| | | |
| | | tree.forEach(item => { |
| | | if (item.MenuID === editMenu.FstId) { |
| | | editMenu.supMenuList = item.children |
| | | } |
| | | }) |
| | | } |
| | | |
| | | let param = { |
| | | func: 'sPC_Get_LongParam', |
| | | MenuID: editMenu.MenuID |
| | | } |
| | | |
| | | this.setState({ |
| | | loading: true |
| | | }) |
| | | |
| | | Api.getSystemConfig(param).then(res => { |
| | | if (res.status) { |
| | | let _LongParam = '' |
| | | if (res.LongParam) { |
| | | try { |
| | | _LongParam = JSON.parse(window.decodeURIComponent(window.atob(res.LongParam))) |
| | | } catch (e) { |
| | | console.warn('Parse Failure') |
| | | _LongParam = '' |
| | | } |
| | | } |
| | | |
| | | editMenu.LongParam = _LongParam |
| | | editMenu.open_edition = res.open_edition || '' |
| | | |
| | | this.setState({ |
| | | editMenu: editMenu, |
| | | loading: false, |
| | | tabview: editMenu.type |
| | | }) |
| | | } else { |
| | | this.setState({ |
| | | loading: false |
| | | }) |
| | | notification.warning({ |
| | | top: 92, |
| | | message: res.message, |
| | | duration: 5 |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * @description 组件销毁,清除state更新 |
| | | */ |
| | | componentWillUnmount () { |
| | | this.setState = () => { |
| | | return |
| | | } |
| | | } |
| | | |
| | | handleView = (param) => { |
| | | this.setState({ |
| | | tabview: '' |
| | | }, () => { |
| | | if (param) { |
| | | this.setState(param) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | copyMenu = (param, MenuId) => { |
| | | Api.getSystemConfig({ |
| | | func: 'sPC_Get_LongParam', |
| | | MenuID: MenuId |
| | | }).then(result => { |
| | | if (result.status) { |
| | | let config = null |
| | | |
| | | try { |
| | | config = result.LongParam ? JSON.parse(window.decodeURIComponent(window.atob(result.LongParam))) : null |
| | | } catch (e) { |
| | | console.warn('Parse Failure') |
| | | config = null |
| | | } |
| | | |
| | | if (config) { |
| | | config.uuid = param.MenuID |
| | | config.MenuID = param.MenuID |
| | | config.parentId = param.ParentID |
| | | config.MenuName = param.MenuName |
| | | config.MenuNo = param.MenuNo |
| | | config.easyCode = '' |
| | | config.components = MenuUtils.resetConfig(config.components) |
| | | config.enabled = false |
| | | |
| | | param.LongParam = window.btoa(window.encodeURIComponent(JSON.stringify(config))) |
| | | } |
| | | |
| | | Api.getSystemConfig(param).then(response => { |
| | | if (response.status) { |
| | | this.setState({ |
| | | handleMVisible: false, |
| | | sysMenu: null |
| | | }) |
| | | |
| | | MKEmitter.emit('mkUpdateMenuList') |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: response.message, |
| | | duration: 5 |
| | | }) |
| | | } |
| | | }) |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: result.message, |
| | | duration: 5 |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | render () { |
| | | const { loading } = this.state |
| | | |
| | | return ( |
| | | <div className="mk-base-design-wrap"> |
| | | <Header/> |
| | | {this.state.tabview === 'TreePage' ? |
| | | <TreePageConfig |
| | | menu={this.state.editMenu} |
| | | reloadmenu={() => {localStorage.setItem('menuUpdate', new Date().getTime())}} |
| | | handleView={this.handleView} |
| | | /> : null |
| | | } |
| | | {this.state.tabview === 'CalendarPage' ? |
| | | <CalendarPageConfig |
| | | menu={this.state.editMenu} |
| | | reloadmenu={() => {localStorage.setItem('menuUpdate', new Date().getTime())}} |
| | | handleView={this.handleView} |
| | | /> : null |
| | | } |
| | | {this.state.tabview === 'CommonTable' ? |
| | | <ComTableConfig |
| | | menu={this.state.editMenu} |
| | | reloadmenu={() => {localStorage.setItem('menuUpdate', new Date().getTime())}} |
| | | handleView={this.handleView} |
| | | /> : null |
| | | } |
| | | {this.state.tabview === 'Modal' ? |
| | | <ModalConfig |
| | | menu={this.state.editMenu} |
| | | editTab={this.state.editTab} |
| | | tabConfig={this.state.tabConfig} |
| | | editSubTab={this.state.editSubTab} |
| | | subTabConfig={this.state.subTabConfig} |
| | | btnTab={this.state.btnTab} |
| | | btnTabConfig={this.state.btnTabConfig} |
| | | editAction={this.state.editAction} |
| | | subConfig={this.state.subConfig} |
| | | handleView={this.handleView} |
| | | /> : null |
| | | } |
| | | {this.state.tabview === 'SubTable' ? |
| | | <SubTable |
| | | menu={this.state.editMenu} |
| | | editTab={this.state.editTab} |
| | | editSubTab={this.state.editSubTab} |
| | | tabConfig={this.state.tabConfig} |
| | | btnTab={this.state.btnTab} |
| | | btnTabConfig={this.state.btnTabConfig} |
| | | config={this.state.subConfig} |
| | | handleView={this.handleView} |
| | | /> : null |
| | | } |
| | | {this.state.tabview === 'FormTab' ? |
| | | <FormTabConfig |
| | | menu={this.state.editMenu} |
| | | btnTab={this.state.btnTab} |
| | | config={this.state.subConfig} |
| | | handleView={this.handleView} |
| | | /> : null |
| | | } |
| | | {loading ? <Spin className="loading-view" /> : null} |
| | | </div> |
| | | ) |
| | | } |
| | | } |
| | | |
| | | const mapStateToProps = (state) => { |
| | | return { |
| | | mainMenu: state.mainMenu, |
| | | menuTree: state.menuTree |
| | | } |
| | | } |
| | | |
| | | const mapDispatchToProps = () => { |
| | | return {} |
| | | } |
| | | |
| | | export default withRouter(connect(mapStateToProps, mapDispatchToProps)(BaseDesign)) |
New file |
| | |
| | | .mk-base-design-wrap { |
| | | .loading-view { |
| | | position: absolute; |
| | | left: calc(50vw - 22px); |
| | | top: calc(50vh - 22px); |
| | | } |
| | | } |
New file |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { Form, Row, Col, Input, Select } from 'antd' |
| | | import './index.scss' |
| | | |
| | | const { TextArea } = Input |
| | | |
| | | class MainSearch extends Component { |
| | | static propTpyes = { |
| | | menu: PropTypes.object, // 菜单信息 |
| | | inputSubmit: PropTypes.func // 回车提交 |
| | | } |
| | | |
| | | state = { |
| | | supMenuList: [] |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | this.setState({ |
| | | supMenuList: this.props.menu.supMenuList |
| | | }) |
| | | } |
| | | |
| | | changeMenu = (val) => { |
| | | const { menu } = this.state |
| | | |
| | | let submenu = menu.fstMenuList.filter(item => item.MenuID === val)[0] |
| | | |
| | | if (submenu) { |
| | | this.setState({ |
| | | supMenuList: submenu.children |
| | | }, () => { |
| | | this.props.form.setFieldsValue({ParentID: submenu.children[0] ? submenu.children[0].MenuID : ''}) |
| | | }) |
| | | } else { |
| | | this.setState({ |
| | | supMenuList: [] |
| | | }, () => { |
| | | this.props.form.setFieldsValue({ParentID: ''}) |
| | | }) |
| | | } |
| | | } |
| | | |
| | | handleConfirm = () => { |
| | | // 表单提交时检查输入值是否正确 |
| | | return new Promise((resolve, reject) => { |
| | | this.props.form.validateFieldsAndScroll((err, values) => { |
| | | if (!err) { |
| | | resolve(values) |
| | | } else { |
| | | reject(err) |
| | | } |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | onEnterSubmit = (e) => { |
| | | // 表单回车提交 |
| | | if (e.key !== 'Enter') return |
| | | |
| | | this.props.inputSubmit && this.props.inputSubmit() |
| | | } |
| | | |
| | | render() { |
| | | const { getFieldDecorator } = this.props.form |
| | | const { menu } = this.state |
| | | const formItemLayout = { |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 8 } |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 16 } |
| | | } |
| | | } |
| | | |
| | | return ( |
| | | <Form {...formItemLayout} style={{paddingRight: '20px'}} onKeyDown={this.onEnterSubmit}> |
| | | <Row gutter={24}> |
| | | <Col span={22}> |
| | | <Form.Item label={'一级菜单'}> |
| | | {getFieldDecorator('fstMenuId', { |
| | | initialValue: menu.fstMenuId, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请选择上级菜单!' |
| | | } |
| | | ] |
| | | })( |
| | | <Select |
| | | showSearch |
| | | filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0} |
| | | onChange={this.changeMenu} |
| | | > |
| | | {menu.fstMenuList.map(option => |
| | | <Select.Option key={option.MenuID} value={option.MenuID}>{option.text || option.MenuName}</Select.Option> |
| | | )} |
| | | </Select> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={22}> |
| | | <Form.Item label={'二级菜单'}> |
| | | {getFieldDecorator('ParentID', { |
| | | initialValue: menu.ParentId, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请选择上级菜单!' |
| | | } |
| | | ] |
| | | })( |
| | | <Select |
| | | showSearch |
| | | filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0} |
| | | > |
| | | {menu.supMenuList.map(option => |
| | | <Select.Option key={option.MenuID} value={option.MenuID}>{option.text || option.MenuName}</Select.Option> |
| | | )} |
| | | </Select> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={22}> |
| | | <Form.Item label={'菜单名称'}> |
| | | {getFieldDecorator('MenuName', { |
| | | initialValue: menu.MenuName || '', |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请输入菜单名称!' |
| | | } |
| | | ] |
| | | })(<Input placeholder="" autoFocus autoComplete="off" />)} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={22}> |
| | | <Form.Item label={'菜单参数'}> |
| | | {getFieldDecorator('MenuNo', { |
| | | initialValue: menu.MenuNo || '', |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请输入菜单参数!' |
| | | } |
| | | ] |
| | | })(<Input placeholder="" autoComplete="off" />)} |
| | | </Form.Item> |
| | | </Col> |
| | | {menu.Template === 'NewPage' ? <Col span={22}> |
| | | <Form.Item label={'链接地址'}> |
| | | {getFieldDecorator('url', { |
| | | initialValue: menu.url || '', |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请输入页面地址!' |
| | | }, |
| | | { |
| | | max: 1024, |
| | | message: '地址最长为1024个字符!' |
| | | } |
| | | ] |
| | | })(<TextArea rows={2} />)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | </Row> |
| | | </Form> |
| | | ) |
| | | } |
| | | } |
| | | |
| | | export default Form.create()(MainSearch) |
| | |
| | | |
| | | import Api from '@/api' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import zhCN from '@/locales/zh-CN/model.js' |
| | | import enUS from '@/locales/en-US/model.js' |
| | | import MkIcon from '@/components/mk-icon' |
| | | import Utils from '@/utils/utils.js' |
| | | import MenuUtils from '@/utils/utils-custom.js' |
| | |
| | | import './index.scss' |
| | | |
| | | const MenuForm = asyncLoadComponent(() => import('../thdmenuform')) |
| | | const ComTableConfig = asyncLoadComponent(() => import('@/templates/comtableconfig')) |
| | | const TreePageConfig = asyncLoadComponent(() => import('@/templates/treepageconfig')) |
| | | const CalendarPageConfig = asyncLoadComponent(() => import('@/templates/calendarconfig')) |
| | | const FormTabConfig = asyncLoadComponent(() => import('@/templates/formtabconfig')) |
| | | const ModalConfig = asyncLoadComponent(() => import('@/templates/modalconfig')) |
| | | const SubTable = asyncLoadComponent(() => import('@/templates/subtableconfig')) |
| | | |
| | | const { confirm } = Modal |
| | | |
| | |
| | | } |
| | | |
| | | state = { |
| | | dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, |
| | | confirmLoading: false, // 提交中。。。 |
| | | loading: false, // 编辑菜单或使用已使用模板时,获取配置信息 |
| | | btnParam: null, // 编辑按钮的配置信息 |
| | | menulist: null, // 编辑中的菜单 |
| | | tabview: '', // 选择模板窗口(template)、基础表格配置(CommonTable)、表单(Modal)、子表(SubTable) |
| | | editMenu: null, // 编辑菜单 |
| | | editAction: null, // 编辑按钮 |
| | | editTab: null, // 编辑标签 |
| | | tabConfig: null, // 标签配置信息 |
| | | editSubTab: null, // 编辑子标签(标签中的标签) |
| | | subTabConfig: null, // 子标签配置信息 |
| | | subConfig: null, // 子配置信息 |
| | | btnTab: null, // 打开新标签或当前页面刷新的按钮 |
| | | btnTabConfig: null, // 打开新标签按钮配置 |
| | | handleMVisible: false, // 添加或修改菜单模态框(角色权限分配等) |
| | | sysMenu: null, // 添加或编辑菜单(角色权限分配等) |
| | | change: false |
| | |
| | | if (this.state.change) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: this.state.dict['model.menu.presave'], |
| | | message: '菜单顺序已调整,请保存!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | |
| | | handleMVisible: true, |
| | | sysMenu: _menu |
| | | }) |
| | | } else if (['CommonTable', 'TreePage', 'CalendarPage'].includes(_menu.PageParam.Template)) { |
| | | sessionStorage.setItem('menuTree', JSON.stringify(this.props.menuTree)) |
| | | let _param = window.btoa(window.encodeURIComponent(JSON.stringify(_menu))) |
| | | |
| | | return |
| | | window.open(`#/basedesign/${_param}`) |
| | | } else if (_menu.PageParam.Template === 'CustomPage') { |
| | | let _param = { |
| | | MenuType: 'custom', |
| | | MenuId: _menu.MenuID, |
| | | ParentId: _menu.ParentId, |
| | | MenuName: _menu.MenuName, |
| | | MenuNo: _menu.MenuNo |
| | | } |
| | | |
| | | _param = window.btoa(window.encodeURIComponent(JSON.stringify(_param))) |
| | | |
| | | window.open(`#/menudesign/${_param}`) |
| | | } |
| | | |
| | | // let _param = '' |
| | | // if (card.type === 'CustomPage') { |
| | | // _param = { |
| | | // MenuType: 'custom', |
| | | // MenuId: card.MenuID, |
| | | // ParentId: card.ParentId, |
| | | // MenuName: card.MenuName, |
| | | // MenuNo: card.MenuNo |
| | | // } |
| | | // _param = window.btoa(window.encodeURIComponent(JSON.stringify(_param))) |
| | | // } |
| | | // window.open(`#/menudesign/${_param}`)} |
| | | |
| | | // let param = { |
| | | // func: 'sPC_Get_LongParam', |
| | | // MenuID: _menu.MenuID |
| | | // } |
| | | |
| | | // this.setState({ |
| | | // loading: true |
| | | // }) |
| | | |
| | | // Api.getSystemConfig(param).then(res => { |
| | | // if (res.status) { |
| | | // let _LongParam = '' |
| | | // if (res.LongParam) { |
| | | // try { |
| | | // _LongParam = JSON.parse(window.decodeURIComponent(window.atob(res.LongParam))) |
| | | // } catch (e) { |
| | | // console.warn('Parse Failure') |
| | | // _LongParam = '' |
| | | // } |
| | | // } |
| | | |
| | | // _menu.LongParam = _LongParam |
| | | // _menu.fstMenuId = _menu.FstId |
| | | // _menu.supMenuList = this.props.supMenuList |
| | | // _menu.fstMenuList = this.props.menuTree |
| | | // _menu.open_edition = res.open_edition || '' |
| | | |
| | | |
| | | // this.setState({ |
| | | // editMenu: _menu, |
| | | // loading: false, |
| | | // tabview: _menu.PageParam.Template |
| | | // }, () => { |
| | | // document.getElementById('root').style.overflowY = 'hidden' |
| | | // }) |
| | | // } else { |
| | | // this.setState({ |
| | | // loading: false |
| | | // }) |
| | | // notification.warning({ |
| | | // top: 92, |
| | | // message: res.message, |
| | | // duration: 5 |
| | | // }) |
| | | // } |
| | | // }) |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | exittabview = () => { |
| | | this.setState({tabview: ''}) |
| | | document.getElementById('root').style.overflowY = 'unset' |
| | | } |
| | | |
| | | handleView = (param) => { |
| | | this.setState({ |
| | | tabview: '' |
| | | }, () => { |
| | | if (param) { |
| | | this.setState(param) |
| | | document.getElementById('root').style.overflowY = 'hidden' |
| | | } else { |
| | | document.getElementById('root').style.overflowY = 'unset' |
| | | } |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * @description 三级菜单添加或修改 |
| | | */ |
| | | memuSubmit = () => { |
| | | const { sysMenu } = this.state |
| | | let sysTemplates = fromJS(this.state.sysTemplates).toJS() |
| | | |
| | | this.menuFormRef.handleConfirm().then(res => { |
| | | let PageParam = { |
| | |
| | | Api.getSystemConfig(param).then(response => { |
| | | if (response.status) { |
| | | this.setState({ |
| | | sysTemplates: sysTemplates, |
| | | confirmLoading: false, |
| | | handleMVisible: false, |
| | | sysMenu: '', |
| | | tabview: '' |
| | | sysMenu: null |
| | | }) |
| | | |
| | | MKEmitter.emit('mkUpdateMenuList') |
| | |
| | | this.setState({ |
| | | confirmLoading: false, |
| | | handleMVisible: false, |
| | | sysMenu: '', |
| | | tabview: '' |
| | | sysMenu: null |
| | | }) |
| | | |
| | | MKEmitter.emit('mkUpdateMenuList') |
| | |
| | | <Button type="primary" className="mk-save-menu" disabled={!change} onClick={() => {this.handleSubBtn('confirm')}}>保存</Button> |
| | | <Button onClick={() => {this.handleSubBtn('close')}}>关闭</Button> |
| | | </div> |
| | | |
| | | {this.state.tabview === 'TreePage' ? |
| | | <TreePageConfig |
| | | menu={this.state.editMenu} |
| | | reloadmenu={() => {MKEmitter.emit('mkUpdateMenuList')}} |
| | | handleView={this.handleView} |
| | | /> : null |
| | | } |
| | | {this.state.tabview === 'CalendarPage' ? |
| | | <CalendarPageConfig |
| | | menu={this.state.editMenu} |
| | | reloadmenu={() => {MKEmitter.emit('mkUpdateMenuList')}} |
| | | handleView={this.handleView} |
| | | /> : null |
| | | } |
| | | {this.state.tabview === 'CommonTable' ? |
| | | <ComTableConfig |
| | | menu={this.state.editMenu} |
| | | reloadmenu={() => {MKEmitter.emit('mkUpdateMenuList')}} |
| | | handleView={this.handleView} |
| | | /> : null |
| | | } |
| | | {this.state.tabview === 'Modal' ? |
| | | <ModalConfig |
| | | menu={this.state.editMenu} |
| | | editTab={this.state.editTab} |
| | | tabConfig={this.state.tabConfig} |
| | | editSubTab={this.state.editSubTab} |
| | | subTabConfig={this.state.subTabConfig} |
| | | btnTab={this.state.btnTab} |
| | | btnTabConfig={this.state.btnTabConfig} |
| | | editAction={this.state.editAction} |
| | | subConfig={this.state.subConfig} |
| | | handleView={this.handleView} |
| | | /> : null |
| | | } |
| | | {this.state.tabview === 'SubTable' ? |
| | | <SubTable |
| | | menu={this.state.editMenu} |
| | | editTab={this.state.editTab} |
| | | editSubTab={this.state.editSubTab} |
| | | tabConfig={this.state.tabConfig} |
| | | btnTab={this.state.btnTab} |
| | | btnTabConfig={this.state.btnTabConfig} |
| | | config={this.state.subConfig} |
| | | handleView={this.handleView} |
| | | /> : null |
| | | } |
| | | {this.state.tabview === 'FormTab' ? |
| | | <FormTabConfig |
| | | menu={this.state.editMenu} |
| | | btnTab={this.state.btnTab} |
| | | config={this.state.subConfig} |
| | | handleView={this.handleView} |
| | | /> : null |
| | | } |
| | | {/* 添加系统菜单 */} |
| | | <Modal |
| | | title="修改菜单" |
| | |
| | | |
| | | UNSAFE_componentWillReceiveProps (nextProps) { |
| | | if (!is(fromJS(this.props.mainMenu), fromJS(nextProps.mainMenu))) { |
| | | // 主菜单切换,请求2、3级菜单数据 |
| | | this.loadsubmenu(nextProps.mainMenu) |
| | | } |
| | | } |
| | |
| | | } |
| | | _param = window.btoa(window.encodeURIComponent(JSON.stringify(_param))) |
| | | window.open(`#/menudesign/${_param}`) |
| | | } else if (['RolePermission', 'NewPage'].includes(cell.type)) { |
| | | cell.Template = cell.PageParam.Template |
| | | cell.url = cell.PageParam.url || '' |
| | | } else if (['CommonTable', 'TreePage', 'CalendarPage'].includes(cell.type)) { |
| | | sessionStorage.setItem('menuTree', JSON.stringify(this.props.menuTree)) |
| | | let _param = window.btoa(window.encodeURIComponent(JSON.stringify(cell))) |
| | | |
| | | cell.fstMenuId = cell.FstId |
| | | cell.supMenuList = this.props.mainMenu.children |
| | | cell.fstMenuList = this.props.menuTree |
| | | window.open(`#/basedesign/${_param}`) |
| | | } else if (['RolePermission', 'NewPage'].includes(cell.type)) { |
| | | let _cell = fromJS(cell).toJS() |
| | | _cell.Template = _cell.PageParam.Template |
| | | _cell.url = _cell.PageParam.url || '' |
| | | |
| | | _cell.fstMenuId = _cell.FstId |
| | | _cell.supMenuList = this.props.mainMenu.children |
| | | _cell.fstMenuList = this.props.menuTree |
| | | |
| | | this.setState({ |
| | | thdVisible: true, |
| | | loading: false, |
| | | sysMenu: cell |
| | | sysMenu: _cell |
| | | }) |
| | | } |
| | | } |
| | |
| | | {item.children.map(cell => { |
| | | return ( |
| | | <Menu.Item key={cell.MenuID}> |
| | | <span className="editable-menu-item" onDoubleClick={(e) => {e.stopPropagation();this.editmenu(cell)}}>{cell.MenuName}</span> |
| | | <span className="editable-menu-item" onDoubleClick={() => this.editmenu(cell)}>{cell.MenuName}</span> |
| | | </Menu.Item> |
| | | ) |
| | | })} |