zlisen 3 years ago
parent
commit
b72a4c398f

+ 1
- 1
config/proxy.js View File

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

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

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

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

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

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

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

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

@@ -1,9 +1,9 @@
1
-import React, { PureComponent, useMemo, useState } from 'react';
1
+import React, { PureComponent, useMemo, useRef, useState } from 'react';
2 2
 import { Avatar, Button } from 'antd';
3 3
 import moment from 'moment';
4 4
 import request from '../../../utils/request';
5 5
 import apis from '../../../services/apis';
6
-import QueryTable from '@/components/QueryTable'
6
+import QueryTable from '@/components/QueryTable';
7 7
 import { router } from 'umi';
8 8
 import AuthButton from '@/components/AuthButton';
9 9
 
@@ -14,62 +14,60 @@ import AuthButton from '@/components/AuthButton';
14 14
  * @returns
15 15
  */
16 16
 
17
-
18
-
19
-
20 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 22
     router.push({
25 23
       pathname: '/findRoom/rent/audit',
26 24
       query: {
27 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 44
   function exportRecommendCustomer() {
49
-    setExportLoding(true)
45
+    setExportLoding(true);
50 46
     request({
51
-      ...apis.customer.customerRecommendRecommenderExport,
47
+      ...apis.searchHouse.exportHouse,
52 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 59
   function download(data) {
62 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 72
   const columns = [
75 73
     {
@@ -98,15 +96,18 @@ function Recommend() {
98 96
       key: 'gender',
99 97
       align: 'center',
100 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 106
       title: '意向区域',
105
-      dataIndex: 'name',//意向区域
107
+      dataIndex: 'name', //意向区域
106 108
       key: 'name',
107 109
       align: 'center',
108 110
       // render: (_, record) => <><span>{record.area = '江苏省南京市秦淮区'}</span></>,
109
-
110 111
     },
111 112
     {
112 113
       title: '租房预算(元/月)',
@@ -114,21 +115,38 @@ function Recommend() {
114 115
       key: 'maxPrice',
115 116
       align: 'center',
116 117
       // render:(_,record)=><span>{record='香颂.蔚澜半岛'}</span>
117
-
118 118
     },
119 119
     {
120 120
       title: '提交时间',
121 121
       dataIndex: 'createdTime',
122 122
       key: 'createdTime',
123 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 133
       title: '状态',
128 134
       dataIndex: 'status',
129 135
       key: 'status',
130 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 152
       title: '操作',
@@ -138,24 +156,23 @@ function Recommend() {
138 156
 
139 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 177
   const searchFields = [
161 178
     {
@@ -185,18 +202,18 @@ function Recommend() {
185 202
       label: '状态',
186 203
       placeholder: '请选择状态',
187 204
       type: 'select',
188
-      placeholder: '全部',//错误
205
+      placeholder: '全部', //错误
189 206
       options: [
190 207
         { label: '全部', value: '' },
191 208
         { label: '待回访', value: '0' },
192 209
         { label: '已回访', value: '1' },
193
-        { label: '无效', value: '2' }
194
-      ]
210
+        { label: '无效', value: '2' },
211
+      ],
195 212
     },
196
-  ]
213
+  ];
197 214
   const actionRender = () => {
198 215
     return (
199
-      <Button type="danger" loading={exportLoding} onClick={() => exportRecommendCustomer()}>
216
+      <Button type="primary" loading={exportLoding} onClick={() => exportRecommendCustomer()}>
200 217
         导出
201 218
       </Button>
202 219
     );
@@ -205,21 +222,19 @@ function Recommend() {
205 222
   return (
206 223
     <>
207 224
       <QueryTable
208
-        rowKey="recommendCustomer"
209
-        // recommendCustomer
225
+        rowKey="id"
226
+        ref={ref}
210 227
         api={apis.searchHouse.list}
211 228
         searchFields={searchFields}
212 229
         postData={data => {
213
-        
214
-          data.type='2'
230
+          data.type = '2';
215 231
           return data;
216 232
         }}
217 233
         columns={columns}
218 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,6 +326,12 @@ export default {
326 326
       url: `${prefix}/searchHouse`,
327 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 335
     //根据ID查询
330 336
     IdHouse: {
331 337
       method: 'GET',
@@ -1823,6 +1829,11 @@ export default {
1823 1829
       method: 'put',
1824 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 1838
   taH5SampleManager: {
1828 1839
     taH5Demand: {
@@ -2372,6 +2383,11 @@ export default {
2372 2383
       url: `${prefix}/publish/:id`,
2373 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 2391
     delete: {
2376 2392
       method: 'DELETE',
2377 2393
       url: `${prefix}/video/:id`,