Browse Source

修改stylelint报错

zhanghe 6 years ago
parent
commit
e41c6f5a02
69 changed files with 556 additions and 594 deletions
  1. 0 1
      package.json
  2. 8 8
      src/common/menu.js
  3. 3 4
      src/components/Animation/AnimTableBody.js
  4. 9 19
      src/components/DataSearch/index.js
  5. 17 15
      src/components/DropOption/index.js
  6. 1 1
      src/components/HeaderSearch/index.js
  7. 11 11
      src/components/SelectModal/SelTable.js
  8. 12 12
      src/components/SelectModal/index.js
  9. 1 1
      src/layouts/UserLayout.js
  10. 0 2
      src/layouts/UserLayout.less
  11. 11 11
      src/models/campus.js
  12. 8 8
      src/models/common.js
  13. 6 6
      src/models/goods.js
  14. 5 5
      src/models/login.js
  15. 5 5
      src/models/merchant.js
  16. 6 6
      src/models/mproduct/detail.js
  17. 10 10
      src/models/mproduct/mproduct.js
  18. 8 8
      src/models/order/detail.js
  19. 12 12
      src/models/order/order.js
  20. 7 7
      src/models/product.js
  21. 3 3
      src/models/recommend.js
  22. 6 6
      src/models/terminal/detail.js
  23. 11 11
      src/models/terminal/terminal.js
  24. 1 2
      src/routes/About/index.js
  25. 14 15
      src/routes/Campus/index.js
  26. 5 6
      src/routes/Campus/modal.js
  27. 9 9
      src/routes/Campus/search.js
  28. 12 13
      src/routes/Campus/table.js
  29. 14 14
      src/routes/CmsUser/index.js
  30. 11 11
      src/routes/CmsUser/modal.js
  31. 1 1
      src/routes/CmsUser/search.js
  32. 18 19
      src/routes/CmsUser/table.js
  33. 1 1
      src/routes/Dashboard/index.js
  34. 18 19
      src/routes/Frontend/index.js
  35. 12 13
      src/routes/Frontend/recommend.js
  36. 0 1
      src/routes/Frontend/recommend.less
  37. 2 2
      src/routes/Login/index.js
  38. 17 18
      src/routes/MProduct/Edit/index.js
  39. 5 6
      src/routes/MProduct/Edit/price.js
  40. 13 14
      src/routes/MProduct/Edit/tags.js
  41. 12 12
      src/routes/MProduct/List/index.js
  42. 2 2
      src/routes/MProduct/List/search.js
  43. 15 16
      src/routes/MProduct/List/table.js
  44. 7 8
      src/routes/Merchant/index.js
  45. 20 22
      src/routes/Order/Add/index.js
  46. 15 16
      src/routes/Order/Add/product.js
  47. 8 9
      src/routes/Order/Add/terminal.js
  48. 10 10
      src/routes/Order/Edit/modal.js
  49. 0 1
      src/routes/Order/Edit/modal.less
  50. 9 9
      src/routes/Order/Edit/orderProfile.js
  51. 10 10
      src/routes/Order/List/index.js
  52. 3 3
      src/routes/Order/List/search.js
  53. 20 21
      src/routes/Order/List/table.js
  54. 17 19
      src/routes/SoldProduct/index.js
  55. 7 8
      src/routes/Terminal/Edit/campus.js
  56. 10 11
      src/routes/Terminal/Edit/index.js
  57. 10 10
      src/routes/Terminal/List/index.js
  58. 2 2
      src/routes/Terminal/List/search.js
  59. 15 16
      src/routes/Terminal/List/table.js
  60. 1 1
      src/services/cmsuser.js
  61. 4 4
      src/services/goods.js
  62. 1 1
      src/services/login.js
  63. 1 1
      src/services/merchant.js
  64. 1 1
      src/services/mproduct.js
  65. 1 1
      src/services/order.js
  66. 1 1
      src/services/product.js
  67. 31 31
      src/utils/city.js
  68. 4 4
      src/utils/config.js
  69. 6 8
      src/utils/request.js

+ 0 - 1
package.json

@@ -4,7 +4,6 @@
   "description": "An out-of-box UI solution for enterprise applications",
   "private": true,
   "scripts": {
-    "precommit": "npm run lint-staged",
     "start": "roadhog server",
     "start:no-proxy": "cross-env NO_PROXY=true roadhog server",
     "build": "roadhog build",

+ 8 - 8
src/common/menu.js

@@ -3,35 +3,35 @@ const menuData = [
     name: '主页',
     icon: 'dashboard',
     path: 'dashboard',
-  },{
+  }, {
     name: '产品库',
     icon: 'shop',
     path: 'goods',
-  },{
+  }, {
     name: '订单管理',
     icon: 'trademark',
     path: 'order',
-  },{
+  }, {
     name: '销售统计',
     icon: 'area-chart',
     path: 'sold',
-  },{
+  }, {
     name: '校区管理',
     icon: 'home',
     path: 'campus',
-  },{
+  }, {
     name: '终端管理',
     icon: 'desktop',
     path: 'terminal',
-  },{
+  }, {
     name: '前端展现',
     icon: 'setting',
     path: 'frontend',
-  },{
+  }, {
     name: '账户信息',
     icon: 'user',
     path: 'merchant',
-  },{
+  }, {
     name: '使用说明',
     icon: 'question-circle-o',
     path: 'help',

+ 3 - 4
src/components/Animation/AnimTableBody.js

@@ -15,7 +15,7 @@ const enterAnim = [
     delay: 250,
     ease: 'easeOutQuad',
     onComplete: (e) => {
-      e.target.style.height = 'auto'
+      e.target.style.height = 'auto';
     },
   }, {
     opacity: 1,
@@ -26,7 +26,7 @@ const enterAnim = [
     delay: 1000,
     backgroundColor: '#fff',
   },
-]
+];
 
 const leaveAnim = [
   {
@@ -41,7 +41,6 @@ const leaveAnim = [
 ];
 
 const AnimTableBody = ({ className, children }) => {
-
   return (
     <TweenOneGroup
       component="tbody"
@@ -53,6 +52,6 @@ const AnimTableBody = ({ className, children }) => {
       {children}
     </TweenOneGroup>
   );
-}
+};
 
 export default AnimTableBody;

+ 9 - 19
src/components/DataSearch/index.js

@@ -3,27 +3,15 @@ import PropTypes from 'prop-types';
 import { Input, Select, Button, Icon } from 'antd';
 import styles from './index.less';
 
-const Option = Select.Option;
-
 export default class DataSearch extends PureComponent {
-  static propTypes = {
-    size: PropTypes.string,
-    select: PropTypes.bool,
-    selectProps: PropTypes.object,
-    onSearch: PropTypes.func,
-    selectOptions: PropTypes.array,
-    style: PropTypes.object,
-    keyword: PropTypes.string,
-    filterSelectProps: PropTypes.object,
-  }
   constructor(props) {
     super(props);
     const { select, selectOptions, selectProps, keyword, field } = this.props;
     this.state = {
       selectValue: select && selectProps ? selectProps.defaultValue : '',
-      inputValue: keyword ? keyword : '',
+      inputValue: keyword || '',
       mode: field && selectOptions.filter(item => item.value === field)[0].mode || 'input',
-    }
+    };
   }
   handleSearch = () => {
     const query = { keyword: this.state.inputValue };
@@ -53,12 +41,12 @@ export default class DataSearch extends PureComponent {
     this.setState({
       ...this.state,
       inputValue: value,
-    })
+    });
   }
   handleInputSelectClear = (value) => {
     if (!value) {
       this.setState({
-        inputValue: ''
+        inputValue: '',
       }, () => this.handleSearch());
     }
   }
@@ -95,7 +83,7 @@ export default class DataSearch extends PureComponent {
         onSelect={this.handleInputSelectChange}
         filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
       >
-        {data.map(item => <Option key={item.value} value={item.value}>{item.name}</Option>)}
+        {data.map(item => <Select.Option key={item.value} value={item.value}>{item.name}</Select.Option>)}
       </Select>
     );
 
@@ -116,9 +104,11 @@ export default class DataSearch extends PureComponent {
     const { size, select, selectOptions, selectProps, style } = this.props;
     return (
       <Input.Group compact size={size} className={styles.search} style={style}>
-        {select && <Select onChange={this.handleSelectChange} size={size} {...selectProps}>
+        {select && (
+        <Select onChange={this.handleSelectChange} size={size} {...selectProps}>
           {selectOptions && selectOptions.map((item, key) => <Option value={item.value} key={key}>{item.name || item.value}</Option>)}
-        </Select>}
+        </Select>
+)}
         {this.renderKeyWordComponent()}
         <Button onClick={this.handleSearch} size={size} type="primary" icon="search">搜索</Button>
       </Input.Group>

+ 17 - 15
src/components/DropOption/index.js

@@ -1,25 +1,27 @@
-import React from 'react'
-import PropTypes from 'prop-types'
-import { Dropdown, Button, Icon, Menu } from 'antd'
+import React from 'react';
+import PropTypes from 'prop-types';
+import { Dropdown, Button, Icon, Menu } from 'antd';
 
 const DropOption = ({ onMenuClick, menuOptions = [], buttonStyle, dropdownProps }) => {
-  const menu = menuOptions.map(item => <Menu.Item key={item.key}>{item.name}</Menu.Item>)
-  return (<Dropdown
-    overlay={<Menu onClick={onMenuClick}>{menu}</Menu>}
-    {...dropdownProps}
-  >
-    <Button style={{ border: 'none', ...buttonStyle }}>
-      <Icon style={{ marginRight: 2 }} type="bars" />
-      <Icon type="down" />
-    </Button>
-  </Dropdown>)
-}
+  const menu = menuOptions.map(item => <Menu.Item key={item.key}>{item.name}</Menu.Item>);
+  return (
+    <Dropdown
+      overlay={<Menu onClick={onMenuClick}>{menu}</Menu>}
+      {...dropdownProps}
+    >
+      <Button style={{ border: 'none', ...buttonStyle }}>
+        <Icon style={{ marginRight: 2 }} type="bars" />
+        <Icon type="down" />
+      </Button>
+    </Dropdown>
+  );
+};
 
 DropOption.propTypes = {
   onMenuClick: PropTypes.func,
   menuOptions: PropTypes.array.isRequired,
   buttonStyle: PropTypes.object,
   dropdownProps: PropTypes.object,
-}
+};
 
 export default DropOption;

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

@@ -73,7 +73,7 @@ export default class HeaderSearch extends PureComponent {
         >
           <Input
             placeholder={placeholder}
-            disabled={true}
+            disabled
             ref={(node) => { this.input = node; }}
             onKeyDown={this.onKeyDown}
             onBlur={this.leaveSearchMode}

+ 11 - 11
src/components/SelectModal/SelTable.js

@@ -7,13 +7,13 @@ const ButtonGroup = Button.Group;
 
 export default class SelTable extends PureComponent {
   static propTypes = {
-    dataSource: PropTypes.array.isRequired,   // 表的数据源
-    columns: PropTypes.array.isRequired,      // 表的列的结构
-    rowKeyName: PropTypes.string.isRequired,  // table row key name
-    operSort: PropTypes.bool,                 // 开启排序功能
-    operDel: PropTypes.bool,                  // 开启删除功能
-    onUp: PropTypes.func,                     // 点击向上调整位置
-    onDown: PropTypes.func,                   // 点击向下调整位置
+    dataSource: PropTypes.array.isRequired, // 表的数据源
+    columns: PropTypes.array.isRequired, // 表的列的结构
+    rowKeyName: PropTypes.string.isRequired, // table row key name
+    operSort: PropTypes.bool, // 开启排序功能
+    operDel: PropTypes.bool, // 开启删除功能
+    onUp: PropTypes.func, // 点击向上调整位置
+    onDown: PropTypes.func, // 点击向下调整位置
   };
 
   render() {
@@ -27,8 +27,8 @@ export default class SelTable extends PureComponent {
       key: 'sort-operation',
       render: (text, record) => (
         <ButtonGroup>
-          <Button onClick={() => onUp(record)} size="small" icon="up-circle-o"></Button>
-          <Button onClick={() => onDown(record)} size="small" icon="down-circle-o"></Button>
+          <Button onClick={() => onUp(record)} size="small" icon="up-circle-o" />
+          <Button onClick={() => onDown(record)} size="small" icon="down-circle-o" />
         </ButtonGroup>
       ),
     };
@@ -38,7 +38,7 @@ export default class SelTable extends PureComponent {
       dataIndex: 'del-operation',
       key: 'del-operation',
       render: (text, record) => (
-        <Button onClick={() => onDel(record)} size="small" icon="delete"></Button>
+        <Button onClick={() => onDel(record)} size="small" icon="delete" />
       ),
     };
 
@@ -52,7 +52,7 @@ export default class SelTable extends PureComponent {
 
     return (
       <Table
-        bordered={true}
+        bordered
         dataSource={dataSource}
         columns={curSpaceColumns}
         rowKey={rowKeyName}

+ 12 - 12
src/components/SelectModal/index.js

@@ -56,12 +56,12 @@ export default class SelectModal extends PureComponent {
 
     // 找到该行在列表中的索引
     const index = arr.findIndex(item => item[rowKeyName] === record[rowKeyName]);
-    //第一个元素或者未找到元素不做操作
-    if (!index || -1 === index) return;
-    //与前一个元素进行位置互换
+    // 第一个元素或者未找到元素不做操作
+    if (!index || index === -1) return;
+    // 与前一个元素进行位置互换
     arr.splice(index, 1, ...arr.splice(index - 1, 1, arr[index]));
     // 将sort字段重新赋值
-    arr.map((item, index) => item.sort !== undefined ? item.sort = index + 1 : null);
+    arr.map((item, index) => (item.sort !== undefined ? item.sort = index + 1 : null));
 
     this.setState({ selTableData: arr });
   }
@@ -74,12 +74,12 @@ export default class SelectModal extends PureComponent {
 
     // 找到该行在列表中的索引
     const index = arr.findIndex(item => item[rowKeyName] == record[rowKeyName]);
-    //最后一个元素或者未找到元素不做操作
-    if (index + 1 === arr.length || -1 === index) return;
-    //与后一个元素进行位置互换
+    // 最后一个元素或者未找到元素不做操作
+    if (index + 1 === arr.length || index === -1) return;
+    // 与后一个元素进行位置互换
     arr.splice(index, 1, ...arr.splice(index + 1, 1, arr[index]));
     // 将sort字段重新赋值
-    arr.map((item, index) => item.sort !== undefined ? item.sort = index + 1 : null);
+    arr.map((item, index) => (item.sort !== undefined ? item.sort = index + 1 : null));
 
     this.setState({ selTableData: arr });
   }
@@ -218,8 +218,8 @@ export default class SelectModal extends PureComponent {
               onSearch={this.handleOnSearch}
             />
             <ButtonGroup style={{ marginTop: 10, marginBottom: 10 }}>
-              <Button type="primary" onClick={this.handleTabChange} ghost={tableTabLeft ? false : true}>待选</Button>
-              <Button type="primary" onClick={this.handleTabChange} ghost={tableTabLeft ? true : false}>{`已选[${selTableData.length}]`}</Button>
+              <Button type="primary" onClick={this.handleTabChange} ghost={!tableTabLeft}>待选</Button>
+              <Button type="primary" onClick={this.handleTabChange} ghost={!!tableTabLeft}>{`已选[${selTableData.length}]`}</Button>
             </ButtonGroup>
             <ForSelTable
               mode={mode}
@@ -233,7 +233,7 @@ export default class SelectModal extends PureComponent {
               onAdd={this.handleOnAdd}
               scroll={{ y: 300 }}
               selected={selTableData}
-              style={{ display: (tableTabLeft ? "block" : "none") }}
+              style={{ display: (tableTabLeft ? 'block' : 'none') }}
             />
             <SelTable
               dataSource={selTableData}
@@ -247,7 +247,7 @@ export default class SelectModal extends PureComponent {
               onDown={this.handleOnDown}
               onDel={this.handleOnDel}
               scroll={{ y: 300 }}
-              style={{ display: (tableTabLeft ? "none" : "block") }}
+              style={{ display: (tableTabLeft ? 'none' : 'block') }}
             />
           </Modal>
         );

+ 1 - 1
src/layouts/UserLayout.js

@@ -58,7 +58,7 @@ class UserLayout extends React.PureComponent {
                   )
                 )
               }
-              <GlobalFooter colorInverse={true} className={styles.footer} links={links} copyright={copyright} />
+              <GlobalFooter colorInverse className={styles.footer} links={links} copyright={copyright} />
             </div>
           </div>
         </div>

+ 0 - 2
src/layouts/UserLayout.less

@@ -61,11 +61,9 @@
       position: absolute;
       width: 100%;
       bottom: 0;
-      
       .copyright {
         color: @inverse-color;
       }
     }
-
   }
 }

+ 11 - 11
src/models/campus.js

@@ -29,12 +29,12 @@ export default modelExtend(pageModel, {
           });
         }
       });
-    }
+    },
   },
 
   effects: {
-    * query ({ payload = {} }, { call, put }) {
-      yield put({ type: 'changeLoading', payload: { listLoading: true }});
+    * query({ payload = {} }, { call, put }) {
+      yield put({ type: 'changeLoading', payload: { listLoading: true } });
       const { merchantId } = getLocalUser();
       const { data, success } = yield call(query, { ...payload, merchantId });
       if (success) {
@@ -46,13 +46,13 @@ export default modelExtend(pageModel, {
               current: Number(payload.pageNo) || 1,
               pageSize: Number(payload.pageSize) || pageSize,
               total: data.totalSize,
-            }
-          }
+            },
+          },
         });
       }
