zhuth před 6 roky
rodič
revize
a31622305f
88 změnil soubory, kde provedl 164 přidání a 177 odebrání
  1. 0 3
      package.json
  2. 1 1
      src/components/admin/userGroupDetailBox.jsx
  3. 1 1
      src/components/admin/userGroupManagement.jsx
  4. 1 1
      src/components/admin/userManagement.jsx
  5. 1 1
      src/components/authority/index.jsx
  6. 1 1
      src/components/chart/chooseDataSourceBox.jsx
  7. 1 1
      src/components/chart/distributeBox.jsx
  8. 1 1
      src/components/chart/list.jsx
  9. 1 1
      src/components/chartDesigner/content.jsx
  10. 2 3
      src/components/chartDesigner/header.jsx
  11. 1 1
      src/components/chartDesigner/layout.jsx
  12. 1 1
      src/components/chartDesigner/sections/aggregateTableConfigForm.jsx
  13. 1 1
      src/components/chartDesigner/sections/barConfigForm.jsx
  14. 1 1
      src/components/chartDesigner/sections/baseConfigForm.jsx
  15. 1 1
      src/components/chartDesigner/sections/dataViewConfigForm.jsx
  16. 1 1
      src/components/chartDesigner/sections/indicatorConfigForm.jsx
  17. 1 1
      src/components/chartDesigner/sections/lineConfigForm.jsx
  18. 1 1
      src/components/chartDesigner/sections/otherConfigForm.jsx
  19. 1 1
      src/components/chartDesigner/sections/pieConfigForm.jsx
  20. 1 1
      src/components/chartDesigner/sections/scatterConfigForm.jsx
  21. 1 1
      src/components/chartDesigner/sections/style/aggregateTable.jsx
  22. 1 1
      src/components/chartDesigner/sections/style/bar.jsx
  23. 1 1
      src/components/chartDesigner/sections/style/line.jsx
  24. 1 1
      src/components/chartDesigner/sections/style/pie.jsx
  25. 1 1
      src/components/chartDesigner/sections/style/scatter.jsx
  26. 1 1
      src/components/chartDesigner/sections/style/table.jsx
  27. 1 1
      src/components/chartDesigner/sections/style/theme.jsx
  28. 1 1
      src/components/chartDesigner/sections/toolbar.jsx
  29. 1 1
      src/components/common/accessObjectBox/accessObjectBox.jsx
  30. 1 1
      src/components/common/dataPreview/dataPreview.jsx
  31. 1 1
      src/components/common/login/login.jsx
  32. 1 1
      src/components/common/login/register.jsx
  33. 1 1
      src/components/common/login/relogin.jsx
  34. 1 1
      src/components/common/navigator.jsx
  35. 1 1
      src/components/dashboard/copyBox.jsx
  36. 1 1
      src/components/dashboard/layout.jsx
  37. 1 1
      src/components/dashboard/list.jsx
  38. 1 1
      src/components/dashboard/menu.jsx
  39. 1 1
      src/components/dashboard/shareKeyView.jsx
  40. 1 1
      src/components/dashboard/shareView.jsx
  41. 1 1
      src/components/dashboard/view.jsx
  42. 1 1
      src/components/dashboardDesigner/chooseChartBox.jsx
  43. 1 1
      src/components/dashboardDesigner/configSider.jsx
  44. 1 1
      src/components/dashboardDesigner/content.jsx
  45. 1 1
      src/components/dashboardDesigner/cusFilterBox.jsx
  46. 1 1
      src/components/dashboardDesigner/header.jsx
  47. 1 1
      src/components/dashboardDesigner/layout.jsx
  48. 1 1
      src/components/dashboardDesigner/viewLayout.jsx
  49. 1 1
      src/components/dashboardDesigner/viewLayoutItem.jsx
  50. 1 1
      src/components/dataConnect/list.jsx
  51. 1 1
      src/components/dataSource/copyBox.jsx
  52. 1 1
      src/components/dataSource/list.jsx
  53. 1 1
      src/components/dataSourceDetail/accessConfig.jsx
  54. 1 1
      src/components/dataSourceDetail/baseConfig.jsx
  55. 1 1
      src/components/dataSourceDetail/columnConfig.jsx
  56. 1 1
      src/components/dataSourceDetail/content.jsx
  57. 1 1
      src/components/dataSourceDetail/contentCreate.jsx
  58. 1 1
      src/components/dataSourceDetail/dataConnectBox.jsx
  59. 1 1
      src/components/dataSourceDetail/dataConnectConfig.jsx
  60. 1 1
      src/components/dataSourceDetail/header.jsx
  61. 1 1
      src/components/dataSourceDetail/headerCreate.jsx
  62. 1 1
      src/components/dataSourceDetail/layout.jsx
  63. 1 1
      src/components/dataSourceDetail/otherConfig.jsx
  64. 1 1
      src/components/homePage/collection.jsx
  65. 1 1
      src/components/homePage/index.jsx
  66. 1 1
      src/components/homePage/sider.jsx
  67. 1 1
      src/components/homePage/toolbar.jsx
  68. 1 1
      src/components/homePage/view.jsx
  69. 1 1
      src/components/logs/logs.jsx
  70. 1 1
      src/components/setting/index.jsx
  71. 1 1
      src/components/user/userInfo.jsx
  72. 1 1
      src/components/workshop/index.jsx
  73. 1 10
      src/index.js
  74. 9 9
      src/models/chart.js
  75. 15 15
      src/models/chartDesigner.js
  76. 2 2
      src/models/chartPolicy.js
  77. 13 13
      src/models/dashboard.js
  78. 9 9
      src/models/dashboardDesigner.js
  79. 5 5
      src/models/dataConnect.js
  80. 11 11
      src/models/dataSource.js
  81. 1 1
      src/models/dataSourceDetail.js
  82. 4 4
      src/models/dataSourcePolicy.js
  83. 11 11
      src/models/home.js
  84. 1 1
      src/models/logs.js
  85. 1 1
      src/models/recent.js
  86. 2 2
      src/models/user.js
  87. 6 6
      src/models/userGroup.js
  88. 1 1
      src/routes/authLayout.jsx

+ 0 - 3
package.json

@@ -18,19 +18,16 @@
     "echarts": "^4.1.0",
     "echarts-for-react": "^2.0.14",
     "fetch-abort": "^1.0.2",
-    "jspdf": "^1.4.1",
     "jszip": "^3.2.2",
     "lodash": "^4.17.15",
     "moment": "^2.22.2",
     "prop-types": "^15.6.2",
-    "rc-color-picker": "^1.2.6",
     "react": "^16.2.0",
     "react-dom": "^16.2.0",
     "react-grid-layout": "^0.16.6",
     "react-router": "^4.3.1",
     "react-router-dom": "^4.3.1",
     "redux": "^4.0.0",
-    "redux-undo": "^0.6.1",
     "wangeditor": "^3.1.1"
   },
   "devDependencies": {

+ 1 - 1
src/components/admin/userGroupDetailBox.jsx

@@ -123,4 +123,4 @@ class DetailBox extends React.Component {
     }
 }
 
-export default connect(( { present: { userGroup } } ) => ({ userGroup }))(Form.create()(DetailBox))
+export default connect(( { userGroup } ) => ({ userGroup }))(Form.create()(DetailBox))

+ 1 - 1
src/components/admin/userGroupManagement.jsx

@@ -232,4 +232,4 @@ class UserGroupManagement extends React.Component {
     }
 }
 
-export default connect(( { present: { userGroup } } ) => ({ userGroup }))(UserGroupManagement);
+export default connect(( { userGroup } ) => ({ userGroup }))(UserGroupManagement);

+ 1 - 1
src/components/admin/userManagement.jsx

@@ -155,4 +155,4 @@ class UserManagement extends React.Component {
     }
 }
 
-export default connect(({ present: { user, main } }) => ({ user, main }))(UserManagement);
+export default connect(({ user, main }) => ({ user, main }))(UserManagement);

+ 1 - 1
src/components/authority/index.jsx

@@ -365,4 +365,4 @@ class DashBoardTree extends React.Component {
     }
 }
 
-export default connect(({ present: { authority, userGroup, user, dashboard } }) => ({ authority, userGroup, user, dashboard }))(Authority)
+export default connect(({ authority, userGroup, user, dashboard }) => ({ authority, userGroup, user, dashboard }))(Authority)

+ 1 - 1
src/components/chart/chooseDataSourceBox.jsx

@@ -237,7 +237,7 @@ class ChooseDataSourceBox extends React.Component {
     }
 }
 
