Browse Source

Merge branch 'dev' of http://git.ycjcjy.com/estateagents/pc-channel into dev

魏超 4 years ago
parent
commit
f8d40fe394

+ 2
- 4
src/pages/fundManagement/Finance.jsx View File

182
                     </Button>
182
                     </Button>
183
                 </Form.Item>
183
                 </Form.Item>
184
             </Form>
184
             </Form>
185
-            <div style={{ margin: '10px 0 16px 0' }}>
186
-                {/* <Button type="danger" className={styles.addBtn} style={{ padding: '0' }} > */}
187
-                    <SelectContact type="danger" onClick={() => getList({ pageNum: 1, pageSize: 10 })} />
188
-                    {/* </Button> */}
185
+            <div style={{ margin: '10px 0 16px 0', display: 'flex' }}>
186
+                <SelectContact type="danger" onClick={() => getList({ pageNum: 1, pageSize: 10 })} />
189
                 <Button type="primary" className={styles.addBtn} onClick={() => toDel()} style={{ marginLeft: '30px' }} >删除</Button>
187
                 <Button type="primary" className={styles.addBtn} onClick={() => toDel()} style={{ marginLeft: '30px' }} >删除</Button>
190
             </div>
188
             </div>
191
             <Table rowSelection={rowSelection} rowKey={r => r.contactId} dataSource={data.records} columns={columns} pagination={false} />
189
             <Table rowSelection={rowSelection} rowKey={r => r.contactId} dataSource={data.records} columns={columns} pagination={false} />

+ 1
- 1
src/pages/sample/h5/components/H5Sample.jsx View File

146
                     </Form.Item>
146
                     </Form.Item>
147
                 </Form>
147
                 </Form>
148
 
148
 
149
-                <Table dataSource={data.records || []} columns={columns} pagination={false} />
149
+                <Table rowKey={r => r.h5TemplateId}  dataSource={data.records || []} columns={columns} pagination={false} />
150
                 <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
150
                 <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
151
                     <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current} />
151
                     <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current} />
152
                 </div>
152
                 </div>

+ 32
- 32
src/pages/sample/h5/index.jsx View File

1
 import React, { useState, useEffect } from 'react';
1
 import React, { useState, useEffect } from 'react';
2
 import { PageHeaderWrapper } from '@ant-design/pro-layout';
2
 import { PageHeaderWrapper } from '@ant-design/pro-layout';
3
-import { Form, Pagination, Card, Button, Icon, Tooltip, message,   notification, Modal, Table, Select,Input, DatePicker,Row, Col  } from 'antd';
3
+import { Form, Pagination, Card, Button, Icon, Tooltip, message, notification, Modal, Table, Select, Input, DatePicker, Row, Col } from 'antd';
4
 import router from 'umi/router';
4
 import router from 'umi/router';
5
 import moment from 'moment';
5
 import moment from 'moment';
6
 import className from 'classnames';
6
 import className from 'classnames';
15
 
15
 