-      yield put({ type: 'changeLoading', payload: { listLoading: false }});
+      yield put({ type: 'changeLoading', payload: { listLoading: false } });
     },
-    * create ({ payload, callback }, { call, put }) {
+    * create({ payload, callback }, { call, put }) {
       const { merchantId } = getLocalUser();
       const { data, success } = yield call(create, { ...payload, merchantId });
       if (success) {
@@ -61,7 +61,7 @@ export default modelExtend(pageModel, {
         if (callback) callback();
       }
     },
-    * update ({ payload, callback }, { call, put }) {
+    * update({ payload, callback }, { call, put }) {
       const { merchantId } = getLocalUser();
       const { data, success } = yield call(update, { ...payload, merchantId });
       if (success) {
@@ -69,7 +69,7 @@ export default modelExtend(pageModel, {
         yield put({ type: 'hideModal' });
         if (callback) callback();
       }
-    }
+    },
   },
 
   reducers: {
@@ -82,5 +82,5 @@ export default modelExtend(pageModel, {
     hideModal(state) {
       return { ...state, modalVisible: false };
     },
-  }
-})
+  },
+});

+ 8 - 8
src/models/common.js

@@ -2,14 +2,14 @@ import modelExtend from 'dva-model-extend';
 
 const model = {
   reducers: {
-    updateState (state, { payload }) {
+    updateState(state, { payload }) {
       return {
         ...state,
         ...payload,
-      }
+      };
     },
   },
-}
+};
 
 const pageModel = modelExtend(model, {
 
@@ -25,8 +25,8 @@ const pageModel = modelExtend(model, {
   },
 
   reducers: {
-    querySuccess (state, { payload }) {
-      const { list, pagination } = payload
+    querySuccess(state, { payload }) {
+      const { list, pagination } = payload;
       return {
         ...state,
         list,
@@ -34,14 +34,14 @@ const pageModel = modelExtend(model, {
           ...state.pagination,
           ...pagination,
         },
-      }
+      };
     },
   },
 
-})
+});
 
 
 module.exports = {
   model,
   pageModel,
-}
+};

+ 6 - 6
src/models/goods.js

@@ -13,7 +13,7 @@ export default {
   },
 
   effects: {
-    * createItem ({ payload, callback }, { call, put }) {
+    * createItem({ payload, callback }, { call, put }) {
       const { data, success } = yield call(create, { ...payload, status: Codes.CODE_NORMAL });
       if (success) {
         message.success('创建成功!');
@@ -21,7 +21,7 @@ export default {
         if (callback) callback();
       }
     },
-    * updateItem ({ payload, callback }, { call, put }) {
+    * updateItem({ payload, callback }, { call, put }) {
       const { data, success } = yield call(update, { ...payload });
       if (success) {
         message.success('修改成功!');
@@ -29,21 +29,21 @@ export default {
         if (callback) callback();
       }
     },
-    * removeItem ({ payload, callback }, { call, put }) {
+    * removeItem({ payload, callback }, { call, put }) {
       const { data, success } = yield call(remove, { ...payload });
       if (success) {
         message.success('删除成功!');
         if (callback) callback();
       }
     },
-    * bundleTags ({ payload, callback }, { call, put }) {
+    * bundleTags({ payload, callback }, { call, put }) {
       const { data, success } = yield call(bundleTags, { ...payload });
       if (success) {
         message.success('操作成功!');
         yield put({ type: 'hideTagModal' });
         if (callback) callback();
       }
-    }
+    },
   },
 
   reducers: {
@@ -60,4 +60,4 @@ export default {
       return { ...state, ...action.payload, tagModalShow: false };
     },
   },
-}
+};

+ 5 - 5
src/models/login.js

@@ -14,7 +14,7 @@ export default {
       const { data, success } = yield call(login, payload);
       if (success) {
         addLocalUser(data);
-        message.success('登录成功')
+        message.success('登录成功');
         yield put(routerRedux.push('/'));
       }
       yield put({ type: 'save', payload: { loading: false } });
@@ -22,17 +22,17 @@ export default {
     *logout(_, { put, call }) {
       const { success } = yield call(logout);
       if (success) {
-        message.success('注销成功,请重新登录!')
+        message.success('注销成功,请重新登录!');
         yield put(routerRedux.push('/user/login'));
       }
-    }
+    },
   },
   reducers: {
     save(state, action) {
       return {
         ...state,
         ...action.payload,
-      }
+      };
     },
   },
-}
+};

+ 5 - 5
src/models/merchant.js

@@ -18,11 +18,11 @@ export default {
           dispatch({ type: 'query', payload: { id: merchantId } });
         }
       });
-    }
+    },
   },
 
   effects: {
-    * query ({ payload }, { call, put }) {
+    * query({ payload }, { call, put }) {
       yield put({ type: 'changeLoading', payload: { loading: true } });
       const { data, success } = yield call(queryOne, payload);
       if (success) {
@@ -30,7 +30,7 @@ export default {
       }
       yield put({ type: 'changeLoading', payload: { loading: false } });
     },
-    * update ({ payload, callback }, { call, put }) {
+    * update({ payload, callback }, { call, put }) {
       const { data, success } = yield call(update, payload);
       if (success) {
         message.success('修改成功!');
@@ -46,5 +46,5 @@ export default {
     querySuccess(state, action) {
       return { ...state, item: action.payload };
     },
-  }
-}
+  },
+};

+ 6 - 6
src/models/mproduct/detail.js

@@ -25,12 +25,12 @@ export default {
           dispatch({ type: 'saveFilters', payload: state });
         }
       });
-    }
+    },
   },
 
   effects: {
     // 查询一条渠道方产品详情 /merchant/product/detail?pid=xxx&merchantId=xxx
-    * queryOne ({ payload }, { call, put }) {
+    * queryOne({ payload }, { call, put }) {
       yield put({ type: 'changeLoading', payload: { itemLoading: true } });
       const { data, success } = yield call(queryOne, payload);
       if (success) {
@@ -39,7 +39,7 @@ export default {
       yield put({ type: 'changeLoading', payload: { itemLoading: false } });
     },
     // 创建渠道方产品 {pid:'xxx', merchantId:'xxx', status:'NORMAL'}
-    * createMerchantProduct ({ payload, callback }, { call, put }) {
+    * createMerchantProduct({ payload, callback }, { call, put }) {
       const { data, success } = yield call(createMerchantProduct, payload);
       if (success) {
         yield put({ type: 'clearPage' });
@@ -89,6 +89,6 @@ export default {
 
     clearPage(state) {
       return { ...state, currentItem: {}, itemLoading: false };
-    }
-  }
-}
+    },
+  },
+};

+ 10 - 10
src/models/mproduct/mproduct.js

@@ -23,12 +23,12 @@ export default modelExtend(pageModel, {
           });
         }
       });
-    }
+    },
   },
 
   effects: {
-    * query ({ payload = {} }, { call, put }) {
-      yield put({ type: 'changeLoading', payload: { listLoading: true }});
+    * query({ payload = {} }, { call, put }) {
+      yield put({ type: 'changeLoading', payload: { listLoading: true } });
       const { merchantId } = getLocalUser();
       const { data, success } = yield call(query, { ...payload, merchantId });
       if (success) {
@@ -40,21 +40,21 @@ export default modelExtend(pageModel, {
               current: Number(payload.pageNo) || 1,
               pageSize: Number(payload.pageSize) || pageSize,
               total: data.totalSize,
-            }
-          }
+            },
+          },
         });
       }
-      yield put({ type: 'changeLoading', payload: { listLoading: false }});
+      yield put({ type: 'changeLoading', payload: { listLoading: false } });
     },
     // 商品上架 - {status: NORMAL, merchantId: 'xxx', pid: 'xxx'}
-    * putOnSale ({ payload, callback }, { call, put }) {
+    * putOnSale({ payload, callback }, { call, put }) {
       const { data, success } = yield call(createMerchantProduct, { ...payload, status: Codes.CODE_NORMAL });
       if (success) {
         if (callback) callback();
       }
     },
     // 商品下架 - {status: 'DEL', merchantId: 'xxx', pid: 'xxx'}
-    * putOffSale ({ payload, callback }, { call, put }) {
+    * putOffSale({ payload, callback }, { call, put }) {
       const { data, success } = yield call(createMerchantProduct, { ...payload, status: Codes.CODE_DELETE });
       if (success) {
         if (callback) callback();
@@ -66,5 +66,5 @@ export default modelExtend(pageModel, {
     changeLoading(state, action) {
       return { ...state, ...action.payload };
     },
-  }
-})
+  },
+});

+ 8 - 8
src/models/order/detail.js

@@ -24,11 +24,11 @@ export default {
           dispatch({ type: 'saveOperType', payload: { operType: 'view' } });
         }
       });
-    }
+    },
   },
 
   effects: {
-    * query ({ payload }, { call, put }) {
+    * query({ payload }, { call, put }) {
       yield put({ type: 'changeLoading', payload: { itemLoading: true } });
       const { data, success } = yield call(queryOne, payload);
       if (success) {
@@ -36,20 +36,20 @@ export default {
       }
       yield put({ type: 'changeLoading', payload: { itemLoading: false } });
     },
-    * create ({ payload, callback }, { call, put }) {
+    * create({ payload, callback }, { call, put }) {
       const { data, success } = yield call(create, { ...payload });
       if (success) {
         yield put({ type: 'cacheCleaner' });
         if (callback) callback();
       }
     },
-    * update ({ payload, callback }, { call, put }) {
+    * update({ payload, callback }, { call, put }) {
       const { data, success } = yield call(update, payload);
       if (success) {
         yield put({ type: 'cacheCleaner' });
         if (callback) callback();
       }
-    }
+    },
   },
 
   reducers: {
@@ -90,6 +90,6 @@ export default {
     },
     cacheCleaner(state) {
       return { ...state, currentItem: {}, itemLoading: false };
-    }
-  }
-}
+    },
+  },
+};

+ 12 - 12
src/models/order/order.js

@@ -27,12 +27,12 @@ export default modelExtend(pageModel, {
           });
         }
       });
-    }
+    },
   },
 
   effects: {
-    * query ({ payload = {} }, { call, put }) {
-      yield put({ type: 'changeLoading', payload: { listLoading: true }});
+    * query({ payload = {} }, { call, put }) {
+      yield put({ type: 'changeLoading', payload: { listLoading: true } });
       const { data, success } = yield call(query, payload);
       if (success) {
         yield put({
@@ -43,32 +43,32 @@ export default modelExtend(pageModel, {
               current: Number(payload.pageNo) || 1,
               pageSize: Number(payload.pageSize) || pageSize,
               total: data.totalSize,
-            }
-          }
+            },
+          },
         });
       }
-      yield put({ type: 'changeLoading', payload: { listLoading: false }});
+      yield put({ type: 'changeLoading', payload: { listLoading: false } });
     },
-    * create ({ payload, callback }, { call, put }) {
+    * create({ payload, callback }, { call, put }) {
       const { data, success } = yield call(create, payload);
       if (success) {
         if (callback) callback();
       }
     },
-    * update ({ payload, callback }, { call, put }) {
+    * update({ payload, callback }, { call, put }) {
       const { data, success } = yield call(update, payload);
       if (success) {
         yield put({ type: 'hideModal' });
         if (callback) callback();
       }
     },
-    * delete ({ payload, callback }, { call, put }) {
+    * delete({ payload, callback }, { call, put }) {
       const { data, success } = yield call(remove, payload);
       if (success) {
         if (callback) callback();
       }
     },
-    * recover ({ payload, callback }, { call, put }) {
+    * recover({ payload, callback }, { call, put }) {
       const { data, success } = yield call(update, payload);
       if (success) {
         if (callback) callback();
@@ -88,5 +88,5 @@ export default modelExtend(pageModel, {
     hideModal(state) {
       return { ...state, modalVisible: false };
     },
-  }
-})
+  },
+});

+ 7 - 7
src/models/product.js

@@ -12,8 +12,8 @@ export default modelExtend(pageModel, {
   state: { listLoading: false },
 
   effects: {
-    * query ({ payload = {} }, { call, put }) {
-      yield put({ type: 'changeLoading', payload: { listLoading: true }});
+    * query({ payload = {} }, { call, put }) {
+      yield put({ type: 'changeLoading', payload: { listLoading: true } });
       const { data, success } = yield call(query, payload);
       if (success) {
         yield put({
@@ -24,11 +24,11 @@ export default modelExtend(pageModel, {
               current: Number(payload.pageNo) || 1,
               pageSize: Number(payload.pageSize) || pageSize,
               total: data.totalSize,
-            }
-          }
+            },
+          },
         });
       }
-      yield put({ type: 'changeLoading', payload: { listLoading: false }});
+      yield put({ type: 'changeLoading', payload: { listLoading: false } });
     },
   },
 
@@ -36,5 +36,5 @@ export default modelExtend(pageModel, {
     changeLoading(state, action) {
       return { ...state, ...action.payload };
     },
-  }
-})
+  },
+});

