From f59a500d24291d7f54b71dcca939a2a23dedca7c Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 18 六月 2020 17:52:03 +0800 Subject: [PATCH] 2020-06-18 --- src/views/mobdesign/index.jsx | 98 ++++++++++++++++++++++++++++++++++-------------- 1 files changed, 69 insertions(+), 29 deletions(-) diff --git a/src/views/mobdesign/index.jsx b/src/views/mobdesign/index.jsx index c90ada7..f22c849 100644 --- a/src/views/mobdesign/index.jsx +++ b/src/views/mobdesign/index.jsx @@ -1,27 +1,34 @@ -import React, {Component} from 'react' -import {connect} from 'react-redux' -import { Icon } from 'antd' +import React, { Component } from 'react' +import { connect } from 'react-redux' +import { DndProvider } from 'react-dnd' +import HTML5Backend from 'react-dnd-html5-backend' +import { Icon, Tabs } from 'antd' -import zhCN from '@/locales/zh-CN/login.js' -import enUS from '@/locales/en-US/login.js' +import Api from '@/api' +import zhCN from '@/locales/zh-CN/mob.js' +import enUS from '@/locales/en-US/mob.js' import asyncComponent from '@/utils/asyncComponent' import './index.scss' +const { TabPane } = Tabs + const Header = asyncComponent(() => import('@/mob/header')) -const Home = asyncComponent(() => import('@/mob/home')) -const Login = asyncComponent(() => import('@/mob/login')) +const MobShell = asyncComponent(() => import('@/mob/mobshell')) +const SourceWrap = asyncComponent(() => import('@/mob/modelsource')) +const DataSource = asyncComponent(() => import('@/mob/datasource')) class Mobile extends Component { state = { dict: localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, - view: null + appId: this.props.match.params.appId, + appType: this.props.match.params.appType, + saveIng: false, + config: null } UNSAFE_componentWillMount() { - this.setState({ - view: {uuid: 'login', type: 'home', parentId: null, parentType: null} - }) + this.getPageParam(this.props.match.params.appId) } /** @@ -33,31 +40,64 @@ } } + jumpToManage = () => { + this.props.history.replace('/mobmanage') + // this.props.history.push('/mobdesign/sdafadjfidsf/dsfsdf') + } + + triggerSave = () => { + this.setState({ + saveIng: true + }) + } + + getPageParam = (id) => { + Api.getSystemConfig({ + func: 'sPC_Get_LongParam', + MenuID: id + }).then(result => { + + }) + } + + updateConfig = () => { + + } + render () { - const { view } = this.state + const { saveIng, appType, config } = this.state return ( <div className="mobile-view"> - <Header /> - <div className="mob-body"> - <div className="mob-tool"> - <div className="mob-tool-content"> - <div className="plus-content"> - <Icon type="plus-circle" />娣� 鍔� 鍐� 瀹� + <Header view="design" jumpToManage={this.jumpToManage} triggerSave={this.triggerSave} saveIng={saveIng} /> + <DndProvider backend={HTML5Backend}> + <div className="mob-body"> + <div className="mob-tool"> + <div className="mob-tool-content"> + <div className="plus-content"> + <Icon type="plus-circle" />娣� 鍔� 鍐� 瀹� + </div> + <div className="useable-component"> + <SourceWrap appType={appType} /> + </div> </div> - <div className="useable-component"></div> + <div className="mob-tool-other"></div> </div> - <div className="mob-tool-other"></div> + <div className="mob-shell"> + <MobShell /> + </div> + <div className="mob-setting"> + <Tabs defaultActiveKey="2" animated={false} size="small"> + <TabPane tab="閰嶇疆" key="1"> + Content of Tab Pane 1 + </TabPane> + <TabPane tab="鏁版嵁婧�" key="2"> + <DataSource config={config} updateConfig={this.updateConfig} /> + </TabPane> + </Tabs> + </div> </div> - <div className="mob-shell"> - {view ? <div className="mob-shell-inner"> - {view.type === 'login' ? <Login /> : null} - {view.type === 'home' ? <Home /> : null} - </div> : null} - </div> - <div className="mob-setting"> - </div> - </div> + </DndProvider> </div> ) } -- Gitblit v1.8.0