Преглед на файлове

:fire: 渠道标签组概念,用标签类型替代

zhanghe преди 6 години
родител
ревизия
d743c03cdc
променени са 4 файла, в които са добавени 15 реда и са изтрити 82 реда
  1. 0 3
      src/common/menu.js
  2. 2 14
      src/common/router.js
  3. 9 50
      src/routes/Frontend/Tag/TagCreate.js
  4. 4 15
      src/routes/Frontend/Tag/TagList.js

+ 0 - 3
src/common/menu.js

@@ -82,9 +82,6 @@ const menuData = () => {
     icon: 'android-o',
     path: 'frontend',
     children: [{
-      name: '首页入口',
-      path: 'tagGroup',
-    }, {
       name: '栏目类型',
       path: 'tagType',
     }, {

+ 2 - 14
src/common/router.js

@@ -311,18 +311,6 @@ export const getRouterData = (app) => {
       component: dynamicWrapper(app, ['shelves', 'resource'], () => import('../routes/Shelves/ShelvesEdit')),
     },
     // 前端管理相关路由注册
-    '/frontend/tagGroup': {
-      component: dynamicWrapper(app, ['tagGroup'], () => import('../routes/Frontend/TagGroup')),
-    },
-    '/frontend/tagGroup/list': {
-      component: dynamicWrapper(app, ['tagGroup'], () => import('../routes/Frontend/TagGroup/TagGroupList')),
-    },
-    '/frontend/tagGroup/create': {
-      component: dynamicWrapper(app, ['tagGroup', 'merchant'], () => import('../routes/Frontend/TagGroup/TagGroupCreate')),
-    },
-    '/frontend/tagGroup/edit/:id': {
-      component: dynamicWrapper(app, ['tagGroup', 'merchant'], () => import('../routes/Frontend/TagGroup/TagGroupCreate')),
-    },
     '/frontend/tagType': {
       component: dynamicWrapper(app, ['tagType'], () => import('../routes/Frontend/TagType')),
     },
@@ -342,10 +330,10 @@ export const getRouterData = (app) => {
       component: dynamicWrapper(app, ['tag'], () => import('../routes/Frontend/Tag/TagList')),
     },
     '/frontend/tag/create': {
-      component: dynamicWrapper(app, ['tag', 'tagGroup', 'shelves'], () => import('../routes/Frontend/Tag/TagCreate')),
+      component: dynamicWrapper(app, ['tag', 'shelves'], () => import('../routes/Frontend/Tag/TagCreate')),
     },
     '/frontend/tag/edit/:id': {
-      component: dynamicWrapper(app, ['tag', 'tagGroup', 'shelves'], () => import('../routes/Frontend/Tag/TagCreate')),
+      component: dynamicWrapper(app, ['tag', 'shelves'], () => import('../routes/Frontend/Tag/TagCreate')),
     },
     '/frontend/recommend': {
       component: dynamicWrapper(app, ['merchant'], () => import('../routes/Frontend/Recommend')),

+ 9 - 50
src/routes/Frontend/Tag/TagCreate.js

@@ -23,23 +23,20 @@ const formItemLayout = {
   },
 };
 
-@connect(({ loading, tag, tagGroup, shelves, tagType, merchant }) => ({
+@connect(({ loading, tag, 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',
@@ -85,12 +82,6 @@ export default class TagCreatePage extends Component {
           payload: params,
         });
         break;
-      case 'tagGroup':
-        this.props.dispatch({
-          type: 'tagGroup/fetchTagGroupList',
-          payload: params,
-        });
-        break;
       case 'tagType':
         this.props.dispatch({
           type: 'tagType/fetchTagTypeList',
@@ -130,9 +121,6 @@ export default class TagCreatePage extends Component {
     }
     let payload;
     switch (flag) {
-      case 'tagGroup':
-        payload = { groupId: rows[0].id, groupName: rows[0].name };
-        break;
       case 'tagType':
         payload = { typeCode: rows[0].code };
         break;
@@ -203,7 +191,7 @@ export default class TagCreatePage extends Component {
         const { name, status } = values;
         const { tag } = this.props;
         const { currentItem } = tag;
-        const { productList = [], groupId, typeCode } = currentItem;
+        const { productList = [], groupId, merchantId, typeCode } = currentItem;
         const id = this.isEdit();
         if (id) {
           this.props.dispatch({
@@ -211,8 +199,8 @@ export default class TagCreatePage extends Component {
             payload: {
               id,
               name,
-              groupId,
               typeCode,
+              merchantId,
               status: boolToStatus(status),
               productList: productList.map(item => item.pid),
             },
@@ -225,6 +213,7 @@ export default class TagCreatePage extends Component {
               name,
               groupId,
               typeCode,
+              merchantId,
               status: boolToStatus(status),
               productList: productList.map(item => item.pid),
             },
@@ -237,15 +226,15 @@ export default class TagCreatePage extends Component {
 
   render() {
     const {
-      form, submitting, mLoading, tLoading, ttLoading,
-      sLoading, shelves, tag, tagGroup, tagType, merchant,
+      form, submitting, mLoading, ttLoading,
+      sLoading, shelves, tag, tagType, merchant,
     } = this.props;
     const {
-      shelvesSelectorDestroy, tagGroupSelectorDestroy,
-      merchantSelectorDestroy, tagTypeSelectorDestroy, productType,
+      shelvesSelectorDestroy, merchantSelectorDestroy,
+      tagTypeSelectorDestroy, productType,
     } = this.state;
     const { currentItem } = tag;
-    const { status, typeCode, name, groupName, merchantName, productList = [] } = currentItem;
+    const { status, typeCode, name, merchantName, productList = [] } = currentItem;
     const { getFieldDecorator } = form;
 
     const tagMetaData = [{
@@ -253,10 +242,6 @@ export default class TagCreatePage extends Component {
       value: typeCode,
       key: 'tagType',
     }, {
-      fieldName: '所属标签组:',
-      value: groupName,
-      key: 'tagGroup',
-    }, {
       fieldName: '所属渠道:',
       value: merchantName,
       key: 'merchant',
@@ -327,31 +312,6 @@ export default class TagCreatePage extends Component {
         </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
@@ -440,7 +400,6 @@ export default class TagCreatePage extends Component {
             columns={tagMetaColumns}
             dataSource={tagMetaData}
           />
-          {!tagGroupSelectorDestroy && getTagGroupModal()}
           {!tagTypeSelectorDestroy && getTagTypeModal()}
           {!merchantSelectorDestroy && getMerchantModal()}
         </Card>

+ 4 - 15
src/routes/Frontend/Tag/TagList.js

@@ -110,39 +110,28 @@ export default class TagListPage extends Component {
     };
     const columns = [{
       title: '标签名称',
-      key: 1,
       dataIndex: 'name',
-      width: '15%',
+      width: '20%',
     }, {
       title: '标签类型',
-      key: 2,
       dataIndex: 'typeCode',
-      width: '15%',
-    }, {
-      title: '所属标签组',
-      key: 3,
-      dataIndex: 'groupName',
-      width: '15%',
+      width: '20%',
     }, {
       title: '所属渠道',
-      key: 4,
       dataIndex: 'merchantName',
-      width: '12%',
+      width: '20%',
     }, {
       title: '标签状态',
-      key: 5,
       dataIndex: 'status',
       render: text => renderStatus(text),
-      width: '10%',
+      width: '12%',
     }, {
       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',