| | |
| | | viewType: 'menu', |
| | | view: '', |
| | | eyeopen: false, |
| | | needUpdate: false |
| | | needUpdate: false, |
| | | appLoginId: '', |
| | | appHomeId: '' |
| | | } |
| | | |
| | | UNSAFE_componentWillMount() { |
| | |
| | | adapters = [] |
| | | } |
| | | |
| | | let appLoginId = '' |
| | | let appHomeId = '' |
| | | if (sessionStorage.getItem('appViewList')) { |
| | | try { |
| | | let appMenus = JSON.parse(sessionStorage.getItem('appViewList')) |
| | | appMenus.forEach(item => { |
| | | if (item.keys_type === 'login') { |
| | | appLoginId = item.keys_id |
| | | } else if (item.keys_type === 'index') { |
| | | appHomeId = item.keys_id |
| | | } |
| | | }) |
| | | } catch (e) { |
| | | |
| | | } |
| | | } |
| | | |
| | | this.setState({ |
| | | adapters, |
| | | MenuId: param.MenuID, |
| | | viewType: /^userbind/.test(param.MenuID) ? 'userbind' : 'menu' |
| | | viewType: /^userbind/.test(param.MenuID) ? 'userbind' : 'menu', |
| | | appLoginId: appLoginId, |
| | | appHomeId: appHomeId |
| | | }, () => { |
| | | this.getMenuParam(param) |
| | | }) |
| | |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | param.secretkey = Utils.encrypt('', param.timestamp) |
| | | |
| | | const that = this |
| | | |
| | | confirm({ |
| | | title: '确定设置本页面为首页吗?', |
| | | content: '', |
| | |
| | | }) |
| | | } else { |
| | | sessionStorage.setItem('appViewList', JSON.stringify(appViewList)) |
| | | |
| | | that.setState({ |
| | | appHomeId: config.MenuID |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | |
| | | param.secretkey = Utils.encrypt('', param.timestamp) |
| | | |
| | | let hasLogin = config.components.findIndex(item => item.type === 'login') > -1 |
| | | const that = this |
| | | |
| | | confirm({ |
| | | title: '确定设置本页面为登录页吗?', |
| | |
| | | }) |
| | | } else { |
| | | sessionStorage.setItem('appViewList', JSON.stringify(appViewList)) |
| | | |
| | | that.setState({ |
| | | appLoginId: config.MenuID |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | |
| | | |
| | | |
| | | render () { |
| | | const { view, viewType, comloading, loading, settingshow, controlshow, activeKey, MenuId, config, menuloading, adapters, eyeopen, needUpdate } = this.state |
| | | const { view, viewType, comloading, loading, settingshow, controlshow, activeKey, MenuId, config, menuloading, adapters, eyeopen, needUpdate, appLoginId, appHomeId } = this.state |
| | | |
| | | return ( |
| | | <div className={'mk-mob-view ' + viewType} id="mk-mob-design-view"> |
| | |
| | | <PictureController/> |
| | | <Quotecomponent config={config} updateConfig={this.updateConfig}/> |
| | | <StyleCombControlButton menu={config} /> |
| | | <Button className="mk-border-green set-home" onClick={this.setHomeView}><HomeOutlined /> 设为首页</Button> |
| | | <Button className="mk-border-purple set-login" onClick={this.setLoginView}><LoginOutlined /> 设为登录页</Button> |
| | | <Button className="mk-border-green set-home" disabled={MenuId === appHomeId} onClick={this.setHomeView}><HomeOutlined /> 设为首页</Button> |
| | | <Button className="mk-border-purple set-login" disabled={MenuId === appLoginId} onClick={this.setLoginView}><LoginOutlined /> 设为登录页</Button> |
| | | <ReplaceField type="custom" config={config} updateConfig={this.resetConfig}/> |
| | | <Transfer MenuID={MenuId} /> |
| | | {config ? <Versions MenuId={MenuId} Template="webPage" checklog={this.checklog} updateConfig={this.updateLogConfig}/> : null} |
| | |
| | | eyeopen: false, |
| | | view: '', |
| | | popConfig: null, |
| | | needUpdate: false |
| | | needUpdate: false, |
| | | appLoginId: '', |
| | | appHomeId: '' |
| | | } |
| | | |
| | | UNSAFE_componentWillMount() { |
| | |
| | | |
| | | this.getAppMessage(param.MenuID) |
| | | } else if (param.type === 'view') { |
| | | let appLoginId = '' |
| | | let appHomeId = '' |
| | | if (sessionStorage.getItem('appViewList')) { |
| | | try { |
| | | let appMenus = JSON.parse(sessionStorage.getItem('appViewList')) |
| | | appMenus.forEach(item => { |
| | | if (item.keys_type === 'login') { |
| | | appLoginId = item.keys_id |
| | | } else if (item.keys_type === 'index') { |
| | | appHomeId = item.keys_id |
| | | } |
| | | }) |
| | | } catch (e) { |
| | | |
| | | } |
| | | } |
| | | |
| | | this.setState({ |
| | | MenuId: param.MenuID |
| | | MenuId: param.MenuID, |
| | | appLoginId: appLoginId, |
| | | appHomeId: appHomeId |
| | | }, () => { |
| | | this.getMenuParam(param) |
| | | }) |
| | |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | param.secretkey = Utils.encrypt('', param.timestamp) |
| | | |
| | | const that = this |
| | | |
| | | confirm({ |
| | | title: '确定设置本页面为首页吗?', |
| | | content: '', |
| | |
| | | }) |
| | | } else { |
| | | sessionStorage.setItem('appViewList', JSON.stringify(appViewList)) |
| | | |
| | | that.setState({ |
| | | appHomeId: config.MenuID |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | |
| | | param.secretkey = Utils.encrypt('', param.timestamp) |
| | | |
| | | let hasLogin = config.components.findIndex(item => item.type === 'login') > -1 |
| | | const that = this |
| | | |
| | | confirm({ |
| | | title: '确定设置本页面为登录页吗?', |
| | |
| | | }) |
| | | } else { |
| | | sessionStorage.setItem('appViewList', JSON.stringify(appViewList)) |
| | | |
| | | that.setState({ |
| | | appLoginId: config.MenuID |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | |
| | | } |
| | | |
| | | render () { |
| | | const { view, loading, comloading, activeKey, settingshow, controlshow, MenuId, config, menuloading, eyeopen, needUpdate } = this.state |
| | | const { view, loading, comloading, activeKey, settingshow, controlshow, MenuId, config, menuloading, eyeopen, needUpdate, appLoginId, appHomeId } = this.state |
| | | |
| | | return ( |
| | | <> |
| | |
| | | <PictureController/> |
| | | <Quotecomponent config={config} updateConfig={this.updateConfig}/> |
| | | <StyleCombControlButton menu={config} /> |
| | | <Button className="mk-border-green" onClick={this.setHomeView}><HomeOutlined /> 设为首页</Button> |
| | | <Button className="mk-border-purple" onClick={this.setLoginView}><LoginOutlined/> 设为登录页</Button> |
| | | <Button className="mk-border-green" disabled={MenuId === appHomeId} onClick={this.setHomeView}><HomeOutlined /> 设为首页</Button> |
| | | <Button className="mk-border-purple" disabled={MenuId === appLoginId} onClick={this.setLoginView}><LoginOutlined/> 设为登录页</Button> |
| | | <ReplaceField type="custom" config={config} updateConfig={this.resetConfig}/> |
| | | <Transfer MenuID={MenuId} /> |
| | | {config ? <Versions MenuId={MenuId} Template="webPage" checklog={this.checklog} updateConfig={this.updateLogConfig}/> : null} |
| | |
| | | columns: [ |
| | | { |
| | | title: '菜单名称', dataIndex: 'MenuName', key: 'MenuName', align: 'center', render: (text, record) => { |
| | | if (record.extra) { |
| | | if (record.extra || this.state.appKeys.includes(record.MenuID)) { |
| | | return <span style={{color: '#1890ff'}}>{text}</span> |
| | | } else if (record.interfaces === 'true') { |
| | | return <span><ApiOutlined style={{color: 'orange', marginRight: '5px'}} title="菜单中使用了外部接口" />{text}</span> |
| | |
| | | trees: null, |
| | | expandedKeys: [], |
| | | searchkey: '', |
| | | appViewList: [] |
| | | appViewList: [], |
| | | appKeys: [] |
| | | } |
| | | |
| | | oriTrees = null |
| | |
| | | }) |
| | | return |
| | | } |
| | | this.setState({appViewList: result.data || []}) |
| | | |
| | | let data = result.data || [] |
| | | this.setState({appViewList: data, appKeys: data.map(item => item.keys_id)}) |
| | | }) |
| | | } |
| | | |