Procházet zdrojové kódy

渠道管理平台

sophieChenyx před 6 roky
rodič
revize
b71656af00
73 změnil soubory, kde provedl 26 přidání a 10120 odebrání
  1. 7 47
      src/routes/Campus/CampusList.js
  2. 0 148
      src/routes/Frontend/Recommend/RecommendCourse.js
  3. 0 150
      src/routes/Frontend/Recommend/RecommendList.js
  4. 0 506
      src/routes/Frontend/Recommend/RecommendPoster.js
  5. 0 63
      src/routes/Frontend/Recommend/RecommendPoster.less
  6. 0 33
      src/routes/Frontend/Recommend/index.js
  7. 0 472
      src/routes/Frontend/Tag/TagCreate.js
  8. 0 43
      src/routes/Frontend/Tag/TagCreate.less
  9. 0 171
      src/routes/Frontend/Tag/TagList.js
  10. 0 17
      src/routes/Frontend/Tag/TagList.less
  11. 0 33
      src/routes/Frontend/Tag/index.js
  12. 0 306
      src/routes/Frontend/TagGroup/TagGroupCreate.js
  13. 0 34
      src/routes/Frontend/TagGroup/TagGroupCreate.less
  14. 0 169
      src/routes/Frontend/TagGroup/TagGroupList.js
  15. 0 33
      src/routes/Frontend/TagGroup/index.js
  16. 0 311
      src/routes/Frontend/TagType/TagTypeCreate.js
  17. 0 164
      src/routes/Frontend/TagType/TagTypeList.js
  18. 0 32
      src/routes/Frontend/TagType/index.js
  19. 0 285
      src/routes/Merchant/MerchantCreate.js
  20. 0 10
      src/routes/Merchant/MerchantCreate.less
  21. 0 105
      src/routes/Merchant/MerchantDeposit.js
  22. 0 6
      src/routes/Merchant/MerchantDeposit.less
  23. 0 194
      src/routes/Merchant/MerchantList.js
  24. 0 620
      src/routes/Product/Course/CourseCreate.js
  25. 0 34
      src/routes/Product/Course/CourseCreate.less
  26. 0 170
      src/routes/Product/Course/CourseList.js
  27. 0 33
      src/routes/Product/Course/index.js
  28. 0 394
      src/routes/Product/Courseware/CoursewareCreate.js
  29. 0 22
      src/routes/Product/Courseware/CoursewareCreate.less
  30. 0 173
      src/routes/Product/Courseware/CoursewareList.js
  31. 0 33
      src/routes/Product/Courseware/index.js
  32. 0 301
      src/routes/Product/Lesson/LessonCreate.js
  33. 0 173
      src/routes/Product/Lesson/LessonList.js
  34. 0 33
      src/routes/Product/Lesson/index.js
  35. 0 410
      src/routes/Product/Package/PackageCreate.js
  36. 0 42
      src/routes/Product/Package/PackageCreate.less
  37. 0 165
      src/routes/Product/Package/PackageList.js
  38. 0 33
      src/routes/Product/Package/index.js
  39. 0 512
      src/routes/Product/Support/SupportCreate.js
  40. 0 33
      src/routes/Product/Support/SupportCreate.less
  41. 0 166
      src/routes/Product/Support/SupportList.js
  42. 0 33
      src/routes/Product/Support/index.js
  43. 0 408
      src/routes/Product/Training/TrainingCreate.js
  44. 0 33
      src/routes/Product/Training/TrainingCreate.less
  45. 0 165
      src/routes/Product/Training/TrainingList.js
  46. 0 33
      src/routes/Product/Training/index.js
  47. 0 188
      src/routes/Resource/AudioBook/AudioBookCreate.js
  48. 0 212
      src/routes/Resource/AudioBook/AudioBookList.js
  49. 0 25
      src/routes/Resource/AudioBook/AudioBookList.less
  50. 0 44
      src/routes/Resource/Picture/PictureCardList.js
  51. 0 163
      src/routes/Resource/Picture/PictureEdit.js
  52. 0 117
      src/routes/Resource/Picture/PictureList.js
  53. 0 127
      src/routes/Resource/Picture/PictureMultipleUpload.js
  54. 0 51
      src/routes/Resource/Picture/PictureMultipleUpload.less
  55. 0 166
      src/routes/Resource/Picture/PictureSingleUpload.js
  56. 0 111
      src/routes/Resource/Picture/PictureTableList.js
  57. 0 35
      src/routes/Resource/Picture/PictureTableList.less
  58. 0 35
      src/routes/Resource/Picture/PictureUpload.js
  59. 0 97
      src/routes/Resource/Picture/PictureUploadResult.js
  60. 0 189
      src/routes/Resource/Video/VideoCreate.js
  61. 0 163
      src/routes/Resource/Video/VideoList.js
  62. 0 181
      src/routes/Resource/Video/VideoPlayList.js
  63. 0 91
      src/routes/Resource/Video/VideoPlayList.less
  64. 0 128
      src/routes/Resource/Video/VideoTableList.js
  65. 0 8
      src/routes/Shelves/ShelvesEdit.js
  66. 2 29
      src/routes/Shelves/ShelvesList.js
  67. 4 70
      src/routes/Shelves/TableForm.js
  68. 11 27
      src/routes/Terminal/User/TerminalList.js
  69. 0 184
      src/routes/Terminal/WhiteList/WhiteList.js
  70. 0 222
      src/routes/Terminal/WhiteList/WhiteListCreate.js
  71. 0 55
      src/routes/Terminal/WhiteList/WhiteListCreate.less
  72. 0 33
      src/routes/Terminal/WhiteList/index.js
  73. 2 18
      src/routes/Trade/ShopCart/ShopCartList.js

+ 7 - 47
src/routes/Campus/CampusList.js

@@ -45,7 +45,6 @@ export default class CampusListPage extends Component {
     this.state = {
       UIParams: (state || {}).UIParams, // 组件的状态参数
       Queryers: (state || {}).Queryers, // 查询的条件参数
-      filterModalDestroy: true,
     };
   }
   componentDidMount() {
@@ -86,17 +85,10 @@ export default class CampusListPage extends Component {
         merchantId: value[0],
       },
     });
-    this.handleFilterModalDestroy();
   }
   handleBatchOperation = () => {
     Message.info('暂不支持批量操作!');
   }