-function mapStateToProps({ present: { dataSource, chart } }) {
+function mapStateToProps({ dataSource, chart }) {
     return { dataSource, chart };
 }
 

+ 1 - 1
src/components/chart/distributeBox.jsx

@@ -288,7 +288,7 @@ class DistributeBox extends React.Component {
     
 }
 
-function mapStateToProps({ present: { chartPolicy } }) {
+function mapStateToProps({ chartPolicy }) {
     return { chartPolicy };
 }
 

+ 1 - 1
src/components/chart/list.jsx

@@ -410,4 +410,4 @@ class ChartList extends React.Component {
     }
 }
 
-export default connect(({ present: { main, chart } }) => ({ main, chart }))(ChartList)
+export default connect(({ main, chart }) => ({ main, chart }))(ChartList)

+ 1 - 1
src/components/chartDesigner/content.jsx

@@ -177,4 +177,4 @@ class ChartDesignerContent extends React.Component {
     }
 }
 
-export default connect(({ present:{ main, chartDesigner } }) => ({ main, chartDesigner }))(ChartDesignerContent);
+export default connect(({ main, chartDesigner }) => ({ main, chartDesigner }))(ChartDesignerContent);

+ 2 - 3
src/components/chartDesigner/header.jsx

@@ -192,8 +192,7 @@ class Header extends React.Component {
 }
 
 function mapStateToProps(state) {
-    const { past, present, future } = state;
-    const { main, chartDesigner } = present;
-    return { main, chartDesigner, past, future }
+    const { main, chartDesigner } = state;
+    return { main, chartDesigner }
 }
 export default connect(mapStateToProps)(Header);

+ 1 - 1
src/components/chartDesigner/layout.jsx

@@ -38,7 +38,7 @@ function mapStateToProps(state) {
     ];
     let loading = false;
     for(let i = 0; i < effectsArr.length; i++) {
-        if(state.present.loading.effects[effectsArr[i]]) {
+        if(state.loading.effects[effectsArr[i]]) {
             loading = true;
             break;
         }

+ 1 - 1
src/components/chartDesigner/sections/aggregateTableConfigForm.jsx

@@ -122,7 +122,7 @@ class AggregateTableConfigForm extends React.Component {
 	}
 }
 
-function mapStateToProps({ present: { chartDesigner } }) {
+function mapStateToProps({ chartDesigner }) {
     return { chartDesigner: chartDesigner }
 }
 

+ 1 - 1
src/components/chartDesigner/sections/barConfigForm.jsx

@@ -135,7 +135,7 @@ const BarConfigForm = ({ autoRefresh, chartDesigner, dispatch }) => {
 	);
 }
 
-function mapStateToProps({ present: { chartDesigner } }) {
+function mapStateToProps({ chartDesigner }) {
     return { chartDesigner }
 }
 

+ 1 - 1
src/components/chartDesigner/sections/baseConfigForm.jsx

@@ -72,7 +72,7 @@ class baseConfigForm extends React.Component {
 	}
 }
 
-function mapStateToProps({ present: { dataSource, chartDesigner } }) {
+function mapStateToProps({ dataSource, chartDesigner }) {
     return { dataSource, chartDesigner }
 }
 

+ 1 - 1
src/components/chartDesigner/sections/dataViewConfigForm.jsx

@@ -80,7 +80,7 @@ class DataViewConfigForm extends React.Component {
 	}
 }
 
-function mapStateToProps({ present: { chartDesigner } }) {
+function mapStateToProps({ chartDesigner }) {
     return { chartDesigner: chartDesigner }
 }
 

+ 1 - 1
src/components/chartDesigner/sections/indicatorConfigForm.jsx

@@ -205,7 +205,7 @@ const IndicatorConfigForm = ({ autoRefresh, chartDesigner, dispatch }) => {
 	);
 }
 
-function mapStateToProps({ present: { chartDesigner } }) {
+function mapStateToProps({ chartDesigner }) {
     return { chartDesigner: chartDesigner }
 }
 

+ 1 - 1
src/components/chartDesigner/sections/lineConfigForm.jsx

@@ -87,7 +87,7 @@ const LineConfigForm = ({ autoRefresh, chartDesigner, dispatch }) => {
 	);
 }
 
-function mapStateToProps({ present: { chartDesigner } }) {
+function mapStateToProps({ chartDesigner }) {
     return { chartDesigner: chartDesigner }
 }
 

+ 1 - 1
src/components/chartDesigner/sections/otherConfigForm.jsx

@@ -128,7 +128,7 @@ class OtherConfigForm extends React.Component {
     }
 }
 
-function mapStateToProps({ present: {chart, chartDesigner}}) {
+function mapStateToProps({ chart, chartDesigner }) {
     return { chart, chartDesigner };
 }
 

+ 1 - 1
src/components/chartDesigner/sections/pieConfigForm.jsx

@@ -116,7 +116,7 @@ const PieConfigForm = ({ autoRefresh, chartDesigner, dispatch }) => {
 	);
 }
 
-function mapStateToProps({ present: { chartDesigner } }) {
+function mapStateToProps({ chartDesigner }) {
     return { chartDesigner: chartDesigner }
 }
 

+ 1 - 1
src/components/chartDesigner/sections/scatterConfigForm.jsx

@@ -187,7 +187,7 @@ const ScatterConfigForm = ({ autoRefresh, chartDesigner, dispatch }) => {
 	);
 }
 
-function mapStateToProps({ present: { chartDesigner } }) {
+function mapStateToProps({ chartDesigner }) {
     return { chartDesigner: chartDesigner }
 }
 

+ 1 - 1
src/components/chartDesigner/sections/style/aggregateTable.jsx

@@ -43,4 +43,4 @@ class AggregateTable extends React.Component {
     }
 }
 
-export default connect(({ present: { chartDesigner } }) => ({ chartDesigner }))(AggregateTable);
+export default connect(({ chartDesigner }) => ({ chartDesigner }))(AggregateTable);

+ 1 - 1
src/components/chartDesigner/sections/style/bar.jsx

@@ -576,4 +576,4 @@ class BarStyle extends React.Component {
     }
 }
 
-export default connect(({ present: { chartDesigner } }) => ({ chartDesigner }))(BarStyle);
+export default connect(({ chartDesigner }) => ({ chartDesigner }))(BarStyle);

+ 1 - 1
src/components/chartDesigner/sections/style/line.jsx

@@ -517,4 +517,4 @@ class LineStyle extends React.Component {
     }
 }
 
-export default connect(({ present: { chartDesigner } }) => ({ chartDesigner }))(LineStyle);
+export default connect(({ chartDesigner }) => ({ chartDesigner }))(LineStyle);

+ 1 - 1
src/components/chartDesigner/sections/style/pie.jsx

@@ -43,4 +43,4 @@ class PieStyleConfig extends React.Component {
     }
 }
 
-export default connect(({ present: { chartDesigner } }) => ({ chartDesigner }))(PieStyleConfig)
+export default connect(({ chartDesigner }) => ({ chartDesigner }))(PieStyleConfig)

+ 1 - 1
src/components/chartDesigner/sections/style/scatter.jsx

@@ -261,4 +261,4 @@ class ScatterStyle extends React.Component {
     }
 }
 
-export default connect(({ present: { chartDesigner } }) => ({ chartDesigner }))(ScatterStyle);
+export default connect(({ chartDesigner }) => ({ chartDesigner }))(ScatterStyle);

+ 1 - 1
src/components/chartDesigner/sections/style/table.jsx

@@ -176,4 +176,4 @@ class TableStyle extends React.Component {
     }
 }
 
-export default connect(({ present: { chartDesigner } }) => ({ chartDesigner }))(TableStyle);
+export default connect(({ chartDesigner }) => ({ chartDesigner }))(TableStyle);

+ 1 - 1
src/components/chartDesigner/sections/style/theme.jsx

@@ -39,4 +39,4 @@ class ThemeConfig extends React.Component {
     }
 }
 
-export default connect(({ present: { chartDesigner } }) => ({ chartDesigner }))(ThemeConfig)
+export default connect(({ chartDesigner }) => ({ chartDesigner }))(ThemeConfig)

+ 1 - 1
src/components/chartDesigner/sections/toolbar.jsx

@@ -159,7 +159,7 @@ class Toolbar extends React.Component {
         );
     }
 }
