瀏覽代碼

Merge branch 'dev' of http://git.ycjcjy.com/zhiyuxing/estateagents-admin-manager into dev

xujing 5 年之前
父節點
當前提交
e05caa6068
共有 3 個檔案被更改,包括 60 行新增42 行删除
  1. 4
    4
      src/components/ActionList/index.jsx
  2. 26
    6
      src/components/ActionList/style.less
  3. 30
    32
      src/pages/activity/helpActivity/list.jsx

+ 4
- 4
src/components/ActionList/index.jsx 查看文件

@@ -1,7 +1,7 @@
1 1
 import React from 'react';
2 2
 import { Menu, Dropdown, Icon } from 'antd';
3 3
 
4
-import styles from './style.less';
4
+import './style.less';
5 5
 
6 6
 export default function withActions(actionsRender) {
7 7
   return function ActionList(text, record) {
@@ -9,13 +9,13 @@ export default function withActions(actionsRender) {
9 9
     const [Act1, Act2, Act3, ...leftActs] = actions || [];
10 10
 
11 11
     const menus = (
12
-      <Menu>
12
+      <Menu className="actlist-menu">
13 13
         {(leftActs || []).map((Act, index) => (<Menu.Item key={`dm-${index}`}>{Act}</Menu.Item>))}
14 14
       </Menu>
15 15
     );
16 16
 
17 17
     return (
18
-      <div className={styles['action-list']}>
18
+      <div className="action-list">
19 19
         {
20 20
           Act1 && <span>{Act1}</span>
21 21
         }
@@ -31,7 +31,7 @@ export default function withActions(actionsRender) {
31 31
             <span>
32 32
               <Dropdown overlay={menus} trigger={['click']}>
33 33
                 <a onClick={e => e.preventDefault()}>
34
-                  更多 <Icon type="down" />
34
+                  <span>更多</span> <Icon type="down" />
35 35
                 </a>
36 36
               </Dropdown>
37 37
             </span>

+ 26
- 6
src/components/ActionList/style.less 查看文件

@@ -1,11 +1,31 @@
1 1
 
2
-.action-list {
3
-  display: inline-block;
4
-
5
-  span {
2
+:global{
3
+  .action-list {
6 4
     display: inline-block;
7
-    & + span {
8
-      margin-left: 16px;
5
+  
6
+    span {
7
+      display: inline-block;
8
+      & + span {
9
+        margin-left: 16px;
10
+      }
11
+  
12
+      a {
13
+        color: #666;
14
+  
15
+        span {
16
+          color: #FF4A4A;
17
+        }
18
+      }
19
+    }
20
+  }
21
+  
22
+  .actlist-menu {
23
+    .ant-dropdown-menu-item {
24
+      color: #666 !important;
25
+
26
+      &:hover {
27
+        background-color: rgba(0,0,0, .1);
28
+      }
9 29
     }
10 30
   }
11 31
 }

+ 30
- 32
src/pages/activity/helpActivity/list.jsx 查看文件

@@ -1,25 +1,24 @@
1 1
 import React, { useState, useEffect } from 'react';
2
-import { Form, Input, Button, Icon, Select, message, Table, Divider, Tag, Pagination, Modal, DatePicker } from 'antd';
3
-import { FormattedMessage } from 'umi-plugin-react/locale';
4
-import styles from '../../style/GoodsList.less';
2
+import { Form, Input, Button, Icon, Select, message, Table, Pagination, Modal, DatePicker } from 'antd';
5 3
 import router from 'umi/router';
6 4
 import moment from 'moment';
5
+import AuthButton from '@/components/AuthButton';
6
+import withActions from '@/components/ActionList';
7
+import EditIcon from '@/components/EditIcon';
8
+import Prompt from 'umi/prompt';
7 9
 import SelectCity from '../../../components/SelectButton/CitySelect'
8 10
 import BuildSelect from '../../../components/SelectButton/BuildSelect'
9 11
 import apis from '../../../services/apis';
10 12
 import request from '../../../utils/request';
11
-import AuthButton from '@/components/AuthButton';
12
-import Prompt from 'umi/prompt';
13
+import styles from '../../style/GoodsList.less';
13 14
 
14 15
 const { Option } = Select;
15
-const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
16 16
 
17 17
 const header = props => {
18 18
   const [data, setData] = useState({})
19 19
   //   const [page, changePage] = useState({})
20 20
 
21 21
   useEffect(() => {
22
-
23 22
     if (localStorage.getItem("helpActivePageParams")) {
24 23
       props.form.setFieldsValue(JSON.parse(localStorage.getItem("helpActivePageParams")));
25 24
       // const { getFieldDecorator } = JSON.parse(localStorage.getItem("pageParams"))
@@ -128,32 +127,31 @@ const header = props => {
128 127
       dataIndex: 'handle',
129 128
       key: 'handle',
130 129
       align: 'center',
131
-      render: (x, row) => (
132
-        <>
133
-          {
134
-            <AuthButton name="admin.help.publish" noRight={null}>
135
-              <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={sendOrPublicDynamic.bind(this, row)}>{row.status === 1 ? '取消发布' : '发布'}<Icon type="close-circle" className={styles.edit} /></span>
136
-            </AuthButton>
137
-          }
138
-          {row.activityStatus === 0 &&
139
-            <AuthButton name="admin.help.finish" noRight={null}>
140
-              <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row, 2)}>结束活动<Icon type="poweroff" style={{ color: '#bebebe' }} className={styles.edit} /></span> </AuthButton>
141
-          }
142
-          {
143
-            <AuthButton name="admin.help.tag" noRight={null}>
144
-              <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row, 0)}>{row.weight === 1 ? '取消标签' : '添加标签'}<Icon type="vertical-align-top" style={{ color: '#bebebe' }} className={styles.edit} /></span>
145
-            </AuthButton>}{
146
-            <AuthButton name="admin.help.top" noRight={null}>
147
-              <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row, 1)}>{row.isMain === true ? '取消推首页' : '推首页'}<Icon type="vertical-align-top" style={{ color: '#bebebe' }} className={styles.edit} /></span>
148
-            </AuthButton>}
149
-          {<span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={() => toDataReacord(row.helpActivityId)}>数据记录<Icon type="form" className={styles.edit} /></span>}
150
-          {(row.activityStatus === 1 || row.activityStatus === 0) &&
130
+      render: withActions((x, row) => [
131
+        <AuthButton name="admin.help.publish" noRight={null}>
132
+          <EditIcon type={row.status === 1 ? 'cancel' : 'publish'} text={row.status === 1 ? '取消发布' : '发布'} onClick={sendOrPublicDynamic.bind(this, row)} />
133
+        </AuthButton>,
134
+
135
+        row.activityStatus === 0 ?
136
+          <AuthButton name="admin.help.finish" noRight={null}>
137
+            <EditIcon type="end" text="结束活动" onClick={topDynamic(row, 2)} />
138
+          </AuthButton> : null,
139
+
140
+        <AuthButton name="admin.help.tag" noRight={null}>
141
+          <EditIcon type={row.weight === 1 ? 'cancel' : 'add'} text={row.weight === 1 ? '取消标签' : '添加标签'} onClick={topDynamic(row, 0)} />
142
+        </AuthButton>,
143
+
144
+        <AuthButton name="admin.help.top" noRight={null}>
145
+          <EditIcon type={row.isMain === 1 ? 'cancel' : 'add'} color="#666" text={row.isMain === 1 ? '取消推首页' : '推首页'} onClick={topDynamic(row, 1)} />
146
+        </AuthButton>,
147
+
148
+        <EditIcon type="record" text="数据记录" color="#666" onClick={() => toDataReacord(row.helpActivityId)} />,
149
+
150
+        (row.activityStatus === 1 || row.activityStatus === 0) ?
151 151
             <AuthButton name="admin.helpActivity.update.put" noRight={null}>
152
-              <span style={{ color: '#FF925C', marginRight: '20px', cursor: 'pointer' }} onClick={toEditGoods(row.helpActivityId)}>编辑<Icon type="form" style={{ color: '#bebebe' }} className={styles.edit} /></span>
153
-            </AuthButton>
154
-          }
155
-        </>
156
-      ),
152
+              <EditIcon color="#666" type="edit" text="编辑" onClick={toEditGoods(row.helpActivityId)} />
153
+            </AuthButton> : null,
154
+      ]),
157 155
     },
158 156
   ];
159 157