-  handleFilterModalShow = () => {
-    this.setState({ filterModalDestroy: false });
-  }
-  handleFilterModalDestroy = () => {
-    this.setState({ filterModalDestroy: true });
-  }
   handleRemoteSelectSearch = (value) => {
     this.props.dispatch({
       type: 'merchant/fetchMerchantList',
@@ -151,34 +143,29 @@ export default class CampusListPage extends Component {
       title: '校区名称',
       key: 2,
       dataIndex: 'name',
-      width: '31%',
+      width: '30%',
       render: text => (
         <Ellipsis tooltip lines={1}>{text}</Ellipsis>
       ),
     }, {
-      title: '所属渠道',
-      key: 3,
-      dataIndex: 'merchantName',
-      width: '10%',
-    }, {
       title: '校区联系人',
-      key: 4,
+      key: 3,
       dataIndex: 'contactName',
-      width: '10%',
+      width: '20%',
     }, {
       title: '联系电话',
-      key: 5,
+      key: 4,
       dataIndex: 'mobile',
       width: '12%',
     }, {
       title: '更新时间',
-      key: 6,
+      key: 5,
       dataIndex: 'gmtModified',
       render: text => moment(text).format('YYYY-MM-DD HH:mm:ss'),
-      width: '16%',
+      width: '15%',
     }, {
       title: '操作',
-      key: 7,
+      key: 6,
       dataIndex: 'operation',
       render: (_, record) => renderOperation(record),
       width: '6%',
@@ -193,7 +180,6 @@ export default class CampusListPage extends Component {
             dataSource={addRowKey(list)}
             header={{
               basicSearch,
-              onAdvanceFilterClick: this.handleFilterModalShow,
               onFilterClick: this.handleFilterOperation,
               onCreateClick: this.handleCreateOperation,
             }}
@@ -205,32 +191,6 @@ export default class CampusListPage extends Component {
             keepUIState={{ ...this.state.UIParams }}
             showStatusSelect={false}
           />
-          {!this.state.filterModalDestroy && (
-            <Modal
-              width={600}
-              visible
-              title="高级筛选"
-              okText="筛选"
-              cancelText="取消"
-              maskClosable={false}
-              onCancel={this.handleFilterModalDestroy}
-              onOk={this.handleModalFilterOperation}
-            >
-              <Form>
-                <Form.Item label="所属商户" {...formItemLayout}>
-                  {getFieldDecorator('merchantId', {
-                      initialValue: [],
-                    })(
-                      <AXRemoteSelect
-                        fetching={fetching}
-                        dataSource={merchantDataFormatter(merchant.list)}
-                        onSearch={this.handleRemoteSelectSearch}
-                      />
-                    )}
-                </Form.Item>
-              </Form>
-            </Modal>
-          )}
         </Card>
       </PageHeaderLayout>
     );

+ 0 - 148
src/routes/Frontend/Recommend/RecommendCourse.js

@@ -1,148 +0,0 @@
-import React, { Component } from 'react';
-import pathToRegexp from 'path-to-regexp';
-import { connect } from 'dva';
-import { routerRedux } from 'dva/router';
-import { Card, Modal, Button } from 'antd';
-import AXDragSortTable from '../../../components/AXDragSortTable';
-import Selector from '../../../components/AXTableSelector/Selector';
-import FooterToolbar from '../../../components/FooterToolbar/index';
-
-@connect(({ loading, merchant, shelves }) => ({
-  shelves,
-  merchant,
-  sLoading: loading.models.product,
-  submitting: loading.models.merchant,
-}))
-export default class RecommendCourseEditPage extends Component {
-  state = {
-    productSelectorDestroy: true,
-  };
-  componentDidMount() {
-    this.props.dispatch({
-      type: 'merchant/queryMerchantRecommend',
-      payload: { merchantId: this.getMerchantId() },
-    });
-  }
-  getMerchantId = () => {
-    const match = pathToRegexp('/frontend/recommend/course-edit/:id')
-      .exec(this.props.location.pathname);
-    return match[1];
-  }
-  handleSelectorModalShow = () => {
-    this.setState({ productSelectorDestroy: false });
-    this.props.dispatch({
-      type: 'shelves/fetchCourseItemList',
-      payload: { merchantId: this.getMerchantId() },
-    });
-  }
-  handleSelectorChange = (params) => {
-    this.props.dispatch({
-      type: 'shelves/fetchCourseItemList',
-      payload: params,
-    });
-  }
-  handleSelectorFinish = (rows) => {
-    this.setState({ productSelectorDestroy: true });
-    this.props.dispatch({
-      type: 'merchant/fixRecommendList',
-      payload: rows,
-    });
-  }
-  handleSelectorCancel = () => {
-    this.setState({ productSelectorDestroy: true });
-  }
-  handleDragSortTableChange = (rows) => {
-    this.props.dispatch({
-      type: 'merchant/fixRecommendList',
-      payload: rows,
-    });
-  }
-  handlePageBack = () => {
-    this.props.dispatch(routerRedux.push({
-      pathname: '/frontend/recommend',
-      state: this.props.location.state,
-    }));
-  }
-  handlePageSubmit = () => {
-    const { merchant } = this.props;
-    const { recommendList } = merchant;
-    const idList = recommendList.map(item => item.pid);
-    this.props.dispatch({
-      type: 'merchant/updateMerchantRecommend',
-      payload: {
-        idList,
-        merchantId: this.getMerchantId(),
-      },
-    });
-  }
-
-  render() {
-    const { productSelectorDestroy } = this.state;
-    const { merchant, shelves, sLoading, submitting } = this.props;
-    const { recommendList } = merchant;
-    const productColumns = [{
-      title: '课程编号',
-      key: 1,
-      dataIndex: 'code',
-      width: '40%',
-    }, {
-      title: '课程名称',
-      key: 2,
-      dataIndex: 'name',
-    }];
-    const getProductModal = () => {
-      return (
-        <Modal
-          visible
-          width={1100}
-          footer={null}
-          title="课程资源"
-          maskClosable={false}
-          onCancel={this.handleSelectorCancel}
-        >
-          <Selector
-            multiple
-            loading={sLoading}
-            selectorName="Course"
-            selectedRows={recommendList}
-            list={shelves.list}
-            pageNo={shelves.pageNo}
-            pageSize={shelves.pageSize}
-            totalSize={shelves.totalSize}
-            onCancel={this.handleSelectorCancel}
-            onChange={this.handleSelectorChange}
-            onFinish={this.handleSelectorFinish}
-          />
-        </Modal>
-      );
-    };
-    return (
-      <div>
-        <Card
-          title={<Button type="primary" onClick={this.handleSelectorModalShow}>选择课程</Button>}
-          style={{ marginBottom: 70 }}
-        >
-          <AXDragSortTable
-            columns={productColumns}
-            data={recommendList}
-            onChange={this.handleDragSortTableChange}
-          />
-          {!productSelectorDestroy && getProductModal()}
-        </Card>
-        <FooterToolbar style={{ width: '100%' }}>
-          <Button
-            onClick={this.handlePageBack}
-            style={{ marginRight: 10 }}
-          >取消
-          </Button>
-          <Button
-            type="primary"
-            loading={submitting}
-            onClick={this.handlePageSubmit}
-          >提交
-          </Button>
-        </FooterToolbar>
-      </div>
-    );
-  }
-}

+ 0 - 150
src/routes/Frontend/Recommend/RecommendList.js

@@ -1,150 +0,0 @@
-import React, { Component } from 'react';
-import moment from 'moment';
-import { connect } from 'dva';
-import { routerRedux } from 'dva/router';
-import { Card, Divider, message } from 'antd';
-import { StandardTableList } from '../../../components/AXList';
-import { renderStatus, renderCategory, addRowKey } from '../../../utils/utils';
-
-const Message = message;
-
-@connect(({ loading, merchant }) => ({
-  merchant,
-  loading: loading.models.merchant,
-}))
-export default class MerchantListPage extends Component {
-  constructor(props) {
-    super(props);
-    const { state } = props.location;
-    this.state = {
-      UIParams: (state || {}).UIParams, // 组件的状态参数
-      Queryers: (state || {}).Queryers, // 查询的条件参数
-    };
-  }
-  componentDidMount() {
-    this.props.dispatch({
-      type: 'merchant/fetchMerchantList',
-      payload: { ...this.state.Queryers },
-    });
-  }
-  handleEditRecommend = ({ id }) => {
-    this.props.dispatch(routerRedux.push({
-      pathname: `/frontend/recommend/course-edit/${id}`,
-      state: this.state,
-    }));
-  };
-  handleEditPoster = ({ id }) => {
-    this.props.dispatch(routerRedux.push({
-      pathname: `/frontend/recommend/poster-edit/${id}`,
-      state: this.state,
-    }));
-  };
-  handleFilterOperation = (params, states) => {
-    this.props.dispatch({
-      type: 'merchant/fetchMerchantList',
-      payload: params,
-    });
-    this.setState({
-      UIParams: states,
-      Queryers: params,
-    });
-  };
-  handleBatchOperation = () => {
-    Message.info('暂不支持批量操作!');
-  };
-
-  render() {
-    const { loading, merchant } = this.props;
-    const { list, totalSize, pageSize, pageNo } = merchant;
-
-    const renderOperation = (item) => {
-      const tagAStyle = { fontWeight: 'bold' };
-      return (
-        <div>
-          <a style={tagAStyle} onClick={() => this.handleEditRecommend(item)}>课程</a>
-          <Divider type="vertical" />
-          <a style={tagAStyle} onClick={() => this.handleEditPoster(item)}>海报</a>
-        </div>
-      );
-    };
-
-    const batchActions = [{
-      key: 'modify',
-      name: '批量修改',
-    }];
-    const basicSearch = {
-      keys: [{
-        name: '商户编号',
-        field: 'code',
-      }, {
-        name: '商户名称',
-        field: 'name',
-      }],
-    };
-    const pagination = {
-      pageNo,
-      pageSize,
-      totalSize,
-    };
-    const columns = [{
-      title: '商户编号',
-      key: 1,
-      dataIndex: 'code',
-      width: '16%',
-    }, {
-      title: '商户名称',
-      key: 2,
-      dataIndex: 'name',
-      width: '18%',
-    }, {
-      title: '商户简称',
-      key: 3,
-      dataIndex: 'simple',
-      width: '16%',
-    }, {
-      title: '商户类型',
-      key: 4,
-      dataIndex: 'domain',
-      render: text => renderCategory(text),
-      width: '12%',
-    }, {
-      title: '状态',
-      key: 5,
-      dataIndex: 'status',
-      render: text => renderStatus(text),
-      width: '12%',
-    }, {
-      title: '更新时间',
-      key: 6,
-      dataIndex: 'gmtModified',
-      render: text => moment(text).format('YYYY-MM-DD HH:mm:ss'),
-      width: '16%',
-    }, {
-      title: '操作',
-      key: 7,
-      dataIndex: 'operation',
-      render: (_, record) => renderOperation(record),
-      width: '10%',
-      align: 'right',
-    }];
-    return (
-      <Card>
-        <StandardTableList
-          columns={columns}
-          loading={loading}
-          dataSource={addRowKey(list)}
-          header={{
-            basicSearch,
-            onFilterClick: this.handleFilterOperation,
-          }}
-          footer={{
-            pagination,
-            batchActions,
-            onBatchClick: this.handleBatchOperation,
-          }}
-          keepUIState={{ ...this.state.UIParams }}
-        />
-      </Card>
-    );
-  }
-}

+ 0 - 506
src/routes/Frontend/Recommend/RecommendPoster.js

@@ -1,506 +0,0 @@
-import React, { Component } from 'react';
-import pathToRegexp from 'path-to-regexp';
-import { connect } from 'dva';
-import { routerRedux } from 'dva/router';
-import { Card, Table, Modal, Popconfirm, Radio, Switch, Button, Input } from 'antd';
-import Selector from '../../../components/AXTableSelector/Selector';
-import FooterToolbar from '../../../components/FooterToolbar';
-import {
-  boolToStatus, genAbsolutePicUrl, renderProductType, renderStatus, statusToBool,
-} from '../../../utils/utils';
-import bitmap from '../../../assets/bitmap.png';
-import styles from './RecommendPoster.less';
-
-@connect(({ loading, merchant, shelves, resource }) => ({
-  shelves,
-  merchant,
-  resource,
-  rLoading: loading.models.resource,
-  sLoading: loading.models.shelves,
-  mLoading: loading.models.merchant,
-}))
-
-export default class RecommendPosterEditPage extends Component {
-  state = {
-    productSelectorDestroy: true,
-    resourceSelectorDestroy: true,
-    productType: 'Course',
-    currentEditPosterId: '',
-  };
-  componentDidMount() {
-    this.props.dispatch({
-      type: 'merchant/fetchMerchantPoster',
-      payload: { merchantId: this.getMerchantId() },
-    });
-  }
-  /**
-   * 1.从URL中提取merchantId
-   * @returns {String}
-   */
-  getMerchantId = () => {
-    const match = pathToRegexp('/frontend/recommend/poster-edit/:id')
-      .exec(this.props.location.pathname);
-    return match[1];
-  };
-  /**
-   * 2.响应产品类型变化
-   * @param e
-   */
-  handleRadioChange = (e) => {
-    this.setState({ productType: e.target.value });
-    this.props.dispatch({
-      type: `shelves/fetch${e.target.value}ItemList`,
-      payload: { merchantId: this.getMerchantId() },
-    });
-  };
-  /**
-   * 3.新建一条海报
-   */
-  handlePosterItemCreate = () => {
-    const newData = [...this.props.merchant.posterList];
-    newData.push({
-      id: `new-poster-${newData.length + 1}`,
-      isNew: true,
-      isEdit: true,
-    });
-    this.props.dispatch({
-      type: 'merchant/fixPosterList',
-      payload: newData,
-    });
-  };
-  /**
-   * 4.删除一条海报
-   * @param posterId
-   * @param isNew
-   */
-  handlePosterItemDelete = (posterId, isNew) => {
-    if (isNew) {
-      const originalData = [...this.props.merchant.posterList];
-      const newData = originalData.filter(data => data.id !== posterId);
-      this.props.dispatch({
-        type: 'merchant/fixPosterList',
-        payload: newData,
-      });
-      return;
-    }
-    this.props.dispatch({
-      type: 'merchant/deleteMerchantPosterItem',
-      payload: { posterId },
-    });
-  };
-  /**
-   * 5.编辑一条海报
-   * @param posterId
-   */
-  handlePosterItemEdit = (posterId) => {
-    const newData = [...this.props.merchant.posterList];
-    for (const index in newData) {
-      if (newData[index].id === posterId) {
-        newData[index].isEdit = true;
-      }
-    }
-    this.props.dispatch({
-      type: 'merchant/fixPosterList',
-      payload: newData,
-    });
-  };
-  /**
-   * 6.控制模态框的展现
-   * @param {String} flag
-   * @param {String} posterId
-   */
-  handleSelectorModalShow = (flag, posterId) => {
-    this.setState({
-      [`${flag}SelectorDestroy`]: false,
-      currentEditPosterId: posterId,
-    });
-    if (flag !== 'resource') {
-      const { productType } = this.state;
-      this.props.dispatch({
-        type: `shelves/fetch${productType}ItemList`,
-        payload: { merchantId: this.getMerchantId() },
-      });
-      return;
-    }
-    this.props.dispatch({
-      type: 'resource/fetchImageList',
-      payload: {},
-    });
-  };
-  /**
-   * 7.控制模态框的销毁
-   */
-  handleSelectorCancel = (flag) => {
-    this.setState({ [`${flag}SelectorDestroy`]: true });
-  };
-  /**
-   * 8.响应模态框内查询操作
-   * @param {String} flag
-   * @param {Object} params
-   */
-  handleSelectorChange = (flag, params) => {
-    if (flag !== 'resource') {
-      const { productType } = this.state;
-      this.props.dispatch({
-        type: `shelves/fetch${productType}ItemList`,
-        payload: { ...params, merchantId: this.getMerchantId() },
-      });
-      return;
-    }
-    this.props.dispatch({
-      type: 'resource/fetchImageList',
-      payload: params,
-    });
-  };
-  /**
-   * 9.响应选择完成操作
-   * @param {String} flag
-   * @param {Array} rows
-   */
-  handleSelectorFinish = (flag, rows) => {
-    this.setState({ [`${flag}SelectorDestroy`]: true });
-    const { currentEditPosterId } = this.state;
-    const originalData = [...this.props.merchant.posterList];
-    const newData = originalData.map((data) => {
-      if (flag === 'product' && data.id === currentEditPosterId) {
-        const { pid, name, code, type } = rows[0];
-        return { ...data, type, name, code, pid };
-      }
-      if (flag === 'resource' && data.id === currentEditPosterId) {
-        const { path } = rows[0];
-        return { ...data, img: path };
-      }
-      return { ...data };
-    });
-    this.props.dispatch({
-      type: 'merchant/fixPosterList',
-      payload: newData,
-    });
-  };
-  /**
-   * 10.修改排序值
-   * @param e
-   * @param posterId
-   */
-  handleSortInputChange = (e, posterId) => {
-    const originalData = [...this.props.merchant.posterList];
-    const newData = originalData.map((data) => {
-      if (data.id === posterId) {
-        return { ...data, sort: parseInt(e.target.value, 10) || 0 };
-      }
-      return { ...data };
-    });
-    this.props.dispatch({
-      type: 'merchant/fixPosterList',
-      payload: newData,
-    });
-  };
-  /**
-   * 11.修改状态
-   * @param checked
-   * @param posterId
-   */
-  handleStatusSwitchChange = (checked, posterId) => {
-    const originalData = [...this.props.merchant.posterList];
-    const newData = originalData.map((data) => {
-      if (data.id === posterId) {
-        return { ...data, status: boolToStatus(checked) };
-      }
-      return { ...data };
-    });
-    this.props.dispatch({
-      type: 'merchant/fixPosterList',
-      payload: newData,
-    });
-  };
-  /**
-   * 12.提交海报内容
-   * @param posterId
-   */
-  handleSaveOperation = (posterId) => {
-    const originalData = [...this.props.merchant.posterList];
-    const targetData = originalData.filter(data => data.id === posterId)[0];
-    const { id, pid, img, sort, type, status, isNew } = targetData;
-    if (isNew) {
-      this.props.dispatch({
-        type: 'merchant/createMerchantPosterItem',
-        payload: {
-          img, pid, type, sort, status: boolToStatus(status), merchantId: this.getMerchantId(),
-        },
-        posterId: id,
-      });
-      return;
-    }
-    this.props.dispatch({
-      type: 'merchant/updateMerchantPosterItem',
-      payload: {
-        id, img, pid, type, sort, status: boolToStatus(status), merchantId: this.getMerchantId(),
-      },
-      posterId: id,
-    });
-  };
-  /**
-   * 13.返回上一页
-   */
-  handlePageBack = () => {
-    this.props.dispatch(routerRedux.push({
-      pathname: '/frontend/recommend',
-      state: this.props.location.state,
-    }));
-  };
-  render() {
-    const { productType, productSelectorDestroy, resourceSelectorDestroy } = this.state;
-    const { merchant, shelves, resource, rLoading, sLoading, mLoading } = this.props;
-    const { posterList } = merchant;
-    /* 海报列表格式设定 */
-    const posterColumns = [{
-      title: '位置',
-      key: 1,
-      dataIndex: 'sort',
-      width: '15%',
-      render: (text, record) => {
-        // 编辑状态下排序可自由填写
-        const { id, isEdit } = record;
-        if (isEdit) {
-          return (
-            <Input
-              value={text}
-              onChange={e => this.handleSortInputChange(e, id)}
-              placeholder="请填写"
-              style={{ width: 100 }}
-            />
-          );
-        }
-        return text;
-      },
-      align: 'center',
-    }, {
-      title: '海报封面',
-      key: 2,
-      dataIndex: 'img',
-      width: '27%',
-      render: (text, record) => {
-        // 将海报封面渲染为一张图片,编辑状态下可更换
-        const { id, isNew, isEdit } = record;
-        return (
-          <div className={styles.cover}>
-            {isEdit && (
-              <div className={styles.mongolian}>
-                <a onClick={() => this.handleSelectorModalShow('resource', id)}>{isNew ? '选择' : '更换'}</a>
-              </div>
-            )}
-            {(isNew && !text) ? <img src={bitmap} alt="" /> : <img src={genAbsolutePicUrl(text)} alt="海报封面" />}
-          </div>
-        );
-      },
-      align: 'center',
-    }, {
-      title: '关联产品信息',
-      key: 3,
-      render: (_, record) => {
-        // 将产品信息渲染成一个小表格
-        const { id, code, name, type, product, isEdit, isNew } = record;
-        const columns = [{
-          dataIndex: 'label',
-          width: '40%',
-        }, {
-          dataIndex: 'value',
-          width: '60%',
-        }];
-        const data = [{
-          key: 'name',
-          label: '产品名称',
-          value: name || (product || {}).name,
-        }, {
-          key: 'code',
-          label: '产品编号',
-          value: code || (product || {}).code,
-        }, {
-          key: 'type',
-          label: '产品类型',
-          value: renderProductType(type || (product || {}).type),
-        }];
-        return (
-          <div className={styles.product}>
-            {isEdit && (
-              <div className={styles.mongolian}>
-                <a onClick={() => this.handleSelectorModalShow('product', id)}>{isNew ? '选择' : '更换'}</a>
-              </div>
-            )}
-            <Table
-              bordered
-              size="small"
-              showHeader={false}
-              pagination={false}
-              columns={columns}
-              dataSource={data}
-            />
-          </div>
-        );
-      },
-      width: '30%',
-      align: 'center',
-    }, {
-      title: '删除状态',
-      key: 4,
-      dataIndex: 'status',
-      width: '13%',
-      render: (text, record) => {
-        const { id, isEdit } = record;
-        if (isEdit) {
-          return (
-            <Switch
-              checked={statusToBool(text)}
-              checkedChildren="正常"
-              unCheckedChildren="删除"
-              onChange={checked => this.handleStatusSwitchChange(checked, id)}
-            />
-          );
-        }
-        return renderStatus(text);
-      },
-      align: 'center',
-    }, {
-      title: '相关操作',
-      key: 5,
-      width: '15%',
-      render: (_, record) => {
-        const { id, isNew, isEdit } = record;
-        const getPopconfirmBtn = () => {
-          return (
-            <Popconfirm
-              placement="top"
-              title="确定要删除该海报?"
-              okText="确定"
-              cancelText="取消"
-              onConfirm={() => this.handlePosterItemDelete(id, isNew)}
-            >
-              <Button
-                size="small"
-                className="delBtn"
-              >删除
-              </Button>
-            </Popconfirm>
-          );
-        };
-        if (isEdit) {
-          return (
-            <div>
-              <Button
-                size="small"
-                className="editBtn"
-                onClick={() => this.handleSaveOperation(id)}
-              >保存
-              </Button>
-              {getPopconfirmBtn()}
-            </div>
-          );
-        }
-        return (
-          <div>
-            <Button
-              size="small"
-              className="editBtn"
-              onClick={() => this.handlePosterItemEdit(id)}
-            >编辑
-            </Button>
-            {getPopconfirmBtn()}
-          </div>
-        );
-      },
-      align: 'right',
-    }];
-    /* 产品模态框选择器 */
-    const renderModalTitle = () => {
-      return (
-        <Radio.Group
-          value={productType}
-          onChange={this.handleRadioChange}
-        >
-          <Radio.Button value="Course">课程</Radio.Button>
-          <Radio.Button value="Support">配套</Radio.Button>
-          <Radio.Button value="Training">师训</Radio.Button>
-          <Radio.Button value="Package">套餐包</Radio.Button>
-        </Radio.Group>
-      );
-    };
-    const getProductModal = () => {
-      return (
-        <Modal
-          visible
-          width={1100}
-          footer={null}
-          title={renderModalTitle()}
-          maskClosable={false}
-          onCancel={() => this.handleSelectorCancel('product')}
-        >
-          <Selector
-            multiple={false}
-            loading={sLoading}
-            selectorName={productType}
-            fixedName="Product"
-            list={shelves.list}
-            pageNo={shelves.pageNo}
-            pageSize={shelves.pageSize}
-            totalSize={shelves.totalSize}
-            onCancel={() => this.handleSelectorCancel('product')}
-            onChange={data => this.handleSelectorChange('product', data)}
-            onFinish={data => this.handleSelectorFinish('product', data)}
-          />
-        </Modal>
-      );
-    };
-    /* 封面模态框选择器 */
-    const getResourceModal = () => {
-      return (
-        <Modal
-          width={1100}
-          footer={null}
-          visible
-          title="图片资源"
-          maskClosable={false}
-          onCancel={() => this.handleSelectorCancel('resource')}
-        >
-          <Selector
-            multiple={false}
-            loading={rLoading}
-            selectorName="PictureSingle"
-            list={resource.list}
-            pageNo={resource.pageNo}
-            pageSize={resource.pageSize}
-            totalSize={resource.totalSize}
-            onCancel={() => this.handleSelectorCancel('resource')}
-            onChange={data => this.handleSelectorChange('resource', data)}
-            onFinish={rows => this.handleSelectorFinish('resource', rows)}
-          />
-        </Modal>
-      );
-    };
-    return (
-      <div>
-        <Card style={{ marginBottom: 70 }}>
-          <Table
-            pagination={false}
-            loading={mLoading}
-            dataSource={posterList}
-            columns={posterColumns}
-            rowKey={record => record.id}
-            className={styles.posterTable}
-          />
-          <Button
-            type="dashed"
-            icon="plus"
-            style={{ width: '100%', marginTop: 16, marginBottom: 8 }}
-            onClick={this.handlePosterItemCreate}
-          >新建
-          </Button>
-          {!resourceSelectorDestroy && getResourceModal()}
-          {!productSelectorDestroy && getProductModal()}
-        </Card>
-        <FooterToolbar style={{ width: '100%' }}>
-          <Button type="primary" onClick={this.handlePageBack}>返回上一页</Button>
-        </FooterToolbar>
-      </div>
-    );
-  }
-}

+ 0 - 63
src/routes/Frontend/Recommend/RecommendPoster.less

@@ -1,63 +0,0 @@
-@import "../../../../node_modules/antd/lib/style/themes/default.less";
-
-.posterTable {
-  :global {
-    .ant-table-title {
-      padding: 0 0 16px 0;
-    }
-    .ant-table-footer {
-      padding: 10px;
-    }
-    .ant-table-tbody > tr > td {
-      padding: 5px 10px;
-    }
-    .ant-table-thead > tr > th {
-      padding: 10px 5px;
-    }
-  }
-}
-
-.mongolian {
-  z-index: 10;
-  display: none;
-  position: absolute;
-  top: 0;
-  left: 0;
-  width: 100%;
-  height: 100%;
-  a {
-    position: relative;
-    top: 45%;
-    transform: translateY(-45%);
-    padding: 5px 15px;
-    background: #fff;
-    color: #73777a;
-  }
-}
-
-.cover {
-  position: relative;
-  margin: 0;
-  width: 100%;
-  height: 100%;
-  img {
-    width: 100%;
-    height: 100%;
-  }
-  &:hover {
-    .mongolian {
-      display: block;
-      background: rgba(0,193,222,.8);
-    }
-  }
-}
-
-.product {
-  position: relative;
-  &:hover {
-    .mongolian {
-      display: block;
-      background: rgba(0,193,222,.8);
-    }
-  }
-}

+ 0 - 33
src/routes/Frontend/Recommend/index.js

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

+ 0 - 472
src/routes/Frontend/Tag/TagCreate.js

@@ -1,472 +0,0 @@
-import React, { Component } from 'react';
-import pathToRegexp from 'path-to-regexp';
-import { connect } from 'dva';
-import { routerRedux } from 'dva/router';
-import { message, Form, Table, Modal, Card, Button, Input, Switch, Radio } from 'antd';
-import { statusToBool, boolToStatus } from '../../../utils/utils';
-import AXDragSortTable from '../../../components/AXDragSortTable/index';
-import Selector from '../../../components/AXTableSelector/Selector';
-import FooterToolbar from '../../../components/FooterToolbar/index';
-import styles from './TagCreate.less';
-
-const Message = message;
-
-const formItemLayout = {
-  labelCol: {
-    xs: { span: 24 },
-    sm: { span: 2 },
-  },
-  wrapperCol: {
-    xs: { span: 24 },
-    sm: { span: 14 },
-    md: { span: 12 },
-  },
-};
-
-@connect(({ loading, tag, tagGroup, shelves, tagType, merchant }) => ({
-  tag,
-  shelves,
-  tagGroup,
-  tagType,
-  merchant,
-  submitting: loading.models.tag,
-  sLoading: loading.models.shelves,
-  mLoading: loading.models.merchant,
-  tLoading: loading.models.tagGroup,
-  ttLoading: loading.models.tagType,
-}))
-@Form.create()
-export default class TagCreatePage extends Component {
-  state = {
-    tagTypeSelectorDestroy: true,
-    tagGroupSelectorDestroy: true,
-    merchantSelectorDestroy: true,
-    shelvesSelectorDestroy: true,
-    productType: 'Course',
-  };
-  componentWillMount() {
-    this.props.dispatch({
-      type: 'tag/cleanItemState',
-      payload: {},
-    });
-  }
-  componentDidMount() {
-    const matchId = this.isEdit();
-    if (matchId) {
-      this.props.dispatch({
-        type: 'tag/fetchTagItem',
-        payload: { tagId: matchId },
-      });
-    }
-  }
-  isEdit = () => {
-    const { location } = this.props;
-    const match = pathToRegexp('/frontend/tag/edit/:id').exec(location.pathname);
-    if (match) {
-      return match[1];
-    }
-    return false;
-  };
-  handleRadioChange=(e) => {
-    this.setState({ productType: e.target.value });
-    this.selectorDataFetcher(e.target.value, {});
-  };
-  selectorDataFetcher=(name, params) => {
-    switch (name) {
-      case 'Course':
-        this.props.dispatch({
-          type: 'shelves/fetchCourseItemList',
-          payload: params,
-        });
-        break;
-      case 'Support':
-        this.props.dispatch({
-          type: 'shelves/fetchSupportItemList',
-          payload: params,
-        });
-        break;
-      case 'tagGroup':
-        this.props.dispatch({
-          type: 'tagGroup/fetchTagGroupList',
-          payload: params,
-        });
-        break;
-      case 'tagType':
-        this.props.dispatch({
-          type: 'tagType/fetchTagTypeList',
-          payload: params,
-        });
-        break;
-      case 'merchant':
-        this.props.dispatch({
-          type: 'merchant/fetchMerchantList',
-          payload: params,
-        });
-        break;
-      default:
-        break;
-    }
-  };
-  handleTagMetaSelectorModalShow = (flag) => {
-    this.setState({
-      [`${flag}SelectorDestroy`]: false,
-    });
-    this.selectorDataFetcher(flag);
-  };
-  handleTagMetaInfoSelectorChange = (flag, params) => {
-    this.selectorDataFetcher(flag, params);
-  };
-  handleTagMetaInfoSelectorCancel = (flag) => {
-    this.setState({
-      [`${flag}SelectorDestroy`]: true,
-    });
-  };
-  handleTagMetaInfoSelectorFinish = (flag, rows) => {
-    this.setState({
-      [`${flag}SelectorDestroy`]: true,
-    });
-    if (!rows || !rows.length) {
-      return;
-    }
-    let payload;
-    switch (flag) {
-      case 'tagGroup':
-        payload = { groupId: rows[0].id, groupName: rows[0].name };
-        break;
-      case 'tagType':
-        payload = { typeCode: rows[0].code };
-        break;
-      case 'merchant':
-        payload = { merchantId: rows[0].id, merchantName: rows[0].name };
-        break;
-      default:
-        break;
-    }
-    this.props.dispatch({
-      type: 'tag/fixCurrentItem',
-      payload,
-    });
-  };
-  handleShelvesSelectorModalShow = () => {
-    const { tag } = this.props;
-    const { currentItem } = tag;
-    const { merchantId } = currentItem;
-    if (!merchantId) {
-      Message.error('请先选择标签所属的渠道!');
-      return;
-    }
-    const params = { merchantId };
-    this.setState({
-      shelvesSelectorDestroy: false,
-    });
-    this.selectorDataFetcher(this.state.productType, params);
-  };
-  handleShelvesSelectorChange = (params) => {
-    const { tag } = this.props;
-    const { currentItem } = tag;
-    const { merchantId } = currentItem;
-    this.selectorDataFetcher(this.state.productType, { ...params, merchantId });
-  };
-  handleShelvesSelectorCancel = () => {
-    this.setState({
-      shelvesSelectorDestroy: true,
-    });
-  };
-  handleShelvesSelectorFinish = (rows) => {
-    this.setState({
-      shelvesSelectorDestroy: true,
-    });
-    if (!rows || !rows.length) {
-      return;
-    }
-    this.props.dispatch({
-      type: 'tag/fixCurrentItem',
-      payload: { productList: rows },
-    });
-  };
-  handleDragSortTableChange = (rows) => {
-    this.props.dispatch({
-      type: 'tag/fixCurrentItem',
-      payload: { productList: rows },
-    });
-  };
-  handlePageBack = () => {
-    this.props.dispatch(routerRedux.push({
-      pathname: '/frontend/tag',
-      state: this.props.location.state,
-    }));
-  };
-  handlePageSubmit = (e) => {
-    e.preventDefault();
-    this.props.form.validateFieldsAndScroll((err, values) => {
-      if (!err) {
-        const { name, status } = values;
-        const { tag } = this.props;
-        const { currentItem } = tag;
-        const { productList = [], groupId, typeCode } = currentItem;
-        const id = this.isEdit();
-        if (id) {
-          this.props.dispatch({
-            type: 'tag/updateTagItem',
-            payload: {
-              id,
-              name,
-              groupId,
-              typeCode,
-              status: boolToStatus(status),
-              productList: productList.map(item => item.pid),
-            },
-            states: this.props.location.state,
-          });
-        } else {
-          this.props.dispatch({
-            type: 'tag/createTagItem',
-            payload: {
-              name,
-              groupId,
-              typeCode,
-              status: boolToStatus(status),
-              productList: productList.map(item => item.pid),
-            },
-            states: this.props.location.state,
-          });
-        }
-      }
-    });
-  };
-
-  render() {
-    const {
-      form, submitting, mLoading, tLoading, ttLoading,
-      sLoading, shelves, tag, tagGroup, tagType, merchant,
-    } = this.props;
-    const {
-      shelvesSelectorDestroy, tagGroupSelectorDestroy,
-      merchantSelectorDestroy, tagTypeSelectorDestroy, productType,
-    } = this.state;
-    const { currentItem } = tag;
-    const { status, typeCode, name, groupName, merchantName, productList = [] } = currentItem;
-    const { getFieldDecorator } = form;
-
-    const tagMetaData = [{
-      fieldName: '所属类型:',
-      value: typeCode,
-      key: 'tagType',
-    }, {
-      fieldName: '所属标签组:',
-      value: groupName,
-      key: 'tagGroup',
-    }, {
-      fieldName: '所属渠道:',
-      value: merchantName,
-      key: 'merchant',
-    }];
-    const tagMetaColumns = [{
-      dataIndex: 'fieldName',
-      key: 1,
-      width: '10%',
-      align: 'left',
-      render: (text, record) => (
-        <Button
-          size="small"
-          type="primary"
-          style={{ width: 90 }}
-          onClick={() => this.handleTagMetaSelectorModalShow(record.key)}
-        >{text}
-        </Button>
-      ),
-    }, {
-      dataIndex: 'value',
-      key: 2,
-      width: '90%',
-    }];
-    const productColumns = [{
-      title: '产品编号',
-      dataIndex: 'code',
-      key: 1,
-      width: '35%',
-    }, {
-      title: '产品名称',
-      dataIndex: 'name',
-      key: 2,
-    }];
-    const renderProductModalTitle = () => {
-      return (
-        <Radio.Group
-          value={productType}
-          onChange={this.handleRadioChange}
-          className={styles.radio}
-        >
-          <Radio.Button value="Course">课程</Radio.Button>
-          <Radio.Button value="Support">配套</Radio.Button>
-        </Radio.Group>
-      );
-    };
-    const getTagTypeModal = () => {
-      return (
-        <Modal
-          width={1100}
-          footer={null}
-          visible
-          title="标签类别"
-          maskClosable={false}
-          onCancel={() => this.handleTagMetaInfoSelectorCancel('tagType')}
-        >
-          <Selector
-            multiple={false}
-            loading={ttLoading}
-            selectorName="TagType"
-            list={tagType.list}
-            pageNo={tagType.pageNo}
-            pageSize={tagType.pageSize}
-            totalSize={tagType.totalSize}
-            onCancel={() => this.handleTagMetaInfoSelectorCancel('tagType')}
-            onChange={data => this.handleTagMetaInfoSelectorChange('tagType', data)}
-            onFinish={data => this.handleTagMetaInfoSelectorFinish('tagType', data)}
-          />
-        </Modal>
-      );
-    };
-    const getTagGroupModal = () => {
-      return (
-        <Modal
-          width={1100}
-          footer={null}
-          visible
-          title="标签组"
-          maskClosable={false}
-          onCancel={() => this.handleTagMetaInfoSelectorCancel('tagGroup')}
-        >
-          <Selector
-            multiple={false}
-            loading={tLoading}
-            selectorName="TagGroup"
-            list={tagGroup.list}
-            pageNo={tagGroup.pageNo}
-            pageSize={tagGroup.pageSize}
-            totalSize={tagGroup.totalSize}
-            onCancel={() => this.handleTagMetaInfoSelectorCancel('tagGroup')}
-            onChange={data => this.handleTagMetaInfoSelectorChange('tagGroup', data)}
-            onFinish={data => this.handleTagMetaInfoSelectorFinish('tagGroup', data)}
-          />
-        </Modal>
-      );
-    };
-    const getMerchantModal = () => {
-      return (
-        <Modal
-          width={1100}
-          footer={null}
-          visible
-          title="渠道列表"
-          maskClosable={false}
-          onCancel={() => this.handleTagMetaInfoSelectorCancel('merchant')}
-        >
-          <Selector
-            multiple={false}
-            loading={mLoading}
-            selectorName="Merchant"
-            list={merchant.list}
-            pageNo={merchant.pageNo}
-            pageSize={merchant.pageSize}
-            totalSize={merchant.totalSize}
-            onCancel={() => this.handleTagMetaInfoSelectorCancel('merchant')}
-            onChange={data => this.handleTagMetaInfoSelectorChange('merchant', data)}
-            onFinish={data => this.handleTagMetaInfoSelectorFinish('merchant', data)}
-          />
-        </Modal>
-      );
-    };
-    const getProductModal = () => {
-      return (
-        <Modal
-          width={1100}
-          footer={null}
-          visible
-          title={renderProductModalTitle()}
-          maskClosable={false}
-          onCancel={this.handleShelvesSelectorCancel}
-        >
-          <Selector
-            multiple
-            loading={sLoading}
-            selectorName={productType}
-            list={shelves.list}
-            pageNo={shelves.pageNo}
-            pageSize={shelves.pageSize}
-            totalSize={shelves.totalSize}
-            onCancel={this.handleShelvesSelectorCancel}
-            onChange={this.handleShelvesSelectorChange}
-            onFinish={this.handleShelvesSelectorFinish}
-          />
-        </Modal>
-      );
-    };
-    const renderProductCardName = () => {
-      return (
-        <Button type="primary" onClick={this.handleShelvesSelectorModalShow}>关联产品</Button>
-      );
-    };
-    return (
-      <div>
-        {/* 基础信息Card */}
-        <Card title="基础信息" style={{ marginBottom: 16 }}>
-          <Form>
-            <Form.Item hasFeedback label="标签名称" {...formItemLayout}>
-              {getFieldDecorator('name', {
-                rules: [{ required: true, message: '请填写标签名称' }],
-                initialValue: name,
-              })(
-                <Input placeholder="请输入" />
-              )}
-            </Form.Item>
-            <Form.Item label="标签状态" {...formItemLayout}>
-              {getFieldDecorator('status', {
-                valuePropName: 'checked',
-                initialValue: statusToBool(status),
-              })(
-                <Switch checkedChildren="正常" unCheckedChildren="删除" />
-              )}
-            </Form.Item>
-          </Form>
-        </Card>
-        {/* 标签类别信息选择Card */}
-        <Card title="类别信息" style={{ marginBottom: 16 }}>
-          <Table
-            bordered
-            size="small"
-            showHeader={false}
-            pagination={false}
-            columns={tagMetaColumns}
-            dataSource={tagMetaData}
-          />
-          {!tagGroupSelectorDestroy && getTagGroupModal()}
-          {!tagTypeSelectorDestroy && getTagTypeModal()}
-          {!merchantSelectorDestroy && getMerchantModal()}
-        </Card>
-        {/* 产品选择Card */}
-        <Card title={renderProductCardName()} style={{ marginBottom: 70 }}>
-          <AXDragSortTable
-            data={productList}
-            columns={productColumns}
-            onChange={this.handleDragSortTableChange}
-          />
-          {!shelvesSelectorDestroy && getProductModal()}
-        </Card>
-        <FooterToolbar style={{ width: '100%' }}>
-          <Button
-            onClick={this.handlePageBack}
-            style={{ marginRight: 10 }}
-          >取消
-          </Button>
-          <Button
-            type="primary"
-            loading={submitting}
-            onClick={this.handlePageSubmit}
-          >提交
-          </Button>
-        </FooterToolbar>
-      </div>
-    );
-  }
-}

+ 0 - 43
src/routes/Frontend/Tag/TagCreate.less

@@ -1,43 +0,0 @@
-@import "../../../../node_modules/antd/lib/style/themes/default.less";
-
-.cardName {
-  & > span {
-    display: inline-block;
-    height: 24px;
-    padding: 0 7px;
-    vertical-align: bottom;
-  }
-  :global {
-    .ant-btn-primary {
-      margin-left: 10px;
-    }
-  }
-}
-
-.cover {
-  width: 100%;
-  height: 240px;
-  img {
-    width: 100%;
-    height: 100%;
-  }
-}
-
-.background {
-  width: 100%;
-  height: 240px;
-  line-height: 240px;
-  vertical-align: middle;
-  img {
-    width: 100%;
-  }
-}
-
-.radio {
-  :global {
-    .ant-radio-button-wrapper-checked {
-      background-color: @primary-color;
-      color: #fff;
-    }
-  }
-}

+ 0 - 171
src/routes/Frontend/Tag/TagList.js

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

+ 0 - 17
src/routes/Frontend/Tag/TagList.less

@@ -1,17 +0,0 @@
-@import "../../../../node_modules/antd/lib/style/themes/default.less";
-
-.link {
-  font-weight: 500;
-}
-.editBtn {
-  margin-right: 10px;
-  background: @primary-5;
-  color: #fff;
-  font-weight: 500;
-}
-.delBtn {
-  background: #f5222d;
-  color: #fff;
-  font-weight: 500;
-}
-

+ 0 - 33
src/routes/Frontend/Tag/index.js

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

+ 0 - 306
src/routes/Frontend/TagGroup/TagGroupCreate.js

@@ -1,306 +0,0 @@
-import React, { Component } from 'react';
-import pathToRegexp from 'path-to-regexp';
-import { connect } from 'dva';
-import { routerRedux } from 'dva/router';
-import { Form, Table, Modal, Card, Button, Input, Switch } from 'antd';
-import { renderStatus, statusToBool, boolToStatus } from '../../../utils/utils';
-import AXDragSortTable from '../../../components/AXDragSortTable';
-import Selector from '../../../components/AXTableSelector/Selector';
-import FooterToolbar from '../../../components/FooterToolbar';
-
-const formItemLayout = {
-  labelCol: {
-    xs: { span: 24 },
-    sm: { span: 3 },
-  },
-  wrapperCol: {
-    xs: { span: 24 },
-    sm: { span: 14 },
-    md: { span: 12 },
-  },
-};
-
-@connect(({ loading, tagGroup, merchant }) => ({
-  merchant,
-  tagGroup,
-  submitting: loading.models.tagGroup,
-  mLoading: loading.models.merchant,
-}))
-@Form.create()
-export default class TagCreatePage extends Component {
-  state = {
-    merchantSelectorDestroy: true,
-  };
-  componentWillMount() {
-    const match = pathToRegexp('/frontend/tagGroup/create').exec(this.props.location.pathname);
-    if (match) {
-      this.cleanPageState();
-    }
-  }
-  componentDidMount() {
-    const matchId = this.isEdit();
-    if (matchId) {
-      this.props.dispatch({
-        type: 'tagGroup/fetchTagGroupItem',
-        payload: { groupId: matchId },
-      });
-    }
-  }
-  isEdit = () => {
-    const { location } = this.props;
-    const match = pathToRegexp('/frontend/tagGroup/edit/:id').exec(location.pathname);
-    if (match) {
-      return match[1];
-    }
-    return false;
-  };
-  cleanPageState=() => {
-    this.props.dispatch({
-      type: 'tagGroup/cleanItemState',
-      payload: {},
-    });
-  };
-  selectorDataFetcher=(name, params) => {
-    switch (name) {
-      case 'Merchant':
-        this.props.dispatch({
-          type: 'merchant/fetchMerchantList',
-          payload: params,
-        });
-        break;
-      case 'Tag':
-        this.props.dispatch({
-          type: 'tag/fetchTagList',
-          payload: params,
-        });
-        break;
-      default:
-        break;
-    }
-  };
-  handleMerchantSelectorModalShow = () => {
-    this.setState({
-      merchantSelectorDestroy: false,
-    });
-    this.selectorDataFetcher('Merchant');
-  };
-  handleMerchantSelectorChange = (params) => {
-    this.selectorDataFetcher('Merchant', params);
-  };
-  handleMerchantSelectorCancel = () => {
-    this.setState({
-      merchantSelectorDestroy: true,
-    });
-  };
-  handleMerchantSelectorFinish = (rows) => {
-    this.setState({
-      merchantSelectorDestroy: true,
-    });
-    if (!rows || !rows.length) {
-      return;
-    }
-    const { id, name } = rows[0];
-    this.props.dispatch({
-      type: 'tagGroup/fixCurrentItem',
-      payload: {
-        merchantId: id,
-        merchantName: name,
-      },
-    });
-  };
-  handleDragSortTableChange = (rows) => {
-    this.props.dispatch({
-      type: 'tagGroup/fixCurrentItem',
-      payload: { tagList: rows },
-    });
-  };
-  handlePageBack = () => {
-    this.props.dispatch(routerRedux.push({
-      pathname: '/frontend/tagGroup',
-      state: this.props.location.state,
-    }));
-  };
-  handlePageSubmit = (e) => {
-    e.preventDefault();
-    this.props.form.validateFieldsAndScroll((err, values) => {
-      if (!err) {
-        const { code, name, status } = values;
-        const { tagGroup } = this.props;
-        const { currentItem } = tagGroup;
-        const { tagList = [], merchantId } = currentItem;
-        const id = this.isEdit();
-        if (id) {
-          this.props.dispatch({
-            type: 'tagGroup/updateTagGroupItem',
-            payload: {
-              id,
-              code,
-              name,
-              merchantId,
-              status: boolToStatus(status),
-              tagList: tagList.map(item => item.id),
-            },
-            states: this.props.location.state,
-          });
-        } else {
-          this.props.dispatch({
-            type: 'tagGroup/createTagGroupItem',
-            payload: {
-              code,
-              name,
-              merchantId,
-              status: boolToStatus(status),
-              tagList: tagList.map(item => item.id),
-            },
-            states: this.props.location.state,
-          });
-        }
-      }
-    });
-  };
-
-  render() {
-    const { form, submitting, mLoading, merchant, tagGroup } = this.props;
-    const { merchantSelectorDestroy } = this.state;
-    const { currentItem } = tagGroup;
-    const { status, code, name, merchantName, tagList = [] } = currentItem;
-    const { getFieldDecorator } = form;
-
-    const merchantData = [{
-      fieldName: '渠道名称',
-      value: merchantName,
-      key: 'merchantName',
-    }];
-    const merchantColumns = [{
-      dataIndex: 'fieldName',
-      key: 1,
-      width: '30%',
-    }, {
-      dataIndex: 'value',
-      key: 2,
-      width: '70%',
-    }];
-    const tagColumns = [{
-      title: '标签名称',
-      dataIndex: 'name',
-      key: 1,
-      width: '35%',
-    }, {
-      title: '标签状态',
-      dataIndex: 'status',
-      render: text => renderStatus(text),
-      key: 2,
-    }];
-    const getMerchantModal = () => {
-      return (
-        <Modal
-          width={1100}
-          footer={null}
-          visible
-          title="厂商列表"
-          maskClosable={false}
-          onCancel={this.handleMerchantSelectorCancel}
-        >
-          <Selector
-            multiple={false}
-            loading={mLoading}
-            selectorName="Merchant"
-            list={merchant.list}
-            pageNo={merchant.pageNo}
-            pageSize={merchant.pageSize}
-            totalSize={merchant.totalSize}
-            onCancel={this.handleMerchantSelectorCancel}
-            onChange={this.handleMerchantSelectorChange}
-            onFinish={this.handleMerchantSelectorFinish}
-          />
-        </Modal>
-      );
-    };
-    const renderMerchantCardName = () => {
-      return (
-        <Button
-          type="primary"
-          disabled={!!this.isEdit()}
-          onClick={this.handleMerchantSelectorModalShow}
-        >所属渠道
-        </Button>
-      );
-    };
-    return (
-      <div>
-        {/* 基础信息Card */}
-        <Card title="基础信息" style={{ marginBottom: 16 }}>
-          <Form>
-            <Form.Item hasFeedback label="标签组编号" {...formItemLayout}>
-              {getFieldDecorator('code', {
-                rules: [
-                  {
-                    required: true, message: '请填写标签组编号',
-                  }, {
-                    pattern: /^[a-zA-Z0-9_-]+$/g, message: '编号包含非法字符',
-                  },
-                ],
-                initialValue: code,
-              })(
-                <Input
-                  placeholder="请输入"
-                  disabled={!!this.isEdit()}
-                />
-              )}
-            </Form.Item>
-            <Form.Item hasFeedback label="标签组名称" {...formItemLayout}>
-              {getFieldDecorator('name', {
-                rules: [{ required: true, message: '请填写标签名称' }],
-                initialValue: name,
-              })(
-                <Input placeholder="请输入" />
-              )}
-            </Form.Item>
-            <Form.Item label="标签组状态" {...formItemLayout}>
-              {getFieldDecorator('status', {
-                valuePropName: 'checked',
-                initialValue: statusToBool(status),
-              })(
-                <Switch checkedChildren="正常" unCheckedChildren="删除" />
-              )}
-            </Form.Item>
-          </Form>
-        </Card>
-        {/* 厂商选择Card */}
-        <Card title={renderMerchantCardName()} style={{ marginBottom: 16 }}>
-          <Table
-            bordered
-            showHeader={false}
-            pagination={false}
-            columns={merchantColumns}
-            dataSource={merchantData}
-          />
-          {!merchantSelectorDestroy && getMerchantModal()}
-        </Card>
-        {/* 标签排序Card */}
-        {this.isEdit() && (
-          <Card title="标签列表" style={{ marginBottom: 70 }}>
-            <AXDragSortTable
-              data={tagList}
-              columns={tagColumns}
-              onChange={this.handleDragSortTableChange}
-            />
-          </Card>
-        )}
-        <FooterToolbar style={{ width: '100%' }}>
-          <Button
-            onClick={this.handlePageBack}
-            style={{ marginRight: 10 }}
-          >取消
-          </Button>
-          <Button
-            type="primary"
-            loading={submitting}
-            onClick={this.handlePageSubmit}
-          >提交
-          </Button>
-        </FooterToolbar>
-      </div>
-    );
-  }
-}

+ 0 - 34
src/routes/Frontend/TagGroup/TagGroupCreate.less

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

+ 0 - 169
src/routes/Frontend/TagGroup/TagGroupList.js

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

+ 0 - 33
src/routes/Frontend/TagGroup/index.js

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

+ 0 - 311
src/routes/Frontend/TagType/TagTypeCreate.js

@@ -1,311 +0,0 @@
-/* eslint-disable prefer-destructuring */
-import React, { Component } from 'react';
-import pathToRegexp from 'path-to-regexp';
-import { connect } from 'dva';
-import { routerRedux } from 'dva/router';
-import { Form, Modal, Card, Button, Input, Switch, Divider } from 'antd';
-import { renderStatus, statusToBool, boolToStatus } from '../../../utils/utils';
-import AXDragSortTable from '../../../components/AXDragSortTable';
-import Selector from '../../../components/AXTableSelector/Selector';
-import FooterToolbar from '../../../components/FooterToolbar';
-
-const formItemLayout = {
-  labelCol: {
-    xs: { span: 24 },
-    sm: { span: 3 },
-  },
-  wrapperCol: {
-    xs: { span: 24 },
-    sm: { span: 14 },
-    md: { span: 12 },
-  },
-};
-
-/**
- * 根据渠道id过滤标签
- * @param merchantId
- * @param tagList
- */
-const filterTagListByMerchantId = (merchantId, tagList) => {
-  if (!merchantId) { return tagList; }
-  return tagList.filter(tag => tag.merchantId === merchantId);
-};
-/**
- * 根据子数组顺序调整父数组
- * @param subArray
- * @param parentArray
- */
-const arraySort = (subArray = [], parentArray = []) => {
-  let cursor = 0;
-  const newArray = [...parentArray];
-  while (cursor < subArray.length - 1) {
-    const prevId = subArray[cursor].id;
-    const nextId = subArray[cursor + 1].id;
-    const currentIndex = newArray.findIndex(data => data.id === prevId);
-    const targetIndex = newArray.findIndex(data => data.id === nextId);
-    if (currentIndex > targetIndex) {
-      newArray[currentIndex] = newArray.splice(targetIndex, 1, newArray[currentIndex])[0];
-    }
-    cursor += 1;
-  }
-  return newArray;
-};
-
-@connect(({ loading, tagType, merchant }) => ({
-  tagType,
-  merchant,
-  submitting: loading.models.tagType,
-  mLoading: loading.models.merchant,
-}))
-@Form.create()
-export default class TagTypeCreatePage extends Component {
-  state = {
-    merchantSelectorDestroy: true,
-    currentMerchantId: '',
-    currentMerchantName: '全部',
-  };
-  componentWillMount() {
-    this.props.dispatch({
-      type: 'tagType/cleanItemState',
-      payload: {},
-    });
-  }
-  componentDidMount() {
-    const matchId = this.isEdit();
-    if (matchId) {
-      this.props.dispatch({
-        type: 'tagType/fetchTagTypeItem',
-        payload: { tagTypeId: matchId },
-      });
-    }
-  }
-  isEdit = () => {
-    const { location } = this.props;
-    const match = pathToRegexp('/frontend/tagType/edit/:id').exec(location.pathname);
-    if (match) {
-      return match[1];
-    }
-    return false;
-  };
-  selectorDataFetcher = (name, params) => {
-    switch (name) {
-      case 'Merchant':
-        this.props.dispatch({
-          type: 'merchant/fetchMerchantList',
-          payload: params,
-        });
-        break;
-      case 'Tag':
-        this.props.dispatch({
-          type: 'tag/fetchTagList',
-          payload: params,
-        });
-        break;
-      default:
-        break;
-    }
-  };
-  handleMerchantSelectorModalShow = () => {
-    this.setState({
-      merchantSelectorDestroy: false,
-    });
-    this.selectorDataFetcher('Merchant');
-  };
-  handleMerchantSelectorChange = (params) => {
-    this.selectorDataFetcher('Merchant', params);
-  };
-  handleMerchantSelectorCancel = () => {
-    this.setState({
-      merchantSelectorDestroy: true,
-    });
-  };
-  handleMerchantSelectorFinish = (rows) => {
-    if (!rows || !rows.length) {
-      return;
-    }
-    const { id, name } = rows[0];
-    this.setState({
-      currentMerchantId: id,
-      currentMerchantName: name,
-      merchantSelectorDestroy: true,
-    });
-  };
-  handleDragSortTableChange = (rows) => {
-    const { currentItem } = this.props.tagType;
-    const { tagList } = currentItem;
-    this.props.dispatch({
-      type: 'tagType/fixCurrentItem',
-      payload: { tagList: arraySort(rows || [], tagList || []) },
-    });
-  };
-  handlePageBack = () => {
-    this.props.dispatch(routerRedux.push({
-      pathname: '/frontend/tagType',
-      state: this.props.location.state,
-    }));
-  };
-  handlePageSubmit = (e) => {
-    e.preventDefault();
-    this.props.form.validateFieldsAndScroll((err, values) => {
-      if (!err) {
-        const { code, name, status } = values;
-        const { tagType } = this.props;
-        const { currentItem } = tagType;
-        const { tagList = [], merchantId } = currentItem;
-        const id = this.isEdit();
-        if (id) {
-          this.props.dispatch({
-            type: 'tagType/updateTagTypeItem',
-            payload: {
-              id,
-              code,
-              name,
-              merchantId,
-              status: boolToStatus(status),
-              tagList: tagList.map(item => item.id),
-            },
-            states: this.props.location.state,
-          });
-        } else {
-          this.props.dispatch({
-            type: 'tagType/createTagTypeItem',
-            payload: {
-              code,
-              name,
-              merchantId,
-              status: boolToStatus(status),
-              tagList: tagList.map(item => item.id),
-            },
-            states: this.props.location.state,
-          });
-        }
-      }
-    });
-  };
-
-  render() {
-    const { form, submitting, mLoading, merchant, tagType } = this.props;
-    const { merchantSelectorDestroy, currentMerchantId, currentMerchantName } = this.state;
-    const { currentItem } = tagType;
-    const { status, code, name, tagList = [] } = currentItem;
-    const { getFieldDecorator } = form;
-
-    const tagColumns = [{
-      title: '标签名称',
-      dataIndex: 'name',
-      key: 1,
-      width: '35%',
-    }, {
-      title: '标签状态',
-      dataIndex: 'status',
-      render: text => renderStatus(text),
-      key: 2,
-    }];
-    const getMerchantModal = () => {
-      return (
-        <Modal
-          width={1100}
-          footer={null}
-          visible
-          title="渠道列表"
-          maskClosable={false}
-          onCancel={this.handleMerchantSelectorCancel}
-        >
-          <Selector
-            multiple={false}
-            loading={mLoading}
-            selectorName="Merchant"
-            list={merchant.list}
-            pageNo={merchant.pageNo}
-            pageSize={merchant.pageSize}
-            totalSize={merchant.totalSize}
-            onCancel={this.handleMerchantSelectorCancel}
-            onChange={this.handleMerchantSelectorChange}
-            onFinish={this.handleMerchantSelectorFinish}
-          />
-        </Modal>
-      );
-    };
-    return (
-      <div>
-        {/* 基础信息Card */}
-        <Card title="基础信息" style={{ marginBottom: 16 }}>
-          <Form>
-            <Form.Item hasFeedback label="标签类型编号" {...formItemLayout}>
-              {getFieldDecorator('code', {
-                rules: [
-                  {
-                    required: true, message: '请填写标签类型编号',
-                  }, {
-                    pattern: /^[a-zA-Z0-9_-]+$/g, message: '编号包含非法字符',
-                  },
-                ],
-                initialValue: code,
-              })(
-                <Input
-                  placeholder="请输入"
-                  disabled={!!this.isEdit()}
-                />
-              )}
-            </Form.Item>
-            <Form.Item hasFeedback label="标签类型名称" {...formItemLayout}>
-              {getFieldDecorator('name', {
-                rules: [{ required: true, message: '请填写标签类型名称' }],
-                initialValue: name,
-              })(
-                <Input placeholder="请输入" />
-              )}
-            </Form.Item>
-            <Form.Item label="标签类型状态" {...formItemLayout}>
-              {getFieldDecorator('status', {
-                valuePropName: 'checked',
-                initialValue: statusToBool(status),
-              })(
-                <Switch checkedChildren="正常" unCheckedChildren="删除" />
-              )}
-            </Form.Item>
-          </Form>
-        </Card>
-        {/* 标签排序Card */}
-        {this.isEdit() && (
-          <Card
-            title={
-              <div>
-                <span>标签列表</span>
-                <Divider type="vertical" />
-                <Button
-                  type="primary"
-                  size="small"
-                  style={{ width: 100 }}
-                  onClick={this.handleMerchantSelectorModalShow}
-                >{currentMerchantName}
-                </Button>
-              </div>
-            }
-            style={{ marginBottom: 70 }}
-          >
-            <AXDragSortTable
-              data={filterTagListByMerchantId(currentMerchantId, tagList)}
-              columns={tagColumns}
-              onChange={this.handleDragSortTableChange}
-            />
-            {!merchantSelectorDestroy && getMerchantModal()}
-          </Card>
-        )}
-        <FooterToolbar style={{ width: '100%' }}>
-          <Button
-            onClick={this.handlePageBack}
-            style={{ marginRight: 10 }}
-          >取消
-          </Button>
-          <Button
-            type="primary"
-            loading={submitting}
-            onClick={this.handlePageSubmit}
-          >提交
-          </Button>
-        </FooterToolbar>
-      </div>
-    );
-  }
-}

+ 0 - 164
src/routes/Frontend/TagType/TagTypeList.js

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

+ 0 - 32
src/routes/Frontend/TagType/index.js

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

+ 0 - 285
src/routes/Merchant/MerchantCreate.js

@@ -1,285 +0,0 @@
-import React, { PureComponent } from 'react';
-import pathToRegexp from 'path-to-regexp';
-import { Card, Form, Input, Button, Radio, Switch } from 'antd';
-import { connect } from 'dva';
-import { routerRedux } from 'dva/router';
-import PageHeaderLayout from '../../layouts/PageHeaderLayout';
-import FooterToolbar from '../../components/FooterToolbar';
-import { Hotax } from '../../utils/config';
-import { statusToBool, boolToStatus } from '../../utils/utils';
-import styles from './MerchantCreate.less';
-
-const fieldLabels = {
-  type: '商户类型',
-  name: '商户名称',
-  code: '商户编号',
-  simple: '商户简称',
-  contactName: '商户联系人',
-  mobile: '联系电话',
-  depositBank: '开户银行',
-  bankAccount: '银行账户',
-  licenseId: '营业执照',
-  taxNumber: '纳税人识别号',
-  receiptType: '发票类型',
-};
-const domains = [{
-  title: '平台方',
-  value: Hotax.DOMAIN_LJ,
-}, {
-  title: '渠道商',
-  value: Hotax.DOMAIN_PJ,
-}, {
-  title: '供应商',
-  value: Hotax.DOMAIN_CP,
-}];
-const receipts = [{
-  title: '普通发票',
-  value: 'COMMON',
-}, {
-  title: '增值税发票',
-  value: 'SPECIAL',
-}];
-const formItemLayout = {
-  labelCol: {
-    xs: { span: 24 },
-    sm: { span: 6 },
-  },
-  wrapperCol: {
-    xs: { span: 24 },
-    sm: { span: 14 },
-    md: { span: 12 },
-  },
-};
-
-@Form.create()
-@connect(({ loading, merchant }) => ({
-  merchant,
-  submitting: loading.models.merchant,
-}))
-export default class MerchantCreatePage extends PureComponent {
-  componentWillMount() {
-    // 如果是添加商户操作,进入此页面时把state清一下
-    const { location } = this.props;
-    const match = pathToRegexp('/merchant/create').exec(location.pathname);
-    if (match) {
-      this.cleanPageState();
-    }
-  }
-  componentDidMount() {
-    const matchId = this.isEdit();
-    if (matchId) {
-      this.props.dispatch({
-        type: 'merchant/fetchMerchantItem',
-        payload: { id: matchId },
-      });
-    }
-  }
-  isEdit = () => {
-    // 根据路径判断操作类型并决定是否需加载该条目信息<create/edit>
-    const { location } = this.props;
-    const match = pathToRegexp('/merchant/edit/:id').exec(location.pathname);
-    if (match) {
-      return match[1];
-    }
-    return false;
-  };
-  cleanPageState = () => {
-    this.props.dispatch({
-      type: 'merchant/cleanItemState',
-      payload: {},
-    });
-  };
-  handlePageBack = () => {
-    this.props.dispatch(routerRedux.push({
-      pathname: '/merchant/list',
-      state: this.props.location.state,
-    }));
-  };
-  handlePageSubmit = (e) => {
-    e.preventDefault();
-    this.props.form.validateFieldsAndScroll((err, values) => {
-      if (!err) {
-        const { status, ...rest } = values;
-        const matchId = this.isEdit();
-        rest.status = boolToStatus(status);
-        if (matchId) {
-          rest.id = matchId;
-          this.props.dispatch({
-            type: 'merchant/updateMerchantItem',
-            payload: rest,
-            states: this.props.location.state,
-          });
-        } else {
-          this.props.dispatch({
-            type: 'merchant/createMerchantItem',
-            payload: rest,
-            states: this.props.location.state,
-          });
-        }
-      }
-    });
-  };
-
-  render() {
-    const { submitting, merchant, form } = this.props;
-    const { getFieldDecorator } = form;
-    const { currentItem } = merchant;
-
-    // 是否可编辑
-    const isEditable = !!this.isEdit();
-
-    return (
-      <PageHeaderLayout>
-        <Card style={{ marginBottom: 70 }}>
-          <Form>
-            <Form.Item label={fieldLabels.type} {...formItemLayout}>
-              {getFieldDecorator('domain', {
-                rules: [{ required: true, message: '请选择商户类型!' }],
-                initialValue: currentItem.domain || Hotax.DOMAIN_PJ,
-              })(
-                <Radio.Group disabled={isEditable} className={styles.radio}>
-                  {
-                    domains.map(item =>
-                      (
-                        <Radio.Button
-                          key={item.value}
-                          value={item.value}
-                        >{item.title}
-                        </Radio.Button>
-                      )
-                    )
-                  }
-                </Radio.Group>
-              )}
-            </Form.Item>
-            <Form.Item hasFeedback label={fieldLabels.code} {...formItemLayout}>
-              {getFieldDecorator('code', {
-                rules: [
-                  {
-                    required: true, message: '请填写商户编号!',
-                  }, {
-                    pattern: /^[0-9]{4,6}$/g, message: '请输入4-6位数字编号!',
-                  },
-                ],
-                initialValue: currentItem.code,
-              })(
-                <Input disabled={isEditable} placeholder="请输入" />
-              )}
-            </Form.Item>
-            <Form.Item hasFeedback label={fieldLabels.name} {...formItemLayout}>
-              {getFieldDecorator('name', {
-                rules: [{ required: true, message: '请填写商户名称!' }],
-                initialValue: currentItem.name,
-              })(
-                <Input placeholder="请输入" />
-              )}
-            </Form.Item>
-            <Form.Item hasFeedback label={fieldLabels.simple} {...formItemLayout}>
-              {getFieldDecorator('simple', {
-                rules: [{ required: true, message: '请填写商户简称!' }],
-                initialValue: currentItem.simple,
-              })(
-                <Input placeholder="请输入" />
-              )}
-            </Form.Item>
-            <Form.Item hasFeedback label={fieldLabels.contactName} {...formItemLayout}>
-              {getFieldDecorator('contactName', {
-                rules: [{ required: true, message: '请填写商户联系人!' }],
-                initialValue: currentItem.contactName,
-              })(
-                <Input placeholder="请输入" />
-              )}
-            </Form.Item>
-            <Form.Item hasFeedback label={fieldLabels.mobile} {...formItemLayout}>
-              {getFieldDecorator('mobile', {
-                rules: [
-                  {
-                    required: true, message: '请填写联系电话!',
-                  }, {
-                    pattern: /^[1][34578][0-9]{9}$/g, message: '请输入11位有效手机号!',
-                  }],
-                initialValue: currentItem.mobile,
-              })(
-                <Input placeholder="请输入" />
-              )}
-            </Form.Item>
-            <Form.Item hasFeedback label={fieldLabels.depositBank} {...formItemLayout}>
-              {getFieldDecorator('depositBank', {
-                rules: [{
-                  required: true, message: '开户银行不能为空!',
-                }],
-                initialValue: currentItem.depositBank,
-              })(
-                <Input placeholder="请输入" />
-              )}
-            </Form.Item>
-            <Form.Item hasFeedback label={fieldLabels.bankAccount} {...formItemLayout}>
-              {getFieldDecorator('bankAccount', {
-                rules: [{
-                  required: true, message: '银行账号不能为空!',
-                }, {
-                  pattern: /^[0-9]{1,22}$/g, message: '请输入有效的银行账户!',
-                }],
-                initialValue: currentItem.bankAccount,
-              })(
-                <Input placeholder="请输入" />
-              )}
-            </Form.Item>
-            <Form.Item label={fieldLabels.licenseId} {...formItemLayout}>
-              {getFieldDecorator('licenseId', {
-                initialValue: currentItem.licenseId,
-              })(
-                <Input placeholder="请输入" />
-              )}
-            </Form.Item>
-            <Form.Item label={fieldLabels.taxNumber} {...formItemLayout}>
-              {getFieldDecorator('taxNumber', {
-                initialValue: currentItem.taxNumber,
-              })(
-                <Input placeholder="请输入" />
-              )}
-            </Form.Item>
-            <Form.Item label={fieldLabels.receiptType} {...formItemLayout}>
-              {getFieldDecorator('receiptType', {
-                initialValue: currentItem.receiptType || 'COMMON',
-              })(
-                <Radio.Group className={styles.radio}>
-                  {
-                    receipts.map(item =>
-                      (
-                        <Radio.Button
-                          key={item.value}
-                          value={item.value}
-                        >{item.title}
-                        </Radio.Button>
-                      )
-                    )
-                  }
-                </Radio.Group>
-              )}
-            </Form.Item>
-            <Form.Item label="状态" {...formItemLayout}>
-              {getFieldDecorator('status', {
-                valuePropName: 'checked',
-                initialValue: status ? statusToBool(currentItem.status) : true,
-              })(
-                <Switch
-                  checkedChildren="启用"
-                  unCheckedChildren="不启用"
-                />
-              )}
-            </Form.Item>
-          </Form>
-        </Card>
-        <FooterToolbar style={{ width: '100%' }}>
-          <Button onClick={this.handlePageBack} style={{ marginRight: 10 }}>
-            取消
-          </Button>
-          <Button type="primary" onClick={this.handlePageSubmit} loading={submitting}>
-            提交
-          </Button>
-        </FooterToolbar>
-      </PageHeaderLayout>
-    );
-  }
-}

+ 0 - 10
src/routes/Merchant/MerchantCreate.less

@@ -1,10 +0,0 @@
-@import "~antd/lib/style/themes/default.less";
-
-.radio {
-  :global {
-    .ant-radio-button-wrapper-checked {
-      background-color: @primary-5;
-      color: #fff;
-    }
-  }
-}

+ 0 - 105
src/routes/Merchant/MerchantDeposit.js

@@ -1,105 +0,0 @@
-import React, { PureComponent } from 'react';
-import { connect } from 'dva';
-import { routerRedux } from 'dva/router';
-import { Card, Form, Input, Button } from 'antd';
-import PageHeaderLayout from '../../layouts/PageHeaderLayout';
-import FooterToolbar from '../../components/FooterToolbar';
-import { toDecimal2 } from '../../utils/utils';
-import styles from './MerchantDeposit.less';
-
-const fieldLabels = {
-  code: '商户编号',
-  name: '商户名称',
-  balance: '账户余额',
-  quantity: '充值金额',
-  note: '备注',
-};
-const formItemLayout = {
-  labelCol: {
-    xs: { span: 24 },
-    sm: { span: 6 },
-  },
-  wrapperCol: {
-    xs: { span: 24 },
-    sm: { span: 14 },
-    md: { span: 12 },
-  },
-};
-
-@Form.create()
-@connect(({ loading, merchant }) => ({
-  merchant,
-  submitting: loading.models.merchant,
-}))
-export default class MerchantDepositPage extends PureComponent {
-  handlePageBack = () => {
-    this.props.dispatch(routerRedux.push({
-      pathname: '/merchant/list',
-      state: this.props.location.state,
-    }));
-  }
-  handlePageSubmit = (e) => {
-    e.preventDefault();
-    this.props.form.validateFieldsAndScroll((err, values) => {
-      if (!err) {
-        const { note, quantity } = values;
-        const { id } = this.props.location.state.currentItem;
-        this.props.dispatch({
-          type: 'merchant/depositMerchantItem',
-          payload: {
-            note,
-            quantity,
-            merchantId: id,
-          },
-          states: this.props.location.state,
-        });
-      }
-    });
-  }
-  render() {
-    const { location, form, submitting } = this.props;
-    const { currentItem } = location.state;
-    const { getFieldDecorator } = form;
-    return (
-      <PageHeaderLayout>
-        <Card style={{ marginBottom: 70 }}>
-          <Form>
-            <Form.Item label={fieldLabels.name} {...formItemLayout}>
-              <span>{`${currentItem.name}【${currentItem.code}】`}</span>
-            </Form.Item>
-            <Form.Item label={fieldLabels.balance} {...formItemLayout}>
-              <span className={styles.balance}>{toDecimal2(currentItem.balance)}元</span>
-            </Form.Item>
-            <Form.Item label={fieldLabels.quantity} {...formItemLayout}>
-              {getFieldDecorator('quantity', {
-                rules: [
-                  {
-                    required: true, type: 'string', message: '充值金额不能为空!',
-                  }, {
-                    pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/, message: '充值金额格式错误!',
-                  },
-                ],
-              })(
-                <Input placeholder="请输入充值金额" addonAfter="元" />
-              )}
-            </Form.Item>
-            <Form.Item label={fieldLabels.note} {...formItemLayout}>
-              {getFieldDecorator('note', {
-              })(
-                <Input placeholder="请输入" />
-              )}
-            </Form.Item>
-          </Form>
-        </Card>
-        <FooterToolbar style={{ width: '100%' }}>
-          <Button onClick={this.handlePageBack} style={{ marginRight: 10 }}>
-            取消
-          </Button>
-          <Button type="primary" onClick={this.handlePageSubmit} loading={submitting}>
-            提交
-          </Button>
-        </FooterToolbar>
-      </PageHeaderLayout>
-    );
-  }
-}

+ 0 - 6
src/routes/Merchant/MerchantDeposit.less

@@ -1,6 +0,0 @@
-@import "~antd/lib/style/themes/default.less";
-
-.balance {
-  color: red;
-  font-weight: 500;
-}

+ 0 - 194
src/routes/Merchant/MerchantList.js

@@ -1,194 +0,0 @@
-import React, { Component } from 'react';
-import moment from 'moment';
-import { connect } from 'dva';
-import { routerRedux } from 'dva/router';
-import { Card, Modal, Button, message } from 'antd';
-import { StandardTableList } from '../../components/AXList';
-import PageHeaderLayout from '../../layouts/PageHeaderLayout';
-import Authorized from '../../utils/Authorized';
-import { renderStatus, renderCategory, addRowKey } from '../../utils/utils';
-
-const Message = message;
-
-@connect(({ loading, merchant }) => ({
-  merchant,
-  loading: loading.models.merchant,
-}))
-export default class MerchantListPage extends Component {
-  constructor(props) {
-    super(props);
-    const { state } = props.location;
-    this.state = {
-      UIParams: (state || {}).UIParams, // 组件的状态参数
-      Queryers: (state || {}).Queryers, // 查询的条件参数
-    };
-  }
-  componentDidMount() {
-    this.props.dispatch({
-      type: 'merchant/fetchMerchantList',
-      payload: { ...this.state.Queryers },
-    });
-  }
-  handleCreateOperation = () => {
-    this.props.dispatch(routerRedux.push({
-      pathname: '/merchant/create',
-      state: this.state,
-    }));
-  };
-  handleDeleteOperation = (item) => {
-    Modal.confirm({
-      okText: '确定',
-      cancelText: '取消',
-      title: '你确定要删除这条商户记录吗?',
-      onOk: () => {
-        this.props.dispatch({
-          type: 'merchant/deleteMerchantItem',
-          payload: { id: item.id },
-          states: this.state,
-        });
-      },
-    });
-  };
-  handleEditOperation = (item) => {
-    this.props.dispatch(routerRedux.push({
-      pathname: `/merchant/edit/${item.id}`,
-      state: this.state,
-    }));
-  };
-  handleFilterOperation = (params, states) => {
-    this.props.dispatch({
-      type: 'merchant/fetchMerchantList',
-      payload: params,
-    });
-    this.setState({
-      UIParams: states,
-      Queryers: params,
-    });
-  };
-  handleDepositOperation = (item) => {
-    this.props.dispatch(routerRedux.push({
-      pathname: `/merchant/deposit/${item.id}`,
-      state: { ...this.state, currentItem: item },
-    }));
-  };
-  handleBatchOperation = () => {
-    Message.info('暂不支持批量操作!');
-  };
-
-  render() {
-    const { loading, merchant } = this.props;
-    const { list, totalSize, pageSize, pageNo } = merchant;
-
-    const renderOperation = (item) => {
-      return (
-        <div>
-          <Authorized authority="admin" noMatch={null}>
-            <Button
-              size="small"
-              className="editBtn"
-              onClick={() => this.handleEditOperation(item)}
-            >编辑
-            </Button>
-            <Button
-              size="small"
-              className="depositBtn"
-              onClick={() => this.handleDepositOperation(item)}
-            >充值
-            </Button>
-          </Authorized>
-          <Button
-            size="small"
-            className="delBtn"
-            onClick={() => this.handleDeleteOperation(item)}
-          >删除
-          </Button>
-        </div>
-      );
-    };
-
-    const batchActions = [{
-      key: 'delete',
-      name: '批量删除',
-    }, {
-      key: 'recovery',
-      name: '批量恢复',
-    }];
-    const basicSearch = {
-      keys: [{
-        name: '商户编号',
-        field: 'code',
-      }, {
-        name: '商户名称',
-        field: 'name',
-      }],
-    };
-    const pagination = {
-      pageNo,
-      pageSize,
-      totalSize,
-    };
-    const columns = [{
-      title: '商户编号',
-      key: 1,
-      dataIndex: 'code',
-      width: '12%',
-    }, {
-      title: '商户名称',
-      key: 2,
-      dataIndex: 'name',
-      width: '16%',
-    }, {
-      title: '商户类型',
-      key: 3,
-      dataIndex: 'domain',
-      render: text => renderCategory(text),
-      width: '11%',
-    }, {
-      title: '账户余额(¥)',
-      key: 4,
-      dataIndex: 'balance',
-      width: '12%',
-    }, {
-      title: '状态',
-      key: 5,
-      dataIndex: 'status',
-      render: text => renderStatus(text),
-      width: '11%',
-    }, {
-      title: '更新时间',
-      key: 6,
-      dataIndex: 'gmtModified',
-      render: text => moment(text).format('YYYY-MM-DD HH:mm:ss'),
-      width: '20%',
-    }, {
-      title: '操作',
-      key: 7,
-      dataIndex: 'operation',
-      render: (_, record) => renderOperation(record),
-      width: '18%',
-      align: 'right',
-    }];
-    return (
-      <PageHeaderLayout>
-        <Card>
-          <StandardTableList
-            columns={columns}
-            loading={loading}
-            dataSource={addRowKey(list)}
-            header={{
-              basicSearch,
-              onFilterClick: this.handleFilterOperation,
-              onCreateClick: this.handleCreateOperation,
-            }}
-            footer={{
-              pagination,
-              batchActions,
-              onBatchClick: this.handleBatchOperation,
-            }}
-            keepUIState={{ ...this.state.UIParams }}
-          />
-        </Card>
-      </PageHeaderLayout>
-    );
-  }
-}

+ 0 - 620
src/routes/Product/Course/CourseCreate.js

@@ -1,620 +0,0 @@
-import React, { Component } from 'react';
-import pathToRegexp from 'path-to-regexp';
-import { connect } from 'dva';
-import { routerRedux } from 'dva/router';
-import {
-  Form, Modal, Card, Button, Input, Switch, Select, Row, Col,
-} from 'antd';
-import {
-  renderStatus, statusToBool, boolToStatus, genAbsolutePicUrl,
-} from '../../../utils/utils';
-import { Hotax } from '../../../utils/config';
-import AXDragSortTable from '../../../components/AXDragSortTable';
-import Selector from '../../../components/AXTableSelector/Selector';
-import FooterToolbar from '../../../components/FooterToolbar';
-import styles from './CourseCreate.less';
-
-const fieldLabels = {
-  code: '课程编号',
-  title: '课程标题',
-  subTitle: '课程副标题',
-  name: '课程全称',
-  breadCrumb: '顶部导航名',
-  merchant: '内容提供商',
-  digest: '课程概要',
-  detail: '课程详情',
-  coverUrl: '课程封面图',
-  bgUrl: '课程背景图',
-  status: '课程状态',
-};
-const formItemLayout = {
-  labelCol: {
-    xs: { span: 24 },
-    sm: { span: 3 },
-  },
-  wrapperCol: {
-    xs: { span: 24 },
-    sm: { span: 14 },
-    md: { span: 12 },
-  },
-};
-
-@connect(({ loading, product, lesson, resource, merchant }) => ({
-  lesson,
-  product,
-  resource,
-  merchant,
-  lLoading: loading.models.lesson,
-  pLoading: loading.models.product,
-  rLoading: loading.models.resource,
-  submitting: loading.models.product,
-}))
-@Form.create()
-export default class CourseItemCreatePage extends Component {
-  state = {
-    bgSelectorDestroy: true,
-    coverSelectorDestroy: true,
-    lessonSelectorDestroy: true,
-    supportSelectorDestroy: true,
-  };
-  componentWillMount() {
-    const match = pathToRegexp('/product/course/create').exec(this.props.location.pathname);
-    if (match) {
-      this.cleanPageState();
-    }
-  }
-  componentDidMount() {
-    const matchId = this.isEdit();
-    if (matchId) {
-      this.props.dispatch({
-        type: 'product/fetchProductItem',
-        payload: { pid: matchId },
-      });
-    }
-    this.props.dispatch({
-      type: 'merchant/fetchMerchantList',
-      payload: { pageSize: 1000 }, // TODO 以后商户多了需要改写交互样式
-    });
-  }
-  isEdit = () => {
-    const { location } = this.props;
-    const match = pathToRegexp('/product/course/edit/:id').exec(location.pathname);
-    if (match) {
-      return match[1];
-    }
-    return false;
-  };
-  cleanPageState = () => {
-    this.props.dispatch({
-      type: 'product/cleanItemState',
-      payload: {},
-    });
-  };
-  selectorDataFetcher = (name, params) => {
-    switch (name) {
-      case 'cover':
-        this.props.dispatch({
-          type: 'resource/fetchImageList',
-          payload: params,
-        });
-        break;
-      case 'bg':
-        this.props.dispatch({
-          type: 'resource/fetchImageList',
-          payload: params,
-        });
-        break;
-      case 'lesson':
-        this.props.dispatch({
-          type: 'lesson/fetchLessonList',
-          payload: params,
-        });
-        break;
-      case 'support':
-        this.props.dispatch({
-          type: 'product/fetchSupportList',
-          payload: params,
-        });
-        break;
-      default:
-        break;
-    }
-  };
-  currentItemFormatter = (name, rows) => {
-    let payload;
-    switch (name) {
-      case 'cover':
-        payload = { coverUrl: rows[0].path };
-        break;
-      case 'bg':
-        payload = { bgUrl: rows[0].path };
-        break;
-      case 'lesson':
-        payload = { subItemList: rows };
-        break;
-      case 'support':
-        payload = { supportList: rows };
-        break;
-      default:
-        break;
-    }
-    return payload;
-  };
-  handleSelectorModalShow = (name) => {
-    this.setState({
-      [`${name}SelectorDestroy`]: false,
-    });
-    this.selectorDataFetcher(name);
-  };
-  handleSelectorChange = (name, params) => {
-    this.selectorDataFetcher(name, params);
-  };
-  handleSelectorFinish = (name, rows) => {
-    this.setState({
-      [`${name}SelectorDestroy`]: true,
-    });
-    const payload = this.currentItemFormatter(name, rows);
-    this.props.dispatch({
-      payload,
-      type: 'product/fixCurrentItem',
-    });
-  };
-  handleDragSortTableChange = (name, rows) => {
-    const payload = this.currentItemFormatter(name, rows);
-    this.props.dispatch({
-      payload,
-      type: 'product/fixCurrentItem',
-    });
-  };
-  handleSelectorCancel = (name) => {
-    this.setState({
-      [`${name}SelectorDestroy`]: true,
-    });
-  };
-  handlePageBack = () => {
-    this.props.dispatch(routerRedux.push({
-      pathname: '/product/course/list',
-      state: this.props.location.state,
-    }));
-  };
-  handlePageSubmit = (e) => {
-    e.preventDefault();
-    this.props.form.validateFieldsAndScroll((err, values) => {
-      if (!err) {
-        // 提取表单字段
-        const { title, subTitle, name, status, ...rest } = values;
-        const newName = `${title}_${subTitle}`;
-        const newValues = { title, subTitle, name: newName, status: boolToStatus(status), ...rest };
-
-        const { product } = this.props;
-        const { currentItem } = product;
-        const { bgUrl, coverUrl, subItemList, supportList } = currentItem;
-
-        // 构造subList,supportIdList
-        let subList;
-        let supportIdList;
-        if (subItemList) {
-          subList = subItemList.map(
-            item => ({ id: item.id, type: Hotax.PRODUCT_LESSON })
-          );
-        }
-        if (supportList) {
-          supportIdList = supportList.map(item => item.id);
-        }
-
-        const matchId = this.isEdit();
-        if (matchId) {
-          const params = {
-            bgUrl,
-            coverUrl,
-            id: matchId,
-            subItemList: subList,
-            supportList: supportIdList,
-            ...newValues,
-          };
-          this.props.dispatch({
-            type: 'product/updateCourseItem',
-            payload: params,
-            states: this.props.location.state,
-          });
-        } else {
-          const params = {
-            bgUrl,
-            coverUrl,
-            subItemList: subList,
-            supportList: supportIdList,
-            ...newValues,
-          };
-          this.props.dispatch({
-            type: 'product/createCourseItem',
-            payload: params,
-            states: this.props.location.state,
-          });
-        }
-      }
-    });
-  };
-
-  render() {
-    const {
-      form, submitting, rLoading, lLoading, pLoading, lesson, product, resource, merchant,
-    } = this.props;
-    const {
-      lessonSelectorDestroy, supportSelectorDestroy, coverSelectorDestroy, bgSelectorDestroy,
-    } = this.state;
-    const { currentItem } = product;
-    const {
-      code, title, subTitle, name, digest, detail, status, coverUrl, bgUrl, cpId,
-      breadCrumb, subItemList = [], supportList = [],
-    } = currentItem;
-    const { getFieldDecorator } = form;
-
-    const lessonColumns = [{
-      title: '课编号',
-      dataIndex: 'code',
-      key: 1,
-      width: '20%',
-      render: (text, record) => (
-        <a
-          className="a-link"
-          target="_blank"
-          rel="noopener noreferrer"
-          href={`/product/lesson/edit/${record.id}`}
-        >
-          {text}
-        </a>
-      ),
-    }, {
-      title: '课名称',
-      dataIndex: 'title',
-      key: 2,
-      width: '30%',
-      render: (text, record) => (
-        <a
-          className="a-link"
-          target="_blank"
-          rel="noopener noreferrer"
-          href={`/product/lesson/edit/${record.id}`}
-        >
-          {text}
-        </a>
-      ),
-    }, {
-      title: '状态',
-      dataIndex: 'status',
-      key: 3,
-      render: text => renderStatus(text),
-    }];
-    const supportColumns = [{
-      title: '配套编号',
-      dataIndex: 'code',
-      key: 1,
-      width: '20%',
-      render: (text, record) => (
-        <a
-          className="a-link"
-          target="_blank"
-          rel="noopener noreferrer"
-          href={`/product/support/edit/${record.id}`}
-        >
-          {text}
-        </a>
-      ),
-    }, {
-      title: '配套名称',
-      dataIndex: 'name',
-      key: 2,
-      width: '30%',
-      render: (text, record) => (
-        <a
-          className="a-link"
-          target="_blank"
-          rel="noopener noreferrer"
-          href={`/product/support/edit/${record.id}`}
-        >
-          {text}
-        </a>
-      ),
-    }, {
-      title: '配套状态',
-      dataIndex: 'status',
-      key: 3,
-      render: text => renderStatus(text),
-    }];
-
-    const getMerchants = () => {
-      const { list } = merchant;
-      return list.map(item => ({
-        text: item.name,
-        key: item.id,
-      }));
-    };
-
-    const getResourceModal = (isCover) => {
-      return (
-        <Modal
-          width={1100}
-          footer={null}
-          visible
-          title="图片资源"
-          maskClosable={false}
-          onCancel={() => this.handleSelectorCancel(isCover ? 'cover' : 'bg')}
-        >
-          <Selector
-            multiple={false}
-            loading={rLoading}
-            selectorName="PictureSingle"
-            list={resource.list}
-            pageNo={resource.pageNo}
-            pageSize={resource.pageSize}
-            totalSize={resource.totalSize}
-            onCancel={() => this.handleSelectorCancel(isCover ? 'cover' : 'bg')}
-            onChange={data => this.handleSelectorChange(isCover ? 'cover' : 'bg', data)}
-            onFinish={rows => this.handleSelectorFinish(isCover ? 'cover' : 'bg', rows)}
-          />
-        </Modal>
-      );
-    };
-    const getLessonModal = () => {
-      return (
-        <Modal
-          width={1100}
-          footer={null}
-          visible
-          title="课资源"
-          maskClosable={false}
-          onCancel={() => this.handleSelectorCancel('lesson')}
-        >
-          <Selector
-            multiple
-            loading={lLoading}
-            selectorName="Lesson"
-            selectedRows={subItemList}
-            list={lesson.list}
-            pageNo={lesson.pageNo}
-            pageSize={lesson.pageSize}
-            totalSize={lesson.totalSize}
-            onCancel={() => this.handleSelectorCancel('lesson')}
-            onChange={data => this.handleSelectorChange('lesson', data)}
-            onFinish={rows => this.handleSelectorFinish('lesson', rows)}
-          />
-        </Modal>
-      );
-    };
-    const getSupportModal = () => {
-      return (
-        <Modal
-          width={1100}
-          footer={null}
-          visible
-          title="配套资源"
-          maskClosable={false}
-          onCancel={() => this.handleSelectorCancel('support')}
-        >
-          <Selector
-            multiple
-            loading={pLoading}
-            selectorName="Support"
-            selectedRows={supportList}
-            list={product.list}
-            pageNo={product.pageNo}
-            pageSize={product.pageSize}
-            totalSize={product.totalSize}
-            onCancel={() => this.handleSelectorCancel('support')}
-            onChange={data => this.handleSelectorChange('support', data)}
-            onFinish={rows => this.handleSelectorFinish('support', rows)}
-          />
-        </Modal>
-      );
-    };
-    const renderLessonCardName = () => {
-      return (
-        <Button
-          type="primary"
-          onClick={() => this.handleSelectorModalShow('lesson')}
-        >课列表
-        </Button>
-      );
-    };
-    const renderSupportCardName = () => {
-      return (
-        <Button
-          type="primary"
-          onClick={() => this.handleSelectorModalShow('support')}
-        >配套列表
-        </Button>
-      );
-    };
-    const renderCoverCardName = () => {
-      return (
-        <div className={styles.cardName}>
-          <span>
-            <a onClick={() => this.handleSelectorModalShow('cover')}>更换封面</a>
-          </span>
-        </div>
-      );
-    };
-    const renderbgCardName = () => {
-      return (
-        <div className={styles.cardName}>
-          <span>
-            <a onClick={() => this.handleSelectorModalShow('bg')}>更换背景</a>
-          </span>
-        </div>
-      );
-    };
-    return (
-      <div>
-        {/* 基础信息Card */}
-        <Card title="基础信息" style={{ marginBottom: 16 }}>
-          <Form>
-            <Form.Item hasFeedback label={fieldLabels.code} {...formItemLayout}>
-              {getFieldDecorator('code', {
-                rules: [
-                  {
-                    required: true, message: '请填写课程编号',
-                  }, {
-                    pattern: /^[a-zA-Z0-9|-]+$/g, message: '编号包含非法字符',
-                  },
-                ],
-                initialValue: code,
-              })(
-                <Input placeholder="请输入" />
-              )}
-            </Form.Item>
-            {this.isEdit() && (
-              <Form.Item label={fieldLabels.name} {...formItemLayout}>
-                {getFieldDecorator('name', {
-                  initialValue: name,
-                })(
-                  <Input placeholder="根据标题及副标题自动生成完整名称,不必填写" disabled />
-                )}
-              </Form.Item>
-            )}
-            <Form.Item hasFeedback label={fieldLabels.title} {...formItemLayout}>
-              {getFieldDecorator('title', {
-                rules: [{ required: true, message: '请填写课程标题' }],
-                initialValue: title,
-              })(
-                <Input placeholder="请输入" />
-              )}
-            </Form.Item>
-            <Form.Item hasFeedback label={fieldLabels.subTitle} {...formItemLayout}>
-              {getFieldDecorator('subTitle', {
-                rules: [{ required: true, message: '请填写课程副标题' }],
-                initialValue: subTitle,
-              })(
-                <Input placeholder="请输入" />
-              )}
-            </Form.Item>
-            <Form.Item hasFeedback label={fieldLabels.breadCrumb} {...formItemLayout}>
-              {getFieldDecorator('breadCrumb', {
-                rules: [{ required: true, message: '请填写顶部导航名' }],
-                initialValue: breadCrumb,
-              })(
-                <Input placeholder="请输入" />
-              )}
-            </Form.Item>
-            <Form.Item hasFeedback label={fieldLabels.merchant} {...formItemLayout}>
-              {getFieldDecorator('cpId', {
-                rules: [{ required: true, message: '请选择供应商' }],
-                initialValue: cpId,
-              })(
-                <Select placeholder="请选择">
-                  {
-                    getMerchants().map(item => (
-                      <Select.Option key={item.key} value={item.key}>
-                        {item.text}
-                      </Select.Option>
-                    ))
-                  }
-                </Select>
-              )}
-            </Form.Item>
-            <Form.Item label={fieldLabels.digest} {...formItemLayout}>
-              {getFieldDecorator('digest', {
-                initialValue: digest,
-              })(
-                <Input.TextArea rows={4} placeholder="请输入" />
-              )}
-            </Form.Item>
-            <Form.Item label={fieldLabels.detail} {...formItemLayout}>
-              {getFieldDecorator('detail', {
-                initialValue: detail,
-              })(
-                <Input.TextArea rows={6} placeholder="请输入" />
-              )}
-            </Form.Item>
-            <Form.Item label={fieldLabels.status} {...formItemLayout}>
-              {getFieldDecorator('status', {
-                valuePropName: 'checked',
-                initialValue: statusToBool(status),
-              })(
-                <Switch
-                  checkedChildren="正常"
-                  unCheckedChildren="删除"
-                />
-              )}
-            </Form.Item>
-          </Form>
-        </Card>
-        {/* 封面及背景图选择Card */}
-        <Card title="封面|背景" style={{ marginBottom: 16 }}>
-          <Row gutter={16}>
-            <Col
-              md={{ span: 9, offset: 1 }}
-              lg={{ span: 7, offset: 2 }}
-              xl={{ span: 5, offset: 4 }}
-              xxl={{ span: 3, offset: 6 }}
-            >
-              <Card
-                hoverable
-                title={renderCoverCardName()}
-              >
-                {
-                  coverUrl && (
-                    <div className={styles.cover}>
-                      <img src={genAbsolutePicUrl(coverUrl)} alt="" />
-                    </div>
-                  )
-                }
-                {!coverSelectorDestroy && getResourceModal(true)}
-              </Card>
-            </Col>
-            <Col
-              md={{ span: 9, offset: 2 }}
-              lg={{ span: 7, offset: 4 }}
-              xl={{ span: 5, offset: 4 }}
-              xxl={{ span: 3, offset: 5 }}
-            >
-              <Card
-                hoverable
-                title={renderbgCardName()}
-              >
-                {
-                  bgUrl ? (
-                    <div className={styles.background}>
-                      <img src={genAbsolutePicUrl(bgUrl)} alt="" />
-                    </div>
-                  ) : null
-                }
-                {!bgSelectorDestroy && getResourceModal(false)}
-              </Card>
-            </Col>
-          </Row>
-        </Card>
-        {/* 课列表选择Card */}
-        <Card title={renderLessonCardName()} style={{ marginBottom: 16 }}>
-          <AXDragSortTable
-            columns={lessonColumns}
-            data={subItemList}
-            onChange={rows => this.handleDragSortTableChange('lesson', rows)}
-          />
-          {!lessonSelectorDestroy && getLessonModal()}
-        </Card>
-        {/* 周边配套选择Card */}
-        <Card title={renderSupportCardName()} style={{ marginBottom: 70 }}>
-          <AXDragSortTable
-            columns={supportColumns}
-            data={supportList}
-            onChange={rows => this.handleDragSortTableChange('support', rows)}
-          />
-          {!supportSelectorDestroy && getSupportModal()}
-        </Card>
-        <FooterToolbar style={{ width: '100%' }}>
-          <Button
-            onClick={this.handlePageBack}
-            style={{ marginRight: 10 }}
-          >取消
-          </Button>
-          <Button
-            type="primary"
-            loading={submitting}
-            onClick={this.handlePageSubmit}
-          >提交
-          </Button>
-        </FooterToolbar>
-      </div>
-    );
-  }
-}

+ 0 - 34
src/routes/Product/Course/CourseCreate.less

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

+ 0 - 170
src/routes/Product/Course/CourseList.js

@@ -1,170 +0,0 @@
-import React, { Component } from 'react';
-import moment from 'moment';
-import { connect } from 'dva';
-import { routerRedux } from 'dva/router';
-import { Card, Modal, Button, message } from 'antd';
-import { StandardTableList } from '../../../components/AXList';
-import Ellipsis from '../../../components/Ellipsis';
-import { renderStatus, addRowKey } from '../../../utils/utils';
-
-const Message = message;
-
-@connect(({ loading, product }) => ({
-  product,
-  loading: loading.models.product,
-}))
-export default class CourseListPage extends Component {
-  constructor(props) {
-    super(props);
-    const { state } = props.location;
-    this.state = {
-      UIParams: (state || {}).UIParams, // 组件的状态参数
-      Queryers: (state || {}).Queryers, // 查询的条件参数
-    };
-  }
-  componentDidMount() {
-    this.props.dispatch({
-      type: 'product/fetchCourseList',
-      payload: { ...this.state.Queryers },
-    });
-  }
-  handleCreateOperation = () => {
-    this.props.dispatch(routerRedux.push({
-      pathname: '/product/course/create',
-      state: this.state,
-    }));
-  }
-  handleDeleteOperation = (item) => {
-    Modal.confirm({
-      okText: '确定',
-      cancelText: '取消',
-      title: '你确定要删除该课程吗?',
-      content: '如果该课程已经被某些套餐包关联,则将导致删除失败,需要手动解除与这些套餐包的关联才可进行删除',
-      onOk: () => {
-        this.props.dispatch({
-          type: 'product/deleteCourseItem',
-          payload: { id: item.id },
-          states: this.state,
-        });
-      },
-    });
-  }
-  handleEditOperation = (item) => {
-    this.props.dispatch(routerRedux.push({
-      pathname: `/product/course/edit/${item.pid}`,
-      state: this.state,
-    }));
-  }
-  handleFilterOperation = (params, states) => {
-    this.props.dispatch({
-      type: 'product/fetchCourseList',
-      payload: params,
-    });
-    this.setState({
-      UIParams: states,
-      Queryers: params,
-    });
-  }
-  handleBatchOperation = () => {
-    Message.info('暂不支持批量操作!');
-  }
-
-  render() {
-    const { loading, product } = this.props;
-    const { list, totalSize, pageSize, pageNo } = product;
-
-    const renderOperation = (item) => {
-      return (
-        <div>
-          <Button
-            size="small"
-            className="editBtn"
-            onClick={() => this.handleEditOperation(item)}
-          >编辑
-          </Button>
-          <Button
-            size="small"
-            className="delBtn"
-            onClick={() => this.handleDeleteOperation(item)}
-          >删除
-          </Button>
-        </div>
-      );
-    };
-
-    const batchActions = [{
-      key: 'delete',
-      name: '批量删除',
-    }, {
-      key: 'recovery',
-      name: '批量恢复',
-    }];
-    const basicSearch = {
-      keys: [{
-        name: '课程编号',
-        field: 'code',
-      }, {
-        name: '课程名称',
-        field: 'name',
-      }],
-    };
-    const pagination = {
-      pageNo,
-      pageSize,
-      totalSize,
-    };
-    const columns = [{
-      title: '课程编号',
-      key: 1,
-      dataIndex: 'code',
-      width: '20%',
-    }, {
-      title: '课程名称',
-      key: 2,
-      dataIndex: 'name',
-      width: '30%',
-      render: text => (
-        <Ellipsis tooltip lines={1}>{text}</Ellipsis>
-      ),
-    }, {
-      title: '课程状态',
-      key: 3,
-      dataIndex: 'status',
-      render: text => renderStatus(text),
-      width: '15%',
-    }, {
-      title: '更新时间',
-      key: 4,
-      dataIndex: 'gmtModified',
-      render: text => moment(text).format('YYYY-MM-DD HH:mm:ss'),
-      width: '20%',
-    }, {
-      title: '操作',
-      key: 5,
-      dataIndex: 'operation',
-      render: (_, record) => renderOperation(record),
-      width: '15%',
-      align: 'right',
-    }];
-    return (
-      <Card>
-        <StandardTableList
-          columns={columns}
-          loading={loading}
-          dataSource={addRowKey(list)}
-          header={{
-            basicSearch,
-            onFilterClick: this.handleFilterOperation,
-            onCreateClick: this.handleCreateOperation,
-          }}
-          footer={{
-            pagination,
-            batchActions,
-            onBatchClick: this.handleBatchOperation,
-          }}
-          keepUIState={{ ...this.state.UIParams }}
-        />
-      </Card>
-    );
-  }
-}

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

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

+ 0 - 394
src/routes/Product/Courseware/CoursewareCreate.js

@@ -1,394 +0,0 @@
-import React, { Component } from 'react';
-import pathToRegexp from 'path-to-regexp';
-import { connect } from 'dva';
-import { routerRedux } from 'dva/router';
-import { Form, Modal, Card, Button, Input, Radio, Switch } from 'antd';
-import AXDragSortTable from '../../../components/AXDragSortTable';
-import Selector from '../../../components/AXTableSelector/Selector';
-import AXVideoPlayer from '../../../components/AXVideoPlayer';
-import FooterToolbar from '../../../components/FooterToolbar';
-import {
-  genAbsolutePicUrl,
-  renderStatus,
-  statusToBool,
-  boolToStatus,
-  getResourceTypeName,
-} from '../../../utils/utils';
-import { Hotax } from '../../../utils/config';
-import styles from './CoursewareCreate.less';
-
-const fieldLabels = {
-  code: '课件编号',
-  title: '课件名称',
-  category: '环节名称',
-  digest: '课件简述',
-  resourceList: '资源列表',
-  status: '课件状态',
-};
-const formItemLayout = {
-  labelCol: {
-    xs: { span: 24 },
-    sm: { span: 2 },
-  },
-  wrapperCol: {
-    xs: { span: 24 },
-    sm: { span: 14 },
-    md: { span: 12 },
-  },
-};
-
-@connect(({ loading, courseware, resource }) => ({
-  resource,
-  courseware,
-  loading: loading.models.resource,
-  submitting: loading.models.courseware,
-}))
-@Form.create()
-export default class CoursewareCreatePage extends Component {
-  state = {
-    modalSelectorDestroy: true,
-    resourceType: 'Picture',
-  };
-  componentWillMount() {
-    // 进入页面前清空下model中state内容,防止上次内容造成干扰
-    const match = pathToRegexp('/product/courseware/create').exec(this.props.location.pathname);
-    if (match) {
-      this.props.dispatch({
-        type: 'courseware/cleanItemState',
-        payload: {},
-      });
-    }
-  }
-  componentDidMount() {
-    // 组件挂载完成,检查是否是编辑操作,决定是否加载该课件数据
-    const matchId = this.isEdit();
-    if (matchId) {
-      this.props.dispatch({
-        type: 'courseware/fetchCoursewareItem',
-        payload: { id: matchId },
-      });
-    }
-  }
-  isEdit = () => {
-    const { location } = this.props;
-    const match = pathToRegexp('/product/courseware/edit/:id').exec(location.pathname);
-    if (match) {
-      return match[1];
-    }
-    return false;
-  };
-  selectorDataFetcher = (params) => {
-    const { resourceType } = this.state;
-    if (resourceType === 'Picture') {
-      this.props.dispatch({
-        type: 'resource/fetchImageList',
-        payload: params,
-      });
-    }
-    if (resourceType === 'Video') {
-      this.props.dispatch({
-        type: 'resource/fetchVideoList',
-        payload: params,
-      });
-    }
-    if (resourceType === 'AudioBook') {
-      this.props.dispatch({
-        type: 'resource/fetchAudioBookList',
-        payload: params,
-      });
-    }
-  };
-  handleSelectorModalShow = () => {
-    this.setState({
-      modalSelectorDestroy: false,
-    });
-    this.selectorDataFetcher();
-  };
-  handleSelectorCancel = () => {
-    this.setState({
-      modalSelectorDestroy: true,
-    });
-  };
-  handleSelectorFinish = (rows) => {
-    this.setState({
-      modalSelectorDestroy: true,
-    });
-    this.props.dispatch({
-      type: 'courseware/fixResourceList',
-      payload: rows,
-    });
-  };
-  handleSelectorChange = (params) => {
-    this.selectorDataFetcher(params);
-  };
-  handleRadioChange = (e) => {
-    this.setState({
-      resourceType: e.target.value,
-    }, () => this.selectorDataFetcher());
-    this.props.dispatch({
-      type: 'courseware/fixResourceList',
-      payload: [],
-    });
-  };
-  handleDragSortTableChange = (rows) => {
-    this.props.dispatch({
-      type: 'courseware/fixResourceList',
-      payload: rows,
-    });
-  };
-  handlePageBack = () => {
-    this.props.dispatch(routerRedux.push({
-      pathname: '/product/courseware/list',
-      state: this.props.location.state,
-    }));
-  };
-  handlePageSubmit = (e) => {
-    e.preventDefault();
-    this.props.form.validateFieldsAndScroll((err, values) => {
-      if (!err) {
-        const { status, ...rest } = values;
-        const newValues = { status: boolToStatus(status), ...rest };
-        const { courseware } = this.props;
-        const { currentItem } = courseware;
-        const { resourceList } = currentItem;
-
-        let resourceIdList;
-        if (resourceList) {
-          resourceIdList = resourceList.map(item => item.id);
-        }
-
-        const matchId = this.isEdit();
-        if (matchId) {
-          const params = {
-            id: matchId,
-            resourceList: resourceIdList,
-            ...newValues,
-          };
-          this.props.dispatch({
-            type: 'courseware/updateCoursewareItem',
-            payload: params,
-            states: this.props.location.state,
-          });
-        } else {
-          const params = {
-            resourceList: resourceIdList,
-            ...newValues,
-          };
-          this.props.dispatch({
-            type: 'courseware/createCoursewareItem',
-            payload: params,
-            states: this.props.location.state,
-          });
-        }
-      }
-    });
-  };
-
-  render() {
-    const { submitting, courseware, form, loading, resource } = this.props;
-    const { modalSelectorDestroy, resourceType } = this.state;
-    const { getFieldDecorator } = form;
-    const { currentItem } = courseware;
-    const { code, title, digest, category, status, resourceList = [] } = currentItem;
-
-    const imageColumns = [{
-      title: '缩略图',
-      dataIndex: 'path',
-      key: 1,
-      render: (text, record) => {
-        const { type, url, format } = record;
-        if (type === Hotax.RESOURCE_IMAGE) {
-          return (
-            <div className={styles.picture}>
-              <img src={genAbsolutePicUrl(text)} alt="" />
-            </div>
-          );
-        } else if (type === Hotax.RESOURCE_AUDIOBOOK) {
-          const { img } = record;
-          const { path } = img || {};
-          return (
-            <div className={styles.picture}>
-              <img src={genAbsolutePicUrl(path)} alt="" />
-            </div>
-          );
-        } else {
-          return (
-            <div className={styles.video}>
-              <AXVideoPlayer
-                width="100%"
-                height="100%"
-                url={url}
-                isM3U8={format === 'm3u8'}
-              />
-            </div>
-          );
-        }
-      },
-      width: '10%',
-      align: 'center',
-    }, {
-      title: '编号',
-      dataIndex: 'code',
-      key: 2,
-      width: '20%',
-    }, {
-      title: '名称',
-      dataIndex: 'name',
-      key: 3,
-      width: '20%',
-    }, {
-      title: '类型',
-      dataIndex: 'type',
-      key: 4,
-      width: '10%',
-      render: text => getResourceTypeName(text),
-      align: 'center',
-    }, {
-      title: '格式',
-      dataIndex: 'format',
-      key: 5,
-      align: 'center',
-    }, {
-      title: '状态',
-      dataIndex: 'status',
-      key: 6,
-      render: text => renderStatus(text),
-      align: 'center',
-    }];
-
-    const renderCardName = () => {
-      return (
-        <Button
-          type="primary"
-          onClick={this.handleSelectorModalShow}
-        >资源列表
-        </Button>
-      );
-    };
-    const renderModalTitle = () => {
-      return (
-        <Radio.Group
-          value={resourceType}
-          onChange={this.handleRadioChange}
-        >
-          <Radio.Button value="Picture">图片</Radio.Button>
-          <Radio.Button value="Video">视频</Radio.Button>
-          <Radio.Button value="AudioBook">有声读物</Radio.Button>
-        </Radio.Group>
-      );
-    };
-    // 根据选定的资源列表类型决定渲染样式
-    const renderResourceList = () => {
-      if (!resourceList.length) {
-        return (
-          <h3 style={{ color: 'red' }}>你还未选择任何资源,请点击上方资源列表进行选择</h3>
-        );
-      } else {
-        return (
-          <AXDragSortTable
-            columns={imageColumns}
-            data={resourceList}
-            onChange={this.handleDragSortTableChange}
-          />
-        );
-      }
-    };
-    return (
-      <div>
-        <Card title="基础信息" style={{ marginBottom: 16 }}>
-          <Form>
-            <Form.Item hasFeedback label={fieldLabels.code} {...formItemLayout}>
-              {getFieldDecorator('code', {
-                rules: [
-                  {
-                    required: true, message: '请填写课件编号',
-                  }, {
-                    pattern: /^[a-zA-Z0-9|-]+$/g, message: '编号包含非法字符',
-                  },
-                ],
-                initialValue: code,
-              })(
-                <Input
-                  placeholder="请输入"
-                />
-              )}
-            </Form.Item>
-            <Form.Item hasFeedback label={fieldLabels.title} {...formItemLayout}>
-              {getFieldDecorator('title', {
-                rules: [{ required: true, message: '请填写课件名称' }],
-                initialValue: title,
-              })(
-                <Input placeholder="请输入" />
-              )}
-            </Form.Item>
-            <Form.Item hasFeedback label={fieldLabels.category} {...formItemLayout}>
-              {getFieldDecorator('category', {
-                initialValue: category,
-              })(
-                <Input placeholder="请输入" />
-              )}
-            </Form.Item>
-            <Form.Item label={fieldLabels.digest} {...formItemLayout}>
-              {getFieldDecorator('digest', {
-                initialValue: digest,
-              })(
-                <Input.TextArea rows={4} placeholder="请输入" />
-              )}
-            </Form.Item>
-            <Form.Item label={fieldLabels.status} {...formItemLayout}>
-              {getFieldDecorator('status', {
-                valuePropName: 'checked',
-                initialValue: statusToBool(status),
-              })(
-                <Switch
-                  checkedChildren="正常"
-                  unCheckedChildren="删除"
-                />
-              )}
-            </Form.Item>
-          </Form>
-        </Card>
-        <Card title={renderCardName()} style={{ marginBottom: 70 }}>
-          {renderResourceList()}
-          {!modalSelectorDestroy && (
-            <Modal
-              visible
-              width={1100}
-              footer={null}
-              title={renderModalTitle()}
-              maskClosable={false}
-              onCancel={this.handleSelectorCancel}
-            >
-              <Selector
-                multiple={resourceType === 'Picture' || resourceType === 'AudioBook'}
-                loading={loading}
-                selectorName={resourceType}
-                list={resource.list}
-                pageNo={resource.pageNo}
-                pageSize={resource.pageSize}
-                totalSize={resource.totalSize}
-                selectedRows={resourceList}
-                onCancel={this.handleSelectorCancel}
-                onChange={this.handleSelectorChange}
-                onFinish={this.handleSelectorFinish}
-              />
-            </Modal>
-          )}
-        </Card>
-        <FooterToolbar style={{ width: '100%' }}>
-          <Button
-            onClick={this.handlePageBack}
-            style={{ marginRight: 10 }}
-          >取消
-          </Button>
-          <Button
-            type="primary"
-            loading={submitting}
-            onClick={this.handlePageSubmit}
-          >提交
-          </Button>
-        </FooterToolbar>
-      </div>
-    );
-  }
-}

+ 0 - 22
src/routes/Product/Courseware/CoursewareCreate.less

@@ -1,22 +0,0 @@
-@import "../../../../node_modules/antd/lib/style/themes/default.less";
-
-.picture {
-  position: relative;
-  vertical-align: middle;
-  text-align: center;
-  width: 100px;
-  height: 80px;
-  line-height: 80px;
-  img {
-    max-height: 100%;
-    max-width: 100%;
-    vertical-align: middle;
-    height: auto;
-  }
-}
-
-.video {
-  width: 100px;
-  height: 80px;
-  text-align: center;
-}

+ 0 - 173
src/routes/Product/Courseware/CoursewareList.js

@@ -1,173 +0,0 @@
-import React, { Component } from 'react';
-import moment from 'moment';
-import { connect } from 'dva';
-import { routerRedux } from 'dva/router';
-import { Card, Modal, Button, message } from 'antd';
-import Ellipsis from '../../../components/Ellipsis';
-import { StandardTableList } from '../../../components/AXList';
-import { renderStatus, addRowKey } from '../../../utils/utils';
-
-const Message = message;
-
-@connect(({ loading, courseware }) => ({
-  courseware,
-  loading: loading.models.courseware,
-}))
-export default class CoursewareListPage extends Component {
-  constructor(props) {
-    super(props);
-    const { state } = props.location;
-    this.state = {
-      UIParams: (state || {}).UIParams, // 组件的状态参数
-      Queryers: (state || {}).Queryers, // 查询的条件参数
-    };
-  }
-  componentDidMount() {
-    this.props.dispatch({
-      type: 'courseware/fetchCoursewareList',
-      payload: { ...this.state.Queryers },
-    });
-  }
-  handleCreateOperation = () => {
-    this.props.dispatch(routerRedux.push({
-      pathname: '/product/courseware/create',
-      state: this.state,
-    }));
-  };
-  handleDeleteOperation = (item) => {
-    Modal.confirm({
-      okText: '确定',
-      cancelText: '取消',
-      title: '你确定要删除该课件吗?',
-      content: '如果该课件已经被某些课关联,则将导致删除失败,需要手动解除与这些课的关联才可进行删除',
-      onOk: () => {
-        this.props.dispatch({
-          type: 'courseware/deleteCoursewareItem',
-          payload: { id: item.id },
-          states: this.state,
-        });
-      },
-    });
-  };
-  handleEditOperation = (item) => {
-    this.props.dispatch(routerRedux.push({
-      pathname: `/product/courseware/edit/${item.id}`,
-      state: this.state,
-    }));
-  };
-  handleFilterOperation = (params, states) => {
-    this.props.dispatch({
-      type: 'courseware/fetchCoursewareList',
-      payload: params,
-    });
-    this.setState({
-      UIParams: states,
-      Queryers: params,
-    });
-  };
-  handleBatchOperation = () => {
-    Message.info('暂不支持批量操作!');
-  };
-
-  render() {
-    const { loading, courseware } = this.props;
-    const { list, totalSize, pageSize, pageNo } = courseware;
-
-    const renderOperation = (item) => {
-      return (
-        <div>
-          <Button
-            size="small"
-            className="editBtn"
-            onClick={() => this.handleEditOperation(item)}
-          >编辑
-          </Button>
-          <Button
-            size="small"
-            className="delBtn"
-            onClick={() => this.handleDeleteOperation(item)}
-          >删除
-          </Button>
-        </div>
-      );
-    };
-
-    const batchActions = [{
-      key: 'delete',
-      name: '批量删除',
-    }, {
-      key: 'recovery',
-      name: '批量恢复',
-    }];
-    const basicSearch = {
-      keys: [{
-        name: '课件名称',
-        field: 'name',
-      }, {
-        name: '课件编号',
-        field: 'code',
-      }],
-    };
-    const pagination = {
-      pageNo,
-      pageSize,
-      totalSize,
-    };
-    const columns = [{
-      title: '课件编号',
-      key: 1,
-      dataIndex: 'code',
-      width: '25%',
-      render: text => (
-        <Ellipsis tooltip lines={1}>{text}</Ellipsis>
-      ),
-    }, {
-      title: '课件名称',
-      key: 2,
-      dataIndex: 'title',
-      width: '30%',
-      render: text => (
-        <Ellipsis tooltip lines={1}>{text}</Ellipsis>
-      ),
-    }, {
-      title: '课件状态',
-      key: 3,
-      dataIndex: 'status',
-      render: text => renderStatus(text),
-      width: '12%',
-    }, {
-      title: '更新时间',
-      key: 4,
-      dataIndex: 'gmtModified',
-      render: text => moment(text).format('YYYY-MM-DD HH:mm:ss'),
-      width: '20%',
-    }, {
-      title: '操作',
-      key: 5,
-      dataIndex: 'operation',
-      render: (_, record) => renderOperation(record),
-      width: '13%',
-      align: 'right',
-    }];
-    return (
-      <Card>
-        <StandardTableList
-          columns={columns}
-          loading={loading}
-          dataSource={addRowKey(list)}
-          header={{
-            basicSearch,
-            onFilterClick: this.handleFilterOperation,
-            onCreateClick: this.handleCreateOperation,
-          }}
-          footer={{
-            pagination,
-            batchActions,
-            onBatchClick: this.handleBatchOperation,
-          }}
-          keepUIState={{ ...this.state.UIParams }}
-        />
-      </Card>
-    );
-  }
-}

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

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

+ 0 - 301
src/routes/Product/Lesson/LessonCreate.js

@@ -1,301 +0,0 @@
-import React, { Component } from 'react';
-import pathToRegexp from 'path-to-regexp';
-import { connect } from 'dva';
-import { routerRedux } from 'dva/router';
-import { Form, Modal, Card, Button, Input, Switch } from 'antd';
-import AXDragSortTable from '../../../components/AXDragSortTable';
-import Selector from '../../../components/AXTableSelector/Selector';
-import FooterToolbar from '../../../components/FooterToolbar';
-import { renderStatus, statusToBool, boolToStatus } from '../../../utils/utils';
-
-const fieldLabels = {
-  code: '课编号',
-  title: '课名称',
-  digest: '课简述',
-  status: '课状态',
-};
-const formItemLayout = {
-  labelCol: {
-    xs: { span: 24 },
-    sm: { span: 2 },
-  },
-  wrapperCol: {
-    xs: { span: 24 },
-    sm: { span: 14 },
-    md: { span: 12 },
-  },
-};
-
-@connect(({ loading, lesson, courseware }) => ({
-  lesson,
-  courseware,
-  loading: loading.models.courseware,
-  submitting: loading.models.lesson,
-}))
-@Form.create()
-export default class LessonCreatePage extends Component {
-  state = {
-    modalSelectorDestroy: true,
-  };
-  componentWillMount() {
-    const match = pathToRegexp('/product/lesson/create').exec(this.props.location.pathname);
-    if (match) {
-      this.cleanPageState();
-    }
-  }
-  componentDidMount() {
-    const matchId = this.isEdit();
-    if (matchId) {
-      this.props.dispatch({
-        type: 'lesson/fetchLessonItem',
-        payload: { id: matchId },
-      });
-    }
-  }
-  isEdit = () => {
-    const { location } = this.props;
-    const match = pathToRegexp('/product/lesson/edit/:id').exec(location.pathname);
-    if (match) {
-      return match[1];
-    }
-    return false;
-  };
-  cleanPageState = () => {
-    this.props.dispatch({
-      type: 'lesson/cleanItemState',
-      payload: {},
-    });
-  };
-  selectorDataFetcher = (params) => {
-    this.props.dispatch({
-      type: 'courseware/fetchCoursewareList',
-      payload: params,
-    });
-  };
-  handleSelectorModalShow = () => {
-    this.setState({
-      modalSelectorDestroy: false,
-    });
-    this.selectorDataFetcher();
-  };
-  handleSelectorCancel = () => {
-    this.setState({
-      modalSelectorDestroy: true,
-    });
-  };
-  handleSelectorFinish = (rows) => {
-    this.setState({
-      modalSelectorDestroy: true,
-    });
-    this.props.dispatch({
-      type: 'lesson/fixCoursewareList',
-      payload: rows,
-    });
-  };
-  handleSelectorChange = (params) => {
-    this.selectorDataFetcher(params);
-  };
-  handleDragSortTableChange = (rows) => {
-    this.props.dispatch({
-      type: 'lesson/fixCoursewareList',
-      payload: rows,
-    });
-  };
-  handlePageBack = () => {
-    this.props.dispatch(routerRedux.push({
-      pathname: '/product/lesson/list',
-      state: this.props.location.state,
-    }));
-  };
-  handlePageSubmit = (e) => {
-    e.preventDefault();
-    this.props.form.validateFieldsAndScroll((err, values) => {
-      if (!err) {
-        // 从表单中提取相关字段
-        const { status, ...rest } = values;
-        const newVals = { status: boolToStatus(status), ...rest };
-        const { lesson } = this.props;
-        const { currentItem } = lesson;
-        const { wareList } = currentItem;
-
-        // 提取wareIdList
-        let wareIdList;
-        if (wareList) {
-          wareIdList = wareList.map(item => item.id);
-        }
-
-        const matchId = this.isEdit();
-        if (matchId) {
-          const params = {
-            id: matchId,
-            wareList: wareIdList,
-            ...newVals,
-          };
-          this.props.dispatch({
-            type: 'lesson/updateLessonItem',
-            payload: params,
-            states: this.props.location.state,
-          });
-        } else {
-          const params = {
-            wareList: wareIdList,
-            ...newVals,
-          };
-          this.props.dispatch({
-            type: 'lesson/createLessonItem',
-            payload: params,
-            states: this.props.location.state,
-          });
-        }
-      }
-    });
-  };
-
-  render() {
-    const { submitting, lesson, form, loading, courseware } = this.props;
-    const { list, pageSize, pageNo, totalSize } = courseware;
-    const { modalSelectorDestroy } = this.state;
-    const { getFieldDecorator } = form;
-    const { currentItem } = lesson;
-    const { code, title, digest, status, wareList = [] } = currentItem;
-
-    const coursewareColumns = [{
-      title: '编号',
-      dataIndex: 'code',
-      key: 1,
-      width: '20%',
-      render: (text, record) => (
-        <a
-          className="a-link"
-          target="_blank"
-          rel="noopener noreferrer"
-          href={`/product/courseware/edit/${record.id}`}
-        >
-          {text}
-        </a>
-      ),
-    }, {
-      title: '名称',
-      dataIndex: 'title',
-      key: 2,
-      width: '30%',
-      render: (text, record) => (
-        <a
-          className="a-link"
-          target="_blank"
-          rel="noopener noreferrer"
-          href={`/product/courseware/edit/${record.id}`}
-        >
-          {text}
-        </a>
-      ),
-    }, {
-      title: '状态',
-      dataIndex: 'status',
-      key: 3,
-      render: text => renderStatus(text),
-    }];
-
-    const renderCardName = () => {
-      return (
-        <Button
-          type="primary"
-          onClick={this.handleSelectorModalShow}
-        >课件列表
-        </Button>
-      );
-    };
-    return (
-      <div>
-        <Card title="基础信息" style={{ marginBottom: 16 }}>
-          <Form>
-            <Form.Item hasFeedback label={fieldLabels.code} {...formItemLayout}>
-              {getFieldDecorator('code', {
-                rules: [
-                  {
-                    required: true, message: '请填写课编号',
-                  }, {
-                    pattern: /^[a-zA-Z0-9|-]+$/g, message: '编号包含非法字符',
-                  },
-                ],
-                initialValue: code,
-              })(
-                <Input placeholder="请输入" />
-              )}
-            </Form.Item>
-            <Form.Item hasFeedback label={fieldLabels.title} {...formItemLayout}>
-              {getFieldDecorator('title', {
-                rules: [{ required: true, message: '请填写课名称' }],
-                initialValue: title,
-              })(
-                <Input placeholder="请输入" />
-              )}
-            </Form.Item>
-            <Form.Item label={fieldLabels.digest} {...formItemLayout}>
-              {getFieldDecorator('digest', {
-                initialValue: digest,
-              })(
-                <Input.TextArea rows={4} placeholder="请输入" />
-              )}
-            </Form.Item>
-            <Form.Item label={fieldLabels.status} {...formItemLayout}>
-              {getFieldDecorator('status', {
-                valuePropName: 'checked',
-                initialValue: statusToBool(status),
-              })(
-                <Switch
-                  checkedChildren="正常"
-                  unCheckedChildren="删除"
-                />
-              )}
-            </Form.Item>
-          </Form>
-        </Card>
-        <Card title={renderCardName()} style={{ marginBottom: 70 }}>
-          <AXDragSortTable
-            columns={coursewareColumns}
-            data={wareList}
-            onChange={this.handleDragSortTableChange}
-          />
-          {!modalSelectorDestroy && (
-            <Modal
-              visible
-              width={1100}
-              footer={null}
-              title="课件资源"
-              maskClosable={false}
-              onCancel={this.handleSelectorCancel}
-            >
-              <Selector
-                multiple
-                list={list}
-                loading={loading}
-                pageNo={pageNo}
-                pageSize={pageSize}
-                totalSize={totalSize}
-                selectorName="Courseware"
-                selectedRows={wareList}
-                onChange={this.handleSelectorChange}
-                onCancel={this.handleSelectorCancel}
-                onFinish={this.handleSelectorFinish}
-              />
-            </Modal>
-          )}
-        </Card>
-        <FooterToolbar style={{ width: '100%' }}>
-          <Button
-            onClick={this.handlePageBack}
-            style={{ marginRight: 10 }}
-          >取消
-          </Button>
-          <Button
-            type="primary"
-            loading={submitting}
-            onClick={this.handlePageSubmit}
-          >提交
-          </Button>
-        </FooterToolbar>
-      </div>
-    );
-  }
-}

+ 0 - 173
src/routes/Product/Lesson/LessonList.js

@@ -1,173 +0,0 @@
-import React, { Component } from 'react';
-import moment from 'moment';
-import { connect } from 'dva';
-import { routerRedux } from 'dva/router';
-import { Card, Modal, Button, message } from 'antd';
-import Ellipsis from '../../../components/Ellipsis';
-import { StandardTableList } from '../../../components/AXList';
-import { renderStatus, addRowKey } from '../../../utils/utils';
-
-const Message = message;
-
-@connect(({ loading, lesson }) => ({
-  lesson,
-  loading: loading.models.lesson,
-}))
-export default class LessonListPage extends Component {
-  constructor(props) {
-    super(props);
-    const { state } = props.location;
-    this.state = {
-      UIParams: (state || {}).UIParams, // 组件的状态参数
-      Queryers: (state || {}).Queryers, // 查询的条件参数
-    };
-  }
-  componentDidMount() {
-    this.props.dispatch({
-      type: 'lesson/fetchLessonList',
-      payload: { ...this.state.Queryers },
-    });
-  }
-  handleCreateOperation = () => {
-    this.props.dispatch(routerRedux.push({
-      pathname: '/product/lesson/create',
-      state: this.state,
-    }));
-  };
-  handleDeleteOperation = (item) => {
-    Modal.confirm({
-      okText: '确定',
-      cancelText: '取消',
-      title: '你确定要删除该课吗?',
-      content: '如果该课已经被某些课程关联,则将导致删除失败,需要手动解除与这些课程的关联才可进行删除',
-      onOk: () => {
-        this.props.dispatch({
-          type: 'lesson/deleteLessonItem',
-          payload: { id: item.id },
-          states: this.state,
-        });
-      },
-    });
-  };
-  handleEditOperation = (item) => {
-    this.props.dispatch(routerRedux.push({
-      pathname: `/product/lesson/edit/${item.id}`,
-      state: this.state,
-    }));
-  };
-  handleFilterOperation = (params, states) => {
-    this.props.dispatch({
-      type: 'lesson/fetchLessonList',
-      payload: params,
-    });
-    this.setState({
-      UIParams: states,
-      Queryers: params,
-    });
-  };
-  handleBatchOperation = () => {
-    Message.info('暂不支持批量操作!');
-  };
-
-  render() {
-    const { loading, lesson } = this.props;
-    const { list, totalSize, pageSize, pageNo } = lesson;
-
-    const renderOperation = (item) => {
-      return (
-        <div>
-          <Button
-            size="small"
-            className="editBtn"
-            onClick={() => this.handleEditOperation(item)}
-          >编辑
-          </Button>
-          <Button
-            size="small"
-            className="delBtn"
-            onClick={() => this.handleDeleteOperation(item)}
-          >删除
-          </Button>
-        </div>
-      );
-    };
-
-    const batchActions = [{
-      key: 'delete',
-      name: '批量删除',
-    }, {
-      key: 'recovery',
-      name: '批量恢复',
-    }];
-    const basicSearch = {
-      keys: [{
-        name: '课名称',
-        field: 'name',
-      }, {
-        name: '课编号',
-        field: 'code',
-      }],
-    };
-    const pagination = {
-      pageNo,
-      pageSize,
-      totalSize,
-    };
-    const columns = [{
-      title: '课编号',
-      key: 1,
-      dataIndex: 'code',
-      width: '25%',
-      render: text => (
-        <Ellipsis tooltip lines={1}>{text}</Ellipsis>
-      ),
-    }, {
-      title: '课名称',
-      key: 2,
-      dataIndex: 'title',
-      width: '30%',
-      render: text => (
-        <Ellipsis tooltip lines={1}>{text}</Ellipsis>
-      ),
-    }, {
-      title: '课状态',
-      key: 3,
-      dataIndex: 'status',
-      render: text => renderStatus(text),
-      width: '12%',
-    }, {
-      title: '更新时间',
-      key: 4,
-      dataIndex: 'gmtModified',
-      render: text => moment(text).format('YYYY-MM-DD HH:mm:ss'),
-      width: '20%',
-    }, {
-      title: '操作',
-      key: 5,
-      dataIndex: 'operation',
-      render: (_, record) => renderOperation(record),
-      width: '13%',
-      align: 'right',
-    }];
-    return (
-      <Card>
-        <StandardTableList
-          columns={columns}
-          loading={loading}
-          dataSource={addRowKey(list)}
-          header={{
-            basicSearch,
-            onFilterClick: this.handleFilterOperation,
-            onCreateClick: this.handleCreateOperation,
-          }}
-          footer={{
-            pagination,
-            batchActions,
-            onBatchClick: this.handleBatchOperation,
-          }}
-          keepUIState={{ ...this.state.UIParams }}
-        />
-      </Card>
-    );
-  }
-}

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

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

+ 0 - 410
src/routes/Product/Package/PackageCreate.js

@@ -1,410 +0,0 @@
-/* eslint-disable guard-for-in */
-import React, { Component } from 'react';
-import pathToRegexp from 'path-to-regexp';
-import { connect } from 'dva';
-import { routerRedux } from 'dva/router';
-import { message, Form, Modal, Card, Button, Input, InputNumber, Table, Switch, Radio } from 'antd';
-import { renderProductType, statusToBool, boolToStatus, addRowKey } from '../../../utils/utils';
-import Selector from '../../../components/AXTableSelector/Selector';
-import FooterToolbar from '../../../components/FooterToolbar';
-import styles from './PackageCreate.less';
-
-const Message = message;
-
-const fieldLabels = {
-  code: '套餐包编号',
-  name: '套餐包名称',
-  status: '套餐包状态',
-};
-const formItemLayout = {
-  labelCol: {
-    xs: { span: 24 },
-    sm: { span: 3 },
-  },
-  wrapperCol: {
-    xs: { span: 24 },
-    sm: { span: 14 },
-    md: { span: 12 },
-  },
-};
-
-@connect(({ loading, product }) => ({
-  product,
-  pLoading: loading.models.product,
-}))
-@Form.create()
-export default class PackageCreatePage extends Component {
-  state = {
-    productType: 'Course',
-    selectorModalDestroy: true,
-  };
-  componentWillMount() {
-    const match = pathToRegexp('/product/package/create').exec(this.props.location.pathname);
-    if (match) {
-      this.cleanPageState();
-    }
-  }
-  componentDidMount() {
-    const matchId = this.isEdit();
-    if (matchId) {
-      this.props.dispatch({
-        type: 'product/fetchProductItem',
-        payload: { pid: matchId },
-      });
-    }
-  }
-  isEdit = () => {
-    const { location } = this.props;
-    const match = pathToRegexp('/product/package/edit/:id').exec(location.pathname);
-    if (match) {
-      return match[1];
-    }
-    return false;
-  };
-  cleanPageState = () => {
-    this.props.dispatch({
-      type: 'product/cleanItemState',
-      payload: {},
-    });
-  };
-  selectorDataFetcher = (name, params) => {
-    switch (name) {
-      case 'Course':
-        this.props.dispatch({
-          type: 'product/fetchCourseList',
-          payload: params,
-        });
-        break;
-      case 'Support':
-        this.props.dispatch({
-          type: 'product/fetchSupportList',
-          payload: params,
-        });
-        break;
-      default:
-        break;
-    }
-  };
-  handleRadioChange = (e) => {
-    this.setState({
-      productType: e.target.value,
-    });
-    this.selectorDataFetcher(e.target.value);
-  };
-  handleSelectorModalShow = () => {
-    this.setState({
-      selectorModalDestroy: false,
-    });
-    this.selectorDataFetcher(this.state.productType);
-  };
-  handleSelectorChange = (params) => {
-    this.selectorDataFetcher(
-      this.state.productType,
-      params
-    );
-  };
-  handleSelectorFinish = (rows) => {
-    this.setState({
-      selectorModalDestroy: true,
-    });
-    this.props.dispatch({
-      type: 'product/fixCurrentItem',
-      payload: {
-        products: rows,
-      },
-    });
-  };
-  handleSelectorCancel = () => {
-    this.setState({
-      selectorModalDestroy: true,
-    });
-  };
-  handleDragSortTableChange = (rows) => {
-    this.props.dispatch({
-      type: 'product/fixCurrentItem',
-      payload: {
-        products: rows,
-      },
-    });
-  };
-  handlePriceInputChange = (field, key, value) => {
-    const { product } = this.props;
-    const { currentItem } = product;
-    const { products = [] } = currentItem;
-    let newData = [...products];
-    newData = newData.map((item) => {
-      if (item.id === key) {
-        return {
-          ...item,
-          [`${field}Price`]: value,
-        };
-      } else {
-        return { ...item };
-      }
-    });
-    this.props.dispatch({
-      type: 'product/fixCurrentItem',
-      payload: {
-        products: newData,
-      },
-    });
-  };
-  handlePageBack = () => {
-    this.props.dispatch(routerRedux.push({
-      pathname: '/product/package',
-      state: this.props.location.state,
-    }));
-  };
-  handlePageSubmit = (e) => {
-    e.preventDefault();
-    this.props.form.validateFieldsAndScroll((err, values) => {
-      if (!err) {
-        // 表单字段处理
-        const { status, ...rest } = values;
-        const newVals = { status: boolToStatus(status), ...rest };
-
-        // products字段处理
-        const { product } = this.props;
-        const { currentItem } = product;
-        const { products } = currentItem;
-        const productList = [];
-        let submittable = true;
-        if (products) {
-          for (const index in products) {
-            const productItem = products[index];
-            if (!productItem.cpPrice || !productItem.merchantPrice) {
-              Message.error('还有价格未填写!');
-              submittable = false;
-              break;
-            }
-            productList.push({
-              pid: productItem.pid,
-              type: productItem.type,
-              cpPrice: productItem.cpPrice,
-              merchantPrice: productItem.merchantPrice,
-            });
-          }
-        }
-
-        // 参数未正确填写不可提交
-        if (!submittable) {
-          return;
-        }
-
-        const matchId = this.isEdit();
-        if (matchId) {
-          const params = {
-            id: matchId,
-            products: productList,
-            ...newVals,
-          };
-          this.props.dispatch({
-            type: 'product/updatePackageItem',
-            payload: params,
-            states: this.props.location.state,
-          });
-        } else {
-          const params = {
-            products: productList,
-            ...newVals,
-          };
-          this.props.dispatch({
-            type: 'product/createPackageItem',
-            payload: params,
-            states: this.props.location.state,
-          });
-        }
-      }
-    });
-  };
-
-  render() {
-    const { form, pLoading, product } = this.props;
-    const { selectorModalDestroy, productType } = this.state;
-    const { currentItem } = product;
-    const { code, name, status, products = [] } = currentItem;
-    const { getFieldDecorator } = form;
-
-    const productColumns = [{
-      title: '序号',
-      dataIndex: 'index',
-      key: 0,
-      align: 'center',
-      render: (text, record, index) => index + 1,
-      width: 50,
-    }, {
-      title: '产品编号',
-      dataIndex: 'code',
-      key: 1,
-      width: '22%',
-      render: (text, record) => (
-        <a
-          className="a-link"
-          target="_blank"
-          rel="noopener noreferrer"
-          href={`/product/${record.type.toLowerCase()}/edit/${record.id}`}
-        >
-          {text}
-        </a>
-      ),
-    }, {
-      title: '产品名称',
-      dataIndex: 'name',
-      key: 2,
-      render: (text, record) => (
-        <a
-          className="a-link"
-          target="_blank"
-          rel="noopener noreferrer"
-          href={`/product/${record.type.toLowerCase()}/edit/${record.id}`}
-        >
-          {text}
-        </a>
-      ),
-    }, {
-      title: '产品类型',
-      dataIndex: 'type',
-      key: 3,
-      align: 'center',
-      render: text => renderProductType(text),
-      width: '10%',
-    }, {
-      title: '供应商价格(¥)',
-      dataIndex: 'cpPrice',
-      key: 4,
-      render: (text, record) => (
-        <InputNumber
-          min={0}
-          value={text}
-          style={{ width: '100%' }}
-          onChange={value => this.handlePriceInputChange('cp', record.key, value)}
-        />
-      ),
-      width: '15%',
-    }, {
-      title: '平台方价格(¥)',
-      dataIndex: 'merchantPrice',
-      key: 5,
-      render: (text, record) => (
-        <InputNumber
-          min={0}
-          value={text}
-          style={{ width: '100%' }}
-          onChange={value => this.handlePriceInputChange('merchant', record.key, value)}
-        />
-      ),
-      width: '15%',
-    }];
-
-    const renderCardName = () => {
-      return (
-        <Button type="primary" onClick={this.handleSelectorModalShow}>课程配套</Button>
-      );
-    };
-    const renderModalTitle = () => {
-      return (
-        <Radio.Group
-          value={productType}
-          onChange={this.handleRadioChange}
-          className={styles.radio}
-        >
-          <Radio.Button value="Course">课程</Radio.Button>
-          <Radio.Button value="Support">配套</Radio.Button>
-        </Radio.Group>
-      );
-    };
-
-    const getProductModal = () => {
-      return (
-        <Modal
-          visible
-          width={1100}
-          footer={null}
-          title={renderModalTitle()}
-          maskClosable={false}
-          onCancel={this.handleSelectorCancel}
-        >
-          <Selector
-            multiple
-            loading={pLoading}
-            selectorName={productType}
-            selectedRows={products}
-            fixedName="Product"
-            list={product.list}
-            pageNo={product.pageNo}
-            pageSize={product.pageSize}
-            totalSize={product.totalSize}
-            onCancel={this.handleSelectorCancel}
-            onChange={this.handleSelectorChange}
-            onFinish={this.handleSelectorFinish}
-          />
-        </Modal>
-      );
-    };
-    return (
-      <div>
-        {/* 基础信息Card */}
-        <Card title="基础信息" style={{ marginBottom: 16 }}>
-          <Form>
-            <Form.Item hasFeedback label={fieldLabels.code} {...formItemLayout}>
-              {getFieldDecorator('code', {
-                rules: [
-                  {
-                    required: true, message: '请填写套餐包编号',
-                  }, {
-                    pattern: /^[a-zA-Z0-9|-]+$/g, message: '编号包含非法字符',
-                  },
-                ],
-                initialValue: code,
-              })(
-                <Input placeholder="请输入" />
-              )}
-            </Form.Item>
-            <Form.Item hasFeedback label={fieldLabels.name} {...formItemLayout}>
-              {getFieldDecorator('name', {
-                rules: [{ required: true, message: '请填写套餐包名称' }],
-                initialValue: name,
-              })(
-                <Input placeholder="请输入" />
-              )}
-            </Form.Item>
-            <Form.Item label={fieldLabels.status} {...formItemLayout}>
-              {getFieldDecorator('status', {
-                valuePropName: 'checked',
-                initialValue: statusToBool(status),
-              })(
-                <Switch
-                  checkedChildren="正常"
-                  unCheckedChildren="删除"
-                />
-              )}
-            </Form.Item>
-          </Form>
-        </Card>
-        {/* 已选产品列表Card 支持排序 */}
-        <Card title={renderCardName()} style={{ marginBottom: 70 }}>
-          <Table
-            bordered
-            pagination={false}
-            className={styles.table}
-            dataSource={addRowKey(products)}
-            columns={productColumns}
-          />
-          {!selectorModalDestroy && getProductModal()}
-        </Card>
-        <FooterToolbar style={{ width: '100%' }}>
-          <Button
-            onClick={this.handlePageBack}
-            style={{ marginRight: 10 }}
-          >取消
-          </Button>
-          <Button
-            type="primary"
-            onClick={this.handlePageSubmit}
-          >提交
-          </Button>
-        </FooterToolbar>
-      </div>
-    );
-  }
-}

+ 0 - 42
src/routes/Product/Package/PackageCreate.less

@@ -1,42 +0,0 @@
-@import "../../../../node_modules/antd/lib/style/themes/default.less";
-
-.cardName {
-  & > span {
-    display: inline-block;
-    height: 24px;
-    padding: 0 7px;
-    vertical-align: bottom;
-  }
-  :global {
-    .ant-btn-primary {
-      margin-left: 10px;
-    }
-  }
-}
-
-.radio {
-  :global {
-    .ant-radio-button-wrapper-checked {
-      background-color: @primary-color;
-      color: #fff;
-    }
-  }
-}
-
-.table {
-  :global {
-    .ant-table-wrapper {
-      height: 300px;
-    }
-    .ant-table-tbody > tr > td {
-      padding: 5px;
-    }
-    .ant-table-thead > tr > th {
-      padding: 10px 5px;
-    }
-    .ant-table-footer {
-      height: 46px;
-      padding: 5px;
-    }
-  }
-}

+ 0 - 165
src/routes/Product/Package/PackageList.js

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

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

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

+ 0 - 512
src/routes/Product/Support/SupportCreate.js

@@ -1,512 +0,0 @@
-import React, { Component } from 'react';
-import pathToRegexp from 'path-to-regexp';
-import { connect } from 'dva';
-import { routerRedux } from 'dva/router';
-import { Form, Modal, Card, Button, Input, Switch, Row, Col, Carousel, Select } from 'antd';
-import { renderStatus, statusToBool, boolToStatus, genAbsolutePicUrl } from '../../../utils/utils';
-import AXDragSortTable from '../../../components/AXDragSortTable';
-import Selector from '../../../components/AXTableSelector/Selector';
-import FooterToolbar from '../../../components/FooterToolbar';
-import styles from './SupportCreate.less';
-
-const fieldLabels = {
-  code: '配套编号',
-  title: '配套标题',
-  subTitle: '配套副标题',
-  name: '配套全称',
-  merchant: '内容提供商',
-  digest: '配套概要',
-  detail: '配套详情',
-  coverUrl: '配套封面图',
-  imgList: '配套滚动图册',
-  status: '配套状态',
-};
-const formItemLayout = {
-  labelCol: {
-    xs: { span: 24 },
-    sm: { span: 3 },
-  },
-  wrapperCol: {
-    xs: { span: 24 },
-    sm: { span: 14 },
-    md: { span: 12 },
-  },
-};
-
-@connect(({ loading, product, resource, merchant }) => ({
-  product,
-  resource,
-  merchant,
-  pLoading: loading.models.product,
-  rLoading: loading.models.resource,
-  submitting: loading.models.product,
-}))
-@Form.create()
-export default class SupportCreatePage extends Component {
-  state = {
-    coverSelectorDestroy: true,
-    carouselSelectorDestroy: true,
-    supportSelectorDestroy: true,
-  };
-  componentWillMount() {
-    const match = pathToRegexp('/product/support/create').exec(this.props.location.pathname);
-    if (match) {
-      this.cleanPageState();
-    }
-  }
-  componentDidMount() {
-    const matchId = this.isEdit();
-    if (matchId) {
-      this.props.dispatch({
-        type: 'product/fetchProductItem',
-        payload: { pid: matchId },
-      });
-    }
-    this.props.dispatch({
-      type: 'merchant/fetchMerchantList',
-      payload: { pageSize: 1000 }, // TODO 以后商户多了需要改写交互样式
-    });
-  }
-  isEdit = () => {
-    const { location } = this.props;
-    const match = pathToRegexp('/product/support/edit/:id').exec(location.pathname);
-    if (match) {
-      return match[1];
-    }
-    return false;
-  };
-  cleanPageState = () => {
-    this.props.dispatch({
-      type: 'product/cleanItemState',
-      payload: {},
-    });
-  };
-  selectorDataFetcher = (name, params) => {
-    switch (name) {
-      case 'cover':
-        this.props.dispatch({
-          type: 'resource/fetchImageList',
-          payload: params,
-        });
-        break;
-      case 'carousel':
-        this.props.dispatch({
-          type: 'resource/fetchImageList',
-          payload: params,
-        });
-        break;
-      case 'support':
-        this.props.dispatch({
-          type: 'product/fetchSupportList',
-          payload: params,
-        });
-        break;
-      default:
-        break;
-    }
-  };
-  currentItemFormatter = (name, rows) => {
-    let payload;
-    switch (name) {
-      case 'cover':
-        payload = { coverUrl: rows[0].path };
-        break;
-      case 'carousel':
-        payload = { imgList: rows.map(row => row.path) };
-        break;
-      case 'support':
-        payload = { supportList: rows };
-        break;
-      default:
-        break;
-    }
-    return payload;
-  };
-  handleSelectorModalShow = (name) => {
-    this.setState({
-      [`${name}SelectorDestroy`]: false,
-    });
-    this.selectorDataFetcher(name);
-  };
-  handleSelectorChange = (name, params) => {
-    this.selectorDataFetcher(name, params);
-  };
-  handleSelectorFinish = (name, rows) => {
-    this.setState({
-      [`${name}SelectorDestroy`]: true,
-    });
-    const payload = this.currentItemFormatter(name, rows);
-    this.props.dispatch({
-      payload,
-      type: 'product/fixCurrentItem',
-    });
-  };
-  handleDragSortTableChange = (name, rows) => {
-    const payload = this.currentItemFormatter(name, rows);
-    this.props.dispatch({
-      payload,
-      type: 'product/fixCurrentItem',
-    });
-  };
-  handleSelectorCancel = (name) => {
-    this.setState({
-      [`${name}SelectorDestroy`]: true,
-    });
-  };
-  handlePageBack = () => {
-    this.props.dispatch(routerRedux.push({
-      pathname: '/product/support/list',
-      state: this.props.location.state,
-    }));
-  };
-  handlePageSubmit = (e) => {
-    e.preventDefault();
-    this.props.form.validateFieldsAndScroll((err, values) => {
-      if (!err) {
-        // 从表单提取基础信息字段
-        const { status, title, subTitle, name, ...rest } = values;
-        const newName = `${title}_${subTitle}`;
-        const newVals = { newName, title, subTitle, status: boolToStatus(status), ...rest };
-
-        // 从props中提取coverUrl、imgList、supportList字段
-        const { product } = this.props;
-        const { currentItem } = product;
-        const { imgList, supportList, coverUrl } = currentItem;
-
-        // 防止supportList为空
-        let supportIdList;
-        if (supportList && supportList.length) {
-          supportIdList = supportList.map(item => item.id);
-        }
-
-        // 更新或者创建操作
-        const matchId = this.isEdit();
-        if (matchId) {
-          const params = {
-            imgList,
-            coverUrl,
-            supportList: supportIdList,
-            id: matchId,
-            ...newVals,
-          };
-          this.props.dispatch({
-            type: 'product/updateSupportItem',
-            payload: params,
-            states: this.props.location.state,
-          });
-        } else {
-          const params = {
-            imgList,
-            coverUrl,
-            supportList: supportIdList,
-            ...newVals,
-          };
-          this.props.dispatch({
-            type: 'product/createSupportItem',
-            payload: params,
-            states: this.props.location.state,
-          });
-        }
-      }
-    });
-  };
-
-  render() {
-    const {
-      form, submitting, rLoading, pLoading, product, resource, merchant,
-    } = this.props;
-    const {
-      supportSelectorDestroy, coverSelectorDestroy, carouselSelectorDestroy,
-    } = this.state;
-    const {
-      currentItem,
-    } = product;
-    const {
-      code, title, subTitle, name, digest, detail, status, coverUrl, cpId,
-      imgList = [], supportList = [],
-    } = currentItem;
-    const {
-      getFieldDecorator,
-    } = form;
-
-    const supportColumns = [{
-      title: '配套编号',
-      dataIndex: 'code',
-      key: 1,
-      width: '20%',
-      render: (text, record) => (
-        <a
-          className="a-link"
-          target="_blank"
-          rel="noopener noreferrer"
-          href={`/product/support/edit/${record.id}`}
-        >
-          {text}
-        </a>
-      ),
-    }, {
-      title: '配套名称',
-      dataIndex: 'name',
-      key: 2,
-      width: '30%',
-      render: (text, record) => (
-        <a
-          className="a-link"
-          target="_blank"
-          rel="noopener noreferrer"
-          href={`/product/support/edit/${record.id}`}
-        >
-          {text}
-        </a>
-      ),
-    }, {
-      title: '配套状态',
-      dataIndex: 'status',
-      key: 3,
-      render: text => renderStatus(text),
-    }];
-
-    const getMerchants = () => {
-      const { list } = merchant;
-      return list.map(item => ({
-        text: item.name,
-        key: item.id,
-      }));
-    };
-
-    const getResourceModal = (isCover) => {
-      return (
-        <Modal
-          width={isCover ? 900 : 1100}
-          footer={null}
-          visible
-          title="图片资源"
-          maskClosable={false}
-          onCancel={() => this.handleSelectorCancel(isCover ? 'cover' : 'carousel')}
-        >
-          <Selector
-            loading={rLoading}
-            list={resource.list}
-            pageNo={resource.pageNo}
-            pageSize={resource.pageSize}
-            totalSize={resource.totalSize}
-            multiple={!isCover}
-            selectorName={isCover ? 'PictureSingle' : 'Index'}
-            onCancel={() => this.handleSelectorCancel(isCover ? 'cover' : 'carousel')}
-            onChange={data => this.handleSelectorChange(isCover ? 'cover' : 'carousel', data)}
-            onFinish={rows => this.handleSelectorFinish(isCover ? 'cover' : 'carousel', rows)}
-          />
-        </Modal>
-      );
-    };
-    const getSupportModal = () => {
-      return (
-        <Modal
-          width={1100}
-          footer={null}
-          visible
-          title="配套资源"
-          maskClosable={false}
-          onCancel={() => this.handleSelectorCancel('support')}
-        >
-          <Selector
-            multiple
-            loading={pLoading}
-            selectorName="Support"
-            list={product.list}
-            pageNo={product.pageNo}
-            pageSize={product.pageSize}
-            totalSize={product.totalSize}
-            onCancel={() => this.handleSelectorCancel('support')}
-            onChange={data => this.handleSelectorChange('support', data)}
-            onFinish={rows => this.handleSelectorFinish('support', rows)}
-          />
-        </Modal>
-      );
-    };
-
-    const renderSupportCardName = () => {
-      return (
-        <Button
-          type="primary"
-          onClick={() => this.handleSelectorModalShow('support')}
-        >相关配套
-        </Button>
-      );
-    };
-    const renderCoverCardName = () => {
-      return (
-        <div className={styles.cardName}>
-          <span>
-            <a onClick={() => this.handleSelectorModalShow('cover')}>配套封面</a>
-          </span>
-        </div>
-      );
-    };
-    const renderCarouselCardName = () => {
-      return (
-        <div className={styles.cardName}>
-          <span>
-            <a onClick={() => this.handleSelectorModalShow('carousel')}>详情图册</a>
-          </span>
-        </div>
-      );
-    };
-    return (
-      <div>
-        {/* 基础信息Card */}
-        <Card title="基础信息" style={{ marginBottom: 16 }}>
-          <Form>
-            <Form.Item hasFeedback label={fieldLabels.code} {...formItemLayout}>
-              {getFieldDecorator('code', {
-                rules: [
-                  {
-                    required: true, message: '请填写配套编号',
-                  }, {
-                    pattern: /^[a-zA-Z0-9|-]+$/g, message: '编号包含非法字符',
-                  },
-                ],
-                initialValue: code,
-              })(
-                <Input placeholder="请输入" />
-              )}
-            </Form.Item>
-            {this.isEdit() && (
-              <Form.Item label={fieldLabels.name} {...formItemLayout}>
-                {getFieldDecorator('name', {
-                  initialValue: name,
-                })(
-                  <Input disabled />
-                )}
-              </Form.Item>
-            )}
-            <Form.Item hasFeedback label={fieldLabels.title} {...formItemLayout}>
-              {getFieldDecorator('title', {
-                rules: [{ required: true, message: '请填写配套标题' }],
-                initialValue: title,
-              })(
-                <Input placeholder="请输入" />
-              )}
-            </Form.Item>
-            <Form.Item hasFeedback label={fieldLabels.subTitle} {...formItemLayout}>
-              {getFieldDecorator('subTitle', {
-                rules: [{ required: true, message: '请填写配套副标题' }],
-                initialValue: subTitle,
-              })(
-                <Input placeholder="请输入" />
-              )}
-            </Form.Item>
-            <Form.Item hasFeedback label={fieldLabels.merchant} {...formItemLayout}>
-              {getFieldDecorator('cpId', {
-                rules: [{ required: true, message: '请选择供应商' }],
-                initialValue: cpId,
-              })(
-                <Select placeholder="请选择">
-                  {
-                    getMerchants().map(item => (
-                      <Select.Option key={item.key} value={item.key}>
-                        {item.text}
-                      </Select.Option>
-                    ))
-                  }
-                </Select>
-              )}
-            </Form.Item>
-            <Form.Item label={fieldLabels.digest} {...formItemLayout}>
-              {getFieldDecorator('digest', {
-                initialValue: digest,
-              })(
-                <Input.TextArea rows={4} placeholder="请输入" />
-              )}
-            </Form.Item>
-            <Form.Item label={fieldLabels.detail} {...formItemLayout}>
-              {getFieldDecorator('detail', {
-                initialValue: detail,
-              })(
-                <Input.TextArea rows={6} placeholder="请输入" />
-              )}
-            </Form.Item>
-            <Form.Item label={fieldLabels.status} {...formItemLayout}>
-              {getFieldDecorator('status', {
-                valuePropName: 'checked',
-                initialValue: statusToBool(status),
-              })(
-                <Switch
-                  checkedChildren="正常"
-                  unCheckedChildren="删除"
-                />
-              )}
-            </Form.Item>
-          </Form>
-        </Card>
-        {/* 封面及走马灯选择Card */}
-        <Card title="封面|图册" style={{ marginBottom: 16 }}>
-          <Row gutter={16}>
-            <Col
-              md={{ span: 10, offset: 1 }}
-              lg={{ span: 8, offset: 2 }}
-              xl={{ span: 6, offset: 4 }}
-              xxl={{ span: 4, offset: 5 }}
-            >
-              <Card
-                hoverable
-                title={renderCoverCardName()}
-              >
-                <div className={styles.cover}>
-                  <img src={coverUrl && genAbsolutePicUrl(coverUrl)} alt="" />
-                </div>
-                {!coverSelectorDestroy && getResourceModal(true)}
-              </Card>
-            </Col>
-            <Col
-              md={{ span: 10, offset: 2 }}
-              lg={{ span: 8, offset: 4 }}
-              xl={{ span: 6, offset: 4 }}
-              xxl={{ span: 4, offset: 5 }}
-            >
-              <Card
-                hoverable
-                title={renderCarouselCardName()}
-              >
-                <div className={styles.carousel}>
-                  <Carousel autoplay>
-                    {
-                      imgList.map(
-                        path => (
-                          <img key={path} src={genAbsolutePicUrl(path)} alt="" />
-                        )
-                      )
-                    }
-                  </Carousel>
-                </div>
-                {!carouselSelectorDestroy && getResourceModal(false)}
-              </Card>
-            </Col>
-          </Row>
-        </Card>
-        {/* 相关周边配套选择Card */}
-        <Card title={renderSupportCardName()} style={{ marginBottom: 70 }}>
-          <AXDragSortTable
-            columns={supportColumns}
-            data={supportList}
-            onChange={rows => this.handleDragSortTableChange('support', rows)}
-          />
-          {!supportSelectorDestroy && getSupportModal()}
-        </Card>
-        <FooterToolbar style={{ width: '100%' }}>
-          <Button
-            onClick={this.handlePageBack}
-            style={{ marginRight: 10 }}
-          >取消
-          </Button>
-          <Button
-            type="primary"
-            loading={submitting}
-            onClick={this.handlePageSubmit}
-          >提交
-          </Button>
-        </FooterToolbar>
-      </div>
-    );
-  }
-}

+ 0 - 33
src/routes/Product/Support/SupportCreate.less

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

+ 0 - 166
src/routes/Product/Support/SupportList.js

@@ -1,166 +0,0 @@
-import React, { Component } from 'react';
-import moment from 'moment';
-import { connect } from 'dva';
-import { routerRedux } from 'dva/router';
-import { Card, Modal, Button, message } from 'antd';
-import { StandardTableList } from '../../../components/AXList/index';
-import { renderStatus, addRowKey } from '../../../utils/utils';
-
-const Message = message;
-
-@connect(({ loading, product }) => ({
-  product,
-  loading: loading.models.product,
-}))
-export default class SupportListPage extends Component {
-  constructor(props) {
-    super(props);
-    const { state } = props.location;
-    this.state = {
-      UIParams: (state || {}).UIParams, // 组件的状态参数
-      Queryers: (state || {}).Queryers, // 查询的条件参数
-    };
-  }
-  componentDidMount() {
-    this.props.dispatch({
-      type: 'product/fetchSupportList',
-      payload: { ...this.state.Queryers },
-    });
-  }
-  handleCreateOperation = () => {
-    this.props.dispatch(routerRedux.push({
-      pathname: '/product/support/create',
-      state: this.state,
-    }));
-  };
-  handleDeleteOperation = (item) => {
-    Modal.confirm({
-      okText: '确定',
-      cancelText: '取消',
-      title: '你确定要删除该课程吗?',
-      content: '如果该课程已经被某些套餐包关联,则将导致删除失败,需要手动解除与这些套餐包的关联才可进行删除',
-      onOk: () => {
-        this.props.dispatch({
-          type: 'product/deleteSupportItem',
-          payload: { id: item.id },
-          states: this.state,
-        });
-      },
-    });
-  };
-  handleEditOperation = (item) => {
-    this.props.dispatch(routerRedux.push({
-      pathname: `/product/support/edit/${item.pid}`,
-      state: this.state,
-    }));
-  };
-  handleFilterOperation = (params, states) => {
-    this.props.dispatch({
-      type: 'product/fetchSupportList',
-      payload: params,
-    });
-    this.setState({
-      UIParams: states,
-      Queryers: params,
-    });
-  };
-  handleBatchOperation = () => {
-    Message.info('暂不支持批量操作!');
-  };
-
-  render() {
-    const { loading, product } = this.props;
-    const { list, totalSize, pageSize, pageNo } = product;
-
-    const renderOperation = (item) => {
-      return (
-        <div>
-          <Button
-            size="small"
-            className="editBtn"
-            onClick={() => this.handleEditOperation(item)}
-          >编辑
-          </Button>
-          <Button
-            size="small"
-            className="delBtn"
-            onClick={() => this.handleDeleteOperation(item)}
-          >删除
-          </Button>
-        </div>
-      );
-    };
-
-    const batchActions = [{
-      key: 'delete',
-      name: '批量删除',
-    }, {
-      key: 'recovery',
-      name: '批量恢复',
-    }];
-    const basicSearch = {
-      keys: [{
-        name: '配套编号',
-        field: 'code',
-      }, {
-        name: '配套名称',
-        field: 'name',
-      }],
-    };
-    const pagination = {
-      pageNo,
-      pageSize,
-      totalSize,
-    };
-    const columns = [{
-      title: '配套编号',
-      key: 1,
-      dataIndex: 'code',
-      width: '20%',
-    }, {
-      title: '配套名称',
-      key: 2,
-      dataIndex: 'name',
-      width: '35%',
-    }, {
-      title: '配套状态',
-      key: 3,
-      dataIndex: 'status',
-      render: text => renderStatus(text),
-      width: '12%',
-    }, {
-      title: '更新时间',
-      key: 4,
-      dataIndex: 'gmtModified',
-      render: text => moment(text).format('YYYY-MM-DD HH:mm:ss'),
-      width: '20%',
-    }, {
-      title: '操作',
-      key: 5,
-      dataIndex: 'operation',
-      render: (_, record) => renderOperation(record),
-      width: '13%',
-      align: 'right',
-    }];
-    return (
-      <Card>
-        <StandardTableList
-          columns={columns}
-          loading={loading}
-          dataSource={addRowKey(list)}
-          header={{
-            basicSearch,
-            onFilterClick: this.handleFilterOperation,
-            onCreateClick: this.handleCreateOperation,
-          }}
-          footer={{
-            pagination,
-            batchActions,
-            onBatchClick: this.handleBatchOperation,
-          }}
-          keepUIState={{ ...this.state.UIParams }}
-        />
-      </Card>
-    );
-  }
-}

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

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

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

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

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

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

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

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

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

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

+ 0 - 188
src/routes/Resource/AudioBook/AudioBookCreate.js

@@ -1,188 +0,0 @@
-import React, { PureComponent } from 'react';
-import { Card, Form, Input, Button } from 'antd';
-import { connect } from 'dva';
-import { routerRedux } from 'dva/router';
-import PageHeaderLayout from '../../../layouts/PageHeaderLayout';
-import Uploader from '../../../components/AXUpload';
-import { Hotax } from '../../../utils/config';
-
-const formItemLayout = {
-  labelCol: {
-    xs: { span: 24 },
-    sm: { span: 6 },
-  },
-  wrapperCol: {
-    xs: { span: 24 },
-    sm: { span: 14 },
-    md: { span: 12 },
-  },
-};
-const submitFormLayout = {
-  wrapperCol: {
-    xs: { span: 24, offset: 0 },
-    sm: { span: 12, offset: 6 },
-  },
-};
-
-function getFileObject(params) {
-  if (!params) { return; }
-  const { img } = params;
-  const { format, ...rest } = img || {};
-  return { ...rest, type: `image/${format}` };
-}
-
-@Form.create()
-@connect(({ loading }) => ({
-  submitting: loading.models.resource,
-}))
-export default class AudioBookCreatePage extends PureComponent {
-  constructor(props) {
-    super(props);
-    const { state } = props.location;
-    const { audioBookItem } = state || {};
-    this.state = {
-      fileList: audioBookItem ? [getFileObject(audioBookItem)] : [],
-      ...(audioBookItem || {}),
-    };
-  }
-  handleOnChangeEvent = (fileList) => {
-    this.setState({ fileList });
-    return fileList;
-  };
-  handlePageBack = () => {
-    const { UIParams, Queryers } = this.props.location.state || {};
-    this.props.dispatch(
-      routerRedux.push({
-        pathname: '/resource/audiobook',
-        state: {
-          UIParams,
-          Queryers,
-        },
-      })
-    );
-  };
-  handlePageSubmit = (e) => {
-    e.preventDefault();
-    this.props.form.validateFieldsAndScroll((err, values) => {
-      if (!err) {
-        const { id, img, audio } = this.state;
-        const { audioPath, audioFormat, fileList, ...params } = values;
-        // 1.提取图片信息
-        let newImg = {};
-        if (Array.isArray(this.state.fileList) && this.state.fileList.length) {
-          const { path, type, size, url } = this.state.fileList[0];
-          newImg = {
-            ...img,
-            url,
-            path,
-            size,
-            format: type ? type.split('/')[1] : '',
-            type: Hotax.RESOURCE_IMAGE,
-            status: (img || {}).status ? img.status : Hotax.STATUS_NORMAL,
-          };
-        }
-        // 2.提取音频信息
-        const newAudio = {
-          ...audio,
-          path: audioPath,
-          format: audioFormat,
-          type: Hotax.RESOURCE_AUDIO,
-          status: (audio || {}).status ? audio.status : Hotax.STATUS_NORMAL,
-        };
-        // 3.需提交的数据
-        const newParams = {
-          ...params,
-          img: newImg,
-          audio: newAudio,
-          status: Hotax.STATUS_NORMAL,
-        };
-        const { UIParams, Queryers } = this.props.location.state || {};
-        if (id) {
-          this.props.dispatch({
-            type: 'resource/updateAudioBook',
-            payload: { id, ...newParams },
-            states: { UIParams, Queryers },
-          });
-        } else {
-          this.props.dispatch({
-            type: 'resource/createAudioBook',
-            payload: newParams,
-            states: { UIParams, Queryers },
-          });
-        }
-      }
-    });
-  };
-  render() {
-    const { form, submitting } = this.props;
-    const { getFieldDecorator } = form;
-    const { fileList, code, name, audio } = this.state;
-
-    return (
-      <PageHeaderLayout>
-        <Card>
-          <Form onSubmit={this.handlePageSubmit}>
-            <Form.Item label="有声读物编号" hasFeedback {...formItemLayout}>
-              {getFieldDecorator('code', {
-                rules: [{
-                  required: true, message: '编号不能为空!',
-                }, {
-                  pattern: /^[a-zA-Z0-9|-]+$/ig, message: '编号格式错误!',
-                }],
-                initialValue: code,
-              })(
-                <Input />
-              )}
-            </Form.Item>
-            <Form.Item label="有声读物名称" hasFeedback {...formItemLayout}>
-              {getFieldDecorator('name', {
-                rules: [{ required: true, message: '名称不能为空!' }],
-                initialValue: name,
-              })(
-                <Input />
-              )}
-            </Form.Item>
-            <Form.Item label="上传配图" {...formItemLayout}>
-              {getFieldDecorator('fileList', {
-                getValueFromEvent: this.handleOnChangeEvent,
-              })(
-                <Uploader
-                  fileList={fileList}
-                  accept="image"
-                  multiple={false}
-                  totalLimit={1}
-                />
-              )}
-            </Form.Item>
-            <Form.Item label="音频路径" {...formItemLayout}>
-              {getFieldDecorator('audioPath', {
-                rules: [{ required: true, message: '音频路径不能为空!' }],
-                initialValue: (audio || {}).path,
-              })(
-                <Input />
-              )}
-            </Form.Item>
-            <Form.Item label="音频格式" {...formItemLayout}>
-              {getFieldDecorator('audioFormat', {
-                rules: [{ required: true, message: '音频格式不能为空!' }],
-                initialValue: (audio || {}).format || 'mp3',
-              })(
-                <Input disabled />
-              )}
-            </Form.Item>
-            <Form.Item {...submitFormLayout} style={{ marginTop: 32 }}>
-              <Button onClick={this.handlePageBack}>取消</Button>
-              <Button
-                type="primary"
-                htmlType="submit"
-                loading={submitting}
-                style={{ marginLeft: 8 }}
-              >提交
-              </Button>
-            </Form.Item>
-          </Form>
-        </Card>
-      </PageHeaderLayout>
-    );
-  }
-}

+ 0 - 212
src/routes/Resource/AudioBook/AudioBookList.js

@@ -1,212 +0,0 @@
-/* eslint-disable no-prototype-builtins,jsx-a11y/media-has-caption */
-import React, { Component } from 'react';
-import moment from 'moment';
-import { connect } from 'dva';
-import { routerRedux } from 'dva/router';
-import { Card, Button, message } from 'antd';
-import Ellipsis from '../../../components/Ellipsis';
-import PageHeaderLayout from '../../../layouts/PageHeaderLayout';
-import { StandardTableList } from '../../../components/AXList';
-import { addRowKey, genAbsolutePicUrl } from '../../../utils/utils';
-import styles from './AudioBookList.less';
-
-const Message = message;
-
-function deleteBlankKey(obj) {
-  if (!(typeof obj === 'object')) {
-    return;
-  }
-  const newObj = { ...obj };
-  for (const key in newObj) {
-    if (newObj.hasOwnProperty(key) && !newObj[key]) {
-      delete newObj[key];
-    }
-  }
-  return newObj;
-}
-function genAudioBook(obj = {}) {
-  const { id, code, name, img, audio, status } = obj;
-  return {
-    id,
-    code,
-    name,
-    status,
-    img: img || {},
-    audio: audio || {},
-  };
-}
-
-@connect(({ loading, resource }) => ({
-  resource,
-  loading: loading.models.resource,
-}))
-export default class AudioBookListPage extends Component {
-  constructor(props) {
-    super(props);
-    const { state } = props.location;
-    this.state = {
-      UIParams: (state || {}).UIParams, // 组件的状态参数
-      Queryers: (state || {}).Queryers, // 查询的条件参数
-    };
-  }
-  componentWillMount() {
-    this.props.dispatch({
-      type: 'resource/clearState',
-    });
-  }
-  componentDidMount() {
-    this.props.dispatch({
-      type: 'resource/fetchAudioBookList',
-      payload: { ...this.state.Queryers },
-    });
-  }
-  // 创建有声读物(增)
-  handleCreateOperation = () => {
-    const { UIParams, Queryers } = this.state;
-    this.props.dispatch(
-      routerRedux.push({
-        pathname: '/resource/audiobook-create',
-        state: { UIParams, Queryers },
-      })
-    );
-  };
-  // 修改有声读物(改)
-  handleUpdateOperation = (item) => {
-    const { UIParams, Queryers } = this.state;
-    this.props.dispatch(
-      routerRedux.push({
-        pathname: `/resource/audiobook-edit/${item.id}`,
-        state: { UIParams, Queryers, audioBookItem: genAudioBook(item) },
-      })
-    );
-  };
-  // 查询有声读物(查)
-  handleFilterOperation = (params, states) => {
-    const newParams = deleteBlankKey(params);
-    this.props.dispatch({
-      type: 'resource/fetchAudioBookList',
-      payload: newParams,
-    });
-    this.setState({
-      UIParams: states,
-      Queryers: newParams,
-    });
-  };
-  // TODO: 批量操作
-  handleBatchOperation = () => {
-    Message.info('暂不支持批量操作!');
-  };
-
-  render() {
-    const { loading, resource } = this.props;
-    const { list, totalSize, pageSize, pageNo } = resource;
-    const pagination = {
-      pageNo,
-      pageSize,
-      totalSize,
-    };
-    const batchActions = [{
-      key: 'delete',
-      name: '批量删除',
-    }, {
-      key: 'edit',
-      name: '批量编辑',
-    }];
-    const basicSearch = {
-      keys: [{
-        name: '有声读物名称',
-        field: 'name',
-      }, {
-        name: '有声读物编号',
-        field: 'code',
-      }],
-    };
-    const columns = [{
-      title: '有声读物编号',
-      key: 1,
-      dataIndex: 'code',
-      width: '18%',
-      render: text => (
-        <Ellipsis tooltip lines={1}>{text}</Ellipsis>
-      ),
-    }, {
-      title: '有声读物名称',
-      key: 2,
-      dataIndex: 'name',
-      width: '20%',
-      render: text => (
-        <Ellipsis tooltip lines={1}>{text}</Ellipsis>
-      ),
-    }, {
-      title: '有声读物配图',
-      key: 3,
-      dataIndex: 'img',
-      width: '20%',
-      render: (text) => {
-        const { path } = text || {};
-        return (
-          <div className={styles.picWrapper}>
-            <img src={genAbsolutePicUrl(path)} alt="thumb" />
-          </div>
-        );
-      },
-    }, {
-      title: '有声读物音频',
-      key: 4,
-      dataIndex: 'audio',
-      width: '20%',
-      render: (text) => {
-        const { url } = text || {};
-        return (
-          <div className={styles.audioWrapper}>
-            <audio controls src={url}>浏览器暂不支持播放</audio>
-          </div>
-        );
-      },
-    }, {
-      title: '修改时间',
-      key: 5,
-      dataIndex: 'gmtModified',
-      render: text => moment(text).format('YYYY-MM-DD HH:mm:ss'),
-      width: '17%',
-    }, {
-      title: '操作',
-      key: 6,
-      dataIndex: 'operation',
-      render: (_, record) => (
-        <Button
-          size="small"
-          type="primary"
-          className="editBtn"
-          onClick={() => this.handleUpdateOperation(record)}
-        >编辑
-        </Button>
-      ),
-      width: '5%',
-      align: 'right',
-    }];
-    return (
-      <PageHeaderLayout>
-        <Card bordered={false}>
-          <StandardTableList
-            columns={columns}
-            loading={loading}
-            dataSource={addRowKey(list)}
-            header={{
-              basicSearch,
-              onFilterClick: this.handleFilterOperation,
-              onCreateClick: this.handleCreateOperation,
-            }}
-            footer={{
-              pagination,
-              batchActions,
-              onBatchClick: this.handleBatchOperation,
-            }}
-            keepUIState={{ ...this.state.UIParams }}
-            showStatusSelect={false}
-          />
-        </Card>
-      </PageHeaderLayout>
-    );
-  }
-}

+ 0 - 25
src/routes/Resource/AudioBook/AudioBookList.less

@@ -1,25 +0,0 @@
-@import "../../../../node_modules/antd/lib/style/themes/default.less";
-
-.picWrapper {
-  position: relative;
-  vertical-align: middle;
-  text-align: center;
-  width: 90px;
-  height: 128px;
-  line-height: 128px;
-  img {
-    max-height: 100%;
-    max-width: 100%;
-    vertical-align: middle;
-    height: auto;
-  }
-}
-
-.audioWrapper {
-  width: 180px;
-  height: 35px;
-  audio {
-    width: 100%;
-    height: 100%;
-  }
-}

+ 0 - 44
src/routes/Resource/Picture/PictureCardList.js

@@ -1,44 +0,0 @@
-import React from 'react';
-import { PictureItem } from '../../../components/AXItem';
-import { StandardCardList } from '../../../components/AXList';
-
-function PictureCardList({
-  UIParams, dataSource, loading, totalSize, pageSize, pageNo,
-  onFilterClick, onCreateClick, onBatchClick, onEditClick,
-}) {
-  const batchActions = [{
-    key: 'delete',
-    name: '批量删除',
-  }, {
-    key: 'edit',
-    name: '批量编辑',
-  }];
-  const basicSearch = {
-    keys: [{
-      name: '图片编号',
-      field: 'code',
-    }, {
-      name: '图片名称',
-      field: 'name',
-    }],
-  };
-  const pagination = {
-    pageNo,
-    pageSize,
-    totalSize,
-  };
-  return (
-    <StandardCardList
-      loading={loading}
-      component={PictureItem}
-      keepUIState={{ ...UIParams }}
-      dataSource={dataSource}
-      header={{ basicSearch, onFilterClick, onCreateClick }}
-      footer={{ pagination, batchActions, onBatchClick }}
-      grid={{ gutter: 16, xxl: 12, xl: 6, lg: 4, md: 3, sm: 2, xs: 1 }}
-      onEdit={onEditClick}
-    />
-  );
-}
-
-export default PictureCardList;

+ 0 - 163
src/routes/Resource/Picture/PictureEdit.js

@@ -1,163 +0,0 @@
-import React, { PureComponent } from 'react';
-import { Card, Form, Input, Button } from 'antd';
-import { connect } from 'dva';
-import { routerRedux } from 'dva/router';
-import Uploader from '../../../components/AXUpload';
-import { Hotax } from '../../../utils/config';
-import PageHeaderLayout from '../../../layouts/PageHeaderLayout';
-
-const formItemLayout = {
-  labelCol: {
-    xs: { span: 24 },
-    sm: { span: 6 },
-  },
-  wrapperCol: {
-    xs: { span: 24 },
-    sm: { span: 14 },
-    md: { span: 12 },
-  },
-};
-const submitFormLayout = {
-  wrapperCol: {
-    xs: { span: 24, offset: 0 },
-    sm: { span: 12, offset: 6 },
-  },
-};
-
-function getFileObject(params) {
-  if (!params) { return; }
-  const { format, url, path, name, size } = params;
-  return { url, path, name, size, type: `image/${format}` };
-}
-
-@Form.create()
-@connect(({ loading }) => ({
-  submitting: loading.models.resource,
-}))
-export default class PictureSingleUpload extends PureComponent {
-  constructor(props) {
-    super(props);
-    const { location } = props;
-    const { state } = location;
-    this.state = {
-      fileList: [getFileObject(state)],
-      code: state.code || '',
-      name: state.name || '',
-    };
-  }
-  handleNameInputChange = (e) => {
-    this.setState({ name: e.target.value });
-  };
-  handleOnChangeEvent = (fileList) => {
-    this.setState({ fileList });
-    return fileList;
-  };
-  handlePageBack = () => {
-    const { UIParams, Queryers, isCard } = this.props.location.state || {};
-    this.props.dispatch(
-      routerRedux.push({
-        pathname: '/resource/picture',
-        state: { UIParams, Queryers, isCard },
-      })
-    );
-  };
-  handlePageSubmit = (e) => {
-    e.preventDefault();
-    this.props.form.validateFieldsAndScroll((err, values) => {
-      if (!err) {
-        const { id, type, UIParams, Queryers } = this.props.location.state || {};
-        const { fileList, ...params } = values;
-        if (Array.isArray(fileList) && fileList.length) {
-          params.url = fileList[0].url;
-        }
-        params.id = id;
-        params.type = type;
-        params.status = Hotax.STATUS_NORMAL;
-        this.props.dispatch({
-          type: 'resource/updateImage',
-          payload: params,
-          states: { UIParams, Queryers },
-        });
-      }
-    });
-  };
-  render() {
-    const { form, submitting } = this.props;
-    const { getFieldDecorator } = form;
-    const { fileList, code, name } = this.state;
-    const firstPicture = fileList[0] || {};
-    const { type, size, path } = firstPicture;
-
-    return (
-      <PageHeaderLayout>
-        <Card>
-          <Form onSubmit={this.handlePageSubmit}>
-            <Form.Item label="图片编号" {...formItemLayout}>
-              {getFieldDecorator('code', {
-                rules: [{ required: true, message: '图片编号不能为空' }],
-                initialValue: code,
-              })(
-                <Input />
-              )}
-            </Form.Item>
-            <Form.Item label="图片名称" {...formItemLayout}>
-              {getFieldDecorator('name', {
-                rules: [{ required: true, message: '图片名称不能为空' }],
-                initialValue: name,
-              })(
-                <Input onChange={this.handleNameInputChange} />
-              )}
-            </Form.Item>
-            <Form.Item label="图片上传" {...formItemLayout}>
-              {getFieldDecorator('fileList', {
-                getValueFromEvent: this.handleOnChangeEvent,
-              })(
-                <Uploader
-                  forbidden={
-                    !((code && /^[a-zA-Z0-9|-]+$/ig.test(code) && name))
-                  }
-                  fileCode={code}
-                  fileList={fileList}
-                  accept="image"
-                  multiple={false}
-                  totalLimit={1}
-                />
-              )}
-            </Form.Item>
-            <Form.Item label="图片路径" {...formItemLayout}>
-              {getFieldDecorator('path', {
-                initialValue: path,
-              })(
-                <Input disabled />
-              )}
-            </Form.Item>
-            <Form.Item label="图片格式" {...formItemLayout}>
-              {getFieldDecorator('format', {
-                initialValue: type ? type.split('/')[1] : '',
-              })(
-                <Input disabled />
-              )}
-            </Form.Item>
-            <Form.Item label="图片大小" {...formItemLayout}>
-              {getFieldDecorator('size', {
-                initialValue: size,
-              })(
-                <Input disabled />
-              )}
-            </Form.Item>
-            <Form.Item {...submitFormLayout} style={{ marginTop: 32 }}>
-              <Button onClick={this.handlePageBack}>取消</Button>
-              <Button
-                type="primary"
-                htmlType="submit"
-                loading={submitting}
-                style={{ marginLeft: 8 }}
-              >提交
-              </Button>
-            </Form.Item>
-          </Form>
-        </Card>
-      </PageHeaderLayout>
-    );
-  }
-}

+ 0 - 117
src/routes/Resource/Picture/PictureList.js

@@ -1,117 +0,0 @@
-import React, { Component } from 'react';
-import { connect } from 'dva';
-import { routerRedux } from 'dva/router';
-import { Card, Button, message } from 'antd';
-import PictureCardList from './PictureCardList';
-import PictureTableList from './PictureTableList';
-import PageHeaderLayout from '../../../layouts/PageHeaderLayout';
-
-const Message = message;
-
-@connect(({ resource, loading }) => ({
-  resource,
-  loading: loading.models.resource,
-}))
-export default class PictureListPage extends Component {
-  constructor(props) {
-    super(props);
-    const { state } = props.location;
-    this.state = {
-      UIParams: (state || {}).UIParams, // 组件的状态参数
-      Queryers: (state || {}).Queryers, // 查询的条件参数
-      isCard: (state || {}).isCard || false,
-    };
-  }
-  componentWillMount() {
-    this.props.dispatch({
-      type: 'resource/clearState',
-    });
-  }
-  componentDidMount() {
-    this.props.dispatch({
-      type: 'resource/fetchImageList',
-      payload: { ...this.state.Queryers },
-    });
-  }
-  handleShowTypeChange = () => {
-    this.setState({ isCard: !this.state.isCard });
-  };
-  // 创建图片(增)
-  handleCreateOperation = () => {
-    this.props.dispatch(
-      routerRedux.push({
-        pathname: '/resource/picture-upload/single',
-        state: this.state,
-      })
-    );
-  };
-  // 修改图片(改)
-  handleEditOperation = (data) => {
-    this.props.dispatch(
-      routerRedux.push({
-        pathname: `/resource/picture-edit/${data.id}`,
-        state: {
-          ...this.state,
-          ...data,
-        },
-      })
-    );
-  };
-  // 查询图片(查)
-  handleFilterOperation = (params, states) => {
-    this.props.dispatch({
-      type: 'resource/fetchImageList',
-      payload: params,
-    });
-    this.setState({
-      UIParams: states,
-      Queryers: params,
-    });
-  };
-  // TODO: 批量操作
-  handleBatchOperation = () => {
-    Message.info('暂不支持批量操作!');
-  };
-
-  render() {
-    const { UIParams } = this.state;
-    const { resource, loading } = this.props;
-    const { list, totalSize, pageSize, pageNo } = resource;
-    const publicProps = {
-      loading,
-      pageNo,
-      pageSize,
-      totalSize,
-      UIParams,
-      dataSource: list,
-      onCreateClick: this.handleCreateOperation,
-      onEditClick: this.handleEditOperation,
-      onFilterClick: this.handleFilterOperation,
-      onBatchClick: this.handleBatchOperation,
-    };
-    return (
-      <PageHeaderLayout>
-        <Card>
-          <Button.Group style={{ marginBottom: 16 }}>
-            <Button
-              style={{ width: 50 }}
-              onClick={this.handleShowTypeChange}
-              icon="appstore-o"
-              type={this.state.isCard ? 'primary' : null}
-            />
-            <Button
-              style={{ width: 50 }}
-              onClick={this.handleShowTypeChange}
-              icon="table"
-              type={this.state.isCard ? null : 'primary'}
-            />
-          </Button.Group>
-          {this.state.isCard ?
-            <PictureCardList {...publicProps} /> :
-            <PictureTableList {...publicProps} />
-          }
-        </Card>
-      </PageHeaderLayout>
-    );
-  }
-}

+ 0 - 127
src/routes/Resource/Picture/PictureMultipleUpload.js

@@ -1,127 +0,0 @@
-import React, { PureComponent } from 'react';
-import { connect } from 'dva';
-import { routerRedux } from 'dva/router';
-import { Input, Button, message } from 'antd';
-import Uploader from '../../../components/AXUpload/index';
-import styles from './PictureMultipleUpload.less';
-
-const Message = message;
-
-@connect(({ loading }) => ({
-  submitting: loading.models.resource,
-}))
-export default class PictureMultipleUpload extends PureComponent {
-  state = {
-    fileList: [],
-  };
-
-  handleUploadSuccess = (fileList) => {
-    this.setState({ fileList });
-  };
-  handleOnRemove = (fileList) => {
-    this.setState({ fileList });
-  };
-  handleCodeInputChange = (index, e) => {
-    const newFileList = [...this.state.fileList];
-    newFileList[index].code = e.target.value;
-    this.setState({
-      fileList: newFileList,
-    });
-  };
-  handleNameInputChange = (index, e) => {
-    const newFileList = [...this.state.fileList];
-    newFileList[index].name = e.target.value;
-    this.setState({
-      fileList: newFileList,
-    });
-  };
-  handlePageBack = () => {
-    this.props.dispatch(routerRedux.push({
-      pathname: '/resource/image',
-    }));
-  };
-  handlePageSubmit = () => {
-    const { fileList } = this.state;
-    let correct = true;
-    fileList.forEach((file) => {
-      if (!file.name || !file.code) {
-        correct = false;
-      }
-    });
-    if (correct) {
-      const payload = fileList.map(file => ({
-        name: file.name,
-        code: file.code,
-        format: file.type,
-        size: file.size,
-        path: file.path,
-        url: file.url,
-        status: 'NORMAL',
-      }));
-      this.props.dispatch({
-        payload,
-        type: 'resource/createImage',
-      });
-    } else {
-      Message.error('还有图片编号或名称未指定!');
-    }
-  };
-
-  render() {
-    const { fileList } = this.state;
-    const { submitting } = this.props;
-    const renderPictureCard = (data, index) => {
-      return (
-        <div key={`item-${index}`} className={styles.itemWrapper}>
-          <div className={styles.item}>
-            <div className={styles.imgWrapper}>
-              <img src={data.url} alt="uploaded" />
-            </div>
-          </div>
-          <div className={styles.inputWrapper}>
-            <Input
-              value={data.code}
-              style={{ width: '100%', marginTop: 2 }}
-              placeholder="请输入图片编号"
-              onChange={e => this.handleCodeInputChange(index, e)}
-            />
-            <Input
-              value={data.name && data.name.split('.')[0]}
-              style={{ width: '100%', marginTop: 2 }}
-              placeholder="请输入图片名称"
-              onChange={e => this.handleNameInputChange(index, e)}
-            />
-          </div>
-        </div>
-      );
-    };
-    return (
-      <div className={styles.content}>
-        <div className={styles.left}>
-          <Uploader
-            forbidden={false}
-            fileList={fileList}
-            accept="image"
-            multiple
-            totalLimit={20}
-            onUpload={this.handleUploadSuccess}
-            onRemove={this.handleOnRemove}
-          />
-        </div>
-        <div className={styles.right}>
-          {fileList.map((item, index) => renderPictureCard(item, index))}
-        </div>
-        <div className={styles.bottom}>
-          <Button onClick={this.handlePageBack}>取消</Button>
-          <Button
-            type="primary"
-            style={{ marginLeft: 10 }}
-            loading={submitting}
-            onClick={this.handlePageSubmit}
-          >提交
-          </Button>
-        </div>
-      </div>
-    );
-  }
-}

+ 0 - 51
src/routes/Resource/Picture/PictureMultipleUpload.less

@@ -1,51 +0,0 @@
-@import "../../../../node_modules/antd/lib/style/themes/default.less";
-
-.content {
-  width: 100%;
-  height: 100%;
-  .left {
-    width: 30%;
-    float: left;
-    min-height: 500px;
-    padding-right: 16px;
-  }
-  .right {
-    float: left;
-    max-width: 70%;
-    min-height: 500px;
-    overflow: scroll;
-    height: 100%;
-    border-left: 1px solid #e1e5e9;
-  }
-  .bottom {
-    clear: both;
-    width: 100%;
-    height: 50px;
-    line-height: 50px;
-    vertical-align: middle;
-    text-align: center;
-  }
-}
-
-.itemWrapper {
-  display: inline-block;
-  width: 165px;
-  margin: 0 0 16px 16px;
-  vertical-align: top;
-  .item {
-    height: 200px;
-    line-height: 200px;
-    position: relative;
-    border: 1px solid #e1e5e9;
-    text-align: center;
-    vertical-align: middle;
-    img {
-      width: 100%;
-      max-height: 200px;
-    }
-  }
-}
-
-.inputWrapper {
-  margin-top: 2px;
-}

+ 0 - 166
src/routes/Resource/Picture/PictureSingleUpload.js

@@ -1,166 +0,0 @@
-import React, { PureComponent, Fragment } from 'react';
-import { Form, Input, Button, Alert } from 'antd';
-import { connect } from 'dva';
-import { routerRedux } from 'dva/router';
-import Uploader from '../../../components/AXUpload';
-import { Hotax } from '../../../utils/config';
-
-const formItemLayout = {
-  labelCol: {
-    xs: { span: 24 },
-    sm: { span: 6 },
-  },
-  wrapperCol: {
-    xs: { span: 24 },
-    sm: { span: 14 },
-    md: { span: 12 },
-  },
-};
-const submitFormLayout = {
-  wrapperCol: {
-    xs: { span: 24, offset: 0 },
-    sm: { span: 12, offset: 6 },
-  },
-};
-
-@Form.create()
-@connect(({ loading }) => ({
-  submitting: loading.models.resource,
-}))
-export default class PictureSingleUpload extends PureComponent {
-  state = {
-    fileList: [],
-    code: null,
-    name: null,
-  };
-  handleCodeInputChange = (e) => {
-    this.setState({ code: e.target.value });
-  };
-  handleNameInputChange = (e) => {
-    this.setState({ name: e.target.value });
-  };
-  handleOnChangeEvent = (fileList) => {
-    this.setState({ fileList });
-    return fileList;
-  };
-  handlePageBack = () => {
-    const { UIParams, Queryers, isCard } = this.props.location.state || {};
-    this.props.dispatch(
-      routerRedux.push({
-        pathname: '/resource/picture',
-        state: {
-          isCard,
-          UIParams,
-          Queryers,
-        },
-      })
-    );
-  };
-  handlePageSubmit = (e) => {
-    e.preventDefault();
-    this.props.form.validateFieldsAndScroll((err, values) => {
-      if (!err) {
-        const { fileList, ...params } = values;
-        if (Array.isArray(fileList) && fileList.length) {
-          params.url = fileList[0].url;
-        }
-        params.type = Hotax.RESOURCE_IMAGE;
-        params.status = Hotax.STATUS_NORMAL;
-        this.props.dispatch({
-          type: 'resource/createImage',
-          payload: params,
-        });
-      }
-    });
-  };
-  render() {
-    const { form, submitting } = this.props;
-    const { getFieldDecorator } = form;
-    const { fileList, code, name } = this.state;
-    const firstPicture = fileList[0] || {};
-    const { type, size, path } = firstPicture;
-
-    return (
-      <Form onSubmit={this.handlePageSubmit}>
-        <Form.Item {...submitFormLayout}>
-          <Alert
-            showIcon
-            type="warning"
-            message={
-              <Fragment>
-                <p>1.上传图片前应先填写符合规范的图片编号和名称,否则不能上传图片;</p>
-                <p>2.上传成功后会自动生成图片大小、格式、路径等信息,无需手动填写;</p>
-                <p>3.图片一旦创建完成,再次编辑时,图片编号不可修改。</p>
-              </Fragment>
-            }
-          />
-        </Form.Item>
-        <Form.Item label="图片编号" hasFeedback {...formItemLayout}>
-          {getFieldDecorator('code', {
-            rules: [{
-              required: true, message: '编号不能为空!',
-            }, {
-              pattern: /^[a-zA-Z0-9|-]+$/ig, message: '编号格式错误!',
-            }],
-          })(
-            <Input onChange={this.handleCodeInputChange} />
-          )}
-        </Form.Item>
-        <Form.Item label="图片名称" hasFeedback {...formItemLayout}>
-          {getFieldDecorator('name', {
-            rules: [{ required: true, message: '名称不能为空!' }],
-          })(
-            <Input onChange={this.handleNameInputChange} />
-          )}
-        </Form.Item>
-        <Form.Item label="图片上传" {...formItemLayout}>
-          {getFieldDecorator('fileList', {
-            getValueFromEvent: this.handleOnChangeEvent,
-          })(
-            <Uploader
-              forbidden={
-                !((code && /^[a-zA-Z0-9|-]+$/ig.test(code) && name))
-              }
-              fileCode={code}
-              fileList={fileList}
-              accept="image"
-              multiple={false}
-              totalLimit={1}
-            />
-          )}
-        </Form.Item>
-        <Form.Item label="图片路径" {...formItemLayout}>
-          {getFieldDecorator('path', {
-            initialValue: path,
-          })(
-            <Input disabled />
-          )}
-        </Form.Item>
-        <Form.Item label="图片格式" {...formItemLayout}>
-          {getFieldDecorator('format', {
-            initialValue: type ? type.split('/')[1] : '',
-          })(
-            <Input disabled />
-          )}
-        </Form.Item>
-        <Form.Item label="图片大小" {...formItemLayout}>
-          {getFieldDecorator('size', {
-            initialValue: size,
-          })(
-            <Input disabled />
-          )}
-        </Form.Item>
-        <Form.Item {...submitFormLayout} style={{ marginTop: 32 }}>
-          <Button onClick={this.handlePageBack}>取消</Button>
-          <Button
-            type="primary"
-            htmlType="submit"
-            loading={submitting}
-            style={{ marginLeft: 8 }}
-          >提交
-          </Button>
-        </Form.Item>
-      </Form>
-    );
-  }
-}

+ 0 - 111
src/routes/Resource/Picture/PictureTableList.js

@@ -1,111 +0,0 @@
-import React from 'react';
-import moment from 'moment';
-import { Button } from 'antd';
-import { addRowKey, genAbsolutePicUrl } from '../../../utils/utils';
-import { StandardTableList } from '../../../components/AXList';
-import styles from './PictureTableList.less';
-
-function PictureTableList({
-  UIParams, dataSource, loading, totalSize, pageSize, pageNo,
-  onFilterClick, onCreateClick, onBatchClick, onEditClick,
-}) {
-  const batchActions = [{
-    key: 'delete',
-    name: '批量删除',
-  }, {
-    key: 'edit',
-    name: '批量编辑',
-  }];
-  const basicSearch = {
-    keys: [{
-      name: '图片编号',
-      field: 'code',
-    }, {
-      name: '图片名称',
-      field: 'name',
-    }],
-  };
-  const pagination = {
-    pageNo,
-    pageSize,
-    totalSize,
-  };
-  const renderThumbPic = (url) => {
-    return (
-      <div className={styles.thumbPic}>
-        <img src={url} alt="thumb" />
-      </div>
-    );
-  };
-  const renderMetaData = ({ code, name }) => {
-    return (
-      <div className={styles.meta}>
-        <p>{name}</p>
-        <p>{code}</p>
-      </div>
-    );
-  };
-  const renderActions = (item) => {
-    return (
-      <div>
-        <Button
-          size="small"
-          type="primary"
-          className="editBtn"
-          onClick={() => onEditClick(item)}
-        >编辑
-        </Button>
-      </div>
-    );
-  };
-  const columns = [{
-    title: '缩略图',
-    key: 1,
-    dataIndex: 'path',
-    render: text => renderThumbPic(genAbsolutePicUrl(text)),
-    width: '20%',
-  }, {
-    title: '名称/编号',
-    key: 2,
-    dataIndex: 'meta',
-    render: (_, record) => renderMetaData(record),
-    width: '25%',
-  }, {
-    title: '格式',
-    key: 3,
-    dataIndex: 'format',
-    width: '13%',
-  }, {
-    title: '大小(Byte)',
-    key: 4,
-    dataIndex: 'size',
-    width: '12%',
-  }, {
-    title: '更新日期',
-    key: 5,
-    dataIndex: 'gmtModified',
-    render: text => moment(text).format('YYYY-MM-DD HH:mm:ss'),
-    width: '20%',
-  }, {
-    title: '操作',
-    key: 6,
-    dataIndex: 'action',
-    render: (_, record) => renderActions(record),
-    width: '10%',
-    align: 'right',
-  }];
-
-  return (
-    <StandardTableList
-      columns={columns}
-      loading={loading}
-      dataSource={addRowKey(dataSource)}
-      keepUIState={{ ...UIParams }}
-      header={{ basicSearch, onFilterClick, onCreateClick }}
-      footer={{ pagination, batchActions, onBatchClick }}
-      showStatusSelect={false}
-    />
-  );
-}
-
-export default PictureTableList;

+ 0 - 35
src/routes/Resource/Picture/PictureTableList.less

@@ -1,35 +0,0 @@
-@import "../../../../node_modules/antd/lib/style/themes/default.less";
-
-.thumbPic {
-  position: relative;
-  vertical-align: middle;
-  text-align: center;
-  width: 90px;
-  height: 128px;
-  line-height: 128px;
-  img {
-    max-height: 100%;
-    max-width: 100%;
-    vertical-align: middle;
-    height: auto;
-  }
-}
-
-.meta {
-  p {
-    font-weight: 500;
-  }
-}
-
-.editBtn {
-  margin-right: 10px;
-  background: @primary-5;
-  color: #fff;
-  font-weight: 500;
-}
-.delBtn {
-  margin-right: 10px;
-  background: #f5222d;
-  color: #fff;
-  font-weight: 500;
-}

+ 0 - 35
src/routes/Resource/Picture/PictureUpload.js

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

+ 0 - 97
src/routes/Resource/Picture/PictureUploadResult.js

@@ -1,97 +0,0 @@
-import React, { Component } from 'react';
-import { connect } from 'dva';
-import { routerRedux } from 'dva/router';
-import { Button, Icon, Card } from 'antd';
-import Result from '../../../components/Result';
-import { genAbsolutePicUrl } from '../../../utils/utils';
-
-class PictureUploadSuccessResult extends Component {
-  jumpToPictureListPage = () => {
-    this.props.dispatch(
-      routerRedux.push({
-        pathname: '/resource/picture',
-      })
-    );
-  };
-  jumpToPictureDetailPage = (params) => {
-    this.props.dispatch(
-      routerRedux.push({
-        pathname: `/resource/picture-edit/:${params.id}`,
-        state: params,
-      })
-    );
-  };
-  jumpToPictureSingleUpload = () => {
-    this.props.dispatch(
-      routerRedux.push({
-        pathname: '/resource/picture-upload/single',
-      })
-    );
-  };
-  render() {
-    const { location } = this.props;
-    const { state = {} } = location;
-    const { path, code, format, name, size } = state;
-    const description = '图片上传成功,请核对以下图片信息,如果有误请编辑图片进行修改';
-    const extra = (
-      <div>
-        <div style={{ fontSize: 16, color: 'rgba(0, 0, 0, 0.85)', fontWeight: 500, marginBottom: 16 }}>
-          您提交的图片信息如下:
-        </div>
-        <div style={{ marginBottom: 16 }}>
-          <Icon style={{ color: '#52c41a', marginRight: 8 }} type="check-circle-o" />图片名称:
-          <span style={{ marginLeft: 16 }}>{name || ''}</span>
-        </div>
-        <div style={{ marginBottom: 16 }}>
-          <Icon style={{ color: '#52c41a', marginRight: 8 }} type="check-circle-o" />图片编号:
-          <span style={{ marginLeft: 16 }}>{code || ''}</span>
-        </div>
-        <div style={{ marginBottom: 16 }}>
-          <Icon style={{ color: '#52c41a', marginRight: 8 }} type="check-circle-o" />图片格式:
-          <span style={{ marginLeft: 16 }}>{format || ''}</span>
-        </div>
-        <div style={{ marginBottom: 16 }}>
-          <Icon style={{ color: '#52c41a', marginRight: 8 }} type="check-circle-o" />图片大小:
-          <span style={{ marginLeft: 16 }}>{`${size || ''}字节`}</span>
-        </div>
-        <div style={{ marginBottom: 16 }}>
-          <Icon style={{ color: '#52c41a', marginRight: 8 }} type="check-circle-o" />图片地址:
-          <span style={{ marginLeft: 16 }}>{path ? genAbsolutePicUrl(path) : ''}</span>
-        </div>
-      </div>
-    );
-    const actions = (
-      <div>
-        <Button
-          onClick={this.jumpToPictureListPage}
-        >返回列表
-        </Button>
-        <Button
-          type="primary"
-          style={{ marginLeft: 10 }}
-          onClick={this.jumpToPictureSingleUpload}
-        >再传一个
-        </Button>
-        <Button
-          type="primary"
-          style={{ marginLeft: 10 }}
-          onClick={() => this.jumpToPictureDetailPage(state)}
-        >修改图片
-        </Button>
-      </div>
-    );
-    return (
-      <Card>
-        <Result
-          type="success"
-          title="上传成功"
-          description={description}
-          extra={extra}
-          actions={actions}
-        />
-      </Card>
-    );
-  }
-}
-
-export default connect()(PictureUploadSuccessResult);

+ 0 - 189
src/routes/Resource/Video/VideoCreate.js

@@ -1,189 +0,0 @@
-import React, { PureComponent } from 'react';
-import pathToRegexp from 'path-to-regexp';
-import { Card, Form, Radio, Input, Button } from 'antd';
-import { connect } from 'dva';
-import { routerRedux } from 'dva/router';
-import PageHeaderLayout from '../../../layouts/PageHeaderLayout';
-import { resourceTypes, resourceQuality } from '../../../utils/utils';
-import { Hotax } from '../../../utils/config';
-
-const formItemLayout = {
-  labelCol: {
-    xs: { span: 24 },
-    sm: { span: 6 },
-  },
-  wrapperCol: {
-    xs: { span: 24 },
-    sm: { span: 14 },
-    md: { span: 12 },
-  },
-};
-const submitFormLayout = {
-  wrapperCol: {
-    xs: { span: 24, offset: 0 },
-    sm: { span: 12, offset: 6 },
-  },
-};
-
-@Form.create()
-@connect(({ loading }) => ({
-  submitting: loading.models.resource,
-}))
-export default class VideoCreatePage extends PureComponent {
-  isEdit = () => {
-    const { location } = this.props;
-    const match = pathToRegexp('/resource/video-edit/:id').exec(location.pathname);
-    if (match) {
-      return match[1];
-    }
-    return false;
-  };
-  handlePageBack = () => {
-    const { UIParams, Queryers } = this.props.location.state || {};
-    this.props.dispatch(
-      routerRedux.push({
-        pathname: '/resource/video',
-        state: { UIParams, Queryers },
-      })
-    );
-  };
-  handlePageSubmit = (e) => {
-    e.preventDefault();
-    this.props.form.validateFieldsAndScroll((err, values) => {
-      if (!err) {
-        const { UIParams, Queryers } = this.props.location.state || {};
-        const matchId = this.isEdit();
-        if (matchId) {
-          this.props.dispatch({
-            type: 'resource/updateVideo',
-            payload: { id: matchId, status: Hotax.STATUS_NORMAL, ...values },
-            states: { UIParams, Queryers },
-          });
-          return;
-        }
-        this.props.dispatch({
-          type: 'resource/createVideo',
-          payload: { status: Hotax.STATUS_NORMAL, ...values },
-          states: { UIParams, Queryers },
-        });
-      }
-    });
-  };
-  render() {
-    const { form, submitting, location } = this.props;
-    const { getFieldDecorator } = form;
-    const { state = {} } = location;
-    const { code, name, size, type, path, rate, quality, format } = state;
-
-    return (
-      <PageHeaderLayout>
-        <Card>
-          <Form onSubmit={this.handlePageSubmit}>
-            <Form.Item label="视频编号" {...formItemLayout}>
-              {getFieldDecorator('code', {
-                rules: [
-                  {
-                    required: true, message: '视频编号不能为空',
-                  }, {
-                    pattern: /^[a-zA-Z0-9|-]+$/g, message: '编号包含非法字符',
-                  },
-                ],
-                initialValue: code,
-              })(
-                <Input placeholder="请填写" />
-              )}
-            </Form.Item>
-            <Form.Item label="视频名称" {...formItemLayout}>
-              {getFieldDecorator('name', {
-                rules: [{ required: true, message: '视频名称不能为空' }],
-                initialValue: name,
-              })(
-                <Input placeholder="请填写" />
-              )}
-            </Form.Item>
-            <Form.Item label="视频路径" {...formItemLayout}>
-              {getFieldDecorator('path', {
-                rules: [{ required: true, message: '资源路径为必填项' }],
-                initialValue: path,
-              })(
-                <Input placeholder="请填写" />
-              )}
-            </Form.Item>
-            <Form.Item label="资源类型" {...formItemLayout}>
-              {getFieldDecorator('type', {
-                rules: [{ required: true, message: '资源类型不能为空' }],
-                initialValue: type || Hotax.RESOURCE_VIDEO,
-              })(
-                <Radio.Group disabled>
-                  {
-                    Object.keys(resourceTypes).map(key =>
-                      (
-                        <Radio.Button
-                          key={key}
-                          value={parseInt(key, 10)}
-                        >{resourceTypes[key]}
-                        </Radio.Button>
-                      )
-                    )
-                  }
-                </Radio.Group>
-              )}
-            </Form.Item>
-            <Form.Item label="清晰度" {...formItemLayout}>
-              {getFieldDecorator('quality', {
-                rules: [{ required: true, message: '清晰度为必选项' }],
-                initialValue: quality || Hotax.QUALITY_HIGH,
-              })(
-                <Radio.Group disabled>
-                  {
-                    Object.keys(resourceQuality).map(key =>
-                      (
-                        <Radio.Button
-                          key={key}
-                          value={key}
-                        >{resourceQuality[key]}
-                        </Radio.Button>
-                      )
-                    )
-                  }
-                </Radio.Group>
-              )}
-            </Form.Item>
-            <Form.Item label="视频格式" {...formItemLayout}>
-              {getFieldDecorator('format', {
-                rules: [{ required: true, message: '视频格式不能为空' }],
-                initialValue: format || 'm3u8',
-              })(
-                <Input disabled placeholder="请填写" />
-              )}
-            </Form.Item>
-            <Form.Item label="视频码流" {...formItemLayout}>
-              {getFieldDecorator('rate', {
-                initialValue: rate,
-              })(
-                <Input placeholder="请填写" />
-              )}
-            </Form.Item>
-            <Form.Item label="视频大小" {...formItemLayout}>
-              {getFieldDecorator('size', {
-                initialValue: size,
-              })(
-                <Input placeholder="请填写" addonAfter="字节" />
-              )}
-            </Form.Item>
-            <Form.Item {...submitFormLayout} style={{ marginTop: 32 }}>
-              <Button onClick={this.handlePageBack}>取消</Button>
-              <Button
-                type="primary"
-                htmlType="submit"
-                loading={submitting}
-                style={{ marginLeft: 8 }}
-              >提交
-              </Button>
-            </Form.Item>
-          </Form>
-        </Card>
-      </PageHeaderLayout>
-    );
-  }
-}

+ 0 - 163
src/routes/Resource/Video/VideoList.js

@@ -1,163 +0,0 @@
-/* eslint-disable no-prototype-builtins */
-import React, { Component } from 'react';
-import { connect } from 'dva';
-import { routerRedux } from 'dva/router';
-import { Card, Modal, Button, message } from 'antd';
-import VideoPlayList from './VideoPlayList';
-import VideoTableList from './VideoTableList';
-import PageHeaderLayout from '../../../layouts/PageHeaderLayout';
-import { addRowKey } from '../../../utils/utils';
-
-const Message = message;
-
-function deleteBlankKey(obj) {
-  if (!(typeof obj === 'object')) {
-    return;
-  }
-  const newObj = { ...obj };
-  for (const key in newObj) {
-    if (newObj.hasOwnProperty(key) && !newObj[key]) {
-      delete newObj[key];
-    }
-  }
-  return newObj;
-}
-
-@connect(({ loading, resource }) => ({
-  resource,
-  loading: loading.models.resource,
-}))
-export default class VideoListPage extends Component {
-  constructor(props) {
-    super(props);
-    const { state } = props.location;
-    this.state = {
-      isCard: false,
-      destroy: true,
-      current: {},
-      UIParams: (state || {}).UIParams, // 组件的状态参数
-      Queryers: (state || {}).Queryers, // 查询的条件参数
-    };
-  }
-  componentWillMount() {
-    this.props.dispatch({
-      type: 'resource/clearState',
-    });
-  }
-  componentDidMount() {
-    this.props.dispatch({
-      type: 'resource/fetchVideoList',
-      payload: { ...this.state.Queryers },
-    });
-  }
-  handleShowTypeChange = () => {
-    this.setState({ isCard: !this.state.isCard });
-  };
-  handleModalDestroy = () => {
-    this.setState({ destroy: true });
-  };
-  handleModalCreate = (item) => {
-    this.setState({ destroy: false, current: item });
-  };
-  // 创建视频(增)
-  handleCreateOperation = () => {
-    const { UIParams, Queryers } = this.state;
-    this.props.dispatch(
-      routerRedux.push({
-        pathname: '/resource/video-create',
-        state: { UIParams, Queryers },
-      })
-    );
-  };
-  // 删除视频(删)
-  handleDeleteOperation = (item) => {
-    Modal.confirm({
-      okText: '确定',
-      cancelText: '取消',
-      title: '您确定要删除该视频吗?',
-      onOk: () => {
-        this.props.dispatch({
-          type: 'resource/deleteVideo',
-          payload: { id: item.id },
-        });
-      },
-    });
-  };
-  // 修改视频(改)
-  handleUpdateOperation = (item) => {
-    const { UIParams, Queryers } = this.state;
-    this.props.dispatch(
-      routerRedux.push({
-        pathname: `/resource/video-edit/${item.id}`,
-        state: { UIParams, Queryers, ...item },
-      })
-    );
-  };
-  // 查询视频(查)
-  handleFilterOperation = (params, states) => {
-    const newParams = deleteBlankKey(params);
-    this.props.dispatch({
-      type: 'resource/fetchVideoList',
-      payload: newParams,
-    });
-    this.setState({
-      UIParams: states,
-      Queryers: newParams,
-    });
-  };
-  // TODO: 批量操作
-  handleBatchOperation = () => {
-    Message.info('暂不支持批量操作!');
-  };
-
-  render() {
-    const { UIParams } = this.state;
-    const { loading, resource } = this.props;
-    const { list, totalSize, pageSize, pageNo } = resource;
-    const publicProps = {
-      loading,
-      pageNo,
-      pageSize,
-      totalSize,
-      UIParams,
-      dataSource: addRowKey(list),
-      onCreateClick: this.handleCreateOperation,
-      onDeleteClick: this.handleDeleteOperation,
-      onUpdateClick: this.handleUpdateOperation,
-      onFilterClick: this.handleFilterOperation,
-    };
-    return (
-      <PageHeaderLayout>
-        <Card bordered={false}>
-          <Button.Group style={{ marginBottom: 16 }}>
-            <Button
-              style={{ width: 50 }}
-              onClick={this.handleShowTypeChange}
-              icon="appstore-o"
-              type={this.state.isCard ? 'primary' : null}
-            />
-            <Button
-              style={{ width: 50 }}
-              onClick={this.handleShowTypeChange}
-              icon="table"
-              type={this.state.isCard ? null : 'primary'}
-            />
-          </Button.Group>
-          {this.state.isCard ?
-            (<VideoPlayList {...publicProps} />)
-            : (
-              <VideoTableList
-                {...publicProps}
-                currentItem={this.state.current}
-                modalDestroy={this.state.destroy}
-                onModalDestroy={this.handleModalDestroy}
-                onModalCreate={this.handleModalCreate}
-                onBatchClick={this.handleBatchOperation}
-              />
-            )
-          }
-        </Card>
-      </PageHeaderLayout>
-    );
-  }
-}

+ 0 - 181
src/routes/Resource/Video/VideoPlayList.js

@@ -1,181 +0,0 @@
-import React, { PureComponent } from 'react';
-import moment from 'moment';
-import { Table, Pagination, Select, Input } from 'antd';
-import AXVideoPlayer from '../../../components/AXVideoPlayer/index';
-import styles from './VideoPlayList.less';
-
-export default class VideoPlayList extends PureComponent {
-  constructor(props) {
-    super(props);
-    this.state = {
-      currentPlayingIndex: 0,
-      searchSelectKey: 'code',
-      searchInputValue: '',
-    };
-  }
-  componentWillReceiveProps(nextProps) {
-    const { dataSource } = nextProps;
-    if (dataSource && dataSource.length) {
-      this.setState({ currentPlayingIndex: 0 });
-    }
-  }
-  handleOnRowClick = (index) => {
-    this.setState({ currentPlayingIndex: index });
-  };
-  handleSearchSelectChange = (value) => {
-    this.setState({ searchSelectKey: value });
-  };
-  handleInputChange = (e) => {
-    this.setState({ searchInputValue: e.target.value });
-  };
-  handleFilterOperation = (params) => {
-    const { pageSize, pageNo, onFilterClick } = this.props;
-    const { searchSelectKey, searchInputValue } = this.state;
-    onFilterClick({
-      pageNo,
-      pageSize,
-      [searchSelectKey]: searchInputValue,
-      ...params,
-    });
-  };
-  handleSearchBtnClick = () => {
-    this.handleFilterOperation();
-  };
-  handleTablePageChange = (page, pageSize) => {
-    this.handleFilterOperation({
-      pageSize,
-      pageNo: page,
-    });
-  };
-  handleTablePageSizeChange = (current, size) => {
-    this.handleFilterOperation({
-      pageSize: size,
-      pageNo: current,
-    });
-  };
-
-  render() {
-    const { dataSource, loading, totalSize, pageSize, pageNo } = this.props;
-    const renderQuality = (quality) => {
-      if (quality === 'high') {
-        return '高清';
-      } else {
-        return '标清';
-      }
-    };
-    const renderItem = (data) => {
-      return (
-        <div className={styles.meta}>
-          <p>
-            <span>编号:  </span>
-            <a>{`${data.code}`}</a>
-          </p>
-          <p>
-            <span>名称:  </span>
-            {`${data.name}`}
-          </p>
-          <p>
-            <span>格式:  </span>
-            {`${renderQuality(data.quality)}[${data.format}]`}
-          </p>
-          <p>
-            <span>时间:  </span>
-            {`${moment(data.gmtModified).format('YYYY-MM-DD HH:mm:ss')}`}
-          </p>
-        </div>
-      );
-    };
-    const renderVideoPlayer = () => {
-      if (dataSource.length) {
-        const videoItem = dataSource[this.state.currentPlayingIndex];
-        return (
-          <AXVideoPlayer
-            width="100%"
-            height="100%"
-            url={videoItem.url}
-            isM3U8={videoItem.format === 'm3u8'}
-          />
-        );
-      }
-      return null;
-    };
-    const columns = [{
-      title: '名称/编号/状态/格式/质量/日期',
-      key: 1,
-      dataIndex: 'cn',
-      render: (_, record) => renderItem(record),
-    }];
-    const paginationProps = {
-      pageSize,
-      total: totalSize,
-      current: pageNo,
-      simple: true,
-      showTotal: total => `共 ${total} 条`,
-      onChange: this.handleTablePageChange,
-      onShowSizeChange: this.handleTablePageSizeChange,
-    };
-    const selectOptions = [{
-      field: 'code',
-      name: '编号',
-    }, {
-      field: 'name',
-      name: '名称',
-    }];
-    const onRowClick = (_, index) => {
-      return {
-        onClick: () => this.handleOnRowClick(index),
-      };
-    };
-    const renderHeader = () => {
-      return (
-        <Input.Search
-          value={this.state.searchInputValue}
-          style={{ width: '100%' }}
-          addonBefore={
-            <Select
-              placeholder="请选择"
-              value={this.state.searchSelectKey}
-              onChange={this.handleSearchSelectChange}
-            >
-              {selectOptions.map(item => (
-                <Select.Option
-                  key={item.field}
-                  value={item.field}
-                >
-                  {item.name}
-                </Select.Option>))}
-            </Select>
-          }
-          placeholder="请输入"
-          enterButton
-          onChange={this.handleInputChange}
-          onSearch={this.handleSearchBtnClick}
-        />
-      );
-    };
-    return (
-      <div className={styles.content}>
-        <div className={styles.left}>
-          <Table
-            bordered
-            title={() => renderHeader()}
-            footer={() => <Pagination {...paginationProps} />}
-            columns={columns}
-            pagination={false}
-            onRow={onRowClick}
-            rowKey={record => record.key}
-            className={styles.table}
-            rowClassName={(_, index) =>
-              (index === this.state.currentPlayingIndex ? styles.rowChecked : null)
-            }
-            loading={loading}
-            dataSource={dataSource}
-          />
-        </div>
-        <div className={styles.right}>
-          {renderVideoPlayer()}
-        </div>
-      </div>
-    );
-  }
-}

+ 0 - 91
src/routes/Resource/Video/VideoPlayList.less

@@ -1,91 +0,0 @@
-@import "../../../../node_modules/antd/lib/style/themes/default.less";
-
-.table {
-  font-size: 16px;
-  :global {
-    .ant-table table {
-      border-collapse: collapse;
-    }
-    .ant-table-wrapper {
-      height: 100%;
-    }
-    .ant-table-tbody > tr > td {
-      padding: 5px 5px;
-    }
-    .ant-table-thead > tr > th {
-      padding: 10px 5px;
-    }
-    .ant-table-row {
-      &:hover {
-        cursor: pointer;
-      }
-    }
-    .ant-table-title {
-      padding: 0;
-    }
-    .ant-table-footer {
-      text-align: center;
-    }
-    .ant-table.ant-table-bordered .ant-table-title {
-      border: unset;
-      padding-left: 0;
-      padding-right: 0;
-    }
-  }
-}
-
-.rowChecked {
-  border: 5px solid @primary-5;
-}
-
-.meta {
-  p {
-    margin: 0;
-    font-weight: 400;
-    span {
-      font-weight: 500;
-    }
-  }
-}
-
-@media (min-width: 1200px) {
-  .table {
-    :global {
-      .ant-table-body {
-        height: 480px;
-        overflow-y: scroll;
-      }
-    }
-  }
-  .left {
-    width: 32%;
-    float: left;
-    height: 570px;
-  }
-  .right {
-    width: 68%;
-    float: left;
-    height: 570px;
-  }
-}
-
-@media (min-width: 1600px) {
-  .table {
-    :global {
-      .ant-table-body {
-        height: 760px;
-        overflow-y: scroll;
-      }
-    }
-  }
-  .left {
-    width: 32%;
-    float: left;
-    height: 850px;
-  }
-  .right {
-    width: 68%;
-    float: left;
-    height: 850px;
-  }
-}

+ 0 - 128
src/routes/Resource/Video/VideoTableList.js

@@ -1,128 +0,0 @@
-import React from 'react';
-import moment from 'moment';
-import { Modal, Button } from 'antd';
-import { StandardTableList } from '../../../components/AXList';
-import AXVideoPlayer from '../../../components/AXVideoPlayer';
-import Ellipsis from '../../../components/Ellipsis';
-import { resourceQuality } from '../../../utils/utils';
-
-function VideoTableList({
-  UIParams, dataSource, loading, totalSize, pageSize, pageNo, modalDestroy, currentItem,
-  onCreateClick, onUpdateClick, onFilterClick, onBatchClick, onModalCreate,
-  onModalDestroy,
-}) {
-  const pagination = {
-    pageNo,
-    pageSize,
-    totalSize,
-  };
-  const batchActions = [{
-    key: 'delete',
-    name: '批量删除',
-  }, {
-    key: 'edit',
-    name: '批量编辑',
-  }];
-  const basicSearch = {
-    keys: [{
-      name: '视频名称',
-      field: 'name',
-    }, {
-      name: '视频编号',
-      field: 'code',
-    }],
-  };
-  const columns = [{
-    title: '视频编号',
-    key: 1,
-    dataIndex: 'code',
-    width: '15%',
-    render: text => (
-      <Ellipsis tooltip lines={1}>{text}</Ellipsis>
-    ),
-  }, {
-    title: '视频名称',
-    key: 2,
-    dataIndex: 'name',
-    width: '30%',
-    render: text => (
-      <Ellipsis tooltip lines={1}>{text}</Ellipsis>
-    ),
-  }, {
-    title: '视频格式',
-    key: 3,
-    dataIndex: 'format',
-    width: '10%',
-  }, {
-    title: '质量',
-    key: 4,
-    dataIndex: 'quality',
-    render: text => resourceQuality[text],
-    width: '10%',
-  }, {
-    title: '修改时间',
-    key: 5,
-    dataIndex: 'gmtModified',
-    render: text => moment(text).format('YYYY-MM-DD HH:mm:ss'),
-    width: '15%',
-  }, {
-    title: '操作',
-    key: 6,
-    dataIndex: 'operation',
-    render: (_, record) => renderActions(record),
-    width: '20%',
-    align: 'right',
-  }];
-  const renderActions = (item) => {
-    return (
-      <div>
-        <Button
-          size="small"
-          type="primary"
-          className="editBtn"
-          onClick={() => onUpdateClick(item)}
-        >编辑
-        </Button>
-        <Button
-          size="small"
-          type="primary"
-          className="playBtn"
-          onClick={() => onModalCreate(item)}
-        >播放
-        </Button>
-      </div>
-    );
-  };
-  return (
-    <div>
-      <StandardTableList
-        columns={columns}
-        loading={loading}
-        dataSource={dataSource}
-        keepUIState={{ ...UIParams }}
-        header={{ basicSearch, onFilterClick, onCreateClick }}
-        footer={{ pagination, batchActions, onBatchClick }}
-        showStatusSelect={false}
-      />
-      {!modalDestroy && (
-        <Modal
-          title={currentItem.name}
-          visible
-          footer={null}
-          onCancel={onModalDestroy}
-          maskClosable={false}
-          width={800}
-        >
-          <AXVideoPlayer
-            width="100%"
-            height="100%"
-            url={currentItem.url}
-            isM3U8={currentItem.format === 'm3u8'}
-          />
-        </Modal>
-      )}
-    </div>
-  );
-}
-
-export default VideoTableList;

+ 0 - 8
src/routes/Shelves/ShelvesEdit.js

@@ -205,20 +205,12 @@ export default class ShelvesEdit extends Component {
         <Card title="栏目管理" style={{ marginBottom: 70 }}>
           {tags && tags.map((item, index) => (
             <Tag
-              closable
               color="#87d068"
               key={item.id}
-              afterClose={() => this.handleTagClose(index)}
             >
               {item.name}
             </Tag>
           ))}
-          <Tag
-            style={{ borderStyle: 'dashed' }}
-            onClick={this.handleTagSelectorModalShow}
-          >
-            <Icon type="plus" />添加栏目
-          </Tag>
           {!tagSelectorDestroy && (
             <Modal
               width={1100}

+ 2 - 29
src/routes/Shelves/ShelvesList.js

@@ -46,16 +46,7 @@ export default class ShelvesListPage extends Component {
       payload: { ...this.state.Queryers },
     });
   }
-  /**
-   * 跳转到创建页面
-   */
-  handleCreateOperation = () => {
-    const { scene } = this.state;
-    this.props.dispatch(routerRedux.push({
-      pathname: `/shelves/${scene.toLowerCase()}/create`,
-      state: this.state,
-    }));
-  };
+
   /**
    * 下架某渠道下的一个产品
    * @param {Object} item
@@ -147,25 +138,8 @@ export default class ShelvesListPage extends Component {
             size="small"
             className="editBtn"
             onClick={() => this.handleEditOperation(item)}
-          >编辑
+          >查看
           </Button>
-          {item.status === Hotax.STATUS_NORMAL ?
-            (
-              <Button
-                size="small"
-                className="delBtn"
-                onClick={() => this.handleDeleteOperation(item)}
-              >下架
-              </Button>
-            ) : (
-              <Button
-                size="small"
-                className="recBtn"
-                onClick={() => this.handleRecoverOperation(item)}
-              >上架
-              </Button>
-            )
-          }
         </div>
       );
     };
@@ -238,7 +212,6 @@ export default class ShelvesListPage extends Component {
           header={{
             basicSearch,
             onFilterClick: this.handleFilterOperation,
-            onCreateClick: this.handleCreateOperation,
           }}
           footer={{
             pagination,

+ 4 - 70
src/routes/Shelves/TableForm.js

@@ -163,7 +163,7 @@ export default class TableForm extends PureComponent {
       title: '计价单位',
       dataIndex: 'chargeUnit',
       key: 'chargeUnit',
-      width: '13%',
+      width: '15%',
       align: 'center',
       render: (text, record) => {
         if (record.editable) {
@@ -201,7 +201,7 @@ export default class TableForm extends PureComponent {
       title: '二维码',
       dataIndex: 'shopQR',
       key: 'shopQR',
-      width: '10%',
+      width: '15%',
       align: 'center',
       render: (text, record) => {
         const { editable, key } = record;
@@ -219,30 +219,10 @@ export default class TableForm extends PureComponent {
         );
       },
     }, {
-      title: '供应商售价(¥)',
-      dataIndex: 'cpPrice',
-      key: 'cpPrice',
-      width: '18%',
-      align: 'center',
-      render: (text, record) => {
-        if (record.editable) {
-          return (
-            <InputNumber
-              min={1}
-              value={text}
-              onChange={e => this.handleFieldChange(e, 'cpPrice', record.key)}
-              style={{ width: '100%' }}
-              placeholder="请输入"
-            />
-          );
-        }
-        return text;
-      },
-    }, {
       title: '平台方售价(¥)',
       dataIndex: 'merchantPrice',
       key: 'merchantPrice',
-      width: '18%',
+      width: '20%',
       align: 'center',
       render: (text, record) => {
         if (record.editable) {
@@ -262,7 +242,7 @@ export default class TableForm extends PureComponent {
       title: '终端显示价格(¥)',
       dataIndex: 'terminalPrice',
       key: 'terminalPrice',
-      width: '18%',
+      width: '20%',
       align: 'center',
       render: (text, record) => {
         if (record.editable) {
@@ -278,44 +258,6 @@ export default class TableForm extends PureComponent {
         }
         return text;
       },
-    }, {
-      title: '操作',
-      key: 'action',
-      align: 'center',
-      render: (text, record) => {
-        if (!!record.editable && this.state.loading) {
-          return null;
-        }
-        if (record.editable) {
-          if (record.isNew) {
-            return (
-              <span>
-                <a onClick={e => this.saveRow(e, record.key)}>添加</a>
-                <Divider type="vertical" />
-                <Popconfirm title="是否要删除此价格?" onConfirm={() => this.remove(record)}>
-                  <a>删除</a>
-                </Popconfirm>
-              </span>
-            );
-          }
-          return (
-            <span>
-              <a onClick={e => this.saveRow(e, record.key)}>保存</a>
-              <Divider type="vertical" />
-              <a onClick={e => this.cancel(e, record.key)}>取消</a>
-            </span>
-          );
-        }
-        return (
-          <span>
-            <a onClick={e => this.toggleEditable(e, record.key)}>编辑</a>
-            <Divider type="vertical" />
-            <Popconfirm title="是否要删除此价格?" onConfirm={() => this.remove(record)}>
-              <a>删除</a>
-            </Popconfirm>
-          </span>
-        );
-      },
     }];
     /* 二维码选择模态框 */
     const getResourceModal = () => {
@@ -357,14 +299,6 @@ export default class TableForm extends PureComponent {
           }}
         />
         {!this.props.qrDestroy && getResourceModal()}
-        <Button
-          style={{ width: '100%', marginTop: 16, marginBottom: 8 }}
-          type="dashed"
-          onClick={this.newPrice}
-          icon="plus"
-        >
-          新增价格
-        </Button>
       </Fragment>
     );
   }

+ 11 - 27
src/routes/Terminal/User/TerminalList.js

@@ -242,47 +242,42 @@ export default class TerminalListPage extends Component {
       title: '终端编号',
       key: 1,
       dataIndex: 'code',
-      width: '15%',
+      width: '13%',
     }, {
       title: '终端名称',
       key: 2,
       dataIndex: 'name',
-      width: '12%',
+      width: '13%',
     }, {
       title: '所属校区',
       key: 3,
       dataIndex: 'campusName',
       render: text => renderCampusName(text),
-      width: '13%',
-    }, {
-      title: '所属渠道',
-      key: 4,
-      dataIndex: 'merchantName',
-      width: '10%',
+      width: '20%',
     }, {
       title: '账号状态',
-      key: 5,
+      key: 4,
       dataIndex: 'status',
       render: text => renderStatus(text, '已禁用'),
-      width: '8%',
+      width: '7%',
     }, {
       title: '绑定状态',
-      key: 6,
+      key: 5,
       dataIndex: 'deviceStatus',
       render: text => renderBindStatus(text),
-      width: '9%',
+      width: '7%',
     }, {
       title: '更新时间',
-      key: 7,
+      key: 6,
       dataIndex: 'gmtModified',
       render: text => moment(text).format('YYYY-MM-DD HH:mm:ss'),
-      width: '15%',
+      width: '20%',
     }, {
       title: '操作',
-      key: 8,
+      key: 7,
       dataIndex: 'operation',
       render: (_, record) => renderOperation(record),
-      width: '18%',
+      width: '15%',
       align: 'right',
     }];
     return (
@@ -316,17 +311,6 @@ export default class TerminalListPage extends Component {
             onOk={this.handleModalFilterOperation}
           >
             <Form>
-              <Form.Item label="所属商户" {...formItemLayout}>
-                {getFieldDecorator('merchantIds', {
-                    initialValue: [],
-                  })(
-                    <AXRemoteSelect
-                      fetching={fetching1}
-                      dataSource={arrayDataFormatter(merchant.list)}
-                      onSearch={this.handleMerchantRemoteSelectSearch}
-                    />
-                  )}
-              </Form.Item>
               <Form.Item label="所属校区" {...formItemLayout}>
                 {getFieldDecorator('campusIds', {
                     initialValue: [],

+ 0 - 184
src/routes/Terminal/WhiteList/WhiteList.js

@@ -1,184 +0,0 @@
-import React, { Component } from 'react';
-import moment from 'moment';
-import { connect } from 'dva';
-import { routerRedux } from 'dva/router';
-import { Card, Modal, Button, message } from 'antd';
-import { StandardTableList } from '../../../components/AXList';
-import { addRowKey, renderStatus } from '../../../utils/utils';
-import { Hotax } from '../../../utils/config';
-
-const Message = message;
-
-@connect(({ loading, terminal }) => ({
-  terminal,
-  loading: loading.models.terminal,
-}))
-export default class WhiteListPage extends Component {
-  constructor(props) {
-    super(props);
-    const { state } = props.location;
-    this.state = {
-      UIParams: (state || {}).UIParams, // 组件的状态参数
-      Queryers: (state || {}).Queryers, // 查询的条件参数
-    };
-  }
-  componentDidMount() {
-    this.props.dispatch({
-      type: 'terminal/fetchSpecialTerminalList',
-      payload: { ...this.state.Queryers },
-    });
-  }
-  handleCreateOperation = () => {
-    this.props.dispatch(routerRedux.push({
-      pathname: '/terminal/whitelist/create',
-      state: this.state,
-    }));
-  }
-  handleDeleteOperation = (item) => {
-    Modal.confirm({
-      okText: '确定',
-      cancelText: '取消',
-      title: '你确定要删除该白名单用户吗?',
-      content: '删除后该终端账号将不再具有所有课程权限',
-      onOk: () => {
-        this.props.dispatch({
-          type: 'terminal/deleteSpecialTerminalItem',
-          payload: { userId: item.userId },
-          states: this.state,
-        });
-      },
-    });
-  }
-  handleEditOperation = (item) => {
-    this.props.dispatch(routerRedux.push({
-      pathname: `/terminal/whitelist/edit/${item.userId}`,
-      state: {
-        currentItem: item,
-        ...this.state,
-      },
-    }));
-  }
-  handleFilterOperation = (params, states) => {
-    this.props.dispatch({
-      type: 'terminal/fetchSpecialTerminalList',
-      payload: params,
-    });
-    this.setState({
-      UIParams: states,
-      Queryers: params,
-    });
-  }
-  handleBatchOperation = () => {
-    Message.info('暂不支持批量操作!');
-  }
-
-  render() {
-    const { loading, terminal } = this.props;
-    const { list, totalSize, pageSize, pageNo } = terminal;
-
-    const renderOperation = (item) => {
-      return (
-        <div>
-          <Button
-            size="small"
-            disabled={item.status === Hotax.STATUS_DELETE}
-            className="editBtn"
-            onClick={() => this.handleEditOperation(item)}
-          >
-            编辑
-          </Button>
-          <Button
-            size="small"
-            className="delBtn"
-            onClick={() => this.handleDeleteOperation(item)}
-          >
-            删除
-          </Button>
-        </div>
-      );
-    };
-    const batchActions = [{
-      key: 'delete',
-      name: '批量删除',
-    }];
-    const basicSearch = {
-      keys: [{
-        name: '终端编号',
-        field: 'code',
-      }],
-    };
-    const pagination = {
-      pageNo,
-      pageSize,
-      totalSize,
-    };
-    const columns = [{
-      title: '终端编号',
-      key: 1,
-      dataIndex: 'code',
-      width: '15%',
-    }, {
-      title: '所属渠道',
-      key: 2,
-      dataIndex: 'merchantName',
-      width: '13%',
-    }, {
-      title: '起始日期',
-      key: 3,
-      dataIndex: 'startTime',
-      render: text => moment(text).format('YYYY-MM-DD HH:mm:ss'),
-      width: '17%',
-    }, {
-      title: '截止日期',
-      key: 4,
-      dataIndex: 'endTime',
-      render: (text) => {
-        if (text) {
-          return moment(text).format('YYYY-MM-DD HH:mm:ss');
-        } else {
-          return '永久';
-        }
-      },
-      width: '17%',
-    }, {
-      title: '状态',
-      key: 5,
-      dataIndex: 'status',
-      render: text => renderStatus(text),
-      width: '10%',
-    }, {
-      title: '更新时间',
-      key: 6,
-      dataIndex: 'gmtModified',
-      render: text => moment(text).format('YYYY-MM-DD HH:mm:ss'),
-      width: '15%',
-    }, {
-      title: '操作',
-      key: 7,
-      dataIndex: 'operation',
-      render: (_, record) => renderOperation(record),
-      width: '13%',
-      align: 'right',
-    }];
-    return (
-      <Card>
-        <StandardTableList
-          columns={columns}
-          loading={loading}
-          dataSource={addRowKey(list)}
-          header={{
-            basicSearch,
-            onFilterClick: this.handleFilterOperation,
-            onCreateClick: this.handleCreateOperation,
-          }}
-          footer={{
-            pagination,
-            batchActions,
-            onBatchClick: this.handleBatchOperation,
-          }}
-          keepUIState={{ ...this.state.UIParams }}
-        />
-      </Card>
-    );
-  }
-}

+ 0 - 222
src/routes/Terminal/WhiteList/WhiteListCreate.js

@@ -1,222 +0,0 @@
-/* eslint-disable no-param-reassign,no-trailing-spaces */
-import React, { Component } from 'react';
-import pathToRegexp from 'path-to-regexp';
-import moment from 'moment';
-import { Card, Modal, Form, DatePicker, Button, List } from 'antd';
-import { connect } from 'dva';
-import { routerRedux } from 'dva/router';
-import Selector from '../../../components/AXTableSelector/Selector';
-import FooterToolbar from '../../../components/FooterToolbar';
-import { Hotax } from '../../../utils/config';
-
-const formItemLayout = {
-  labelCol: {
-    xs: { span: 24 },
-    sm: { span: 9 },
-  },
-  wrapperCol: {
-    xs: { span: 24 },
-    sm: { span: 14 },
-    md: { span: 10 },
-  },
-};
-
-@Form.create()
-@connect(({ loading, terminal }) => ({
-  terminal,
-  tLoading: loading.models.terminal,
-}))
-export default class WhiteListCreatePage extends Component {
-  state = {
-    terminalSelectorDestroy: true,
-  };
-  componentDidMount() {
-    const matchId = this.isEdit();
-    if (matchId) {
-      this.props.dispatch({
-        type: 'terminal/fetchSpecialTerminalItem',
-        payload: { userId: matchId },
-      });
-    } else {
-      this.props.dispatch({
-        type: 'terminal/fetchTerminalList',
-        payload: {},
-      });
-    }
-  }
-  componentWillUnmount() {
-    this.props.dispatch({
-      type: 'terminal/cleanState',
-    });
-  }
-  handleTerminalSelectorModalShow = () => {
-    this.setState({
-      terminalSelectorDestroy: false,
-    });
-    this.props.dispatch({
-      type: 'terminal/fetchTerminalList',
-      payload: {},
-    });
-  }
-  handleTerminalSelectorFinish = (rows) => {
-    this.setState({
-      terminalSelectorDestroy: true,
-    });
-    if (!rows || !rows.length) {
-      return;
-    }
-    const { id, code, merchantName } = rows[0];
-    this.props.dispatch({
-      type: 'terminal/fixCurrentItem',
-      payload: {
-        code,
-        merchantName,
-        userId: id,
-      },
-    });
-  };
-  handleTerminalSelectorCancel = () => {
-    this.setState({
-      terminalSelectorDestroy: true,
-    });
-  };
-  handleTerminalSelectorChange = (params) => {
-    this.props.dispatch({
-      type: 'terminal/fetchTerminalList',
-      payload: params,
-    });
-  }
-  isEdit = () => {
-    const { location } = this.props;
-    const match = pathToRegexp('/terminal/whitelist/edit/:id').exec(location.pathname);
-    if (match) {
-      return match[1];
-    }
-    return false;
-  }
-  handlePageSubmit = () => {
-    this.props.form.validateFieldsAndScroll((error, values) => {
-      if (!error) {
-        const { terminal } = this.props;
-        const { currentItem } = terminal;
-        const { id, code, userId, status } = currentItem;
-        values = { id, code, userId, status, ...values };
-        // 编辑模式
-        if (this.isEdit()) {
-          this.props.dispatch({
-            type: 'terminal/updateSpecialTerminalItem',
-            payload: values,
-            states: this.props.location.state,
-          });
-        // 创建模式
-        } else {
-          delete values.id;
-          values.status = Hotax.STATUS_NORMAL;
-          this.props.dispatch({
-            type: 'terminal/createSpecialTerminalItem',
-            payload: values,
-            states: this.props.location.state,
-          });
-        }
-      }
-    });
-  }
-  handlePageBack = () => {
-    this.props.dispatch(routerRedux.push({
-      pathname: '/terminal/whitelist',
-      state: this.props.location.state,
-    }));
-  }
-
-  render() {
-    const { terminalSelectorDestroy } = this.state;
-    const { form, tLoading, terminal } = this.props;
-    const { getFieldDecorator } = form;
-    const { currentItem } = terminal;
-    const { code, merchantName, startTime, endTime } = currentItem;
-
-    const getTerminalModal = () => {
-      return (
-        <Modal
-          visible
-          width={1100}
-          footer={null}
-          title="终端列表"
-          maskClosable={false}
-          onCancel={this.handleTerminalSelectorCancel}
-        >
-          <Selector
-            multiple={false}
-            loading={tLoading}
-            selectorName="Terminal"
-            list={terminal.list}
-            pageNo={terminal.pageNo}
-            pageSize={terminal.pageSize}
-            totalSize={terminal.totalSize}
-            onCancel={this.handleTerminalSelectorCancel}
-            onChange={this.handleTerminalSelectorChange}
-            onFinish={this.handleTerminalSelectorFinish}
-          />
-        </Modal>
-      );
-    };
-
-    return (
-      <div>
-        <Card title={this.isEdit() ? '编辑白名单' : '创建白名单'} style={{ marginBottom: 70 }}>
-          <Form>
-            <Form.Item
-              label={!this.isEdit() ? <a onClick={this.handleTerminalSelectorModalShow}>选择终端</a> : '终端账号'}
-              {...formItemLayout}
-            >
-              <List
-                bordered
-                size="small"
-                dataSource={[
-                  `终端编号: ${code || ''}`,
-                  `所属渠道: ${merchantName || ''}`,
-                ]}
-                renderItem={item => <List.Item>{item}</List.Item>}
-                style={{ width: 280 }}
-              />
-            </Form.Item>
-            <Form.Item label="起始日期" {...formItemLayout}>
-              {getFieldDecorator('startTime', {
-                rules: [{ required: true, message: '请选择起始日期' }],
-                initialValue: startTime && moment(startTime),
-              })(
-                <DatePicker
-                  showTime
-                  placeholder="选择日期时间"
-                  format="YYYY-MM-DD HH:mm:ss"
-                  style={{ width: 280 }}
-                />
-              )}
-            </Form.Item>
-            <Form.Item label="截止日期" {...formItemLayout}>
-              {getFieldDecorator('endTime', {
-                initialValue: endTime && moment(endTime),
-              })(
-                <DatePicker
-                  showTime
-                  placeholder="选择日期时间"
-                  format="YYYY-MM-DD HH:mm:ss"
-                  style={{ width: 280 }}
-                />
-              )}
-            </Form.Item>
-          </Form>
-          {!terminalSelectorDestroy && getTerminalModal()}
-        </Card>
-        <FooterToolbar style={{ width: '100%' }}>
-          <Button onClick={this.handlePageBack} style={{ marginRight: 10 }}>
-            取消
-          </Button>
-          <Button type="primary" onClick={this.handlePageSubmit}>
-            提交
-          </Button>
-        </FooterToolbar>
-      </div>
-    );
-  }
-}

+ 0 - 55
src/routes/Terminal/WhiteList/WhiteListCreate.less

@@ -1,55 +0,0 @@
-@import "~antd/lib/style/themes/default.less";
-
-.cardItem {
-  :global {
-    .ant-card-head {
-      padding-left: 16px;
-    }
-  }
-}
-
-.errorIcon {
-  cursor: pointer;
-  color: @error-color;
-  margin-right: 24px;
-  i {
-    margin-right: 4px;
-  }
-}
-
-.errorPopover {
-  :global {
-    .ant-popover-inner-content {
-      padding: 0;
-      max-height: 290px;
-      overflow: auto;
-      min-width: 256px;
-    }
-  }
-}
-
-.errorListItem {
-  list-style: none;
-  border-bottom: 1px solid @border-color-split;
-  padding: 8px 16px;
-  cursor: pointer;
-  transition: all .3s;
-  &:hover {
-    background: @primary-1;
-  }
-  &:last-child {
-    border: 0;
-  }
-  .errorIcon {
-    color: @error-color;
-    float: left;
-    margin-top: 4px;
-    margin-right: 12px;
-    padding-bottom: 22px;
-  }
-  .errorField {
-    font-size: 12px;
-    color: @text-color-secondary;
-    margin-top: 2px;
-  }
-}

+ 0 - 33
src/routes/Terminal/WhiteList/index.js

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

+ 2 - 18
src/routes/Trade/ShopCart/ShopCartList.js

@@ -160,7 +160,7 @@ export default class ShopCartListPage extends Component {
       title: '终端编号',
       key: 1,
       dataIndex: 'code',
-      width: '15%',
+      width: '20%',
     }, {
       title: '终端名称',
       key: 2,
@@ -173,11 +173,6 @@ export default class ShopCartListPage extends Component {
       render: text => renderCampusName(text),
       width: '25%',
     }, {
-      title: '所属渠道',
-      key: 4,
-      dataIndex: 'merchantName',
-      width: '11%',
-    }, {
       title: '账号状态',
       key: 5,
       dataIndex: 'status',
@@ -188,7 +183,7 @@ export default class ShopCartListPage extends Component {
       key: 6,
       dataIndex: 'gmtModified',
       render: text => moment(text).format('YYYY-MM-DD HH:mm:ss'),
-      width: '15%',
+      width: '20%',
     }, {
       title: '操作',
       key: 7,
@@ -228,17 +223,6 @@ export default class ShopCartListPage extends Component {
             onOk={this.handleModalFilterOperation}
           >
             <Form>
-              <Form.Item label="所属商户" {...formItemLayout}>
-                {getFieldDecorator('merchantIds', {
-                  initialValue: [],
-                })(
-                  <AXRemoteSelect
-                    fetching={fetching1}
-                    dataSource={arrayDataFormatter(merchant.list)}
-                    onSearch={this.handleMerchantRemoteSelectSearch}
-                  />
-                )}
-              </Form.Item>
               <Form.Item label="所属校区" {...formItemLayout}>
                 {getFieldDecorator('campusIds', {
                   initialValue: [],