-function mapStateToProps({ present: { chartDesigner } }) {
+function mapStateToProps({ chartDesigner }) {
     return { chartDesigner: chartDesigner }
 }
 

+ 1 - 1
src/components/common/accessObjectBox/accessObjectBox.jsx

@@ -295,4 +295,4 @@ class TableList extends React.Component {
     }
 }
 
-export default connect(({ present: { userGroup, user } }) => ({ userGroup, user }))(AccessObjectBox);
+export default connect(({ userGroup, user }) => ({ userGroup, user }))(AccessObjectBox);

+ 1 - 1
src/components/common/dataPreview/dataPreview.jsx

@@ -114,4 +114,4 @@ class DataPreview extends React.Component {
     }
 }
 
-export default connect(({ present: { dataList } }) => ({ dataList }))(DataPreview);
+export default connect(({ dataList }) => ({ dataList }))(DataPreview);

+ 1 - 1
src/components/common/login/login.jsx

@@ -142,4 +142,4 @@ class LoginComponent extends React.Component {
     }
 }
 
-export default connect(({ present: { main } }) => ({ main }))(LoginComponent);
+export default connect(({ main }) => ({ main }))(LoginComponent);

+ 1 - 1
src/components/common/login/register.jsx

@@ -288,6 +288,6 @@ class Register extends Component {
     }
 }
 
-export default connect(({ present: { register } }) => ({
+export default connect(({ register }) => ({
     register,
 }))(Form.create()(Register))

+ 1 - 1
src/components/common/login/relogin.jsx

@@ -107,7 +107,7 @@ class Relogin extends React.Component {
     }
 }
 
-function mapStateToProps({ present: { main } }) {
+function mapStateToProps({ main }) {
     return { main };
 }
 

+ 1 - 1
src/components/common/navigator.jsx

@@ -79,7 +79,7 @@ class Navigator extends React.Component {
     }
 }
 
-function mapStateToProps({ present: { main } }) {
+function mapStateToProps({ main }) {
     return { main };
 }
 

+ 1 - 1
src/components/dashboard/copyBox.jsx

@@ -84,4 +84,4 @@ class CopyBox extends React.Component {
     }
 }
 
-export default connect(({ present: { dataConnect } }) => ({ dataConnect }))(CopyBox)
+export default connect(({ dataConnect }) => ({ dataConnect }))(CopyBox)

+ 1 - 1
src/components/dashboard/layout.jsx

@@ -106,7 +106,7 @@ class DashboardLayout extends React.Component {
         </Layout>
     }
 }
-function mapStateToProps({ present: { main, loading, dashboard }}) {
+function mapStateToProps({ main, loading, dashboard }) {
     let effectsArr = ['dashboard/remoteMenuTree', 'dashboard/remoteAddMenu', 'dashboard/remoteDeleteMenu'];
     let flag = false;
     for(let i = 0; i < effectsArr.length; i++) {

+ 1 - 1
src/components/dashboard/list.jsx

@@ -458,4 +458,4 @@ class DashboardList extends React.Component {
     }
 }
 
-export default connect(({ present: { main, dashboard } }) => ({ main, dashboard }))(DashboardList)
+export default connect(({ main, dashboard }) => ({ main, dashboard }))(DashboardList)

+ 1 - 1
src/components/dashboard/menu.jsx

@@ -362,7 +362,7 @@ class DashboardMenu extends React.Component {
     }
 }
 
-function mapStateToProps({ present: { dashboard }}) {
+function mapStateToProps({ dashboard }) {
     return { dashboard }
 }
 export default connect(mapStateToProps)(DashboardMenu)

+ 1 - 1
src/components/dashboard/shareKeyView.jsx

@@ -8,4 +8,4 @@ class DashboardView extends React.Component {
         return <DashboardDesigner dashboardDesigner={this.props.dashboardDesigner} code={code} isShareKeyView={true}/>
     }
 }
-export default connect(({ present: { dashboardDesigner } }) => ({ dashboardDesigner }))(DashboardView)
+export default connect(({ dashboardDesigner }) => ({ dashboardDesigner }))(DashboardView)

+ 1 - 1
src/components/dashboard/shareView.jsx

@@ -8,4 +8,4 @@ class DashboardView extends React.Component {
         return <DashboardDesigner dashboardDesigner={this.props.dashboardDesigner} code={code} isShareView={true}/>
     }
 }
-export default connect(({ present: { dashboardDesigner } }) => ({ dashboardDesigner }))(DashboardView)
+export default connect(({ dashboardDesigner }) => ({ dashboardDesigner }))(DashboardView)

+ 1 - 1
src/components/dashboard/view.jsx

@@ -8,4 +8,4 @@ class DashboardView extends React.Component {
         return <DashboardDesigner dashboardDesigner={this.props.dashboardDesigner} code={code}/>
     }
 }
-export default connect(({ present: { dashboardDesigner } }) => ({ dashboardDesigner }))(DashboardView)
+export default connect(({ dashboardDesigner }) => ({ dashboardDesigner }))(DashboardView)

+ 1 - 1
src/components/dashboardDesigner/chooseChartBox.jsx

@@ -287,7 +287,7 @@ class ChooseChartBox extends React.Component {
     } 
 }
 
-function mapStateToProps({ present: { dashboardDesigner, chart, loading: stateLoading } }) {
+function mapStateToProps({ dashboardDesigner, chart, loading: stateLoading }) {
     let loading = stateLoading.effects['chart/fetchList'];
     return { dashboardDesigner, chart, loading };
 }

+ 1 - 1
src/components/dashboardDesigner/configSider.jsx

@@ -232,4 +232,4 @@ class ConfigSider extends React.Component {
     }
 }
 
-export default connect(({ present: { dashboard, dashboardDesigner } }) => ({ dashboard, dashboardDesigner }))(ConfigSider);
+export default connect(({ dashboard, dashboardDesigner }) => ({ dashboard, dashboardDesigner }))(ConfigSider);

+ 1 - 1
src/components/dashboardDesigner/content.jsx

@@ -171,4 +171,4 @@ class DashboardDesignerContent extends React.Component {
     }
 }
 
-export default connect(({ present: { dashboardDesigner } }) => ({ dashboardDesigner }))(DashboardDesignerContent);
+export default connect(({ dashboardDesigner }) => ({ dashboardDesigner }))(DashboardDesignerContent);

+ 1 - 1
src/components/dashboardDesigner/cusFilterBox.jsx

@@ -273,4 +273,4 @@ class CusFilterBox extends React.Component {
     }
 }
 
-export default connect(({ present: { dashboardDesigner } }) => ({ dashboardDesigner }))(CusFilterBox);
+export default connect(({ dashboardDesigner }) => ({ dashboardDesigner }))(CusFilterBox);

+ 1 - 1
src/components/dashboardDesigner/header.jsx

@@ -175,4 +175,4 @@ class Header extends React.Component {
     }
 }
 
-export default connect(({ present: { main, dashboardDesigner } }) => ({ main, dashboardDesigner }))(Header);
+export default connect(({ main, dashboardDesigner }) => ({ main, dashboardDesigner }))(Header);

+ 1 - 1
src/components/dashboardDesigner/layout.jsx

@@ -69,7 +69,7 @@ class DashboardDesigner extends React.Component {
 }
 
 function mapStateToProps(state) {
-    const { main } = state.present;
+    const { main } = state;
     return { main }
 }
 

+ 1 - 1
src/components/dashboardDesigner/viewLayout.jsx

@@ -157,4 +157,4 @@ class ViewLayout extends React.Component {
     }
 }
 
-export default connect(({ present: { main, dashboardDesigner } }) => ({ main, dashboardDesigner }))(ViewLayout);
+export default connect(({ main, dashboardDesigner }) => ({ main, dashboardDesigner }))(ViewLayout);

+ 1 - 1
src/components/dashboardDesigner/viewLayoutItem.jsx

@@ -101,4 +101,4 @@ class ViewLayoutItem extends React.Component {
     }
 }
 
-export default connect(({ present: { main, dashboardDesigner } }) => ({ main, dashboardDesigner }))(ViewLayoutItem);
+export default connect(({ main, dashboardDesigner }) => ({ main, dashboardDesigner }))(ViewLayoutItem);

+ 1 - 1
src/components/dataConnect/list.jsx

@@ -295,7 +295,7 @@ class DataConnect extends React.Component {
     }
 }
 
-function mapStateToProps({present: {dataConnect}}) {
+function mapStateToProps({dataConnect}) {
     return { dataConnect }
 }
 

+ 1 - 1
src/components/dataSource/copyBox.jsx

@@ -68,4 +68,4 @@ class CopyBox extends React.Component {
     }
 }
 
