Sfoglia il codice sorgente

Merge branch 'master' of http://gogs.ioobot.com:6680/xy/online

wly 7 anni fa
parent
commit
52262c6bfc
53 ha cambiato i file con 406 aggiunte e 189 eliminazioni
  1. 75 55
      src/app/App.jsx
  2. 3 3
      src/app/graphqlService/common/application/Application.js
  3. 0 0
      src/app/graphqlService/common/caseMetabase/CaseMetabase.jsx
  4. 1 1
      src/app/graphqlService/common/deploy/Deploy.jsx
  5. 0 0
      src/app/graphqlService/common/deploy/ali/AliConfig.jsx
  6. 0 0
      src/app/graphqlService/common/deploy/amazon/AmazonConfig.js
  7. 0 0
      src/app/graphqlService/common/deploy/huawei/HuaweiConfig.jsx
  8. 0 0
      src/app/graphqlService/common/deploy/index.css
  9. 3 4
      src/app/graphqlService/common/deploy/tencent/APIGroupCard.js
  10. 3 4
      src/app/graphqlService/common/deploy/tencent/APIPathCard.js
  11. 3 4
      src/app/graphqlService/common/deploy/tencent/DeployCard.js
  12. 0 0
      src/app/graphqlService/common/deploy/tencent/NotificationCard.js
  13. 1 1
      src/app/graphqlService/common/deploy/tencent/TencentConfig.js
  14. 0 0
      src/app/graphqlService/common/generateJs/GenerateJs.jsx
  15. 0 0
      src/app/graphqlService/common/generateJs/index.css
  16. 0 0
      src/app/graphqlService/common/graphql/Graphql.jsx
  17. 0 0
      src/app/graphqlService/common/graphql/index.css
  18. 3 6
      src/app/graphqlService/common/schema/Create.js
  19. 3 5
      src/app/graphqlService/common/schema/Schema.jsx
  20. 2 2
      src/app/graphqlService/common/schema/Table.js
  21. 0 0
      src/app/graphqlService/common/schema/index.css
  22. 0 0
      src/app/graphqlService/dataAnalysis/DataAnalysis.jsx
  23. 0 0
      src/app/graphqlService/dataAnalysis/metabase/Metabase.jsx
  24. 0 0
      src/app/graphqlService/dataStorage/DataStorage.jsx
  25. 0 0
      src/app/graphqlService/dataStorage/databaseSetting/DatabaseSetting.jsx
  26. 0 0
      src/app/graphqlService/dataStorage/schemaCreate/SchemaCreate.jsx
  27. 0 0
      src/app/graphqlService/trialCase/TrialCase.jsx
  28. 0 0
      src/app/graphqlService/userCreate/UserCreate.jsx
  29. 1 1
      src/app/index.css
  30. 1 1
      src/app/quantService/QuantService.jsx
  31. 0 0
      src/app/quantService/quantConfig/QuantConfig.jsx
  32. 0 0
      src/app/quantService/quantResult/QuantResult.jsx
  33. 79 0
      src/app/wechatService/wxConfig/WxConfig.jsx
  34. 0 0
      src/app/wechatService/wxConfig/index.css
  35. 54 33
      src/app/wechatService/wxCreate/WxCreate.js
  36. 3 0
      src/app/wechatService/wxCreate/index.css
  37. 2 2
      src/app/wechatService/wxDeploy/WxDeploy.js
  38. 2 2
      src/app/wechatService/wxResult/WxResult.jsx
  39. 10 10
      src/app/wechatService/wxTrialCase/WXTrialCase.js
  40. 69 0
      src/app/wechatService/wxUserCreate/WXUserCreate.js
  41. 1 1
      src/case/ShopApp/src/api/axious_request.js
  42. 0 0
      src/case/ShopApp/src/components/UserPage/UserPage.jsx
  43. 0 43
      src/components/wechatService/Config.jsx
  44. 0 0
      src/cookie.js
  45. 3 0
      src/func.js
  46. 81 1
      src/gql.js
  47. 0 0
      src/graphql/schema.js
  48. 1 1
      src/index.js
  49. 0 0
      src/login/AccountConfig.js
  50. 1 4
      src/login/CloudConfig.js
  51. 0 0
      src/login/Login.js
  52. 1 5
      src/login/LoginInput.js
  53. 0 0
      src/login/index.css

+ 75 - 55
src/components/app/App.jsx → src/app/App.jsx

@@ -9,14 +9,17 @@ import 'moment/locale/zh-cn';
 import {FormattedMessage} from 'react-intl';
 import zhCN from 'antd/lib/locale-provider/zh_CN';
 
-import WechatService from "../wechatService/WechatService";
-import QuantService from "../quantService/QuantService";
-import TrialCase from "../trialCase/TrialCase";
-import UserCreate from "../userCreate/UserCreate";
+import QuantService from "./quantService/QuantService";
+import TrialCase from "./graphqlService/trialCase/TrialCase";
+import UserCreate from "./graphqlService/userCreate/UserCreate";
+import WXTrialCase from "./wechatService/wxTrialCase/WXTrialCase";
+import WXUserCreate from "./wechatService/wxUserCreate/WXUserCreate";
 import Login from "../login/Login";
-import '../common/graphql/index.css';
+import './graphqlService/common/graphql/index.css';
 import './index.css'
-import Create from "../common/schema/Create";
+import Create from "./graphqlService/common/schema/Create";
+import WxCreate from "./wechatService/wxCreate/WxCreate";
+
 
 import {SHOW_ALL_SCHEMA, SHOW_ALL_WXCONFIG} from "../gql";
 import axios from 'axios';
@@ -36,33 +39,30 @@ class App extends Component {
             sideBar: "ecommerce",
             collapsed: false,
             inlineCollapsed: false,
-            language:props.language,
+            language: props.language,
             locale: props.language === "中文" ? zhCN : undefined,
-            languageButton:props.language === "中文" ? "English" : "中文",
-            visible: false
+            languageButton: props.language === "中文" ? "English" : "中文",
+            visible: false,
+            wxVisible: false
         };
     }
 