16
 function header(props) {
16
 function header(props) {
17
   // 获取初始化数据
17
   // 获取初始化数据
18
-  const [ data, setData ] = useState({})
18
+  const [data, setData] = useState({})
19
 
19
 
20
   useEffect(() => {
20
   useEffect(() => {
21
     getList({ pageNum: 1, pageSize: 12 });
21
     getList({ pageNum: 1, pageSize: 12 });
22
-  },[])
22
+  }, [])
23
 
23
 
24
   // 查询列表
24
   // 查询列表
25
   const getList = (params) => {
25
   const getList = (params) => {
26
     request({ ...apis.sample.h5list, params: { ...params } }).then((data) => {
26
     request({ ...apis.sample.h5list, params: { ...params } }).then((data) => {
27
-        console.log(data)
28
-        setData(data)
27
+      console.log(data)
28
+      setData(data)
29
     })
29
     })
30
   }
30
   }
31
 
31
 
32
-  
32
+
33
   // 提交事件
33
   // 提交事件
34
   const handleSubmit = (e, props) => {
34
   const handleSubmit = (e, props) => {
35
     e.preventDefault();
35
     e.preventDefault();
36
     e.stopPropagation();
36
     e.stopPropagation();
37
     props.form.validateFields((err, values) => {
37
     props.form.validateFields((err, values) => {
38
       if (!err) {
38
       if (!err) {
39
-        let {createDate, ...submitValue} = values
40
-        if(null != createDate && createDate.length > 0){
39
+        let { createDate, ...submitValue } = values
40
+        if (null != createDate && createDate.length > 0) {
41
           const [startCreateDate, endCreateDate] = createDate
41
           const [startCreateDate, endCreateDate] = createDate
42
           submitValue.startCreateDate = moment(startCreateDate).format('YYYY-MM-DD');
42
           submitValue.startCreateDate = moment(startCreateDate).format('YYYY-MM-DD');
43
           submitValue.endCreateDate = moment(endCreateDate).format('YYYY-MM-DD');
43
           submitValue.endCreateDate = moment(endCreateDate).format('YYYY-MM-DD');
44
-        }else{
44
+        } else {
45
           submitValue.startCreateDate = null
45
           submitValue.startCreateDate = null
46
           submitValue.endCreateDate = null
46
           submitValue.endCreateDate = null
47
         }
47
         }
51
   }
51
   }
52
 
52
 
53
   const changePageNum = (pageNumber) => {
53
   const changePageNum = (pageNumber) => {
54
-    let {createDate, ...submitValue} = props.form.getFieldsValue()
55
-    if(null != createDate && createDate.length > 0){
54
+    let { createDate, ...submitValue } = props.form.getFieldsValue()
55
+    if (null != createDate && createDate.length > 0) {
56
       const [startCreateDate, endCreateDate] = createDate
56
       const [startCreateDate, endCreateDate] = createDate
57
       submitValue.startCreateDate = moment(startCreateDate).format('YYYY-MM-DD');
57
       submitValue.startCreateDate = moment(startCreateDate).format('YYYY-MM-DD');
58
       submitValue.endCreateDate = moment(endCreateDate).format('YYYY-MM-DD');
58
       submitValue.endCreateDate = moment(endCreateDate).format('YYYY-MM-DD');
59
-    }else{
59
+    } else {
60
       submitValue.startCreateDate = null
60
       submitValue.startCreateDate = null
61
       submitValue.endCreateDate = null
61
       submitValue.endCreateDate = null
62
     }
62
     }
74
     });
74
     });
75
   }
75
   }
76
 
76
 
77
-  
77
+
78
   const changeNewsStatus = (row, newsId) => () => {
78
   const changeNewsStatus = (row, newsId) => () => {
79
-    const title = row.status === 0 ? '确定启用吗': '停用后,此账号将无法登录渠道代理商后台'
79
+    const title = row.status === 0 ? '确定启用吗' : '停用后,此账号将无法登录渠道代理商后台'
80
     Modal.confirm({
80
     Modal.confirm({
81
       title: title,
81
       title: title,
82
       okText: '确认',
82
       okText: '确认',
83
       cancelText: '取消',
83
       cancelText: '取消',
84
       onOk() {
84
       onOk() {
85
-        if(row.status === 0){
85
+        if (row.status === 0) {
86
           request({ ...apis.channel.put, urlData: { id: newsId }, data: { ...row, status: 1 } }).then((data) => {
86
           request({ ...apis.channel.put, urlData: { id: newsId }, data: { ...row, status: 1 } }).then((data) => {
87
             message.info('操作成功!')
87
             message.info('操作成功!')
88
             getList({ pageNum: 1, pageSize: 12 });
88
             getList({ pageNum: 1, pageSize: 12 });
90
             console.log(err)
90
             console.log(err)
91
             message.info(err.msg || err.message)
91
             message.info(err.msg || err.message)
92
           })
92
           })
93
-        }else{
93
+        } else {
94
           request({ ...apis.channel.put, urlData: { id: newsId }, data: { ...row, status: 0 } }).then((data) => {
94
           request({ ...apis.channel.put, urlData: { id: newsId }, data: { ...row, status: 0 } }).then((data) => {
95
             message.info('操作成功!')
95
             message.info('操作成功!')
96
             getList({ pageNum: 1, pageSize: 12 });
96
             getList({ pageNum: 1, pageSize: 12 });
99
             message.info(err.msg || err.message)
99
             message.info(err.msg || err.message)
100
           })
100
           })
101
         }
101
         }
102
-        
102
+
103
       }
103
       }
104
     });
104
     });
105
   }
105
   }
106
-   
106
+
107
   function handleReset() {
107
   function handleReset() {
108
     props.form.resetFields();
108
     props.form.resetFields();
109
     getList({ pageNum: 1, pageSize: 12 })
109
     getList({ pageNum: 1, pageSize: 12 })
113
   return (
113
   return (
114
 
114
 
115
     <>
115
     <>
116
-    <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
116
+      <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
117
         <Form.Item>
117
         <Form.Item>
118
           {getFieldDecorator('sampleName')(
118
           {getFieldDecorator('sampleName')(
119
             <Input
119
             <Input
131
           )}
131
           )}
132
         </Form.Item>
132
         </Form.Item>
133
         <Form.Item>
133
         <Form.Item>
134
-            <span style={{marginRight:'10px'}}>新增时间段:</span>
135
-                {getFieldDecorator('createDate')(
136
-                  <RangePicker placeholder={['开始时间','结束时间']} />
137
-                )}
134
+          <span style={{ marginRight: '10px' }}>新增时间段:</span>
135
+          {getFieldDecorator('createDate')(
136
+            <RangePicker placeholder={['开始时间', '结束时间']} />
137
+          )}
138
         </Form.Item>
138
         </Form.Item>
139
         <Form.Item>
139
         <Form.Item>
140
           {getFieldDecorator('tag')(
140
           {getFieldDecorator('tag')(
149
             搜索
149
             搜索
150
           </Button>
150
           </Button>
151
           <Button style={{ marginLeft: 8 }} onClick={handleReset}>
151
           <Button style={{ marginLeft: 8 }} onClick={handleReset}>
152
-              重置
152
+            重置
153
           </Button>
153
           </Button>
154
         </Form.Item>
154
         </Form.Item>
155
       </Form>
155
       </Form>
156
-      
156
+
157
       <Button type="danger" className={styles.addBtn} onClick={toEditH5()}>新增</Button>
157
       <Button type="danger" className={styles.addBtn} onClick={toEditH5()}>新增</Button>
158
-      <Row>      
159
-          {(data.records || []).map(x => (
160
-              <Col span={6}>
161
-                <H5Card h5Data={x} onChange={handleReset}/>
162
-              </Col>
163
-            ))}
158
+      <Row>
159
+        {(data.records || []).map((x, index) => (
160
+          <Col key={index} span={6}>
161
+            <H5Card h5Data={x} onChange={handleReset} />
162
+          </Col>
163
+        ))}
164
       </Row>
164
       </Row>
165
       <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
165
       <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
166
-        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current}/>
166
+        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current} />
167
       </div>
167
       </div>
168
     </>
168
     </>
169
   )
169
   )