| | |
| | | |
| | | import Api from '@/api' |
| | | import Utils, { setGLOBFuncs } from '@/utils/utils.js' |
| | | import zhCN from '@/locales/zh-CN/mob.js' |
| | | import enUS from '@/locales/en-US/mob.js' |
| | | // import antdEnUS from 'antd/es/locale/en_US' |
| | | import antdZhCN from 'antd/es/locale/zh_CN' |
| | | import MKEmitter from '@/utils/events.js' |
| | |
| | | |
| | | class MenuDesign extends Component { |
| | | state = { |
| | | dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, |
| | | loading: true, |
| | | MenuId: '', |
| | | MenuName: '', |
| | |
| | | sessionStorage.setItem('kei_no', param.kei_no || '') |
| | | sessionStorage.setItem('sysBgColor', param.sysBgColor || '#ffffff') |
| | | |
| | | this.setState({ |
| | | dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS |
| | | }) |
| | | this.getAppMessage(param.MenuID) |
| | | } else if (param.type === 'view') { |
| | | this.setState({ |
| | |
| | | } |
| | | |
| | | render () { |
| | | const { loading, comloading, activeKey, settingshow, controlshow, dict, MenuId, config, menuloading, customComponents, eyeopen } = this.state |
| | | const { loading, comloading, activeKey, settingshow, controlshow, MenuId, config, menuloading, customComponents, eyeopen } = this.state |
| | | |
| | | return ( |
| | | <ConfigProvider locale={antdZhCN}> |
| | |
| | | <Panel header="基本信息" key="basedata"> |
| | | {/* 菜单信息 */} |
| | | {config ? <MenuForm |
| | | dict={dict} |
| | | config={config} |
| | | MenuId={MenuId} |
| | | updateConfig={this.updateConfig} |
| | |
| | | {config ? <Paragraph style={{padding: '15px 0px 0px 18px'}} copyable={{ text: MenuId }}>菜单ID</Paragraph> : null} |
| | | </Panel> |
| | | {/* 组件添加 */} |
| | | <Panel header={dict['mob.component']} key="component"> |
| | | <Panel header="组件" key="component"> |
| | | <SourceWrap /> |
| | | </Panel> |
| | | <Panel header="元素" key="element"> |
| | |
| | | {!controlshow ? <DoubleLeftOutlined onClick={() => {sessionStorage.setItem('controlshow', 'true'); this.setState({controlshow: true})}}/> : null} |
| | | </div> |
| | | <div className="wrap"> |
| | | <Button type="primary" id="save-config" onClick={this.submitConfig} loading={menuloading}>{dict['mob.save']}</Button> |
| | | <Switch className="big" checkedChildren={dict['mob.enable']} unCheckedChildren={dict['mob.disable']} checked={config && config.enabled} onChange={this.onEnabledChange} /> |
| | | <Button type="primary" id="save-config" onClick={this.submitConfig} loading={menuloading}>保存</Button> |
| | | <Switch className="big" checkedChildren="启" unCheckedChildren="停" checked={config && config.enabled} onChange={this.onEnabledChange} /> |
| | | <ArrowLeftOutlined title="后退" className="back-view" onClick={this.backView}/> |
| | | <Button className="mk-border-purple" onClick={() => this.setState({eyeopen: !eyeopen})}>{!eyeopen ? <EyeOutlined /> : <EyeInvisibleOutlined />} 组件名</Button> |
| | | <CreateView resetmenu={this.getAppMenus} /> |