| | |
| | | import React, {Component} from 'react' |
| | | import { Radio } from 'antd' |
| | | |
| | | import avatar from '@/assets/img/avatar.jpg' |
| | | import MainLogo from '@/assets/img/main-logo.png' |
| | |
| | | class MobHeader extends Component { |
| | | state = { |
| | | avatar: sessionStorage.getItem('CloudAvatar') || avatar, |
| | | userName: sessionStorage.getItem('CloudUserName'), |
| | | typename: sessionStorage.getItem('typename') |
| | | } |
| | | |
| | | changeView = (e) => { |
| | | let val = e.target.value |
| | | this.props.changeView(val) |
| | | userName: sessionStorage.getItem('CloudUserName') |
| | | } |
| | | |
| | | render () { |
| | | const { typename } = this.state |
| | | return ( |
| | | <header className="mob-header-container"> |
| | | <div className="header-logo"><img src={MainLogo} alt=""/></div> |
| | | {typename === 'pad' ? <div className="change-view"> |
| | | <Radio.Group defaultValue="vertical" onChange={this.changeView}> |
| | | <Radio value="vertical">竖屏</Radio> |
| | | <Radio value="horizontal">横屏</Radio> |
| | | </Radio.Group> |
| | | </div> : null} |
| | | <div className="header-user"> |
| | | <img src={this.state.avatar} alt=""/> |
| | | <span> |
| | |
| | | cell.delay = _param.delay || 0 |
| | | cell.statusBarColor = _param.statusBarColor || 'black' |
| | | cell.sysBgColor = _param.sysBgColor || '#ffffff' |
| | | cell.direction = _param.direction || 'vertical' |
| | | cell.adapter = _param.adapter || '' |
| | | cell.share = _param.share || 'false' // 分享 |
| | | cell.share_des = _param.share_des || '' // 分享描述 |
| | |
| | | }) |
| | | |
| | | // 子应用ID、typename、应用ID、CloudUserID、appkey、login_types(是否需要登录,已弃用)、link_type(是否使用短连接,已弃用)、role_type(是否使用角色管理)、lang、css(皮肤)、title(标题)、favicon(图标)、user_binding(用户绑定)、sms_id(短信模板ID)、自定义 |
| | | param.LText = sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','false','false','${item.role_type || 'true'}','${item.lang || 'zh-CN'}','${item.css || ''}','${item.title || ''}','${item.favicon || ''}','${item.user_binding || 'false'}','','${window.btoa(window.encodeURIComponent(JSON.stringify({userbind: item.userbind || '', instantMessage: item.instantMessage || '', apptype: item.apptype || '', delay: item.delay || 0, statusBarColor: item.statusBarColor || 'black', sysBgColor: item.sysBgColor || '#ffffff', adapter: item.adapter || '', share: item.share || '', share_des: item.share_des || '', share_url: item.share_url || '', share_link: item.share_link || ''})))}'`) |
| | | param.LText = sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','false','false','${item.role_type || 'true'}','${item.lang || 'zh-CN'}','${item.css || ''}','${item.title || ''}','${item.favicon || ''}','${item.user_binding || 'false'}','','${window.btoa(window.encodeURIComponent(JSON.stringify({userbind: item.userbind || '', instantMessage: item.instantMessage || '', apptype: item.apptype || '', delay: item.delay || 0, statusBarColor: item.statusBarColor || 'black', sysBgColor: item.sysBgColor || '#ffffff', direction: item.direction || 'vertical', adapter: item.adapter || '', share: item.share || '', share_des: item.share_des || '', share_url: item.share_url || '', share_link: item.share_link || ''})))}'`) |
| | | param.LText = param.LText.join(' union all ') |
| | | param.LText = Utils.formatOptions(param.LText) |
| | | |
| | |
| | | return item |
| | | }) |
| | | |
| | | param.LText = selectApp.sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','false','false','${item.role_type || 'true'}','${item.lang || 'zh-CN'}','${item.css || ''}','${item.title || ''}','${item.favicon || ''}','${item.user_binding || 'false'}','','${window.btoa(window.encodeURIComponent(JSON.stringify({userbind: item.userbind || '', instantMessage: item.instantMessage || '', apptype: item.apptype || '', delay: item.delay || 0, statusBarColor: item.statusBarColor || 'black', sysBgColor: item.sysBgColor || '#ffffff', adapter: item.adapter || '', share: item.share || '', share_des: item.share_des || '', share_url: item.share_url || '', share_link: item.share_link || ''})))}'`) |
| | | param.LText = selectApp.sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','false','false','${item.role_type || 'true'}','${item.lang || 'zh-CN'}','${item.css || ''}','${item.title || ''}','${item.favicon || ''}','${item.user_binding || 'false'}','','${window.btoa(window.encodeURIComponent(JSON.stringify({userbind: item.userbind || '', instantMessage: item.instantMessage || '', apptype: item.apptype || '', delay: item.delay || 0, statusBarColor: item.statusBarColor || 'black', sysBgColor: item.sysBgColor || '#ffffff', direction: item.direction || 'vertical', adapter: item.adapter || '', share: item.share || '', share_des: item.share_des || '', share_url: item.share_url || '', share_link: item.share_link || ''})))}'`) |
| | | param.LText = param.LText.join(' union all ') |
| | | param.LText = Utils.formatOptions(param.LText) |
| | | } |
| | |
| | | return item |
| | | }) |
| | | |
| | | param.LText = sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','false','false','${item.role_type || 'true'}','${item.lang || 'zh-CN'}','${item.css || ''}','${item.title || ''}','${item.favicon || ''}','${item.user_binding || 'false'}','','${window.btoa(window.encodeURIComponent(JSON.stringify({userbind: item.userbind || '', instantMessage: item.instantMessage || '', apptype: item.apptype || '', delay: item.delay || 0, statusBarColor: item.statusBarColor || 'black', sysBgColor: item.sysBgColor || '#ffffff', adapter: item.adapter || '', share: item.share || '', share_des: item.share_des || '', share_url: item.share_url || '', share_link: item.share_link || ''})))}'`) |
| | | param.LText = sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','false','false','${item.role_type || 'true'}','${item.lang || 'zh-CN'}','${item.css || ''}','${item.title || ''}','${item.favicon || ''}','${item.user_binding || 'false'}','','${window.btoa(window.encodeURIComponent(JSON.stringify({userbind: item.userbind || '', instantMessage: item.instantMessage || '', apptype: item.apptype || '', delay: item.delay || 0, statusBarColor: item.statusBarColor || 'black', sysBgColor: item.sysBgColor || '#ffffff', direction: item.direction || 'vertical', adapter: item.adapter || '', share: item.share || '', share_des: item.share_des || '', share_url: item.share_url || '', share_link: item.share_link || ''})))}'`) |
| | | param.LText = param.LText.join(' union all ') |
| | | param.LText = Utils.formatOptions(param.LText) |
| | | |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | {typename === 'pad' ? <Col span={12}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="系统默认屏幕方向,单个页面方向请在页面中配置。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 屏幕方向 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('direction', { |
| | | initialValue: card ? card.direction || 'vertical' : 'vertical' |
| | | })( |
| | | <Radio.Group> |
| | | <Radio value="vertical">竖屏</Radio> |
| | | <Radio value="horizontal">横屏</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | </Row> |
| | | </Form> |
| | | ) |
| | |
| | | menuloading: false, |
| | | oriConfig: null, |
| | | config: null, |
| | | direction: 'vertical', |
| | | settingshow: true, |
| | | controlshow: true, |
| | | comloading: false, |
| | |
| | | sessionStorage.setItem('typename', param.typename || 'mob') |
| | | sessionStorage.setItem('adapter', param.adapter || '') |
| | | sessionStorage.setItem('sysBgColor', param.sysBgColor || '#ffffff') |
| | | sessionStorage.setItem('direction', param.direction || 'vertical') |
| | | sessionStorage.setItem('userbind', param.userbind || '') |
| | | sessionStorage.setItem('instantMessage', param.instantMessage || '') |
| | | |
| | |
| | | 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 |
| | | } |
| | | |
| | | let adapters = sessionStorage.getItem('adapter') |
| | | if (adapters) { |
| | |
| | | config.uuid = MenuId |
| | | config.MenuID = MenuId |
| | | config.open_edition = result.open_edition || '' |
| | | config.direction = config.direction || sessionStorage.getItem('direction') || 'vertical' |
| | | window.GLOB.urlFields = config.urlFields || [] |
| | | |
| | | if (sessionStorage.getItem('typename') === 'pad') { |
| | | if (config.direction !== '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 |
| | | } |
| | | } |
| | | |
| | | if (config.version !== 2.0) { |
| | | config.components = this.collectTB(config.components) |
| | |
| | | config.MenuName = urlParam.MenuName || '' |
| | | // config.MenuNo = urlParam.MenuNo || '' |
| | | config.MenuNo = '' |
| | | config.direction = config.direction || sessionStorage.getItem('direction') || 'vertical' |
| | | |
| | | if (sessionStorage.getItem('typename') === 'pad') { |
| | | if (config.direction !== '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 |
| | | } |
| | | } |
| | | |
| | | let navItem = null |
| | | config.components.forEach(item => { |
| | |
| | | } |
| | | |
| | | changeView = (val) => { |
| | | if (sessionStorage.getItem('typename') !== 'pad') return |
| | | |
| | | if (val !== 'vertical') { |
| | | window.GLOB.winWidth = 992 |
| | | window.GLOB.winHeight = 690 |
| | |
| | | } |
| | | |
| | | this.setState({ |
| | | direction: val, |
| | | comloading: true |
| | | }, () => { |
| | | this.setState({ comloading: false }) |
| | |
| | | return ( |
| | | <ConfigProvider locale={antdZhCN}> |
| | | <div className={'mk-mob-view ' + viewType} id="mk-mob-design-view"> |
| | | <Header changeView={this.changeView}/> |
| | | <Header/> |
| | | {loading ? <Spin className="view-spin" size="large" /> : null} |
| | | <DndProvider backend={HTML5Backend}> |
| | | <div className={'menu-setting ' + (!settingshow ? 'hidden' : '')}> |
| | |
| | | config={config} |
| | | MenuId={MenuId} |
| | | adapters={adapters} |
| | | updateConfig={this.updateConfig} |
| | | updateConfig={(con) => { |
| | | this.updateConfig(con) |
| | | if (con.direction !== config.direction) { |
| | | this.changeView(con.direction) |
| | | } |
| | | }} |
| | | /> : null} |
| | | {config ? <UrlFieldComponent config={config} updateConfig={this.updateConfig}/> : null} |
| | | {/* 表名添加 */} |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={24}> |
| | | <Form.Item label="屏幕方向"> |
| | | {getFieldDecorator('direction', { |
| | | initialValue: config.direction || 'vertical' |
| | | })( |
| | | <Radio.Group onChange={(e) => {this.selectChange('direction', e.target.value)}}> |
| | | <Radio value="vertical">竖屏</Radio> |
| | | <Radio value="horizontal">横屏</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | {adapters.includes('app') || adapters.includes('wxmini') ? <Col span={24}> |
| | | <Form.Item className="status-bar" label={ |
| | | <Tooltip placement="topLeft" title="在明科云APP或小程序中,状态栏的背景色。"> |