Forráskód Böngészése

[Update] 更改项目名称及部分文件名称

zhanghe 6 éve
szülő
commit
4457b4f746
100 módosított fájl, 1586 hozzáadás és 1180 törlés
  1. 4 0
      .webpackrc
  2. 39 28
      src/common/menu.js
  3. 27 8
      src/common/router.js
  4. 0 0
      src/components/AXCityCascader/city.js
  5. 2 2
      src/components/RBCityCascader/index.js
  6. 0 0
      src/components/AXCityCascader/index.less
  7. 2 2
      src/components/RBDragSortTable/index.js
  8. 0 0
      src/components/AXDragSortTable/index.less
  9. 2 2
      src/components/RBIcon/index.js
  10. 11 10
      src/components/RBItem/PictureItem.js
  11. 0 0
      src/components/AXItem/PictureItem.less
  12. 0 0
      src/components/AXItem/index.js
  13. 13 16
      src/components/RBList/StandardCardList.js
  14. 0 0
      src/components/AXList/StandardCardList.less
  15. 8 12
      src/components/RBList/StandardTableList.js
  16. 0 0
      src/components/AXList/StandardTableList.less
  17. 0 0
      src/components/AXList/index.js
  18. 1 1
      src/components/RBRemoteSelect/index.js
  19. 2 2
      src/components/RBSelectTable/RBSingleSelectTable.js
  20. 0 0
      src/components/AXSelectTable/RBSingleSelectTable.less
  21. 5 0
      src/components/AXSelectTable/index.js
  22. 0 0
      src/components/AXTableSelector/MultipleSelectTable.js
  23. 0 0
      src/components/AXTableSelector/MultipleSelectTable.less
  24. 0 0
      src/components/AXTableSelector/Selector.js
  25. 0 0
      src/components/AXTableSelector/Selector.less
  26. 0 0
      src/components/AXTableSelector/SingleSelectTable.js
  27. 0 0
      src/components/AXTableSelector/SingleSelectTable.less
  28. 0 0
      src/components/AXTableSelector/columnsMap.js
  29. 0 0
      src/components/AXTableSelector/columnsMap.less
  30. 3 3
      src/components/RBUpload/index.js
  31. 0 0
      src/components/AXUpload/index.less
  32. 1 1
      src/components/RBVideoPlayer/index.js
  33. 0 0
      src/components/AXVideoPlayer/index.less
  34. 3 3
      src/components/GlobalHeader/index.js
  35. 1 1
      src/components/GlobalHeader/index.less
  36. 0 5
      src/components/RBSelectTable/index.js
  37. 1 0
      src/components/SiderMenu/index.less
  38. 1 1
      src/index.ejs
  39. 2 0
      src/index.less
  40. 3 3
      src/layouts/BasicLayout.js
  41. 5 5
      src/layouts/UserLayout.js
  42. 0 1
      src/models/cmsUser.js
  43. 16 2
      src/models/login.js
  44. 54 14
      src/models/product.js
  45. 37 6
      src/models/resource.js
  46. 22 12
      src/models/shelves.js
  47. 15 0
      src/models/trade.js
  48. 2 3
      src/models/user.js
  49. 1 1
      src/router.js
  50. 3 3
      src/routes/Campus/CampusCreate.js
  51. 3 3
      src/routes/Campus/CampusList.js
  52. 5 115
      src/routes/Dashboard/Analysis.js
  53. 0 170
      src/routes/Dashboard/Monitor.js
  54. 0 23
      src/routes/Dashboard/Monitor.less
  55. 5 0
      src/routes/Dashboard/SnapshopList.less
  56. 129 0
      src/routes/Dashboard/SnapshotList.js
  57. 0 275
      src/routes/Dashboard/Workplace.js
  58. 0 233
      src/routes/Dashboard/Workplace.less
  59. 0 0
      src/routes/Document/DocumentChannel.js
  60. 126 0
      src/routes/Document/DocumentPlatform.js
  61. 23 0
      src/routes/Document/document.less
  62. 3 3
      src/routes/Frontend/Recommend/RecommendEdit.js
  63. 1 1
      src/routes/Frontend/Recommend/RecommendList.js
  64. 3 3
      src/routes/Frontend/Tag/TagCreate.js
  65. 1 1
      src/routes/Frontend/Tag/TagList.js
  66. 3 3
      src/routes/Frontend/TagGroup/TagGroupCreate.js
  67. 1 1
      src/routes/Frontend/TagGroup/TagGroupList.js
  68. 4 8
      src/routes/Merchant/MerchantCreate.js
  69. 2 2
      src/routes/Merchant/MerchantList.js
  70. 31 27
      src/routes/Product/Course/CourseCreate.js
  71. 1 1
      src/routes/Product/Course/CourseList.js
  72. 25 25
      src/routes/Product/Courseware/CoursewareCreate.js
  73. 1 1
      src/routes/Product/Courseware/CoursewareList.js
  74. 3 3
      src/routes/Product/Lesson/LessonCreate.js
  75. 1 1
      src/routes/Product/Lesson/LessonList.js
  76. 1 1
      src/routes/Product/Package/PackageCreate.js
  77. 1 1
      src/routes/Product/Package/PackageList.js
  78. 3 3
      src/routes/Product/Support/SupportCreate.js
  79. 1 1
      src/routes/Product/Support/SupportList.js
  80. 412 0
      src/routes/Product/Training/TrainingCreate.js
  81. 33 0
      src/routes/Product/Training/TrainingCreate.less
  82. 165 0
      src/routes/Product/Training/TrainingList.js
  83. 33 0
      src/routes/Product/Training/index.js
  84. 3 14
      src/routes/Resource/Picture/PictureCardList.js
  85. 9 8
      src/routes/Resource/Picture/PictureEdit.js
  86. 14 12
      src/routes/Resource/Picture/PictureList.js
  87. 1 1
      src/routes/Resource/Picture/PictureMultipleUpload.js
  88. 10 10
      src/routes/Resource/Picture/PictureSingleUpload.js
  89. 7 8
      src/routes/Resource/Picture/PictureTableList.js
  90. 148 0
      src/routes/Resource/Video/VideoEdit.js
  91. 24 10
      src/routes/Resource/Video/VideoList.js
  92. 2 2
      src/routes/Resource/Video/VideoPlayList.js
  93. 13 7
      src/routes/Resource/Video/VideoTableList.js
  94. 3 3
      src/routes/Shelves/Course/CourseCreate.js
  95. 13 13
      src/routes/Shelves/Course/CourseEdit.js
  96. 1 1
      src/routes/Shelves/Course/CourseList.js
  97. 16 23
      src/routes/Shelves/Course/TableForm.js
  98. 3 3
      src/routes/Shelves/Package/PackageCreate.js
  99. 13 13
      src/routes/Shelves/Package/PackageEdit.js
  100. 0 0
      src/routes/Shelves/Package/PackageList.js

+ 4 - 0
.webpackrc

@@ -4,6 +4,10 @@
     "transform-decorators-legacy",
     ["import", { "libraryName": "antd", "libraryDirectory": "es", "style": true }]
   ],
