| | |
| | | }) |
| | | return |
| | | } else if (result.run_type) { |
| | | this.setState({timer}) |
| | | let repeats = config.timerRepeats || 0 |
| | | this.setState({timer, repeats}) |
| | | this.timer = setTimeout(() => { |
| | | this.timerTask() |
| | | this.timerTask(repeats) |
| | | }, timer) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | timerTask = () => { |
| | | const { timer } = this.state |
| | | timerTask = (times) => { |
| | | const { timer, repeats } = this.state |
| | | if (!timer) return |
| | | |
| | | this.loadData(true) |
| | | |
| | | if (repeats) { |
| | | times = times - 1 |
| | | if (times <= 0) { |
| | | clearTimeout(this.timer) |
| | | return |
| | | } |
| | | } |
| | | this.timer = setTimeout(() => { |
| | | this.timerTask() |
| | | this.timerTask(times) |
| | | }, timer) |
| | | } |
| | | |
| | |
| | | }) |
| | | return |
| | | } else if (result.run_type) { |
| | | this.setState({timer}) |
| | | let repeats = config.timerRepeats || 0 |
| | | this.setState({timer, repeats}) |
| | | this.timer = setTimeout(() => { |
| | | this.timerTask() |
| | | this.timerTask(repeats) |
| | | }, timer) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | timerTask = () => { |
| | | const { timer } = this.state |
| | | timerTask = (times) => { |
| | | const { timer, repeats } = this.state |
| | | if (!timer) return |
| | | |
| | | this.loadData(true) |
| | | |
| | | if (repeats) { |
| | | times = times - 1 |
| | | if (times <= 0) { |
| | | clearTimeout(this.timer) |
| | | return |
| | | } |
| | | } |
| | | this.timer = setTimeout(() => { |
| | | this.timerTask() |
| | | this.timerTask(times) |
| | | }, timer) |
| | | } |
| | | |
| | |
| | | }) |
| | | return |
| | | } else if (result.run_type) { |
| | | this.setState({timer}) |
| | | let repeats = config.timerRepeats || 0 |
| | | this.setState({timer, repeats}) |
| | | this.timer = setTimeout(() => { |
| | | this.timerTask() |
| | | this.timerTask(repeats) |
| | | }, timer) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | timerTask = () => { |
| | | const { timer } = this.state |
| | | timerTask = (times) => { |
| | | const { timer, repeats } = this.state |
| | | if (!timer) return |
| | | |
| | | this.loadData(true) |
| | | |
| | | if (repeats) { |
| | | times = times - 1 |
| | | if (times <= 0) { |
| | | clearTimeout(this.timer) |
| | | return |
| | | } |
| | | } |
| | | this.timer = setTimeout(() => { |
| | | this.timerTask() |
| | | this.timerTask(times) |
| | | }, timer) |
| | | } |
| | | |
| | |
| | | }) |
| | | return |
| | | } else if (result.run_type) { |
| | | this.setState({timer}) |
| | | let repeats = config.timerRepeats || 0 |
| | | this.setState({timer, repeats}) |
| | | this.timer = setTimeout(() => { |
| | | this.timerTask() |
| | | this.timerTask(repeats) |
| | | }, timer) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | timerTask = () => { |
| | | const { timer } = this.state |
| | | timerTask = (times) => { |
| | | const { timer, repeats } = this.state |
| | | if (!timer) return |
| | | |
| | | this.loadData(true) |
| | | |
| | | if (repeats) { |
| | | times = times - 1 |
| | | if (times <= 0) { |
| | | clearTimeout(this.timer) |
| | | return |
| | | } |
| | | } |
| | | this.timer = setTimeout(() => { |
| | | this.timerTask() |
| | | this.timerTask(times) |
| | | }, timer) |
| | | } |
| | | |
| | |
| | | }) |
| | | return |
| | | } else if (result.run_type) { |
| | | this.setState({timer}) |
| | | let repeats = config.timerRepeats || 0 |
| | | this.setState({timer, repeats}) |
| | | this.timer = setTimeout(() => { |
| | | this.timerTask() |
| | | this.timerTask(repeats) |
| | | }, timer) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | timerTask = () => { |
| | | const { timer } = this.state |
| | | timerTask = (times) => { |
| | | const { timer, repeats } = this.state |
| | | if (!timer) return |
| | | |
| | | this.loadData(true) |
| | | |
| | | if (repeats) { |
| | | times = times - 1 |
| | | if (times <= 0) { |
| | | clearTimeout(this.timer) |
| | | return |
| | | } |
| | | } |
| | | this.timer = setTimeout(() => { |
| | | this.timerTask() |
| | | this.timerTask(times) |
| | | }, timer) |
| | | } |
| | | |
| | |
| | | }) |
| | | return |
| | | } else if (result.run_type) { |
| | | this.setState({timer}) |
| | | let repeats = config.timerRepeats || 0 |
| | | this.setState({timer, repeats}) |
| | | this.timer = setTimeout(() => { |
| | | this.timerTask() |
| | | this.timerTask(repeats) |
| | | }, timer) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | timerTask = () => { |
| | | const { timer } = this.state |
| | | timerTask = (times) => { |
| | | const { timer, repeats } = this.state |
| | | if (!timer) return |
| | | |
| | | this.loadData(true) |
| | | |
| | | if (repeats) { |
| | | times = times - 1 |
| | | if (times <= 0) { |
| | | clearTimeout(this.timer) |
| | | return |
| | | } |
| | | } |
| | | this.timer = setTimeout(() => { |
| | | this.timerTask() |
| | | this.timerTask(times) |
| | | }, timer) |
| | | } |
| | | |
| | |
| | | }) |
| | | return |
| | | } else if (result.run_type) { |
| | | this.setState({timer}) |
| | | let repeats = config.timerRepeats || 0 |
| | | this.setState({timer, repeats}) |
| | | this.timer = setTimeout(() => { |
| | | this.timerTask() |
| | | this.timerTask(repeats) |
| | | }, timer) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | timerTask = () => { |
| | | const { timer } = this.state |
| | | timerTask = (times) => { |
| | | const { timer, repeats } = this.state |
| | | if (!timer) return |
| | | |
| | | this.loadData(true) |
| | | |
| | | if (repeats) { |
| | | times = times - 1 |
| | | if (times <= 0) { |
| | | clearTimeout(this.timer) |
| | | return |
| | | } |
| | | } |
| | | this.timer = setTimeout(() => { |
| | | this.timerTask() |
| | | this.timerTask(times) |
| | | }, timer) |
| | | } |
| | | |
| | |
| | | }) |
| | | return |
| | | } else if (result.run_type) { |
| | | this.setState({timer}) |
| | | let repeats = config.timerRepeats || 0 |
| | | this.setState({timer, repeats}) |
| | | this.timer = setTimeout(() => { |
| | | this.timerTask() |
| | | this.timerTask(repeats) |
| | | }, timer) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | timerTask = () => { |
| | | const { timer } = this.state |
| | | timerTask = (times) => { |
| | | const { timer, repeats } = this.state |
| | | if (!timer) return |
| | | |
| | | this.loadData(true) |
| | | |
| | | if (repeats) { |
| | | times = times - 1 |
| | | if (times <= 0) { |
| | | clearTimeout(this.timer) |
| | | return |
| | | } |
| | | } |
| | | this.timer = setTimeout(() => { |
| | | this.timerTask() |
| | | this.timerTask(times) |
| | | }, timer) |
| | | } |
| | | |
| | |
| | | <EditComponent dict={this.state.dict} type="table" options={['search', 'form']} config={this.state.config}/> |
| | | <Switch className="big" checkedChildren="启" unCheckedChildren="停" checked={this.state.config.enabled} onChange={this.onEnabledChange} /> |
| | | <Button type="primary" id="save-config" onClick={this.submitConfig} loading={this.state.menuloading}>{this.state.dict['model.save']}</Button> |
| | | <Button onClick={this.cancelConfig}>{this.state.dict['model.back']}</Button> |
| | | <Button onClick={this.cancelConfig}>关闭</Button> |
| | | </div> |
| | | } style={{ width: '100%' }}> |
| | | <SettingComponent |
| | |
| | | .model-calendar-board { |
| | | position: fixed; |
| | | z-index: 1070; |
| | | z-index: 1; |
| | | padding-top: 48px; |
| | | top: 0px; |
| | | left: 0px; |
| | |
| | | <EditComponent dict={this.state.dict} type="table" options={['search', 'form', 'action', 'columns']} config={this.state.config} MenuID={this.props.menu.MenuID} thawButtons={this.state.thawButtons} refresh={this.editConfig}/> |
| | | <Switch className="big" checkedChildren={this.state.dict['model.enable']} unCheckedChildren={this.state.dict['model.disable']} checked={this.state.config.enabled} onChange={this.onEnabledChange} /> |
| | | <Button type="primary" id="save-config" onClick={this.submitConfig} loading={this.state.menuloading}>{this.state.dict['model.save']}</Button> |
| | | <Button onClick={this.cancelConfig}>{this.state.dict['model.back']}</Button> |
| | | <Button onClick={this.cancelConfig}>关闭</Button> |
| | | </div> |
| | | } style={{ width: '100%' }}> |
| | | <SettingComponent |
| | |
| | | .common-table-board { |
| | | position: fixed; |
| | | z-index: 1070; |
| | | z-index: 1; |
| | | padding-top: 48px; |
| | | top: 0px; |
| | | left: 0px; |
| | |
| | | .modal-form-board { |
| | | position: fixed; |
| | | z-index: 1070; |
| | | z-index: 1; |
| | | padding-top: 48px; |
| | | top: 0px; |
| | | left: 0px; |
| | |
| | | .model-subtable-board { |
| | | position: fixed; |
| | | z-index: 1070; |
| | | z-index: 1; |
| | | padding-top: 48px; |
| | | top: 0px; |
| | | left: 0px; |
| | |
| | | <div> |
| | | <Switch className="big" checkedChildren="启" unCheckedChildren="停" checked={this.state.config.enabled} onChange={this.onEnabledChange} /> |
| | | <Button type="primary" id="save-config" onClick={this.submitConfig} loading={this.state.menuloading}>{this.state.dict['model.save']}</Button> |
| | | <Button onClick={this.cancelConfig}>{this.state.dict['model.back']}</Button> |
| | | <Button onClick={this.cancelConfig}>关闭</Button> |
| | | </div> |
| | | } style={{ width: '100%' }}> |
| | | <Row gutter={16}> |
| | |
| | | .tree-page-board { |
| | | position: fixed; |
| | | z-index: 1070; |
| | | z-index: 1; |
| | | padding-top: 48px; |
| | | top: 0px; |
| | | left: 0px; |
| | |
| | | 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 { notification, Spin, ConfigProvider } from 'antd' |
| | | import enUS from 'antd/es/locale/en_US' |
| | | import zhCN from 'antd/es/locale/zh_CN' |
| | | |
| | | 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 _locale = sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS |
| | | const Header = asyncComponent(() => import('@/menu/header')) |
| | | const ComTableConfig = asyncLoadComponent(() => import('@/templates/comtableconfig')) |
| | | const TreePageConfig = asyncLoadComponent(() => import('@/templates/treepageconfig')) |
| | |
| | | const FormTabConfig = asyncLoadComponent(() => import('@/templates/formtabconfig')) |
| | | const ModalConfig = asyncLoadComponent(() => import('@/templates/modalconfig')) |
| | | const SubTable = asyncLoadComponent(() => import('@/templates/subtableconfig')) |
| | | |
| | | document.body.className = '' |
| | | sessionStorage.setItem('isEditState', 'true') |
| | | |
| | | class BaseDesign extends Component { |
| | | static propTpyes = { |
| | |
| | | } |
| | | |
| | | state = { |
| | | dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, |
| | | loading: false, // 编辑菜单或使用已使用模板时,获取配置信息 |
| | | btnParam: null, // 编辑按钮的配置信息 |
| | | menulist: null, // 编辑中的菜单 |
| | |
| | | |
| | | Api.getSystemConfig(param).then(res => { |
| | | if (res.status) { |
| | | let _LongParam = '' |
| | | editMenu.open_edition = res.open_edition || '' |
| | | editMenu.LongParam = '' |
| | | |
| | | if (res.LongParam) { |
| | | let _LongParam = '' |
| | | try { |
| | | _LongParam = JSON.parse(window.decodeURIComponent(window.atob(res.LongParam))) |
| | | } catch (e) { |
| | | console.warn('Parse Failure') |
| | | _LongParam = '' |
| | | } |
| | | editMenu.LongParam = _LongParam |
| | | } else if (editMenu.PageParam.copyMenuId) { |
| | | let _param = { |
| | | func: 'sPC_Get_LongParam', |
| | | MenuID: editMenu.PageParam.copyMenuId |
| | | } |
| | | |
| | | Api.getSystemConfig(_param).then(res => { |
| | | if (res.status) { |
| | | if (res.LongParam) { |
| | | let _LongParam = '' |
| | | try { |
| | | _LongParam = JSON.parse(window.decodeURIComponent(window.atob(res.LongParam))) |
| | | _LongParam.type = 'user' |
| | | } 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 |
| | | }) |
| | | } |
| | | }) |
| | | return |
| | | } |
| | | |
| | | this.setState({ |
| | | editMenu: editMenu, |
| | |
| | | }, () => { |
| | | 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 |
| | | }) |
| | | window.close() |
| | | } |
| | | }) |
| | | } |
| | |
| | | |
| | | return ( |
| | | <div className="mk-base-design-wrap"> |
| | | <ConfigProvider locale={_locale}> |
| | | |
| | | <Header/> |
| | | {this.state.tabview === 'TreePage' ? |
| | | <TreePageConfig |
| | |
| | | handleView={this.handleView} |
| | | /> : null |
| | | } |
| | | {loading ? <Spin className="loading-view" /> : null} |
| | | {loading ? <Spin className="loading-view" size="large"/> : null} |
| | | </ConfigProvider> |
| | | </div> |
| | | ) |
| | | } |
| | | } |
| | | |
| | | const mapStateToProps = (state) => { |
| | | return { |
| | | mainMenu: state.mainMenu, |
| | | menuTree: state.menuTree |
| | | } |
| | | } |
| | | |
| | | const mapDispatchToProps = () => { |
| | | return {} |
| | | } |
| | | |
| | | export default withRouter(connect(mapStateToProps, mapDispatchToProps)(BaseDesign)) |
| | | export default BaseDesign |
| | |
| | | .loading-view { |
| | | position: absolute; |
| | | left: calc(50vw - 22px); |
| | | top: calc(50vh - 22px); |
| | | top: calc(30vh + 48px); |
| | | } |
| | | } |
| | |
| | | import { withRouter } from 'react-router-dom' |
| | | import {connect} from 'react-redux' |
| | | import { Dropdown, Menu, Modal, notification, Switch, Button, Popover } from 'antd' |
| | | import { MenuFoldOutlined, SettingOutlined, AppstoreOutlined, DownOutlined, HomeOutlined, ApiOutlined, PlusOutlined, SwapOutlined } from '@ant-design/icons' |
| | | import { MenuFoldOutlined, SettingOutlined, AppstoreOutlined, DownOutlined, HomeOutlined, ApiOutlined, PlusOutlined, SwapOutlined, MenuOutlined } from '@ant-design/icons' |
| | | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import { |
| | |
| | | } trigger="hover"> |
| | | <SettingOutlined className="edit-check"/> |
| | | </Popover> : null} |
| | | {/* window.btoa(window.encodeURIComponent(JSON.stringify({ MenuType: 'home', MenuId: 'home_page_id', MenuName: '首页' }))) */} |
| | | {window.GLOB.systemType !== 'production' ? |
| | | <div className="home-entrance entrance"> |
| | | <div className="icon"><HomeOutlined /></div> |
| | | <div className="title">首页</div> |
| | | <div className="detail">基于自定义页面的首页设计,可实现灵活的元素配置及样式调整,展现当前系统的风格。</div> |
| | | <Button type="primary" disabled={!(memberLevel >= 20)} title={memberLevel >= 20 ? '' : '会员等级不够,无开发权限。'} onClick={() => {window.open('#/menudesign/JTdCJTIyTWVudVR5cGUlMjIlM0ElMjJob21lJTIyJTJDJTIyTWVudUlkJTIyJTNBJTIyaG9tZV9wYWdlX2lkJTIyJTJDJTIyTWVudU5hbWUlMjIlM0ElMjIlRTklQTYlOTYlRTklQTElQjUlMjIlN0Q=')}}> |
| | | 编辑 |
| | | </Button> |
| | | </div> : null |
| | | } |
| | | <div className="api-entrance entrance"> |
| | | <div className="icon"><ApiOutlined /></div> |
| | | <div className="title">接口调试</div> |
| | | <div className="detail">可自动处理登录接口的参数加密,以及业务接口的签名计算,方便开发人员的接口测试工作。</div> |
| | | <Button type="primary" disabled={!(memberLevel >= 20)} title={memberLevel >= 20 ? '' : '会员等级不够,无开发权限。'} onClick={() => {window.open('#/interface')}}> |
| | | 编辑 |
| | | </Button> |
| | | </div> |
| | | <div className="app-entrance entrance"> |
| | | <div className="icon"><AppstoreOutlined /></div> |
| | | <div className="title">应用管理</div> |
| | |
| | | </Button> |
| | | } |
| | | </div> |
| | | <div className="api-entrance entrance"> |
| | | <div className="icon"><ApiOutlined /></div> |
| | | <div className="title">接口调试</div> |
| | | <div className="detail">可自动处理登录接口的参数加密,以及业务接口的签名计算,方便开发人员的接口测试工作。</div> |
| | | <Button type="primary" disabled={!(memberLevel >= 20)} title={memberLevel >= 20 ? '' : '会员等级不够,无开发权限。'} onClick={() => {window.open('#/interface')}}> |
| | | 编辑 |
| | | {window.GLOB.systemType !== 'production' ? <div className="menu-entrance entrance"> |
| | | <div className="icon"><MenuOutlined /></div> |
| | | <div className="title">菜单操作说明</div> |
| | | <div className="detail">鼠标悬停 <SettingOutlined style={{color: '#1890ff'}}/> 可显示菜单的添加、排序(包括编辑、删除)与解冻功能,双击三级菜单可进入编辑窗口。</div> |
| | | <Button type="primary" onClick={() => {window.open('#/main')}}> |
| | | 新窗口 |
| | | </Button> |
| | | </div> |
| | | {/* window.btoa(window.encodeURIComponent(JSON.stringify({ MenuType: 'home', MenuId: 'home_page_id', MenuName: '首页' }))) */} |
| | | {window.GLOB.systemType !== 'production' ? |
| | | <div className="home-entrance entrance"> |
| | | <div className="icon"><HomeOutlined /></div> |
| | | <div className="title">首页</div> |
| | | <div className="detail">基于自定义页面的首页设计,可实现灵活的元素配置及样式调整,展现当前系统的风格。</div> |
| | | <Button type="primary" disabled={!(memberLevel >= 20)} title={memberLevel >= 20 ? '' : '会员等级不够,无开发权限。'} onClick={() => {window.open('#/menudesign/JTdCJTIyTWVudVR5cGUlMjIlM0ElMjJob21lJTIyJTJDJTIyTWVudUlkJTIyJTNBJTIyaG9tZV9wYWdlX2lkJTIyJTJDJTIyTWVudU5hbWUlMjIlM0ElMjIlRTklQTYlOTYlRTklQTElQjUlMjIlN0Q=')}}> |
| | | 编辑 |
| | | </Button> |
| | | </div> : null |
| | | } |
| | | </div> : null} |
| | | {/* 编辑菜单 */} |
| | | {editLevel === 'level1' ? <EditMenu menulist={this.state.menulist} reload={this.reload} exitEdit={this.exitEdit}/> : null} |
| | | {/* 头像、用户名 */} |
| | |
| | | cursor: pointer; |
| | | } |
| | | .home-entrance { |
| | | left: 300px; |
| | | left: 260px; |
| | | } |
| | | .api-entrance { |
| | | left: 600px; |
| | | left: 540px; |
| | | } |
| | | .app-entrance { |
| | | left: 900px; |
| | | left: 820px; |
| | | } |
| | | .menu-entrance { |
| | | left: 1100px; |
| | | } |
| | | .entrance { |
| | | position: absolute; |
| | |
| | | import { is, fromJS } from 'immutable' |
| | | import { connect } from 'react-redux' |
| | | import { DndProvider } from 'react-dnd' |
| | | import { withRouter } from 'react-router-dom' |
| | | import HTML5Backend from 'react-dnd-html5-backend' |
| | | import { notification, Modal, Button } from 'antd' |
| | | import moment from 'moment' |
| | |
| | | import MKEmitter from '@/utils/events.js' |
| | | import MkIcon from '@/components/mk-icon' |
| | | import Utils from '@/utils/utils.js' |
| | | import MenuUtils from '@/utils/utils-custom.js' |
| | | import DragElement from '../menuelement' |
| | | import asyncLoadComponent from '@/utils/asyncLoadComponent' |
| | | import './index.scss' |
| | |
| | | }) |
| | | } |
| | | |
| | | 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({ |
| | | confirmLoading: false, |
| | | handleMVisible: false, |
| | | sysMenu: null |
| | | }) |
| | | |
| | | MKEmitter.emit('mkUpdateMenuList') |
| | | document.getElementById('root').style.overflowY = 'unset' |
| | | } else { |
| | | this.setState({ |
| | | confirmLoading: false |
| | | }) |
| | | notification.warning({ |
| | | top: 92, |
| | | message: response.message, |
| | | duration: 5 |
| | | }) |
| | | } |
| | | }) |
| | | } else { |
| | | this.setState({ |
| | | confirmLoading: false |
| | | }) |
| | | notification.warning({ |
| | | top: 92, |
| | | message: result.message, |
| | | duration: 5 |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | this.setState({ |
| | | menulist: this.props.menulist |
| | |
| | | return {} |
| | | } |
| | | |
| | | export default withRouter(connect(mapStateToProps, mapDispatchToProps)(EditMenu)) |
| | | export default connect(mapStateToProps, mapDispatchToProps)(EditMenu) |
| | |
| | | loading: false, |
| | | sysMenu: _cell |
| | | }) |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '当前菜单不可编辑', |
| | | duration: 5 |
| | | }) |
| | | } |
| | | } |
| | | |
| | |
| | | import { Form, Row, Col, Input, Select } from 'antd' |
| | | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import './index.scss' |
| | | // import './index.scss' |
| | | |
| | | const MkEditIcon = asyncComponent(() => import('@/components/mkIcon')) |
| | | |
| | |
| | | import MKEmitter from '@/utils/events.js' |
| | | import Utils from '@/utils/utils.js' |
| | | import Preview from './preview' |
| | | import MenuUtils from '@/utils/utils-custom.js' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | |
| | | import mainsubtable from '@/assets/img/mainsubtable.jpg' |
| | |
| | | preview: null |
| | | }) |
| | | } |
| | | // this.setState({ |
| | | // tabview: 'template', |
| | | // editMenu: { |
| | | // MenuID: Utils.getuuid(), |
| | | // MenuName: '', |
| | | // MenuNo: '', |
| | | // type: '', |
| | | // PageParam: '', |
| | | // LongParam: '', |
| | | // isSubtable: '', // 是否为主子表 |
| | | // ParentId: this.props.supMenu.MenuID, |
| | | // supMenuList: this.props.supMenuList, |
| | | // fstMenuId: this.props.mainMenu.MenuID, |
| | | // fstMenuList: this.props.menuTree, |
| | | // menuSort: (this.props.menulist.length + 1) * 10 // 新建菜单设置排序 |
| | | // } |
| | | // }, () => { |
| | | // document.getElementById('root').style.overflowY = 'hidden' |
| | | // }) |
| | | |
| | | useTemplate = (template) => { |
| | | const { mainMenu, supMenu, menuTree } = this.props |
| | |
| | | PageParam.url = values.url |
| | | } |
| | | |
| | | if (sysMenu.copyId) { |
| | | if (sysMenu.copyId && sysMenu.Template !== 'CustomPage') { |
| | | PageParam.copyMenuId = sysMenu.copyId |
| | | } |
| | | |
| | |
| | | loading: true |
| | | }) |
| | | |
| | | if (sysMenu.Template === 'CustomPage' && sysMenu.copyId) { |
| | | this.copyMenu(param, sysMenu.copyId) |
| | | } else { |
| | | Api.getSystemConfig(param).then(response => { |
| | | if (response.status) { |
| | | this.setState({ |
| | |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | 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({ |
| | | loading: false, |
| | | addVisible: false, |
| | | sysMenu: null |
| | | }) |
| | | |
| | | MKEmitter.emit('mkUpdateMenuList') |
| | | document.getElementById('root').style.overflowY = 'unset' |
| | | } else { |
| | | this.setState({ |
| | | loading: false |
| | | }) |
| | | notification.warning({ |
| | | top: 92, |
| | | message: response.message, |
| | | duration: 5 |
| | | }) |
| | | } |
| | | }) |
| | | } else { |
| | | this.setState({ |
| | | confirmLoading: false |
| | | }) |
| | | notification.warning({ |
| | | top: 92, |
| | | message: result.message, |
| | | duration: 5 |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |