zlisen 3 years ago
parent
commit
b72a4c398f

+ 1
- 1
config/proxy.js View File

9
   dev: {
9
   dev: {
10
     '/api/': {
10
     '/api/': {
11
       target: 'https://xlk.njyz.tech/',
11
       target: 'https://xlk.njyz.tech/',
12
-      // target: 'http://localhost:8567/',
12
+      // target: 'http://localhost:8081/',
13
       // target: 'https://www.newhousehold.cn',
13
       // target: 'https://www.newhousehold.cn',
14
       changeOrigin: true,
14
       changeOrigin: true,
15
       pathRewrite: {
15
       pathRewrite: {

+ 9
- 5
src/pages/findRoom/addedValueService/index.jsx View File

1
-import React, { PureComponent, useMemo, useState } from 'react';
1
+import React, { PureComponent, useMemo, useRef, useState } from 'react';
2
 import { Avatar, Button } from 'antd';
2
 import { Avatar, Button } from 'antd';
3
 import moment from 'moment';
3
 import moment from 'moment';
4
 import request from '../../../utils/request';
4
 import request from '../../../utils/request';
15
  */
15
  */
16
 
16
 
17
 function Recommend() {
17
 function Recommend() {
18
+
19
+  const ref=useRef()
18
   const [exportLoding, setExportLoding] = useState(false);
20
   const [exportLoding, setExportLoding] = useState(false);
19
   //详情页面弹窗配置
21
   //详情页面弹窗配置
20
   function toAudit(row, type) {
22
   function toAudit(row, type) {
43
   function exportRecommendCustomer() {
45
   function exportRecommendCustomer() {
44
     setExportLoding(true);
46
     setExportLoding(true);
45
     request({
47
     request({
46
-      ...apis.customer.customerRecommendRecommenderExport,
48
+      ...apis.searchHouse.exportHouse,
47
       responseType: 'blob',
49
       responseType: 'blob',
50
+      params: {
51
+        ...ref.current.getSearchData,
52
+      },
48
     })
53
     })
49
       .then(response => {
54
       .then(response => {
50
-        console.log('exportRecommendCustomer: ', response);
51
         download(response);
55
         download(response);
52
       })
56
       })
53
       .catch(error => {});
57
       .catch(error => {});
225
   return (
229
   return (
226
     <>
230
     <>
227
       <QueryTable
231
       <QueryTable
228
-        rowKey="recommendCustomer"
229
-        // recommendCustomer
232
+        rowKey="id"
233
+        ref={ref}
230
         api={apis.searchHouse.list}
234
         api={apis.searchHouse.list}
231
         searchFields={searchFields}
235
         searchFields={searchFields}
232
         columns={columns}
236
         columns={columns}

+ 12
- 7
src/pages/findRoom/buyRoom/index.jsx View File

1
-import React, { PureComponent, useMemo, useState } from 'react';
1
+import React, { PureComponent, useMemo, useRef, useState } from 'react';
2
 import { Avatar, Button } from 'antd';
2
 import { Avatar, Button } from 'antd';
3
 import moment from 'moment';
3
 import moment from 'moment';
4
 import request from '../../../utils/request';
4
 import request from '../../../utils/request';
15
  */
15
  */
16
 
16
 
17
 function Recommend() {
17
 function Recommend() {
18
+
19
+  const ref = useRef()
18
   const [exportLoding, setExportLoding] = useState(false);
20
   const [exportLoding, setExportLoding] = useState(false);
19
   //详情页面弹窗配置
21
   //详情页面弹窗配置
20
   function toAudit(row, type) {
22
   function toAudit(row, type) {
37
   //   }
39
   //   }
38
 
40
 
39
   /**
41
   /**
40
-   *导出数据(推荐用户)
42
+   *导出数据
41
    *
43
    *
42
    */
44
    */
43
   function exportRecommendCustomer() {
45
   function exportRecommendCustomer() {
44
     setExportLoding(true);
46
     setExportLoding(true);
45
     request({
47
     request({
46
-      ...apis.customer.customerRecommendRecommenderExport,
48
+      ...apis.searchHouse.exportHouse,
47
       responseType: 'blob',
49
       responseType: 'blob',
50
+      params:{
51
+        ...ref.current.getSearchData
52
+      }
48
     })
53
     })
49
       .then(response => {
54
       .then(response => {
50
         console.log('exportRecommendCustomer: ', response);
55
         console.log('exportRecommendCustomer: ', response);
210
   ];
215
   ];
211
   const actionRender = () => {
216
   const actionRender = () => {
212
     return (
217
     return (
213
-      <Button type="danger" loading={exportLoding} onClick={() => exportRecommendCustomer()}>
218
+      <Button type='primary' loading={exportLoding} onClick={() => exportRecommendCustomer()}>
214
         导出
219
         导出
215
       </Button>
220
       </Button>
216
     );
221
     );
217
   };
222
   };
218
-
223
+  
219
   return (
224
   return (
220
     <>
225
     <>
221
       <QueryTable
226
       <QueryTable
222
-        rowKey="recommendCustomer"
223
-        // recommendCustomer
227
+        rowKey="id"
228
+        ref={ref}
224
         api={apis.searchHouse.list}
229
         api={apis.searchHouse.list}
225
         searchFields={searchFields}
230
         searchFields={searchFields}
226
         postData={data => {
231
         postData={data => {

+ 11
- 6
src/pages/findRoom/overseas/index.jsx View File

1
-import React, { PureComponent, useMemo, useState } from 'react';
1
+import React, { PureComponent, useMemo, useRef, useState } from 'react';
2
 import { Avatar, Button } from 'antd';
2
 import { Avatar, Button } from 'antd';
3
 import moment from 'moment';
3
 import moment from 'moment';
4
 import request from '../../../utils/request';
4
 import request from '../../../utils/request';
18
 
18
 
19
 
19
 
20
 function Recommend() {
20
 function Recommend() {
21
+
22
+  const ref= useRef()
21
   const [exportLoding, setExportLoding] = useState(false)
23
   const [exportLoding, setExportLoding] = useState(false)
22
   //详情页面弹窗配置
24
   //详情页面弹窗配置
23
   function toAudit(row,type) {
25
   function toAudit(row,type) {
48
   function exportRecommendCustomer() {
50
   function exportRecommendCustomer() {
49
     setExportLoding(true)
51
     setExportLoding(true)
50
     request({
52
     request({
51
-      ...apis.customer.customerRecommendRecommenderExport,
53
+      ...apis.searchHouse.exportHouse,
52
       responseType: 'blob',
54
       responseType: 'blob',
55
+      params: {
56
+        ...ref.current.getSearchData,
57
+      },
53
     }).then(response => {
58
     }).then(response => {
54
       console.log('exportRecommendCustomer: ', response)
59
       console.log('exportRecommendCustomer: ', response)
55
       download(response)
60
       download(response)
66
     const link = document.createElement('a')
71
     const link = document.createElement('a')
67
     link.style.display = 'none'
72
     link.style.display = 'none'
68
     link.href = url
73
     link.href = url
69
-    link.setAttribute('download', '找房需求.xlsx')
74
+    link.setAttribute('download', '海外需求.xlsx')
70
     document.body.append(link)
75
     document.body.append(link)
71
     link.click()
76
     link.click()
72
     setExportLoding(false)
77
     setExportLoding(false)
196
   ]
201
   ]
197
   const actionRender = () => {
202
   const actionRender = () => {
198
     return (
203
     return (
199
-      <Button type="danger" loading={exportLoding} onClick={() => exportRecommendCustomer()}>
204
+      <Button type='primary' loading={exportLoding} onClick={() => exportRecommendCustomer()}>
200
         导出
205
         导出
201
       </Button>
206
       </Button>
202
     );
207
     );
205
   return (
210
   return (
206
     <>
211
     <>
207
       <QueryTable
212
       <QueryTable
208
-        rowKey="recommendCustomer"
209
-        // recommendCustomer
213
+        rowKey="id"
214
+        ref={ref}
210
         api={apis.searchHouse.list}
215
         api={apis.searchHouse.list}
211
         searchFields={searchFields}
216
         searchFields={searchFields}
212
         columns={columns}
217
         columns={columns}

+ 83
- 68
src/pages/findRoom/rent/index.jsx View File

1
-import React, { PureComponent, useMemo, useState } from 'react';
1
+import React, { PureComponent, useMemo, useRef, useState } from 'react';
2
 import { Avatar, Button } from 'antd';
2
 import { Avatar, Button } from 'antd';
3
 import moment from 'moment';
3
 import moment from 'moment';
4
 import request from '../../../utils/request';
4
 import request from '../../../utils/request';
5
 import apis from '../../../services/apis';
5
 import apis from '../../../services/apis';
6
-import QueryTable from '@/components/QueryTable'
6
+import QueryTable from '@/components/QueryTable';
7
 import { router } from 'umi';
7
 import { router } from 'umi';
8
 import AuthButton from '@/components/AuthButton';
8
 import AuthButton from '@/components/AuthButton';
9
 
9
 
14
  * @returns
14
  * @returns
15
  */
15
  */
16
 
16
 
17
-
18
-
19
-
20
 function Recommend() {
17
 function Recommend() {
21
-  const [exportLoding, setExportLoding] = useState(false)
18
+  const ref = useRef();
19
+  const [exportLoding, setExportLoding] = useState(false);
22
   //详情页面弹窗配置
20
   //详情页面弹窗配置
23
-  function toAudit(row,type) {
21
+  function toAudit(row, type) {
24
     router.push({
22
     router.push({
25
       pathname: '/findRoom/rent/audit',
23
       pathname: '/findRoom/rent/audit',
26
       query: {
24
       query: {
27
         id: row.id,
25
         id: row.id,
28
-        type:type
26
+        type: type,
29
       },
27
       },
30
-    })
31
-
28
+    });
32
   }
29
   }
33
-//   function toSee(cuurentId) {
34
-//     router.push({
35
-//       pathname: '/home/recommend/auditCopy',
36
-//       query: {
37
-//         id: cuurentId,
38
-//       },
39
-//     })
40
-
41
-//   }
30
+  //   function toSee(cuurentId) {
31
+  //     router.push({
32
+  //       pathname: '/home/recommend/auditCopy',
33
+  //       query: {
34
+  //         id: cuurentId,
35
+  //       },
36
+  //     })
42
 
37
 
38
+  //   }
43
 
39
 
44
   /**
40
   /**
45
    *导出数据(推荐用户)
41
    *导出数据(推荐用户)
46
    *
42
    *
47
    */
43
    */
48
   function exportRecommendCustomer() {
44
   function exportRecommendCustomer() {
49
-    setExportLoding(true)
45
+    setExportLoding(true);
50
     request({
46
     request({
51
-      ...apis.customer.customerRecommendRecommenderExport,
47
+      ...apis.searchHouse.exportHouse,
52
       responseType: 'blob',
48
       responseType: 'blob',
53
-    }).then(response => {
54
-      console.log('exportRecommendCustomer: ', response)
55
-      download(response)
56
-    }).catch(error => {
57
-
49
+      params: {
50
+        ...ref.current.getSearchData,
51
+      },
58
     })
52
     })
53
+      .then(response => {
54
+        download(response);
55
+      })
56
+      .catch(error => {});
59
   }
57
   }
60
 
58
 
61
   function download(data) {
59
   function download(data) {
62
     if (!data) {
60
     if (!data) {
63
-      return
61
+      return;
64
     }
62
     }
65
-    const url = window.URL.createObjectURL(new Blob([data]))
66
-    const link = document.createElement('a')
67
-    link.style.display = 'none'
68
-    link.href = url
69
-    link.setAttribute('download', '找房需求.xlsx')
70
-    document.body.append(link)
71
-    link.click()
72
-    setExportLoding(false)
63
+    const url = window.URL.createObjectURL(new Blob([data]));
64
+    const link = document.createElement('a');
65
+    link.style.display = 'none';
66
+    link.href = url;
67
+    link.setAttribute('download', '租房需求.xlsx');
68
+    document.body.append(link);
69
+    link.click();
70
+    setExportLoding(false);
73
   }
71
   }
74
   const columns = [
72
   const columns = [
75
     {
73
     {
98
       key: 'gender',
96
       key: 'gender',
99
       align: 'center',
97
       align: 'center',
100
       // eslint-disable-next-line no-nested-ternary
98
       // eslint-disable-next-line no-nested-ternary
101
-      render: (_, record) => <><span>{record.gender === '1' ? '男' : record.gender === '2' ? '女' : '未知'}</span></>,
99
+      render: (_, record) => (
100
+        <>
101
+          <span>{record.gender === '1' ? '男' : record.gender === '2' ? '女' : '未知'}</span>
102
+        </>
103
+      ),
102
     },
104
     },
103
     {
105
     {
104
       title: '意向区域',
106
       title: '意向区域',
105
-      dataIndex: 'name',//意向区域
107
+      dataIndex: 'name', //意向区域
106
       key: 'name',
108
       key: 'name',
107
       align: 'center',
109
       align: 'center',
108
       // render: (_, record) => <><span>{record.area = '江苏省南京市秦淮区'}</span></>,
110
       // render: (_, record) => <><span>{record.area = '江苏省南京市秦淮区'}</span></>,
109
-
110
     },
111
     },
111
     {
112
     {
112
       title: '租房预算(元/月)',
113
       title: '租房预算(元/月)',
114
       key: 'maxPrice',
115
       key: 'maxPrice',
115
       align: 'center',
116
       align: 'center',
116
       // render:(_,record)=><span>{record='香颂.蔚澜半岛'}</span>
117
       // render:(_,record)=><span>{record='香颂.蔚澜半岛'}</span>
117
-
118
     },
118
     },
119
     {
119
     {
120
       title: '提交时间',
120
       title: '提交时间',
121
       dataIndex: 'createdTime',
121
       dataIndex: 'createdTime',
122
       key: 'createdTime',
122
       key: 'createdTime',
123
       align: 'center',
123
       align: 'center',
124
-      render: (_, record) => <><span>{record.createdTime && moment(record.createdTime).format('YYYY-MM-DD HH:mm:ss')}</span></>,
124
+      render: (_, record) => (
125
+        <>
126
+          <span>
127
+            {record.createdTime && moment(record.createdTime).format('YYYY-MM-DD HH:mm:ss')}
128
+          </span>
129
+        </>
130
+      ),
125
     },
131
     },
126
     {
132
     {
127
       title: '状态',
133
       title: '状态',
128
       dataIndex: 'status',
134
       dataIndex: 'status',
129
       key: 'status',
135
       key: 'status',
130
       align: 'center',
136
       align: 'center',
131
-      render: (_, record) => <><span>{record.status == 0 ? '待回访' : record.status == 1 ? '已回访' : record.status == 2 ? '无效' : ''}</span></>,
137
+      render: (_, record) => (
138
+        <>
139
+          <span>
140
+            {record.status == 0
141
+              ? '待回访'
142
+              : record.status == 1
143
+              ? '已回访'
144
+              : record.status == 2
145
+              ? '无效'
146
+              : ''}
147
+          </span>
148
+        </>
149
+      ),
132
     },
150
     },
133
     {
151
     {
134
       title: '操作',
152
       title: '操作',
138
 
156
 
139
       render: (_, record) => (
157
       render: (_, record) => (
140
         <>
158
         <>
141
-        {record.status == '0' ? (
142
-          <AuthButton name="house.rent.reply" noRight={null}>
143
-            <Button type="link" onClick={() => toAudit(record, 'edit')}>
144
-              审核
145
-            </Button>
146
-          </AuthButton>
147
-        ) : (
148
-          <AuthButton name="house.rent.detail" noRight={null}>
149
-            <Button type="link" onClick={() => toAudit(record, 'detail')}>
150
-              查看详情
151
-            </Button>
152
-          </AuthButton>
153
-        )}
154
-      </>
159
+          {record.status == '0' ? (
160
+            <AuthButton name="house.rent.reply" noRight={null}>
161
+              <Button type="link" onClick={() => toAudit(record, 'edit')}>
162
+                审核
163
+              </Button>
164
+            </AuthButton>
165
+          ) : (
166
+            <AuthButton name="house.rent.detail" noRight={null}>
167
+              <Button type="link" onClick={() => toAudit(record, 'detail')}>
168
+                查看详情
169
+              </Button>
170
+            </AuthButton>
171
+          )}
172
+        </>
155
       ),
173
       ),
156
     },
174
     },
157
-  ]
158
-
175
+  ];
159
 
176
 
160
   const searchFields = [
177
   const searchFields = [
161
     {
178
     {
185
       label: '状态',
202
       label: '状态',
186
       placeholder: '请选择状态',
203
       placeholder: '请选择状态',
187
       type: 'select',
204
       type: 'select',
188
-      placeholder: '全部',//错误
205
+      placeholder: '全部', //错误
189
       options: [
206
       options: [
190
         { label: '全部', value: '' },
207
         { label: '全部', value: '' },
191
         { label: '待回访', value: '0' },
208
         { label: '待回访', value: '0' },
192
         { label: '已回访', value: '1' },
209
         { label: '已回访', value: '1' },
193
-        { label: '无效', value: '2' }
194
-      ]
210
+        { label: '无效', value: '2' },
211
+      ],
195
     },
212
     },
196
-  ]
213
+  ];
197
   const actionRender = () => {
214
   const actionRender = () => {
198
     return (
215
     return (
199
-      <Button type="danger" loading={exportLoding} onClick={() => exportRecommendCustomer()}>
216
+      <Button type="primary" loading={exportLoding} onClick={() => exportRecommendCustomer()}>
200
         导出
217
         导出
201
       </Button>
218
       </Button>
202
     );
219
     );
205
   return (
222
   return (
206
     <>
223
     <>
207
       <QueryTable
224
       <QueryTable
208
-        rowKey="recommendCustomer"
209
-        // recommendCustomer
225
+        rowKey="id"
226
+        ref={ref}
210
         api={apis.searchHouse.list}
227
         api={apis.searchHouse.list}
211
         searchFields={searchFields}
228
         searchFields={searchFields}
212
         postData={data => {
229
         postData={data => {
213
-        
214
-          data.type='2'
230
+          data.type = '2';
215
           return data;
231
           return data;
216
         }}
232
         }}
217
         columns={columns}
233
         columns={columns}
218
         // actionRender={actionRender}
234
         // actionRender={actionRender}
219
       />
235
       />
220
-
221
     </>
236
     </>
222
   );
237
   );
223
 }
238
 }
224
 
239
 
225
-export default Recommend
240
+export default Recommend;

+ 16
- 0
src/services/apis.js View File

326
       url: `${prefix}/searchHouse`,
326
       url: `${prefix}/searchHouse`,
327
       action: 'admin.searchHouse.get',
327
       action: 'admin.searchHouse.get',
328
     },
328
     },
329
+    exportHouse: {
330
+      method: 'GET',
331
+      url: `${prefix}/exportHouse`,
332
+      action: 'admin.exportHouse.get',
333
+    },
334
+    // /admin?name=&phone=&status=
329
     //根据ID查询
335
     //根据ID查询
330
     IdHouse: {
336
     IdHouse: {
331
       method: 'GET',
337
       method: 'GET',
1823
       method: 'put',
1829
       method: 'put',
1824
       action: 'admin.publish.live.id.put',
1830
       action: 'admin.publish.live.id.put',
1825
     },
1831
     },
1832
+    livehome: {
1833
+      url: `${prefix}/home/live/:id`,
1834
+      method: 'put',
1835
+      action: 'admin.publish.live.id.put',
1836
+    },
1826
   },
1837
   },
1827
   taH5SampleManager: {
1838
   taH5SampleManager: {
1828
     taH5Demand: {
1839
     taH5Demand: {
2372
       url: `${prefix}/publish/:id`,
2383
       url: `${prefix}/publish/:id`,
2373
       action: 'admin.publish.id.put',
2384
       action: 'admin.publish.id.put',
2374
     },
2385
     },
2386
+    home: {
2387
+      method: 'PUT',
2388
+      url: `${prefix}/home/video/:id`,
2389
+      action: 'admin.publish.id.put',
2390
+    },
2375
     delete: {
2391
     delete: {
2376
       method: 'DELETE',
2392
       method: 'DELETE',
2377
       url: `${prefix}/video/:id`,
2393
       url: `${prefix}/video/:id`,