| | |
| | | const Header = asyncComponent(() => import('@/mob/header')) |
| | | const MenuForm = asyncComponent(() => import('./menuform')) |
| | | const MobShell = asyncComponent(() => import('@/mob/mobshell')) |
| | | const CreateView = asyncComponent(() => import('@/pc/createview')) |
| | | const SourceWrap = asyncComponent(() => import('@/mob/modulesource')) |
| | | const BgController = asyncComponent(() => import('@/pc/bgcontroller')) |
| | | const SysInterface = asyncComponent(() => import('@/menu/sysinterface')) |
| | |
| | | config: null, |
| | | visible: false, |
| | | customComponents: [], |
| | | direction: 'vertical', |
| | | comloading: false |
| | | } |
| | | |
| | | UNSAFE_componentWillMount() { |
| | |
| | | sessionStorage.setItem('appId', param.ID || '') |
| | | sessionStorage.setItem('lang', param.lang || 'zh-CN') |
| | | sessionStorage.setItem('kei_no', param.kei_no || '') |
| | | sessionStorage.setItem('link_type', param.link_type || 'true') |
| | | sessionStorage.setItem('role_type', param.role_type || 'true') |
| | | sessionStorage.setItem('login_types', param.login_types || 'true') |
| | | sessionStorage.setItem('typename', param.typename || 'mob') |
| | | |
| | | this.setState({ |
| | | localedict: sessionStorage.getItem('lang') !== 'en-US' ? antdZhCN : antdEnUS, |
| | |
| | | }) |
| | | this.getAppMessage() |
| | | } else if (param.type === 'view') { |
| | | window.GLOB.winWidth = 420 |
| | | window.GLOB.winHeight = 738 |
| | | window.GLOB.shellWidth = 376 |
| | | window.GLOB.shellHeight = 680 |
| | | |
| | | if (sessionStorage.getItem('typename') === 'pad') { |
| | | window.GLOB.winWidth = 736 |
| | | window.GLOB.winHeight = 945 |
| | | window.GLOB.shellWidth = 640 |
| | | window.GLOB.shellHeight = 853 |
| | | } |
| | | |
| | | this.setState({ |
| | | MenuId: param.MenuID |
| | | }, () => { |
| | |
| | | type: 'view' |
| | | } |
| | | |
| | | if (menu.fixed && menu.MenuNo && menu.MenuName) { |
| | | param.fixed = true |
| | | } |
| | | param.MenuNo = menu.MenuNo || '' |
| | | param.MenuName = menu.MenuName || '' |
| | | |
| | |
| | | updateCustomComponent = () => { |
| | | Api.getSystemConfig({ |
| | | func: 's_get_custom_components', |
| | | typename: 'mob', |
| | | typename: sessionStorage.getItem('typename'), |
| | | typecharone: '' |
| | | }).then(res => { |
| | | let coms = [] |
| | |
| | | let param = { |
| | | func: 'sPC_Get_LongParam', |
| | | TypeCharOne: sessionStorage.getItem('kei_no'), |
| | | typename: 'mob', |
| | | typename: sessionStorage.getItem('typename'), |
| | | MenuID: MenuId |
| | | } |
| | | |
| | |
| | | config.open_edition = result.open_edition || '' |
| | | window.GLOB.urlFields = config.urlFields || [] |
| | | |
| | | if (urlParam.fixed && urlParam.MenuName && urlParam.MenuNo) { |
| | | config.fixed = true |
| | | } |
| | | |
| | | let indeComs = [] |
| | | config.components.forEach(item => { |
| | | if (item.type === 'navbar') { |
| | |
| | | let _param = { |
| | | func: 's_get_app_menus', |
| | | TypeCharOne: sessionStorage.getItem('kei_no'), |
| | | typename: 'mob', |
| | | typename: sessionStorage.getItem('typename'), |
| | | LText: `select '${window.GLOB.appkey}'`, |
| | | timestamp: moment().format('YYYY-MM-DD HH:mm:ss') |
| | | } |
| | |
| | | let param = { |
| | | func: 'sPC_Get_LongParam', |
| | | TypeCharOne: sessionStorage.getItem('kei_no'), |
| | | typename: 'mob', |
| | | typename: sessionStorage.getItem('typename'), |
| | | MenuID: urlParam.copyMenuId |
| | | } |
| | | |
| | |
| | | config.uuid = MenuId |
| | | config.MenuID = MenuId |
| | | config.open_edition = '' |
| | | config.MenuName = urlParam.MenuName || '' |
| | | config.MenuNo = urlParam.MenuNo || '' |
| | | |
| | | let indeComs = [] |
| | | config.components.forEach(item => { |
| | |
| | | Api.getSystemConfig({ |
| | | func: 'sPC_Get_LongParam', |
| | | TypeCharOne: sessionStorage.getItem('kei_no'), |
| | | typename: 'mob', |
| | | typename: sessionStorage.getItem('typename'), |
| | | MenuID: item.uuid |
| | | }).then(res => { |
| | | res.uuid = item.uuid |
| | |
| | | EasyCode: '', |
| | | Template: 'webPage', |
| | | TypeCharOne: sessionStorage.getItem('kei_no'), |
| | | Typename: 'mob', |
| | | Typename: sessionStorage.getItem('typename'), |
| | | MenuName: config.MenuName || '', |
| | | PageParam: JSON.stringify({Template: 'webPage'}), |
| | | open_edition: config.open_edition, |
| | |
| | | EasyCode: '', |
| | | Template: item.type, |
| | | TypeCharOne: sessionStorage.getItem('kei_no'), |
| | | Typename: 'mob', |
| | | Typename: sessionStorage.getItem('typename'), |
| | | MenuName: item.name || '', |
| | | PageParam: JSON.stringify({Template: item.type}), |
| | | open_edition: item.open_edition || '', |
| | |
| | | }) |
| | | } |
| | | |
| | | changeView = (val) => { |
| | | if (val !== 'vertical') { |
| | | window.GLOB.winWidth = 992 |
| | | window.GLOB.winHeight = 690 |
| | | window.GLOB.shellWidth = 853 |
| | | window.GLOB.shellHeight = 640 |
| | | } else { |
| | | window.GLOB.winWidth = 736 |
| | | window.GLOB.winHeight = 945 |
| | | window.GLOB.shellWidth = 640 |
| | | window.GLOB.shellHeight = 853 |
| | | } |
| | | |
| | | this.setState({ |
| | | direction: val, |
| | | comloading: true |
| | | }, () => { |
| | | this.setState({ comloading: false }) |
| | | }) |
| | | } |
| | | |
| | | render () { |
| | | const { localedict, loading, activeKey, dict, MenuId, config, menuloading, customComponents } = this.state |
| | | const { localedict, comloading, loading, activeKey, dict, MenuId, config, menuloading, customComponents } = this.state |
| | | |
| | | return ( |
| | | <ConfigProvider locale={localedict}> |
| | | <div className="mk-mob-view" id="mk-mob-design-view"> |
| | | <Header /> |
| | | <Header changeView={this.changeView}/> |
| | | {loading ? <Spin className="view-spin" size="large" /> : null} |
| | | <DndProvider backend={HTML5Backend}> |
| | | <div className="menu-setting"> |
| | |
| | | <div className="menu-control"> |
| | | <Button type="primary" 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} /> |
| | | <CreateView resetmenu={this.getAppMenus} /> |
| | | <PasteController type="menu" Tab={null} insert={this.insert} /> |
| | | <StyleCombControlButton menu={config} /> |
| | | <SysInterface config={config} updateConfig={this.updateConfig}/> |
| | |
| | | <Button type="default" onClick={this.closeView}>关闭</Button> |
| | | </div> |
| | | <div className={'menu-body ' + (menuloading ? 'saving' : '')}> |
| | | <div className="mob-shell"> |
| | | {config ? <MobShell menu={config} handleList={this.updateConfig} /> : null} |
| | | <div className="mob-shell" style={{width: window.GLOB.shellWidth, height: window.GLOB.shellHeight}}> |
| | | {config && !comloading ? <MobShell menu={config} handleList={this.updateConfig} /> : null} |
| | | </div> |
| | | </div> |
| | | </DndProvider> |