-export default connect(({ present: { dataConnect } }) => ({ dataConnect }))(CopyBox)
+export default connect(({ dataConnect }) => ({ dataConnect }))(CopyBox)

+ 1 - 1
src/components/dataSource/list.jsx

@@ -489,7 +489,7 @@ class DataSource extends React.Component {
     }
 }
 
-function mapStateToProps({present: {main, dataSource, dataConnect}}) {
+function mapStateToProps({ main, dataSource, dataConnect }) {
     return { main, dataSource, dataConnect }
 }
 

+ 1 - 1
src/components/dataSourceDetail/accessConfig.jsx

@@ -317,7 +317,7 @@ class DataSourceAccessConfig extends React.Component{
     }
 }
         
-function mapStateToProps({ present: { user, dataSourcePolicy, dataSourceDetail } }) {
+function mapStateToProps({ user, dataSourcePolicy, dataSourceDetail }) {
     return { user, dataSourcePolicy, dataSourceDetail }
 }
 

+ 1 - 1
src/components/dataSourceDetail/baseConfig.jsx

@@ -309,4 +309,4 @@ class DataSourceBaseConfig extends React.Component {
     }
 }
 
-export default connect(({ present: { dataConnect, dataSource, dataSourceDetail } }) => ({ dataConnect, dataSource, dataSourceDetail }))(DataSourceBaseConfig);
+export default connect(({ dataConnect, dataSource, dataSourceDetail }) => ({ dataConnect, dataSource, dataSourceDetail }))(DataSourceBaseConfig);

+ 1 - 1
src/components/dataSourceDetail/columnConfig.jsx

@@ -479,7 +479,7 @@ class DataSourceColumnConfig extends React.Component {
     }
 }
 
-function mapStateToProps({ present: { dataSourceDetail, loading } }) {
+function mapStateToProps({ dataSourceDetail, loading }) {
     const fetching = loading.effects['dataSourceDetail/importColumns'];
     return {
         fetching,

+ 1 - 1
src/components/dataSourceDetail/content.jsx

@@ -60,4 +60,4 @@ class DataSourceDetailContent extends React.Component {
     }
 }
 
-export default connect(({ present: { dataSourceDetail, dataConnect } }) => ({ dataSourceDetail, dataConnect }))(DataSourceDetailContent);
+export default connect(({ dataSourceDetail, dataConnect }) => ({ dataSourceDetail, dataConnect }))(DataSourceDetailContent);

+ 1 - 1
src/components/dataSourceDetail/contentCreate.jsx

@@ -102,4 +102,4 @@ class DataSourceCreateContent extends React.Component {
     }
 }
 
-export default connect(({ present: { dataSourceDetail, dataConnect } }) => ({ dataSourceDetail, dataConnect }))(DataSourceCreateContent);
+export default connect(({ dataSourceDetail, dataConnect }) => ({ dataSourceDetail, dataConnect }))(DataSourceCreateContent);

+ 1 - 1
src/components/dataSourceDetail/dataConnectBox.jsx

@@ -369,7 +369,7 @@ class DataConnectBox extends React.Component {
 }
 
 function mapStateToProps(state) {
-    const dataConnect = state.present.dataConnect;
+    const dataConnect = state.dataConnect;
     return { dataConnect };
 }
 

+ 1 - 1
src/components/dataSourceDetail/dataConnectConfig.jsx

@@ -245,4 +245,4 @@ class DataConnectConfig extends React.Component {
     }
 }
 
-export default connect(({ present: { dataSourceDetail, dataConnect } }) => ({ dataSourceDetail, dataConnect }))(DataConnectConfig);
+export default connect(({ dataSourceDetail, dataConnect }) => ({ dataSourceDetail, dataConnect }))(DataConnectConfig);

+ 1 - 1
src/components/dataSourceDetail/header.jsx

@@ -110,4 +110,4 @@ class DataSourceDetailHeader extends React.Component {
     }
 }
 
-export default connect(({ present: { dataSourceDetail } }) => ({ dataSourceDetail }))(DataSourceDetailHeader);
+export default connect(({ dataSourceDetail }) => ({ dataSourceDetail }))(DataSourceDetailHeader);

+ 1 - 1
src/components/dataSourceDetail/headerCreate.jsx

@@ -59,4 +59,4 @@ class DataSourceCreateHeader extends React.Component {
     }
 }
 
-export default connect(({ present: { dataSourceDetail } }) => ({ dataSourceDetail }))(DataSourceCreateHeader);
+export default connect(({ dataSourceDetail }) => ({ dataSourceDetail }))(DataSourceCreateHeader);

+ 1 - 1
src/components/dataSourceDetail/layout.jsx

@@ -52,4 +52,4 @@ class DataSourceDetail extends React.Component {
 
 }
 
-export default connect(({ present: { dataSource, dataSourceDetail } }) => ({ dataSource, dataSourceDetail }))(DataSourceDetail)
+export default connect(({ dataSource, dataSourceDetail }) => ({ dataSource, dataSourceDetail }))(DataSourceDetail)

+ 1 - 1
src/components/dataSourceDetail/otherConfig.jsx

@@ -98,7 +98,7 @@ const OtherConfig = ({ dataSourceDetail, dataSource, dataConnect, dispatch, mode
     );
 }
 
-function mapStateToProps({ present: {dataSource, dataSourceDetail, dataConnect} }) {
+function mapStateToProps({ dataSource, dataSourceDetail, dataConnect }) {
     return { dataSource, dataSourceDetail, dataConnect }
 }
 

+ 1 - 1
src/components/homePage/collection.jsx

@@ -82,4 +82,4 @@ class Collection extends React.Component {
         </Collapse>
     }
 }
-export default connect(({ present: { home } }) => ({ home }))(Collection)
+export default connect(({ home }) => ({ home }))(Collection)

+ 1 - 1
src/components/homePage/index.jsx

@@ -132,4 +132,4 @@ class Home extends React.Component {
     }
 }
 
-export default connect(({ present: { home, dashboard } }) => ({ home, dashboard }))(Home)
+export default connect(({ home, dashboard }) => ({ home, dashboard }))(Home)

+ 1 - 1
src/components/homePage/sider.jsx

@@ -108,4 +108,4 @@ class MenuLayout extends React.Component {
     }
 }
 
-export default connect(({ present: { home, dashboard } }) => ({ home, dashboard }))(MenuLayout)
+export default connect(({ home, dashboard }) => ({ home, dashboard }))(MenuLayout)

+ 1 - 1
src/components/homePage/toolbar.jsx

@@ -103,4 +103,4 @@ class Toolbar extends React.Component {
     }
 }
 
-export default connect(({ present: { dashboardDesigner, home } }) => ({ dashboardDesigner, home }))(Toolbar)
+export default connect(({ dashboardDesigner, home }) => ({ dashboardDesigner, home }))(Toolbar)

+ 1 - 1
src/components/homePage/view.jsx

@@ -26,4 +26,4 @@ class DashboardView extends React.Component {
             config={this.props.config}/>
     }
 }
-export default connect(({ present: { dashboardDesigner } }) => ({ dashboardDesigner }))(DashboardView)
+export default connect(({ dashboardDesigner }) => ({ dashboardDesigner }))(DashboardView)

+ 1 - 1
src/components/logs/logs.jsx

@@ -222,4 +222,4 @@ class Logs extends React.Component {
     }
 }
 
-export default connect(({ present: { logs } }) => ({ logs }))(Logs)
+export default connect(({ logs }) => ({ logs }))(Logs)

+ 1 - 1
src/components/setting/index.jsx

@@ -49,4 +49,4 @@ class Setting extends React.Component {
     }
 }
 
-export default connect(({ present: { main } }) => ({ main }))(Setting)
+export default connect(({ main }) => ({ main }))(Setting)

+ 1 - 1
src/components/user/userInfo.jsx

@@ -68,4 +68,4 @@ const UserInfo = ({ main, dispatch }) => {
     )
 }
 
-export default connect(({ present: { main } }) => ({ main }))(UserInfo);
+export default connect(({ main }) => ({ main }))(UserInfo);

+ 1 - 1
src/components/workshop/index.jsx

@@ -54,4 +54,4 @@ class Workshop extends React.Component {
     }
 }
 
-export default connect(({ present: { main } }) => ({ main }))(Workshop)
+export default connect(({ main }) => ({ main }))(Workshop)

+ 1 - 10
src/index.js

@@ -1,5 +1,4 @@
 import dva from 'dva'