+ 3 - 3
src/models/recommend.js

@@ -22,7 +22,7 @@ export default {
           });
         }
       });
-    }
+    },
   },
 
   effects: {
@@ -59,5 +59,5 @@ export default {
     saveSortResult(state, action) {
       return { ...state, item: [...action.payload], modalShow: false };
     },
-  }
-}
+  },
+};

+ 6 - 6
src/models/terminal/detail.js

@@ -28,11 +28,11 @@ export default {
           });
         }
       });
-    }
+    },
   },
 
   effects: {
-    * create ({ payload, callback }, { call, put }) {
+    * create({ payload, callback }, { call, put }) {
       const { data, success } = yield call(create, payload);
       if (success) {
         message.success('创建成功!');
@@ -40,7 +40,7 @@ export default {
         if (callback) callback();
       }
     },
-    * update ({ payload, callback }, { call, put }) {
+    * update({ payload, callback }, { call, put }) {
       const { data, success } = yield call(update, payload);
       if (success) {
         message.success('修改成功!');
@@ -75,6 +75,6 @@ export default {
     },
     initState(state) {
       return { ...state, currentItem: {} };
-    }
-  }
-}
+    },
+  },
+};

+ 11 - 11
src/models/terminal/terminal.js

@@ -23,12 +23,12 @@ export default modelExtend(pageModel, {
           });
         }
       });
-    }
+    },
   },
 
   effects: {
-    * query ({ payload = {} }, { call, put }) {
-      yield put({ type: 'changeLoading', payload: { listLoading: true }});
+    * query({ payload = {} }, { call, put }) {
+      yield put({ type: 'changeLoading', payload: { listLoading: true } });
       const { merchantId } = getLocalUser();
       const { data, success } = yield call(query, { ...payload, merchantId });
       if (success) {
@@ -40,31 +40,31 @@ export default modelExtend(pageModel, {
               current: Number(payload.pageNo) || 1,
               pageSize: Number(payload.pageSize) || pageSize,
               total: data.totalSize,
-            }
-          }
+            },
+          },
         });
       }
-      yield put({ type: 'changeLoading', payload: { listLoading: false }});
+      yield put({ type: 'changeLoading', payload: { listLoading: false } });
     },
-    * delete ({ payload, callback }, { call, put }) {
+    * delete({ payload, callback }, { call, put }) {
       const { data, success } = yield call(remove, payload);
       if (success) {
         message.success('禁用成功!');
         if (callback) callback();
       }
     },
-    * recover ({ payload, callback }, { call, put }) {
+    * recover({ payload, callback }, { call, put }) {
       const { data, success } = yield call(update, payload);
       if (success) {
         message.success('解禁成功!');
         if (callback) callback();
       }
-    }
+    },
   },
 
   reducers: {
     changeLoading(state, { payload }) {
       return { ...state, ...payload };
     },
-  }
-})
+  },
+});

+ 1 - 2
src/routes/About/index.js

@@ -4,8 +4,7 @@ import { Card, Icon } from 'antd';
 export default class About extends PureComponent {
   render() {
     return (
-      <Card title="使用说明">
-      </Card>
+      <Card title="使用说明" />
     );
   }
 }

+ 14 - 15
src/routes/Campus/index.js

@@ -14,7 +14,6 @@ import { Codes } from '../../utils/config';
   campus: state.campus,
 }))
 export default class CampusList extends Component {
-
   render() {
     const { location, dispatch, campus } = this.props;
     const {
@@ -23,7 +22,7 @@ export default class CampusList extends Component {
       pagination,
       currentItem,
       modalVisible,
-      modalType
+      modalType,
     } = campus;
 
     location.query = queryString.parse(location.search);
@@ -31,7 +30,7 @@ export default class CampusList extends Component {
     const { field, keyword, ...filters } = query;
 
     // 把携带的参数中空值项删除
-    Object.keys(filters).map(key => { filters[key] ? null : delete filters[key] });
+    Object.keys(filters).map((key) => { filters[key] ? null : delete filters[key]; });
     // 如果搜索内容不为空则添加进filters中
     if (field && keyword) {
       filters.field = field;
@@ -44,7 +43,7 @@ export default class CampusList extends Component {
       maskClosable: false,
       title: `${modalType === 'create' ? '添加校区' : '编辑校区'}`,
       wrapClassName: 'vertical-center-modal',
-      onOk (data) {
+      onOk(data) {
         dispatch({
           type: `campus/${modalType}`,
           payload: data,
@@ -53,10 +52,10 @@ export default class CampusList extends Component {
               pathname: '/terminal/campus',
               search: queryString.stringify(filters),
             }));
-          }
+          },
         });
       },
-      onCancel () {
+      onCancel() {
         dispatch({
           type: 'campus/hideModal',
         });
@@ -74,8 +73,8 @@ export default class CampusList extends Component {
         dispatch(routerRedux.push({
           pathname,
           search: queryString.stringify({
-            ...payload
-          })
+            ...payload,
+          }),
         }));
       },
       onAdd: () => {
@@ -83,7 +82,7 @@ export default class CampusList extends Component {
           type: 'campus/showModal',
           payload: { modalType: 'create' },
         });
-      }
+      },
     };
 
     const listProps = {
@@ -99,7 +98,7 @@ export default class CampusList extends Component {
           return newObj;
         }, {});
         const data = { ...filters, ...tableFilters };