+  "define": {
+    "process.env.ROLE": "PLATFORM",
+    "process.env.API": "DEV"
+  },
   "env": {
     "development": {
       "extraBabelPlugins": [

+ 39 - 28
src/common/menu.js

@@ -1,27 +1,23 @@
 import React from 'react';
 import { isUrl } from '../utils/utils';
-import { plantform } from '../utils/config';
-import RBIcon from '../components/RBIcon';
+import AXIcon from '../components/AXIcon';
 
 const menuData = () => {
-  if (plantform === 'LJ') {
+  if (process.env.ROLE === 'PLATFORM') {
     return [{
       name: '统计概览',
       icon: 'dashboard',
       path: 'dashboard',
       children: [{
-        name: '运行监控',
-        path: 'analysis',
-        icon: <RBIcon type="apprun" />,
-      }, {
-        name: '营销统计',
-        path: 'monitor',
-        icon: <RBIcon type="monitor" />,
-      }, {
-        name: '行为分析',
-        path: 'workplace',
-        icon: <RBIcon type="action" />,
+      //   name: '营销统计',
+      //   path: 'analysis',
+      //   icon: <AXIcon type="monitor" />,
+      // }, {
+        name: '销售详情',
+        path: 'sold',
+        icon: <AXIcon type="action" />,
       }],
+      authority: ['admin', 'platform'],
     }, {
       name: '基础资源',
       icon: 'folder',
@@ -35,6 +31,7 @@ const menuData = () => {
         path: 'video',
         icon: 'video-camera',
       }],
+      authority: ['admin', 'platform'],
     }, {
       name: '产品加工',
       icon: 'appstore-o',
@@ -52,9 +49,13 @@ const menuData = () => {
         name: '制作配套',
         path: 'support',
       }, {
+        name: '制作师训',
+        path: 'training',
+      }, {
         name: '制作套餐包',
         path: 'package',
       }],
+      authority: ['admin', 'platform'],
     }, {
       name: '产品出售',
       icon: 'shop',
@@ -66,9 +67,13 @@ const menuData = () => {
         name: '上架配套',
         path: 'support',
       }, {
+        name: '上架师训',
+        path: 'training',
+      }, {
         name: '上架套餐包',
         path: 'package',
       }],
+      authority: ['admin', 'platform'],
     }, {
       name: '前端配置',
       icon: 'android-o',
@@ -83,6 +88,7 @@ const menuData = () => {
         name: '推荐位配置',
         path: 'recommend',
       }],
+      authority: ['admin', 'platform'],
     }, {
       name: '交易管理',
       icon: 'trademark',
@@ -93,9 +99,10 @@ const menuData = () => {
         path: 'shopcart',
       }, {
         name: '订单列表',
-        icon: <RBIcon type="order" />,
+        icon: <AXIcon type="order" />,
         path: 'order',
       }],
+      authority: ['admin', 'platform'],
     }, {
       name: '厂商管理',
       icon: 'team',
@@ -104,18 +111,20 @@ const menuData = () => {
         name: '商户列表',
         path: 'list',
       }],
+      authority: ['admin', 'platform'],
     }, {
       name: '校区管理',
-      icon: <RBIcon type="campus" />,
+      icon: <AXIcon type="campus" />,
       path: 'campus',
       children: [{
         name: '校区列表',
         path: 'list',
       }],
+      authority: ['admin', 'platform', 'channel'],
     }, {
       name: '终端管理',
       path: 'terminal',
-      icon: <RBIcon type="terminal" />,
+      icon: <AXIcon type="terminal" />,
       children: [{
         name: '终端用户',
         path: 'user',
@@ -123,16 +132,18 @@ const menuData = () => {
         name: '白名单',
         path: 'whitelist',
       }],
+      authority: ['admin', 'platform', 'channel'],
     }, {
       name: '系统管理',
       path: 'system',
-      icon: <RBIcon type="systemuser" />,
+      icon: <AXIcon type="systemuser" />,
       children: [{
         name: '系统用户',
         path: 'cms-user',
       }],
+      authority: 'admin',
     }];
-  } else if (plantform === 'PJ') {
+  } else if (process.env.ROLE === 'CHANNEL') {
     return [{
       name: '统计概览',
       icon: 'dashboard',
@@ -140,15 +151,15 @@ const menuData = () => {
       children: [{
         name: '运行监控',
         path: 'analysis',
-        icon: <RBIcon type="apprun" />,
+        icon: <AXIcon type="apprun" />,
       }, {
         name: '营销统计',
         path: 'monitor',
-        icon: <RBIcon type="monitor" />,
+        icon: <AXIcon type="monitor" />,
       }, {
         name: '行为分析',
         path: 'workplace',
-        icon: <RBIcon type="action" />,
+        icon: <AXIcon type="action" />,
       }],
     }, {
       name: '产品库',
@@ -174,22 +185,22 @@ const menuData = () => {
         path: 'shopcart',
       }, {
         name: '订单列表',
-        icon: <RBIcon type="order" />,
+        icon: <AXIcon type="order" />,
       }],
     }, {
       name: '校区管理',
-      icon: <RBIcon type="campus" />,
+      icon: <AXIcon type="campus" />,
       path: 'campus',
     }, {
       name: '终端用户',
       path: 'terminal',
-      icon: <RBIcon type="terminal" />,
+      icon: <AXIcon type="terminal" />,
     }, {
       name: '账户信息',
       icon: 'team',
       path: 'merchant',
     }];
-  } else if (plantform === 'CP') {
+  } else if (process.env.ROLE === 'CP') {
     return [{
       name: '统计概览',
       icon: 'dashboard',
@@ -197,7 +208,7 @@ const menuData = () => {
       children: [{
         name: '营销统计',
         path: 'monitor',
-        icon: <RBIcon type="monitor" />,
+        icon: <AXIcon type="monitor" />,
       }],
     }, {
       name: '产品库',
@@ -219,7 +230,7 @@ const menuData = () => {
       path: 'trade',
       children: [{
         name: '订单列表',
-        icon: <RBIcon type="order" />,
+        icon: <AXIcon type="order" />,
       }],
     }, {
       name: '账户信息',

+ 27 - 8
src/common/router.js

@@ -212,6 +212,18 @@ export const getRouterData = (app) => {
     '/product/support/edit/:id': {
       component: dynamicWrapper(app, ['resource', 'product', 'merchant'], () => import('../routes/Product/Support/SupportCreate')),
     },
+    '/product/training': {
+      component: dynamicWrapper(app, ['product'], () => import('../routes/Product/Training')),
+    },
+    '/product/training/list': {
+      component: dynamicWrapper(app, ['product'], () => import('../routes/Product/Training/TrainingList')),
+    },
+    '/product/training/create': {
+      component: dynamicWrapper(app, ['resource', 'product', 'merchant'], () => import('../routes/Product/Training/TrainingCreate')),
+    },
+    '/product/training/edit/:id': {
+      component: dynamicWrapper(app, ['resource', 'product', 'merchant'], () => import('../routes/Product/Training/TrainingCreate')),
+    },
     '/product/package': {
       component: dynamicWrapper(app, ['product'], () => import('../routes/Product/Package')),
     },
@@ -249,6 +261,12 @@ export const getRouterData = (app) => {
     '/shelves/support/edit': {
       component: dynamicWrapper(app, ['shelves'], () => import('../routes/Shelves/Support/SupportEdit')),
     },
+    '/shelves/training': {
+      component: dynamicWrapper(app, ['shelves'], () => import('../routes/Shelves/Training')),
+    },
+    '/shelves/training/list': {
+      component: dynamicWrapper(app, ['shelves'], () => import('../routes/Shelves/Training/TrainingList')),
+    },
     '/shelves/package': {
       component: dynamicWrapper(app, ['shelves'], () => import('../routes/Shelves/Package')),
     },
@@ -321,14 +339,11 @@ export const getRouterData = (app) => {
       component: dynamicWrapper(app, ['trade'], () => import('../routes/Trade/Order/SubOrderDetail')),
     },
     // 统计概览相关路由注册
-    '/dashboard/analysis': {
-      component: dynamicWrapper(app, ['chart'], () => import('../routes/Dashboard/Analysis')),
-    },
-    '/dashboard/monitor': {
-      component: dynamicWrapper(app, ['monitor'], () => import('../routes/Dashboard/Monitor')),
-    },
-    '/dashboard/workplace': {
-      component: dynamicWrapper(app, ['project', 'activities', 'chart'], () => import('../routes/Dashboard/Workplace')),
+    // '/dashboard/analysis': {
+    //   component: dynamicWrapper(app, ['chart'], () => import('../routes/Dashboard/Analysis')),
+    // },
+    '/dashboard/sold': {
+      component: dynamicWrapper(app, ['trade'], () => import('../routes/Dashboard/SnapshotList')),
     },
     // 异常相关路由注册
     '/exception/403': {
@@ -347,6 +362,10 @@ export const getRouterData = (app) => {
     '/user/login': {
       component: dynamicWrapper(app, ['login'], () => import('../routes/User/Login')),
     },
+    // 帮助文档相关路由注册
+    '/document/platform': {
+      component: dynamicWrapper(app, [], () => import('../routes/Document/DocumentPlatform')),
+    },
   };
   // Get name from ./menu.js or just set it in the router data.
   const menuData = getFlatMenuData(getMenuData());

src/components/RBCityCascader/city.js → src/components/AXCityCascader/city.js


+ 2 - 2
src/components/RBCityCascader/index.js

@@ -4,7 +4,7 @@ import { Cascader } from 'antd';
 import { DICT_FIXED } from './city';
 import styles from './index.less';
 
-class RBCityCascader extends PureComponent {
+class AXCityCascader extends PureComponent {
   static propTypes = {
     placeholder: PropTypes.string,
   };
@@ -30,4 +30,4 @@ class RBCityCascader extends PureComponent {
   }
 }
 
-export default RBCityCascader;
+export default AXCityCascader;

src/components/RBCityCascader/index.less → src/components/AXCityCascader/index.less


+ 2 - 2
src/components/RBDragSortTable/index.js

@@ -5,7 +5,7 @@ import HTML5Backend from 'react-dnd-html5-backend';
 import update from 'immutability-helper';
 import styles from './index.less';
 
-class RBDragSortTable extends PureComponent {
+class AXDragSortTable extends PureComponent {
   handleMoveRow = (dragIndex, hoverIndex) => {
     const { data, onChange } = this.props;
     let newData = data;
@@ -206,4 +206,4 @@ class RBDragSortTable extends PureComponent {
   }
 }
 
-export default DragDropContext(HTML5Backend)(RBDragSortTable);
+export default DragDropContext(HTML5Backend)(AXDragSortTable);

src/components/RBDragSortTable/index.less → src/components/AXDragSortTable/index.less


+ 2 - 2
src/components/RBIcon/index.js

@@ -1,8 +1,8 @@
 import React from 'react';
 
-const RBIcon = (props) => {
+const AXIcon = (props) => {
   const { type } = props;
   return <i className={`realbull icon-${type}`} style={{ marginRight: 10 }} />;
 };
 
-export default RBIcon;
+export default AXIcon;

+ 11 - 10
src/components/RBItem/PictureItem.js

@@ -1,23 +1,24 @@
 import React, { Component } from 'react';
 import { Card, Checkbox, Icon, Button } from 'antd';
-import { ossHost } from '../../utils/config';
+import { genAbsolutePicUrl } from '../../utils/utils';
 import styles from './PictureItem.less';
 
 class PictureItem extends Component {
   handleItemChecked = (e) => {
-    const { id, onSelectChange } = this.props;
-    onSelectChange(id, e.target.checked);
+    const { item, onSelectChange } = this.props;
+    onSelectChange(item.id, e.target.checked);
   }
   handleItemDelete = () => {
-    const { id, onDelete } = this.props;
-    onDelete({ id });
+    const { item, onDelete } = this.props;
+    onDelete(item.id);
   }
   handleItemEdit = () => {
-    const { id, onEdit } = this.props;
-    onEdit({ id });
+    const { item, onEdit } = this.props;
+    onEdit(item);
   }
   render() {
-    const { picPath, picCode, selected } = this.props;
+    const { item, selected } = this.props;
+    const { path, code } = item;
     return (
       <Card
         bordered
@@ -25,7 +26,7 @@ class PictureItem extends Component {
         className={styles.card}
       >
         <div className={styles.picWrapper}>
-          <img src={`${ossHost}/${picPath}`} alt="cover" />
+          <img src={genAbsolutePicUrl(path)} alt="cover" />
         </div>
         <Checkbox
           checked={selected}
@@ -38,7 +39,7 @@ class PictureItem extends Component {
           onClick={this.handleItemDelete}
         />
         <div className={styles.metaData}>
-          {picCode}
+          {code}
         </div>
         <div className={styles.picActions}>
           <Button

src/components/RBItem/PictureItem.less → src/components/AXItem/PictureItem.less


src/components/RBItem/index.js → src/components/AXItem/index.js


+ 13 - 16
src/components/RBList/StandardCardList.js

@@ -1,7 +1,6 @@
 import React, { PureComponent, Fragment } from 'react';
 import { Alert, List, Select, Input, Checkbox, Button, Pagination } from 'antd';
 import PropTypes from 'prop-types';
-import Authorized from '../../utils/Authorized';
 import styles from './StandardCardList.less';
 
 function generator(props) {
@@ -23,7 +22,7 @@ class StandardCardList extends PureComponent {
     dataSource: [],
     header: false,
     footer: false,
-  }
+  };
   static propTypes = {
     loading: PropTypes.bool,
     dataSource: PropTypes.array,
@@ -36,7 +35,7 @@ class StandardCardList extends PureComponent {
       PropTypes.object,
       PropTypes.bool,
     ]),
-  }
+  };
   constructor(props) {
     super(props);
     const {
@@ -117,15 +116,13 @@ class StandardCardList extends PureComponent {
                 (this.state.isAdvancedLevel ? <a>普通搜索</a> : <a>高级搜索</a>)
               }
               <Button icon="sync" onClick={this.handleRefreshBtnClick}>刷新</Button>
-              <Authorized authority="root" noMatch={null}>
-                <Button
-                  icon="plus"
-                  type="primary"
-                  style={{ marginLeft: 5 }}
-                  onClick={onCreateClick}
-                >新建
-                </Button>
-              </Authorized>
+              <Button
+                icon="plus"
+                type="primary"
+                style={{ marginLeft: 5 }}
+                onClick={onCreateClick}
+              >新建
+              </Button>
             </div>
           </div>
           {advancedSearch &&
@@ -162,7 +159,6 @@ class StandardCardList extends PureComponent {
     return (
       <div className={styles.footer}>
         {batchActions && (
-        <Authorized authority="root" noMatch={null}>
           <div className={styles.batch}>
             <Checkbox
               checked={this.state.allChecked}
@@ -188,7 +184,7 @@ class StandardCardList extends PureComponent {
             >确定
             </Button>
           </div>
-        </Authorized>)}
+        )}
         {pagination && (
         <div className={styles.pagination}>
           <Pagination
@@ -332,7 +328,7 @@ class StandardCardList extends PureComponent {
   }
   render() {
     const { selectedKeys } = this.state;
-    const { component, dataSource, loading, header, footer, grid, onDelete } = this.props;
+    const { component, dataSource, loading, header, footer, grid, onEdit, onDelete } = this.props;
     const listFooter = footer ? this.getListFooter() : false;
     const listHeader = header ? this.getListHeader() : false;
     return (
@@ -348,10 +344,11 @@ class StandardCardList extends PureComponent {
         renderItem={item => (
           <List.Item>
             {generator({
+              onEdit,
               onDelete,
               selected: selectedKeys.indexOf(item.id) !== -1,
               onSelectChange: this.handleItemSelectChange,
-              ...item,
+              item,
             })(component)}
           </List.Item>
         )}

src/components/RBList/StandardCardList.less → src/components/AXList/StandardCardList.less


+ 8 - 12
src/components/RBList/StandardTableList.js

@@ -1,7 +1,6 @@
 import React, { PureComponent, Fragment } from 'react';
 import { Alert, Table, Select, Input, Button, Pagination } from 'antd';
 import PropTypes from 'prop-types';
-import Authorized from '../../utils/Authorized';
 import styles from './StandardTableList.less';
 
 function getSearchField(options) {
@@ -124,15 +123,13 @@ export default class StandardTableList extends PureComponent {
               <Button icon="sync" onClick={this.handleRefreshBtnClick}>刷新</Button>
               {/* noCreate 参数控制是否显示新建按钮 */}
               {onCreateClick !== undefined && (
-                <Authorized authority="root" noMatch={null}>
-                  <Button
-                    icon="plus"
-                    type="primary"
-                    style={{ marginLeft: 5 }}
-                    onClick={onCreateClick}
-                  >新建
-                  </Button>
-                </Authorized>
+                <Button
+                  icon="plus"
+                  type="primary"
+                  style={{ marginLeft: 5 }}
+                  onClick={onCreateClick}
+                >新建
+                </Button>
               )}
             </div>
           </div>
@@ -164,7 +161,6 @@ export default class StandardTableList extends PureComponent {
     return (
       <div className={styles.footer}>
         {batchActions && (
-        <Authorized authority="root" noMatch={null}>
           <div className={styles.batch}>
             <Select
               style={{ width: 100 }}
@@ -185,7 +181,7 @@ export default class StandardTableList extends PureComponent {
             >确定
             </Button>
           </div>
-        </Authorized>)}
+        )}
         {pagination && (
         <div className={styles.pagination}>
           <Pagination

src/components/RBList/StandardTableList.less → src/components/AXList/StandardTableList.less


src/components/RBList/index.js → src/components/AXList/index.js


+ 1 - 1
src/components/RBRemoteSelect/index.js

@@ -2,7 +2,7 @@ import React, { PureComponent } from 'react';
 import PropTypes from 'prop-types';
 import { Select, Spin } from 'antd';
 
-export default class RBRemoteSelect extends PureComponent {
+export default class AXRemoteSelect extends PureComponent {
   static defaultProps = {
     placeholder: '请输入检索内容并根据检索结果进行选择',
   };

+ 2 - 2
src/components/RBSelectTable/RBSingleSelectTable.js

@@ -1,7 +1,7 @@
 import React, { PureComponent } from 'react';
 import PropTypes from 'prop-types';
 import { Table, Input, Select, Pagination, Radio, Icon } from 'antd';
-import styles from './RBSingleSelectTable.less';
+import styles from './AXSingleSelectTable.less';
 
 function addRowKey(data) {
   return data.map((item) => {
@@ -19,7 +19,7 @@ const options = [{
   value: 'name',
 }];
 
-export default class RBSingleSelectTable extends PureComponent {
+export default class AXSingleSelectTable extends PureComponent {
   static propTypes = {
     dataSource: PropTypes.array,
     loading: PropTypes.bool,

src/components/RBSelectTable/RBSingleSelectTable.less → src/components/AXSelectTable/RBSingleSelectTable.less


+ 5 - 0
src/components/AXSelectTable/index.js

@@ -0,0 +1,5 @@
+import AXSingleSelectTable from './AXSingleSelectTable';
+
+export {
+  AXSingleSelectTable,
+};

src/components/RBTableSelector/MultipleSelectTable.js → src/components/AXTableSelector/MultipleSelectTable.js


src/components/RBTableSelector/MultipleSelectTable.less → src/components/AXTableSelector/MultipleSelectTable.less


src/components/RBTableSelector/Selector.js → src/components/AXTableSelector/Selector.js


src/components/RBTableSelector/Selector.less → src/components/AXTableSelector/Selector.less


src/components/RBTableSelector/SingleSelectTable.js → src/components/AXTableSelector/SingleSelectTable.js


src/components/RBTableSelector/SingleSelectTable.less → src/components/AXTableSelector/SingleSelectTable.less


src/components/RBTableSelector/columnsMap.js → src/components/AXTableSelector/columnsMap.js


src/components/RBTableSelector/columnsMap.less → src/components/AXTableSelector/columnsMap.less


+ 3 - 3
src/components/RBUpload/index.js

@@ -2,7 +2,7 @@
 import React, { Component } from 'react';
 import { Upload, Icon, message, Modal } from 'antd';
 import { queryOssSignature } from '../../services/resource';
-import { FILE_MAX_SIZE } from '../../utils/config';
+import { Hotax } from '../../utils/config';
 import { setSignature } from '../../utils/signature';
 import styles from './index.less';
 
@@ -24,8 +24,8 @@ const renderAccept = (accept) => {
 
 // 检查文件大小
 const checkFileSize = (fileName, fileSize) => {
-  if (fileSize > FILE_MAX_SIZE * 1000 * 1000) {
-    Message.error(`${fileName}文件大小超过${FILE_MAX_SIZE}M!`);
+  if (fileSize > Hotax.FILE_MAX_SIZE * 1000 * 1000) {
+    Message.error(`${fileName}文件大小超过${Hotax.FILE_MAX_SIZE}M!`);
     return false;
   }
   return true;

src/components/RBUpload/index.less → src/components/AXUpload/index.less


+ 1 - 1
src/components/RBVideoPlayer/index.js

@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
 import Hls from 'hls.js';
 import styles from './index.less';
 
-export default class RBVideoPlayer extends PureComponent {
+export default class AXVideoPlayer extends PureComponent {
   static propTypes = {
     url: PropTypes.string.isRequired,
     autoplay: PropTypes.bool,

src/components/RBVideoPlayer/index.less → src/components/AXVideoPlayer/index.less


+ 3 - 3
src/components/GlobalHeader/index.js

@@ -7,7 +7,7 @@ import { Link } from 'dva/router';
 import NoticeIcon from '../NoticeIcon';
 import AvatarIcon from '../AvatarIcon';
 import HeaderSearch from '../HeaderSearch';
-import { projectName } from '../../utils/config';
+import { Hotax } from '../../utils/config';
 import styles from './index.less';
 
 export default class GlobalHeader extends PureComponent {
@@ -63,7 +63,7 @@ export default class GlobalHeader extends PureComponent {
         <div className={styles.logo} key="logo">
           <Link to="/">
             <img src={logo} alt="logo" />
-            <h1>{projectName}</h1>
+            <h1>{Hotax.PROJECT_NAME}</h1>
           </Link>
         </div>
         <Icon
@@ -116,9 +116,9 @@ export default class GlobalHeader extends PureComponent {
           <Tooltip title="使用文档">
             <a
               target="_blank"
-              href="http://pro.ant.design/docs/getting-started"
               rel="noopener noreferrer"
               className={styles.action}
+              href="/document/platform"
             >
               <Icon type="question-circle-o" />
             </a >

+ 1 - 1
src/components/GlobalHeader/index.less

@@ -31,7 +31,7 @@
     border-right: 1px solid @hover-bg;
     font-size: 20px;
     margin: 0;
-    padding: 0 10px 0 10px;
+    padding: 0 21px 0 21px;
     font-family: 'Myriad Pro', 'Helvetica Neue', Arial, Helvetica, sans-serif;
     font-weight: 600;
     &:hover {

+ 0 - 5
src/components/RBSelectTable/index.js

@@ -1,5 +0,0 @@
-import RBSingleSelectTable from './RBSingleSelectTable';
-
-export {
-  RBSingleSelectTable,
-};

+ 1 - 0
src/components/SiderMenu/index.less

@@ -6,6 +6,7 @@
   box-shadow: 2px 0 6px rgba(0, 21, 41, .35);
   position: relative;
   z-index: 10;
+  overflow: auto;
   background: #333744;
   :global {
     .drawer .drawer-content {

+ 1 - 1
src/index.ejs

@@ -5,7 +5,7 @@
   <meta charset="UTF-8">
   <meta http-equiv="X-UA-Compatible" content="IE=edge">
   <meta name="viewport" content="width=device-width, initial-scale=1">
-  <title>RealBull</title>
+  <title>Hotax</title>
   <link rel="icon" href="/favicon.png" type="image/x-icon">
   <!-- 引入业务图标库 -->
   <link rel="stylesheet" href="//at.alicdn.com/t/font_583229_e33lmw33ougl23xr.css" type="text/css">

+ 2 - 0
src/index.less

@@ -36,6 +36,7 @@ body {
   .ant-card-head {
     padding-left: 16px !important;
   }
+  /*
   .ant-message {
     width: unset !important;
     top: 50px !important;
@@ -45,6 +46,7 @@ body {
   .ant-message-notice {
     text-align: right !important;
   }
+  */
   .ant-table-tbody > tr.ant-table-row-selected td {
     background: #ffffb8 !important;
   }

+ 3 - 3
src/layouts/BasicLayout.js

@@ -10,7 +10,7 @@ import { enquireScreen } from 'enquire-js';
 import GlobalHeader from '../components/GlobalHeader';
 import SiderMenu from '../components/SiderMenu';
 import NotFound from '../routes/Exception/404';
-import { projectName } from '../utils/config';
+import { Hotax } from '../utils/config';
 import { getRoutes } from '../utils/utils';
 import Authorized from '../utils/Authorized';
 import { getMenuData } from '../common/menu';
@@ -111,9 +111,9 @@ class BasicLayout extends React.PureComponent {
   getPageTitle() {
     const { routerData, location } = this.props;
     const { pathname } = location;
-    let title = projectName;
+    let title = Hotax.PROJECT_NAME;
     if (routerData[pathname] && routerData[pathname].name) {
-      title = `${routerData[pathname].name} - ${projectName}`;
+      title = `${routerData[pathname].name} - ${Hotax.PROJECT_NAME}`;
     }
     return title;
   }

+ 5 - 5
src/layouts/UserLayout.js

@@ -6,17 +6,17 @@ import styles from './UserLayout.less';
 import GlobalFooter from '../components/GlobalFooter';
 import logo from '../assets/logo.jpg';
 import { getRoutes } from '../utils/utils';
-import { copyright, projectName } from '../utils/config';
+import { Hotax } from '../utils/config';
 
-const copyrightNode = <Fragment>Copyright <Icon type="copyright" />{copyright}</Fragment>;
+const copyrightNode = <Fragment>Copyright <Icon type="copyright" />{Hotax.CopyRight}</Fragment>;
 
 class UserLayout extends React.PureComponent {
   getPageTitle() {
     const { routerData, location } = this.props;
     const { pathname } = location;
-    let title = projectName;
+    let title = Hotax.PROJECT_NAME;
     if (routerData[pathname] && routerData[pathname].name) {
-      title = `${routerData[pathname].name} - ${projectName}`;
+      title = `${routerData[pathname].name} - ${Hotax.PROJECT_NAME}`;
     }
     return title;
   }
@@ -30,7 +30,7 @@ class UserLayout extends React.PureComponent {
               <div className={styles.header}>
                 <Link to="/">
                   <img alt="logo" className={styles.logo} src={logo} />
-                  <span className={styles.title}>{projectName}</span>
+                  <span className={styles.title}>{Hotax.PROJECT_NAME}</span>
                 </Link>
               </div>
               <div className={styles.desc}>双师云课堂后台管理系统</div>

+ 0 - 1
src/models/cmsUser.js

@@ -22,7 +22,6 @@ export default {
     *fetchCmsUserList({ payload }, { call, put }) {
       const response = yield call(queryCmsUserList, payload);
       if (response.success) {
-        message.success('加载系统用户列表成功');
         yield put({
           type: 'querySuccess',
           payload: {

+ 16 - 2
src/models/login.js

@@ -20,7 +20,7 @@ export default {
       // Login successfully
       if (response.success) {
         reloadAuthorized();
-        yield put(routerRedux.push('/dashboard/analysis'));
+        yield put(routerRedux.push('/dashboard/sold'));
       }
     },
     *logout(_, { call, put }) {
@@ -35,8 +35,22 @@ export default {
   reducers: {
     changeLoginStatus(state, { payload }) {
       if (payload.data) {
+        // 将用户信息存储到localStorage
         setLocalUser(payload.data);
-        setAuthority(payload.data.id === '1' ? 'root' : 'general');
+        // 分析登录用户的角色
+        const { id, cp, merchant, platForm } = payload.data;
+        let userType = '';
+        if (platForm && id === '1') {
+          userType = 'admin';
+        } else if (platForm && id !== '1') {
+          userType = 'platform';
+        } else if (cp) {
+          userType = 'cp';
+        } else if (merchant) {
+          userType = 'channel';
+        }
+        // 设置用户权限
+        setAuthority(userType);
       }
       return {
         ...state,

+ 54 - 14
src/models/product.js

@@ -7,11 +7,7 @@ import {
   updateProductItem,
   deleteProductItem,
 } from '../services/product';
-import {
-  PRODUCT_COURSE,
-  PRODUCT_SUPPORT,
-  PRODUCT_PACKAGE,
-} from '../utils/config';
+import { Hotax } from '../utils/config';
 
 export default {
   namespace: 'product',
@@ -26,7 +22,7 @@ export default {
 
   effects: {
     *fetchCourseList({ payload }, { call, put }) {
-      const response = yield call(queryProductList, {type: PRODUCT_COURSE, ...payload});
+      const response = yield call(queryProductList, { type: Hotax.PRODUCT_COURSE, ...payload });
       if (response.success) {
         yield put({
           type: 'querySuccess',
@@ -40,7 +36,21 @@ export default {
       }
     },
     *fetchSupportList({ payload }, { call, put }) {
-      const response = yield call(queryProductList, {type: PRODUCT_SUPPORT, ...payload});
+      const response = yield call(queryProductList, { type: Hotax.PRODUCT_SUPPORT, ...payload });
+      if (response.success) {
+        yield put({
+          type: 'querySuccess',
+          payload: {
+            list: response.data.list || [],
+            pageSize: response.data.pageSize,
+            totalSize: response.data.totalSize,
+            pageNo: response.data.pageNo,
+          },
+        });
+      }
+    },
+    *fetchTrainingList({ payload }, { call, put }) {
+      const response = yield call(queryProductList, { type: Hotax.PRODUCT_TRAINING, ...payload });
       if (response.success) {
         yield put({
           type: 'querySuccess',
@@ -54,7 +64,7 @@ export default {
       }
     },
     *fetchPackageList({ payload }, { call, put }) {
-      const response = yield call(queryProductList, {type: PRODUCT_PACKAGE, ...payload});
+      const response = yield call(queryProductList, { type: Hotax.PRODUCT_PACKAGE, ...payload });
       if (response.success) {
         yield put({
           type: 'querySuccess',
@@ -98,6 +108,16 @@ export default {
         });
       }
     },
+    *deleteTrainingItem({ payload, states }, { call, put }) {
+      const response = yield call(deleteProductItem, payload);
+      if (response.success) {
+        message.success('删除师训成功');
+        yield put({
+          type: 'fetchTrainingList',
+          payload: states.Queryers,
+        });
+      }
+    },
     *deletePackageItem({ payload, states }, { call, put }) {
       const response = yield call(deleteProductItem, payload);
       if (response.success) {
@@ -109,7 +129,7 @@ export default {
       }
     },
     *createCourseItem({ payload, state }, { call, put }) {
-      const response = yield call(createProductItem, {type: PRODUCT_COURSE, ...payload});
+      const response = yield call(createProductItem, { type: Hotax.PRODUCT_COURSE, ...payload });
       if (response.success) {
         message.success('创建课程成功');
         yield put(routerRedux.push({
@@ -119,7 +139,7 @@ export default {
       }
     },
     *createSupportItem({ payload, state }, { call, put }) {
-      const response = yield call(createProductItem, {type: PRODUCT_SUPPORT, ...payload});
+      const response = yield call(createProductItem, { type: Hotax.PRODUCT_SUPPORT, ...payload });
       if (response.success) {
         message.success('创建配套成功');
         yield put(routerRedux.push({
@@ -128,8 +148,18 @@ export default {
         }));
       }
     },
+    *createTrainingItem({ payload, state }, { call, put }) {
+      const response = yield call(createProductItem, { type: Hotax.PRODUCT_TRAINING, ...payload });
+      if (response.success) {
+        message.success('创建师训成功');
+        yield put(routerRedux.push({
+          state,
+          pathname: '/product/training',
+        }));
+      }
+    },
     *createPackageItem({ payload, state }, { call, put }) {
-      const response = yield call(createProductItem, {type: PRODUCT_PACKAGE, ...payload});
+      const response = yield call(createProductItem, { type: Hotax.PRODUCT_PACKAGE, ...payload });
       if (response.success) {
         message.success('创建套餐包成功');
         yield put(routerRedux.push({
@@ -139,7 +169,7 @@ export default {
       }
     },
     *updateCourseItem({ payload, states }, { call, put }) {
-      const response = yield call(updateProductItem, {type: PRODUCT_COURSE, ...payload});
+      const response = yield call(updateProductItem, { type: Hotax.PRODUCT_COURSE, ...payload });
       if (response.success) {
         message.success('修改课程成功');
         yield put(routerRedux.push({
@@ -149,7 +179,7 @@ export default {
       }
     },
     *updateSupportItem({ payload, states }, { call, put }) {
-      const response = yield call(updateProductItem, {type: PRODUCT_SUPPORT, ...payload});
+      const response = yield call(updateProductItem, { type: Hotax.PRODUCT_SUPPORT, ...payload });
       if (response.success) {
         message.success('修改配套成功');
         yield put(routerRedux.push({
@@ -158,8 +188,18 @@ export default {
         }));
       }
     },
+    *updateTrainingItem({ payload, states }, { call, put }) {
+      const response = yield call(updateProductItem, { type: Hotax.PRODUCT_TRAINING, ...payload });
+      if (response.success) {
+        message.success('修改师训成功');
+        yield put(routerRedux.push({
+          pathname: '/product/training',
+          state: states,
+        }));
+      }
+    },
     *updatePackageItem({ payload, states }, { call, put }) {
-      const response = yield call(updateProductItem, {type: PRODUCT_PACKAGE, ...payload});
+      const response = yield call(updateProductItem, { type: Hotax.PRODUCT_PACKAGE, ...payload });
       if (response.success) {
         message.success('修改套餐包成功');
         yield put(routerRedux.push({

+ 37 - 6
src/models/resource.js

@@ -1,9 +1,9 @@
 import { routerRedux } from 'dva/router';
 import { message } from 'antd';
 import {
-  createImage,
-  deleteImage,
-  updateImage,
+  createResource,
+  deleteResource,
+  updateResource,
   queryImageResource,
   queryVideoResource,
 } from '../services/resource';
@@ -48,7 +48,7 @@ export default {
       }
     },
     *createImage({ payload }, { call, put }) {
-      const response = yield call(createImage, payload);
+      const response = yield call(createResource, payload);
       if (response && response.success) {
         yield put(
           routerRedux.push({
@@ -58,8 +58,19 @@ export default {
         );
       }
     },
+    *createVideo({ payload }, { call, put }) {
+      const response = yield call(createResource, payload);
+      if (response && response.success) {
+        yield put(
+          routerRedux.push({
+            pathname: '/resource/video',
+            state: response.data,
+          })
+        );
+      }
+    },
     *updateImage({ payload, states }, { call, put }) {
-      const response = yield call(updateImage, payload);
+      const response = yield call(updateResource, payload);
       if (response && response.success) {
         message.success('修改图片成功');
         yield put(routerRedux.push({
@@ -68,8 +79,18 @@ export default {
         }));
       }
     },
+    *updateVideo({ payload, states }, { call, put }) {
+      const response = yield call(updateResource, payload);
+      if (response && response.success) {
+        message.success('修改视频成功');
+        yield put(routerRedux.push({
+          pathname: '/resource/video',
+          state: states,
+        }));
+      }
+    },
     *deleteImage({ payload, states }, { call, put }) {
-      const response = yield call(deleteImage, payload);
+      const response = yield call(deleteResource, payload);
       if (response && response.success) {
         message.success('删除图片成功');
         yield put({
@@ -78,6 +99,16 @@ export default {
         });
       }
     },
+    *deleteVideo({ payload, states }, { call, put }) {
+      const response = yield call(deleteResource, payload);
+      if (response && response.success) {
+        message.success('删除视频成功');
+        yield put({
+          type: 'fetchVideoList',
+          payload: states,
+        });
+      }
+    },
   },
 
   reducers: {

+ 22 - 12
src/models/shelves.js

@@ -11,11 +11,7 @@ import {
   deleteItemPrice,
   updateItemTags,
 } from '../services/shelves';
-import {
-  PRODUCT_COURSE,
-  PRODUCT_SUPPORT,
-  PRODUCT_PACKAGE,
-} from '../utils/config';
+import { Hotax } from '../utils/config';
 
 export default {
   namespace: 'shelves',
@@ -44,7 +40,7 @@ export default {
       }
     },
     *fetchCourseItemList({ payload }, { call, put }) {
-      const response = yield call(queryItemList, { type: PRODUCT_COURSE, ...payload });
+      const response = yield call(queryItemList, { type: Hotax.PRODUCT_COURSE, ...payload });
       if (response.success) {
         yield put({
           type: 'querySuccess',
@@ -58,7 +54,21 @@ export default {
       }
     },
     *fetchSupportItemList({ payload }, { call, put }) {
-      const response = yield call(queryItemList, { type: PRODUCT_SUPPORT, ...payload });
+      const response = yield call(queryItemList, { type: Hotax.PRODUCT_SUPPORT, ...payload });
+      if (response.success) {
+        yield put({
+          type: 'querySuccess',
+          payload: {
+            list: response.data.list || [],
+            pageSize: response.data.pageSize,
+            totalSize: response.data.totalSize,
+            pageNo: response.data.pageNo,
+          },
+        });
+      }
+    },
+    *fetchTrainingItemList({ payload }, { call, put }) {
+      const response = yield call(queryItemList, { type: Hotax.PRODUCT_TRAINING, ...payload });
       if (response.success) {
         yield put({
           type: 'querySuccess',
@@ -72,7 +82,7 @@ export default {
       }
     },
     *fetchPackageItemList({ payload }, { call, put }) {
-      const response = yield call(queryItemList, { type: PRODUCT_PACKAGE, ...payload });
+      const response = yield call(queryItemList, { type: Hotax.PRODUCT_PACKAGE, ...payload });
       if (response.success) {
         yield put({
           type: 'querySuccess',
@@ -107,13 +117,13 @@ export default {
         }));
       }
     },
-    *deleteItem({ payload }, { call, put }) {
+    *deleteItem({ payload }, { call }) {
       const response = yield call(deleteItem, payload);
       if (response.success) {
         message.success('下架成功');
       }
     },
-    *recoverItem({ payload }, { call, put }) {
+    *recoverItem({ payload }, { call }) {
       const response = yield call(recoverItem, payload);
       if (response.success) {
         message.success('恢复上架成功');
@@ -181,8 +191,8 @@ export default {
         currentItem: {
           ...currentItem,
           ...action.payload,
-        }
+        },
       };
-    }
+    },
   },
 };

+ 15 - 0
src/models/trade.js

@@ -1,6 +1,7 @@
 import { message } from 'antd';
 import { routerRedux } from 'dva/router';
 import {
+  querySnapshotList,
   queryTerminalBuyMsg,
   queryOrderList,
   queryOrderItem,
@@ -24,6 +25,20 @@ export default {
   },
 
   effects: {
+    *fetchSnapshotList({ payload }, { call, put }) {
+      const response = yield call(querySnapshotList, payload);
+      if (response.success) {
+        yield put({
+          type: 'querySuccess',
+          payload: {
+            list: response.data.list || [],
+            pageSize: response.data.pageSize,
+            totalSize: response.data.totalSize,
+            pageNo: response.data.pageNo,
+          },
+        });
+      }
+    },
     *fetchTerminalBuyMsg({ payload }, { call, put }) {
       const response = yield call(queryTerminalBuyMsg, payload);
       if (response.success) {

+ 2 - 3
src/models/user.js

@@ -1,4 +1,4 @@
-import { query as queryUsers, queryCurrent } from '../services/user';
+import { query as queryUsers } from '../services/user';
 import { getLocalUser } from '../utils/authority';
 
 export default {
@@ -17,9 +17,8 @@ export default {
         payload: response,
       });
     },
-    *fetchCurrent(_, { call, put }) {
+    *fetchCurrent(_, { put }) {
       // TODO 这里从本地读取用户信息,后期改成请求
-      // const response = yield call(queryCurrent);
       const userInfo = getLocalUser();
       yield put({
         type: 'saveCurrentUser',

+ 1 - 1
src/router.js

@@ -28,7 +28,7 @@ function RouterConfig({ history, app }) {
           <AuthorizedRoute
             path="/"
             render={props => <BasicLayout {...props} />}
-            authority={['root', 'general']}
+            authority={['admin', 'platform']}
             redirectPath="/user/login"
           />
         </Switch>

+ 3 - 3
src/routes/Campus/CampusCreate.js

@@ -4,8 +4,8 @@ import pathToRegexp from 'path-to-regexp';
 import { message, Card, Modal, List, Form, Input, Button, Popover, Icon } from 'antd';
 import { connect } from 'dva';
 import { routerRedux } from 'dva/router';
-import Selector from '../../components/RBTableSelector/Selector';
-import RBCityCascader from '../../components/RBCityCascader';
+import Selector from '../../components/AXTableSelector/Selector';
+import AXCityCascader from '../../components/AXCityCascader';
 import FooterToolbar from '../../components/FooterToolbar';
 import PageHeaderLayout from '../../layouts/PageHeaderLayout';
 import {
@@ -258,7 +258,7 @@ export default class CampusCreatePage extends PureComponent {
                 rules: [{ required: true, message: '请选择校区地址!' }],
                 initialValue: renderCityName(),
               })(
-                <RBCityCascader />
+                <AXCityCascader />
               )}
             </Form.Item>
             <Form.Item label={fieldLabels.zoneName} {...formItemLayout}>

+ 3 - 3
src/routes/Campus/CampusList.js

@@ -3,9 +3,9 @@ import moment from 'moment';
 import { connect } from 'dva';
 import { routerRedux } from 'dva/router';
 import { Card, Modal, Form, Button, message } from 'antd';
-import { StandardTableList } from '../../components/RBList';
+import { StandardTableList } from '../../components/AXList';
 import Ellipsis from '../../components/Ellipsis';
-import RBRemoteSelect from '../../components/RBRemoteSelect';
+import AXRemoteSelect from '../../components/AXRemoteSelect';
 import PageHeaderLayout from '../../layouts/PageHeaderLayout';
 import { addRowKey } from '../../utils/utils';
 
@@ -221,7 +221,7 @@ export default class CampusListPage extends Component {
                   {getFieldDecorator('merchantId', {
                       initialValue: [],
                     })(
-                      <RBRemoteSelect
+                      <AXRemoteSelect
                         fetching={fetching}
                         dataSource={merchantDataFormatter(merchant.list)}
                         onSearch={this.handleRemoteSelectSearch}

+ 5 - 115
src/routes/Dashboard/Analysis.js

@@ -1,4 +1,4 @@
-import React, { Component, Fragment } from 'react';
+import React, { Component } from 'react';
 import { connect } from 'dva';
 import {
   Row,
@@ -6,8 +6,6 @@ import {
   Icon,
   Card,
   Tabs,
-  Table,
-  Radio,
   DatePicker,
   Tooltip,
   Menu,
@@ -23,7 +21,6 @@ import {
   Field,
   Bar,
   Pie,
-  TimelineChart,
 } from '../../components/Charts';
 import Trend from '../../components/Trend';
 import NumberInfo from '../../components/NumberInfo';
@@ -237,12 +234,12 @@ export default class Analysis extends Component {
       md: 12,
       lg: 12,
       xl: 6,
-      style: { marginBottom: 24 },
+      style: { marginBottom: 16 },
     };
 
     return (
-      <Fragment>
-        <Row gutter={24}>
+      <div style={{ margin: 16 }}>
+        <Row gutter={16}>
           <Col {...topColResponsiveProps}>
             <ChartCard
               bordered={false}
@@ -375,114 +372,7 @@ export default class Analysis extends Component {
             </Tabs>
           </div>
         </Card>
-
-        <Row gutter={24}>
-          <Col xl={12} lg={24} md={24} sm={24} xs={24}>
-            <Card
-              loading={loading}
-              bordered={false}
-              title="线上热门搜索"
-              extra={iconGroup}
-              style={{ marginTop: 24 }}
-            >
-              <Row gutter={68}>
-                <Col sm={12} xs={24} style={{ marginBottom: 24 }}>
-                  <NumberInfo
-                    subTitle={
-                      <span>
-                        搜索用户数
-                        <Tooltip title="指标文案">
-                          <Icon style={{ marginLeft: 8 }} type="info-circle-o" />
-                        </Tooltip>
-                      </span>
-                    }
-                    gap={8}
-                    total={numeral(12321).format('0,0')}
-                    status="up"
-                    subTotal={17.1}
-                  />
-                  <MiniArea line height={45} data={visitData2} />
-                </Col>
-                <Col sm={12} xs={24} style={{ marginBottom: 24 }}>
-                  <NumberInfo
-                    subTitle="人均搜索次数"
-                    total={2.7}
-                    status="down"
-                    subTotal={26.2}
-                    gap={8}
-                  />
-                  <MiniArea line height={45} data={visitData2} />
-                </Col>
-              </Row>
-              <Table
-                rowKey={record => record.index}
-                size="small"
-                columns={columns}
-                dataSource={searchData}
-                pagination={{
-                  style: { marginBottom: 0 },
-                  pageSize: 5,
-                }}
-              />
-            </Card>
-          </Col>
-          <Col xl={12} lg={24} md={24} sm={24} xs={24}>
-            <Card
-              loading={loading}
-              className={styles.salesCard}
-              bordered={false}
-              title="销售额类别占比"
-              bodyStyle={{ padding: 24 }}
-              extra={
-                <div className={styles.salesCardExtra}>
-                  {iconGroup}
-                  <div className={styles.salesTypeRadio}>
-                    <Radio.Group value={salesType} onChange={this.handleChangeSalesType}>
-                      <Radio.Button value="all">全部渠道</Radio.Button>
-                      <Radio.Button value="online">线上</Radio.Button>
-                      <Radio.Button value="offline">门店</Radio.Button>
-                    </Radio.Group>
-                  </div>
-                </div>
-              }
-              style={{ marginTop: 24, minHeight: 509 }}
-            >
-              <h4 style={{ marginTop: 8, marginBottom: 32 }}>销售额</h4>
-              <Pie
-                hasLegend
-                subTitle="销售额"
-                total={yuan(salesPieData.reduce((pre, now) => now.y + pre, 0))}
-                data={salesPieData}
-                valueFormat={val => yuan(val)}
-                height={248}
-                lineWidth={4}
-              />
-            </Card>
-          </Col>
-        </Row>
-
-        <Card
-          loading={loading}
-          className={styles.offlineCard}
-          bordered={false}
-          bodyStyle={{ padding: '0 0 32px 0' }}
-          style={{ marginTop: 32 }}
-        >
-          <Tabs activeKey={activeKey} onChange={this.handleTabChange}>
-            {offlineData.map(shop => (
-              <TabPane tab={<CustomTab data={shop} currentTabKey={activeKey} />} key={shop.name}>
-                <div style={{ padding: '0 24px' }}>
-                  <TimelineChart
-                    height={400}
-                    data={offlineChartData}
-                    titleMap={{ y1: '客流量', y2: '支付笔数' }}
-                  />
-                </div>
-              </TabPane>
-            ))}
-          </Tabs>
-        </Card>
-      </Fragment>
+      </div>
     );
   }
 }

+ 0 - 170
src/routes/Dashboard/Monitor.js

@@ -1,170 +0,0 @@
-import React, { PureComponent, Fragment } from 'react';
-import { connect } from 'dva';
-import { Row, Col, Card, Tooltip } from 'antd';
-import numeral from 'numeral';
-import Authorized from '../../utils/Authorized';
-import { Pie, WaterWave, Gauge, TagCloud } from '../../components/Charts';
-import NumberInfo from '../../components/NumberInfo';
-import CountDown from '../../components/CountDown';
-import ActiveChart from '../../components/ActiveChart';
-import styles from './Monitor.less';
-
-const { Secured } = Authorized;
-
-const targetTime = new Date().getTime() + 3900000;
-
-// use permission as a parameter
-const havePermissionAsync = new Promise((resolve) => {
-  // Call resolve on behalf of passed
-  setTimeout(() => resolve(), 1000);
-});
-@Secured(havePermissionAsync)
-@connect(({ monitor, loading }) => ({
-  monitor,
-  loading: loading.models.monitor,
-}))
-export default class Monitor extends PureComponent {
-  componentDidMount() {
-    this.props.dispatch({
-      type: 'monitor/fetchTags',
-    });
-  }
-
-  render() {
-    const { monitor, loading } = this.props;
-    const { tags } = monitor;
-
-    return (
-      <Fragment>
-        <Row gutter={24}>
-          <Col xl={18} lg={24} md={24} sm={24} xs={24} style={{ marginBottom: 24 }}>
-            <Card title="活动实时交易情况" bordered={false}>
-              <Row>
-                <Col md={6} sm={12} xs={24}>
-                  <NumberInfo
-                    subTitle="今日交易总额"
-                    suffix="元"
-                    total={numeral(124543233).format('0,0')}
-                  />
-                </Col>
-                <Col md={6} sm={12} xs={24}>
-                  <NumberInfo
-                    subTitle="销售目标完成率"
-                    total="92%"
-                  />
-                </Col>
-                <Col md={6} sm={12} xs={24}>
-                  <NumberInfo subTitle="活动剩余时间" total={<CountDown target={targetTime} />} />
-                </Col>
-                <Col md={6} sm={12} xs={24}>
-                  <NumberInfo
-                    subTitle="每秒交易总额"
-                    suffix="元"
-                    total={numeral(234).format('0,0')}
-                  />
-                </Col>
-              </Row>
-              <div className={styles.mapChart}>
-                <Tooltip title="等待后期实现">
-                  <img src="https://gw.alipayobjects.com/zos/rmsportal/HBWnDEUXCnGnGrRfrpKa.png" alt="map" />
-                </Tooltip>
-              </div>
-            </Card>
-          </Col>
-          <Col xl={6} lg={24} md={24} sm={24} xs={24}>
-            <Card title="活动情况预测" style={{ marginBottom: 24 }} bordered={false}>
-              <ActiveChart />
-            </Card>
-            <Card
-              title="券核效率"
-              style={{ marginBottom: 24 }}
-              bodyStyle={{ textAlign: 'center' }}
-              bordered={false}
-            >
-              <Gauge
-                format={(val) => {
-                  switch (parseInt(val, 10)) {
-                    case 20:
-                      return '差';
-                    case 40:
-                      return '中';
-                    case 60:
-                      return '良';
-                    case 80:
-                      return '优';
-                    default:
-                      return '';
-                  }
-                }}
-                title="跳出率"
-                height={180}
-                percent={87}
-              />
-            </Card>
-          </Col>
-        </Row>
-        <Row gutter={24}>
-          <Col xl={12} lg={24} sm={24} xs={24}>
-            <Card
-              title="各品类占比"
-              bordered={false}
-              className={styles.pieCard}
-            >
-              <Row style={{ padding: '16px 0' }}>
-                <Col span={8}>
-                  <Pie
-                    animate={false}
-                    percent={28}
-                    subTitle="中式快餐"
-                    total="28%"
-                    height={128}
-                    lineWidth={2}
-                  />
-                </Col>
-                <Col span={8}>
-                  <Pie
-                    animate={false}
-                    color="#5DDECF"
-                    percent={22}
-                    subTitle="西餐"
-                    total="22%"
-                    height={128}
-                    lineWidth={2}
-                  />
-                </Col>
-                <Col span={8}>
-                  <Pie
-                    animate={false}
-                    color="#2FC25B"
-                    percent={32}
-                    subTitle="火锅"
-                    total="32%"
-                    height={128}
-                    lineWidth={2}
-                  />
-                </Col>
-              </Row>
-            </Card>
-          </Col>
-          <Col xl={6} lg={12} sm={24} xs={24}>
-            <Card title="热门搜索" loading={loading} bordered={false} bodyStyle={{ overflow: 'hidden' }}>
-              <TagCloud
-                data={tags}
-                height={161}
-              />
-            </Card>
-          </Col>
-          <Col xl={6} lg={12} sm={24} xs={24}>
-            <Card title="资源剩余" bodyStyle={{ textAlign: 'center', fontSize: 0 }} bordered={false}>
-              <WaterWave
-                height={161}
-                title="补贴资金剩余"
-                percent={34}
-              />
-            </Card>
-          </Col>
-        </Row>
-      </Fragment>
-    );
-  }
-}

+ 0 - 23
src/routes/Dashboard/Monitor.less

@@ -1,23 +0,0 @@
-@import "~antd/lib/style/themes/default.less";
-@import "../../utils/utils.less";
-
-.mapChart {
-  padding-top: 24px;
-  height: 457px;
-  text-align: center;
-  img {
-    display: inline-block;
-    max-width: 100%;
-    max-height: 437px;
-  }
-}
-
-.pieCard :global(.pie-stat) {
-  font-size: 24px!important;
-}
-
-@media screen and (max-width: @screen-lg) {
-  .mapChart {
-    height: auto;
-  }
-}

+ 5 - 0
src/routes/Dashboard/SnapshopList.less

@@ -0,0 +1,5 @@
+.desc {
+  & > p > span {
+    font-weight: bold;
+  }
+}

+ 129 - 0
src/routes/Dashboard/SnapshotList.js

@@ -0,0 +1,129 @@
+import React, { Component } from 'react';
+import moment from 'moment';
+import { connect } from 'dva';
+import { Card, message } from 'antd';
+import { StandardTableList } from '../../components/AXList';
+import { addRowKey, renderProductType } from '../../utils/utils';
+import styles from './SnapshopList.less';
+
+const Message = message;
+
+@connect(({ trade, loading }) => ({
+  trade,
+  loading: loading.models.trade,
+}))
+export default class SnapshotListPage extends Component {
+  componentDidMount() {
+    this.props.dispatch({
+      type: 'trade/fetchSnapshotList',
+      payload: {},
+    });
+  }
+  handleFilterOperation = (params) => {
+    this.props.dispatch({
+      type: 'trade/fetchSnapshotList',
+      payload: params,
+    });
+  }
+  handleBatchOperation = () => {
+    Message.info('暂不支持批量操作!');
+  }
+
+  render() {
+    const { trade, loading } = this.props;
+    const { list, totalSize, pageSize, pageNo } = trade;
+
+    const batchActions = [{
+      key: 'delete',
+      name: '批量处理',
+    }];
+    const basicSearch = {
+      keys: [{
+        name: '校区名称',
+        field: 'campusName',
+      }, {
+        name: '校区编号',
+        field: 'campusCode',
+      }, {
+        name: '终端编号',
+        field: 'userCode',
+      }, {
+        name: '产品编号',
+        field: 'productCode',
+      }],
+    };
+    const pagination = {
+      pageNo,
+      pageSize,
+      totalSize,
+    };
+    const columns = [{
+      title: '产品信息',
+      key: 1,
+      width: '30%',
+      render: (_, record) => {
+        const { productCode, productName, productType } = record;
+        return (
+          <div className={styles.desc}>
+            <p><span>产品编号:&nbsp;</span>{productCode}</p>
+            <p><span>产品名称:&nbsp;</span>{productName}</p>
+            <p><span>产品类型:&nbsp;</span>{renderProductType(productType)}</p>
+          </div>
+        );
+      },
+    }, {
+      title: '用户信息',
+      key: 2,
+      width: '34%',
+      render: (_, record) => {
+        const { userCode, campusName, merchantName } = record;
+        return (
+          <div className={styles.desc}>
+            <p><span>终端编号:&nbsp;</span>{userCode}</p>
+            <p><span>所属校区:&nbsp;</span>{campusName}</p>
+            <p><span>所属渠道:&nbsp;</span>{merchantName}</p>
+          </div>
+        );
+      },
+    }, {
+      title: '价格信息',
+      key: 3,
+      render: (_, record) => {
+        const { merchantPrice, chargeUnit, quantity } = record;
+        return (
+          <div className={styles.desc}>
+            <p><span>商品价格:&nbsp;¥</span>{merchantPrice}</p>
+            <p><span>计价单位:&nbsp;</span>{chargeUnit}</p>
+            <p><span>购买数量:&nbsp;×</span>{quantity}</p>
+          </div>
+        );
+      },
+      width: '18%',
+    }, {
+      title: '购买时间',
+      key: 4,
+      dataIndex: 'gmtCreated',
+      render: text => moment(text).format('YYYY-MM-DD HH:mm:ss'),
+      width: '18%',
+    }];
+    return (
+      <Card style={{ margin: 16 }}>
+        <StandardTableList
+          columns={columns}
+          loading={loading}
+          dataSource={addRowKey(list)}
+          header={{
+            basicSearch,
+            onFilterClick: this.handleFilterOperation,
+          }}
+          footer={{
+            pagination,
+            batchActions,
+            onBatchClick: this.handleBatchOperation,
+          }}
+          showStatusSelect={false}
+        />
+      </Card>
+    );
+  }
+}

+ 0 - 275
src/routes/Dashboard/Workplace.js

@@ -1,275 +0,0 @@
-import React, { PureComponent } from 'react';
-import moment from 'moment';
-import { connect } from 'dva';
-import { Link } from 'dva/router';
-import { Row, Col, Card, List, Avatar } from 'antd';
-
-import PageHeaderLayout from '../../layouts/PageHeaderLayout';
-import EditableLinkGroup from '../../components/EditableLinkGroup';
-import { Radar } from '../../components/Charts';
-
-import styles from './Workplace.less';
-
-const links = [
-  {
-    title: '操作一',
-    href: '',
-  },
-  {
-    title: '操作二',
-    href: '',
-  },
-  {
-    title: '操作三',
-    href: '',
-  },
-  {
-    title: '操作四',
-    href: '',
-  },
-  {
-    title: '操作五',
-    href: '',
-  },
-  {
-    title: '操作六',
-    href: '',
-  },
-];
-
-const members = [
-  {
-    id: 'members-1',
-    title: '科学搬砖组',
-    logo: 'https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png',
-    link: '',
-  },
-  {
-    id: 'members-2',
-    title: '程序员日常',
-    logo: 'https://gw.alipayobjects.com/zos/rmsportal/cnrhVkzwxjPwAaCfPbdc.png',
-    link: '',
-  },
-  {
-    id: 'members-3',
-    title: '设计天团',
-    logo: 'https://gw.alipayobjects.com/zos/rmsportal/gaOngJwsRYRaVAuXXcmB.png',
-    link: '',
-  },
-  {
-    id: 'members-4',
-    title: '中二少女团',
-    logo: 'https://gw.alipayobjects.com/zos/rmsportal/ubnKSIfAJTxIgXOKlciN.png',
-    link: '',
-  },
-  {
-    id: 'members-5',
-    title: '骗你学计算机',
-    logo: 'https://gw.alipayobjects.com/zos/rmsportal/WhxKECPNujWoWEFNdnJE.png',
-    link: '',
-  },
-];
-
-@connect(({ project, activities, chart, loading }) => ({
-  project,
-  activities,
-  chart,
-  projectLoading: loading.effects['project/fetchNotice'],
-  activitiesLoading: loading.effects['activities/fetchList'],
-}))
-export default class Workplace extends PureComponent {
-  componentDidMount() {
-    const { dispatch } = this.props;
-    dispatch({
-      type: 'project/fetchNotice',
-    });
-    dispatch({
-      type: 'activities/fetchList',
-    });
-    dispatch({
-      type: 'chart/fetch',
-    });
-  }
-
-  componentWillUnmount() {
-    const { dispatch } = this.props;
-    dispatch({
-      type: 'chart/clear',
-    });
-  }
-
-  renderActivities() {
-    const {
-      activities: { list },
-    } = this.props;
-    return list.map((item) => {
-      const events = item.template.split(/@\{([^{}]*)\}/gi).map((key) => {
-        if (item[key]) {
-          return <a href={item[key].link} key={item[key].name}>{item[key].name}</a>;
-        }
-        return key;
-      });
-      return (
-        <List.Item key={item.id}>
-          <List.Item.Meta
-            avatar={<Avatar src={item.user.avatar} />}
-            title={
-              <span>
-                <a className={styles.username}>{item.user.name}</a>
-                &nbsp;
-                <span className={styles.event}>{events}</span>
-              </span>
-            }
-            description={
-              <span className={styles.datetime} title={item.updatedAt}>
-                {moment(item.updatedAt).fromNow()}
-              </span>
-            }
-          />
-        </List.Item>
-      );
-    });
-  }
-
-  render() {
-    const {
-      project: { notice },
-      projectLoading,
-      activitiesLoading,
-      chart: { radarData },
-    } = this.props;
-
-    const pageHeaderContent = (
-      <div className={styles.pageHeaderContent}>
-        <div className={styles.avatar}>
-          <Avatar size="large" src="https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png" />
-        </div>
-        <div className={styles.content}>
-          <div className={styles.contentTitle}>早安,曲丽丽,祝你开心每一天!</div>
-          <div>交互专家 | 蚂蚁金服-某某某事业群-某某平台部-某某技术部-UED</div>
-        </div>
-      </div>
-    );
-
-    const extraContent = (
-      <div className={styles.extraContent}>
-        <div className={styles.statItem}>
-          <p>项目数</p>
-          <p>56</p>
-        </div>
-        <div className={styles.statItem}>
-          <p>团队内排名</p>
-          <p>8<span> / 24</span></p>
-        </div>
-        <div className={styles.statItem}>
-          <p>项目访问</p>
-          <p>2,223</p>
-        </div>
-      </div>
-    );
-
-    return (
-      <PageHeaderLayout
-        content={pageHeaderContent}
-        extraContent={extraContent}
-      >
-        <Row gutter={24}>
-          <Col xl={16} lg={24} md={24} sm={24} xs={24}>
-            <Card
-              className={styles.projectList}
-              style={{ marginBottom: 24 }}
-              title="进行中的项目"
-              bordered={false}
-              extra={<Link to="/">全部项目</Link>}
-              loading={projectLoading}
-              bodyStyle={{ padding: 0 }}
-            >
-              {
-                notice.map(item => (
-                  <Card.Grid className={styles.projectGrid} key={item.id}>
-                    <Card bodyStyle={{ padding: 0 }} bordered={false}>
-                      <Card.Meta
-                        title={(
-                          <div className={styles.cardTitle}>
-                            <Avatar size="small" src={item.logo} />
-                            <Link to={item.href}>{item.title}</Link>
-                          </div>
-                        )}
-                        description={item.description}
-                      />
-                      <div className={styles.projectItemContent}>
-                        <Link to={item.memberLink}>{item.member || ''}</Link>
-                        {item.updatedAt && (
-                          <span className={styles.datetime} title={item.updatedAt}>
-                            {moment(item.updatedAt).fromNow()}
-                          </span>
-                        )}
-                      </div>
-                    </Card>
-                  </Card.Grid>
-                ))
-              }
-            </Card>
-            <Card
-              bodyStyle={{ padding: 0 }}
-              bordered={false}
-              className={styles.activeCard}
-              title="动态"
-              loading={activitiesLoading}
-            >
-              <List loading={activitiesLoading} size="large">
-                <div className={styles.activitiesList}>
-                  {this.renderActivities()}
-                </div>
-              </List>
-            </Card>
-          </Col>
-          <Col xl={8} lg={24} md={24} sm={24} xs={24}>
-            <Card
-              style={{ marginBottom: 24 }}
-              title="快速开始 / 便捷导航"
-              bordered={false}
-              bodyStyle={{ padding: 0 }}
-            >
-              <EditableLinkGroup
-                onAdd={() => {}}
-                links={links}
-                linkElement={Link}
-              />
-            </Card>
-            <Card
-              style={{ marginBottom: 24 }}
-              bordered={false}
-              title="XX 指数"
-              loading={radarData.length === 0}
-            >
-              <div className={styles.chart}>
-                <Radar hasLegend height={343} data={radarData} />
-              </div>
-            </Card>
-            <Card
-              bodyStyle={{ paddingTop: 12, paddingBottom: 12 }}
-              bordered={false}
-              title="团队"
-            >
-              <div className={styles.members}>
-                <Row gutter={48}>
-                  {
-                    members.map(item => (
-                      <Col span={12} key={`members-item-${item.id}`}>
-                        <Link to={item.link}>
-                          <Avatar src={item.logo} size="small" />
-                          <span className={styles.member}>{item.title}</span>
-                        </Link>
-                      </Col>
-                    ))
-                  }
-                </Row>
-              </div>
-            </Card>
-          </Col>
-        </Row>
-      </PageHeaderLayout>
-    );
-  }
-}

+ 0 - 233
src/routes/Dashboard/Workplace.less

@@ -1,233 +0,0 @@
-@import "~antd/lib/style/themes/default.less";
-@import "../../utils/utils.less";
-
-.activitiesList {
-  padding: 0 24px 8px 24px;
-  .username {
-    color: @text-color;
-  }
-  .event {
-    font-weight: normal;
-  }
-}
-
-.pageHeaderContent {
-  display: flex;
-  .avatar {
-    flex: 0 1 72px;
-    margin-bottom: 8px;
-    & > span {
-      border-radius: 72px;
-      display: block;
-      width: 72px;
-      height: 72px;
-    }
-  }
-  .content {
-    position: relative;
-    top: 4px;
-    margin-left: 24px;
-    flex: 1 1 auto;
-    color: @text-color-secondary;
-    line-height: 22px;
-    .contentTitle {
-      font-size: 20px;
-      line-height: 28px;
-      font-weight: 500;
-      color: @heading-color;
-      margin-bottom: 12px;
-    }
-  }
-}
-
-.extraContent {
-  .clearfix();
-  float: right;
-  white-space: nowrap;
-  .statItem {
-    padding: 0 32px;
-    position: relative;
-    display: inline-block;
-    > p:first-child {
-      color: @text-color-secondary;
-      font-size: @font-size-base;
-      line-height: 22px;
-      margin-bottom: 4px;
-    }
-    > p {
-      color: @heading-color;
-      font-size: 30px;
-      line-height: 38px;
-      margin: 0;
-      > span {
-        color: @text-color-secondary;
-        font-size: 20px;
-      }
-    }
-    &:after {
-      background-color: @border-color-split;
-      position: absolute;
-      top: 8px;
-      right: 0;
-      width: 1px;
-      height: 40px;
-      content: '';
-    }
-    &:last-child {
-      padding-right: 0;
-      &:after {
-        display: none;
-      }
-    }
-  }
-}
-
-.members {
-  a {
-    display: block;
-    margin: 12px 0;
-    line-height: 24px;
-    height: 24px;
-    .textOverflow();
-    .member {
-      font-size: @font-size-base;
-      color: @text-color;
-      line-height: 24px;
-      max-width: 100px;
-      vertical-align: top;
-      margin-left: 12px;
-      transition: all .3s;
-      display: inline-block;
-      .textOverflow();
-    }
-    &:hover {
-      span {
-        color: @primary-color;
-      }
-    }
-  }
-}
-
-.projectList {
-  :global {
-    .ant-card-meta-description {
-      color: @text-color-secondary;
-      height: 44px;
-      line-height: 22px;
-      overflow: hidden;
-    }
-  }
-  .cardTitle {
-    font-size: 0;
-    a {
-      color: @heading-color;
-      margin-left: 12px;
-      line-height: 24px;
-      height: 24px;
-      display: inline-block;
-      vertical-align: top;
-      font-size: @font-size-base;
-      &:hover {
-        color: @primary-color;
-      }
-    }
-  }
-  .projectGrid {
-    width: 33.33%;
-  }
-  .projectItemContent {
-    display: flex;
-    margin-top: 8px;
-    overflow: hidden;
-    font-size: 12px;
-    height: 20px;
-    line-height: 20px;
-    .textOverflow();
-    a {
-      color: @text-color-secondary;
-      display: inline-block;
-      flex: 1 1 0;
-      .textOverflow();
-      &:hover {
-        color: @primary-color;
-      }
-    }
-    .datetime {
-      color: @disabled-color;
-      flex: 0 0 auto;
-      float: right;
-    }
-  }
-}
-
-.datetime {
-  color: @disabled-color;
-}
-
-@media screen and (max-width: @screen-xl)  and (min-width: @screen-lg) {
-  .activeCard {
-    margin-bottom: 24px;
-  }
-  .members {
-    margin-bottom: 0;
-  }
-  .extraContent {
-    margin-left: -44px;
-    .statItem {
-      padding: 0 16px;
-    }
-  }
-}
-
-@media screen and (max-width: @screen-lg) {
-  .activeCard {
-    margin-bottom: 24px;
-  }
-  .members {
-    margin-bottom: 0;
-  }
-  .extraContent {
-    float: none;
-    margin-right: 0;
-    .statItem {
-      padding: 0 16px;
-      text-align: left;
-      &:after {
-        display: none;
-      }
-    }
-  }
-}
-
-@media screen and (max-width: @screen-md) {
-  .extraContent {
-    margin-left: -16px;
-  }
-  .projectList {
-    .projectGrid {
-      width: 50%;
-    }
-  }
-}
-
-@media screen and (max-width: @screen-sm) {
-  .pageHeaderContent {
-    display: block;
-    .content {
-      margin-left: 0;
-    }
-  }
-  .extraContent {
-    .statItem {
-      float: none;
-    }
-  }
-}
-
-@media screen and (max-width: @screen-xs) {
-  .projectList {
-    .projectGrid {
-      width: 100%;
-    }
-  }
-}

+ 0 - 0
src/routes/Document/DocumentChannel.js


+ 126 - 0
src/routes/Document/DocumentPlatform.js

@@ -0,0 +1,126 @@
+/* eslint-disable react/no-unescaped-entities */
+import React, { PureComponent } from 'react';
+import { Card, Icon } from 'antd';
+import DescriptionList from '../../components/DescriptionList';
+import styles from './document.less';
+
+const { Description } = DescriptionList;
+
+export default class PlatformDocument extends PureComponent {
+  render() {
+    return (
+      <Card title="平台使用文档" className={styles.card}>
+        <DescriptionList
+          col={1}
+          size="large"
+          title="1.资源管理"
+          className={styles.descList}
+        >
+          <Description>
+            <Icon type="question-circle-o" className={styles.question} />&nbsp;
+            如何上传图片?
+          </Description>
+          <Description>
+            <Icon type="check-circle-o" className={styles.answer} />&nbsp;
+            操作:"资源管理 > 图片管理 > 新建 > 提交",正确填写图片的编号和名称后方可选择待上传图片;
+            <br />
+            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+            注意:图片编号应满足格式限制,不填写或者格式错误禁止上传图片,图片一旦创建完成,图片编号不可修改;
+          </Description>
+          <Description>
+            <Icon type="question-circle-o" className={styles.question} />&nbsp;
+            如何查看视频内容?
+          </Description>
+          <Description>
+            <Icon type="check-circle-o" className={styles.answer} />&nbsp;
+            操作:"资源管理 > 视频管理 > 检索",可根据视频编号或者名称查看具体视频内容;
+          </Description>
+        </DescriptionList>
+        <DescriptionList
+          col={1}
+          size="large"
+          title="2.产品加工"
+          className={styles.descList}
+        >
+          <Description>
+            <Icon type="question-circle-o" className={styles.question} />&nbsp;
+            如何制作课件?
+          </Description>
+          <Description>
+            <Icon type="check-circle-o" className={styles.answer} />&nbsp;
+            操作:"产品加工 > 制作课件 > 新建 > 提交",正确填写课件的编号及名称后点击`资源列表`选择一个视频或者多个图片;
+            <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+            注意:环节名称与前端课件的环节名对应,不填写则前端展现为空;
+          </Description>
+          <Description>
+            <Icon type="question-circle-o" className={styles.question} />&nbsp;
+            如何制作课?
+          </Description>
+          <Description>
+            <Icon type="check-circle-o" className={styles.answer} />&nbsp;
+            操作:"产品加工 > 制作课 > 新建 > 提交",正确填写课的编号及名称后点击`课件列表`选择一个或者多个课件;
+            <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+            注意:拖动表格或者点击"上移/下移"来调整课件顺序;
+          </Description>
+          <Description>
+            <Icon type="question-circle-o" className={styles.question} />&nbsp;
+            如何制作课程?
+          </Description>
+          <Description>
+            <Icon type="check-circle-o" className={styles.answer} />&nbsp;
+            操作:"产品加工 > 制作课程 > 新建 > 提交",正确填写课程的编号及名称后选择封面、背景、课及相关配套等信息;
+            <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+            注意:拖动表格或者点击"上移/下移"来调整课或者相关配套顺序;
+          </Description>
+          <Description>
+            <Icon type="question-circle-o" className={styles.question} />&nbsp;
+            如何制作配套?
+          </Description>
+          <Description>
+            <Icon type="check-circle-o" className={styles.answer} />&nbsp;
+            操作:"产品加工 > 制作配套 > 新建 > 提交",正确填写配套的编号及名称后选择封面、详情图片列表及相关配套等信息;
+            <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+            注意:拖动表格或者点击"上移/下移"来调整相关配套顺序;
+          </Description>
+          <Description>
+            <Icon type="question-circle-o" className={styles.question} />&nbsp;
+            如何制作师训内容?
+          </Description>
+          <Description>
+            <Icon type="check-circle-o" className={styles.answer} />&nbsp;
+            操作:"产品加工 > 制作师训 > 新建 > 提交",正确填写师训的编号、主题、活动时间后选择封面、详情大图列表等信息;
+            <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+            注意:活动起始日期和截止日期可不选;
+          </Description>
+          <Description>
+            <Icon type="question-circle-o" className={styles.question} />&nbsp;
+            如何创建套餐包?
+          </Description>
+          <Description>
+            <Icon type="check-circle-o" className={styles.answer} />&nbsp;
+            操作:"产品加工 > 制作套餐包 > 新建 > 提交",正确填写师训的编号、名称后选择套餐包含的课程或者配套等内容;
+            <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+            注意:选择完课程及配套内容后须填写该课程或配套在套餐包里的价格;
+          </Description>
+        </DescriptionList>
+        <DescriptionList
+          col={1}
+          size="large"
+          title="3.产品上架"
+          className={styles.descList}
+        >
+          <Description>
+            <Icon type="question-circle-o" className={styles.question} />&nbsp;
+            如何将产品上架到不同的渠道平台?
+          </Description>
+          <Description>
+            <Icon type="check-circle-o" className={styles.answer} />&nbsp;
+            操作:"产品出售 > 上架XX > 新建 > 提交",选择需要上架的产品,然后选择需要上架的渠道平台;
+            <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+            注意:改步操作后该产品仅属于可售卖状态,需要再次编辑填写相关价格,并选择需上架的栏目;
+          </Description>
+        </DescriptionList>
+      </Card>
+    );
+  }
+}

+ 23 - 0
src/routes/Document/document.less

@@ -0,0 +1,23 @@
+@import "~antd/lib/style/themes/default.less";
+
+.card {
+  margin: 16px 13%;
+  :global(.ant-card-head-title) {
+    text-align: center;
+  }
+}
+
+.descList {
+  border-bottom: 1px dashed #bfbfbf;
+  padding: 10px 0;
+}
+
+.question {
+  color: #1890ff;
+  font-weight: bold;
+}
+
+.answer {
+  color: #52c41a;
+  font-weight: bold;
+}

+ 3 - 3
src/routes/Frontend/Recommend/RecommendEdit.js

@@ -3,8 +3,8 @@ import pathToRegexp from 'path-to-regexp';
 import { connect } from 'dva';
 import { routerRedux } from 'dva/router';
 import { Card, Modal, Button } from 'antd';
-import RBDragSortTable from '../../../components/RBDragSortTable';
-import Selector from '../../../components/RBTableSelector/Selector';
+import AXDragSortTable from '../../../components/AXDragSortTable';
+import Selector from '../../../components/AXTableSelector/Selector';
 import FooterToolbar from '../../../components/FooterToolbar/index';
 
 @connect(({ loading, merchant, shelves }) => ({
@@ -122,7 +122,7 @@ export default class RecommendEditPage extends Component {
           title={<a onClick={this.handleSelectorModalShow}>选择课程</a>}
           style={{ marginBottom: 70 }}
         >
-          <RBDragSortTable
+          <AXDragSortTable
             columns={productColumns}
             data={recommendList}
             onChange={this.handleDragSortTableChange}

+ 1 - 1
src/routes/Frontend/Recommend/RecommendList.js

@@ -3,7 +3,7 @@ import moment from 'moment';
 import { connect } from 'dva';
 import { routerRedux } from 'dva/router';
 import { Card, Button, message } from 'antd';
-import { StandardTableList } from '../../../components/RBList';
+import { StandardTableList } from '../../../components/AXList';
 import { renderStatus, renderCategory, addRowKey } from '../../../utils/utils';
 
 const Message = message;

+ 3 - 3
src/routes/Frontend/Tag/TagCreate.js

@@ -4,8 +4,8 @@ import { connect } from 'dva';
 import { routerRedux } from 'dva/router';
 import { message, Form, Table, Modal, Card, Button, Input, Switch, Radio } from 'antd';
 import { statusToBool, boolToStatus } from '../../../utils/utils';
-import RBDragSortTable from '../../../components/RBDragSortTable/index';
-import Selector from '../../../components/RBTableSelector/Selector';
+import AXDragSortTable from '../../../components/AXDragSortTable/index';
+import Selector from '../../../components/AXTableSelector/Selector';
 import FooterToolbar from '../../../components/FooterToolbar/index';
 import styles from './TagCreate.less';
 
@@ -365,7 +365,7 @@ export default class TagCreatePage extends Component {
         </Card>
         {/* 产品选择Card */}
         <Card title={renderProductCardName()} style={{ marginBottom: 70 }}>
-          <RBDragSortTable
+          <AXDragSortTable
             data={productList}
             columns={productColumns}
             onChange={this.handleDragSortTableChange}

+ 1 - 1
src/routes/Frontend/Tag/TagList.js

@@ -3,7 +3,7 @@ import moment from 'moment';
 import { connect } from 'dva';
 import { routerRedux } from 'dva/router';
 import { Card, Modal, Button, message } from 'antd';
-import { StandardTableList } from '../../../components/RBList/index';
+import { StandardTableList } from '../../../components/AXList/index';
 import { renderStatus, addRowKey } from '../../../utils/utils';
 
 const Message = message;

+ 3 - 3
src/routes/Frontend/TagGroup/TagGroupCreate.js

@@ -4,8 +4,8 @@ import { connect } from 'dva';
 import { routerRedux } from 'dva/router';
 import { Form, Table, Modal, Card, Button, Input, Switch } from 'antd';
 import { renderStatus, statusToBool, boolToStatus } from '../../../utils/utils';
-import RBDragSortTable from '../../../components/RBDragSortTable';
-import Selector from '../../../components/RBTableSelector/Selector';
+import AXDragSortTable from '../../../components/AXDragSortTable';
+import Selector from '../../../components/AXTableSelector/Selector';
 import FooterToolbar from '../../../components/FooterToolbar';
 import styles from './TagGroupCreate.less';
 
@@ -281,7 +281,7 @@ export default class TagCreatePage extends Component {
         {/* 标签排序Card */}
         {this.isEdit() &&
           <Card title="标签列表" style={{marginBottom: 70}}>
-            <RBDragSortTable
+            <AXDragSortTable
               data={tagList}
               columns={tagColumns}
               onChange={this.handleDragSortTableChange}

+ 1 - 1
src/routes/Frontend/TagGroup/TagGroupList.js

@@ -3,7 +3,7 @@ import moment from 'moment';
 import { connect } from 'dva';
 import { routerRedux } from 'dva/router';
 import { Card, Modal, Button, message } from 'antd';
-import { StandardTableList } from '../../../components/RBList/index';
+import { StandardTableList } from '../../../components/AXList/index';
 import { renderStatus, addRowKey } from '../../../utils/utils';
 
 const Message = message;

+ 4 - 8
src/routes/Merchant/MerchantCreate.js

@@ -5,11 +5,7 @@ import { connect } from 'dva';
 import { routerRedux } from 'dva/router';
 import PageHeaderLayout from '../../layouts/PageHeaderLayout';
 import FooterToolbar from '../../components/FooterToolbar';
-import {
-  DOMAIN_CP,
-  DOMAIN_LJ,
-  DOMAIN_PJ,
-} from '../../utils/config';
+import { Hotax } from '../../utils/config';
 import { statusToBool, boolToStatus } from '../../utils/utils';
 import styles from './MerchantCreate.less';
 
@@ -28,13 +24,13 @@ const fieldLabels = {
 };
 const domains = [{
   title: '平台方',
-  value: DOMAIN_LJ,
+  value: Hotax.DOMAIN_LJ,
 }, {
   title: '渠道商',
-  value: DOMAIN_PJ,
+  value: Hotax.DOMAIN_PJ,
 }, {
   title: '供应商',
-  value: DOMAIN_CP,
+  value: Hotax.DOMAIN_CP,
 }];
 const receipts = [{
   title: '普通发票',

+ 2 - 2
src/routes/Merchant/MerchantList.js

@@ -3,7 +3,7 @@ import moment from 'moment';
 import { connect } from 'dva';
 import { routerRedux } from 'dva/router';
 import { Card, Modal, Button, message } from 'antd';
-import { StandardTableList } from '../../components/RBList';
+import { StandardTableList } from '../../components/AXList';
 import PageHeaderLayout from '../../layouts/PageHeaderLayout';
 import Authorized from '../../utils/Authorized';
 import { renderStatus, renderCategory, addRowKey } from '../../utils/utils';
@@ -82,7 +82,7 @@ export default class MerchantListPage extends Component {
     const renderOperation = (item) => {
       return (
         <div>
-          <Authorized authority="root" noMatch={null}>
+          <Authorized authority="admin" noMatch={null}>
             <Button
               size="small"
               className="depositBtn"

+ 31 - 27
src/routes/Product/Course/CourseCreate.js

@@ -8,9 +8,9 @@ import {
 import {
   renderStatus, statusToBool, boolToStatus, genAbsolutePicUrl,
 } from '../../../utils/utils';
-import { PRODUCT_LESSON } from '../../../utils/config';
-import RBDragSortTable from '../../../components/RBDragSortTable';
-import Selector from '../../../components/RBTableSelector/Selector';
+import { Hotax } from '../../../utils/config';
+import AXDragSortTable from '../../../components/AXDragSortTable';
+import Selector from '../../../components/AXTableSelector/Selector';
 import FooterToolbar from '../../../components/FooterToolbar';
 import styles from './CourseCreate.less';
 
@@ -83,13 +83,13 @@ export default class CourseItemCreatePage extends Component {
       return match[1];
     }
     return false;
-  }
+  };
   cleanPageState = () => {
     this.props.dispatch({
       type: 'product/cleanItemState',
       payload: {},
     });
-  }
+  };
   selectorDataFetcher = (name, params) => {
     switch (name) {
       case 'cover':
@@ -97,26 +97,29 @@ export default class CourseItemCreatePage extends Component {
           type: 'resource/fetchImageList',
           payload: params,
         });
-        return;
+        break;
       case 'bg':
         this.props.dispatch({
           type: 'resource/fetchImageList',
           payload: params,
         });
-        return;
+        break;
       case 'lesson':
         this.props.dispatch({
           type: 'lesson/fetchLessonList',
           payload: params,
         });
-        return;
+        break;
       case 'support':
         this.props.dispatch({
           type: 'product/fetchSupportList',
           payload: params,
         });
+        break;
+      default:
+        break;
     }
-  }
+  };
   currentItemFormatter = (name, rows) => {
     let payload;
     switch (name) {
@@ -132,18 +135,20 @@ export default class CourseItemCreatePage extends Component {
       case 'support':
         payload = { supportList: rows };
         break;
+      default:
+        break;
     }
     return payload;
-  }
+  };
   handleSelectorModalShow = (name) => {
     this.setState({
       [`${name}SelectorDestroy`]: false,
     });
     this.selectorDataFetcher(name);
-  }
+  };
   handleSelectorChange = (name, params) => {
     this.selectorDataFetcher(name, params);
-  }
+  };
   handleSelectorFinish = (name, rows) => {
     this.setState({
       [`${name}SelectorDestroy`]: true,
@@ -153,33 +158,33 @@ export default class CourseItemCreatePage extends Component {
       payload,
       type: 'product/fixCurrentItem',
     });
-  }
+  };
   handleDragSortTableChange = (name, rows) => {
     const payload = this.currentItemFormatter(name, rows);
     this.props.dispatch({
       payload,
       type: 'product/fixCurrentItem',
     });
-  }
+  };
   handleSelectorCancel = (name) => {
     this.setState({
       [`${name}SelectorDestroy`]: true,
     });
-  }
+  };
   handlePageBack = () => {
     this.props.dispatch(routerRedux.push({
       pathname: '/product/course',
       state: this.props.location.state,
     }));
-  }
+  };
   handlePageSubmit = (e) => {
     e.preventDefault();
     this.props.form.validateFieldsAndScroll((err, values) => {
       if (!err) {
         // 提取表单字段
-        let { title, subTitle, name, status, ...rest } = values;
-        name = `${title}_${subTitle}`;
-        values = { title, subTitle, name, status: boolToStatus(status), ...rest };
+        const { title, subTitle, name, status, ...rest } = values;
+        const newName = `${title}_${subTitle}`;
+        const newValues = { title, subTitle, name: newName, status: boolToStatus(status), ...rest };
 
         const { product } = this.props;
         const { currentItem } = product;
@@ -190,7 +195,7 @@ export default class CourseItemCreatePage extends Component {
         let supportIdList;
         if (subItemList) {
           subList = subItemList.map(
-            item => ({ id: item.id, type: PRODUCT_LESSON })
+            item => ({ id: item.id, type: Hotax.PRODUCT_LESSON })
           );
         }
         if (supportList) {
@@ -205,7 +210,7 @@ export default class CourseItemCreatePage extends Component {
             id: matchId,
             subItemList: subList,
             supportList: supportIdList,
-            ...values,
+            ...newValues,
           };
           this.props.dispatch({
             type: 'product/updateCourseItem',
@@ -218,7 +223,7 @@ export default class CourseItemCreatePage extends Component {
             coverUrl,
             subItemList: subList,
             supportList: supportIdList,
-            ...values,
+            ...newValues,
           };
           this.props.dispatch({
             type: 'product/createCourseItem',
@@ -228,7 +233,7 @@ export default class CourseItemCreatePage extends Component {
         }
       }
     });
-  }
+  };
 
   render() {
     const {
@@ -279,11 +284,10 @@ export default class CourseItemCreatePage extends Component {
 
     const getMerchants = () => {
       const { list } = merchant;
-      const options = list.map(item => ({
+      return list.map(item => ({
         text: item.name,
         key: item.id,
       }));
-      return options;
     };
 
     const getResourceModal = (isCover) => {
@@ -541,7 +545,7 @@ export default class CourseItemCreatePage extends Component {
         </Card>
         {/* 课列表选择Card */}
         <Card title={renderLessonCardName()} style={{ marginBottom: 16 }}>
-          <RBDragSortTable
+          <AXDragSortTable
             columns={lessonColumns}
             data={subItemList}
             onChange={rows => this.handleDragSortTableChange('lesson', rows)}
@@ -550,7 +554,7 @@ export default class CourseItemCreatePage extends Component {
         </Card>
         {/* 周边配套选择Card */}
         <Card title={renderSupportCardName()} style={{ marginBottom: 70 }}>
-          <RBDragSortTable
+          <AXDragSortTable
             columns={supportColumns}
             data={supportList}
             onChange={rows => this.handleDragSortTableChange('support', rows)}

+ 1 - 1
src/routes/Product/Course/CourseList.js

@@ -3,7 +3,7 @@ import moment from 'moment';
 import { connect } from 'dva';
 import { routerRedux } from 'dva/router';
 import { Card, Modal, Button, message } from 'antd';
-import { StandardTableList } from '../../../components/RBList';
+import { StandardTableList } from '../../../components/AXList';
 import Ellipsis from '../../../components/Ellipsis';
 import { renderStatus, addRowKey } from '../../../utils/utils';
 

+ 25 - 25
src/routes/Product/Courseware/CoursewareCreate.js

@@ -3,11 +3,11 @@ import pathToRegexp from 'path-to-regexp';
 import { connect } from 'dva';
 import { routerRedux } from 'dva/router';
 import { Form, Modal, Card, Button, Input, Radio, Switch } from 'antd';
-import RBVideoPlayer from '../../../components/RBVideoPlayer/index';
-import RBDragSortTable from '../../../components/RBDragSortTable/index';
-import Selector from '../../../components/RBTableSelector/Selector';
+import AXVideoPlayer from '../../../components/AXVideoPlayer/index';
+import AXDragSortTable from '../../../components/AXDragSortTable/index';
+import Selector from '../../../components/AXTableSelector/Selector';
 import FooterToolbar from '../../../components/FooterToolbar/index';
-import { RESOURCE_VIDEO } from '../../../utils/config';
+import { Hotax } from '../../../utils/config';
 import {
   genAbsolutePicUrl,
   renderStatus,
@@ -46,7 +46,7 @@ const formItemLayout = {
 export default class CoursewareCreatePage extends Component {
   state = {
     modalSelectorDestroy: true,
-    resourceType: 'Index',
+    resourceType: 'Picture',
   };
   componentWillMount() {
     // 进入页面前清空下model中state内容,防止上次内容造成干扰
@@ -72,16 +72,16 @@ export default class CoursewareCreatePage extends Component {
       return match[1];
     }
     return false;
-  }
+  };
   cleanPageState = () => {
     this.props.dispatch({
       type: 'courseware/cleanItemState',
       payload: {},
     });
-  }
+  };
   selectorDataFetcher = (params) => {
     const { resourceType } = this.state;
-    if (resourceType === 'Index') {
+    if (resourceType === 'Picture') {
       this.props.dispatch({
         type: 'resource/fetchImageList',
         payload: params,
@@ -93,18 +93,18 @@ export default class CoursewareCreatePage extends Component {
         payload: params,
       });
     }
-  }
+  };
   handleSelectorModalShow = () => {
     this.setState({
       modalSelectorDestroy: false,
     });
     this.selectorDataFetcher();
-  }
+  };
   handleSelectorCancel = () => {
     this.setState({
       modalSelectorDestroy: true,
     });
-  }
+  };
   handleSelectorFinish = (rows) => {
     this.setState({
       modalSelectorDestroy: true,
@@ -113,33 +113,33 @@ export default class CoursewareCreatePage extends Component {
       type: 'courseware/fixResourceList',
       payload: rows,
     });
-  }
+  };
   handleSelectorChange = (params) => {
     this.selectorDataFetcher(params);
-  }
+  };
   handleRadioChange = (e) => {
     this.setState({
       resourceType: e.target.value,
     }, () => this.selectorDataFetcher());
-  }
+  };
   handleDragSortTableChange = (rows) => {
     this.props.dispatch({
       type: 'courseware/fixResourceList',
       payload: rows,
     });
-  }
+  };
   handlePageBack = () => {
     this.props.dispatch(routerRedux.push({
       pathname: '/product/courseware',
       state: this.props.location.state,
     }));
-  }
+  };
   handlePageSubmit = (e) => {
     e.preventDefault();
     this.props.form.validateFieldsAndScroll((err, values) => {
       if (!err) {
         const { status, ...rest } = values;
-        values = { status: boolToStatus(status), ...rest };
+        const newValues = { status: boolToStatus(status), ...rest };
         const { courseware } = this.props;
         const { currentItem } = courseware;
         const { resourceList } = currentItem;
@@ -154,7 +154,7 @@ export default class CoursewareCreatePage extends Component {
           const params = {
             id: matchId,
             resourceList: resourceIdList,
-            ...values,
+            ...newValues,
           };
           this.props.dispatch({
             type: 'courseware/updateCoursewareItem',
@@ -164,7 +164,7 @@ export default class CoursewareCreatePage extends Component {
         } else {
           const params = {
             resourceList: resourceIdList,
-            ...values,
+            ...newValues,
           };
           this.props.dispatch({
             type: 'courseware/createCoursewareItem',
@@ -174,7 +174,7 @@ export default class CoursewareCreatePage extends Component {
         }
       }
     });
-  }
+  };
 
   render() {
     const { submitting, courseware, form, loading, resource } = this.props;
@@ -239,13 +239,13 @@ export default class CoursewareCreatePage extends Component {
     const renderResourceList = () => {
       if (!resourceList.length) {
         return (
-          <h3 style={{ color: 'red' }}>你还未选择任何资源,请点击上方"资源列表"进行选择!</h3>
+          <h3 style={{ color: 'red' }}>你还未选择任何资源,请点击上方资源列表进行选择</h3>
         );
-      } else if (resourceList[0].type === RESOURCE_VIDEO) {
+      } else if (resourceList[0].type === Hotax.RESOURCE_VIDEO) {
         const videoItem = resourceList[0];
         return (
           <div className={styles.video}>
-            <RBVideoPlayer
+            <AXVideoPlayer
               width="100%"
               height="100%"
               url={videoItem.url}
@@ -255,7 +255,7 @@ export default class CoursewareCreatePage extends Component {
         );
       } else {
         return (
-          <RBDragSortTable
+          <AXDragSortTable
             columns={imageColumns}
             data={resourceList}
             onChange={this.handleDragSortTableChange}
@@ -331,7 +331,7 @@ export default class CoursewareCreatePage extends Component {
               onCancel={this.handleSelectorCancel}
             >
               <Selector
-                multiple={resourceType === 'Index'}
+                multiple={resourceType === 'Picture'}
                 loading={loading}
                 selectorName={resourceType}
                 list={resource.list}

+ 1 - 1
src/routes/Product/Courseware/CoursewareList.js

@@ -3,7 +3,7 @@ import moment from 'moment';
 import { connect } from 'dva';
 import { routerRedux } from 'dva/router';
 import { Card, Modal, Button, message } from 'antd';
-import { StandardTableList } from '../../../components/RBList/index';
+import { StandardTableList } from '../../../components/AXList/index';
 import { renderStatus, addRowKey } from '../../../utils/utils';
 
 const Message = message;

+ 3 - 3
src/routes/Product/Lesson/LessonCreate.js

@@ -3,8 +3,8 @@ import pathToRegexp from 'path-to-regexp';
 import { connect } from 'dva';
 import { routerRedux } from 'dva/router';
 import { Form, Modal, Card, Button, Input, Switch } from 'antd';
-import RBDragSortTable from '../../../components/RBDragSortTable/index';
-import Selector from '../../../components/RBTableSelector/Selector';
+import AXDragSortTable from '../../../components/AXDragSortTable/index';
+import Selector from '../../../components/AXTableSelector/Selector';
 import FooterToolbar from '../../../components/FooterToolbar/index';
 import { renderStatus, statusToBool, boolToStatus } from '../../../utils/utils';
 import styles from './LessonCreate.less';
@@ -236,7 +236,7 @@ export default class LessonCreatePage extends Component {
           </Form>
         </Card>
         <Card title={renderCardName()} style={{marginBottom: 70}}>
-          <RBDragSortTable
+          <AXDragSortTable
             columns={coursewareColumns}
             data={wareList}
             onChange={this.handleDragSortTableChange}

+ 1 - 1
src/routes/Product/Lesson/LessonList.js

@@ -3,7 +3,7 @@ import moment from 'moment';
 import { connect } from 'dva';
 import { routerRedux } from 'dva/router';
 import { Card, Modal, Button, message } from 'antd';
-import { StandardTableList } from '../../../components/RBList/index';
+import { StandardTableList } from '../../../components/AXList/index';
 import { renderStatus, addRowKey } from '../../../utils/utils';
 
 const Message = message;

+ 1 - 1
src/routes/Product/Package/PackageCreate.js

@@ -4,7 +4,7 @@ import { connect } from 'dva';
 import { routerRedux } from 'dva/router';
 import { message, Form, Modal, Card, Button, Input, InputNumber, Table, Switch, Select, Radio } from 'antd';
 import { renderProductType, statusToBool, boolToStatus, addRowKey } from '../../../utils/utils';
-import Selector from '../../../components/RBTableSelector/Selector';
+import Selector from '../../../components/AXTableSelector/Selector';
 import FooterToolbar from '../../../components/FooterToolbar/index';
 import styles from './PackageCreate.less';
 

+ 1 - 1
src/routes/Product/Package/PackageList.js

@@ -3,7 +3,7 @@ import moment from 'moment';
 import { connect } from 'dva';
 import { routerRedux } from 'dva/router';
 import { Card, Modal, Button, message } from 'antd';
-import { StandardTableList } from '../../../components/RBList/index';
+import { StandardTableList } from '../../../components/AXList/index';
 import { renderStatus, addRowKey } from '../../../utils/utils';
 
 const Message = message;

+ 3 - 3
src/routes/Product/Support/SupportCreate.js

@@ -4,8 +4,8 @@ import { connect } from 'dva';
 import { routerRedux } from 'dva/router';
 import { Form, Modal, Card, Button, Input, Switch, Row, Col, Carousel, Select } from 'antd';
 import { renderStatus, statusToBool, boolToStatus, genAbsolutePicUrl } from '../../../utils/utils';
-import RBDragSortTable from '../../../components/RBDragSortTable/index';
-import Selector from '../../../components/RBTableSelector/Selector';
+import AXDragSortTable from '../../../components/AXDragSortTable/index';
+import Selector from '../../../components/AXTableSelector/Selector';
 import FooterToolbar from '../../../components/FooterToolbar/index';
 import styles from './SupportCreate.less';
 
@@ -482,7 +482,7 @@ export default class SupportCreatePage extends Component {
         </Card>
         {/* 相关周边配套选择Card */}
         <Card title={renderSupportCardName()} style={{marginBottom: 70}}>
-          <RBDragSortTable
+          <AXDragSortTable
             columns={supportColumns}
             data={supportList}
             onChange={(rows) => this.handleDragSortTableChange('support', rows)}

+ 1 - 1
src/routes/Product/Support/SupportList.js

@@ -3,7 +3,7 @@ import moment from 'moment';
 import { connect } from 'dva';
 import { routerRedux } from 'dva/router';
 import { Card, Modal, Button, message } from 'antd';
-import { StandardTableList } from '../../../components/RBList/index';
+import { StandardTableList } from '../../../components/AXList/index';
 import { renderStatus, addRowKey } from '../../../utils/utils';
 
 const Message = message;

+ 412 - 0
src/routes/Product/Training/TrainingCreate.js

@@ -0,0 +1,412 @@
+import React, { Component } from 'react';
+import moment from 'moment';
+import pathToRegexp from 'path-to-regexp';
+import { connect } from 'dva';
+import { routerRedux } from 'dva/router';
+import {
+  Form, Modal, Card, Button, Input, Switch, Row, Col, Carousel, Select, DatePicker } from 'antd';
+import { statusToBool, boolToStatus, genAbsolutePicUrl } from '../../../utils/utils';
+import Selector from '../../../components/AXTableSelector/Selector';
+import FooterToolbar from '../../../components/FooterToolbar/index';
+import styles from './TrainingCreate.less';
+
+const fieldLabels = {
+  code: '师训编号',
+  title: '师训主题',
+  dateDesc: '活动时间范围',
+  openTime: '活动开始时间',
+  closeTime: '活动结束时间',
+  merchant: '内容提供商',
+  coverUrl: '师训封面图',
+  imgList: '详情大图列表',
+  status: '状态',
+};
+const formItemLayout = {
+  labelCol: {
+    xs: { span: 24 },
+    sm: { span: 3 },
+  },
+  wrapperCol: {
+    xs: { span: 24 },
+    sm: { span: 14 },
+    md: { span: 12 },
+  },
+};
+
+@connect(({ loading, product, resource, merchant }) => ({
+  product,
+  resource,
+  merchant,
+  pLoading: loading.models.product,
+  rLoading: loading.models.resource,
+  submitting: loading.models.product,
+}))
+@Form.create()
+export default class TrainingCreatePage extends Component {
+  state = {
+    coverSelectorDestroy: true,
+    carouselSelectorDestroy: true,
+  };
+  componentWillMount() {
+    const match = pathToRegexp('/product/training/create').exec(this.props.location.pathname);
+    if (match) {
+      this.cleanPageState();
+    }
+  }
+  componentDidMount() {
+    const matchId = this.isEdit();
+    if (matchId) {
+      this.props.dispatch({
+        type: 'product/fetchProductItem',
+        payload: { pid: matchId },
+      });
+    }
+    this.props.dispatch({
+      type: 'merchant/fetchMerchantList',
+      payload: {pageSize: 1000}, // TODO 以后商户多了需要改写交互样式
+    });
+  }
+  isEdit = () => {
+    const { location } = this.props;
+    const match = pathToRegexp('/product/training/edit/:id').exec(location.pathname);
+    if (match) {
+      return match[1];
+    }
+    return false;
+  }
+  cleanPageState = () => {
+    this.props.dispatch({
+      type: 'product/cleanItemState',
+      payload: {},
+    });
+  }
+  selectorDataFetcher = (name, params) => {
+    switch (name) {
+      case 'cover':
+        this.props.dispatch({
+          type: 'resource/fetchImageList',
+          payload: params,
+        });
+        break;
+      case 'carousel':
+        this.props.dispatch({
+          type: 'resource/fetchImageList',
+          payload: params,
+        });
+        break;
+      default:
+        break;
+    }
+  }
+  currentItemFormatter = (name, rows) => {
+    let payload;
+    switch (name) {
+      case 'cover':
+        payload = { coverUrl: rows[0].path };
+        break;
+      case 'carousel':
+        payload = { imgList: rows.map(row => row.path) };
+        break;
+      default:
+        break;
+    }
+    return payload;
+  }
+  handleSelectorModalShow = (name) => {
+    this.setState({
+      [`${name}SelectorDestroy`]: false,
+    });
+    this.selectorDataFetcher(name);
+  }
+  handleSelectorChange = (name, params) => {
+    this.selectorDataFetcher(name, params);
+  }
+  handleSelectorFinish = (name, rows) => {
+    this.setState({
+      [`${name}SelectorDestroy`]: true,
+    });
+    const payload = this.currentItemFormatter(name, rows);
+    this.props.dispatch({
+      payload,
+      type: 'product/fixCurrentItem',
+    });
+  }
+  handleSelectorCancel = (name) => {
+    this.setState({
+      [`${name}SelectorDestroy`]: true,
+    });
+  }
+  handlePageBack = () => {
+    this.props.dispatch(routerRedux.push({
+      pathname: '/product/training',
+      state: this.props.location.state,
+    }));
+  }
+  handlePageSubmit = (e) => {
+    e.preventDefault();
+    this.props.form.validateFieldsAndScroll((err, values) => {
+      if (!err) {
+        // 从表单提取基础信息字段
+        const { status, title, openTime, closeTime, ...rest } = values;
+        const postData = {
+          title,
+          openTime: parseInt(moment(openTime).format('x'), 10),
+          closeTime: parseInt(moment(closeTime).format('x'), 10),
+          status: boolToStatus(status),
+          ...rest,
+        };
+
+        // 从props中提取coverUrl、imgList字段
+        const { product } = this.props;
+        const { currentItem } = product;
+        const { imgList, coverUrl } = currentItem;
+
+        // 更新或者创建操作
+        const matchId = this.isEdit();
+        if (matchId) {
+          const params = {
+            imgList,
+            coverUrl,
+            id: matchId,
+            ...postData,
+          };
+          this.props.dispatch({
+            type: 'product/updateTrainingItem',
+            payload: params,
+            states: this.props.location.state,
+          });
+        } else {
+          const params = {
+            imgList,
+            coverUrl,
+            ...postData,
+          };
+          this.props.dispatch({
+            type: 'product/createTrainingItem',
+            payload: params,
+            states: this.props.location.state,
+          });
+        }
+      }
+    });
+  }
+
+  render() {
+    const { form, submitting, rLoading, product, resource, merchant } = this.props;
+    const { coverSelectorDestroy, carouselSelectorDestroy } = this.state;
+    const { currentItem } = product;
+    const {
+      code, title, dateDesc, openTime, closeTime, status, coverUrl, cpId, imgList = [],
+    } = currentItem;
+    const { getFieldDecorator } = form;
+
+
+    const getMerchants = () => {
+      const { list } = merchant;
+      const options = list.map(item => ({
+        text: item.name,
+        key: item.id,
+      }));
+      return options;
+    }
+
+    const getResourceModal = (isCover) => {
+      return (
+        <Modal
+          visible
+          title="图片资源"
+          width={isCover ? 900 : 1100}
+          footer={null}
+          maskClosable={false}
+          onCancel={() => this.handleSelectorCancel(isCover ? 'cover' : 'carousel')}
+        >
+          <Selector
+            loading={rLoading}
+            list={resource.list}
+            pageNo={resource.pageNo}
+            pageSize={resource.pageSize}
+            totalSize={resource.totalSize}
+            multiple={isCover ? false : true}
+            selectorName={isCover ? 'PictureSingle' : 'Picture'}
+            onCancel={() => this.handleSelectorCancel(isCover ? 'cover' : 'carousel')}
+            onChange={(data) => this.handleSelectorChange(isCover ? 'cover' : 'carousel', data)}
+            onFinish={(rows) => this.handleSelectorFinish(isCover ? 'cover' : 'carousel', rows)}
+          />
+        </Modal>
+      );
+    }
+    const renderCoverCardName = () => {
+      return (
+        <div className={styles.cardName}>
+          <span>
+            <a onClick={() => this.handleSelectorModalShow('cover')}>师训封面</a>
+          </span>
+        </div>
+      );
+    }
+    const renderCarouselCardName = () => {
+      return (
+        <div className={styles.cardName}>
+          <span>
+            <a onClick={() => this.handleSelectorModalShow('carousel')}>详情大图</a>
+          </span>
+        </div>
+      );
+    }
+    return (
+      <div>
+        {/* 基础信息Card */}
+        <Card title="基础信息" style={{ marginBottom: 16 }}>
+          <Form>
+            <Form.Item hasFeedback label={fieldLabels.code} {...formItemLayout}>
+              {getFieldDecorator('code', {
+                rules: [
+                  {
+                    required: true, message: '请填写师训编号',
+                  }, {
+                    pattern: /^[a-zA-Z0-9|-]+$/g, message: '编号包含非法字符',
+                  },
+                ],
+                initialValue: code,
+              })(
+                <Input
+                  placeholder="请输入"
+                  disabled={this.isEdit() ? true : false}
+                />
+              )}
+            </Form.Item>
+            <Form.Item hasFeedback label={fieldLabels.title} {...formItemLayout}>
+              {getFieldDecorator('title', {
+                rules: [{ required: true, message: '请填写师训主题' }],
+                initialValue: title,
+              })(
+                <Input placeholder="请输入" />
+              )}
+            </Form.Item>
+            <Form.Item hasFeedback label={fieldLabels.dateDesc} {...formItemLayout}>
+              {getFieldDecorator('dateDesc', {
+                rules: [{ required: true, message: '请填写师训活动时间范围' }],
+                initialValue: dateDesc,
+              })(
+                <Input placeholder="请输入" />
+              )}
+            </Form.Item>
+            <Form.Item hasFeedback label={fieldLabels.openTime} {...formItemLayout}>
+              {getFieldDecorator('openTime', {
+                rules: [{ required: true, message: '请选择开始时间' }],
+                initialValue: openTime && moment(openTime),
+              })(
+                <DatePicker
+                  showTime
+                  placeholder="选择开始时间"
+                  format="YYYY-MM-DD HH:mm:ss"
+                  style={{ width: '100%' }}
+                />
+              )}
+            </Form.Item>
+            <Form.Item hasFeedback label={fieldLabels.closeTime} {...formItemLayout}>
+              {getFieldDecorator('closeTime', {
+                rules: [{ required: true, message: '请选择结束时间' }],
+                initialValue: closeTime && moment(closeTime),
+              })(
+                <DatePicker
+                  showTime
+                  placeholder="选择结束时间"
+                  format="YYYY-MM-DD HH:mm:ss"
+                  style={{ width: '100%' }}
+                />
+              )}
+            </Form.Item>
+            <Form.Item hasFeedback label={fieldLabels.merchant} {...formItemLayout}>
+              {getFieldDecorator('cpId', {
+                rules: [{ required: true, message: '请选择供应商' }],
+                initialValue: cpId,
+              })(
+                <Select placeholder="请选择">
+                  {
+                    getMerchants().map(item => (
+                      <Select.Option key={item.key} value={item.key}>
+                        {item.text}
+                      </Select.Option>
+                    ))
+                  }
+                </Select>
+              )}
+            </Form.Item>
+            <Form.Item label={fieldLabels.status} {...formItemLayout}>
+              {getFieldDecorator('status', {
+                valuePropName: 'checked',
+                initialValue: statusToBool(status),
+              })(
+                <Switch
+                  checkedChildren="正常"
+                  unCheckedChildren="删除"
+                />
+              )}
+            </Form.Item>
+          </Form>
+        </Card>
+        {/* 封面及走马灯选择Card */}
+        <Card title="封面 | 图册" style={{ marginBottom: 70 }}>
+          <Row gutter={16}>
+            <Col
+              md={{ span: 12, offset: 1 }}
+              lg={{ span: 8, offset: 2 }}
+              xl={{ span: 8, offset: 2 }}
+              xxl={{ span: 6, offset: 5 }}
+            >
+              <Card
+                hoverable
+                title={renderCoverCardName()}
+              >
+                <div className={styles.cover}>
+                  {coverUrl && (
+                    <img src={genAbsolutePicUrl(coverUrl)} alt="" />
+                  )}
+                </div>
+                {!coverSelectorDestroy && getResourceModal(true)}
+              </Card>
+            </Col>
+            <Col
+              md={{ span: 10, offset: 2 }}
+              lg={{ span: 8, offset: 4 }}
+              xl={{ span: 6, offset: 4 }}
+              xxl={{ span: 4, offset: 5 }}
+            >
+              <Card
+                hoverable
+                title={renderCarouselCardName()}
+              >
+                <div className={styles.carousel}>
+                  <Carousel autoplay>
+                    {
+                      imgList.map(
+                        path => (
+                          <img key={path} src={genAbsolutePicUrl(path)} alt="" />
+                        )
+                      )
+                    }
+                  </Carousel>
+                </div>
+                {!carouselSelectorDestroy && getResourceModal(false)}
+              </Card>
+            </Col>
+          </Row>
+        </Card>
+        <FooterToolbar style={{ width: '100%' }}>
+          <Button
+            onClick={this.handlePageBack}
+            style={{ marginRight: 10 }}
+          >取消
+          </Button>
+          <Button
+            type="primary"
+            loading={submitting}
+            onClick={this.handlePageSubmit}
+          >提交
+          </Button>
+        </FooterToolbar>
+      </div>
+    );
+  }
+}

+ 33 - 0
src/routes/Product/Training/TrainingCreate.less

@@ -0,0 +1,33 @@
+@import "../../../../node_modules/antd/lib/style/themes/default.less";
+
+.cardName {
+  & > span {
+    display: inline-block;
+    height: 24px;
+    padding: 0 7px;
+    vertical-align: bottom;
+  }
+  :global {
+    .ant-btn-primary {
+      margin-left: 10px;
+    }
+  }
+}
+
+.cover {
+  width: 100%;
+  height: 200px;
+  img {
+    width: 100%;
+    height: 100%;
+  }
+}
+
+.carousel {
+  width: 100%;
+  height: 200px;
+  img {
+    width: 100%;
+    height: 100%;
+  }
+}

+ 165 - 0
src/routes/Product/Training/TrainingList.js

@@ -0,0 +1,165 @@
+import React, { Component } from 'react';
+import moment from 'moment';
+import { connect } from 'dva';
+import { routerRedux } from 'dva/router';
+import { Card, Modal, Button, message } from 'antd';
+import { StandardTableList } from '../../../components/AXList';
+import { renderStatus, addRowKey } from '../../../utils/utils';
+
+const Message = message;
+
+@connect(({ loading, product }) => ({
+  product,
+  loading: loading.models.product,
+}))
+export default class TrainingListPage extends Component {
+  constructor(props) {
+    super(props);
+    const { state } = props.location;
+    this.state = {
+      UIParams: (state || {}).UIParams, // 组件的状态参数
+      Queryers: (state || {}).Queryers, // 查询的条件参数
+    };
+  }
+  componentDidMount() {
+    this.props.dispatch({
+      type: 'product/fetchTrainingList',
+      payload: { ...this.state.Queryers },
+    });
+  }
+  handleCreateOperation = () => {
+    this.props.dispatch(routerRedux.push({
+      pathname: '/product/training/create',
+      state: this.state,
+    }));
+  }
+  handleDeleteOperation = (item) => {
+    Modal.confirm({
+      okText: '确定',
+      cancelText: '取消',
+      title: '你确定要删除该师训吗?',
+      onOk: () => {
+        this.props.dispatch({
+          type: 'product/deleteTrainingItem',
+          payload: { id: item.id },
+          states: this.state,
+        });
+      },
+    });
+  }
+  handleEditOperation = (item) => {
+    this.props.dispatch(routerRedux.push({
+      pathname: `/product/training/edit/${item.pid}`,
+      state: this.state,
+    }));
+  }
+  handleFilterOperation = (params, states) => {
+    this.props.dispatch({
+      type: 'product/fetchTrainingList',
+      payload: params,
+    });
+    this.setState({
+      UIParams: states,
+      Queryers: params,
+    });
+  }
+  handleBatchOperation = () => {
+    Message.info('暂不支持批量操作!');
+  }
+
+  render() {
+    const { loading, product } = this.props;
+    const { list, totalSize, pageSize, pageNo } = product;
+
+    const renderOperation = (item) => {
+      return (
+        <div>
+          <Button
+            size="small"
+            className="editBtn"
+            onClick={() => this.handleEditOperation(item)}
+          >编辑
+          </Button>
+          <Button
+            size="small"
+            className="delBtn"
+            onClick={() => this.handleDeleteOperation(item)}
+          >删除
+          </Button>
+        </div>
+      );
+    };
+
+    const batchActions = [{
+      key: 'delete',
+      name: '批量删除',
+    }, {
+      key: 'recovery',
+      name: '批量恢复',
+    }];
+    const basicSearch = {
+      keys: [{
+        name: '师训编号',
+        field: 'code',
+      }, {
+        name: '师训名称',
+        field: 'name',
+      }],
+    };
+    const pagination = {
+      pageNo,
+      pageSize,
+      totalSize,
+    };
+    const columns = [{
+      title: '师训编号',
+      key: 1,
+      dataIndex: 'code',
+      width: '20%',
+    }, {
+      title: '师训主题',
+      key: 2,
+      dataIndex: 'name',
+      width: '35%',
+    }, {
+      title: '状态',
+      key: 3,
+      dataIndex: 'status',
+      render: text => renderStatus(text),
+      width: '12%',
+    }, {
+      title: '更新时间',
+      key: 4,
+      dataIndex: 'gmtModified',
+      render: text => moment(text).format('YYYY-MM-DD HH:mm:ss'),
+      width: '20%',
+    }, {
+      title: '操作',
+      key: 5,
+      dataIndex: 'operation',
+      render: (_, record) => renderOperation(record),
+      width: '13%',
+      align: 'right',
+    }];
+    return (
+      <Card>
+        <StandardTableList
+          columns={columns}
+          loading={loading}
+          dataSource={addRowKey(list)}
+          header={{
+            basicSearch,
+            onFilterClick: this.handleFilterOperation,
+            onCreateClick: this.handleCreateOperation,
+          }}
+          footer={{
+            pagination,
+            batchActions,
+            onBatchClick: this.handleBatchOperation,
+          }}
+          keepUIState={{ ...this.state.UIParams }}
+        />
+      </Card>
+    );
+  }
+}

+ 33 - 0
src/routes/Product/Training/index.js

@@ -0,0 +1,33 @@
+import React, { Component } from 'react';
+import { Redirect, Route, Switch } from 'dva/router';
+import { connect } from 'dva';
+import PageHeaderLayout from '../../../layouts/PageHeaderLayout';
+import { getRoutes } from '../../../utils/utils';
+
+@connect()
+export default class Training extends Component {
+  render() {
+    const { match, routerData } = this.props;
+    const routes = getRoutes(match.path, routerData);
+
+    return (
+      <PageHeaderLayout>
+        <Switch>
+          {
+            routes.map(item =>
+              (
+                <Route
+                  key={item.key}
+                  path={item.path}
+                  component={item.component}
+                  exact={item.exact}
+                />
+              )
+            )
+          }
+          <Redirect exact from="/product/training" to="/product/training/list" />
+        </Switch>
+      </PageHeaderLayout>
+    );
+  }
+}

+ 3 - 14
src/routes/Resource/Picture/PictureCardList.js

@@ -1,17 +1,6 @@
 import React from 'react';
-import { PictureItem } from '../../../components/RBItem';
-import { StandardCardList } from '../../../components/RBList';
-
-function pictureItemFormatter(originData) {
-  return originData.map((item) => {
-    return {
-      id: item.id,
-      picPath: item.path,
-      picCode: item.code,
-      picStatus: item.state,
-    };
-  });
-}
+import { PictureItem } from '../../../components/AXItem';
+import { StandardCardList } from '../../../components/AXList';
 
 function PictureCardList({
   UIParams, dataSource, loading, totalSize, pageSize, pageNo,
@@ -43,7 +32,7 @@ function PictureCardList({
       loading={loading}
       component={PictureItem}
       keepUIState={{ ...UIParams }}
-      dataSource={pictureItemFormatter(dataSource)}
+      dataSource={dataSource}
       header={{ basicSearch, onFilterClick, onCreateClick }}
       footer={{ pagination, batchActions, onBatchClick }}
       grid={{ gutter: 16, xxl: 12, xl: 6, lg: 4, md: 3, sm: 2, xs: 1 }}

+ 9 - 8
src/routes/Resource/Picture/PictureEdit.js

@@ -2,7 +2,7 @@ import React, { PureComponent } from 'react';
 import { Card, Form, Input, Button, Switch } from 'antd';
 import { connect } from 'dva';
 import { routerRedux } from 'dva/router';
-import Uploader from '../../../components/RBUpload';
+import Uploader from '../../../components/AXUpload';
 import PageHeaderLayout from '../../../layouts/PageHeaderLayout';
 import { boolToStatus, statusToBool } from '../../../utils/utils';
 
@@ -14,13 +14,13 @@ const formItemLayout = {
   wrapperCol: {
     xs: { span: 24 },
     sm: { span: 14 },
-    md: { span: 10 },
+    md: { span: 12 },
   },
 };
 const submitFormLayout = {
   wrapperCol: {
     xs: { span: 24, offset: 0 },
-    sm: { span: 10, offset: 6 },
+    sm: { span: 12, offset: 6 },
   },
 };
 
@@ -47,11 +47,11 @@ export default class PictureSingleUpload extends PureComponent {
   }
   handleNameInputChange = (e) => {
     this.setState({ name: e.target.value });
-  }
+  };
   handleOnChangeEvent = (fileList) => {
     this.setState({ fileList });
     return fileList;
-  }
+  };
   handlePageBack = () => {
     const { UIParams, Queryers } = this.props.location.state || {};
     this.props.dispatch(
@@ -60,7 +60,7 @@ export default class PictureSingleUpload extends PureComponent {
         state: { UIParams, Queryers },
       })
     );
-  }
+  };
   handlePageSubmit = (e) => {
     e.preventDefault();
     this.props.form.validateFieldsAndScroll((err, values) => {
@@ -80,7 +80,7 @@ export default class PictureSingleUpload extends PureComponent {
         });
       }
     });
-  }
+  };
   render() {
     const { form, submitting } = this.props;
     const { getFieldDecorator } = form;
@@ -94,9 +94,10 @@ export default class PictureSingleUpload extends PureComponent {
           <Form onSubmit={this.handlePageSubmit}>
             <Form.Item label="图片编号" {...formItemLayout}>
               {getFieldDecorator('code', {
+                rules: [{ required: true, message: '图片编号不能为空' }],
                 initialValue: code,
               })(
-                <Input disabled />
+                <Input />
               )}
             </Form.Item>
             <Form.Item label="图片名称" {...formItemLayout}>

+ 14 - 12
src/routes/Resource/Picture/PictureList.js

@@ -19,7 +19,7 @@ export default class PictureListPage extends Component {
     this.state = {
       UIParams: (state || {}).UIParams, // 组件的状态参数
       Queryers: (state || {}).Queryers, // 查询的条件参数
-      isCard: true,
+      isCard: false,
     };
   }
   componentDidMount() {
@@ -30,8 +30,8 @@ export default class PictureListPage extends Component {
   }
   handleShowTypeChange = () => {
     this.setState({ isCard: !this.state.isCard });
-  }
-  // 增加
+  };
+  // 创建图片(增)
   handleCreateOperation = () => {
     this.props.dispatch(
       routerRedux.push({
@@ -39,8 +39,8 @@ export default class PictureListPage extends Component {
         state: this.state,
       })
     );
-  }
-  // 删除
+  };
+  // 删除图片(删)
   handleDeleteOperation = (item) => {
     Modal.confirm({
       okText: '确定',
@@ -53,8 +53,8 @@ export default class PictureListPage extends Component {
         });
       },
     });
-  }
-  // 修改
+  };
+  // 修改图片(改)
   handleEditOperation = (data) => {
     this.props.dispatch(
       routerRedux.push({
@@ -65,8 +65,8 @@ export default class PictureListPage extends Component {
         },
       })
     );
-  }
-  // 查询
+  };
+  // 查询图片(查)
   handleFilterOperation = (params, states) => {
     this.props.dispatch({
       type: 'resource/fetchImageList',
@@ -76,13 +76,14 @@ export default class PictureListPage extends Component {
       UIParams: states,
       Queryers: params,
     });
-  }
-  // 批量
+  };
+  // TODO: 批量操作
   handleBatchOperation = () => {
     Message.info('暂不支持批量操作!');
-  }
+  };
 
   render() {
+    const { UIParams } = this.state;
     const { resource, loading } = this.props;
     const { list, totalSize, pageSize, pageNo } = resource;
     const publicProps = {
@@ -90,6 +91,7 @@ export default class PictureListPage extends Component {
       pageNo,
       pageSize,
       totalSize,
+      UIParams,
       dataSource: list,
       onCreateClick: this.handleCreateOperation,
       onDeleteClick: this.handleDeleteOperation,

+ 1 - 1
src/routes/Resource/Picture/PictureMultipleUpload.js

@@ -2,7 +2,7 @@ import React, { PureComponent } from 'react';
 import { connect } from 'dva';
 import { routerRedux } from 'dva/router';
 import { Input, Button, message } from 'antd';
-import Uploader from '../../../components/RBUpload/index';
+import Uploader from '../../../components/AXUpload/index';
 import styles from './PictureMultipleUpload.less';
 
 const Message = message;

+ 10 - 10
src/routes/Resource/Picture/PictureSingleUpload.js

@@ -2,9 +2,9 @@ import React, { PureComponent, Fragment } from 'react';
 import { Form, Input, Button, Switch, Alert } from 'antd';
 import { connect } from 'dva';
 import { routerRedux } from 'dva/router';
-import Uploader from '../../../components/RBUpload';
+import Uploader from '../../../components/AXUpload';
 import { boolToStatus } from '../../../utils/utils';
-import { RESOURCE_IMAGE } from '../../../utils/config';
+import { Hotax } from '../../../utils/config';
 
 const formItemLayout = {
   labelCol: {
@@ -14,13 +14,13 @@ const formItemLayout = {
   wrapperCol: {
     xs: { span: 24 },
     sm: { span: 14 },
-    md: { span: 10 },
+    md: { span: 12 },
   },
 };
 const submitFormLayout = {
   wrapperCol: {
     xs: { span: 24, offset: 0 },
-    sm: { span: 10, offset: 6 },
+    sm: { span: 12, offset: 6 },
   },
 };
 
@@ -36,14 +36,14 @@ export default class PictureSingleUpload extends PureComponent {
   };
   handleCodeInputChange = (e) => {
     this.setState({ code: e.target.value });
-  }
+  };
   handleNameInputChange = (e) => {
     this.setState({ name: e.target.value });
-  }
+  };
   handleOnChangeEvent = (fileList) => {
     this.setState({ fileList });
     return fileList;
-  }
+  };
   handlePageBack = () => {
     const { UIParams, Queryers } = this.props.location.state || {};
     this.props.dispatch(
@@ -55,7 +55,7 @@ export default class PictureSingleUpload extends PureComponent {
         },
       })
     );
-  }
+  };
   handlePageSubmit = (e) => {
     e.preventDefault();
     this.props.form.validateFieldsAndScroll((err, values) => {
@@ -65,14 +65,14 @@ export default class PictureSingleUpload extends PureComponent {
           params.url = fileList[0].url;
         }
         params.status = boolToStatus(status);
-        params.type = RESOURCE_IMAGE;
+        params.type = Hotax.RESOURCE_IMAGE;
         this.props.dispatch({
           type: 'resource/createImage',
           payload: params,
         });
       }
     });
-  }
+  };
   render() {
     const { form, submitting } = this.props;
     const { getFieldDecorator } = form;

+ 7 - 8
src/routes/Resource/Picture/PictureTableList.js

@@ -1,9 +1,8 @@
 import React from 'react';
 import moment from 'moment';
 import { Button } from 'antd';
-import { ossHost } from '../../../utils/config';
-import { renderStatus, addRowKey } from '../../../utils/utils';
-import { StandardTableList } from '../../../components/RBList/index';
+import { renderStatus, addRowKey, genAbsolutePicUrl } from '../../../utils/utils';
+import { StandardTableList } from '../../../components/AXList';
 import styles from './PictureTableList.less';
 
 function PictureTableList({
@@ -52,13 +51,13 @@ function PictureTableList({
         <Button
           size="small"
           type="primary"
-          className={styles.editBtn}
+          className="editBtn"
           onClick={() => onEditClick(item)}
         >编辑
         </Button>
         <Button
           size="small"
-          className={styles.delBtn}
+          className="delBtn"
           onClick={() => onDeleteClick(item)}
         >删除
         </Button>
@@ -69,14 +68,14 @@ function PictureTableList({
     title: '缩略图',
     key: 1,
     dataIndex: 'path',
-    render: text => renderThumbPic(`${ossHost}/${text}`),
+    render: text => renderThumbPic(genAbsolutePicUrl(text)),
     width: '15%',
   }, {
     title: '名称/编号',
     key: 2,
     dataIndex: 'meta',
     render: (_, record) => renderMetaData(record),
-    width: '25%',
+    width: '27%',
   }, {
     title: '格式',
     key: 3,
@@ -104,7 +103,7 @@ function PictureTableList({
     key: 7,
     dataIndex: 'action',
     render: (_, record) => renderActions(record),
-    width: '15%',
+    width: '13%',
     align: 'right',
   }];
 

+ 148 - 0
src/routes/Resource/Video/VideoEdit.js

@@ -0,0 +1,148 @@
+import React, { PureComponent } from 'react';
+import { Card, Form, Select, Input, Button, Switch } from 'antd';
+import { connect } from 'dva';
+import { routerRedux } from 'dva/router';
+import PageHeaderLayout from '../../../layouts/PageHeaderLayout';
+import { boolToStatus, statusToBool } from '../../../utils/utils';
+
+const formItemLayout = {
+  labelCol: {
+    xs: { span: 24 },
+    sm: { span: 6 },
+  },
+  wrapperCol: {
+    xs: { span: 24 },
+    sm: { span: 14 },
+    md: { span: 12 },
+  },
+};
+const submitFormLayout = {
+  wrapperCol: {
+    xs: { span: 24, offset: 0 },
+    sm: { span: 12, offset: 6 },
+  },
+};
+
+@Form.create()
+@connect(({ loading }) => ({
+  submitting: loading.models.resource,
+}))
+export default class VideoEditPage extends PureComponent {
+  handlePageBack = () => {
+    const { UIParams, Queryers } = this.props.location.state || {};
+    this.props.dispatch(
+      routerRedux.push({
+        pathname: '/resource/video',
+        state: { UIParams, Queryers },
+      })
+    );
+  };
+  handlePageSubmit = (e) => {
+    e.preventDefault();
+    this.props.form.validateFieldsAndScroll((err, values) => {
+      if (!err) {
+        const { id, type, UIParams, Queryers } = this.props.location.state || {};
+        const { fileList, status, ...params } = values;
+        if (Array.isArray(fileList) && fileList.length) {
+          params.url = fileList[0].url;
+        }
+        params.id = id;
+        params.type = type;
+        params.status = boolToStatus(status);
+        this.props.dispatch({
+          type: 'resource/updateVideo',
+          payload: params,
+          states: { UIParams, Queryers },
+        });
+      }
+    });
+  };
+  render() {
+    const { form, submitting, location } = this.props;
+    const { getFieldDecorator } = form;
+    const { state = {} } = location;
+    const { code, name, size, type, path, rate, quality, status } = state;
+
+    return (
+      <PageHeaderLayout>
+        <Card>
+          <Form onSubmit={this.handlePageSubmit}>
+            <Form.Item label="视频编号" {...formItemLayout}>
+              {getFieldDecorator('code', {
+                rules: [{ required: true, message: '视频编号不能为空' }],
+                initialValue: code,
+              })(
+                <Input />
+              )}
+            </Form.Item>
+            <Form.Item label="视频名称" {...formItemLayout}>
+              {getFieldDecorator('name', {
+                rules: [{ required: true, message: '视频名称不能为空' }],
+                initialValue: name,
+              })(
+                <Input />
+              )}
+            </Form.Item>
+            <Form.Item label="资源类型" {...formItemLayout}>
+              {getFieldDecorator('type', {
+                rules: [{ required: true, message: '资源类型不能为空' }],
+                initialValue: type,
+              })(
+                <Input />
+              )}
+            </Form.Item>
+            <Form.Item label="资源路径" {...formItemLayout}>
+              {getFieldDecorator('path', {
+                initialValue: path,
+              })(
+                <Input />
+              )}
+            </Form.Item>
+            <Form.Item label="清晰度" {...formItemLayout}>
+              {getFieldDecorator('quality', {
+                initialValue: quality,
+              })(
+                <Input />
+              )}
+            </Form.Item>
+            <Form.Item label="资源码流" {...formItemLayout}>
+              {getFieldDecorator('rate', {
+                initialValue: rate,
+              })(
+                <Input />
+              )}
+            </Form.Item>
+            <Form.Item label="资源大小" {...formItemLayout}>
+              {getFieldDecorator('size', {
+                initialValue: size,
+              })(
+                <Input />
+              )}
+            </Form.Item>
+            <Form.Item label="资源状态" {...formItemLayout}>
+              {getFieldDecorator('status', {
+                valuePropName: 'checked',
+                initialValue: statusToBool(status),
+              })(
+                <Switch
+                  checkedChildren="正常"
+                  unCheckedChildren="删除"
+                />
+              )}
+            </Form.Item>
+            <Form.Item {...submitFormLayout} style={{ marginTop: 32 }}>
+              <Button onClick={this.handlePageBack}>取消</Button>
+              <Button
+                type="primary"
+                htmlType="submit"
+                loading={submitting}
+                style={{ marginLeft: 8 }}
+              >提交
+              </Button>
+            </Form.Item>
+          </Form>
+        </Card>
+      </PageHeaderLayout>
+    );
+  }
+}

+ 24 - 10
src/routes/Resource/Video/VideoList.js

@@ -30,7 +30,7 @@ export default class VideoListPage extends Component {
   constructor(props) {
     super(props);
     this.state = {
-      isCard: true,
+      isCard: false,
       destroy: true,
       current: {},
     };
@@ -43,23 +43,34 @@ export default class VideoListPage extends Component {
   }
   handleShowTypeChange = () => {
     this.setState({ isCard: !this.state.isCard });
-  }
+  };
+  handleModalDestroy = () => {
+    this.setState({ destroy: true });
+  };
+  handleModalCreate = (item) => {
+    this.setState({ destroy: false, current: item });
+  };
+  // 创建视频(增)
+  handleCreateOperation = () => {
+  };
+  // 删除视频(删)
+  handleDeleteOperation = () => {
+  };
+  // 修改视频(改)
+  handleUpdateOperation = () => {
+  };
+  // 查询视频(查)
   handleFilterOperation = (params) => {
     const newParams = deleteBlankKey(params);
     this.props.dispatch({
       type: 'resource/fetchVideoList',
       payload: newParams,
     });
-  }
+  };
+  // TODO: 批量操作
   handleBatchOperation = () => {
     Message.info('暂不支持批量操作!');
-  }
-  handleModalDestroy = () => {
-    this.setState({ destroy: true });
-  }
-  handleModalCreate = (item) => {
-    this.setState({ destroy: false, current: item });
-  }
+  };
 
   render() {
     const { loading, resource } = this.props;
@@ -70,6 +81,9 @@ export default class VideoListPage extends Component {
       pageSize,
       totalSize,
       dataSource: addRowKey(list),
+      onCreateClick: this.handleCreateOperation,
+      onDeleteClick: this.handleDeleteOperation,
+      onUpdateClick: this.handleUpdateOperation,
       onFilterClick: this.handleFilterOperation,
     };
     return (

+ 2 - 2
src/routes/Resource/Video/VideoPlayList.js

@@ -1,7 +1,7 @@
 import React, { PureComponent } from 'react';
 import moment from 'moment';
 import { Table, Pagination, Select, Input } from 'antd';
-import RBVideoPlayer from '../../../components/RBVideoPlayer/index';
+import AXVideoPlayer from '../../../components/AXVideoPlayer/index';
 import styles from './VideoPlayList.less';
 
 export default class VideoPlayList extends PureComponent {
@@ -89,7 +89,7 @@ export default class VideoPlayList extends PureComponent {
       if (dataSource.length) {
         const videoItem = dataSource[this.state.currentPlayingIndex];
         return (
-          <RBVideoPlayer
+          <AXVideoPlayer
             width="100%"
             height="100%"
             url={videoItem.url}

+ 13 - 7
src/routes/Resource/Video/VideoTableList.js

@@ -1,13 +1,15 @@
 import React from 'react';
 import moment from 'moment';
 import { Modal } from 'antd';
-import { StandardTableList } from '../../../components/RBList/index';
-import RBVideoPlayer from '../../../components/RBVideoPlayer/index';
+import { StandardTableList } from '../../../components/AXList';
+import AXVideoPlayer from '../../../components/AXVideoPlayer';
+import Ellipsis from '../../../components/Ellipsis';
 import { renderStatus, renderVideoQuality } from '../../../utils/utils';
 
 function VideoTableList({
   dataSource, loading, totalSize, pageSize, pageNo, modalDestroy, currentItem,
-  onFilterClick, onBatchClick, onModalCreate, onModalDestroy,
+  onCreateClick, onDeleteClick, onUpdateClick, onFilterClick, onBatchClick,
+  onModalCreate, onModalDestroy,
 }) {
   const pagination = {
     pageNo,
@@ -34,12 +36,15 @@ function VideoTableList({
     title: '视频编号',
     key: 1,
     dataIndex: 'code',
-    width: '15%',
+    width: '17%',
   }, {
     title: '视频名称',
     key: 2,
     dataIndex: 'name',
-    width: '32%',
+    width: '30%',
+    render: text => (
+      <Ellipsis tooltip lines={1}>{text}</Ellipsis>
+    ),
   }, {
     title: '视频格式',
     key: 3,
@@ -69,6 +74,7 @@ function VideoTableList({
     dataIndex: 'operation',
     render: (_, record) => <a onClick={() => onModalCreate(record)}>播放</a>,
     width: '8%',
+    align: 'right',
   }];
   return (
     <div>
@@ -76,7 +82,7 @@ function VideoTableList({
         columns={columns}
         loading={loading}
         dataSource={dataSource}
-        header={{ basicSearch, onFilterClick }}
+        header={{ basicSearch, onFilterClick, onCreateClick }}
         footer={{ pagination, batchActions, onBatchClick }}
       />
       {!modalDestroy && (
@@ -88,7 +94,7 @@ function VideoTableList({
         maskClosable={false}
         width={800}
       >
-        <RBVideoPlayer
+        <AXVideoPlayer
           width="100%"
           height="100%"
           url={currentItem.url}

+ 3 - 3
src/routes/Shelves/Course/CourseCreate.js

@@ -2,9 +2,9 @@ import React, { Component } from 'react';
 import { connect } from 'dva';
 import { routerRedux } from 'dva/router';
 import { message, Modal, Table, Card, Button } from 'antd';
-import Selector from '../../../components/RBTableSelector/Selector';
+import Selector from '../../../components/AXTableSelector/Selector';
 import FooterToolbar from '../../../components/FooterToolbar';
-import { STATUS_NORMAL } from '../../../utils/config';
+import { Hotax } from '../../../utils/config';
 import { renderCategory, statusCodeToName } from '../../../utils/utils';
 import styles from './CourseCreate.less';
 
@@ -104,7 +104,7 @@ export default class CourseCreatePage extends Component {
       payload: {
         pid,
         merchantId: id,
-        status: STATUS_NORMAL,
+        status: Hotax.STATUS_NORMAL,
       },
       states: {
         itemType: 'course',

+ 13 - 13
src/routes/Shelves/Course/CourseEdit.js

@@ -4,9 +4,9 @@ import { connect } from 'dva';
 import { routerRedux } from 'dva/router';
 import TableForm from './TableForm';
 import FooterToolbar from '../../../components/FooterToolbar';
-import Selector from '../../../components/RBTableSelector/Selector';
+import Selector from '../../../components/AXTableSelector/Selector';
 import { addRowKey } from '../../../utils/utils';
-import { PRODUCT_COURSE, STATUS_NORMAL } from '../../../utils/config';
+import { Hotax } from '../../../utils/config';
 
 @connect(({ loading, shelves, tag }) => ({
   tag,
@@ -45,15 +45,15 @@ export default class CourseEdit extends Component {
       payload: {
         ...data,
         ...this.state,
-        productType: PRODUCT_COURSE,
-        status: STATUS_NORMAL,
+        productType: Hotax.PRODUCT_COURSE,
+        status: Hotax.STATUS_NORMAL,
       },
       states: {
         pid,
         merchantId,
       },
     });
-  }
+  };
   handleGoodsUpdate=(data) => {
     const { pid, merchantId } = this.state;
     this.props.dispatch({
@@ -67,7 +67,7 @@ export default class CourseEdit extends Component {
         merchantId,
       },
     });
-  }
+  };
   handleGoodsDelete=(data) => {
     const { pid, merchantId } = this.state;
     this.props.dispatch({
@@ -78,7 +78,7 @@ export default class CourseEdit extends Component {
         merchantId,
       },
     });
-  }
+  };
   handleTagClose=(index) => {
     const { pid, merchantId } = this.state;
     const { shelves } = this.props;
@@ -98,7 +98,7 @@ export default class CourseEdit extends Component {
         merchantId,
       },
     });
-  }
+  };
   handleTagSelectorModalShow = () => {
     this.setState({
       tagSelectorDestroy: false,
@@ -108,19 +108,19 @@ export default class CourseEdit extends Component {
       type: 'tag/fetchTagList',
       payload: { merchantId },
     });
-  }
+  };
   handleTagSelectorCancel = () => {
     this.setState({
       tagSelectorDestroy: true,
     });
-  }
+  };
   handleTagSelectorChange = (params) => {
     const { merchantId } = this.state;
     this.props.dispatch({
       type: 'tag/fetchTagList',
       payload: { merchantId, ...params },
     });
-  }
+  };
   handleTagSelectorFinish = (rows) => {
     const { pid, merchantId } = this.state;
     const newTagIds = (rows || []).map(row => row.id);
@@ -139,13 +139,13 @@ export default class CourseEdit extends Component {
     this.setState({
       tagSelectorDestroy: true,
     });
-  }
+  };
   handlePageBack=() => {
     this.props.dispatch(routerRedux.push({
       pathname: '/shelves/course',
       state: this.props.location.state,
     }));
-  }
+  };
   render() {
     const { tagSelectorDestroy } = this.state;
     const { submitting, tLoading, shelves, tag, form } = this.props;

+ 1 - 1
src/routes/Shelves/Course/CourseList.js

@@ -3,7 +3,7 @@ import moment from 'moment';
 import { connect } from 'dva';
 import { routerRedux } from 'dva/router';
 import { Card, Modal, Button, message } from 'antd';
-import { StandardTableList } from '../../../components/RBList';
+import { StandardTableList } from '../../../components/AXList';
 import Ellipsis from '../../../components/Ellipsis';
 import { renderStatus, addRowKey } from '../../../utils/utils';
 

+ 16 - 23
src/routes/Shelves/Course/TableForm.js

@@ -8,35 +8,28 @@ import {
   Divider,
   message,
 } from 'antd';
-import {
-  CHARGE_UNIT_YEAR,
-  CHARGE_UNIT_SEASON,
-  CHARGE_UNIT_HALF_YEAR,
-  DURATION_HALF_YEAR,
-  DURATION_YEAR,
-  DURATION_SEASON,
-} from '../../../utils/config';
+import { Hotax } from '../../../utils/config';
 import styles from './TableForm.less';
 
 const chargeUnitMap = [{
-  text: CHARGE_UNIT_YEAR,
-  value: CHARGE_UNIT_YEAR,
+  text: Hotax.CHARGE_UNIT_YEAR,
+  value: Hotax.CHARGE_UNIT_YEAR,
 }, {
-  text: CHARGE_UNIT_HALF_YEAR,
-  value: CHARGE_UNIT_HALF_YEAR,
+  text: Hotax.CHARGE_UNIT_HALF_YEAR,
+  value: Hotax.CHARGE_UNIT_HALF_YEAR,
 }, {
-  text: CHARGE_UNIT_SEASON,
-  value: CHARGE_UNIT_SEASON,
+  text: Hotax.CHARGE_UNIT_SEASON,
+  value: Hotax.CHARGE_UNIT_SEASON,
 }];
 const durationMap = {
-  [CHARGE_UNIT_SEASON]: DURATION_SEASON,
-  [CHARGE_UNIT_HALF_YEAR]: DURATION_HALF_YEAR,
-  [CHARGE_UNIT_YEAR]: DURATION_YEAR,
+  [Hotax.CHARGE_UNIT_SEASON]: Hotax.DURATION_SEASON,
+  [Hotax.CHARGE_UNIT_HALF_YEAR]: Hotax.DURATION_HALF_YEAR,
+  [Hotax.CHARGE_UNIT_YEAR]: Hotax.DURATION_YEAR,
 };
 const sortMap = {
-  [CHARGE_UNIT_SEASON]: 0,
-  [CHARGE_UNIT_HALF_YEAR]: 1,
-  [CHARGE_UNIT_YEAR]: 2,
+  [Hotax.CHARGE_UNIT_SEASON]: 0,
+  [Hotax.CHARGE_UNIT_HALF_YEAR]: 1,
+  [Hotax.CHARGE_UNIT_YEAR]: 2,
 };
 
 export default class TableForm extends PureComponent {
@@ -72,11 +65,11 @@ export default class TableForm extends PureComponent {
       target.editable = !target.editable;
       this.setState({ data: newData });
     }
-  }
+  };
   chargeUnitSelectable=(value) => {
     const tmp = this.state.data.find(item => item.chargeUnit === value);
     return tmp !== undefined;
-  }
+  };
   remove(record) {
     const { key, isNew } = record;
     const newData = this.state.data.filter(item => item.key !== key);
@@ -97,7 +90,7 @@ export default class TableForm extends PureComponent {
     });
     this.index += 1;
     this.setState({ data: newData });
-  }
+  };
   handleFieldChange(value, fieldName, key) {
     const newData = this.state.data.map(item => ({ ...item }));
     const target = this.getRowByKey(key, newData);

+ 3 - 3
src/routes/Shelves/Package/PackageCreate.js

@@ -2,9 +2,9 @@ import React, { Component } from 'react';
 import { connect } from 'dva';
 import { routerRedux } from 'dva/router';
 import { message, Modal, Table, Card, Button } from 'antd';
-import Selector from '../../../components/RBTableSelector/Selector';
+import Selector from '../../../components/AXTableSelector/Selector';
 import FooterToolbar from '../../../components/FooterToolbar';
-import { STATUS_NORMAL } from '../../../utils/config';
+import { Hotax } from '../../../utils/config';
 import { renderCategory, statusCodeToName } from '../../../utils/utils';
 import styles from './PackageCreate.less';
 
@@ -104,7 +104,7 @@ export default class PackageCreatePage extends Component {
       payload: {
         pid,
         merchantId: id,
-        status: STATUS_NORMAL,
+        status: Hotax.STATUS_NORMAL,
       },
       states: this.props.location.state,
     });

+ 13 - 13
src/routes/Shelves/Package/PackageEdit.js

@@ -4,9 +4,9 @@ import { connect } from 'dva';
 import { routerRedux } from 'dva/router';
 import TableForm from './TableForm';
 import FooterToolbar from '../../../components/FooterToolbar';
-import Selector from '../../../components/RBTableSelector/Selector';
+import Selector from '../../../components/AXTableSelector/Selector';
 import { addRowKey } from '../../../utils/utils';
-import { PRODUCT_PACKAGE, STATUS_NORMAL } from '../../../utils/config';
+import { Hotax } from '../../../utils/config';
 
 @connect(({ loading, shelves, tag }) => ({
   tag,
@@ -45,15 +45,15 @@ export default class PackageEdit extends Component {
       payload: {
         ...data,
         ...this.state,
-        productType: PRODUCT_PACKAGE,
-        status: STATUS_NORMAL,
+        productType: Hotax.PRODUCT_PACKAGE,
+        status: Hotax.STATUS_NORMAL,
       },
       states: {
         pid,
         merchantId,
       },
     });
-  }
+  };
   handleGoodsUpdate=(data) => {
     const { pid, merchantId } = this.state;
     this.props.dispatch({
@@ -67,7 +67,7 @@ export default class PackageEdit extends Component {
         merchantId,
       },
     });
-  }
+  };
   handleGoodsDelete=(data) => {
     const { pid, merchantId } = this.state;
     this.props.dispatch({
@@ -78,7 +78,7 @@ export default class PackageEdit extends Component {
         merchantId,
       },
     });
-  }
+  };
   handleTagClose=(index) => {
     const { pid, merchantId } = this.state;
     const { shelves } = this.props;
@@ -98,7 +98,7 @@ export default class PackageEdit extends Component {
         merchantId,
       },
     });
-  }
+  };
   handleTagSelectorModalShow = () => {
     this.setState({
       tagSelectorDestroy: false,
@@ -108,19 +108,19 @@ export default class PackageEdit extends Component {
       type: 'tag/fetchTagList',
       payload: { merchantId },
     });
-  }
+  };
   handleTagSelectorCancel = () => {
     this.setState({
       tagSelectorDestroy: true,
     });
-  }
+  };
   handleTagSelectorChange = (params) => {
     const { merchantId } = this.state;
     this.props.dispatch({
       type: 'tag/fetchTagList',
       payload: { merchantId, ...params },
     });
-  }
+  };
   handleTagSelectorFinish = (rows) => {
     const { pid, merchantId } = this.state;
     const newTagIds = (rows || []).map(row => row.id);
@@ -139,13 +139,13 @@ export default class PackageEdit extends Component {
     this.setState({
       tagSelectorDestroy: true,
     });
-  }
+  };
   handlePageBack=() => {
     this.props.dispatch(routerRedux.push({
       pathname: '/shelves/package',
       state: this.props.location.state,
     }));
-  }
+  };
   render() {
     const { tagSelectorDestroy } = this.state;
     const { submitting, tLoading, shelves, tag, form } = this.props;

+ 0 - 0
src/routes/Shelves/Package/PackageList.js


Nem az összes módosított fájl került megjelenítésre, mert túl sok fájl változott