-    componentWillMount(){
-        console.log('window.location',window.location);
+    componentWillMount() {
         let urlList = window.location.pathname.split("/");
         let urlListLength = urlList.length;
-        console.log('urlList',urlList,urlListLength);
         if (urlListLength > 2) {
-            this.setState({menuLevel1:urlList[1]});
-            if(urlList[3] !== 'index'){
-                this.setState({sideBar:urlList[3]});
+            this.setState({menuLevel1: urlList[1]});
+            if (urlList[3] !== 'index') {
+                this.setState({sideBar: urlList[3]});
             }
         }
     }
 
     onCollapse = (collapsed) => {
-        // console.log(collapsed);
         this.setState({collapsed});
     };
 
     switchMenu = (menuName, e) => {
-        // console.log('menuName', menuName, 'e', e);
         this.setState({
             [menuName]: e.key,
         });
@@ -72,14 +72,14 @@ class App extends Component {
         this.setState({
             [menuName]: e.key,
         });
-        if(e.key === "graphql-service"){
+        if (e.key === "graphql-service") {
             this.setState({sideBar: "ecommerce"});
         }
     };
 
     switchSidebar = (value) => {
         this.setState({
-            sideBar:value,
+            sideBar: value,
         });
     };
 
@@ -95,26 +95,38 @@ class App extends Component {
         });
     };
 
+    wxShowModal = () => {
+        this.setState({
+            wxVisible: true,
+        });
+    };
+
     hideModal = () => {
         this.setState({
             visible: false,
         });
     };
 
+    wxHideModal = () => {
+        this.setState({
+            wxVisible: false,
+        });
+    };
+
     changeLocale = (e) => {
         e.stopPropagation();
         let {language} = this.state;
         // console.log('app language',language);
         let changeLanguage = language === "中文" ? "English" : "中文";
         let local = language === "中文" ? undefined : zhCN;
-        let languageButton = language === "中文" ?  "中文" : "English";
+        let languageButton = language === "中文" ? "中文" : "English";
 
         sessionStorage.setItem("language", changeLanguage);
         this.props.changeLanguage(changeLanguage);
         this.setState({
             language: changeLanguage,
             locale: local,
-            languageButton:languageButton
+            languageButton: languageButton
         });
         if (!local) {
             moment.locale('en');
@@ -124,13 +136,14 @@ class App extends Component {
     };
 
     render() {
-        const {locale, languageButton, visible} = this.state;
+        const {locale, languageButton, visible, wxVisible} = this.state;
 
         return (
             <Router>
                 <Layout style={{minHeight: '100vh'}}>
                     <Header className="header" style={{position: 'fixed', zIndex: 1, width: '100%'}}>
-                        <Link to="/"   onClick={() => this.setState({menuLevel1:"graphql-service",sideBar:"ecommerce"})}>
+                        <Link to="/"
+                              onClick={() => this.setState({menuLevel1: "graphql-service", sideBar: "ecommerce"})}>
                             <div className="logo-wrapper">
                                 <div className='logo'/>
                             </div>
@@ -138,13 +151,13 @@ class App extends Component {
                         <Menu
                             theme="dark"
                             mode="horizontal"
-                            // defaultSelectedKeys={['graphql-service']}
                             selectedKeys={[this.state.menuLevel1]}
                             style={{lineHeight: '64px'}}
                             onClick={(e) => this.switchMenuTab('menuLevel1', e)}
                         >
                             <Menu.Item key="graphql-service">
-                                <Link to="/graphql-service/trial-case/index"><FormattedMessage id="Graphql Service"/></Link>
+                                <Link to="/graphql-service/trial-case/index"><FormattedMessage
+                                    id="Graphql Service"/></Link>
                             </Menu.Item>
                             <Menu.Item key="wechat-service">
                                 <Link to="/wechat-service/trial-case/index"><FormattedMessage
@@ -156,7 +169,8 @@ class App extends Component {
                         </Menu>
 
                         <Link to="/login">
-                            <Button className='login-button' type='primary' onClick={()=>this.switchMenuLevel('menuLevel1','user')} >Login</Button>
+                            <Button className='login-button' type='primary'
+                                    onClick={() => this.switchMenuLevel('menuLevel1', 'user')}>Login</Button>
                         </Link>
 
                         <div className="change-locale">
@@ -192,8 +206,8 @@ class App extends Component {
                                         onCollapse={this.onCollapse}
                                     >
                                         <WxConfigSiderbar inlineCollapsed={this.state.inlineCollapsed}
-                                                        sideBar={this.state.sideBar} switchMenu={this.switchMenu}
-                                                        showModal={this.showModal}/>
+                                                          sideBar={this.state.sideBar} switchMenu={this.switchMenu}
+                                                          wxShowModal={this.wxShowModal}/>
                                     </Sider>
                                 );
                             case 'quant-service':
@@ -223,15 +237,17 @@ class App extends Component {
                                                 position: 'fixed'
                                             }}
                                         >
-                                            <SubMenu key="trial-case" title={<span><Icon type="appstore" theme="twoTone"/><span>Case Show</span></span>}>
+                                            <SubMenu key="trial-case" title={<span><Icon type="appstore"
+                                                                                         theme="twoTone"/><span>Case Show</span></span>}>
                                                 <Menu.Item key="quant-service">
                                                     <Link to="/quant-service/trial-case/quant case">quant case</Link>
                                                 </Menu.Item>
                                             </SubMenu>
 
-                                            <Menu.Item key="instructions" >
-                                                <a href="https://ioobot-document.netlify.com/" title="instructions" target="instructions">
-                                                    <Icon type="file-text" theme="twoTone" />
+                                            <Menu.Item key="instructions">
+                                                <a href="https://ioobot-document.netlify.com/" title="instructions"
+                                                   target="instructions">
+                                                    <Icon type="file-text" theme="twoTone"/>
                                                     <span>Instructions</span>
                                                 </a>
                                             </Menu.Item>
@@ -262,13 +278,13 @@ class App extends Component {
                                             }}
                                         >
                                             <Menu.Item key="account">
-                                                <Icon type="setting" theme="twoTone" />
+                                                <Icon type="setting" theme="twoTone"/>
                                                 <span>Account center</span>
                                                 <Link to="/login/account"/>
                                             </Menu.Item>
 
                                             <Menu.Item key="cloud-settings">
-                                                <Icon type="cloud" theme="twoTone" />
+                                                <Icon type="cloud" theme="twoTone"/>
                                                 <span>Cloud settings</span>
                                                 <Link to="/login/cloud"/>
                                             </Menu.Item>
@@ -292,6 +308,7 @@ class App extends Component {
                         }
                     })()}
                     <Create visible={visible} hideModal={this.hideModal} switchSidebar={this.switchSidebar}/>
+                    <WxCreate visible={wxVisible} hideModal={this.wxHideModal} switchSidebar={this.switchSidebar}/>
 
                     <LocaleProvider locale={locale}>
                         <Layout style={{marginTop: '64px', zIndex: '0'}}
@@ -300,7 +317,8 @@ class App extends Component {
                                 <Route path="/" exact component={TrialCase}/>
                                 <Route path="/graphql-service/trial-case/:case" component={TrialCase}/>
                                 <Route path="/graphql-service/my-create/:case" component={UserCreate}/>
-                                <Route path="/wechat-service/:sidebar/:case" component={WechatService}/>
+                                <Route path="/wechat-service/trial-case/:case" component={WXTrialCase}/>
+                                <Route path="/wechat-service/my-create/:case" component={WXUserCreate}/>
                                 <Route path="/quant-service/:sidebar/:case" component={QuantService}/>
                                 <Route path="/login/:setting" component={Login}/>
                                 <Route path="/login" component={Login}/>
@@ -332,9 +350,9 @@ class GraphqlSidebar extends Component {
                         // console.log('user schema data',data);
                         if (loading) return <Spin style={{marginLeft: 3}}/>;
                         if (error) return 'error!';
-                        localStorage.setItem('ecommerce', data.caseSchema.find(obj=>obj.schemaName==='ecommerce').schemaData);
-                        localStorage.setItem('subscribe', data.caseSchema.find(obj=>obj.schemaName==='subscribe').schemaData);
-                        localStorage.setItem('bills', data.caseSchema.find(obj=>obj.schemaName==='bills').schemaData);
+                        localStorage.setItem('ecommerce', data.caseSchema.find(obj => obj.schemaName === 'ecommerce').schemaData);
+                        localStorage.setItem('subscribe', data.caseSchema.find(obj => obj.schemaName === 'subscribe').schemaData);
+                        localStorage.setItem('bills', data.caseSchema.find(obj => obj.schemaName === 'bills').schemaData);
                         return (
                             <Menu
                                 theme="dark"
@@ -360,9 +378,9 @@ class GraphqlSidebar extends Component {
                                             <Menu.Item key={schema.schemaName}>
                                                 <Link to={{
                                                     pathname: `/graphql-service/trial-case/${schema.schemaName}`,
-                                                    state:{
-                                                        schemaName:schema.schemaName,
-                                                        schemaID:schema.id
+                                                    state: {
+                                                        schemaName: schema.schemaName,
+                                                        schemaID: schema.id
                                                     }
                                                 }}>{schema.schemaName}</Link>
                                             </Menu.Item>)
@@ -386,9 +404,9 @@ class GraphqlSidebar extends Component {
                                             <Menu.Item key={schema.schemaName}>
                                                 <Link to={{
                                                     pathname: `/graphql-service/my-create/${schema.schemaName}`,
-                                                    state:{
-                                                        schemaName:schema.schemaName,
-                                                        schemaID:schema.id
+                                                    state: {
+                                                        schemaName: schema.schemaName,
+                                                        schemaID: schema.id
                                                     }
                                                 }}>{schema.schemaName}</Link>
                                             </Menu.Item>)
@@ -396,8 +414,9 @@ class GraphqlSidebar extends Component {
                                 </SubMenu>
 
                                 <Menu.Item key="instructions">
-                                    <a href="https://ioobot-document.netlify.com/" title="instructions" target="_blank" rel="noopener noreferrer">
-                                        <Icon type="file-text" theme="twoTone" />
+                                    <a href="https://ioobot-document.netlify.com/" title="instructions" target="_blank"
+                                       rel="noopener noreferrer">
+                                        <Icon type="file-text" theme="twoTone"/>
                                         <span>Instructions</span>
                                     </a>
                                 </Menu.Item>
@@ -452,16 +471,16 @@ class WxConfigSiderbar extends Component {
                                             <Menu.Item key={config.appName}>
                                                 <Link to={{
                                                     pathname: `/graphql-service/trial-case/${config.appName}`,
-                                                    state:{
-                                                        configName:config.appName,
-                                                        configID:config.id
+                                                    state: {
+                                                        configName: config.appName,
+                                                        configID: config.id
                                                     }
                                                 }}>{config.appName}</Link>
                                             </Menu.Item>)
                                     }
                                 </SubMenu>
 
-                                <Menu.Item key="create-config" onClick={this.props.showModal}>
+                                <Menu.Item key="create-config" onClick={this.props.wxShowModal}>
                                     <Icon type="edit" theme="twoTone"/>
                                     <span>Create</span>
                                     <Icon type="plus" style={{
@@ -478,9 +497,9 @@ class WxConfigSiderbar extends Component {
                                             <Menu.Item key={config.appName}>
                                                 <Link to={{
                                                     pathname: `/wechat-service/my-create/${config.appName}`,
-                                                    state:{
-                                                        configName:config.appName,
-                                                        configID:config.id
+                                                    state: {
+                                                        configName: config.appName,
+                                                        configID: config.id
                                                     }
                                                 }}>{config.appName}</Link>
                                             </Menu.Item>)
@@ -488,8 +507,9 @@ class WxConfigSiderbar extends Component {
                                 </SubMenu>
 
                                 <Menu.Item key="instructions">
-                                    <a href="https://ioobot-document.netlify.com/" title="instructions" target="_blank" rel="noopener noreferrer">
-                                        <Icon type="file-text" theme="twoTone" />
+                                    <a href="https://ioobot-document.netlify.com/" title="instructions" target="_blank"
+                                       rel="noopener noreferrer">
+                                        <Icon type="file-text" theme="twoTone"/>
                                         <span>Instructions</span>
                                     </a>
                                 </Menu.Item>

+ 3 - 3
src/components/common/application/Application.js → src/app/graphqlService/common/application/Application.js

@@ -1,7 +1,7 @@
 import React, {Component} from 'react';
-import ShopApp from '../../../case/ShopApp/src/App'
-import BillApp from '../../../case/BillApp/src/App'
-import OrderApp from '../../../case/OrderApp/src/App'
+import ShopApp from '../../../../case/ShopApp/src/App'
+import BillApp from '../../../../case/BillApp/src/App'
+import OrderApp from '../../../../case/OrderApp/src/App'
 class Application extends Component {
 
     render() {

+ 0 - 0
src/components/common/caseMetabase/CaseMetabase.jsx → src/app/graphqlService/common/caseMetabase/CaseMetabase.jsx


+ 1 - 1
src/components/common/deploy/Deploy.jsx → src/app/graphqlService/common/deploy/Deploy.jsx

@@ -6,7 +6,7 @@ import AliConfig from './ali/AliConfig';
 import AmazonConfig from './amazon/AmazonConfig';
 
 import './index.css';
-import {SHOW_FC, SEARCH_SCHEMA, SHOW_CLOUD} from "../../gql";
+import {SHOW_FC, SEARCH_SCHEMA, SHOW_CLOUD} from "../../../../gql";
 import {request} from 'graphql-request'
 
 const tabListNoTitle = [{

+ 0 - 0
src/components/common/deploy/ali/AliConfig.jsx → src/app/graphqlService/common/deploy/ali/AliConfig.jsx


+ 0 - 0
src/components/common/deploy/amazon/AmazonConfig.js → src/app/graphqlService/common/deploy/amazon/AmazonConfig.js


+ 0 - 0
src/components/common/deploy/huawei/HuaweiConfig.jsx → src/app/graphqlService/common/deploy/huawei/HuaweiConfig.jsx


+ 0 - 0
src/components/common/deploy/index.css → src/app/graphqlService/common/deploy/index.css


+ 3 - 4
src/components/common/deploy/tencent/APIGroupCard.js → src/app/graphqlService/common/deploy/tencent/APIGroupCard.js

@@ -1,13 +1,12 @@
 import React, {Component} from 'react';
 import {Input, Collapse, Button, Radio, Icon} from 'antd';
-import {ADD_APIGROUP, UPDATE_APIGROUP} from "../../../gql";
+import {ADD_APIGROUP, UPDATE_APIGROUP} from "../../../../../gql";
 import {request} from 'graphql-request'
+import {idGen} from "../../../../../func";
 
 const Panel = Collapse.Panel;
 
-const idGen = (kind) => {
-    return kind + '_' + Date.now() + '_' + Math.random().toString().slice(-8);
-};
+
 
 class APIGroupCard extends Component {
     constructor(props) {

+ 3 - 4
src/components/common/deploy/tencent/APIPathCard.js → src/app/graphqlService/common/deploy/tencent/APIPathCard.js

@@ -1,13 +1,12 @@
 import React, {Component} from 'react';
 import {Input, Radio, Collapse, Button, Icon} from 'antd';
 import {request} from 'graphql-request'
-import {ADD_APIGWPATH, UPDATE_APIGWPATH} from "../../../gql";
+import {ADD_APIGWPATH, UPDATE_APIGWPATH} from "../../../../../gql";
+import {idGen} from "../../../../../func";
 
 const Panel = Collapse.Panel;
 
-const idGen = (kind) => {
-    return kind + '_' + Date.now() + '_' + Math.random().toString().slice(-8);
-};
+
 
 class APIPathCard extends Component {
     constructor(props) {

+ 3 - 4
src/components/common/deploy/tencent/DeployCard.js → src/app/graphqlService/common/deploy/tencent/DeployCard.js

@@ -1,13 +1,12 @@
 import React, {Component} from 'react';
 import {Input, Radio, Collapse, Button, Icon} from 'antd';
-import {ADD_DEPLOY, UPDATE_DEPLOY} from "../../../gql";
+import {ADD_DEPLOY, UPDATE_DEPLOY} from "../../../../../gql";
 import {request} from 'graphql-request'
+import {idGen} from "../../../../../func";
 
 const Panel = Collapse.Panel;
 
-const idGen = (kind) => {
-    return kind + '_' + Date.now() + '_' + Math.random().toString().slice(-8);
-};
+
 
 class DeployCard extends Component {
     constructor(props) {

+ 0 - 0
src/components/common/deploy/tencent/NotificationCard.js → src/app/graphqlService/common/deploy/tencent/NotificationCard.js


+ 1 - 1
src/components/common/deploy/tencent/TencentConfig.js → src/app/graphqlService/common/deploy/tencent/TencentConfig.js

@@ -5,7 +5,7 @@ import APIPathCard from './APIPathCard';
 import DeployCard from './DeployCard';
 import NotificationCard from './NotificationCard';
 
-import {SHOW_DEPLOY, SHOW_APIGWGROUP, SHOW_APIGWPATH} from "../../../gql";
+import {SHOW_DEPLOY, SHOW_APIGWGROUP, SHOW_APIGWPATH} from "../../../../../gql";
 import {request} from 'graphql-request'
 
 class TencentConfig extends Component {

+ 0 - 0
src/components/common/generateJs/GenerateJs.jsx → src/app/graphqlService/common/generateJs/GenerateJs.jsx


+ 0 - 0
src/components/common/generateJs/index.css → src/app/graphqlService/common/generateJs/index.css


+ 0 - 0
src/components/common/graphql/Graphql.jsx → src/app/graphqlService/common/graphql/Graphql.jsx


+ 0 - 0
src/components/common/graphql/index.css → src/app/graphqlService/common/graphql/index.css


+ 3 - 6
src/components/wechatService/Create.js → src/app/graphqlService/common/schema/Create.js

@@ -5,13 +5,10 @@ import {Modal,Row, Col, Input, Icon, Button, Spin} from 'antd';
 import {Mutation, Query} from "react-apollo";
 import gql from "graphql-tag";
 
-import {SHOW_SCHEMA, ADD_SCHEMA} from '../gql'
+import {SHOW_SCHEMA, ADD_SCHEMA} from '../../../../gql'
 import './index.css';
-import {getCookie} from "../cookie";
-
-const idGen = (kind) => {
-    return kind + '_' + Date.now() + '_' + Math.random().toString().slice(-8);
-};
+import {getCookie} from "../../../../cookie";
+import {idGen} from "../../../../func";
 
 class Create extends Component {
     constructor(props) {

+ 3 - 5
src/components/common/schema/Schema.jsx → src/app/graphqlService/common/schema/Schema.jsx

@@ -12,17 +12,15 @@ import {
     UPDATE_SCHEMA_NAME,
     SEARCH_SCHEMA,
     ADD_SCHEMA
-} from '../../gql'
+} from '../../../../gql'
 import Table from "./Table";
 import {request} from 'graphql-request'
-import {getCookie} from "../../cookie";
+import {getCookie} from "../../../../cookie";
+import {idGen} from "../../../../func";
 
 const confirm = Modal.confirm;
 const Search = Input.Search;
 
-const idGen = (kind) => {
-    return kind + '_' + Date.now() + '_' + Math.random().toString().slice(-8);
-};
 
 class Schema extends Component {
     constructor(props) {

+ 2 - 2
src/components/common/schema/Table.js → src/app/graphqlService/common/schema/Table.js

@@ -1,11 +1,11 @@
 import React, {Component} from 'react';
 
 import {Layout, Select, Input, Icon, Button, notification, Spin, Modal} from 'antd';
-import {UPDATE_SCHEMA, SHOW_SCHEMA, SHOW_TABLE} from "../../gql";
+import {UPDATE_SCHEMA, SHOW_SCHEMA, SHOW_TABLE} from "../../../../gql";
 import gql from "graphql-tag";
 
 import {Mutation, Query} from "react-apollo";
-import {getCookie} from "../../cookie";
+import {getCookie} from "../../../../cookie";
 
 const Option = Select.Option;
 const {Content} = Layout;

+ 0 - 0
src/components/common/schema/index.css → src/app/graphqlService/common/schema/index.css


+ 0 - 0
src/components/dataAnalysis/DataAnalysis.jsx → src/app/graphqlService/dataAnalysis/DataAnalysis.jsx


+ 0 - 0
src/components/dataAnalysis/metabase/Metabase.jsx → src/app/graphqlService/dataAnalysis/metabase/Metabase.jsx


+ 0 - 0
src/components/dataStorage/DataStorage.jsx → src/app/graphqlService/dataStorage/DataStorage.jsx


+ 0 - 0
src/components/dataStorage/databaseSetting/DatabaseSetting.jsx → src/app/graphqlService/dataStorage/databaseSetting/DatabaseSetting.jsx


+ 0 - 0
src/components/dataStorage/schemaCreate/SchemaCreate.jsx → src/app/graphqlService/dataStorage/schemaCreate/SchemaCreate.jsx


+ 0 - 0
src/components/trialCase/TrialCase.jsx → src/app/graphqlService/trialCase/TrialCase.jsx


+ 0 - 0
src/components/userCreate/UserCreate.jsx → src/app/graphqlService/userCreate/UserCreate.jsx


+ 1 - 1
src/components/app/index.css → src/app/index.css

@@ -6,7 +6,7 @@
 }
 
 .logo {
-    background-image: url("../../images/logo.png");
+    background-image: url("../images/logo.png");
     background-repeat:no-repeat;
     background-size:100% 100%;
 }

+ 1 - 1
src/components/quantService/QuantService.jsx → src/app/quantService/QuantService.jsx

@@ -3,7 +3,7 @@ import React, {Component} from 'react';
 import {Layout, Menu} from 'antd';
 
 import QuantConfig from "./quantConfig/QuantConfig";
-import Deploy from "../common/deploy/Deploy";
+import Deploy from "../graphqlService/common/deploy/Deploy";
 import QuantResult from "./quantResult/QuantResult";
 
 const { Content } = Layout;

+ 0 - 0
src/components/quantService/quantConfig/QuantConfig.jsx → src/app/quantService/quantConfig/QuantConfig.jsx


+ 0 - 0
src/components/quantService/quantResult/QuantResult.jsx → src/app/quantService/quantResult/QuantResult.jsx


+ 79 - 0
src/app/wechatService/wxConfig/WxConfig.jsx

@@ -0,0 +1,79 @@
+import React, {Component} from 'react';
+import {Input, Spin, Button, Icon} from 'antd';
+import './index.css';
+import {idGen} from "../../../func";
+import {SHOW_WXCONTENT} from "../../../gql";
+import gql from "graphql-tag";
+import {Mutation, Query} from "react-apollo";
+
+class WxConfig extends Component {
+
+    constructor(props) {
+        super(props);
+        this.state = {
+            configs: ['AppName', 'AppID', 'AppSecret', 'URL', 'Token', 'welcome_words', 'pay_api_key', 'attach', 'mch_id', 'body', 'spbill_create_ip', 'notify_url'],
+            mch_id: '',
+            notify_url: '',
+            appSecret: '',
+            appID: '',
+            token: '',
+            spbill_create_ip: '',
+            enter_url: '',
+            pay_api_key: '',
+            body: '',
+            welcome_words: '',
+            attach: '',
+            configID: props.location.state === undefined ? props.configID : props.location.state.configID,
+            appName: props.location.state === undefined ? props.appName : props.location.state.appName,
+        }
+    }
+
+    switchConfig = (label) => {
+        return (e) => {
+            this.setState({
+                [label]: e.target.value
+            })
+        };
+    };
+
+    componentWillReceiveProps(next) {
+        this.setState({
+            configID: next.configID,
+            appName: next.appName,
+        });
+    }
+
+    render() {
+        return (
+            <Query query={gql(SHOW_WXCONTENT)} variables={{id: this.state.configID}}>
+                {
+                    ({loading, error, data}) => {
+                        if (loading) {
+                            return <Spin style={{marginLeft: 3}}/>
+                        }
+                        if (error) {
+                            return 'error!';
+                        }
+                        console.log(data);
+                        return (
+                            <div>
+                                {
+                                    this.state.configs.map(config => (
+                                        <div key={config} style={{marginBottom: 10}}>
+                                            <span className='vice-title'>{config}: </span>
+                                            <Input value={this.state[config]} style={{width: 200}} onChange={this.switchConfig(config)}/>
+                                        </div>
+                                    ))
+                                }
+                                <Button type={'primary'}>save</Button>
+                            </div>
+                        )
+                    }
+                }
+            </Query>
+
+        )
+    }
+}
+
+export default WxConfig;

+ 0 - 0
src/components/wechatService/index.css → src/app/wechatService/wxConfig/index.css


+ 54 - 33
src/components/common/schema/Create.js → src/app/wechatService/wxCreate/WxCreate.js

@@ -1,26 +1,34 @@
 import React, {Component} from 'react';
-import { withRouter } from "react-router-dom";
-import {Modal,Row, Col, Input, Icon, Button, Spin} from 'antd';
+import {withRouter} from "react-router-dom";
+import {Modal, Row, Col, Input, Icon, Button, Spin} from 'antd';
 
 import {Mutation, Query} from "react-apollo";
 import gql from "graphql-tag";
 
-import {SHOW_SCHEMA, ADD_SCHEMA} from '../../gql'
+import {ADD_WXCONFIG, SHOW_WXCONFIG} from '../../../gql'
 import './index.css';
-import {getCookie} from "../../cookie";
+import {getCookie} from "../../../cookie";
+import {idGen} from "../../../func";
 
-const idGen = (kind) => {
-    return kind + '_' + Date.now() + '_' + Math.random().toString().slice(-8);
-};
-
-class Create extends Component {
+class WxCreate extends Component {
     constructor(props) {
         super(props);
         this.state = {
-            schemaName: '',
-            schemaID: '',
+            appName: '',
+            configID: '',
             visible: false,
             confirmLoading: false,
+            mch_id: '',
+            notify_url: '',
+            appSecret: '',
+            appID: '',
+            token: '',
+            spbill_create_ip: '',
+            enter_url: '',
+            pay_api_key: '',
+            body: '',
+            welcome_words: '',
+            attach: ''
         };
     }
 
@@ -31,41 +39,52 @@ class Create extends Component {
     }
 
 
-    handleOk = (userID, create_schema) => {
+    handleOk = (userID, create_wxConfig) => {
+        let {mch_id, notify_url, appSecret, appID, token, spbill_create_ip, enter_url, pay_api_key, body, welcome_words, attach} = this.state;
         let varobj = {
-            id: idGen('schema'),
+            id: idGen('wxConfig'),
             user_id: userID,
             createdAt: new Date().getTime(),
             updatedAt: '',
-            schemaState: 'create',
-            schemaData: JSON.stringify([]),
-            reference: ''
+            mch_id,
+            notify_url,
+            appSecret,
+            appID,
+            token,
+            spbill_create_ip,
+            enter_url,
+            pay_api_key,
+            body,
+            welcome_words,
+            attach
         };
-        let schemaName = this.state.schemaName;
+        let appName = this.state.appName;
 
         this.setState({
             confirmLoading: true,
         });
 
-        create_schema({
+        create_wxConfig({
             variables: {
                 ...varobj,
-                schemaName
+                appName
             }
         });
+
         setTimeout(() => {
             this.setState({
                 visible: false,
                 confirmLoading: false,
             });
         }, 1000);
+
         this.props.hideModal();
-        this.props.switchSidebar(schemaName);
+        this.props.switchSidebar(appName);
         this.props.history.push({
-            pathname: `/graphql-service/my-create/${schemaName}`,
-            state:{
-                schemaName,
-                schemaID:varobj.id,
+            pathname: `/wechat-service/my-create/${appName}`,
+            state: {
+                appName,
+                configID: varobj.id,
                 create: true
             }
         });
@@ -78,32 +97,34 @@ class Create extends Component {
         return (
             <div>
                 <Mutation
-                    mutation={gql(ADD_SCHEMA)}
-                    refetchQueries={[{query: gql(SHOW_SCHEMA), variables: {user_id: userID}}]}
+                    mutation={gql(ADD_WXCONFIG)}
+                    refetchQueries={[{query: gql(SHOW_WXCONFIG), variables: {user_id: userID}}]}
                 >
 
-                    {(create_schema, {loading, error}) => {
+                    {(create_wxConfig, {loading, error}) => {
                         if (loading)
                             return <Spin style={{marginLeft: 30, marginTop: 10}}/>;
                         if (error)
                             return 'error';
                         return (
-                            <Modal title="Create Graphql Service"
+                            <Modal title="Create Wechat Service"
                                    centered
                                    visible={visible}
-                                   onOk={() => this.handleOk(userID, create_schema)}
+                                   onOk={() => this.handleOk(userID, create_wxConfig)}
                                    confirmLoading={confirmLoading}
-                                   onCancel={() => {this.props.hideModal();}}
+                                   onCancel={() => {
+                                       this.props.hideModal();
+                                   }}
                             >
                                 <div>
-                                    <p>schema name</p>
+                                    <p>app name</p>
                                     <Input
                                         className='add-input'
                                         placeholder="input schema_name"
                                         onChange={e => {
                                             e.persist();
                                             this.setState({
-                                                schemaName: e.target.value,
+                                                appName: e.target.value,
                                             });
                                         }}
                                     />
@@ -117,4 +138,4 @@ class Create extends Component {
     }
 }
 
-export default withRouter(Create);
+export default withRouter(WxCreate);

+ 3 - 0
src/app/wechatService/wxCreate/index.css

@@ -0,0 +1,3 @@
+.add-input {
+  margin-top: 10px;
+}

+ 2 - 2
src/components/wechatService/Deploy.js → src/app/wechatService/wxDeploy/WxDeploy.js

@@ -1,6 +1,6 @@
 import React, {Component} from 'react';
 
-class Deploy extends Component {
+class WxDeploy extends Component {
 
     render() {
         return (
@@ -11,4 +11,4 @@ class Deploy extends Component {
     }
 }
 
-export default Deploy;
+export default WxDeploy;

+ 2 - 2
src/components/wechatService/Result.jsx → src/app/wechatService/wxResult/WxResult.jsx

@@ -1,6 +1,6 @@
 import React, {Component} from 'react';
 
-class Result extends Component {
+class WxResult extends Component {
 
     render() {
         return (
@@ -11,4 +11,4 @@ class Result extends Component {
     }
 }
 
-export default Result;
+export default WxResult;

+ 10 - 10
src/components/wechatService/WechatService.jsx → src/app/wechatService/wxTrialCase/WXTrialCase.js

@@ -2,13 +2,14 @@ import React, {Component} from 'react';
 
 import {Layout, Menu} from 'antd';
 
-import Config from "./Config";
-import Deploy from "./Deploy";
-import Result from './Result';
+import WxConfig from "../wxConfig/WxConfig";
+import WxDeploy from "../wxDeploy/WxDeploy";
+import WxResult from '../wxResult/WxResult';
+import Schema from "../../graphqlService/common/schema/Schema";
 
 const {Content} = Layout;
 
-class WechatService extends Component {
+class WXTrialCase extends Component {
     constructor() {
         super();
         this.state = {
@@ -17,7 +18,6 @@ class WechatService extends Component {
     }
 
     switchMenu = (menuName, e) => {
-        // console.log('menuName', menuName, 'e', e);
         this.setState({
             [menuName]: e.key,
         });
@@ -50,13 +50,13 @@ class WechatService extends Component {
                         {(() => {
                             switch (this.state.menuLevel3) {
                                 case 'wechat-config':
-                                    return <Config/>;
+                                    return <WxConfig history={this.props.history} location={this.props.location}/>;
                                 case 'wechat-deploy':
-                                    return <Deploy/>;
+                                    return <WxDeploy/>;
                                 case 'wechat-result':
-                                    return <Result/>;
+                                    return <WxResult/>;
                                 default:
-                                    return <Config/>
+                                    return <WxConfig/>
                             }
                         })()}
                     </Content>
@@ -66,4 +66,4 @@ class WechatService extends Component {
     }
 }
 
-export default WechatService;
+export default WXTrialCase;

+ 69 - 0
src/app/wechatService/wxUserCreate/WXUserCreate.js

@@ -0,0 +1,69 @@
+import React, {Component} from 'react';
+
+import {Layout, Menu} from 'antd';
+
+import WxConfig from "../wxConfig/WxConfig";
+import WxDeploy from "../wxDeploy/WxDeploy";
+import WxResult from '../wxResult/WxResult';
+import Schema from "../../graphqlService/common/schema/Schema";
+
+const {Content} = Layout;
+
+class WXUserCreate extends Component {
+    constructor() {
+        super();
+        this.state = {
+            menuLevel3: "wechat-config",
+        }
+    }
+
+    switchMenu = (menuName, e) => {
+        this.setState({
+            [menuName]: e.key,
+        });
+    };
+
+    render() {
+        return (
+            <div>
+                <Menu
+                    mode="horizontal"
+                    defaultSelectedKeys={['wechat-config']}
+                    style={{
+                        padding: '0 24px',
+                        position: 'fixed',
+                        width: '100%',
+                        zIndex: '1',
+                        lineHeight: '50px',
+                        fontWeight: 600
+                    }}
+                    onClick={(e) => this.switchMenu('menuLevel3', e)}
+                    selectedKeys={[this.state.menuLevel3]}
+                >
+                    <Menu.Item key="wechat-config">config settings</Menu.Item>
+                    <Menu.Item key="wechat-deploy">deploy settings</Menu.Item>
+                    <Menu.Item key="wechat-result">result</Menu.Item>
+                </Menu>
+
+                <Layout style={{padding: '24px', zIndex: '0'}}>
+                    <Content style={{padding: '24px', minHeight: 280, background: '#fff', marginTop: '48px'}}>
+                        {(() => {
+                            switch (this.state.menuLevel3) {
+                                case 'wechat-config':
+                                    return <WxConfig history={this.props.history} location={this.props.location}/>;
+                                case 'wechat-deploy':
+                                    return <WxDeploy/>;
+                                case 'wechat-result':
+                                    return <WxResult/>;
+                                default:
+                                    return <WxConfig/>
+                            }
+                        })()}
+                    </Content>
+                </Layout>
+            </div>
+        )
+    }
+}
+
+export default WXUserCreate;

+ 1 - 1
src/case/ShopApp/src/api/axious_request.js

@@ -1,7 +1,7 @@
 const axios = require('axios');
 
 const axious=()=>{
-    console.log("axios",axios)
+    // console.log("axios",axios)
 }
 
 export default axious

+ 0 - 0
src/case/ShopApp/src/components/UserPage/userPage.jsx → src/case/ShopApp/src/components/UserPage/UserPage.jsx


+ 0 - 43
src/components/wechatService/Config.jsx

@@ -1,43 +0,0 @@
-import React, {Component} from 'react';
-import {Input, Radio, Collapse, Button, Icon} from 'antd';
-import './index.css';
-
-const idGen = (kind) => {
-    return kind + '_' + Date.now() + '_' + Math.random().toString().slice(-8);
-};
-
-class Config extends Component {
-
-    constructor(props) {
-        super(props);
-        this.state = {
-            configs: ['AppName', 'AppID', 'AppSecret', 'URL', 'Token', 'welcome_words', 'pay_api_key', 'attach', 'mch_id', 'body', 'spbill_create_ip', 'notify_url'],
-        }
-    }
-
-    switchConfig = (label) => {
-        return (e) => {
-            this.setState({
-                [label]: e.target.value
-            })
-        };
-    };
-
-    render() {
-        return (
-            <div>
-                {
-                    this.state.configs.map(config => (
-                        <div key={config} style={{marginBottom: 10}}>
-                            <span className='vice-title'>{config}: </span>
-                            <Input value={this.state[config]} style={{width: 200}} onChange={this.switchConfig(config)}/>
-                        </div>
-                    ))
-                }
-                <Button type={'primary'}>save</Button>
-            </div>
-        )
-    }
-}
-
-export default Config;

+ 0 - 0
src/components/cookie.js → src/cookie.js


+ 3 - 0
src/func.js

@@ -0,0 +1,3 @@
+export const idGen = (kind) => {
+    return kind + '_' + Date.now() + '_' + Math.random().toString().slice(-8);
+};

+ 81 - 1
src/components/gql.js → src/gql.js

@@ -410,6 +410,83 @@ const SHOW_ALL_WXCONFIG = `
             }
         `;
 
+const SHOW_WXCONFIG = `
+            query WXCONFIG($user_id: ID) {
+                wxConfig_by_props(user_id: $user_id) {
+                    appID
+                    appName
+                    appSecret
+                    attach
+                    body
+                    enter_url
+                    id
+                    mch_id
+                    notify_url
+                    pay_api_key
+                    spbill_create_ip
+                    token
+                    welcome_words
+                }
+            }
+        `;
+
+const ADD_WXCONFIG = `
+            mutation createwxConfig($updatedAt: String, $mch_id: String, $appName: String, $notify_url: String, $appSecret: String, $createdAt: String, $appID: String, $token: String, $spbill_create_ip: String, $enter_url: String, $id: ID!, $pay_api_key: String, $user_id: ID, $body: String, $welcome_words: String, $attach: String) {
+                create_wxConfig(
+                    updatedAt: $updatedAt 
+                    mch_id: $mch_id 
+                    appName: $appName 
+                    notify_url: $notify_url 
+                    appSecret: $appSecret 
+                    createdAt: $createdAt 
+                    appID: $appID 
+                    token: $token 
+                    spbill_create_ip: $spbill_create_ip 
+                    enter_url: $enter_url 
+                    id: $id 
+                    pay_api_key: $pay_api_key 
+                    user_id: $user_id 
+                    body: $body 
+                    welcome_words: $welcome_words 
+                    attach: $attach
+                ) {
+                    mch_id
+                    appName
+                    notify_url
+                    appSecret
+                    appID
+                    token
+                    spbill_create_ip
+                    enter_url
+                    id
+                    pay_api_key
+                    body
+                    welcome_words
+                    attach
+                }
+            }
+`;
+
+const SHOW_WXCONTENT = `
+            query wxConfigbyid($id: ID) {
+                wxConfig_by_id(id: $id) {
+                    mch_id
+                    appName
+                    notify_url
+                    appSecret
+                    appID
+                    token
+                    spbill_create_ip
+                    enter_url
+                    id
+                    pay_api_key
+                    body
+                    welcome_words
+                    attach
+                }
+            }
+        `;
+
 export {
     ADD_USER,
     GET_USER,
@@ -435,5 +512,8 @@ export {
     ADD_APIGWPATH,
     UPDATE_APIGWPATH,
     SHOW_FC,
-    SHOW_ALL_WXCONFIG
+    SHOW_ALL_WXCONFIG,
+    SHOW_WXCONFIG,
+    ADD_WXCONFIG,
+    SHOW_WXCONTENT
 }

+ 0 - 0
src/graphql/schema.js


+ 1 - 1
src/index.js

@@ -1,7 +1,7 @@
 import React, {Component} from 'react';
 import ReactDOM from 'react-dom';
 import './index.css';
-import App from './components/app/App'
+import App from './app/App'
 import * as serviceWorker from './serviceWorker';
 
 import ApolloClient from "apollo-boost";

+ 0 - 0
src/components/login/AccountConfig.js → src/login/AccountConfig.js


+ 1 - 4
src/components/login/CloudConfig.js → src/login/CloudConfig.js

@@ -4,10 +4,7 @@ import {Button, Input, Spin, Icon} from 'antd';
 import {SHOW_CLOUD, ADD_CLOUD, UPDATE_CLOUD} from "../gql";
 import {request} from 'graphql-request'
 import {getCookie} from '../cookie';
-
-const idGen = (kind) => {
-    return kind + '_' + Date.now() + '_' + Math.random().toString().slice(-8);
-};
+import {idGen} from "../func";
 
 class CloudConfig extends Component {
     constructor(props) {

+ 0 - 0
src/components/login/Login.js → src/login/Login.js


+ 1 - 5
src/components/login/LoginInput.js → src/login/LoginInput.js

@@ -8,16 +8,12 @@ import {request} from 'graphql-request'
 import gql from "graphql-tag";
 // todo: _.debounce 的引入
 import _ from 'lodash';
-
+import {idGen} from "../func";
 import {setCookie} from "../cookie";
 
 axios.defaults.withCredentials = true;
 
 
-const idGen = (kind) => {
-    return kind + '_' + Date.now() + '_' + Math.random().toString().slice(-8);
-};
-
 class LoginInput extends Component {
     constructor() {
         super();

+ 0 - 0
src/components/login/index.css → src/login/index.css