-        Object.keys(data).map(key => data[key] ? null : delete data[key]);
+        Object.keys(data).map(key => (data[key] ? null : delete data[key]));
         dispatch(routerRedux.push({
           pathname,
           search: queryString.stringify({
@@ -119,15 +118,15 @@ export default class CampusList extends Component {
         });
       },
       onDeleteItem: () => {
-        //TODO: 暂不提供删除校区功能
-      }
+        // TODO: 暂不提供删除校区功能
+      },
     };
     return (
       <PageHeaderLayout>
         <Card>
-          <Search { ...searchProps } />
-          <CampusTableList { ...listProps } />
-          {modalVisible && <CampusModalForm { ...modalProps } />}
+          <Search {...searchProps} />
+          <CampusTableList {...listProps} />
+          {modalVisible && <CampusModalForm {...modalProps} />}
         </Card>
       </PageHeaderLayout>
     );

+ 5 - 6
src/routes/Campus/modal.js

@@ -4,7 +4,6 @@ import * as city from '../../utils/city';
 
 @Form.create()
 export default class CampusModalForm extends Component {
-
   handleOnOk = () => {
     const { onOk, form, item } = this.props;
     const { validateFields, getFieldsValue } = form;
@@ -30,7 +29,7 @@ export default class CampusModalForm extends Component {
       wrapperCol: { span: 14 },
     };
 
-    const modalOpts = { ...modalProps, onOk: this.handleOnOk }
+    const modalOpts = { ...modalProps, onOk: this.handleOnOk };
 
     return (
       <Modal {...modalOpts}>
@@ -40,8 +39,8 @@ export default class CampusModalForm extends Component {
               rules: [
                 {
                   required: true,
-                  message: '校区地址为必选项!'
-                }
+                  message: '校区地址为必选项!',
+                },
               ],
               initialValue: item.provinceCode && [city.provCodeToName(item.provinceCode), ...(item.cityName || '').split(' ')],
             })(<Cascader
@@ -50,7 +49,7 @@ export default class CampusModalForm extends Component {
               placeholder="请选择"
             />)}
           </Form.Item>
-          {/*校区编号暂不显示
+          {/* 校区编号暂不显示
           <Form.Item label="校区编号:" {...formItemLayout}>
             {getFieldDecorator('code', {
               initialValue: item.code,
@@ -107,6 +106,6 @@ export default class CampusModalForm extends Component {
           </Form.Item>
         </Form>
       </Modal>
-    )
+    );
   }
 }

+ 9 - 9
src/routes/Campus/search.js

@@ -7,7 +7,7 @@ const Search = ({
   field,
   keyword,
   onSearch,
-  onAdd
+  onAdd,
 }) => {
   const searchGroupProps = {
     field,
@@ -15,9 +15,9 @@ const Search = ({
     size: 'default',
     select: true,
     selectOptions: [{
-      value: 'name', name: '校区名称'
-    },{
-      value: 'code', name: '校区编号'
+      value: 'name', name: '校区名称',
+    }, {
+      value: 'code', name: '校区编号',
     }],
     selectProps: {
       defaultValue: field || 'name',
@@ -25,18 +25,18 @@ const Search = ({
     onSearch: (value) => {
       onSearch(value);
     },
-  }
+  };
   return (
     <Row gutter={24}>
       <Col lg={10} md={12} sm={16} xs={24} style={{ marginBottom: 16 }}>
-        <DataSearch { ...searchGroupProps } />
+        <DataSearch {...searchGroupProps} />
       </Col>
       <Col lg={{ offset: 7, span: 7 }} md={12} sm={8} xs={24} style={{ marginBottom: 16, textAlign: 'right' }}>
         <Button type="primary" onClick={onAdd}><Icon type="plus-circle" />添加校区</Button>
       </Col>
     </Row>
-  )
-}
+  );
+};
 
 Search.propTypes = {
   form: PropTypes.object.isRequired,
@@ -44,6 +44,6 @@ Search.propTypes = {
   onAdd: PropTypes.func,
   field: PropTypes.string,
   keyword: PropTypes.string,
-}
+};
 
 export default Form.create()(Search);

+ 12 - 13
src/routes/Campus/table.js

@@ -6,11 +6,10 @@ import AnimTableBody from '../../components/Animation/AnimTableBody';
 import styles from './table.less';
 
 export default class CampusTableList extends Component {
-
   handleDeleteItem = (record) => {
     Modal.confirm({
       title: '您确定要删除该校区吗?',
-      onOk () {
+      onOk() {
         onDeleteItem(record.id);
       },
     });
@@ -29,26 +28,26 @@ export default class CampusTableList extends Component {
       title: '校区编号',
       dataIndex: 'code',
       key: 'code',
-    },{
+    }, {
       title: '校区名称',
       dataIndex: 'name',
       key: 'name',
-    },{
+    }, {
       title: '联系人',
       dataIndex: 'contactName',
       key: 'contactName',
-    },{
+    }, {
       title: '电话',
       dataIndex: 'mobile',
       key: 'mobile',
-    },{
+    }, {
       title: '修改时间',
       dataIndex: 'gmtModified',
       key: 'gmtModified',
       render: (text, record) => (
         <div>{moment(text).format('YYYY-MM-DD HH:mm:ss')}</div>
-      )
-    },{
+      ),
+    }, {
       title: '操作',
       dataIndex: 'operation',
       key: 'operation',
@@ -56,25 +55,25 @@ export default class CampusTableList extends Component {
         <div>
           <a onClick={() => onEditItem(record)}>编辑</a>
         </div>
-      )
+      ),
     }];
 
     // 配置分页
-    tableProps.pagination = !!pagination && { ...pagination, showSizeChanger: true, showQuickJumper: true, showTotal: total => `共 ${total} 条`};
+    tableProps.pagination = !!pagination && { ...pagination, showSizeChanger: true, showQuickJumper: true, showTotal: total => `共 ${total} 条` };
 
     // 添加动画
-    const AnimationTableBody = (props) => (<AnimTableBody {...props}/>);
+    const AnimationTableBody = props => (<AnimTableBody {...props} />);
 
     return (
       <Table
         simple
         bordered
-        { ...tableProps }
+        {...tableProps}
         columns={columns}
         className={classnames({ [styles.table]: true, [styles.motion]: true })}
         rowKey={record => record.id}
         components={{
-          body: { wrapper: AnimationTableBody }
+          body: { wrapper: AnimationTableBody },
         }}
       />
     );

+ 14 - 14
src/routes/CmsUser/index.js

@@ -38,7 +38,7 @@ export default class CMSUser extends Component {
     const { field, keyword, ...filters } = query;
     const { list, listLoading, pagination, currentItem, itemLoading, modalVisible, modalType } = cmsUser;
 
-    Object.keys(filters).map(key => { filters[key] ? null : delete filters[key] });
+    Object.keys(filters).map((key) => { filters[key] ? null : delete filters[key]; });
     if (field && keyword) {
       filters.field = field;
       filters.keyword = keyword;
@@ -52,13 +52,13 @@ export default class CMSUser extends Component {
       modalType,
       title: `${modalType === 'create' ? '添加CMS用户' : '编辑CMS用户'}`,
       wrapClassName: 'vertical-center-modal',
-      onOk (data) {
+      onOk(data) {
         dispatch({
           type: `cmsUser/${modalType}`,
           payload: data,
         });
       },
-      onCancel () {
+      onCancel() {
         dispatch({
           type: 'cmsUser/hideModal',
         });
@@ -76,8 +76,8 @@ export default class CMSUser extends Component {
         dispatch(routerRedux.push({
           pathname,
           search: queryString.stringify({
-            ...payload
-          })
+            ...payload,
+          }),
         }));
       },
       onAdd: () => {
@@ -87,7 +87,7 @@ export default class CMSUser extends Component {
             modalType: 'create',
           },
         });
-      }
+      },
     };
 
     const listProps = {
@@ -105,7 +105,7 @@ export default class CMSUser extends Component {
         }, {});
 
         const data = { ...filters, ...tableFilters };
-        Object.keys(data).map(key => data[key] ? null : delete data[key]);
+        Object.keys(data).map(key => (data[key] ? null : delete data[key]));
         dispatch(routerRedux.push({
           pathname,
           search: queryString.stringify({
@@ -123,7 +123,7 @@ export default class CMSUser extends Component {
             modalType: 'update',
             currentItem: item,
           },
-        })
+        });
       },
       // 封禁
       onDeleteItem: (id) => {
@@ -137,7 +137,7 @@ export default class CMSUser extends Component {
                 search: queryString.stringify(filters),
               })
             );
-          }
+          },
         });
       },
       // 解禁
@@ -152,17 +152,17 @@ export default class CMSUser extends Component {
                 search: queryString.stringify(filters),
               })
             );
-          }
+          },
         });
-      }
+      },
     };
 
     return (
       <PageHeaderLayout>
         <Card>
-          <CMSUserSearch { ...searchProps } />
-          <CMSUserTableList { ...listProps } />
-          {modalVisible && <CMSUserModalForm { ...modalProps } />}
+          <CMSUserSearch {...searchProps} />
+          <CMSUserTableList {...listProps} />
+          {modalVisible && <CMSUserModalForm {...modalProps} />}
         </Card>
       </PageHeaderLayout>
     );

+ 11 - 11
src/routes/CmsUser/modal.js

@@ -37,7 +37,7 @@ export default class CMSUserModalForm extends Component {
         <Form layout="horizontal">
           <Form.Item label="选择厂商" hasFeedback {...formItemLayout}>
             {getFieldDecorator('merchantId', {
-              rules: [{ required: true, type: 'string', message: "该项为必选项!" }],
+              rules: [{ required: true, type: 'string', message: '该项为必选项!' }],
               initialValue: item.merchantId,
             })(
               <Select
@@ -57,20 +57,20 @@ export default class CMSUserModalForm extends Component {
               initialValue: item.name,
             })(<Input placeholder="请输入" />)}
           </Form.Item>
-          {modalType === 'create' ?
+          {modalType === 'create' ? (
             <Form.Item label="用户密码:" hasFeedback {...formItemLayout}>
               {getFieldDecorator('password', {
                 rules: [{ required: true, type: 'string', message: '密码为必填项!' }],
                 initialValue: item.password,
               })(<Input placeholder="请输入" />)}
             </Form.Item>
-            :
-            <Form.Item label="用户密码:" hasFeedback {...formItemLayout}>
-              {getFieldDecorator('password', {
+) : (
+  <Form.Item label="用户密码:" hasFeedback {...formItemLayout}>
+    {getFieldDecorator('password', {
                 initialValue: item.password,
-              })(<Input placeholder="修改密码时填写"/>)}
-            </Form.Item>
-          }
+              })(<Input placeholder="修改密码时填写" />)}
+  </Form.Item>
+)}
           <Form.Item label="用户昵称:" hasFeedback {...formItemLayout}>
             {getFieldDecorator('nickName', {
               initialValue: item.nickName,
@@ -81,8 +81,8 @@ export default class CMSUserModalForm extends Component {
               initialValue: item.gender || 'MALE',
             })(
               <Radio.Group>
-                <Radio value={'MALE'} key={'MALE'}>男</Radio>
-                <Radio value={'FEMALE'} key={'FEMALE'}>女</Radio>
+                <Radio value="MALE" key="MALE">男</Radio>
+                <Radio value="FEMALE" key="FEMALE">女</Radio>
               </Radio.Group>
             )}
           </Form.Item>
@@ -114,7 +114,7 @@ export default class CMSUserModalForm extends Component {
           <Form.Item label="账号状态:" {...formItemLayout}>
             {getFieldDecorator('status', {
               valuePropsName: 'checked',
-          })(<Switch defaultChecked={item.status === Codes.CODE_NORMAL ? true : false} checkedChildren="使用中" unCheckedChildren="禁用中" />)}
+          })(<Switch defaultChecked={item.status === Codes.CODE_NORMAL} checkedChildren="使用中" unCheckedChildren="禁用中" />)}
           </Form.Item>
         </Form>
       </Modal>

+ 1 - 1
src/routes/CmsUser/search.js

@@ -32,7 +32,7 @@ export default class CMSUserSearch extends Component {
     return (
       <Row gutter={24}>
         <Col lg={10} md={12} sm={16} xs={24} style={{ marginBottom: 16 }}>
-          <DataSearch { ...searchGroupProps } />
+          <DataSearch {...searchGroupProps} />
         </Col>
         <Col lg={{ offset: 7, span: 7 }} md={12} sm={8} xs={24} style={{ marginBottom: 16, textAlign: 'right' }}>
           <Button type="primary" onClick={onAdd}><Icon type="plus-circle" />添加用户</Button>

+ 18 - 19
src/routes/CmsUser/table.js

@@ -9,13 +9,12 @@ import { Codes, statuses, domains } from '../../utils/config';
 import styles from './table.less';
 
 export default class CMSUserTableList extends Component {
-
   handleOperateItem = (record) => {
     Modal.confirm({
       title: `您确定要${record.status === Codes.CODE_NORMAL ? '禁用' : '解禁'}该账户?`,
-      onOk () {
+      onOk() {
         if (record.status === Codes.CODE_NORMAL) {
-          onDeleteItem({id: record.id});
+          onDeleteItem({ id: record.id });
         } else {
           onRecoverItem({ id: record.id, status: Codes.CODE_NORMAL });
         }
@@ -43,48 +42,48 @@ export default class CMSUserTableList extends Component {
       render: (text, record) => (
         <Avatar
           src={text}
-          style={{ backgroundColor: colorList[Math.floor(Math.random()*(colorList.length -1))], verticalAlign: 'middle' }}
+          style={{ backgroundColor: colorList[Math.floor(Math.random() * (colorList.length - 1))], verticalAlign: 'middle' }}
         >
           {record.nickname}
         </Avatar>
-      )
-    },{
+      ),
+    }, {
       title: '用户名称',
       dataIndex: 'name',
       key: 'name',
-    },{
+    }, {
       title: '用户昵称',
       dataIndex: 'nickName',
       key: 'nickName',
-    },{
+    }, {
       title: '厂商名称',
       dataIndex: 'merchantId',
       key: 'merchantId',
       render: (text, record) => record.merchantName,
-    },{
+    }, {
       title: '厂商类型',
       dataIndex: 'domain',
       key: 'domain',
-      render: (text, record) => domains[record.domain]
-    },{
+      render: (text, record) => domains[record.domain],
+    }, {
       title: '状态',
       dataIndex: 'status',
       key: 'status',
       render: (text, record) => {
-        const statusMap = {[Codes.CODE_NORMAL]: 'success', [Codes.CODE_DELETE]: 'error'};
+        const statusMap = { [Codes.CODE_NORMAL]: 'success', [Codes.CODE_DELETE]: 'error' };
         return (<Badge status={statusMap[record.status]} text={statuses[record.status]} />);
       },
       filters: Object.keys(statuses).map(key => ({ text: statuses[key], value: key })),
       filterMultiple: false,
       filteredValue: curStatus,
-    },{
+    }, {
       title: '修改时间',
       dataIndex: 'gmtModified',
       key: 'gmtModified',
       render: (text, record) => (
         <div>{moment(text).format('YYYY-MM-DD HH:mm:ss')}</div>
       ),
-    },{
+    }, {
       title: '操作',
       dataIndex: 'operation',
       key: 'operation',
@@ -94,25 +93,25 @@ export default class CMSUserTableList extends Component {
           <span className={styles.splitLine} />
           <a onClick={() => this.handleOperateItem(record)}>{record.status === Codes.CODE_NORMAL ? '禁用' : '解禁'}</a>
         </div>
-      )
+      ),
     }];
 
     // 配置分页
-    tableProps.pagination = !!pagination && { ...pagination, showSizeChanger: true, showQuickJumper: true, showTotal: total => `共 ${total} 条`};
+    tableProps.pagination = !!pagination && { ...pagination, showSizeChanger: true, showQuickJumper: true, showTotal: total => `共 ${total} 条` };
 
     // 添加动画
-    const AnimationTableBody = (props) => (<AnimTableBody {...props}/>);
+    const AnimationTableBody = props => (<AnimTableBody {...props} />);
 
     return (
       <Table
         simple
         bordered
-        { ...tableProps }
+        {...tableProps}
         columns={columns}
         className={classnames({ [styles.table]: true, [styles.motion]: true })}
         rowKey={record => record.id}
         components={{
-          body: { wrapper: AnimationTableBody }
+          body: { wrapper: AnimationTableBody },
         }}
       />
     );

+ 1 - 1
src/routes/Dashboard/index.js

@@ -134,7 +134,7 @@ export default class Dashboard extends Component {
               bordered={false}
               title="活跃量"
               action={<Tooltip title="指标说明"><Icon type="info-circle-o" /></Tooltip>}
-              total={`2037个`}
+              total="2037个"
               footer={<Field label="日活增长" value={200} />}
               contentHeight={46}
             >

+ 18 - 19
src/routes/Frontend/index.js

@@ -12,7 +12,6 @@ import { pageSize } from '../../utils/config';
   mproduct: state.mproduct,
 }))
 export default class FrontendConfiger extends PureComponent {
-
   state = { curTab: 'recommend' };
 
   handleTabChange = (key) => {
@@ -52,7 +51,7 @@ export default class FrontendConfiger extends PureComponent {
         merchantId,
         pageNo: 1,
         pageSize,
-      }
+      },
     });
   }
 
@@ -73,7 +72,7 @@ export default class FrontendConfiger extends PureComponent {
       pageSize: pagination.pageSize,
     };
 
-    Object.keys(data).map(key => data[key] ? null : delete data[key]);
+    Object.keys(data).map(key => (data[key] ? null : delete data[key]));
     dispatch({ type: 'mproduct/query', payload: data });
   }
 
@@ -110,22 +109,22 @@ export default class FrontendConfiger extends PureComponent {
 
     const contentMap = {
       recommend:
-        <RecommendList
-          rowKeyName="id"
-          loading={loading}
-          selTableData={item}
-          modalVisible={modalShow}
-          fsTableDataSource={mproduct.list}
-          fsTablePagination={mproduct.pagination}
-          fsTableLoading={mproduct.listLoading}
-          fsTableOnChange={this.handleRecommendModalTableChange}
-          onOk={this.handleRecommendModalOk}
-          onCancel={this.handleRecommendModalCancel}
-          onSearch={this.handleRecommendModalSearch}
-          modalShowController={this.handleRecommendAdjustClick}
-          onPageCancel={this.handleRecommendPageCancel}
-          onPageSubmit={this.handleRecommendPageSubmit}
-        />
+  <RecommendList
+    rowKeyName="id"
+    loading={loading}
+    selTableData={item}
+    modalVisible={modalShow}
+    fsTableDataSource={mproduct.list}
+    fsTablePagination={mproduct.pagination}
+    fsTableLoading={mproduct.listLoading}
+    fsTableOnChange={this.handleRecommendModalTableChange}
+    onOk={this.handleRecommendModalOk}
+    onCancel={this.handleRecommendModalCancel}
+    onSearch={this.handleRecommendModalSearch}
+    modalShowController={this.handleRecommendAdjustClick}
+    onPageCancel={this.handleRecommendPageCancel}
+    onPageSubmit={this.handleRecommendPageSubmit}
+  />,
     };
 
     return (

+ 12 - 13
src/routes/Frontend/recommend.js

@@ -6,7 +6,6 @@ import styles from './recommend.less';
 import { productType } from '../../utils/config';
 
 export default class RecommendList extends PureComponent {
-
   render() {
     const {
       loading,
@@ -38,7 +37,7 @@ export default class RecommendList extends PureComponent {
       searchSelect: true,
       searchSelectOptions: [{
         value: 'name', name: '产品名称', mode: 'input',
-      },{
+      }, {
         value: 'code', name: '产品编号', mode: 'input',
       }],
       searchSelectProps: {
@@ -55,21 +54,21 @@ export default class RecommendList extends PureComponent {
       tableClassName: styles.sTable,
       tablePagination: false,
       tableDataSource: selTableData,
-      rowKeyName: rowKeyName,
+      rowKeyName,
       tableColumns: [{
         title: '产品编号',
         dataIndex: 'code',
         key: 'code',
-      },{
+      }, {
         title: '产品名称',
         dataIndex: 'name',
         key: 'name',
-      },{
+      }, {
         title: '类型',
         dataIndex: 'type',
         key: 'type',
         render: (text, record) => productType[text],
-      }]
+      }],
     };
 
     const fsTableProps = {
@@ -78,33 +77,33 @@ export default class RecommendList extends PureComponent {
         title: '产品编号',
         dataIndex: 'code',
         key: 'code',
-      },{
+      }, {
         title: '产品名称',
         dataIndex: 'name',
         key: 'name',
-      },{
+      }, {
         title: '类型',
         dataIndex: 'type',
         key: 'type',
         render: (text, record) => productType[text],
       }],
       ...fsTableOpts,
-    }
+    };
 
     const columns = [{
       title: '产品编号',
       dataIndex: 'code',
       key: 'code',
-    },{
+    }, {
       title: '产品名称',
       dataIndex: 'name',
       key: 'name',
-    },{
+    }, {
       title: '类型',
       dataIndex: 'type',
       key: 'type',
       render: (text, record) => productType[text],
-    },{
+    }, {
       title: '位置',
       dataIndex: 'sort',
       key: 'sort',
@@ -124,7 +123,7 @@ export default class RecommendList extends PureComponent {
           <Button onClick={onPageCancel} style={{ marginTop: 20 }}>退出</Button>
           <Button onClick={onPageSubmit} type="primary" style={{ marginLeft: 50, marginTop: 20 }}>保存</Button>
         </Card>
-        {/*渠道产品选择模态框*/}
+        {/* 渠道产品选择模态框 */}
         <SelectModal
           mode="multiple"
           {...modalProps}

+ 0 - 1
src/routes/Frontend/recommend.less

@@ -60,7 +60,6 @@
   }
 }
 
-
 .sTable {
   :global {
     .ant-table-tbody > tr > td,

+ 2 - 2
src/routes/Login/index.js

@@ -20,7 +20,7 @@ export default class Login extends Component {
   handleSubmit = (e) => {
     const { dispatch } = this.props;
     e.preventDefault();
-    this.props.form.validateFields(err => {
+    this.props.form.validateFields((err) => {
       if (err) return;
       const values = this.props.form.getFieldsValue(['username', 'password']);
       dispatch({ type: 'login/login', payload: { ...values } });
@@ -46,7 +46,7 @@ export default class Login extends Component {
       <div className={styles.main}>
         <Form onSubmit={this.handleSubmit}>
           <Tabs animated={false} className={styles.tabs} activeKey={type} onChange={this.onSwitch}>
-            <TabPane tab={<span><Icon type="user"/>账户密码登录</span>} key="account">
+            <TabPane tab={<span><Icon type="user" />账户密码登录</span>} key="account">
               <FormItem hasFeedback>
                 {getFieldDecorator('username', {
                   rules: [{

+ 17 - 18
src/routes/MProduct/Edit/index.js

@@ -20,7 +20,6 @@ const confirm = Modal.confirm;
   tagModel: state.tagModel,
 }))
 export default class MerchantProductEdit extends PureComponent {
-
   handleAddPriceClick = () => {
     this.props.dispatch({
       type: 'goodsModel/showModal',
@@ -42,8 +41,8 @@ export default class MerchantProductEdit extends PureComponent {
     const { dispatch, location } = this.props;
     const { search } = location;
     confirm({
-      title: `您确定要删除此定价?`,
-      onOk () {
+      title: '您确定要删除此定价?',
+      onOk() {
         dispatch({
           type: 'goodsModel/removeItem',
           payload: { id: record.id },
@@ -52,7 +51,7 @@ export default class MerchantProductEdit extends PureComponent {
               pathname: '/goods/edit',
               search,
             }));
-          }
+          },
         });
       },
     });
@@ -72,7 +71,7 @@ export default class MerchantProductEdit extends PureComponent {
         pageSize,
         status: Codes.CODE_NORMAL,
         merchantId,
-      }
+      },
     });
   }
 
@@ -94,7 +93,7 @@ export default class MerchantProductEdit extends PureComponent {
           pathname: '/goods/edit',
           search,
         }));
-      }
+      },
     });
   }
 
@@ -117,7 +116,7 @@ export default class MerchantProductEdit extends PureComponent {
         pageSize,
         status: Codes.CODE_NORMAL,
         merchantId,
-      }
+      },
     });
   }
 