-import undoable, { includeAction } from 'redux-undo'
 import indexRouter from './routes/router'
 import mainModel from './models/main'
 import homeModel from './models/home'
@@ -23,15 +22,7 @@ import './utils/baseUtils'
 import './themes/default/index.less'
 
 // 1. Initialize
-const app = dva({
-    onReducer: reducer => (state, action) => {
-        const newState = undoable(reducer, {
-            limit: 10,
-            filter: includeAction(['chartDesigner/setField', 'chartDesigner/setFields']), // 只对图表编辑界面的部分action生效
-        })(state, action);
-        return { ...newState };
-    },
-});
+const app = dva();
 
 // 2. Plugins
 app.use(createLoading());

+ 9 - 9
src/models/chart.js

@@ -186,7 +186,7 @@ export default {
                 pageSize: pageSize || 999999999
             }
             try{
-                const chart = yield select(state => state.present.chart);
+                const chart = yield select(state => state.chart);
                 if(!action.mandatory && chart.list.length > 0) {
                     return chart.list;
                 }
@@ -313,7 +313,7 @@ export default {
         },
         *remoteModify(action, { select, call, put }) {
             try{
-                const chartDesigner = yield select(state => state.present.chartDesigner);
+                const chartDesigner = yield select(state => state.chartDesigner);
                 const { filters, code, header, baseConfig, otherConfig, description, group, chartOption,
                     fetchConfig, styleConfig, thumbnail, theme } = chartDesigner;
                 let body = {
@@ -363,7 +363,7 @@ export default {
             }
         },
         *remoteDelete(action, { select, call, put, takeEvery, takeLatest }) {
-            const chart = yield select(state => state.present.chart);
+            const chart = yield select(state => state.chart);
             const code = action.code;
             let list = chart.list;
             try {
@@ -390,7 +390,7 @@ export default {
         
         *remoteGroupList(action, { select, call, put }) {
             try {
-                const chart = yield select(state => state.present.chart);
+                const chart = yield select(state => state.chart);
                 if(!action.mandatory && chart.groupList.length > 0) {
                     return;
                 }
@@ -447,7 +447,7 @@ export default {
          */
         *remoteAddGroup(action, { select, call, put }) {
             try {
-                const chart = yield select((state) => state.present.chart);
+                const chart = yield select((state) => state.chart);
                 const group = chart.groupList;
                 const pgroups = group.filter(g => g.pcode === '-1');
                 const cgroups = group.filter(g => g.pcode !== '-1');
@@ -491,7 +491,7 @@ export default {
          */
         *remoteModifyGroup(action, { select, call, put }) {
             try {
-                const chart = yield select((state) => state.present.chart);
+                const chart = yield select((state) => state.chart);
                 const groupDirty = chart.groupDirty;
                 const group = action.group;
 
@@ -547,7 +547,7 @@ export default {
         },
         *remoteDeleteGroup(action, { select, call, put }) {
             try {
-                const chart = yield select((state) => state.present.chart);
+                const chart = yield select((state) => state.chart);
                 const groupList = chart.groupList;
                 const { group } = action;
 
@@ -576,7 +576,7 @@ export default {
         *remoteMoveGroup(action, { select, call, put }) {
             try {
                 const { dragCode, dropCode, dropPosition } = action;
-                const chart = yield select((state) => state.present.chart);
+                const chart = yield select((state) => state.chart);
                 let group = chart.groupList;
 
                 const dragGroup = group.filter(g => g.code === dragCode)[0];
@@ -737,7 +737,7 @@ export default {
                     body
                 });
                 if(res.code > 0) {
-                    const chart = yield select(state => state.present.chart);
+                    const chart = yield select(state => state.chart);
                     const list = chart.list;
                     for(let i = 0; i < list.length; i++) {
                         if(list[i].code === chartCode) {

+ 15 - 15
src/models/chartDesigner.js

@@ -164,14 +164,14 @@ export default {
         },
         *changeDataSource(action, { select, call, put }) {
             const { dataSource } = action;
-            const chartDesigner = yield select(state => state.present.chartDesigner);
+            const chartDesigner = yield select(state => state.chartDesigner);
             const { baseConfig } = chartDesigner;
             yield put({ type: 'changeField', name: 'baseConfig', value: { ...baseConfig, dataSource } });
             yield put({ type: 'remoteDataColumn', code: dataSource.code });
         },
         *initChangeDataSource(action, { select, call, put, take }) {
             const { dataSource } = action;
-            const chartDesigner = yield select(state => state.present.chartDesigner);
+            const chartDesigner = yield select(state => state.chartDesigner);
             const { baseConfig } = chartDesigner;
             yield put({ type: 'silentChangeField', name: 'baseConfig', value: { ...baseConfig, dataSource } });
             yield put({ type: 'remoteDataColumn', code: dataSource.code });
@@ -219,7 +219,7 @@ export default {
             try{
                 yield put({ type: 'chart/remoteModify' });
                 const { newHeaderLabel } = action;
-                const chartDesigner = yield select(state => state.present.chartDesigner);
+                const chartDesigner = yield select(state => state.chartDesigner);
                 const { filters, baseConfig, otherConfig, description, group, chartOption, fetchConfig, styleConfig, theme } = chartDesigner;
                 let body = {
                     filters: JSON.stringify(filters),
@@ -297,7 +297,7 @@ export default {
         },
         // 因为数据源列字段可能发生重命名,需要替换到最新的列
         *updateColumns(action, { select, call, put }) {
-            const chartDesigner = yield select(state => state.present.chartDesigner);
+            const chartDesigner = yield select(state => state.chartDesigner);
             const { columns, baseConfig } = chartDesigner;
             const { viewType } = baseConfig;
             try {
@@ -399,7 +399,7 @@ export default {
             }
         },
         *fetchChartData(action, { select, call, put }) {
-            const chartDesigner = yield select(state => state.present.chartDesigner);
+            const chartDesigner = yield select(state => state.chartDesigner);
             const { baseConfig } = chartDesigner;
             const { viewType } = baseConfig;
             const { page, pageSize, drillDown } = action;
@@ -477,8 +477,8 @@ export default {
         *fetchBarData(action, { select, call, put }) {
             try {
                 const { inDashBoard, item } = action;
-                let chartDesigner = yield select(state => state.present.chartDesigner);
-                let dashboardDesigner = yield select(state => state.present.dashboardDesigner);
+                let chartDesigner = yield select(state => state.chartDesigner);
+                let dashboardDesigner = yield select(state => state.dashboardDesigner);
                 let { code, barConfig, filters, theme, styleConfig, defaultBarThreshold } = chartDesigner;
                 if(inDashBoard){
                     code = item.code;
@@ -570,8 +570,8 @@ export default {
         *fetchPieData(action, { select, call, put }) {
             try {
                 const { inDashBoard, item, drillDown } = action;
-                let chartDesigner = yield select(state => state.present.chartDesigner);
-                let dashboardDesigner = yield select(state => state.present.dashboardDesigner);
+                let chartDesigner = yield select(state => state.chartDesigner);
+                let dashboardDesigner = yield select(state => state.dashboardDesigner);
                 let { code, pieConfig, filters, theme, styleConfig, defaultPieThreshold } = chartDesigner;
                 if(inDashBoard){
                     code = item.code;
@@ -660,10 +660,10 @@ export default {
         },
         *fetchLineData(action, { select, call, put }) {
             try {
-                const chartDesigner = yield select(state => state.present.chartDesigner);
+                const chartDesigner = yield select(state => state.chartDesigner);
                 let { code, lineConfig, filters, theme, styleConfig, defaultLineThreshold } = chartDesigner;
                 const { inDashBoard, item } = action;
-                let dashboardDesigner = yield select(state => state.present.dashboardDesigner);
+                let dashboardDesigner = yield select(state => state.dashboardDesigner);
                 if(inDashBoard){
                     code = item.code;
                     filters = item.filters || [];
@@ -750,7 +750,7 @@ export default {
         },
         *fetchScatterData(action, { select, call, put }) {
             try {
-                const chartDesigner = yield select(state => state.present.chartDesigner);
+                const chartDesigner = yield select(state => state.chartDesigner);
                 const { code, scatterConfig, filters, theme, styleConfig, defaultScatterThreshold } = chartDesigner;
                 const body = {
                     id: code,
@@ -797,7 +797,7 @@ export default {
         },
         *fetchDataViewData(action, { select, call, put }) {
             try {
-                const chartDesigner = yield select(state => state.present.chartDesigner);
+                const chartDesigner = yield select(state => state.chartDesigner);
                 const { code, dataViewConfig, filters, theme, styleConfig } = chartDesigner;
                 const { page, pageSize } = action;
                 const body = {
@@ -841,7 +841,7 @@ export default {
         },
         *fetchAggregateTableData(action, { select, call, put }) {
             try {
-                const chartDesigner = yield select(state => state.present.chartDesigner);
+                const chartDesigner = yield select(state => state.chartDesigner);
                 const { code, aggregateTableConfig, filters, theme, styleConfig } = chartDesigner;
                 const { targetColumn, statistics: statisticsNames } = aggregateTableConfig;
 
@@ -897,7 +897,7 @@ export default {
         },
         *fetchIndicatorData(action, { select, call, put }) {
             try {
-                const chartDesigner = yield select(state => state.present.chartDesigner);
+                const chartDesigner = yield select(state => state.chartDesigner);
                 const { code, indicatorConfig, filters, theme, styleConfig, defaultIndicatorThreshold } = chartDesigner;
                 const { xAxis, yAxis, otherColumn, sortColumn, sortType, threshold } = indicatorConfig;
                 const body = {

+ 2 - 2
src/models/chartPolicy.js

@@ -127,7 +127,7 @@ export default {
             }
         },
         *remoteAdd(action, { put, call, select }) {
-            const chartPolicy = yield select(state => state.present.chartPolicy);
+            const chartPolicy = yield select(state => state.chartPolicy);
             const { chartCode, policy } = action;
             const body = {
                 type: 'chart',
@@ -180,7 +180,7 @@ export default {
             }
         },
         *remoteDelete(action, { put, call, select }) {
-            const chartPolicy = yield select(state => state.present.chartPolicy);
+            const chartPolicy = yield select(state => state.chartPolicy);
             const { code } = action;
             const body = code;
             try {

+ 13 - 13
src/models/dashboard.js

@@ -74,7 +74,7 @@ export default {
                 pageSize: pageSize || 999999999
             }
             try {
-                const dashboard = yield select(state => state.present.dashboard);
+                const dashboard = yield select(state => state.dashboard);
                 if(!action.mandatory && dashboard.list.length > 0) {
                     return;
                 }
@@ -156,7 +156,7 @@ export default {
                     let items = resData.bdConfiguration ? JSON.parse(resData.bdConfiguration) : [];
                     let relationColumns = resData.relationColumns ? JSON.parse(resData.relationColumns) : [];
                     let chartCodes = resData.chartIds ? resData.chartIds.split(',') : [];
-                    const main = yield select(state => state.present.main);
+                    const main = yield select(state => state.main);
                     const { currentUser } = main;
 
                     const allDataSources = items.map(item => {
@@ -222,7 +222,7 @@ export default {
         *remoteQucikAdd(action, { select, call, put }) {
             const { menuCode } = action;
             try {
-                const dashboardDesigner = yield select(state => state.present.dashboardDesigner);
+                const dashboardDesigner = yield select(state => state.dashboardDesigner);
                 const { name, items, description, relationColumns, filters } = dashboardDesigner;
                 let body = {
                     bdName: name,
@@ -252,8 +252,8 @@ export default {
         *remoteModify(action, { select, call, put }) {
             const { hideMessage } = action
             try {
-                const dashboardDesigner = yield select(state => state.present.dashboardDesigner);
-                const dashboard = yield select(state => state.present.dashboard);
+                const dashboardDesigner = yield select(state => state.dashboardDesigner);
+                const dashboard = yield select(state => state.dashboard);
                 const { code, name, items, description, relationColumns, filters, chartCodes, shareCode, theme } = dashboardDesigner;
                 let body = {
                     id: code,
@@ -299,7 +299,7 @@ export default {
             }
         },
         *remoteDelete(action, { select, call, put }) {
-            const dashboard = yield select(state => state.present.dashboard);
+            const dashboard = yield select(state => state.dashboard);
             const code = action.code;
             let list = dashboard.list;
             try {
@@ -324,7 +324,7 @@ export default {
             }
         },
         *remoteMenuTree(action, { put, call, select }) {
-            const dashboard = yield select(state => state.present.dashboard);
+            const dashboard = yield select(state => state.dashboard);
             if(!action.mandatory && dashboard.menuTree.length > 0) {
                 return {menuList: dashboard.menuList, menuTree: dashboard.menuTree};
             }
@@ -423,7 +423,7 @@ export default {
         },
         *transferMenu(action, { put, call, select }) {
             const { dropKey, dragKey } = action;
-            const dashboard = yield select(state => state.present.dashboard);
+            const dashboard = yield select(state => state.dashboard);
             const { menuList } = dashboard;
             let menu = menuList.find(l => l.code === dragKey);
             menu.pcode = dropKey;
@@ -445,7 +445,7 @@ export default {
         *remoteSetMenu(action, { put, call, select }) {
             const { dashboard: currentDashboard, menu } = action;
             try {
-                const dashboard = yield select(state => state.present.dashboard);
+                const dashboard = yield select(state => state.dashboard);
                 const getParens = (menu) => {
                     const { menuList } = dashboard;
                     let pmenus = [menu];
@@ -585,7 +585,7 @@ export default {
                     body
                 });
                 if(res.code > 0) {
-                    const dashboard = yield select(state => state.present.dashboard);
+                    const dashboard = yield select(state => state.dashboard);
                     const list = dashboard.list;
                     for(let i = 0; i < list.length; i++) {
                         if(list[i].code === dashboardCode) {
@@ -622,7 +622,7 @@ export default {
                     let items = resData.bdConfiguration ? JSON.parse(resData.bdConfiguration) : [];
                     let relationColumns = resData.relationColumns ? JSON.parse(resData.relationColumns) : [];
                     let chartCodes = resData.chartIds ? resData.chartIds.split(',') : [];
-                    const main = yield select(state => state.present.main);
+                    const main = yield select(state => state.main);
                     const { currentUser } = main;
 
                     const allDataSources = items.map(item => {
@@ -724,7 +724,7 @@ export default {
                     let items = resData.bdConfiguration ? JSON.parse(resData.bdConfiguration) : [];
                     let relationColumns = resData.relationColumns ? JSON.parse(resData.relationColumns) : [];
                     let chartCodes = resData.chartIds ? resData.chartIds.split(',') : [];
-                    const main = yield select(state => state.present.main);
+                    const main = yield select(state => state.main);
                     const { currentUser } = main;
 
                     const allDataSources = items.map(item => {
@@ -794,7 +794,7 @@ export default {
             if(res.code > 0) {
                 message.success('复制成功');
                 // yield put({ type: 'fetchList', mandatory: true });
-                const dashboard = yield select(state => state.present.dashboard);
+                const dashboard = yield select(state => state.dashboard);
                 yield put({ type: 'remoteMenuDashboardList', menuCode: dashboard.currentMenu.code });
                 yield put({ type: 'dataSource/fetchList', mandatory: true });
                 yield put({ type: 'chart/fetchList', mandatory: true });

+ 9 - 9
src/models/dashboardDesigner.js

@@ -388,7 +388,7 @@ export default {
          * 刷新报表
          */
         *refresh(action, { call, put, select }) {
-            const dashboardDesigner = yield select(state => state.present.dashboardDesigner);
+            const dashboardDesigner = yield select(state => state.dashboardDesigner);
             const { items, minLayoutHeight } = dashboardDesigner;
 
             for(let i = 0; i < items.length; i++) {
@@ -402,7 +402,7 @@ export default {
         },
         *remoteGetColumns(action, { call, put, select }) {
             const { dataSourceCode, mandatory } = action;
-            const dashboardDesigner = yield select(state => state.present.dashboardDesigner);
+            const dashboardDesigner = yield select(state => state.dashboardDesigner);
             const { dataSources } = dashboardDesigner;
             const body = dataSourceCode;
             let idx = dataSources.findIndex(d => d.code === dataSourceCode);
@@ -447,7 +447,7 @@ export default {
         *changeFilters(action, { put, call, select }) {
             try {
                 const { filters } = action;
-                const dashboardDesigner = yield select(state => state.present.dashboardDesigner);
+                const dashboardDesigner = yield select(state => state.dashboardDesigner);
                 const { items, minLayoutHeight } = dashboardDesigner;
     
                 yield put({ type: 'silentSetField', name: 'filters', value: filters });
@@ -466,7 +466,7 @@ export default {
          */
         *changeFilter(action, { put, call, select }) {
             const { filter } = action;
-            const dashboardDesigner = yield select(state => state.present.dashboardDesigner);
+            const dashboardDesigner = yield select(state => state.dashboardDesigner);
             let { filters, items, minLayoutHeight } = dashboardDesigner;
             let targetDataSourceCodes = [];
 
@@ -497,7 +497,7 @@ export default {
         },
         *fetchChartData(action, { put, call, select }) {
             const { item, mandatory, page, pageSize } = action;
-            const dashboardDesigner = yield select(state => state.present.dashboardDesigner);
+            const dashboardDesigner = yield select(state => state.dashboardDesigner);
             const { creatorCode, filters, theme } = dashboardDesigner;
             const { chartCode, chartType } = item;
             if(!mandatory && !!item.chartOption) {
@@ -580,7 +580,7 @@ export default {
         *setRelationColumns(action, { put, call, select }) {
             const { relationColumns } = action;
             let targetDataSourceCodes = []; // 记录有改动的数据源code
-            const dashboardDesigner = yield select(state => state.present.dashboardDesigner);
+            const dashboardDesigner = yield select(state => state.dashboardDesigner);
             let { filters, items, minLayoutHeight } = dashboardDesigner;
             for(let i = filters.length - 1; i >= 0; i--) {
                 let f = filters[i];
@@ -636,7 +636,7 @@ export default {
         *modifyItem(action, { select, call, put }) {
             try{
                 const { item } = action;
-                const dashboardDesigner = yield select(state => state.present.dashboardDesigner);
+                const dashboardDesigner = yield select(state => state.dashboardDesigner);
                 const { items } = dashboardDesigner;
                 let idx = items.findIndex(i => i.code === item.code);
                 if(idx > -1) {
@@ -652,7 +652,7 @@ export default {
          */
         *fetchDataList(action, { select, call, put }) {
             const { item, page, pageSize } = action;
-            const dashboardDesigner = yield select(state => state.present.dashboardDesigner);
+            const dashboardDesigner = yield select(state => state.dashboardDesigner);
             const { creatorCode, filters } = dashboardDesigner;
             const { chartCode } = item;
             
@@ -703,7 +703,7 @@ export default {
             }
         },
         *exportToExcel(action, { select, take, put }) {
-            const dashboardDesigner = yield select(state => state.present.dashboardDesigner);
+            const dashboardDesigner = yield select(state => state.dashboardDesigner);
             const { name, filters, items } = dashboardDesigner;
             try {
                 yield put({ type: 'setField', name: 'loading', value: true });

+ 5 - 5
src/models/dataConnect.js

@@ -146,7 +146,7 @@ export default {
                 pageSize: pageSize || 999999999
             }
             try {
-                const dataConnect = yield select(state => state.present.dataConnect);
+                const dataConnect = yield select(state => state.dataConnect);
                 if(!action.mandatory && dataConnect.list.length > 0) {
                     return;
                 }
@@ -185,7 +185,7 @@ export default {
             }
         },
         *remoteValidate(action, { select, call, put, takeEvery, takeLatest }) {
-            const dataConnect = yield select(state => state.present.dataConnect);
+            const dataConnect = yield select(state => state.dataConnect);
             const model = dataConnect.newOne;
             try {
                 // 设置validating为true
@@ -235,7 +235,7 @@ export default {
         },
         *remoteAdd(action, { select, call, put, takeEvery, takeLatest }) {
             try {
-                const dataConnect = yield select(state => state.present.dataConnect);
+                const dataConnect = yield select(state => state.dataConnect);
                 const model = dataConnect.newOne;
 
                 // 设置validating为true
@@ -276,7 +276,7 @@ export default {
         },
         *remoteModify(action, { select, call, put }) {
             try{
-                const dataConnect = yield select(state => state.present.dataConnect);
+                const dataConnect = yield select(state => state.dataConnect);
                 const model = dataConnect.newOne;
 
                 // 设置validating为true
@@ -320,7 +320,7 @@ export default {
             }
         },
         *remoteDelete(action, { select, call, put, takeEvery, takeLatest }) {
-            const dataConnect = yield select(state => state.present.dataConnect);
+            const dataConnect = yield select(state => state.dataConnect);
             const code = action.code;
             let list = dataConnect.list;
             try {

+ 11 - 11
src/models/dataSource.js

@@ -165,7 +165,7 @@ export default {
                 pageSize: pageSize || 999999999
             }
             try {
-                const dataSource = yield select(state => state.present.dataSource);
+                const dataSource = yield select(state => state.dataSource);
                 if(!action.mandatory && dataSource.list.length > 0) {
                     return;
                 }
@@ -220,8 +220,8 @@ export default {
             
         },
         *remoteAdd(action, { select, call, put }) {
-            const dataSourceDetail = yield select(state => state.present.dataSourceDetail);
-            const currentUserName = yield select(state => state.present.main.currentUser.name)
+            const dataSourceDetail = yield select(state => state.dataSourceDetail);
+            const currentUserName = yield select(state => state.main.currentUser.name)
             const { name, description, target, tags, type, connectCode, columns, group } = dataSourceDetail;
             try {
                 const data = {
@@ -330,7 +330,7 @@ export default {
             }
         },
         *remoteDelete(action, { select, call, put }) {
-            const dataSource = yield select(state => state.present.dataSource);
+            const dataSource = yield select(state => state.dataSource);
             const code = action.code;
             let list = dataSource.list;
             try {
@@ -356,8 +356,8 @@ export default {
         },
         *remoteModify(action, { select, call, put }) {
             try{
-                const dataSourceDetail = yield select(state => state.present.dataSourceDetail);
-                const currentUserName = yield select(state => state.present.main.currentUser.name)
+                const dataSourceDetail = yield select(state => state.dataSourceDetail);
+                const currentUserName = yield select(state => state.main.currentUser.name)
                 const { code, name, description, target, type, group, connectCode, columns } = dataSourceDetail;
     
                 let data = {
@@ -403,7 +403,7 @@ export default {
 
         *remoteGroupList(action, { select, call, put }) {
             try {
-                const dataSource = yield select(state => state.present.dataSource);
+                const dataSource = yield select(state => state.dataSource);
                 if(!action.mandatory && dataSource.groupList.length > 0) {
                     return;
                 }
@@ -461,7 +461,7 @@ export default {
          */
         *remoteAddGroup(action, { select, call, put }) {
             try {
-                const dataSource = yield select((state) => state.present.dataSource);
+                const dataSource = yield select((state) => state.dataSource);
                 const group = dataSource.groupList;
                 const pgroups = group.filter(g => g.pcode === '-1');
                 const cgroups = group.filter(g => g.pcode !== '-1');
@@ -557,7 +557,7 @@ export default {
         },
         *remoteDeleteGroup(action, { select, call, put }) {
             try {
-                const dataSource = yield select((state) => state.present.dataSource);
+                const dataSource = yield select((state) => state.dataSource);
                 const groupList = dataSource.groupList;
                 const { group } = action;
 
@@ -586,7 +586,7 @@ export default {
         *remoteMoveGroup(action, { select, call, put }) {
             try {
                 const { dragCode, dropCode, dropPosition } = action;
-                const dataSource = yield select((state) => state.present.dataSource);
+                const dataSource = yield select((state) => state.dataSource);
                 let group = dataSource.groupList;
 
                 const dragGroup = group.filter(g => g.code === dragCode)[0];
@@ -748,7 +748,7 @@ export default {
                     body
                 });
                 if(res.code > 0) {
-                    const dataSource = yield select(state => state.present.dataSource);
+                    const dataSource = yield select(state => state.dataSource);
                     const list = dataSource.list;
                     for(let i = 0; i < list.length; i++) {
                         if(list[i].code === dataSourceCode) {

+ 1 - 1
src/models/dataSourceDetail.js

@@ -73,7 +73,7 @@ export default {
     },
     effects: {
         *importColumns(action, { select, call, put }) {
-            const dataSourceDetail = yield select(state => state.present.dataSourceDetail);
+            const dataSourceDetail = yield select(state => state.dataSourceDetail);
             const sqlStr = dataSourceDetail.target;
             const oldColumns = JSON.parse(JSON.stringify(dataSourceDetail.columns));
             const { cover } = action;

+ 4 - 4
src/models/dataSourcePolicy.js

@@ -117,8 +117,8 @@ export default {
             }
         },
         *remoteAdd(action, { put, call, select }) {
-            const dataSourcePolicy = yield select(state => state.present.dataSourcePolicy);
-            const dataSourceDetail = yield select(state => state.present.dataSourceDetail);
+            const dataSourcePolicy = yield select(state => state.dataSourcePolicy);
+            const dataSourceDetail = yield select(state => state.dataSourceDetail);
             const { policy } = action;
             const body = {
                 type: 'base',
@@ -147,7 +147,7 @@ export default {
             }
         },
         *remoteModify(action, { put, call, select }) {
-            const dataSourceDetail = yield select(state => state.present.dataSourceDetail);
+            const dataSourceDetail = yield select(state => state.dataSourceDetail);
             const { policy } = action;
             const body = {
                 id: policy.code,
@@ -172,7 +172,7 @@ export default {
             }
         },
         *remoteDelete(action, { put, call, select }) {
-            const dataSourcePolicy = yield select(state => state.present.dataSourcePolicy);
+            const dataSourcePolicy = yield select(state => state.dataSourcePolicy);
             const { code } = action;
             const body = code;
             try {

+ 11 - 11
src/models/home.js

@@ -69,7 +69,7 @@ export default {
     },
     effects: {
         *openTab(action, { select, call, put }) {
-            const home = yield select(state => state.present.home);
+            const home = yield select(state => state.home);
             const { tabs } = home;
             const { tab } = action;
             if(tabs.findIndex(t => t.code === tab.code) > -1) {
@@ -80,7 +80,7 @@ export default {
             }
         },
         *changeTab(action, { select, call, put }) {
-            const home = yield select(state => state.present.home);
+            const home = yield select(state => state.home);
             const { tabs, selectedTab } = home;
             const { tab } = action;
             let fields = [];
@@ -104,7 +104,7 @@ export default {
         *closeTab(action, { select, call, put }) {
             const { tab } = action;
             yield put({ type: 'removeTab', tab });
-            const home = yield select(state => state.present.home);
+            const home = yield select(state => state.home);
             const { tabs, selectedTab } = home;
             if(selectedTab.code === tab.code && tabs.length > 0) {
                 yield put({ type: 'changeTab', tab: tabs[tabs.length - 1] });
@@ -117,7 +117,7 @@ export default {
             yield put({ type: 'removeTabs', tabs });
         },
         *closeAllTabs(action, { select, call, put }) {
-            const { home } = yield select(state => ({ home: state.present.home }));
+            const { home } = yield select(state => ({ home: state.home }));
             const { tabs, fixedDashboard } = home;
             let rmTabs = [];
 
@@ -133,7 +133,7 @@ export default {
             }
         },
         *saveCurrentTabDashboardConfig(action, { select, call, put }) {
-            const { home, dashboardDesigner } = yield select(state => ({ home: state.present.home, dashboardDesigner: state.present.dashboardDesigner }));
+            const { home, dashboardDesigner } = yield select(state => ({ home: state.home, dashboardDesigner: state.dashboardDesigner }));
             const { tabs } = home;
             const { code } = action;
             let idx = tabs.findIndex(t => t.code === code);
@@ -145,7 +145,7 @@ export default {
         },
         *fetchCollectionDashboardList(action, { select, call, put }) {
             try {
-                const home = yield select(state => state.present.home);
+                const home = yield select(state => state.home);
                 const { collectionDashboards } = home;
                 const { mandatory } = action;
                 if(collectionDashboards.length > 0 && !mandatory) {
@@ -177,7 +177,7 @@ export default {
         },
         *collect(action, { select, put, call }) {
             try{
-                const home = yield select(state => state.present.home);
+                const home = yield select(state => state.home);
                 const { data } = action;
                 const { collectionDashboards } = home;
                 if(collectionDashboards.findIndex(d => d.code === data.code) > -1) {
@@ -198,7 +198,7 @@ export default {
         },
         *uncollect(action, { select, put, call }) {
             try{
-                const home = yield select(state => state.present.home);
+                const home = yield select(state => state.home);
                 const { data } = action;
                 const { collectionDashboards } = home;
                 let idx = collectionDashboards.findIndex(d => d.code === data.code);
@@ -219,7 +219,7 @@ export default {
             }
         },
         *getFixedDashboard(action, { select, put, call }) {
-            const main = yield select (state => state.present.main);
+            const main = yield select (state => state.main);
             const { currentUser } = main;
             try{
                 const res = yield call(service.fetch, {
@@ -246,7 +246,7 @@ export default {
             }
         },
         *onFixedDashboard(action, { select, put, call }) {
-            const main = yield select (state => state.present.main);
+            const main = yield select (state => state.main);
             const { currentUser } = main;
             const { tab } = action;
             try{
@@ -264,7 +264,7 @@ export default {
             }
         },
         *onCancelFixedDashboard(action, { select, put, call }) {
-            const main = yield select (state => state.present.main);
+            const main = yield select (state => state.main);
             const { currentUser } = main;
             const { tab } = action;
             try{

+ 1 - 1
src/models/logs.js

@@ -85,7 +85,7 @@ export default {
     effects: {
        *fetchList(action, { select, call, put }) {
             try{
-                const logs = yield select(state => state.present.logs);
+                const logs = yield select(state => state.logs);
                 const { filterItem, filterLabel } = logs;
                 const { page, pageSize, silent } = action;
                 const body = {

+ 1 - 1
src/models/recent.js

@@ -61,7 +61,7 @@ export default {
         },
         *fetchRecentDashboard(action, { select, call, put }) {
             try {
-                // const recent = yield select(state => state.present.recent);
+                // const recent = yield select(state => state.recent);
                 // if(!action.mandatory && recent.recentDashboard.length > 0) {
                 //     return;
                 // }

+ 2 - 2
src/models/user.js

@@ -37,7 +37,7 @@ export default {
     },
     effects: {
         *fetchList(action, { put, call, select }) {
-            const user = yield select(state => state.present.user);
+            const user = yield select(state => state.user);
             try {
                 if(!action.mandatory && user.list.length > 0) {
                     return;
@@ -61,7 +61,7 @@ export default {
             }
         },
         *remoteModify(action, { put, call, select }) {
-            const user = yield select(state => state.present.user);
+            const user = yield select(state => state.user);
             const { newOne } = user;
             const { fields } = action;
             const body = {

+ 6 - 6
src/models/userGroup.js

@@ -99,7 +99,7 @@ export default {
     },
     effects: {
         *fetchList(action, { put, call, select }) {
-            const userGroup = yield select(state => state.present.userGroup);
+            const userGroup = yield select(state => state.userGroup);
             const { mandatory, autoSelect } = action;
             try {
                 if(!mandatory && userGroup.list.length > 0) {
@@ -127,7 +127,7 @@ export default {
         },
         *remoteAdd(action, { put, call, select }) {
             try {
-                const userGroup = yield select(state => state.present.userGroup);
+                const userGroup = yield select(state => state.userGroup);
                 const { newOne } = userGroup;
                 let body = {
                     userGroupName: newOne.name,
@@ -155,7 +155,7 @@ export default {
             }
         },
         *remoteModify(action, { put, call, select }) {
-            const userGroup = yield select(state => state.present.userGroup);
+            const userGroup = yield select(state => state.userGroup);
             const { newOne } = userGroup;
             const body = {
                 id: newOne.code,
@@ -187,7 +187,7 @@ export default {
                 });
                 if(res.code > 0) {
                     yield put({ type: 'delete', group });
-                    const userGroup = yield select(state => state.present.userGroup);
+                    const userGroup = yield select(state => state.userGroup);
                     const { list } = userGroup;
                     yield put({ type: 'changeSelectedGroup', group: list[0] });
                     message.success('删除成功');
@@ -205,13 +205,13 @@ export default {
                 return
             }
             yield put({ type: 'remoteMemberList', groupCode: group.code });
-            const userGroup = yield select(state => state.present.userGroup);
+            const userGroup = yield select(state => state.userGroup);
             const { list } = userGroup;
             yield put({ type: 'setSelectedGroup', group: list.filter(l => l.code === group.code)[0] });
         },
         *remoteMemberList(action, { put, call, select }) {
             const { groupCode, mandatory } = action;
-            const userGroup = yield select(state => state.present.userGroup);
+            const userGroup = yield select(state => state.userGroup);
             const { list } = userGroup;
             const group = list.filter(l => l.code === groupCode)[0];
             if(!mandatory && group && group.member.length > 0) {

+ 1 - 1
src/routes/authLayout.jsx

@@ -55,7 +55,7 @@ class AuthLayout extends React.Component {
     }
 }
 
-function mapStateToProps({ present: { main } }) {
+function mapStateToProps({ main }) {
     return { main };
 }