@@ -151,11 +150,11 @@ export default class MerchantProductEdit extends PureComponent {
       merchantId,
     };
 
-    Object.keys(data).map(key => data[key] ? null : delete data[key]);
+    Object.keys(data).map(key => (data[key] ? null : delete data[key]));
     dispatch({ type: 'tagModel/query', payload: { ...data } });
   }
 
-  render(){
+  render() {
     const { mproductDetail, goodsModel, tagModel, location } = this.props;
     const { currentItem } = mproductDetail;
     const { modalShow, tagModalShow, operation, goodsItem } = goodsModel;
@@ -183,7 +182,7 @@ export default class MerchantProductEdit extends PureComponent {
               pathname: '/goods/edit',
               search,
             }));
-          }
+          },
         });
       },
     };
@@ -192,25 +191,25 @@ export default class MerchantProductEdit extends PureComponent {
       simple: true,
       bordered: true,
       pagination: false,
-      rowKey: (record) => record.id,
+      rowKey: record => record.id,
       dataSource: goods,
       columns: [{
         title: '计价单位',
         dataIndex: 'chargeUnit',
         key: 'chargeUnit',
-      },{
+      }, {
         title: '供应商价格(¥)',
         dataIndex: 'cpPrice',
         key: 'cpPrice',
-      },{
+      }, {
         title: '渠道方价格(¥)',
         dataIndex: 'merchantPrice',
         key: 'merchantPrice',
-      },{
+      }, {
         title: '终端价格(¥)',
         dataIndex: 'terminalPrice',
         key: 'terminalPrice',
-      },{
+      }, {
         title: '操作',
         key: 'action',
         render: (text, record) => (
@@ -247,8 +246,8 @@ export default class MerchantProductEdit extends PureComponent {
           }
           style={{ marginBottom: 15 }}
         >
-          <Table { ...listTableProps }/>
-          <NewPriceModal { ...priceModalProps } />
+          <Table {...listTableProps} />
+          <NewPriceModal {...priceModalProps} />
         </Card>
         <Card
           bordered={false}
@@ -260,7 +259,7 @@ export default class MerchantProductEdit extends PureComponent {
           }
           style={{ marginBottom: 15 }}
         >
-          {/*标签的模态选择框*/}
+          {/* 标签的模态选择框 */}
           <TagSelectModal
             rowKeyName="id"
             modalVisible={tagModalShow}

+ 5 - 6
src/routes/MProduct/Edit/price.js

@@ -6,7 +6,6 @@ const Option = Select.Option;
 
 @Form.create()
 export default class NewPriceModal extends PureComponent {
-
   handleModalOnOk = () => {
     const {
       form: {
@@ -38,9 +37,9 @@ export default class NewPriceModal extends PureComponent {
     };
 
     return (
-      <Modal { ...modalProps } onOk={this.handleModalOnOk} >
+      <Modal {...modalProps} onOk={this.handleModalOnOk} >
         <Form layout="horizontal" >
-          <Form.Item label="计价单位" { ...formItemLayout }>
+          <Form.Item label="计价单位" {...formItemLayout}>
             {getFieldDecorator('chargeUnit', {
               rules: [{ required: true, type: 'string', message: '请选择一种计价单位!' }],
               initialValue: data.chargeUnit,
@@ -50,7 +49,7 @@ export default class NewPriceModal extends PureComponent {
               </Select>
             )}
           </Form.Item>
-          <Form.Item label="供应商价格" { ...formItemLayout }>
+          <Form.Item label="供应商价格" {...formItemLayout}>
             {getFieldDecorator('cpPrice', {
               initialValue: data.cpPrice,
             })(
@@ -63,7 +62,7 @@ export default class NewPriceModal extends PureComponent {
               />
             )}
           </Form.Item>
-          <Form.Item label="渠道方价格" { ...formItemLayout }>
+          <Form.Item label="渠道方价格" {...formItemLayout}>
             {getFieldDecorator('merchantPrice', {
               initialValue: data.merchantPrice,
             })(
@@ -76,7 +75,7 @@ export default class NewPriceModal extends PureComponent {
               />
             )}
           </Form.Item>
-          <Form.Item label="终端价格" { ...formItemLayout }>
+          <Form.Item label="终端价格" {...formItemLayout}>
             {getFieldDecorator('terminalPrice', {
               initialValue: data.terminalPrice,
             })(

+ 13 - 14
src/routes/MProduct/Edit/tags.js

@@ -4,7 +4,6 @@ import SelectModal from '../../../components/SelectModal';
 import { Codes } from '../../../utils/config';
 
 export default class TagSelectModal extends PureComponent {
-
   render() {
     const {
       rowKeyName,
@@ -40,58 +39,58 @@ export default class TagSelectModal extends PureComponent {
       },
     };
 
-    //已选资源列表
+    // 已选资源列表
     const selTableProps = {
       operDel: true,
       tablePagination: false,
       tableDataSource: selTableData,
-      rowKeyName: rowKeyName,
+      rowKeyName,
       tableColumns: [{
         title: '标签名称',
         dataIndex: 'name',
         key: 'name',
         width: '26%',
-      },{
+      }, {
         title: '标签组名称',
         dataIndex: 'groupName',
         key: 'groupName',
         width: '26%',
-      },{
+      }, {
         title: '渠道名称',
         dataIndex: 'merchantName',
         key: 'merchantName',
         width: '26%',
-      }]
+      }],
     };
 
-    //待选资源Table属性
+    // 待选资源Table属性
     const fsTableProps = {
       fsTableColumns: [{
         title: '标签名称',
         dataIndex: 'name',
         key: 'name',
         width: '26%',
-      },{
+      }, {
         title: '标签组名称',
         dataIndex: 'groupName',
         key: 'groupName',
         width: '26%',
-      },{
+      }, {
         title: '渠道名称',
         dataIndex: 'merchantName',
         key: 'merchantName',
         width: '26%',
       }],
       ...fsTableOpts,
-    }
+    };
 
     return (
       <SelectModal
         mode="multiple"
-        { ...searchProps }
-        { ...selTableProps }
-        { ...fsTableProps }
-        { ...modalProps }
+        {...searchProps}
+        {...selTableProps}
+        {...fsTableProps}
+        {...modalProps}
       />
     );
   }

+ 12 - 12
src/routes/MProduct/List/index.js

@@ -24,10 +24,10 @@ export default class MerchantProductList extends PureComponent {
     location.query = queryString.parse(location.search);
     const { query, pathname } = location;
     const { field, keyword, ...filters } = query;
-    const { list, listLoading, pagination  } = mproduct;
+    const { list, listLoading, pagination } = mproduct;
 
     // 把携带的参数中空值项删除
-    Object.keys(filters).map(key => { filters[key] ? null : delete filters[key] });
+    Object.keys(filters).map((key) => { filters[key] ? null : delete filters[key]; });
     // 如果搜索内容不为空则添加进filters中
     if (field && keyword) {
       filters.field = field;
@@ -45,8 +45,8 @@ export default class MerchantProductList extends PureComponent {
         dispatch(routerRedux.push({
           pathname,
           search: queryString.stringify({
-            ...payload
-          })
+            ...payload,
+          }),
         }));
       },
       onAdd: () => {
@@ -56,7 +56,7 @@ export default class MerchantProductList extends PureComponent {
             state: filters,
           })
         );
-      }
+      },
     };
 
     const listProps = {
@@ -74,7 +74,7 @@ export default class MerchantProductList extends PureComponent {
         }, {});
 
         const data = { ...filters, ...tableFilters };
-        Object.keys(data).map(key => data[key] ? null : delete data[key]);
+        Object.keys(data).map(key => (data[key] ? null : delete data[key]));
         dispatch(routerRedux.push({
           pathname,
           search: queryString.stringify({
@@ -87,7 +87,7 @@ export default class MerchantProductList extends PureComponent {
       onEditItem: (item) => {
         dispatch(
           routerRedux.push({
-            pathname: `/goods/edit`,
+            pathname: '/goods/edit',
             search: queryString.stringify({
               merchantId: item.merchantId,
               pid: item.pid,
@@ -107,7 +107,7 @@ export default class MerchantProductList extends PureComponent {
                 search: queryString.stringify(filters),
               })
             );
-          }
+          },
         });
       },
       onRecoverItem: (payload) => {
@@ -121,16 +121,16 @@ export default class MerchantProductList extends PureComponent {
                 search: queryString.stringify(filters),
               })
             );
-          }
+          },
         });
-      }
+      },
     };
 
     return (
       <PageHeaderLayout>
         <Card>
-          <Search { ...searchProps } />
-          <TableList { ...listProps } />
+          <Search {...searchProps} />
+          <TableList {...listProps} />
         </Card>
       </PageHeaderLayout>
     );

+ 2 - 2
src/routes/MProduct/List/search.js

@@ -23,7 +23,7 @@ export default class Search extends PureComponent {
       select: true,
       selectOptions: [{
         value: 'name', name: '产品名称', mode: 'input',
-      },{
+      }, {
         value: 'code', name: '产品编号', mode: 'input',
       }],
       selectProps: {
@@ -37,7 +37,7 @@ export default class Search extends PureComponent {
     return (
       <Row gutter={24}>
         <Col lg={10} md={12} sm={16} xs={24} style={{ marginBottom: 16 }}>
-          <DataSearch { ...searchGroupProps } />
+          <DataSearch {...searchGroupProps} />
         </Col>
       </Row>
     );

+ 15 - 16
src/routes/MProduct/List/table.js

@@ -9,19 +9,18 @@ import { itemStatuses, Codes, productType } from '../../../utils/config';
 import styles from './table.less';
 
 export default class TableList extends PureComponent {
-
   handleOperateItem = (record) => {
     const { onDeleteItem, onRecoverItem } = this.props;
     Modal.confirm({
       title: `您确定要${record.status === Codes.CODE_NORMAL ? '下架' : '出售'}该产品?`,
-      onOk () {
+      onOk() {
         if (record.status === Codes.CODE_NORMAL) {
           onDeleteItem({ pid: record.pid, merchantId: record.merchantId, status: Codes.CODE_DELETE });
         } else if (record.status === Codes.CODE_DELETE) {
           onRecoverItem({ pid: record.pid, merchantId: record.merchantId, status: Codes.CODE_NORMAL });
         }
       },
-    })
+    });
   }
 
   render() {
@@ -38,34 +37,34 @@ export default class TableList extends PureComponent {
       title: '产品编号',
       dataIndex: 'code',
       key: 'code',
-    },{
+    }, {
       title: '产品名称',
       dataIndex: 'name',
       key: 'name',
-    },{
+    }, {
       title: '产品类型',
       dataIndex: 'type',
       key: 'type',
       render: (text, record) => productType[record.type],
-    },{
+    }, {
       title: '状态',
       dataIndex: 'status',
       key: 'status',
       render: (text, record) => {
-        const statusMap = {[Codes.CODE_NORMAL]: 'success', [Codes.CODE_DELETE]: 'error'};
+        const statusMap = { [Codes.CODE_NORMAL]: 'success', [Codes.CODE_DELETE]: 'error' };
         return (<Badge status={statusMap[record.status]} text={itemStatuses[record.status]} />);
       },
       filters: Object.keys(itemStatuses).map(key => ({ text: itemStatuses[key], value: key })),
       filterMultiple: false,
       filteredValue: [curStatus],
-    },{
+    }, {
       title: '创建时间',
       dataIndex: 'gmtModified',
       key: 'gmtModified',
       render: (text, record) => (
         <div>{moment(text).format('YYYY-MM-DD HH:mm:ss')}</div>
-      )
-    },{
+      ),
+    }, {
       title: '操作',
       dataIndex: 'operation',
       key: 'operation',
@@ -75,30 +74,30 @@ export default class TableList extends PureComponent {
           <Divider type="vertical" />
           <a onClick={() => this.handleOperateItem(record)}>{record.status === Codes.CODE_NORMAL ? '下架' : '出售'}</a>
         </div>
-      )
+      ),
     }];
 
     // 数据table列表表头的筛选按钮点击重置后status值为空,此时删除该参数
-    columns.map(item => {
+    columns.map((item) => {
       item.dataIndex === 'status' && !curStatus ? delete item.filteredValue : null;
     });
 
     // 配置分页
-    tableProps.pagination = !!pagination && { ...pagination, showSizeChanger: true, showQuickJumper: true, showTotal: total => `共 ${total} 条`};
+    tableProps.pagination = !!pagination && { ...pagination, showSizeChanger: true, showQuickJumper: true, showTotal: total => `共 ${total} 条` };
 
     // 添加动画
-    const AnimationTableBody = (props) => (<AnimTableBody {...props}/>);
+    const AnimationTableBody = props => (<AnimTableBody {...props} />);
 
     return (
       <Table
         simple
         bordered
-        { ...tableProps }
+        {...tableProps}
         columns={columns}
         className={classnames({ [styles.table]: true, [styles.motion]: true })}
         rowKey={record => record.id}
         components={{
-          body: { wrapper: AnimationTableBody }
+          body: { wrapper: AnimationTableBody },
         }}
       />
     );

+ 7 - 8
src/routes/Merchant/index.js

@@ -8,7 +8,6 @@ import { getLocalUser } from '../../utils/helper';
 @connect(state => ({ merchant: state.merchant }))
 @Form.create()
 export default class MerchantInfo extends PureComponent {
-
   handlePageCancel = () => {
     this.props.dispatch(routerRedux.push('/'));
   }
@@ -28,13 +27,13 @@ export default class MerchantInfo extends PureComponent {
         payload: data,
         callback: () => {
           dispatch(routerRedux.push('/'));
-        }
+        },
       });
     });
   }
 
   render() {
-    const { form , merchant } = this.props;
+    const { form, merchant } = this.props;
     const { item, loading } = merchant;
     const { getFieldDecorator } = form;
 
@@ -62,7 +61,7 @@ export default class MerchantInfo extends PureComponent {
         <Spin spinning={loading}>
           <Card>
             <Form layout="horizontal" onSubmit={this.handlePageSubmit}>
-            {/*
+              {/*
               <Form.Item label="厂商编号" hasFeedback {...formItemLayout}>
                 {getFieldDecorator('code',{
                   rules: [{ required: true, type: 'string', message: '编号为必填写!' }],
@@ -88,24 +87,24 @@ export default class MerchantInfo extends PureComponent {
               </Form.Item>
             */}
               <Form.Item label="开户银行" hasFeedback {...formItemLayout}>
-                {getFieldDecorator('depositBank',{
+                {getFieldDecorator('depositBank', {
                   rules: [{ required: true, type: 'string', message: '开户银行为必填项!' }],
                   initialValue: item.depositBank,
                 })(<Input />)}
               </Form.Item>
               <Form.Item label="银行账户" hasFeedback {...formItemLayout}>
-                {getFieldDecorator('bankAccount',{
+                {getFieldDecorator('bankAccount', {
                   rules: [{ required: true, type: 'string', message: '银行账户为必填项!' }],
                   initialValue: item.bankAccount,
                 })(<Input />)}
               </Form.Item>
               <Form.Item label="营业执照编号" hasFeedback {...formItemLayout}>
-                {getFieldDecorator('licenseId',{
+                {getFieldDecorator('licenseId', {
                   initialValue: item.licenseId,
                 })(<Input />)}
               </Form.Item>
               <Form.Item label="纳税人识别号" hasFeedback {...formItemLayout}>
-                {getFieldDecorator('taxNumber',{
+                {getFieldDecorator('taxNumber', {
                   initialValue: item.taxNumber,
                 })(<Input />)}
               </Form.Item>

+ 20 - 22
src/routes/Order/Add/index.js

@@ -17,7 +17,6 @@ import styles from './index.less';
   mproduct: state.mproduct,
 }))
 export default class CreateOrder extends Component {
-
   // 终端选择弹框相关的回调方法
   handleTerminalSelectBtnClick = () => {
     this.props.dispatch({ type: 'orderDetail/showTerminalModal' });
@@ -26,7 +25,7 @@ export default class CreateOrder extends Component {
       payload: {
         pageNo: 1,
         pageSize,
-      }
+      },
     });
   }
 
@@ -39,7 +38,7 @@ export default class CreateOrder extends Component {
         campusName: record.campusName,
         merchantName: record.merchantName,
         merchantId: record.merchantId,
-      }
+      },
     });
   }
 
@@ -111,20 +110,20 @@ export default class CreateOrder extends Component {
           cpPrice: 2000,
           merchantPrice: 3000,
           terminalPrice: 4000,
-        },{
+        }, {
           id: '2',
           chargeUnit: '半年',
           cpPrice: 1000,
           merchantPrice: 2000,
           terminalPrice: 3000,
-        },{
+        }, {
           id: '3',
           chargeUnit: '季',
           cpPrice: 500,
           merchantPrice: 800,
           terminalPrice: 1000,
         }],
-      },{
+      }, {
         id: 'package-1',
         code: '课程包-01',
         name: '小学一年级语文课程包',
@@ -132,7 +131,7 @@ export default class CreateOrder extends Component {
         coverUrl: 'https://os.alipayobjects.com/rmsportal/QBnOOoLaAfKPirc.png',
         goods: [{
 
-        }]
+        }],
       }],
     };
     const { userCode, userName, campusName, merchantName, merchantId, products } = currentItem;
@@ -156,7 +155,7 @@ export default class CreateOrder extends Component {
       render: (text, record) => (
         <Popover
           content={
-            <Card hoverable style={{ width: 350, height: 550 }} cover={<img alt="" src={text}/>}>
+            <Card hoverable style={{ width: 350, height: 550 }} cover={<img alt="" src={text} />}>
               <Card.Meta
                 title={`${record.name}/${record.code}`}
                 description={`类型: ${productType[record.type]}`}
@@ -167,7 +166,7 @@ export default class CreateOrder extends Component {
           <img src={text} width={50} />
         </Popover>
       ),
-    },{
+    }, {
       title: '价格类型',
       dataIndex: 'goods',
       key: 1,
@@ -181,7 +180,7 @@ export default class CreateOrder extends Component {
         ><a>付费方式<Icon type="down" /></a>
         </Dropdown>
       ),
-    },{
+    }, {
       title: '优惠价格',
       dataIndex: 'adjustPrice',
       key: 2,
@@ -193,11 +192,11 @@ export default class CreateOrder extends Component {
           parser={value => value.replace(/\¥\s?|(,*)/g, '')}
         />
       ),
-    },{
+    }, {
       title: '实际售价',
       dataIndex: 'finalPrice',
       key: 3,
-    },{
+    }, {
       title: '数量',
       dataIndex: 'quantity',
       key: 4,
@@ -209,7 +208,7 @@ export default class CreateOrder extends Component {
           parser={value => value.replace(/\x\s?|(,*)/g, '')}
         />
       ),
-    },{
+    }, {
       title: '单位',
       dataIndex: 'chargeUnit',
       key: 5,
@@ -221,7 +220,7 @@ export default class CreateOrder extends Component {
           <Form>
             <Form.Item label="选择终端" {...formItemLayout}>
               <Button onClick={this.handleTerminalSelectBtnClick} type="primary" size="small" icon="plus-circle-o">选择</Button>
-              {userCode ?
+              {userCode ? (
                 <List
                   size="small"
                   bordered
@@ -229,16 +228,16 @@ export default class CreateOrder extends Component {
                   dataSource={[`终端编号: ${userCode}`, `终端名称: ${userName}`, `所属校区: ${campusName}`, `所属渠道: ${merchantName}`]}
                   renderItem={item => <List.Item>{item}</List.Item>}
                 />
-              : null}
+) : null}
             </Form.Item>
             <Form.Item label="收货地址" {...formItemLayout}>
-              <Input.TextArea style={{ width: "50%" }} placeholder="请填写或使用默认地址"/>
+              <Input.TextArea style={{ width: '50%' }} placeholder="请填写或使用默认地址" />
             </Form.Item>
             <Form.Item label="添加备注" {...formItemLayout}>
-              <Input.TextArea style={{ width: "50%" }} placeholder="请输入(选填)" />
+              <Input.TextArea style={{ width: '50%' }} placeholder="请输入(选填)" />
             </Form.Item>
             <Form.Item label="添加商品" {...formItemLayout}>
-              <Button onClick={this.handleProductSelectBtnClick} disabled={merchantId ? false : true} type="primary" size="small" icon="plus-circle-o">添加</Button>
+              <Button onClick={this.handleProductSelectBtnClick} disabled={!merchantId} type="primary" size="small" icon="plus-circle-o">添加</Button>
               <Table
                 size="large"
                 className={styles.table}
@@ -249,7 +248,7 @@ export default class CreateOrder extends Component {
               />
             </Form.Item>
           </Form>
-          {/*终端选择弹框*/}
+          {/* 终端选择弹框 */}
           <TerminalSelectModal
             rowKeyName="id"
             modalVisible={terminalModalShow}
@@ -263,7 +262,7 @@ export default class CreateOrder extends Component {
             fsTablePagination={terminal.pagination}
             fsTableOnChange={this.handleTerminalModalTableChange}
           />
-          {/*渠道产品选择弹框*/}
+          {/* 渠道产品选择弹框 */}
           <MerchantProductSelectModal
             rowKeyName="id"
             modalVisible={productModalShow}
@@ -287,8 +286,7 @@ export default class CreateOrder extends Component {
                 <Menu.Item>¥2000 / 季</Menu.Item>
               </Menu>
             }
-          >
-          </Dropdown.Button>
+          />
           <Button>取消</Button>
           <Button type="primary">完成</Button>
         </FooterToolbar>

+ 15 - 16
src/routes/Order/Add/product.js

@@ -3,7 +3,6 @@ import SelectModal from '../../../components/SelectModal';
 import { productType } from '../../../utils/config';
 
 export default class MerchantProductSelectModal extends PureComponent {
-
   render() {
     const { selTableData, modalVisible, rowKeyName, onCancel, onOk, onSearch, ...fsTableOpts } = this.props;
 
@@ -22,7 +21,7 @@ export default class MerchantProductSelectModal extends PureComponent {
       searchSelect: true,
       searchSelectOptions: [{
         value: 'name', name: '产品名称', mode: 'input',
-      },{
+      }, {
         value: 'code', name: '产品编号', mode: 'input',
       }],
       searchSelectProps: {
@@ -37,24 +36,24 @@ export default class MerchantProductSelectModal extends PureComponent {
       operDel: true,
       tablePagination: false,
       tableDataSource: selTableData,
-      rowKeyName: rowKeyName,
+      rowKeyName,
       tableColumns: [{
         title: '产品编号',
         dataIndex: 'code',
         key: 1,
         width: '27%',
-      },{
+      }, {
         title: '产品名称',
         dataIndex: 'name',
         key: 2,
-        width: '28%'
-      },{
+        width: '28%',
+      }, {
         title: '产品类型',
         dataIndex: 'type',
         key: 3,
         render: (text, record) => productType[text],
-        width: '15%'
-      },{
+        width: '15%',
+      }, {
         title: '渠道名称',
         dataIndex: 'merchantName',
         key: 4,
@@ -68,33 +67,33 @@ export default class MerchantProductSelectModal extends PureComponent {
         dataIndex: 'code',
         key: 1,
         width: '27%',
-      },{
+      }, {
         title: '产品名称',
         dataIndex: 'name',
         key: 2,
         width: '28%',
-      },{
+      }, {
         title: '产品类型',
         dataIndex: 'type',
         key: 3,
         render: (text, record) => productType[text],
         width: '15%',
-      },{
+      }, {
         title: '渠道名称',
         dataIndex: 'merchantName',
         key: 4,
         width: '15%',
       }],
       ...fsTableOpts,
-    }
+    };
 
     return (
       <SelectModal
         mode="multiple"
-        { ...searchProps }
-        { ...modalProps }
-        { ...selTableProps }
-        { ...fsTableProps }
+        {...searchProps}
+        {...modalProps}
+        {...selTableProps}
+        {...fsTableProps}
       />
     );
   }

+ 8 - 9
src/routes/Order/Add/terminal.js

@@ -3,7 +3,6 @@ import SelectModal from '../../../components/SelectModal';
 import { Codes } from '../../../utils/config';
 
 export default class TerminalSelectModal extends PureComponent {
-
   render() {
     const {
       modalVisible,
@@ -28,7 +27,7 @@ export default class TerminalSelectModal extends PureComponent {
       searchSelect: true,
       searchSelectOptions: [{
         value: 'name', name: '终端名称', mode: 'input',
-      },{
+      }, {
         value: 'code', name: '终端编号', mode: 'input',
       }],
       searchSelectProps: {
@@ -45,31 +44,31 @@ export default class TerminalSelectModal extends PureComponent {
         dataIndex: 'code',
         key: 1,
         width: '25%',
-      },{
+      }, {
         title: '终端名称',
         dataIndex: 'name',
         key: 2,
         width: '15%',
-      },{
+      }, {
         title: '校区名称',
         dataIndex: 'campusName',
         key: 3,
         width: '30%',
-      },{
+      }, {
         title: '渠道名称',
         dataIndex: 'merchantName',
         key: 4,
         width: '15%',
       }],
       ...fsTableOpts,
-    }
+    };
 
     return (
       <SelectModal
         mode="single"
-        { ...searchProps }
-        { ...fsTableProps }
-        { ...modalProps }
+        {...searchProps}
+        {...fsTableProps}
+        {...modalProps}
       />
     );
   }

+ 10 - 10
src/routes/Order/Edit/modal.js

@@ -30,7 +30,7 @@ export default class WareSelectSortModal extends PureComponent {
       searchSelect: true,
       searchSelectOptions: [{
         value: 'name', name: '课件名称', mode: 'input',
-      },{
+      }, {
         value: 'code', name: '课件编号', mode: 'input',
       }],
       searchSelectProps: {
@@ -47,40 +47,40 @@ export default class WareSelectSortModal extends PureComponent {
       tableClassName: styles.sTable,
       tablePagination: false,
       tableDataSource: selTableData,
-      rowKeyName: rowKeyName,
+      rowKeyName,
       tableColumns: [{
         title: '课件编号',
         dataIndex: 'code',
         key: 'code',
-      },{
+      }, {
         title: '课件名称',
         dataIndex: 'name',
         key: 'name',
       }],
     };
 
-    //待选资源Table属性
+    // 待选资源Table属性
     const fsTableProps = {
       fsTableClassName: styles.fsTable,
       fsTableColumns: [{
         title: '课件编号',
         dataIndex: 'code',
         key: 'code',
-      },{
+      }, {
         title: '课件名称',
         dataIndex: 'name',
         key: 'name',
       }],
       ...fsTableOpts,
-    }
+    };
 
     return (
       <SelectModal
         mode="multiple"
-        { ...searchProps }
-        { ...modalProps }
-        { ...selTableProps }
-        { ...fsTableProps }
+        {...searchProps}
+        {...modalProps}
+        {...selTableProps}
+        {...fsTableProps}
       />
     );
   }

+ 0 - 1
src/routes/Order/Edit/modal.less

@@ -56,7 +56,6 @@
   }
 }
 
-
 .sTable {
   :global {
     .ant-table-tbody > tr > td,

+ 9 - 9
src/routes/Order/Edit/orderProfile.js

@@ -20,39 +20,39 @@ export default class OrderProfile extends Component {
       title: '商品编号',
       dataIndex: 'code',
       key: 'code',
-    },{
+    }, {
       title: '商品类型',
       dataIndex: 'type',
       key: 'type',
-    },{
+    }, {
       title: '商品名称',
       dataIndex: 'name',
       key: 'name',
-    },{
+    }, {
       title: '领教定价',
       dataIndex: 'lingjiaoPrice',
       key: 'lingjiaoPrice',
-    },{
+    }, {
       title: '渠道定价',
       dataIndex: 'merchantPrice',
       key: 'merchantPrice',
-    },{
+    }, {
       title: '实际售价',
       dataIndex: 'finalPrice',
       key: 'finalPrice',
-    },{
+    }, {
       title: '数量',
       dataIndex: 'quality',
       key: 'quality',
-    },{
+    }, {
       title: '单位',
       dataIndex: 'chargeUnit',
       key: 'chargeUnit',
-    },{
+    }, {
       title: '起始时间',
       dataIndex: 'timeBegin',
       key: 'timeBegin',
-    },{
+    }, {
       title: '结束时间',
       dataIndex: 'timeEnd',
       key: 'timeEnd',

+ 10 - 10
src/routes/Order/List/index.js

@@ -28,7 +28,7 @@ export default class Order extends PureComponent {
     const { list, listLoading, pagination, currentItem, itemLoading, modalVisible, modalType } = order;
 
     // 把携带的参数中空值项删除
-    Object.keys(filters).map(key => { filters[key] ? null : delete filters[key] });
+    Object.keys(filters).map((key) => { filters[key] ? null : delete filters[key]; });
     // 如果搜索内容不为空则添加进filters中
     if (field && keyword) {
       filters.field = field;
@@ -46,8 +46,8 @@ export default class Order extends PureComponent {
         dispatch(routerRedux.push({
           pathname,
           search: queryString.stringify({
-            ...payload
-          })
+            ...payload,
+          }),
         }));
       },
       onAdd: () => {
@@ -57,7 +57,7 @@ export default class Order extends PureComponent {
             state: filters,
           })
         );
-      }
+      },
     };
 
     const listProps = {
@@ -77,7 +77,7 @@ export default class Order extends PureComponent {
         }, {});
 
         const data = { ...filters, ...tableFilters };
-        Object.keys(data).map(key => data[key] ? null : delete data[key]);
+        Object.keys(data).map(key => (data[key] ? null : delete data[key]));
         dispatch(routerRedux.push({
           pathname,
           search: queryString.stringify({
@@ -114,7 +114,7 @@ export default class Order extends PureComponent {
                 search: queryString.stringify(filters),
               })
             );
-          }
+          },
         });
       },
       onRecoverItem: (payload) => {
@@ -128,16 +128,16 @@ export default class Order extends PureComponent {
                 search: queryString.stringify(filters),
               })
             );
-          }
+          },
         });
-      }
+      },
     };
 
     return (
       <PageHeaderLayout>
         <Card>
-          <Search { ...searchProps } />
-          <TableList { ...listProps } />
+          <Search {...searchProps} />
+          <TableList {...listProps} />
         </Card>
       </PageHeaderLayout>
     );

+ 3 - 3
src/routes/Order/List/search.js

@@ -23,9 +23,9 @@ export default class Search extends PureComponent {
       select: true,
       selectOptions: [{
         value: 'campusName', name: '校区名称', mode: 'input',
-      },{
+      }, {
         value: 'campusCode', name: '校区编号', mode: 'input',
-      },{
+      }, {
         value: 'userCode', name: '终端编号', mode: 'input',
       }],
       selectProps: {
@@ -39,7 +39,7 @@ export default class Search extends PureComponent {
     return (
       <Row gutter={24}>
         <Col lg={10} md={12} sm={16} xs={24} style={{ marginBottom: 16 }}>
-          <DataSearch { ...searchGroupProps } />
+          <DataSearch {...searchGroupProps} />
         </Col>
         <Col lg={{ offset: 7, span: 7 }} md={12} sm={8} xs={24} style={{ marginBottom: 16, textAlign: 'right' }}>
           <Button type="primary" onClick={onAdd}><Icon type="plus-circle" />新建订单</Button>

+ 20 - 21
src/routes/Order/List/table.js

@@ -11,11 +11,10 @@ import { orderStatuses, Codes } from '../../../utils/config';
 const { RangePicker } = DatePicker;
 
 export default class TableList extends PureComponent {
-
   state = {
-    filtered: false,       //是否处于过滤状态
-    timeBegin: null,       //起始时间 - 默认当前时间戳
-    timeEnd: null,         //结束时间 - 默认时间戳
+    filtered: false, // 是否处于过滤状态
+    timeBegin: null, // 起始时间 - 默认当前时间戳
+    timeEnd: null, // 结束时间 - 默认时间戳
   }
 
   componentWillReceiveProps(nextProps) {
@@ -52,7 +51,7 @@ export default class TableList extends PureComponent {
         filtered: true,
         timeBegin: value[0],
         timeEnd: value[1],
-      })
+      });
     }
   }
 
@@ -76,10 +75,10 @@ export default class TableList extends PureComponent {
       onViewItem(record);
     } else if (e.key === '2') {
       console.log('enter into edit page...');
-    }else if (e.key === '3') {
+    } else if (e.key === '3') {
       Modal.confirm({
         title: '你确定要作废该订单?',
-        onOk () {
+        onOk() {
           console.log('deleting...');
           // onDeleteItem(record.id)
         },
@@ -126,37 +125,37 @@ export default class TableList extends PureComponent {
       title: '终端编号',
       dataIndex: 'userCode',
       key: 'userCode',
-    },{
+    }, {
       title: '校区',
       dataIndex: 'campusName',
       key: 'campusName',
       render: (text, record) => (
         <span>{`${record.provinceCode}-${record.cityName}-${record.zoneName}`}</span>
       ),
-    },{
+    }, {
       title: '商品标价(¥)',
       dataIndex: 'originPrice',
       key: 'originPrice',
-    },{
+    }, {
       title: '实际售价(¥)',
       dataIndex: 'finalPrice',
       key: 'finalPrice',
-    },{
+    }, {
       title: '价格调整(¥)',
       dataIndex: 'adjustPrice',
       key: 'adjustPrice',
-    },{
+    }, {
       title: '状态',
       dataIndex: 'status',
       key: 'status',
       render: (text, record) => {
-        const statusMap = {[Codes.CODE_PAID]: 'success', [Codes.CODE_UNPAID]: 'processing', [Codes.CODE_CANCEL]: 'error'};
+        const statusMap = { [Codes.CODE_PAID]: 'success', [Codes.CODE_UNPAID]: 'processing', [Codes.CODE_CANCEL]: 'error' };
         return (<Badge status={statusMap[record.status]} text={orderStatuses[record.status]} />);
       },
       filters: Object.keys(orderStatuses).map(key => ({ text: orderStatuses[key], value: key })),
       filterMultiple: false,
       filteredValue: [curStatus],
-    },{
+    }, {
       title: '下单时间',
       dataIndex: 'gmtCreated',
       key: 'gmtCreated',
@@ -170,7 +169,7 @@ export default class TableList extends PureComponent {
             value={filtered ? [timeBegin, timeEnd] : []}
             showTime={{ format: 'HH:mm:ss' }}
             format="YYYY-MM-DD HH:mm:ss"
-            placeholder={["起始时间", "截止时间"]}
+            placeholder={['起始时间', '截止时间']}
             onChange={this.handleRangePickerOnChange}
             onOk={this.handleRangePickerOnOk}
             getCalendarContainer={() => document.querySelector('.custom-filter-dropdown')}
@@ -178,7 +177,7 @@ export default class TableList extends PureComponent {
         </div>
       ),
       onFilterDropdownVisibleChange: this.handleRangePickerFilter,
-    },{
+    }, {
       title: '操作',
       dataIndex: 'operation',
       key: 'operation',
@@ -186,27 +185,27 @@ export default class TableList extends PureComponent {
     }];
 
     // 数据table列表表头的筛选按钮点击重置后status值为空,此时删除该参数
-    columns.map(item => {
+    columns.map((item) => {
       item.dataIndex === 'status' && !curStatus ? delete item.filteredValue : null;
     });
 
     // 配置分页
-    tableProps.pagination = !!pagination && { ...pagination, showSizeChanger: true, showQuickJumper: true, showTotal: total => `共 ${total} 条`};
+    tableProps.pagination = !!pagination && { ...pagination, showSizeChanger: true, showQuickJumper: true, showTotal: total => `共 ${total} 条` };
 
     // 添加动画
-    const AnimationTableBody = (props) => (<AnimTableBody {...props}/>);
+    const AnimationTableBody = props => (<AnimTableBody {...props} />);
 
     return (
       <Table
         simple
         bordered
-        { ...tableProps }
+        {...tableProps}
         columns={columns}
         className={classnames({ [styles.table]: true, [styles.motion]: true })}
         scroll={{ x: 1200 }}
         rowKey={record => record.id}
         components={{
-          body: { wrapper: AnimationTableBody }
+          body: { wrapper: AnimationTableBody },
         }}
       />
     );

+ 17 - 19
src/routes/SoldProduct/index.js

@@ -33,57 +33,57 @@ export default class SoldProductList extends Component {
     const columns = [{
       title: '产品编号',
       dataIndex: 'productCode',
-      key: 1, //设置了dataIndex可忽略这个属性
-    },{
+      key: 1, // 设置了dataIndex可忽略这个属性
+    }, {
       title: '产品名称',
       dataIndex: 'productName',
       key: 2,
-    },{
+    }, {
       title: '产品类型',
       dataIndex: 'productType',
       key: 3,
       render: (text, record) => productType[text],
-    },{
+    }, {
       title: '终端编号',
       dataIndex: 'userCode',
       key: 4,
-    },{
+    }, {
       title: '终端名称',
       dataIndex: 'userName',
       key: 5,
-    },{
+    }, {
       title: '校区编号',
       dataIndex: 'campusCode',
       key: 6,
-    },{
+    }, {
       title: '校区名称',
       dataIndex: 'campusName',
       key: 7,
-    },{
+    }, {
       title: '渠道名称',
       dataIndex: 'merchantName',
       key: 8,
-    },{
+    }, {
       title: '供应商价格(¥)',
       dataIndex: 'cpPrice',
       key: 9,
-    },{
+    }, {
       title: '渠道价格(¥)',
       dataIndex: 'merchantPrice',
       key: 10,
-    },{
+    }, {
       title: '终端价格(¥)',
       dataIndex: 'terminalPrice',
       key: 11,
-    },{
+    }, {
       title: '数量',
       dataIndex: 'quantity',
       key: 12,
-    },{
+    }, {
       title: '计价单位',
       dataIndex: 'chargeUnit',
       key: 13,
-    },{
+    }, {
       title: '创建时间',
       dataIndex: 'gmtCreated',
       key: 14,
@@ -147,16 +147,14 @@ export default class SoldProductList extends Component {
                 <Col md={8} sm={24}>
                   <Form.Item label="时间范围">
                     {getFieldDecorator('time')(
-                      <DatePicker
-                      />
+                      <DatePicker />
                     )}
                   </Form.Item>
                 </Col>
                 <Col md={8} sm={24}>
                   <Form.Item label="至">
                     {getFieldDecorator('time')(
-                      <DatePicker
-                      />
+                      <DatePicker />
                     )}
                   </Form.Item>
                 </Col>
@@ -166,7 +164,7 @@ export default class SoldProductList extends Component {
           <div>
             <Table
               bordered
-              rowKey={(record) => record.id}
+              rowKey={record => record.id}
               columns={columns}
               dataSource={mockData}
               scroll={{ x: 1800 }}

+ 7 - 8
src/routes/Terminal/Edit/campus.js

@@ -4,7 +4,6 @@ import SelectModal from '../../../components/SelectModal';
 import { Codes } from '../../../utils/config';
 
 export default class CampusSelectModal extends PureComponent {
-
   render() {
     const {
       modalVisible,
@@ -29,7 +28,7 @@ export default class CampusSelectModal extends PureComponent {
       searchSelect: true,
       searchSelectOptions: [{
         value: 'name', name: '校区名称', mode: 'input',
-      },{
+      }, {
         value: 'code', name: '校区编号', mode: 'input',
       }],
       searchSelectProps: {
@@ -46,26 +45,26 @@ export default class CampusSelectModal extends PureComponent {
         dataIndex: 'code',
         key: 'code',
         width: '30%',
-      },{
+      }, {
         title: '校区名称',
         dataIndex: 'name',
         key: 'name',
         width: '35%',
-      },{
+      }, {
         title: '渠道名称',
         dataIndex: 'merchantName',
         key: 'merchantName',
         width: '20%',
       }],
       ...fsTableOpts,
-    }
+    };
 
     return (
       <SelectModal
         mode="single"
-        { ...searchProps }
-        { ...fsTableProps }
-        { ...modalProps }
+        {...searchProps}
+        {...fsTableProps}
+        {...modalProps}
       />
     );
   }

+ 10 - 11
src/routes/Terminal/Edit/index.js

@@ -14,7 +14,6 @@ import { getLocalUser } from '../../../utils/helper';
   campus: state.campus,
 }))
 export default class TerminalProfile extends Component {
-
   handleCampusSelectClick = () => {
     const { merchantId } = getLocalUser();
     this.props.dispatch({ type: 'terminalDetail/showModal' });
@@ -121,35 +120,35 @@ export default class TerminalProfile extends Component {
           <Form layout="horizontal" onSubmit={this.handlePageSubmit}>
             <Form.Item hasFeedback label="所属校区" {...formItemLayout}>
               <Tooltip placement="top" title="点击选择校区">
-                <Button disabled={operType === "update" ? true: false} style={{ marginRight: 20 }} type="primary" size="small" icon="select" onClick={this.handleCampusSelectClick}>选择</Button>
+                <Button disabled={operType === 'update'} style={{ marginRight: 20 }} type="primary" size="small" icon="select" onClick={this.handleCampusSelectClick}>选择</Button>
               </Tooltip>
               {campusName && <strong>{`${campusName}`}</strong>}
             </Form.Item>
             <Form.Item label="终端名称:" hasFeedback {...formItemLayout}>
               {getFieldDecorator('name', {
                 initialValue: name,
-              })(<Input placeholder="请输入(例: 教室三/教室四...)"/>)}
+              })(<Input placeholder="请输入(例: 教室三/教室四...)" />)}
             </Form.Item>
-            {operType === 'create' ?
+            {operType === 'create' ? (
               <Form.Item label="终端密码:" hasFeedback {...formItemLayout}>
                 {getFieldDecorator('password', {
                   rules: [{ required: true, type: 'string', message: '密码为必填项!' }],
                   initialValue: password,
                 })(<Input placeholder="请输入" />)}
               </Form.Item>
-              :
-              <Form.Item label="终端密码:" hasFeedback {...formItemLayout}>
-                {getFieldDecorator('password', {
+) : (
+  <Form.Item label="终端密码:" hasFeedback {...formItemLayout}>
+    {getFieldDecorator('password', {
                   initialValue: password,
                 })(<Input placeholder="修改密码时填写" />)}
-              </Form.Item>
-            }
+  </Form.Item>
+)}
             <Form.Item label="账号状态:" {...formItemLayout}>
               {getFieldDecorator('status', {
                 valuePropsName: 'checked',
             })(
               <Switch
-                defaultChecked={status === Codes.CODE_NORMAL ? true : false}
+                defaultChecked={status === Codes.CODE_NORMAL}
                 checkedChildren="使用中"
                 unCheckedChildren="禁用中"
               />
@@ -160,7 +159,7 @@ export default class TerminalProfile extends Component {
               <Button type="primary" style={{ marginLeft: 35 }} htmlType="submit">提交</Button>
             </Form.Item>
           </Form>
-          {/*校区模态选择框*/}
+          {/* 校区模态选择框 */}
           <CampusSelectModal
             rowKeyName="id"
             modalVisible={modalShow}

+ 10 - 10
src/routes/Terminal/List/index.js

@@ -23,7 +23,7 @@ export default class TerminalList extends Component {
     const { query, pathname } = location;
     const { field, keyword, ...filters } = query;
 
-    Object.keys(filters).map(key => { filters[key] ? null : delete filters[key] });
+    Object.keys(filters).map((key) => { filters[key] ? null : delete filters[key]; });
     if (field && keyword) {
       filters.field = field;
       filters.keyword = keyword;
@@ -42,8 +42,8 @@ export default class TerminalList extends Component {
         dispatch(routerRedux.push({
           pathname,
           search: queryString.stringify({
-            ...payload
-          })
+            ...payload,
+          }),
         }));
       },
       onAdd: () => {
@@ -51,7 +51,7 @@ export default class TerminalList extends Component {
           pathname: '/terminal/add',
           state: filters,
         }));
-      }
+      },
     };
 
     const listProps = {
@@ -69,7 +69,7 @@ export default class TerminalList extends Component {
         }, {});
 
         const data = { ...filters, ...tableFilters };
-        Object.keys(data).map(key => data[key] ? null : delete data[key]);
+        Object.keys(data).map(key => (data[key] ? null : delete data[key]));
         dispatch(routerRedux.push({
           pathname,
           search: queryString.stringify({
@@ -97,7 +97,7 @@ export default class TerminalList extends Component {
                 search: queryString.stringify(filters),
               })
             );
-          }
+          },
         });
       },
       onRecoverItem: (payload) => {
@@ -111,16 +111,16 @@ export default class TerminalList extends Component {
                 search: queryString.stringify(filters),
               })
             );
-          }
+          },
         });
-      }
+      },
     };
 
     return (
       <PageHeaderLayout>
         <Card>
-          <TerminalSearch { ...searchProps } />
-          <TerminalTableList { ...listProps } />
+          <TerminalSearch {...searchProps} />
+          <TerminalTableList {...listProps} />
         </Card>
       </PageHeaderLayout>
     );

+ 2 - 2
src/routes/Terminal/List/search.js

@@ -20,7 +20,7 @@ export default class TerminalSearch extends Component {
       select: true,
       selectOptions: [{
         value: 'name', name: '终端名称', type: 'input',
-      },{
+      }, {
         value: 'code', name: '终端编号', type: 'input',
       }],
       selectProps: {
@@ -34,7 +34,7 @@ export default class TerminalSearch extends Component {
     return (
       <Row gutter={24}>
         <Col lg={10} md={12} sm={16} xs={24} style={{ marginBottom: 16 }}>
-          <DataSearch { ...searchGroupProps } />
+          <DataSearch {...searchGroupProps} />
         </Col>
         <Col lg={{ offset: 7, span: 7 }} md={12} sm={8} xs={24} style={{ marginBottom: 16, textAlign: 'right' }}>
           <Button type="primary" onClick={onAdd}><Icon type="plus-circle" />添加终端</Button>

+ 15 - 16
src/routes/Terminal/List/table.js

@@ -9,12 +9,11 @@ import styles from './table.less';
 import { Codes, terminalStatuses } from '../../../utils/config';
 
 export default class TerminalTableList extends Component {
-
   handleOperateItem = (record) => {
     const { onDeleteItem, onRecoverItem } = this.props;
     Modal.confirm({
       title: `您确定要${record.status === Codes.CODE_NORMAL ? '禁用' : '解禁'}该终端账号?`,
-      onOk () {
+      onOk() {
         if (record.status === Codes.CODE_NORMAL) {
           onDeleteItem(record.id);
         } else {
@@ -34,38 +33,38 @@ export default class TerminalTableList extends Component {
       title: '终端编号',
       dataIndex: 'code',
       key: 'code',
-    },{
+    }, {
       title: '终端名称',
       dataIndex: 'name',
       key: 'name',
-    },{
+    }, {
       title: '校区',
       dataIndex: 'campusName',
       key: 'campusName',
-    },{
+    }, {
       title: '渠道名称',
       dataIndex: 'merchantId',
       key: 'merchantId',
       render: (text, record) => record.merchantName,
-    },{
+    }, {
       title: '状态',
       dataIndex: 'status',
       key: 'status',
       render: (text, record) => {
-        const statusMap = {[Codes.CODE_NORMAL]: 'success', [Codes.CODE_DISABLE]: 'error'};
+        const statusMap = { [Codes.CODE_NORMAL]: 'success', [Codes.CODE_DISABLE]: 'error' };
         return (<Badge status={statusMap[record.status]} text={terminalStatuses[record.status]} />);
       },
       filters: Object.keys(terminalStatuses).map(key => ({ text: terminalStatuses[key], value: key })),
       filterMultiple: false,
       filteredValue: [curStatus],
-    },{
+    }, {
       title: '修改时间',
       dataIndex: 'gmtModified',
       key: 'gmtModified',
       render: (text, record) => (
         <div>{moment(text).format('YYYY-MM-DD HH:mm:ss')}</div>
-      )
-    },{
+      ),
+    }, {
       title: '操作',
       dataIndex: 'operation',
       key: 'operation',
@@ -75,29 +74,29 @@ export default class TerminalTableList extends Component {
           <Divider type="vertical" />
           <a onClick={() => this.handleOperateItem(record)}>{record.status === Codes.CODE_NORMAL ? '禁用' : '解禁'}</a>
         </div>
-      )
+      ),
     }];
 
-    columns.map(item => {
+    columns.map((item) => {
       item.dataIndex === 'status' && !curStatus ? delete item.filteredValue : null;
     });
 
     // 配置分页
-    tableProps.pagination = !!pagination && { ...pagination, showSizeChanger: true, showQuickJumper: true, showTotal: total => `共 ${total} 条`};
+    tableProps.pagination = !!pagination && { ...pagination, showSizeChanger: true, showQuickJumper: true, showTotal: total => `共 ${total} 条` };
 
     // 添加动画
-    const AnimationTableBody = (props) => (<AnimTableBody {...props}/>);
+    const AnimationTableBody = props => (<AnimTableBody {...props} />);
 
     return (
       <Table
         simple
         bordered
-        { ...tableProps }
+        {...tableProps}
         columns={columns}
         className={classnames({ [styles.table]: true, [styles.motion]: true })}
         rowKey={record => record.id}
         components={{
-          body: { wrapper: AnimationTableBody }
+          body: { wrapper: AnimationTableBody },
         }}
       />
     );

+ 1 - 1
src/services/cmsuser.js

@@ -23,6 +23,6 @@ export async function update(params) {
 }
 
 export async function remove({ id }) {
-  const options = { method: 'DELETE' }
+  const options = { method: 'DELETE' };
   return request(`${cmsUser}/${id}`, options);
 }

+ 4 - 4
src/services/goods.js

@@ -2,7 +2,7 @@ import { stringify } from 'qs';
 import request from '../utils/request';
 import { goods, bundleTag } from '../utils/api';
 
-export async function create (params) {
+export async function create(params) {
   const options = {
     method: 'POST',
     body: JSON.stringify(params),
@@ -10,7 +10,7 @@ export async function create (params) {
   return request(`${goods}`, options);
 }
 
-export async function update (params) {
+export async function update(params) {
   const options = {
     method: 'PUT',
     body: JSON.stringify(params),
@@ -18,12 +18,12 @@ export async function update (params) {
   return request(`${goods}`, options);
 }
 
-export async function remove ({ id }) {
+export async function remove({ id }) {
   const options = { method: 'DELETE' };
   return request(`${goods}/${id}`, options);
 }
 
-export async function bundleTags (params) {
+export async function bundleTags(params) {
   const options = {
     method: 'PUT',
     body: JSON.stringify(params),

+ 1 - 1
src/services/login.js

@@ -9,7 +9,7 @@ export async function login(params) {
     },
     method: 'POST',
     body: stringify(params),
-  }
+  };
   return request(`${userLogin}`, options);
 }
 

+ 1 - 1
src/services/merchant.js

@@ -27,7 +27,7 @@ export async function update(params) {
 }
 
 export async function remove({ id }) {
-  const options = { method: 'DELETE' }
+  const options = { method: 'DELETE' };
   return request(`${merchant}/${id}`, options);
 }
 

+ 1 - 1
src/services/mproduct.js

@@ -14,6 +14,6 @@ export async function createMerchantProduct(params) {
   const options = {
     method: 'PUT',
     body: JSON.stringify(params),
-  }
+  };
   return request(`${merchantProductCreate}`, options);
 }

+ 1 - 1
src/services/order.js

@@ -27,6 +27,6 @@ export async function update(params) {
 }
 
 export async function remove({ id }) {
-  const options = { method: 'DELETE' }
+  const options = { method: 'DELETE' };
   return request(`${order.replace('/:id', `/${id}`)}`, options);
 }

+ 1 - 1
src/services/product.js

@@ -44,7 +44,7 @@ export async function update(params) {
  * @desc 下架一个产品 delete /product/<productId>
  */
 export async function remove({ id }) {
-  const options = { method: 'DELETE' }
+  const options = { method: 'DELETE' };
   return request(`${product}/${id}`, options);
 }
 

+ 31 - 31
src/utils/city.js

@@ -21,7 +21,7 @@
     JSON.stringify(map)
     ```
 */
-let DICT = {
+const DICT = {
   110000: '北京',
   110100: '北京市',
   110101: '东城区',
@@ -4018,44 +4018,44 @@ let DICT = {
   820200: '离岛',
   990000: '海外',
   990100: '海外',
-}
+};
 
 // id pid/parentId name children
 const tree = (list) => {
-  let mapped = {}
-  let item
+  const mapped = {};
+  let item;
   for (let i = 0; i < list.length; i += 1) {
-    item = list[i]
-    if (!item || !item.id) continue
-    mapped[item.id] = item
+    item = list[i];
+    if (!item || !item.id) continue;
+    mapped[item.id] = item;
   }
 
-  let result = []
+  const result = [];
   for (let ii = 0; ii < list.length; ii += 1) {
-    item = list[ii]
+    item = list[ii];
 
-    if (!item) continue
+    if (!item) continue;
     /* jshint -W041 */
     if (item.pid === undefined && item.parentId === undefined) {
-      result.push(item)
-      continue
+      result.push(item);
+      continue;
     }
-    let parent = mapped[item.pid] || mapped[item.parentId]
-    if (!parent) continue
-    if (!parent.children) parent.children = []
-    parent.children.push(item)
+    const parent = mapped[item.pid] || mapped[item.parentId];
+    if (!parent) continue;
+    if (!parent.children) parent.children = [];
+    parent.children.push(item);
   }
-  return result
-}
+  return result;
+};
 
-let DICT_FIXED = (function () {
-  let fixed = []
-  for (let id in DICT) {
+const DICT_FIXED = (function () {
+  const fixed = [];
+  for (const id in DICT) {
     if ({}.hasOwnProperty.call(DICT, id)) {
-      let pid
+      let pid;
       if (id.slice(2, 6) !== '0000') {
         pid = id.slice(4, 6) === '00' ? (`${id.slice(0, 2)}0000`) :
-          `${id.slice(0, 4)}00`
+          `${id.slice(0, 4)}00`;
       }
       fixed.push({
         id,
@@ -4063,24 +4063,24 @@ let DICT_FIXED = (function () {
         name: DICT[id],
         value: DICT[id],
         label: DICT[id],
-      })
+      });
     }
   }
-  return tree(fixed)
-}())
+  return tree(fixed);
+}());
 
 function provCodeToName(provCode) {
-  for (let key in DICT) {
-    if (String(key).slice(0,2) === provCode) {
+  for (const key in DICT) {
+    if (String(key).slice(0, 2) === provCode) {
       return DICT[key];
     }
   }
 }
 
 function provNameToCode(provName) {
-  for (let key in DICT) {
+  for (const key in DICT) {
     if (provName === DICT[key]) {
-      return String(key).slice(0,2);
+      return String(key).slice(0, 2);
     }
   }
 }
@@ -4089,4 +4089,4 @@ module.exports = {
   DICT_FIXED,
   provCodeToName,
   provNameToCode,
-}
+};

+ 4 - 4
src/utils/config.js

@@ -3,7 +3,7 @@
 const Codes = {};
 Codes.CODE_VIDEO = 0;
 Codes.CODE_AUDIO = 1;
-Codes.CODE_LIVE  = 2;
+Codes.CODE_LIVE = 2;
 Codes.CODE_IMAGE = 3;
 
 Codes.CODE_NORMAL = 'NORMAL';
@@ -58,7 +58,7 @@ module.exports = {
   },
   // 产品类型
   productType: {
-    [Codes.CODE_COURSE] : '课程',
+    [Codes.CODE_COURSE]: '课程',
     [Codes.CODE_SUPPORT]: '配套',
     [Codes.CODE_PACKAGE]: '课程包',
   },
@@ -72,12 +72,12 @@ module.exports = {
   resourceType: {
     [Codes.CODE_VIDEO]: '视频',
     [Codes.CODE_AUDIO]: '音频',
-    [Codes.CODE_LIVE] : '直播',
+    [Codes.CODE_LIVE]: '直播',
     [Codes.CODE_IMAGE]: '图片',
   },
   // 标签类型
   tagType: {
-    [Codes.CODE_COURSE] : '课程',
+    [Codes.CODE_COURSE]: '课程',
     [Codes.CODE_SUPPORT]: '配套',
   },
   // 订单状态

+ 6 - 8
src/utils/request.js

@@ -1,5 +1,4 @@
 import fetch from 'dva/fetch';
-import { stringify } from 'qs';
 import { message, notification } from 'antd';
 import { routerRedux } from 'dva/router';
 import store from '../index';
@@ -27,7 +26,7 @@ const httpCodeMessage = {
 const customCodeMessage = {
   10004: 'Token认证失败',
   10002: '账号或密码错误',
-  800  : '数据不存在',
+  800: '数据不存在',
 };
 
 /**
@@ -86,23 +85,22 @@ function promise2Json(response) {
  */
 export default function request(url, options) {
   const defaultOptions = {
-    credentials: 'include',   // with cookies(Post CORS requests)
+    credentials: 'include', // with cookies(Post CORS requests)
   };
   const newOptions = { ...defaultOptions, ...options };
   newOptions.method = (newOptions.method || 'GET').toUpperCase();
   if (newOptions.method === 'POST' || newOptions.method === 'PUT' ||
     newOptions.method === 'PATCH' || newOptions.method === 'DELETE') {
     newOptions.headers = {
-      'Accept': 'application/json',
+      Accept: 'application/json',
       'Content-Type': 'application/json; charset=utf-8',
       ...newOptions.headers,
     };
-  }
-  else {
+  } else {
     newOptions.headers = {
-      'Accept': 'application/json',
+      Accept: 'application/json',
       ...newOptions.headers,
-    }
+    };
   }
 
   return fetch(url, newOptions)